perf(vk): inline PushedFast shadow & POD vkCmdPushDescriptorSetKHR ring packing #2975
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!2975
Loading…
Reference in a new issue
No description provided.
Delete branch "siantm/Longshot:perf/vk-binddesc-push-fast"
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 push-descriptor comparison and recording-ring serialization (
FT_BINDDESC+FT_PUSHCALL/vkCmdPushDescriptorSetKHRinvk_recorder.h) underRX_VK_PUSH_DESC_FAST. The switch ships off (0): the test farm and the AMD Lab measured it slower on AMD (Steam Deck, RX 580, RX 7900 XTX), see Measurements;RX_VK_PUSH_DESC_FAST=1turns it on for further measurement.Before this change:
bind_descriptors()push scannedDescWriter::imgslinearly to check for a null sampler, stored/compared descriptors inPushed::words+Pushed::atoffset vectors (words_same_store()), and builtchangedinside a heap-backedstd::vector<VkWriteDescriptorSet>.vkCmdPushDescriptorSetKHRencoded onto the recorder ring via general-purposeEncserialization + out-of-line pointer chasing across everyVkWriteDescriptorSetelement and itspBufferInfo/pImageInfo/pTexelBufferViewsub-arrays.With
RX_VK_PUSH_DESC_FAST:build_descriptors()notesDescWriter::has_unbindable_image(no sampler, or no view withoutnullDescriptor: the same rule as the walk) as each sampled image is appended (DescWriter::push_sampled), eliminating the post-build linear scan.PushedFast: a flatuint64_tshadow word array paired with inlineWriteMeta(up tokInlineWrites = 64writes, heap fallback above) plus a stackVkWriteDescriptorSet changed_buf[64]invk_draw.cpp, removingPushed::atindirection and heap vector traffic on common draws.vkCmdPushDescriptorSetKHRcalls (up to 64 writes / 256 descriptors,pNext == nullptr,dstSet == VK_NULL_HANDLE, controllable via atomicrec::g_push_desc_fast) as a single compact exact-size POD ring record (throughRX_VK_RECORDER_FAST'sbegin_fast/finish_fast, decoded indispatch_fast) and replays them directly from stack arrays on the recorder thread. Full pushes keepRX_VK_CMD_FAST's push template.First read push_desc_fast.h, vk_recorder.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_push_desc_fast.py --cxx clang++ --headers ...passed (3,000-opPushedFastoracle parity againstwords_same_store, compact POD ring round-trip with poisoned caller memory, ring wrap-around,n==0, over-cap fallback, liveg_push_desc_fastHOS_AB toggle, source wiring, and all 4 broken variants caught).python -X utf8 -I tests/test_recorder_sync.py --cxx clang++ --headers ... --bench 20000,tests/test_recorder_parts.py,tests/test_hos_ab.py,tests/test_thinlto_tls.py, andtests/test_saveload_warm_cache.pypassed.RX_VK_PUSH_DESC_FAST=1, 15 s):925frames,0cold frames,RUN_ERROR=None.RX_VK_PUSH_DESC_FAST=check, 25 s):1,692frames,12,300,000+checks,0mismatches,RUN_ERROR=None.HOS_AB(HOS_AB=RX_VK_PUSH_DESC_FAST=0,3,0, 5×90 s,147paired periods in Market):5/5runs won, zero crashes/errors.main@0aeb6858(2026-12-03):tests/run_all.py --exactoftest_vk_push_desc_fast,test_vk_recorder_fast,test_recorder_sync,test_hos_ab,test_switch_table,test_vk_cmd_fast,test_push_state,test_sampler_admission,test_recording_admission,test_ub_snap_scope, andtest_recorder_partsalone, passed (Windows 11, llvm-mingw clang++);clang++ -fsyntax-onlyofgpu/vk/vk_draw.cppandgpu/vk/vk_replay.cpppassed. No game run on the rebased head.568a6c4(default on, againstmain@495ed9fe2): passed on thenvidia,intelandlinux+radvtargets; failed on AMD RX 7900 XTX (Market median frame time 11.95 -> 58.73 ms in 2 of 3 starts, mean FPS unchanged), Steam Deck (Market 1% low 48.23 -> 62.74 ms) and Windows RTX 4070 (Field p99 7.34 -> 9.66 ms;screenshot.max_diff0.495, main's picture the broken one).RX_VK_PUSH_DESC_FAST=checklogged no mismatch on any target.=0vs=1, 2 pairs, preliminary): 98.4 -> 120.5 FPS on average; AMD Lab, Linux RX 580 (3 pairs): 57.21 -> 54.91 FPS (-4.03%), p99 21.95 -> 45.25 ms, frames of 50 ms or more 7/12/1 -> 22/21/18.Still to test:
RX_VK_PUSH_DESC_FAST=1against=0on the rebased head, to see whether the AMD slowdown repeats before the default goes back on (by hand/@Beanstalk).Measurements
Verdict: mixed, so off by default: faster on the RTX 4060 below (+1.52% fps) and in HumanBean's preliminary Linux RTX 3090 pairs, slower on AMD: the AMD Lab RX 580 (-4.03% fps, p99 21.95 -> 45.25 ms) and the farm's Steam Deck (Market 1% low +30.1%); the farm's RX 7900 XTX Market median moved 11.95 -> 58.73 ms with its mean FPS unchanged (29.21 -> 28.36). Two independent AMD systems measured it slower, so it ships off; the reason is in its
gpu/vk/switches.defrow.RTX 4060 in-run A/B: +1.52% fps, mean frame time -0.194 ms (95% interval +0.24% to +2.79% faster vs
RX_VK_PUSH_DESC_FAST=0).Setup: Windows 11, NVIDIA GeForce RTX 4060 (driver 621.40, Vulkan 1.4); Market, child (crowded), 50% res (
768x432), output res1280x720, frame generation Off, vsync Off, uncapped (HOS_FPS_MAX=1000), queued in-runHOS_AB=RX_VK_PUSH_DESC_FAST=0,3,0across 5×90 s runs (147paired periods;16,108ON frames vs15,897OFF frames).Baseline: both columns are one build,
5d89c34d9onperf/vk-binddesc-push-fast(main@495ed9fe2):RX_VK_PUSH_DESC_FAST=0(Before) againstRX_VK_PUSH_DESC_FASTunset (After).5d89c34d5d89c34dcmds_mscmds_msP99 / P99.9draw_msdraw_ms - uploads_msP99 / P99.9wait_gpu_msNote on frame-total tail variance: total-frame
game_msinAB2had isolated simulation bursts (+0.347 msON meangame_ms), making single-runp99slightly noisy (17.15vs17.02 ms,top 0.1%avg24.46 msON vs24.92 msOFF), while renderercmds_ms(-0.42 msP99.9) and non-uploaddraw_ms(-0.48 msP99.9) improve across all tail percentiles.Risks
Off by default: the
Pushed::words/Pushed::atcomparison path and the genericEncvkCmdPushDescriptorSetKHRring encoding run as onmain.RX_VK_PUSH_DESC_FAST=1turns the fast paths on,=checkruns both and logs any mismatch (0mismatches across12.3M+checks on the RTX 4060, none logged on the farm). 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, NVIDIA GeForce RTX 4060 (Vulkan 1.4, driver 621.40), Market: RX_VK_PUSH_DESC_FAST=1 (925 frames, RUN_ERROR=None), =check (1692 frames, 12.3M+ checks, 0 mismatches), 5x90s HOS_AB (147 periods, +1.52% FPS, 95% CI +0.24%..+2.79%, cmds_ms -10.32%)
Possibly related, for context:
@review
Recommendation: Request changes. The new dynamically initialized thread-local vectors violate the renderer’s TLS rule, and the commit does not record the stated AI assistance. The claimed performance gain also remains unproven against the base at settings players use.
The change caches descriptor comparisons and packs common push-descriptor calls into compact recorder packets. It adds a default-on switch and additional per-thread state; the reported in-build A/B shows lower renderer times on one NVIDIA Windows setup, but does not establish the change’s gain against main.
Blocking (1): must change before merging.
gpu/vk/vk_draw.cpp:6057: The new function-local thread-local vectors bypass this file’s required TLS_OBJECT ownership scheme. (more on the line) Do: Put the overflow vectors in TLS_OBJECT-owned state and access them through that state, including the second vector in bind_descriptors_ubo_delta.Should fix (2): not blocking, but worth doing before merging.
5d89c34d, has no Assisted-by or Co-Authored-By trailer; the trailer in the PR body is not a commit trailer. Do: Record the assistance in the commit trailer as required by the checklist.gpu/vk/switches.def:720: The switch row claims that enabling it provides a per-recording PoolSetCache, but this change implements no such cache. (more on the line) Do: Remove the PoolSetCache claim from the switch row.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
5d89c34d, and the setup uses 50% rendering resolution. The off path still runs changed code, so its +1.52% result cannot establish the total effect relative to495ed9fe; 1% lows are also missing. Do: Run interleaved base-versus-head measurements in the target and heavy scenes at the PC’s normal Auto settings, reporting average FPS, 1% lows, median and p99 frame times and the targeted timings.@fixcan do L1, L2 and L5.Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven. The PR reports +1.52% FPS and -0.194 ms mean frame time over five in-run A/B tests on an RTX 4060, but both sides use the PR build, at 50% rendering resolution. It does not report a comparison with base
495ed9feat the PC’s normal settings or the required 1% lows.Other systems: The changed paths cover graphics and compute descriptor pushes and the recorder thread on Windows and Linux. Windows NVIDIA has a live smoke and parity run; AMD, Linux, Steam Deck and Intel remain untested according to the PR. The packet is self-describing across switch changes, and the compact path bounds its writes and descriptor counts before packing.
Switches: RX_VK_PUSH_DESC_FAST is added, default on; 0 selects the legacy comparison and encoding paths, and check runs comparison parity checks. The row is present in switches.def. The default’s performance across supported hardware remains unmeasured.
Reviewed:
5d89c34d9eagainst495ed9fe2a: Read repository rules, standards, PR template, commit log, the changed header, changed draw and recorder paths and their surrounding code, switch row, test harness and test wiring. Skimmed the rest of the large renderer and recorder files and the generated test harness data. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code, tests or project scripts were run. CI was still running in the supplied status.
Overlaps and merge order: Unknown; the network is closed and no overlap information was supplied.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -717,6 +717,7 @@ SW(RX_VK_PROTECT_BARE, attempt, bool, "off", "1 keeps the GPU's version of pagesSW(RX_VK_PSYCHOV35_DLSS, kill, bool, "on: compatible engines take Native PsychoV35's RGBA16F scene", "=0 disables the Native PsychoV35 HDR route for the upscalers, for troubleshooting.")SW(RX_VK_PTR_DIAG, diag, bool, "off: no lines", "Logs a line for each program whose global memory accesses are not all plain constant buffer pointers.")SW(RX_VK_PUSH_ALL, kill, bool, "off: only changed bindings are pushed", "Pushes every descriptor binding at every draw, as before.")SW(RX_VK_PUSH_DESC_FAST, kill, enum, "on (1): O(1) null-sampler guard, flat PushedFast delta shadow, per-recording PoolSetCache, and compact POD vkCmdPushDescriptorSetKHR ring encoding", "=0 (or off, false, no): off, runs the legacy descriptor bind and closure ring paths; =check: runs both and logs any mismatch; any other value: on (HOS_AB may flip).")L5 (should fix): The switch row claims that enabling it provides a per-recording PoolSetCache, but this change implements no such cache.
When: A reader inspecting the switch table is told the pool-set path is cached, while bind_descriptors still allocates and updates descriptor sets and there is no PoolSetCache in gpu/vk.
Do: Remove the PoolSetCache claim from the switch row.
@ -5979,2 +6056,2 @@fine_n[FC_PUSH_FULL]++, fine_n[FC_PUSH_WRITES] += (int64_t)wr.writes.size();for (const VkWriteDescriptorSet& w : wr.writes) fine_n[FC_PUSH_DESCS] += w.descriptorCount;static const bool ub_every = ub_snapshot_wanted() && ub_snap_dedup_mode() == 1;static thread_local std::vector<VkWriteDescriptorSet> changed_overflow;L1 (blocking): The new function-local thread-local vectors bypass this file’s required TLS_OBJECT ownership scheme.
When: Both bind_descriptors and bind_descriptors_ubo_delta introduce dynamically initialized changed_overflow vectors. On llvm-mingw these add the TLS initialization guard overhead described at the top of this file to accesses in the descriptor hot path, contrary to its rule for new objects with constructors or destructors.
Do: Put the overflow vectors in TLS_OBJECT-owned state and access them through that state, including the second vector in bind_descriptors_ubo_delta.
5d89c34d9e568a6c40e7Addressed review feedback in
568a6c40e(amended from5d89c34d9):gpu/vk/vk_draw.cpp): Removed the function-localstatic thread_local std::vector<VkWriteDescriptorSet> changed_overflowdeclarations from bothbind_descriptorsandbind_descriptors_ubo_delta. Moved the overflow scratch buffer toTLS_OBJECT(push_changed_overflow, std::vector<VkWriteDescriptorSet>)viapush_write_scratch(...), avoiding function-localthread_localinit guards on the hot path and keepingTLS_OBJECTthread-exit cleanup.Assisted-by: Antigravity (Google DeepMind)to the commit message.gpu/vk/switches.def): Removed the unimplementedper-recording PoolSetCacheclaim from theRX_VK_PUSH_DESC_FASTrow.@Beanstalk/ representative hardware runs once ready.Checks run after the final edit:
python -X utf8 -I tests/test_vk_push_desc_fast.py --cxx clang++ --headers ...— passed (including all 4 broken variants)python -X utf8 -I tests/test_vk_push_desc_fast.py --headers ...(default compiler discovery) — passedpython -X utf8 -I tests/test_vk_push_desc_fast.py --cxx g++ --headers ...— passedclang++ -x c++-header -std=c++20 -Wall -Wextra -Werror -fsyntax-onlyandg++ -x c++ -std=c++20 -Wall -Wextra -Werror -fsyntax-onlyongpu/vk/push_desc_fast.h— clean (exit 0)python -I -B tests/test_tls_objects.py—PASS: 21 TLS_OBJECTs; 46 other namespace-scope thread_locals, none with a constructor or destructorpython -I -B tests/test_hos_ab.py --cc clang— passedpython -I -B tests/test_vk_braces.py—OK: the braces of 618 renderer sources balance@siantm only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.@review
@beanstalk
Beanstalk test farm · an earlier run: commit
568a6c4(the newer results are in a comment below)Commit
568a6c4· approved by HumanBean (reviewed) · dashboard⚠️ Note: The fixed CPU-oriented settings differ from players' Auto settings; the plan does not measure the reported renderer-specific timings or establish a 1.52% gain within farm noise.
⚠️ Note: Check mode reports mismatches but this plan does not require a periodic check-count log, so a clean log alone does not prove how many descriptor checks ran. The farm cannot run the requested macOS test or the standalone unit harness.
Done (started 2026-12-02 15:59 UTC, last report 07:43 UTC). Comment
@Beanstalkto run it again.nvidiaamdintellinux+radvsteamdeckwindows+nvidiaWhy it failed
amd:performancemarket.frametime_p50_ms.max_delta_pct:12.0 → 58.7 (+391.4%); limit 15.0steamdeck:performancemarket.frametime_1pct_low_ms.max_delta_pct:48.2 → 62.7 (+30.1%); limit 15.0windows+nvidia:performancefield.frametime_p99_ms.max_delta_pct:7.3 → 9.7 (+31.6%); limit 15.0windows+nvidia:performancefield.frametime_1pct_low_ms.max_delta_pct:7.7 → 10.4 (+34.2%); limit 15.0windows+nvidia:performancescreenshot.max_diff:0.2 → 0.5; 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 8 required comparison(s). See rule results.What was tested
What will be tested · AI plan (
gpt-6.1-terra)The farm will compare main and the PR in the Market and Hyrule Field on NVIDIA, AMD, Intel, RADV and Steam Deck systems, including the tested Windows NVIDIA path. Three starts per side measure uncapped frame times and FPS at a fixed CPU-oriented resolution; one additional start per side exercises the PR's live descriptor parity check. Crashes, descriptor mismatch logs, materially changed pictures, or frame-time regressions above 15% fail the run.
check(PR only).market-entrance(settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0; switchesHOS_OUTPUT_RES=1280x720,RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market for 30 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field 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, frame_generation=0; switchesHOS_OUTPUT_RES=1280x720,RX_VK_AUTO_TUNE=0), then teleport to Market, teleport to Hyrule Field; 1 run on each side.Measurements on `nvidia`, for the PR description
Verdict: pass on nvidia (2 reports): no rule failed and no PR run crashed.
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window
NVIDIA GeForce RTX 3090, 621.1.0AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu+windowNVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.1.0AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAMScene: performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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, frame_generation=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); performance: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; live-parity: 1 game start a side; 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)495ed9f568a6c4RX_VK_PUSH_DESC_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_PUSH_DESC_FASTcheckAs Markdown for the PR description:
Measurements on `amd`, for the PR description
Verdict: fail on amd (2 reports):
performance market.frametime_p50_ms.max_delta_pct (+391.4%)failed.Hardware: 1: linux+amd+radv+igpu
AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99AMD Ryzen Z2 Extreme, 32 GB RAM; 2: linux+amd+radv+dgpuAMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAMScene: performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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, frame_generation=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); performance: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; live-parity: 1 game start a side; 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)495ed9f568a6c4RX_VK_PUSH_DESC_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_PUSH_DESC_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: performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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, frame_generation=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); performance: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; live-parity: 1 game start a side; 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)495ed9f568a6c4RX_VK_PUSH_DESC_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_PUSH_DESC_FASTcheckAs Markdown for the PR description:
Measurements on `linux+radv`, for the PR description
Verdict: pass on linux+radv (2 reports): no rule failed and no PR run crashed.
Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM; 2: linux+amd+radv+igpuAMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAMScene: performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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, frame_generation=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); performance: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; live-parity: 1 game start a side; 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)495ed9f568a6c4RX_VK_PUSH_DESC_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_PUSH_DESC_FASTcheckAs Markdown for the PR description:
Measurements on `steamdeck`, for the PR description
Verdict: fail on steamdeck (2 reports):
performance market.frametime_1pct_low_ms.max_delta_pct (+30.1%)failed.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: performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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, frame_generation=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); performance: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; live-parity: 1 game start a side; 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)495ed9f568a6c4RX_VK_PUSH_DESC_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_PUSH_DESC_FASTcheckAs Markdown for the PR description:
Measurements on `windows+nvidia`, for the PR description
Verdict: fail on windows+nvidia (2 reports):
performance field.frametime_p99_ms.max_delta_pct (+31.6%);performance field.frametime_1pct_low_ms.max_delta_pct (+34.2%);performance screenshot.max_difffailed.Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window
NVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu+windowNVIDIA GeForce RTX 3090, 621.1.0AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAMScene: performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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, frame_generation=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); performance: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; live-parity: 1 game start a side; 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)495ed9f568a6c4RX_VK_PUSH_DESC_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_PUSH_DESC_FASTcheckAs Markdown for the PR description:
The testers' hardware
nvidiaNVIDIA GeForce RTX 3090, 621.1.0AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAMnvidiaNVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.1.0AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAMamdAMD Radeon 890M Graphics (RADV STRIX1), 26.1.99AMD Ryzen Z2 Extreme, 32 GB RAMamdAMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1AMD Ryzen 7 5800X3D 8-Core Processor, 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 RAMlinux+radvAMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAMlinux+radvAMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 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 RAMwindows+nvidiaNVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAMwindows+nvidiaNVIDIA GeForce RTX 3090, 621.1.0AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAMRecommendation: Approve. The code is ready: only testing is left. The reported runs show a promising improvement on one Windows NVIDIA system, but they do not compare the PR with its base at normal player settings or cover the other affected Tier 1 systems. Recommend approval; not approved on the forge.
The change reduces descriptor comparison and recorder serialization work using a fast shadow and compact ring records. It adds a fallback and parity-check path, at the cost of more renderer and recorder complexity.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
5d89c34d, and the setup uses 50% rendering resolution. The off path still runs changed code, so its +1.52% result cannot establish the total effect relative to495ed9fe; 1% lows are also missing. Do: Run interleaved base-versus-head measurements in the target and heavy scenes at the PC’s normal Auto settings, reporting average FPS, 1% lows, median and p99 frame times and the targeted timings.Since the last review (on
5d89c34d9e)Resolved: L1 (The new function-local thread-local vectors bypass this file’s required TLS_OBJECT ownersh…); L2 (The commit does not contain the required AI-assistance trailer, although the PR says Antig…); L5 (The switch row claims that enabling it provides a per-recording PoolSetCache, but this cha…)
Still open: L3 (The reported A/B does not measure the PR against its base or show performance at the setti…); L4 (The default-on renderer and recorder changes have not been exercised on the other affected…)
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 the base. The author reports 78.4 to 79.6 fps and 12.75 to 12.56 ms mean frame time over five 90-second Windows RTX 4060 runs, but both sides used the PR build with the switch toggled, at 50% resolution.
Other systems: The default-on paths affect Vulkan descriptor recording across supported GPUs and operating systems. Windows NVIDIA smoke and parity runs are reported; Linux, AMD, Intel and the other affected Tier 1 configurations remain untested.
Switches: RX_VK_PUSH_DESC_FAST is added, default on; 0 selects the legacy paths and check compares descriptor shadows. The default is not yet supported by base-comparison and Tier 1 measurements.
Reviewed:
568a6c40e7against495ed9fe2a: Read AGENTS.md, CONTRIBUTING.md, the commit message, the fix diff and push_desc_fast.h; skimmed the PR diff, test changes and relevant standards references. The large changed files and tests were not read in full. Comments, supplied CI status and the range-diff were considered.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run. The author reports game-free checks, Windows NVIDIA smoke and parity runs, and five A/B runs; the supplied CI checks are 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.
Preliminary Linux Market A/B on PR head
568a6c40e7bb. The same build ran withRX_VK_PUSH_DESC_FAST=0and=1. The switch defaults to on.The enabled captures were both faster. Median average FPS was approximately 98.4 off and 120.5 on (+22.5%). Treat the size of the gain as preliminary. The off captures included 2 and 4 frames flagged for pipeline or shader activity, compared with 0 and 0 on, and the shared queue separated the captures by several minutes.
Market (child), Linux, RTX 3090 with NVIDIA 620.70.06, 1280×720 output at 50% render scale, uncapped with V-Sync and frame generation off. Two alternating 40-second pairs after warm-up. The session paused before the third pair.
AMD Lab Market A/B on PR head
568a6c40e7bb, usingRX_VK_PUSH_DESC_FAST=0andRX_VK_PUSH_DESC_FAST=1on the same build.Slower in these captures. Median average FPS changed by -4.03%.
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 15 / 23 / 2 frames on side A and 50 / 34 / 44 on side B across the three captures. The FPS and tail numbers include those frames.
568a6c40e72dd0ba5d7cBeanstalk test farm
Commit
2dd0ba5· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.Rebased onto
main@0aeb6858(head2dd0ba5d).RX_VK_PUSH_DESC_FASTnow ships off. The description is updated to match.Rebase.
mainnow hasRX_VK_CMD_FASTandRX_VK_RECORDER_FAST, so the fast path is rebuilt on top of them instead of beside them:RX_VK_CMD_FAST's push template.DescWriter::has_unbindable_image, noted inpush_sampled) followsmain's current rule: an image with no sampler, or with no view on a device withoutnullDescriptor, is refused, as the walked guard refuses it.RX_VK_RECORDER_FAST'sbegin_fast/finish_fastand decoded indispatch_fast, instead of reserving its own ring space.tests/recording_admission_test.cppand the sampler-admission fixture stub the new hooks.Default off, and why. Two independent AMD systems measured it slower:
The
gpu/vk/switches.defrow (nowattempt, default0) gives that reason.RX_VK_PUSH_DESC_FAST=1still turns it on for more measurements.Farm results (
568a6c4):amd(RX 7900 XTX), Market median 11.95 → 58.73 ms: the PR's frame times sit around 12 ms or around 60 ms. The median moved in 2 of 3 starts, while mean FPS barely changed (29.21 → 28.36). I can't explain that split from the code. It is part of why the switch is now off.windows+nvidia(RTX 4070),screenshot.max_diff0.495: the broken picture is main's, which shows the white-ground glitch; the PR's picture renders correctly. The Field p99 7.34 → 9.66 ms on that PC has not been measured again.RX_VK_PUSH_DESC_FAST=checklogged no mismatch on any target.L3 / L4 (base 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), so these need the farm or people. With the switch off, the open question is whether
=1is worth turning on, on AMD (RADV and Windows) and Steam Deck. HumanBean's Linux RTX 3090 pairs (98.4 → 120.5 FPS, preliminary) point the other way on NVIDIA.Tested on the rebased head (Windows 11, llvm-mingw clang++):
tests/run_all.py --exactoftest_vk_push_desc_fast,test_vk_recorder_fast,test_recorder_sync,test_hos_ab,test_switch_table,test_vk_cmd_fast,test_push_state,test_sampler_admission,test_recording_admission,test_ub_snap_scope: 10 passed, 0 failed.tests/run_all.py --jobs 1 --exact tests/test_recorder_parts.py: passed. It runs alone because it once failed while 8 checks ran at once, onmainas well.clang++ -fsyntax-onlyofgpu/vk/vk_draw.cppandgpu/vk/vk_replay.cpp, with the build plan's own compile commands: no errors.No game run on the rebased head.
Recommendation: Request changes. It no longer merges, and the conflict is more than text: main now routes descriptor binds through
bind_descriptors_lean(#3048,RX_VK_DRAW_OVERHEAD_LEAN, on by default), which keeps onlyPushedand knows nothing ofPushedFast. Its measurements were taken before that path existed. Even before the rebase, the speed-up shows only on NVIDIA and it is measured slower on AMD, so it ships off and does nothing for players yet, while adding a second descriptor shadow that every bind path has to keep in step.For players, nothing changes as it ships:
RX_VK_PUSH_DESC_FASTis off. With it on, the CPU does less work for each descriptor push (no walk over the images, a flat compare shadow, and a compact ring packet forvkCmdPushDescriptorSetKHR). That gives +1.5% fps on an RTX 4060 and is slower on AMD. The code is careful and well checked (=check, the oracle test), but it is a lot of new code in the hottest bind path for an off-by-default attempt.Does it help: Unproven on current main, and mixed where it was measured. On the RTX 4060, an in-run
HOS_ABcomparing the switch on and off in one build at5d89c34d(over main495ed9fe2) gave +1.52% fps (95% CI +0.24% to +2.79%) andcmds_ms-10%. HumanBean's Linux RTX 3090 gave 98.4 -> 120.5 fps (2 pairs, preliminary). Slower: the AMD Lab RX 580 at -4.03% fps (p99 21.95 -> 45.25 ms), and the farm at568a6c4(default on) failed onamd(Market median 11.95 -> 58.73 ms),steamdeck(1% low +30%) andwindows+nvidia(Field p99 +32%). None of these numbers is main against this PR on main as it is now. With #3048's lean path as the default, most draws would not reach the fast path at all.Other systems: AMD (RADV and Windows) and the Steam Deck are measured slower with it on. With it off, the cost over main is small but not measured: one flag test per sampled image in
build_descriptors(push_sampled), onepushed_fast()TLS access per bind, and a second reset indescriptors_disturbed().Switches:
RX_VK_PUSH_DESC_FAST(attempt, enum: 0 / 1 / check): off by default, which is right given the AMD numbers. The row names the reason and the PR.Reviewed:
2dd0ba5d7against its merge base0aeb68589. Read in full:gpu/vk/push_desc_fast.h, thevk_draw.cppandvk_recorder.hhunks together with the code they rely on (descriptors_disturbedand its callers,draw_begin_recording,write_kind,begin_fast/finish_fast, thedispatch_fastconsumer),switches.def, and the test wiring (test_hos_ab.py,test_sampler_admission.py, both admission fixtures). Checked against mainbe4942212: the conflict and #3048'sbind_descriptors_lean. Skimmedtests/test_vk_push_desc_fast.py. Nothing run.Fixed in this review: nothing. The conflict is a design question, not a basic one.
Checked and fine:
Pushedwords and theEncpacket behave as on main. The legacy loops nowbreakand recurse after the loop instead of recursing inside it; the result is the same.descriptors_disturbed()forgets both shadows and runs at each recording's start (draw_begin_recording). So aHOS_ABflip between recordings can't delta against the other mode's stale shadow. Within one recording only one shadow is used.PushedFast: inline and heap metadata are picked consistently throughn_writes.compare_and_store_writereturns -1 before it touches anything, and the partial stores before a -1 are overwritten by the full push that follows. Theub_every(Intel Arc) handling matches the legacy path in both functions.pNext, unknown kinds, a setdstSet, more than 64 writes or 256 descriptors, a missing pointer, or no room in the ring. Dispatch sets only the pointer that matches the type.Blocking
gpu/vk/vk_draw.cppdoes not merge into mainbe4942212: there are conflicts at the includes,DescWriterandbuild_descriptors. The bigger issue is semantic. Main'sbind_descriptors_lean(#3048) is the default bind path, andbind_descriptors_ubo_deltaalso hands off to it. It updatespushed()only. Rebased as it is,=1would mix two shadows within one recording. One case: the lean path pushes new writes for cmd/layout/n whilepfstill holds the older ones, then abind_descriptorsdraw in fast mode compares againstpf, finds a write "unchanged" and leaves out a descriptor the GPU needs (wrong texture or buffer). The reverse also happens:vk_draw.cpp:6637returns without touchingps, so a later lean bind can delta against a staleps. Fix: rebase onto main and either put the fast shadow intobind_descriptors_leanas well, or make every push keep the other shadow in step (at minimum, invalidate the other shadow'scmd). Then extend=checkto cover the lean path.main" doesn't hold.Suggestions
=checkalso turns on the POD ring packet (vk_draw.cpp:6375storesmode != 0), but nothing compares that packet with the closure packet. The 12.3M checks cover the shadow, not the ring encoding (the unit test's round trip covers that). Say so in Testing, or keep the closure packet under=checkso that its runs isolate the shadow.rec::g_push_desc_fastis process-wide but is set at each recording's start from a thread-local mode (vk_draw.cpp:6375). With several recording threads underHOS_AB, one thread's start can switch another thread's ring encoding in the middle of a recording. That is harmless for correctness, since the ring decodes both, but it blurs the A/B's on and off periods.vk_recorder.h:237also sets it inmode_init, where the per-recording store already decides it.=1withRX_VK_RECORDER_FAST=0). The two halves could then ship or be dropped separately, and the smaller one would be easier to carry.Testing: By the author: the unit and oracle tests and the renderer checks on the rebased head (Windows, llvm-mingw); in the game on the RTX 4060 at
5d89c34d(smoke,=checkwith 0 mismatches in 12.3M checks, 5×90 sHOS_AB). The rebased head2dd0ba5d7has had no game run and no farm run. The farm at568a6c4failed onamd,steamdeckandwindows+nvidia, and the AMD Lab's RX 580 measured it slower. Still missing: a game run,=checkand a farm run on a head rebased onto current main. These hold the merge.Overlaps and merge order: #3304 (WIP: a whole push's words made in one pass) goes after the same
Pushed::wordscost by another route: decide which shadow to keep before either merges. #3049 (inlineDescWriterstaging) and #3303 (texture checks inbuild_descriptors) change the sameDescWriterand the image-append sitespush_sampledreplaces. #2948 (descriptor buffers for game shaders) would make push descriptors moot wherever it applies. #3080 and #3116 (both WIP) give textual conflicts invk_draw.cppandvk_recorder.h. Suggested order: settle this one against #3304 first, then rebase over whichever of #3049 and #3303 lands first.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.