perf(vk): add 128KB MRU non-wiping texture and handle-table memo (RX_VK_TEX_TABLE_FAST) #2970
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2970
Loading…
Reference in a new issue
No description provided.
Delete branch "siantm/Longshot:perf/vk-tex-table-memo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Speeds up sampled-texture descriptor resolution (
desc_ms/FT_TEX= 1.03–1.17 ms/frame in Market) with an L2-resident 128 KB non-wiping MRU cache and fast handle-table resolution (RX_VK_TEX_TABLE_FAST, default on1).Before this change,
tex_desc_memooccupied 512 KB (exceeding L2), wiped all entries viagen_tag++whenever any unrelated texture slot registered (reg_gen), scanned up to 4 ways without MRU promotion, and bypassed the memo completely wheneveris_table(d.handle_program != ~0U) was true — forcingtexture_view_of()+sampler_for()lookups for every element of handle-table arrays.With
RX_VK_TEX_TABLE_FAST:gpu/vk/tex_table_fast.hshrinks the 4-way memo to 512 sets × 4 ways × 64 B = 128 KB (alignas(64)) with swap-to-way-0 MRU promotion and non-wiping per-entryreg_seenvalidation (e.slot_ver == texture_slot_version(slot)checked only whene.reg_seen != cur_reg_gen; onlysamp_genchanges bumpgen_tag).is_table) resolve through consecutive-handle RLE fast-skip (prev_handle) and the 128 KB memo. A memo miss binds whatmain's slow path binds: the depth-aware dummy view for a texture with no view, thenguard_depth_comparison(#3032); the memo keeps what was bound after the guard, and nothing when the slot was registered again while its view was made.First read tex_table_fast.h and vk_draw.cpp.
Testing
Tested: Windows 11, NVIDIA GeForce RTX 4060 (driver 621.40, Vulkan 1.4).
python -X utf8 -I tests/test_vk_tex_table_fast.py --cxx clang++ --headers ...passed (128 KB layout, MRU promotion, non-wipingreg_gen, handle-table RLE, the key's depth bit, 3000-op A/B trace, source wiring, and 6 broken variants caught).python -X utf8 -I tests/test_hos_ab.py,tests/test_saveload_warm_cache.py,tests/test_flat_map.py,tests/test_tls_objects.py, andclang++ -fsyntax-onlyongpu/vk/vk_draw.cpppassed.RX_VK_TEX_TABLE_FAST=1, 25 s): 2016 frames,RUN_ERROR=None.RX_VK_TEX_TABLE_FAST=check, 25 s): 20,600,000+ checks (98.2%hits,2.58M+RLE skips),0mismatches,RUN_ERROR=None.HOS_AB(HOS_AB=RX_VK_TEX_TABLE_FAST=0,3,0, 5×90 s, 149 paired periods in Market): 5/5 runs won, zero crashes/errors.main@1e782fa4b(2026-12-03), the fast path moved onto #3032's depth-aware dummy view andguard_depth_comparison:tests/run_all.py --exactof 22 checks passed (Windows 11, llvm-mingw clang++):test_vk_tex_table_fast,test_tex_desc_memo,test_dummy_views,test_recording_admission,test_sampler_admission,test_hos_ab,test_switch_table,test_vk_desc_span_fast,test_vk_ubo_ssbo_fast,test_desc_clock,test_desc_counts,test_descriptor_array_census,test_drawn_page_map,test_fsr3fi_hud_capture,test_handle_table_arrays,test_hidden_mesh_depth,test_pick_tex_gen,test_prof_symbols,test_program_answer_domains,test_program_cache_reader,test_taau_env_lookup,test_target_layouts.main@0aeb6858(2026-12-03):test_vk_tex_table_fast,test_tex_desc_memo,test_recording_admission,test_sampler_admission,test_hos_abandtest_switch_tablepassed, andclang++ -fsyntax-onlyofgpu/vk/vk_draw.cpp. No game run on the rebased head.a4aa1ce(before #3032 on both sides): passed onwindows+nvidia,linux+nvidiaandintel; failed onwindows+amd(screenshot.max_diff0.42 on an RX 9070 XT, 0.96 on a Ryzen 5600G whose main pictures also differ from each other by 0.79),linux+radv(one PC's Market 1% low +22.5%) andsteamdeck(0.78, the PR's picture taken on a loading screen).RX_VK_TEX_TABLE_FAST=checklogged no mismatch.=0vs=1): -1.49% median FPS, within the run-to-run spread; p99 42.51 -> 44.52 ms.Still to test:
RX_VK_TEX_TABLE_FAST=checkon AMD, since the fast path changed with #3032 (@Beanstalk/by hand).mainagainst this head at player settings, in the Market and a heavy area (by hand).Measurements
Verdict: faster: +1.09% fps, the mean frame time -0.137 ms (95% interval +0.61% to +1.60% faster vs
RX_VK_TEX_TABLE_FAST=0).Setup: Windows 11, NVIDIA GeForce RTX 4060 (driver 621.40, Vulkan 1.4); Market, child (crowded), 50% res (768x432), output res 1280x720, frame generation Off, vsync Off, uncapped (
HOS_FPS_MAX=1000), queued in-runHOS_AB=RX_VK_TEX_TABLE_FAST=0,3,0across 5×90 s runs (149 paired periods; 16,300 ON frames vs 16,123 OFF frames).Baseline: both columns are one build,
ba8257aa7onperf/vk-tex-table-memo(main@495ed9fe2):RX_VK_TEX_TABLE_FAST=0(Before) againstRX_VK_TEX_TABLE_FASTunset (After).ba8257aaba8257aadesc_msdraw_msRisks
Set
RX_VK_TEX_TABLE_FAST=0to fall back to the 512 KBtex_desc_memopath (with legacyis_tableresolution), orRX_VK_TEX_TABLE_FAST=checkto verify live parity (0mismatches). Shader cache and pipeline cache are untouched.Assisted-by: Antigravity
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11 RTX 4060 Market CPU-bound 5x90s HOS_AB (+1.09% FPS, 95% CI +0.61%..+1.60%, desc_ms -4.87%, 0.1% Low +7.19%) and =check 0 mismatches on 20.6M checks
Possibly related, for context:
@review
Recommendation: Approve. The code is ready: only testing is left. The reported speedup compares two modes of this branch rather than the branch against main, so the gain and default are not yet established. Recommend approval; not approved on the forge.
The change adds a smaller per-thread texture descriptor memo and caches handle-table resolution. It adds a second cache and more invalidation and diagnostic logic; its player-facing performance benefit remains unproven against main.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:5041: The reported A/B does not measure the full change against main under player settings. (more on the line) Do: Measure the base and this head in interleaved runs at player settings in Market and another heavy area, reporting FPS, lows, frame times, descriptor time and RAM. (@fixdoes its part first: Avoid allocating the existing texture memo when only the new memo is needed, while preserving its separate SSBO cache.)gpu/vk/switches.def:813: The default-on renderer path has not been tested on the other affected Tier 1 systems. (more on the line) Do: Run parity and representative base-versus-head performance checks on the affected Tier 1 systems, including Steam Deck, before settling the default.@fixcan do L1.Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven. The reported five paired runs on an RTX 4060 show +1.09% FPS and 0.134 ms less descriptor time with the switch on versus off in the same PR build, but neither side is main. The run also uses 50% render resolution rather than the device's normal player settings.
Other systems: The path handles graphics and compute descriptors, direct handles and handle tables on both Windows and Linux. Live parity was reported only on Windows with an RTX 4060; AMD, Linux and Steam Deck results are outstanding. The additional memo is allocated per recording thread alongside the existing memo, so its RAM and cache effects also need assessment.
Switches: RX_VK_TEX_TABLE_FAST is added, default on; 0 selects the existing path and check compares paths. Its switch-table row is present, but the default is not established for the unmeasured Tier 1 systems or against main.
Reviewed:
ba8257aa7cagainst495ed9fe2a: Read the repository rules, PR template, standards, commit log, changed renderer diff, new cache header, changed switch and A/B wiring, and the relevant descriptor, texture and registration code. Read portions of the new test including its harness, mutations and runner; skimmed the remainder. The full vk_draw.cpp and test files were not read in full. docs/review-checklist.md was absent.; nothing run (a code review).Checked and fine:
Testing: No code, tests or project scripts were run, as requested. The supplied CI checks are still running.
Overlaps and merge order: Not determined; network access was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -810,6 +810,7 @@ SW(RX_VK_TEX_DESC_MEMO, kill, enum, "on (1): per-thread 4-way texture descriptorSW(RX_VK_TEX_MAX_DIM, hw, int, "2048; 1024 on Minimum settings (or Custom with none, where Auto picks Minimum) when the driver allows 4.5 GB or less (or an iGPU with 16 GB RAM or less)", "Width above which a big decoded ASTC texture leaves out its top mip levels.")SW(RX_VK_TEX_MAX_MB, tune, int, "1536 MB", "Size in MB down to which any texture leaves out top mip levels, whatever its width.")SW(RX_VK_TEX_SKIP_MB, hw, int, "64 MB; 8 on Minimum settings (or Custom with none, where Auto picks Minimum) when the driver allows 4.5 GB or less (or an iGPU with 16 GB RAM or less)", "Size as RGBA8, in MB, from which a decoded ASTC texture wider than the max width loses top levels.")SW(RX_VK_TEX_TABLE_FAST, kill, enum, "on (1): 128 KB L2-resident MRU non-wiping texture descriptor memo for both single and handle-table descriptors with RLE fast-skip", "=0 (or off, false, no): uses the legacy tex_desc_memo path; =check: runs both and logs any mismatch; any other value: on (HOS_AB may flip).")L2 (should fix): The default-on renderer path has not been tested on the other affected Tier 1 systems.
When: AMD on Windows and Linux, NVIDIA on Linux, and Steam Deck run the new descriptor and cache path without a reported parity or performance run.
Do: Run parity and representative base-versus-head performance checks on the affected Tier 1 systems, including Steam Deck, before settling the default.
@ -5037,6 +5038,50 @@ void tex_desc_memo_begin_recording() {VkSampler tex_desc_zero_sampler(bool is_depth) { return sampler_for(0, is_depth, false); }TLS_OBJECT(tex_table_fast_tls, tex_table_fast::State)L1 (should fix): The reported A/B does not measure the full change against main under player settings.
When: Both reported sides run this branch, and the on path allocates the new per-thread cache in addition to the existing cache. The numbers therefore omit any shared branch cost and do not establish the gain at the normal resolution and preset.
Do: Measure the base and this head in interleaved runs at player settings in Market and another heavy area, reporting FPS, lows, frame times, descriptor time and RAM.
ba8257aa7ca4aa1ce125Addressed the L1 allocation part in
a4aa1ce12:L1 (lazy legacy
tex_desc_memoallocation, separate SSBO cache):tex_desc_memo::SsboStateingpu/vk/tex_desc_memo.h(preservingState::ssboand forwarding overloads) and switchedbuild_descriptors()'s SSBO memo ingpu/vk/vk_draw.cpptoTLS_OBJECT(tex_desc_ssbo_tls, tex_desc_memo::SsboState).tex_desc_memo_begin_recording()now pre-allocates onlytex_desc_ssbo_tls()whentex_desc_memo_mode != 0, andbuild_descriptors()lazily allocatestex_desc_memo_tls()only whentm_mode != 0 && tf_mode == 0(e.g.RX_VK_TEX_TABLE_FAST=0,HOS_ABflip to0, orRX_VK_TEX_DESC_MEMO=check). WhenRX_VK_TEX_TABLE_FASTis active (1orcheck), the 512 KB legacy texture memo is never allocated.-Werror=sign-compare/-Werror=extrahazards ingpu/vk/tex_table_fast.handtests/test_vk_tex_table_fast.py, and added source-wiring checks forSsboStateand lazytex_desc_memo_tlsallocation.Verified locally on
a4aa1ce12:python -I tests/test_vk_tex_table_fast.py(clang++andC:\msys64\mingw64\bin\g++.exe, with and without Vulkan headersv1.4.345, all 6MUST_FAILvariants caught)clang++ -std=c++20 -fms-extensions -Wno-c++11-narrowing -DVK_NO_PROTOTYPES -DMKWVK_BUILDING -fsyntax-onlyongpu/vk/vk_draw.cpppython -I tests/test_hos_ab.py --cc clangpython -I tests/test_tls_objects.pypython -I tests/test_vk_braces.pyRemaining live checks: Interleaved base-vs-head player-settings measurement (L1) and Tier-1 parity/perf verification on AMD Windows/Linux, NVIDIA Linux, and Steam Deck (L2) are still pending on target hardware.
@review
@beanstalk
Beanstalk test farm · an earlier run: commit
a4aa1ce(the newer results are in a comment below)Commit
a4aa1ce· approved by HumanBean (reviewed) · dashboard⚠️ Note: The farm cannot measure descriptor time directly or reproduce the reported interleaved in-run A/B and its confidence interval; a roughly 1% gain may be smaller than run-to-run noise.
⚠️ Note: The parity scenario fails on mismatch logs but does not guarantee that a particular handle-table or depth-comparison case was reached.
⚠️ Note: macOS is not represented by an available farm target, and the fixed CPU-oriented settings are not each tester’s normal player settings.
Done (started 2026-12-02 16:02 UTC, last report 11:32 UTC). Comment
@Beanstalkto run it again.windows+nvidialinux+nvidiawindows+amdlinux+radvintelsteamdeckWhy it failed
windows+amd:default-performancescreenshot.max_diff:0.2 → 0.4; limit 0.2windows+amd:default-performancescreenshot.max_diff:0.8 → 1.0; limit 0.2linux+radv:default-performancemarket-perf.frametime_1pct_low_ms.max_delta_pct:24.1 → 29.5 (+22.5%); limit 15.0steamdeck:default-performancescreenshot.max_diff:0.3 → 0.8; limit 0.2Couldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.
intel, report 1:Insufficient frame-time evidence for 6 required comparison(s). See rule results.What was tested
What will be tested · AI plan (
gpt-6.1-terra)The farm will compare main with the default PR in Market and Hyrule Field, then run the PR’s live parity check in both places. Three performance starts per side and one parity start per side take about 50 minutes per tester, with uncapped, CPU-oriented settings. Frame times, FPS, memory, screenshots, and parity mismatch logs will be recorded; crashes, substantial frame-time regressions, picture differences, or mismatch logs fail the PR. Windows and Linux GPU targets include the Steam Deck. No tester online now matches linux+nvidia: that target waits for one.
check(PR only).market-entrance(settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switchesHOS_OUTPUT_RES=1280x720,RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market-perf for 30 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field-perf for 30 s (after 10 s warm-up); 3 runs on each side.market-entrance(settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switchesHOS_OUTPUT_RES=1280x720,RX_VK_AUTO_TUNE=0), then teleport to Market, measure market-check for 20 s (after 10 s warm-up), teleport to Hyrule Field, measure field-check for 20 s (after 10 s warm-up); 1 run on each side.Measurements on `windows+nvidia`, for the PR description
Verdict: pass on windows+nvidia (2 reports): no rule failed and no PR run crashed.
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+xess
NVIDIA GeForce GTX 980, 582.78.0Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 32 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu+windowNVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAMScene: default-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); live-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-performance: 3 game starts a side, market-perf 30 s after 10 s warm-up, field-perf 30 s after 10 s warm-up; live-parity: 1 game start a side, market-check 20 s after 10 s warm-up, field-check 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)495ed9fa4aa1ceRX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_TEX_TABLE_FASTcheckAs Markdown for the PR description:
Measurements on `linux+nvidia`, for the PR description
Verdict: pass on linux+nvidia (2 reports): no rule failed and no PR run crashed.
Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce GTX 1660 Ti, 620.73.4Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu+dlssNVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAMScene: default-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); live-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-performance: 3 game starts a side, market-perf 30 s after 10 s warm-up, field-perf 30 s after 10 s warm-up; live-parity: 1 game start a side, market-check 20 s after 10 s warm-up, field-check 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)495ed9fa4aa1ceRX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_TEX_TABLE_FASTcheckAs Markdown for the PR description:
Measurements on `windows+amd`, for the PR description
Verdict: fail on windows+amd (2 reports):
default-performance screenshot.max_difffailed.Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4
AMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM; 2: windows+amd+amd-proprietary+igpu+window+xessAMD Radeon(TM) Graphics, 2.0.279AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAMScene: default-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); live-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-performance: 3 game starts a side, market-perf 30 s after 10 s warm-up, field-perf 30 s after 10 s warm-up; live-parity: 1 game start a side, market-check 20 s after 10 s warm-up, field-check 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)495ed9fa4aa1ceRX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_TEX_TABLE_FASTcheckAs Markdown for the PR description:
Measurements on `linux+radv`, for the PR description
Verdict: fail on linux+radv (2 reports):
default-performance market-perf.frametime_1pct_low_ms.max_delta_pct (+22.5%)failed.Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM; 2: linux+amd+radv+igpuAMD Radeon 890M Graphics (RADV STRIX1), 26.1.99AMD Ryzen Z2 Extreme, 32 GB RAMScene: default-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); live-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-performance: 3 game starts a side, market-perf 30 s after 10 s warm-up, field-perf 30 s after 10 s warm-up; live-parity: 1 game start a side, market-check 20 s after 10 s warm-up, field-check 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)495ed9fa4aa1ceRX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_TEX_TABLE_FASTcheckAs Markdown for the PR description:
Measurements on `intel`, for the PR description
Verdict: pass on intel (2 reports): no rule failed and no PR run crashed.
Hardware: 1: windows+intel+intel-proprietary+igpu+window
Intel(R) UHD Graphics 630, 0.404.2115Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM; 2: linux+intel+anv+igpuIntel(R) Graphics (RKL GT1), 26.2.411th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAMScene: default-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); live-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-performance: 3 game starts a side, market-perf 30 s after 10 s warm-up, field-perf 30 s after 10 s warm-up; live-parity: 1 game start a side, market-check 20 s after 10 s warm-up, field-check 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)495ed9fa4aa1ceRX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_TEX_TABLE_FASTcheckAs Markdown for the PR description:
Measurements on `steamdeck`, for the PR description
Verdict: fail on steamdeck (2 reports):
default-performance screenshot.max_difffailed.Hardware: 1: linux+amd+radv+igpu+handheld
AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99AMD Custom APU 0405, 16 GB RAM; 2: linux+amd+radv+igpu+handheldAMD Custom GPU 0405 (RADV VANGOGH), 26.1.99AMD Custom APU 0405, 16 GB RAMScene: default-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); live-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-performance: 3 game starts a side, market-perf 30 s after 10 s warm-up, field-perf 30 s after 10 s warm-up; live-parity: 1 game start a side, market-check 20 s after 10 s warm-up, field-check 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)495ed9fa4aa1ceRX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (p99) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· field-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· market-check · frame time (worst 1%) (ms)RX_VK_TEX_TABLE_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_TEX_TABLE_FASTcheckAs Markdown for the PR description:
The testers' hardware
windows+nvidiaNVIDIA GeForce GTX 980, 582.78.0Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 32 GB RAMwindows+nvidiaNVIDIA GeForce RTX 4070 Ti SUPER, 621.14.0AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAMlinux+nvidiaNVIDIA GeForce GTX 1660 Ti, 620.73.4Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAMlinux+nvidiaNVIDIA GeForce RTX 5070 Laptop GPU, 620.85.2AMD Ryzen AI 9 365 w/ Radeon 880M, 32 GB RAMwindows+amdAMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAMwindows+amdAMD Radeon(TM) Graphics, 2.0.279AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAMlinux+radvAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAMlinux+radvAMD Radeon 890M Graphics (RADV STRIX1), 26.1.99AMD Ryzen Z2 Extreme, 32 GB RAMintelIntel(R) UHD Graphics 630, 0.404.2115Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAMintelIntel(R) Graphics (RKL GT1), 26.2.411th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAMsteamdeckAMD Custom GPU 0405 (RADV VANGOGH), 26.1.99AMD Custom APU 0405, 16 GB RAMsteamdeckAMD Custom GPU 0405 (RADV VANGOGH), 26.1.99AMD Custom APU 0405, 16 GB RAMRecommendation: Approve. The code is ready: only testing is left. The reported 1.09% FPS gain compares two modes of the earlier PR build, so the full change's gain against main remains unproven. Tier 1 parity and performance runs are also pending. Recommend approval; not approved on the forge.
The change caches texture descriptor resolution, including handle tables, to reduce renderer CPU work. The revision avoids allocating the legacy texture memo when the fast path alone is needed and retains a separate SSBO cache; the full performance benefit and platform costs still need measurement.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:5041: The full change has not been measured against main at player settings. When: The reported switch-off comparison includes PR code and predates the allocation revision, so it cannot establish the current head's gain against main. Do: Run interleaved main-versus-head measurements in the target and heavy scenes at the normal preset and native resolution, reporting frame-time and low-FPS results. (@fixdoes its part first: Avoid allocating the existing texture memo when only the new memo is needed, while preserving its separate SSBO cache.)gpu/vk/switches.def:813: The default-on renderer path has not been tested on the other affected Tier 1 systems. When: AMD on Windows and Linux, NVIDIA on Linux, and Steam Deck run the new descriptor and cache path without a reported parity or performance run. Do: Run parity and representative base-versus-head performance checks on the affected Tier 1 systems, including Steam Deck, before settling the default.@fixcan do L1.Since the last review (on
ba8257aa7c)Still open: L1 (The full change has not been measured against main at player settings.); L2 (The default-on renderer path has not been tested on the other affected Tier 1 systems.)
Checks: Still running: 10 checks.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven against main at player settings. The author's five Windows RTX 4060 in-run comparisons on the earlier PR build report +1.09% FPS, -0.134 ms descriptor time and +0.82% 1% low, but compare the switch off versus on within that build.
Other systems: The renderer path can affect Windows and Linux across GPU vendors, including Steam Deck. Windows RTX 4060 has a reported live parity run with more than 20.6 million checks and zero mismatches; AMD Windows and Linux, NVIDIA Linux and Steam Deck results remain pending.
Switches: RX_VK_TEX_TABLE_FAST is added, defaults to 1, supports 0 for the legacy path and check for live parity checks, and has a switches.def row. The default's suitability across affected systems remains unproven.
Reviewed:
a4aa1ce125against495ed9fe2a: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the changed memo headers and the changed descriptor code and its callers. Skimmed the test diff and switch table; vk_draw.cpp and the test files were not read in full. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run the project were executed. The author reports game-free checks and a Windows live parity run; CI is still running.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
AMD Lab Market A/B on PR head
a4aa1ce12590, usingRX_VK_TEX_TABLE_FAST=0andRX_VK_TEX_TABLE_FAST=1on the same build.Within the run-to-run spread. Median average FPS changed by -1.49%.
0)1)Market (child), headless Linux 7.3.3-1-cachyos, Core i7-9700K, Radeon RX 580 with Mesa RADV 3:26.2.6-1, 1280x720 output and 50% (640x360) render scale, uncapped with V-Sync and frame generation off. Three alternating pairs, 40 seconds per capture after warm-up.
After warm-up, the harness still flagged pipeline or shader activity in 32 / 29 / 37 frames on side A and 48 / 42 / 15 on side B across the three captures. The FPS and tail numbers include those frames.
a4aa1ce125235e44e956Beanstalk test farm
Commit
235e44e· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.Rebased onto
main@0aeb6858(head235e44e9). The default stays on. The description's Testing is updated.Rebase: a real conflict with #3032, fixed. #3032 (
b6e38a13c, onmainsince 2026-12-03) changed the slow path: a texture with no view gets a depth-aware dummy view, and a depth-comparison sampler goes throughguard_depth_comparison. Rebased as it was, this PR's fast path would have skipped both, because it still used the colour dummy view and the PR's own table-only depth-format rule. Now:guard_depth_comparison(raw_view, tex, last_view_format, d.is_depth, is_table, p.key, k).gpu/vk/tex_table_fast.h.tests/test_vk_tex_table_fast.py's oracle follows the new rule, and its broken variant aimed at the old rule is replaced bykey_ignores_depth.tests/recording_admission_test.cppstubs the new recording hook.Farm results (
a4aa1ce, before #3032 on both sides):steamdeck(screenshot.max_diff0.78): the PR's Market picture is a loading screen, so the capture came too early. It doesn't show the scene.windows+amd, RX 9070 XT: Field diff 0.42 against main's own 0.11. The PR's picture is darker, but I can't tell a rendering difference from fog or time of day in it.windows+amd, Ryzen 5600G: the PR's Field pictures are badly broken (sky showing through the world, diffs 0.96 and 0.55). That PC's main pictures also differ from each other by 0.79 in the Market. I could not tie the breakage to the PR from the code. This one needs a run of the rebased head on that PC.linux+radv: one PC's Market 1% low rose 24.1 → 29.5 ms (+22.5%); the otherlinux+radvPC passed.RX_VK_TEX_TABLE_FAST=checklogged no mismatch.AMD Lab, RX 580: -1.49% median FPS, within the run-to-run spread (p99 42.51 → 44.52 ms). I'm not reading that as slower. Only one system shows a tail regression (the farm's RADV PC above), so the default stays on.
L1 / L2 (main against head at player settings, other Tier 1 systems): still open. I can't run the game here (one Windows RTX 4060 PC, a shared queue). Because the fast path changed with #3032, the next useful runs are
@Beanstalkon this head (windows+amdespecially) and anRX_VK_TEX_TABLE_FAST=checkrun on AMD.Tested on the rebased head (Windows 11, llvm-mingw clang++):
tests/run_all.py --exactoftest_vk_tex_table_fast,test_tex_desc_memo,test_recording_admission,test_sampler_admission,test_hos_ab,test_switch_table: 6 passed, 0 failed.clang++ -fsyntax-onlyofgpu/vk/vk_draw.cpp, with the build plan's own compile command: no errors.main@1e782fa4b(already with #3032), 22 checks that read the changed code passed; the description lists them.No game run on the rebased head.
@siantm only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.Recommendation: Request changes. This is a default-on renderer path, and its current head has never run in the game. The last Test Farm run (
a4aa1ce, before #3032) failed on Windows AMD, Linux RADV and the Steam Deck, and nobody has explained those failures. The only gain is +1.09% fps, from one RTX 4060 with the switch off against on. The PR also conflicts withmainingpu/vk/vk_draw.cpp.For a player, this is meant to save a little CPU time in the renderer when it binds sampled textures: about 0.13 ms of
desc_msa frame in the Market. It adds a second texture-descriptor memo (128 KB a thread) and moves handle-table arrays onto it. On the code side it adds a second memo besidetex_desc_memo, a second check mode and a copy of the c2 handle reader, so it only pays off if the gain is shown againstmain.Does it help: Unproven. The +1.09% fps (95% CI +0.61..+1.60%) and
desc_ms-0.134 ms come from one build,ba8257aa7, with the switch off against on: one Windows RTX 4060, 50% render scale at 768x432, 5x90 s HOS_AB. Neither side ismain, and that build is two rebases old. On the AMD Lab RX 580 (RADV) it was -1.49% median fps (within the spread), with p99 going 42.51 -> 44.52 ms. On the farm ata4aa1ce, onelinux+radvPC's Market 1% low got worse, 24.1 -> 29.5 ms (+22.5%). There is nomain-against-head run at player settings on any PC.Other systems: every GPU and OS runs this path by default. On Windows AMD, the 5600G's Field pictures were broken (sky showing through the world, diffs 0.96/0.55) and the RX 9070 XT's were darker (0.42 against main's own 0.11). The author couldn't tie either to the code, and neither has been re-run. The Steam Deck capture was a loading screen, so it shows nothing either way.
=checklogged no mismatch anywhere, but the farm itself notes the parity scenario may never reach a handle-table or depth-comparison case. Since then the fast path has changed for #3032 (depth-aware dummy view,guard_depth_comparisonon a miss), and that version has no game run at all.Switches:
RX_VK_TEX_TABLE_FAST(kill, enum), default on (1);0gives the legacy memo,checkruns both and logs mismatches. It has itsswitches.defrow and is wired into HOS_AB. Turning it on for everyone rests on one NVIDIA PC. AMD's only numbers are flat to slightly worse, and its farm failures are open, so the default isn't measured per platform yet.Reviewed:
235e44e95against0aeb68589(its base;mainis nowbe4942212). Read in full:gpu/vk/tex_table_fast.hand thevk_draw.cppdiff, plus the slow path it mirrors: thebuild_descriptorstexture loop,guard_depth_comparison,desc_fp_note,tex_desc_touch_slowand thetm_modegate. Also thetex_desc_memo.hdiff (SsboState),switches.def,test_hos_ab.pyandrecording_admission_test.cpp. Not read:tests/test_vk_tex_table_fast.py(748 lines). Nothing run.Fixed in this review: nothing (nothing pushed; the conflict is left for the author).
Checked and fine:
slot_ver << 20 | slot) is the same onedesc_fp_notepushes.draw_sampled,depth_samplesandst_dummy_texturesmatch the slow path, both on a run-length (RLE) skip and on a hit.has_raw_view.texture_view_of, thenguard_depth_comparison, then the depth-awaredummy_view. The memo keeps what was bound after the guard.storeis skipped when the slot was registered again, or the sampler generation moved, while the view was being made.tf_moderuns only whentm_mode == 1and!log_img_wanted, sodump_on,RX_VK_WATCH_PROG, sampler watching,RX_VK_LOG_IMGandRX_VK_TEX_DESC_MEMO=0/checkstill take the slow path.TLS_OBJECT), and the counters arethread_local.SsboStatekeeps the SSBO memo, and the 512 KB legacy memo is now allocated only when the legacy path runs.tex_table_touch_slowmatches the legacytex_desc_touch_slow, plus the non-wiping generation sync.Entryis 64 B, so the memo is 512x4x64 B = 128 KB.Blocking
gpu/vk/vk_draw.cpp: conflicts withmain@be4942212(git merge-treereports a content conflict in this file). Rebase, then re-run the checks the description lists.gpu/vk/switches.def:664(default on): the head as it stands has never run in the game, and the last farm run failed onwindows+amd,linux+radvandsteamdeckwithout an explanation. Run@Beanstalkon the rebased head (windows+amdespecially, plus an=checkrun on AMD). Until the AMD pictures and the RADV 1% low are explained, or shown not to come from this PR, this can't ship default-on. If they do come from it, make the default per vendor or off.mainagainst this head, not switch off against on. Use interleaved runs at player settings (native or the usual render scale) in the Market and one more heavy area, with lows. A ~1% gain inside a p99 regression on AMD isn't a gain yet.Suggestions
gpu/vk/tex_table_fast.h:31-58:c2_read_word,c2_can_readandc2_handle_ofare copies oftex_desc_memo.h:90-115. Calltex_desc_memo::c2_*instead, so the two can't drift apart.trace_tex_hitis set only on the slow path (vk_draw.cpp:6367). Before this PR, handle tables always took that path. With the switch on they never do, so the trace no longer sees textures sampled through a table. Add the trace check to thetf_modegate, or settrace_tex_hiton a hit.main's memo already has a non-wiping sync (tex_desc_memo::sync_generations(..., non_wiping), driven bydesc_span_fast_on()). Say when "wiped all entries whenever any unrelated texture slot registered" still holds, so the gain is credited to the right part.Testing: By the author on Windows 11 with an RTX 4060: game-free checks on the rebased head (6 checks plus
clang++ -fsyntax-only; 22 on the previous base), an=checkrun on the older head (20.6M checks, 0 mismatches) and the 5x90 s HOS_AB. The farm rana4aa1ce(pre-#3032): pass on Windows NVIDIA, Linux NVIDIA and Intel; fail on Windows AMD, Linux RADV and the Steam Deck. The AMD Lab ran an RX 580 A/B ona4aa1ce. Missing, and holding the merge: any game run of this head; a farm run of this head;mainagainst the head at player settings.Overlaps and merge order: #3080, #3304, #3303, #3116, #3049 and #3046 are open; check each for the same
build_descriptorstexture loop before rebasing. #2055 (WIP) changes texture slot-version lookups in the same function, and #2920 (merged) is the memo this builds on. Whichever of these lands first, the others rebase onto it. This one has to rebase anyway.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.