perf(vk): adaptive exponential part ramp and lazy upload command buffer (RX_VK_PART_ADAPTIVE) #3004
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3004
Loading…
Reference in a new issue
No description provided.
Delete branch "siantm/Longshot:perf/vk-part-adaptive-lazy-upload"
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
On PC builds (
Longshot),gpu/vk/vk_replay.cpppreviously split recording replay into fixed-size integer parts (min_part/min_part_draws) and eagerly acquired anupload_cbcommand buffer (begin/end/ queue submit) on parts even when the part performed zero host-staged uploads or runs in synchronous non-threaded / non-deferred / non-gprof / non-fo-tracking mode. On CPU-bound frames, eagerupload_cbacquisition and overly small fixed part thresholds add redundant command-buffer lifecycle work and synchronization bubbles (wait_gpu_ms,main_cpu_ms).This change introduces
RX_VK_PART_ADAPTIVE(default1,0legacy,check/2live parity counter mode) across gpu/vk/part_adaptive_fast.h and gpu/vk/vk_replay.cpp:32 -> 120 -> 240 -> 512draws): Ramps the part draw threshold upward across parts within a recording so steady-state frames avoid premature mid-frame command-buffer splits, while0preserves the exact legacy integer threshold.upload_cb): Defersupload_cbacquisition in non-threaded, non-deferred, non-gprof, and non-fo_tracking()modes until an actual upload requires it, avoiding empty upload command buffers when a part has zero uploads (lazy_skips=20201out ofparts=86871in 30 s live gameplay).Files to read first:
gpu/vk/part_adaptive_fast.h,gpu/vk/vk_replay.cpp,gpu/vk/switches.def, andtests/test_vk_part_adaptive.py.Testing
Tested: Windows (
skylake_skylake_4fada1d4fa),longshot-builder.exe/clang++andg++, scenemarket(1280x720):python -I scripts/dev.py pack && python -I scripts/dev.py rt: clean build (0shader parts rebuilt,lift: unchanged,v3.2.0-196-g8fd77e404).python -I scripts/dev.py vk: passed (270units compiled cleanly,longshot_vk.dlllinked, symbols checked).tests/test_vk_part_adaptive.py: passed with bothclang++andg++(12/12MUST_FAILbroken variants verified).tests/test_hos_ab.py --cc clang,tests/test_tls_objects.py(19 TLS_OBJECTs; 44 other namespace-scope thread_locals), andtests/test_vk_braces.py(620sources): all passed.RX_VK_PART_ADAPTIVE=check, scenemarket):2097frames (69.9fps),vk: rx_vk_part_adaptive check: parts=86871 lazy_skips=20201 mismatches=0,RUN_ERROR=None, zeroVK_ERROR_DEVICE_LOSTor crashes.tests/test_switch_table.pywas not modified; noteLONGSHOT_LAUNCHER_STARTUPinhost/launcher_startup.h:9is a pre-existing failure onmain.Still to test:
@Beanstalksmoke and in-run A/B on Linux/Windows Vulkan drivers).Measurements
Verdict: Faster: +1.09% mean FPS (side 1
OFFis -1.05% fps / +0.150 ms slower per frame, 95% CI +0.64% to +1.47%, strictly excluding 0), winning 5/5 queued 90 s runs (AB1–AB5) with improved frame-time tails (1% Low+0.85 FPS,0.1% Low+2.67 FPS,p99-0.24 ms) and lower GPU wait time (wait_gpu_ms-5.76% / -0.1360 ms).RX_VK_PART_ADAPTIVEships enabled by default (1).Setup: Windows, scene
market(1280x720), single-binary in-runHOS_ABalternatingRX_VK_PART_ADAPTIVE=1(Side 0, ON) andRX_VK_PART_ADAPTIVE=0(Side 1, OFF) every 2 s across 5 queued 90 s runs (20261202-121950-rx_vk_part_adaptive-inrun-market, 147 paired periods total).Baseline: Because this uses same-build
HOS_ABtoggling, Side 1 (RX_VK_PART_ADAPTIVE=0) executes the exact legacymain @ 56823e27afixed-threshold and eagerupload_cbbehavior in the same binary and scene.56823e27a(RX_VK_PART_ADAPTIVE=0, Side 1 OFF)8fd77e404(RX_VK_PART_ADAPTIVE=1, Side 0 ON)n=14244vs14405)-0.1545 ms; side 1-1.05%fps, 95% CI+0.64%to+1.47%)>= 50 ms/ min)wait_gpu_msmain_cpu_ms/draw_ms/desc_ms/cmds_msPer-run
HOS_ABresults (AB1–AB5):AB1 -0.70%(70.9 vs 70.4),AB2 -0.67%(70.9 vs 70.5),AB3 -0.87%(71.0 vs 70.4),AB4 -1.06%(71.5 vs 70.8),AB5 -2.01%(71.1 vs 69.7);scripts/perf.py abper-runp99:17.886 vs 20.291 ms,17.786 vs 19.722 ms,18.019 vs 19.580 ms,17.188 vs 19.816 ms,17.930 vs 19.181 ms.Risks
RX_VK_PART_ADAPTIVE=1, which could shift submission cadence on drivers with different command-buffer submission costs.upload_cbdeferral is strictly gated off in threaded, deferred, gprof, andfo_tracking()modes to keep upload synchronization ordering unchanged.RX_VK_PART_ADAPTIVE=0; a clean revert of this commit restores prior code. No save files, options, or shader/pipeline caches change.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 (skylake_skylake_4fada1d4fa), market 1280x720: 30s RX_VK_PART_ADAPTIVE=check (2097 frames, 69.9 fps, parts=86871 lazy_skips=20201 mismatches=0, RUN_ERROR=None) and 5x90s HOS_AB (5/5 won, +1.09% ON vs OFF, 1% Low +0.85 FPS, 0.1% Low +2.67 FPS)
Possibly related, for context:
@review
@beanstalk
Beanstalk test farm · an earlier run: commit
8fd77e4(the newer results are in a comment below)Commit
8fd77e4· approved by HumanBean (reviewed) · dashboard⚠️ Note: Two starts per side keep both switch modes within the run budget; this is unlikely to resolve the claimed roughly 1% speedup reliably.
⚠️ Note: The plan does not run the diagnostic check mode or the in-run alternating A/B, and therefore cannot verify their parity counters or reproduce that measurement protocol.
Started at 14:54 UTC.
Estimate: done in about 2 h 15 min, from the queue and the testers online now; some jobs can't start yet.
nvidiaamdintelwindows+amdlinux+radvsteamdeckreplay-scenes· frame time p99 (ms)RX_VK_PART_ADAPTIVE=RX_VK_PART_ADAPTIVE=0(reference)nvidiaamdintelwindows+amdlinux+radvsteamdeckWhy it failed
nvidia:replay-scenes · RX_VK_PART_ADAPTIVE= (PR only)market.frametime_1pct_low_ms.max_delta_pct:12.2 → 14.4 (+17.8%); limit 15.0nvidia:replay-scenes · RX_VK_PART_ADAPTIVE= (PR only)market.frametime_p99_ms: RX_VK_PART_ADAPTIVE= vs RX_VK_PART_ADAPTIVE=0 (PR):10.6 → 12.2 (+15.6%); limit 15.0; the PR's own cells: RX_VK_PART_ADAPTIVE= against RX_VK_PART_ADAPTIVE=0 (RX_VK_PART_ADAPTIVE=0 (PR only))amd:replay-scenes · RX_VK_PART_ADAPTIVE=0 (PR only)screenshot.max_diff:0.1 → 0.2; limit 0.2amd:replay-scenes · RX_VK_PART_ADAPTIVE= (PR only)kokiri.frametime_p99_ms.max_delta_pct:56.6 → 77.0 (+36.0%); limit 15.0amd:replay-scenes · RX_VK_PART_ADAPTIVE= (PR only)kokiri.frametime_1pct_low_ms.max_delta_pct:67.1 → 85.8 (+27.8%); limit 15.0amd:replay-scenes · RX_VK_PART_ADAPTIVE= (PR only)market.frametime_p99_ms: RX_VK_PART_ADAPTIVE= vs RX_VK_PART_ADAPTIVE=0 (PR):43.4 → 50.8 (+17.2%); limit 15.0; the PR's own cells: RX_VK_PART_ADAPTIVE= against RX_VK_PART_ADAPTIVE=0 (RX_VK_PART_ADAPTIVE=0 (PR only))amd:replay-scenes · RX_VK_PART_ADAPTIVE= (PR only)kokiri.frametime_p99_ms: RX_VK_PART_ADAPTIVE= vs RX_VK_PART_ADAPTIVE=0 (PR):49.6 → 77.0 (+55.2%); limit 15.0; the PR's own cells: RX_VK_PART_ADAPTIVE= against RX_VK_PART_ADAPTIVE=0 (RX_VK_PART_ADAPTIVE=0 (PR only))windows+amd:replay-scenes · RX_VK_PART_ADAPTIVE= (PR only)screenshot.max_diff:0.2 → 0.3; 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 10 required comparison(s). See rule results.What was tested
What will be tested · AI plan (
gpt-6.1-terra)The farm will compare adaptive replay with main and with the PR’s legacy mode in Market and Kokiri Forest, using two starts per side and 20-second uncapped measurements at each location. NVIDIA, AMD, Intel, Windows AMD, Linux RADV and Steam Deck targets will measure frame times and compare stationary pictures; the switch comparison isolates the adaptive mode within the PR. A crash, a frame-time regression over 15%, or a picture difference over the allowed threshold fails the plan.
0(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 for 20 s (after 10 s warm-up), teleport to Kokiri Forest, take the picture kokiri to compare with main, measure kokiri for 20 s (after 10 s warm-up); 2 runs on each side for each of 2 cells (2 game starts a run).Measurements on `nvidia`, for the PR description
Verdict: fail on nvidia (2 reports):
replay-scenes market.frametime_1pct_low_ms.max_delta_pct (+17.8%);replay-scenes market.frametime_p99_ms: RX_VK_PART_ADAPTIVE= vs RX_VK_PART_ADAPTIVE=0 (PR) (+15.6%)failed.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, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAMScene: replay-scenes, 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); replay-scenes: 2 game starts a side, market 20 s after 10 s warm-up, kokiri 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)56823e28fd77e4RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (worst 1%) (ms)Flags and settings
RX_VK_PART_ADAPTIVE0As Markdown for the PR description:
Measurements on `amd`, for the PR description
Verdict: fail on amd (2 reports):
replay-scenes screenshot.max_diff;replay-scenes kokiri.frametime_p99_ms.max_delta_pct (+36.0%);replay-scenes kokiri.frametime_1pct_low_ms.max_delta_pct (+27.8%)failed.Hardware: 1: linux+amd+radv+igpu
AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 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: replay-scenes, 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); replay-scenes: 2 game starts a side, market 20 s after 10 s warm-up, kokiri 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)56823e28fd77e4RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (worst 1%) (ms)Flags and settings
RX_VK_PART_ADAPTIVE0As Markdown for the PR description:
Measurements on `intel`, for the PR description
Verdict: queued on intel (1 report).
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 RAMScene: replay-scenes, 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); replay-scenes: 2 game starts a side, market 20 s after 10 s warm-up, kokiri 20 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)Nothing was measured: no metric came back.
Flags and settings
RX_VK_PART_ADAPTIVE0As Markdown for the PR description:
Measurements on `windows+amd`, for the PR description
Verdict: fail on windows+amd (2 reports):
replay-scenes 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: replay-scenes, 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); replay-scenes: 2 game starts a side, market 20 s after 10 s warm-up, kokiri 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)56823e28fd77e4RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (worst 1%) (ms)Flags and settings
RX_VK_PART_ADAPTIVE0As Markdown for the PR description:
Measurements on `linux+radv`, for the PR description
Verdict: fail on linux+radv (2 reports):
replay-scenes screenshot.max_difffailed.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: replay-scenes, 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); replay-scenes: 2 game starts a side, market 20 s after 10 s warm-up, kokiri 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)56823e28fd77e4RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (worst 1%) (ms)Flags and settings
RX_VK_PART_ADAPTIVE0As Markdown for the PR description:
Measurements on `steamdeck`, for the PR description
Verdict: fail on steamdeck (1 report):
replay-scenes screenshot.max_diff;replay-scenes kokiri.frametime_p99_ms.max_delta_pct (+15.7%);replay-scenes market.frametime_1pct_low_ms.max_delta_pct (+118.9%)failed.Hardware: 1: linux+amd+radv+igpu+handheld
AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99AMD Custom APU 0405, 16 GB RAMScene: replay-scenes, 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); replay-scenes: 2 game starts a side, market 20 s after 10 s warm-up, kokiri 20 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)56823e28fd77e4RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE= (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE= (PR only)· market · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (p99) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· kokiri · frame time (worst 1%) (ms)RX_VK_PART_ADAPTIVE=0 (PR only)· market · frame time (worst 1%) (ms)Flags and settings
RX_VK_PART_ADAPTIVE0As Markdown for the PR description:
The testers' hardware
nvidiaNVIDIA GeForce GTX 980, 582.78.0Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 32 GB RAMnvidiaNVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAMamdAMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAMamdAMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAMintelIntel(R) UHD Graphics 630, 0.404.2115Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 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 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 Windows A/B shows a small gain in one scene, but the default changes submission timing on every supported GPU and has not been measured against the base build or tested across Tier 1 systems. The required hardware runs and head CI are still pending. Recommend approval; not approved on the forge.
The change ramps submission-part thresholds and skips empty upload command-buffer work in eligible modes. It may reduce CPU and submission overhead, at the cost of longer intervals before later work reaches the GPU and additional recording-state logic.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_replay.cpp:2468: Measure the default against the actual base in player workloads before settling the claimed gain. (more on the line) Do: Run interleaved base-versus-head measurements in Market and a heavy moving scene at player settings, reporting average FPS, lows and frame times. (@fixdoes its part first: Keep later parts at the measured legacy threshold while evaluating the lazy-upload change separately.)gpu/vk/vk_replay.cpp:2468: The enabled default needs Tier 1 hardware coverage for the changed submission cadence. (more on the line) Do: Use the Test Farm to smoke-test and compare performance on the affected Tier 1 Windows and Linux NVIDIA and AMD configurations and Steam Deck, including frame-time tails and visible output. (@fixdoes its part first: Separate the threshold ramp from lazy upload so each default can be evaluated and selected independently.)@fixcan do L1 and L2.Questions (1) (not confirmed from the code; they don't hold the recommendation)
tests/test_vk_part_adaptive.py:229: Is there a case at HEAD where the recording code submits an upload buffer without ending it?Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven against the base commit. Five same-binary Windows A/B runs report 70.34 to 71.11 FPS (+1.09%) in Market, with better reported frame-time tails, but the OFF side is this PR's code with the switch disabled, not a run of base
56823e27a1. No base-versus-head measurements in other player scenes are supplied.Other systems: The adaptive thresholds affect threaded and deferred recording as well as direct recording, and can change GPU submission cadence on Windows, Linux and Steam Deck. Lazy upload is gated off for threaded, deferred, GPU profiling and frame-overlap tracking modes. The supplied live run covers one Windows system; no Linux, RADV, Steam Deck or other Tier 1 results are supplied.
Switches: RX_VK_PART_ADAPTIVE is added, default 1; 0 selects legacy thresholds and eager upload buffers, and check/2 uses legacy thresholds with lazy uploads and invariant counters. Its row is present, but the default's performance across supported hardware remains unmeasured.
Reviewed:
8fd77e404eagainst56823e27a1: Read the repository rules, PR template, standards, commit, full new header and test, and the changed hunks and surrounding recording, upload, memory and profiling paths. Skimmed the remaining portions of the large changed renderer files and test_hos_ab.py; docs/review-checklist.md and the sibling Tooling checkout are absent. No generated files or translations changed. The supplied comments, measurements and CI status were reviewed.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run, as requested. The author reports a Windows live run and five A/B runs; head CI is still running. The requested Test Farm run could not be initiated from the available tools and no farm results were supplied.
Overlaps and merge order: Not established; network access was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -2416,2 +2466,3 @@static const int64_t kPartFirst = std::clamp<int64_t>(env_int("RX_VK_PART_FIRST", 32), 0, kPartMin);const int64_t need = rec_parts == 0 && kPartFirst ? kPartFirst : kPartMin;const int mode = rec_cur ? rec_cur->adaptive_mode : part_adaptive_mode();const int64_t need = part_adaptive_fast::part_threshold(rec_parts, kPartFirst, kPartMin, kPartMax, mode == 1);L1 (should fix): Measure the default against the actual base in player workloads before settling the claimed gain.
When: The supplied A/B compares two paths in the changed binary in Market. Larger later parts delay GPU submission, and existing comments record substantial differences between part sizes while moving, so that comparison alone does not establish the result against base in heavy scenes.
Do: Run interleaved base-versus-head measurements in Market and a heavy moving scene at player settings, reporting average FPS, lows and frame times.
L2 (should fix): The enabled default needs Tier 1 hardware coverage for the changed submission cadence.
When: The ramp applies on NVIDIA, AMD and Steam Deck on both supported operating systems, but the supplied run covers only one Windows machine. Different drivers and GPU workloads can respond differently to longer parts.
Do: Use the Test Farm to smoke-test and compare performance on the affected Tier 1 Windows and Linux NVIDIA and AMD configurations and Steam Deck, including frame-time tails and visible output.
Independent Linux Market A/B on PR head
8fd77e404e48.RX_VK_PART_ADAPTIVEdefaults to on in this revision.Inconclusive in this short capture. Median average FPS changed by +19.50%.
0)1)| Frames of 50 ms or more, each run | 1 / 0 | 0 / 0 |
Market (child), Linux 7.3.3-1-cachyos, RTX 3090, NVIDIA 620.70.06, 1280x720, 50% (640x360), uncapped with V-Sync and frame generation off. Two interleaved 30-second captures per side on the same PR binary, each after pipeline warm-up. Frame-time and 1% low rows report the median across the two captures.
The first off capture included a 9.45-second presentation stall. It dominates the average FPS delta.
Follow-up Market A/B on the same
8fd77e404e48build. I ran three fresh interleaved 30-second pairs, with at least 15 seconds of pipeline warm-up each, on the same Linux/RTX 3090 setup (1280x720 output at 50%, uncapped, V-Sync and frame generation off).Repeat result: within the run-to-run spread. Median average FPS changed by +2.80%. All six measured captures stayed below 50 ms per frame. The first comparison's 9.45-second presentation stall made its average FPS sensitive to one capture, so the fresh results above are the relevant comparison.
@rebase
I rebased this pull request onto
main(4e762a4b26): the new head ise03766022d.Conflicts resolved
Nothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
8fd77e404ee03766022dBeanstalk test farm
Commit
e037660· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.Recommendation: Approve. The code is ready: only testing is left. The enabled default still lacks a measurement against the actual base and the required Tier 1 coverage. The reported Windows gain and Linux follow-up are encouraging but do not settle those two questions. Recommend approval; not approved on the forge.
The change ramps recording-part thresholds and avoids starting empty upload command buffers in eligible modes, potentially reducing CPU and submission overhead. It adds state and synchronization logic whose benefit and driver coverage still need validation.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_replay.cpp:2468: Measure the default against the actual base in player workloads before settling the claimed gain. When: The supplied A/B compares two paths in the changed binary in Market. Larger later parts delay GPU submission, and existing comments record substantial differences between part sizes while moving, so that comparison alone does not establish the result against base in heavy scenes. Do: Run interleaved base-versus-head measurements in Market and a heavy moving scene at player settings, reporting average FPS, lows and frame times. (@fixdoes its part first: Keep later parts at the measured legacy threshold while evaluating the lazy-upload change separately.)gpu/vk/vk_replay.cpp:2468: The enabled default needs Tier 1 hardware coverage for the changed submission cadence. When: The ramp applies on NVIDIA, AMD and Steam Deck on both supported operating systems, but the supplied run covers only one Windows machine. Different drivers and GPU workloads can respond differently to longer parts. Do: Use the Test Farm to smoke-test and compare performance on the affected Tier 1 Windows and Linux NVIDIA and AMD configurations and Steam Deck, including frame-time tails and visible output. (@fixdoes its part first: Separate the threshold ramp from lazy upload so each default can be evaluated and selected independently.)@fixcan do L1 and L2.Since the last review (on
8fd77e404e)Still open: L1 (Measure the default against the actual base in player workloads before settling the claime…); L2 (The enabled default needs Tier 1 hardware coverage for the changed submission cadence.)
Checks: Still running: 11 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 actual base. The PR reports a 1.09% mean FPS gain across five Windows in-run A/B captures, but compares switch settings in the PR binary; the Linux RTX 3090 follow-up reports a 2.80% median gain within run-to-run spread.
Other systems: The submission cadence can affect Vulkan drivers on Windows and Linux, including AMD RADV and Steam Deck. The recorded Linux NVIDIA run gives some coverage; the remaining Tier 1 systems have not been reported tested. Threaded, deferred, profiling and frame-overlap modes retain eager upload acquisition.
Switches: RX_VK_PART_ADAPTIVE is added, default 1; 0 selects legacy thresholds and eager uploads, while 2 checks invariants using legacy thresholds and eligible lazy uploads. The enabled default is not yet supported by actual-base and Tier 1 measurements; it is listed in switches.def.
Reviewed:
e03766022dagainst4e762a4b26: Read the repository rules and PR template, the full adaptive helper, and the relevant change and call-site excerpts. Skimmed the larger changed renderer and test files; they were not read in full. No review checklist file exists at the specified path.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The PR reports Windows game and game-free test runs, plus independent Linux NVIDIA captures; 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 BeanBot, after its rebase. Nothing was run; a maintainer decides.
This was merged (head
e037660, after BeanBot's rebase) before I answered. This comment follows up on the results posted since.Test farm (Beanstalk, run on
8fd77e4): the part ramp makes frame-time tails worse on several systems. The useful numbers are the PR's own cells,RX_VK_PART_ADAPTIVEdefault against=0in the same build (frame time p99, ms):=0→ default=0→ defaultKokiri's p99 is higher with the default in 8 of 9 reports, and the rule limit (15%) was crossed on three independent systems (760M, RTX 4070, Steam Deck). The Intel UHD 630 report could not run.
The cause is in the change itself:
part_adaptive_fast::part_threshold(gpu/vk/part_adaptive_fast.h) lets later parts grow 120 → 240 → 512 draws, so the GPU gets each part's work later in the frame. That hurts most where the GPU is the limit (the iGPUs and the Deck). The lazy upload command buffer only skips emptybegin/endwork and doesn't move submissions.What I'll do about it: a follow-up PR turns the ramp off by default and keeps lazy upload:
RX_VK_PART_ADAPTIVE=1will mean lazy upload with the legacy thresholds, and the ramp will only run withRX_VK_PART_ADAPTIVE=ramp. I've prepared the branch. It isn't open yet because it needs an in-game run first. The reason will be ingpu/vk/switches.defand in a comment atmaybe_split.Pictures: the farm flagged
screenshot.max_diffon the Steam Deck (Market 0.78 against main's 0.18 with itself). The PR picture there is an all-black frame (3 KB PNG). The same black capture shows up on the main side and on other PRs' runs (#2989, #2997), so I count it as a capture failure, not a rendering difference. The other flagged pictures (Windows RX 9070 XT, the 890M and the 8060S) were also flagged in the=0cell. That cell runs the legacy path, so the PR's default is not what moves them.@HumanBean's Linux Market A/B (RTX 3090,
8fd77e4): thanks. The first run gave +19.50% median FPS, but a 9.45 s stall in one off capture accounts for that. The three-pair repeat gave +2.80% (118.53 → 121.85 FPS, p99 11.95 → 11.73 ms), within the spread. On that GPU-light setup the ramp doesn't hurt, which fits the farm's pattern.BeanBot L1/L2 (base-vs-head at player settings, Tier 1 coverage): the farm results above answer L2 against the ramp. L1 (base-vs-head at player settings) still hasn't been measured. Nothing more was run from my side: this PR is merged, and I made no code change to it. The description can't be edited after the merge (our forge tooling refuses merged PRs), so this comment is where the results are recorded.
The follow-up is #3117: the ramp runs only with
RX_VK_PART_ADAPTIVE=ramp; the default keeps the lazy upload command buffer and the legacy part thresholds.