perf(vk): EDS3-aware 256x2 L1 graphics pipeline cache (RX_VK_PIPE_FAST) #2991
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2991
Loading…
Reference in a new issue
No description provided.
Delete branch "siantm/Longshot:perf/vk-pipe-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
graphics_pipeline()(gpu/vk/vk_draw.cpp) previously rebuilt a full 224-byte stack state copy (formats[8],vattr[16],divs[16],blend[8]) and compared all of those fields—including inactive vertex attributes, dynamic blend state underVK_EXT_extended_dynamic_state3(eds3_blend/eds3_polygon/eds3_clamp/eds3_a2c), and vertex inputs on mesh/fallback draws—inside a tiny 2-entrypipe_fast[2]cache before constructing aKeyInputsstruct and hashing every field formine.find(key).This adds
gpu/vk/pipe_fast.h(RX_VK_PIPE_FAST, default1):LoadsEntrycache (32B entries): keyed on(prog_ptr, prog_key, prog_variant, vertex_input)to cachevloads_maskandfs_write_mask, eliminating per-drawvertex_info(p)and fragment-stage walks.256 x 2-way MRU L1PipeEntry*cache (PipeL1EntryT): keyed on(prog_ptr, prog_key, prog_variant, topo_c, samples, n, depth_format, eds_mask, vertex_input)+ activecolor_format[0..n-1], skipping vertex inputs (nvattr, activevattr,divisor) on mesh/fallback draws and skipping blend/polygon/clamp/a2c checks whenever hardware EDS3 makes them dynamic state.compute_pipeline_key(): replicatesdraw_key.h::pipeline_key(key_inputs(...))bit-exact without allocatingKeyInputsor walking shader stages onLoadsEntryhits.RX_VK_PIPE_FAST=0runs baselinepipe_fast[2]+pipeline_keybefore touchingpipe_fast_tls()ormine;RX_VK_PIPE_FAST=checkvalidates bothcompute_pipeline_key == pipeline_keyandfast_pe == base_peacross every lookup.Files to read first:
gpu/vk/pipe_fast.h,gpu/vk/vk_draw.cpp(graphics_pipeline,pipe_fast_begin_recording,pipe_fast_close), andtests/test_vk_pipe_fast.py.Testing
Tested:
market(RX_VK_PIPE_FAST=check, 15 s,RUN_ERROR=None):1160 frames(77.3 fps),[pipe_fast] periodic: calls=23659601 l1_hits=20205872 (85.4%) l1_misses=3453729 mine_hits=0 loads_hits=21236792 loads_misses=2422809 checks=23659601 key_mismatches=0 mismatches=0.python -I tests/test_vk_pipe_fast.py --cxx clang++: PASS (bit-exactcompute_pipeline_keyacross all 16 EDS3 combos, mesh/fallback vs graphics, active/inactivevloads_mask,divisor[0..15],write_masks, ABA safety,256x2MRU, 3,000-draw randomized trace vs oracle, and 10 broken variants caught).python -I tests/test_saveload_warm_cache.py --cxx clang++: PASS.python -I tests/test_hos_ab.py --cc clang: PASS (12 broken variants caught).python -I tests/test_tls_objects.py: PASS (20 TLS_OBJECTs;47other namespace-scopethread_locals, none with ctor/dtor).python -I tests/test_vk_braces.py: PASS (620renderer sources balance).python -I scripts/dev.py pack && python -I scripts/dev.py rt(0shader parts rebuilt,lift: unchanged).Still to test:
Measurements
Verdict: faster:
+0.99%fps (-0.125 mspooled mean frame time, 95% CI+0.54%to+1.46%across 147 pairedHOS_ABperiods; 5/5 runs won). Pipeline lookup timepipelines_msdropped-30.38%(-0.1325 ms, from0.4360 msto0.3036 ms),draw_msdropped-2.35%(-0.1746 ms), andwait_gpu_msdropped-9.11%(-0.1754 ms).Setup: Windows 11; Market, child (crowded) (
window 804x581); quality preset Custom, resolution 50% (768x432), output res1280x720, frame generation Off, vsync Off; uncapped (HOS_FPS_MAX=1000),RX_VK_FRAME_TRACE=1, 5 runs of 90 s each after warm-up,HOS_AB=RX_VK_PIPE_FAST=0,3,0flipped every 3 s within each run (dev.py queue run --mode timing).Baseline: both columns are one build,
v3.2.0-196-g30189bffc(30189bffc):RX_VK_PIPE_FAST=0againstRX_VK_PIPE_FASTunset (1, default) on it.30189bffc30189bffcSIDE_1vsSIDE_0)79.08)79.87)-0.068to-0.183 ms)-0.99%)P50)80.84fps)81.77fps)pipelines_ms/draw_ms(SUBSYSTEM_DELTAS)Individual runs (
AB1–AB5, side 0 ON vs side 1 OFF):AB1: side 079.4fps vs side 178.6fps (-0.91%)AB2: side 079.4fps vs side 178.8fps (-0.70%)AB3: side 079.1fps vs side 178.6fps (-0.61%)AB4: side 079.8fps vs side 178.6fps (-1.44%)AB5: side 081.7fps vs side 180.6fps (-1.32%)An earlier 3x90 s
HOS_ABrun (87periods) on the same build also won 3/3 (80.35vs79.41fps,+1.17%, 95% CI+0.63%to+1.72%,1% Low 64.31 vs 62.66,0.1% Low 54.85 vs 48.71,pipelines_ms -30.44%).Risks
compute_pipeline_key()orPipeL1EntryTmatching ever omits an input field introduced toKeyInputs, a draw could hit a mismatchedPipeEntry*.RX_VK_PIPE_FAST=0restores baselinepipe_fast[2]+pipeline_key()cleanly, andRX_VK_PIPE_FAST=checkcontinuously verifiescompute_pipeline_key == pipeline_key(0key mismatches and0entry mismatches across23.66Mlive checks).128 x 2 x 32 B = 8 KiBforLoadsEntryplus256 x 2PipeL1EntryTslots) stays within TLS budget and never builds extraVkPipelineobjects.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.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11, market (1280x720, 50% res 768x432, V-Sync off, framegen off, HOS_FPS_MAX=1000): RX_VK_PIPE_FAST=check ran 1160 frames (77.3 fps, RUN_ERROR=None) with 23659601 checks, 20205872 L1 hits (85.4%), 0 key_mismatches, 0 mismatches; 5x90s honest HOS_AB won 5/5 (+0.99% fps, 79.87 vs 79.08 fps, 95% CI +0.54% to +1.46%, pipelines_ms -30.38%).
Possibly related, for context:
@review
Recommendation: Approve. The new header causes the game-free checks to fail with GCC warnings treated as errors. The reported speedup also compares two modes of this branch rather than the branch against main, so the gain and default remain unproven. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change caches graphics pipeline lookups and program masks per recording thread, avoiding repeated state comparisons and key construction. It adds a substantial per-thread cache and a second implementation of pipeline-key logic that must stay synchronized with the original.
Should fix (1): not blocking, but worth doing before merging.
gpu/vk/pipe_fast.h:29: The conditional expressions mix enumerators with unsigned integers, which GCC diagnoses under -Wextra. (more on the line) Do: Give both operands the same unsigned type, for example by casting the enumerators, and keep the checks working with GCC as well as Clang.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:3512: Measure the overall gain against the actual base at player settings. (more on the line) Do: Run interleaved base and head builds in the target and heavy scenes at the device's normal resolution and Auto-selected quality, reporting average and 1% low fps, frame times and pipeline time.gpu/vk/pipe_fast.h:197: Exercise the new lookup on the other Tier 1 systems and the non-EDS3 path before merging. (more on the line) Do: Run the check mode through representative open and dungeon scenes on the affected Tier 1 Windows and Linux hardware, including Steam Deck and a non-EDS3 device; report rendering and mismatch results.@fixcan do L1.Questions (2) (not confirmed from the code; they don't hold the recommendation)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven against main. The PR reports 79.87 versus 79.08 fps, a 0.99% gain, over five interleaved Windows runs, but both sides use head
30189bffcand the setup uses custom settings; the required comparison against base56823e27a1at player settings is missing.Other systems: The cache affects graphics and mesh-fallback draws, EDS3 and non-EDS3 devices, and recording threads on Windows and Linux. The reported live check covers one Windows Market run; AMD, Linux, Steam Deck, non-EDS3 hardware and other areas remain unverified.
Switches: RX_VK_PIPE_FAST is added, default 1; 0 selects the old lookup algorithm and check/2 compares both paths. Its switches.def row is present, but the default's gain across supported systems is not yet established.
Reviewed:
30189bffc2against56823e27a1: Read the repository rules, PR template, standards, commit and diff; read pipe_fast.h and the changed graphics pipeline and recording code, and traced the original key, shader masks, TLS ownership and callers. Read the new test and changed test sections; skimmed the rest of the large renderer and test files. No recorded game files, translations or generated files are changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no builds, tests or project scripts were run. The author reports the new checks passing with Clang and a Windows check-mode game run; CI is still running.
Overlaps and merge order: Not determined; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -0,0 +26,4 @@kEdsA2c = 1u << 3,};[[gnu::always_inline]] inline uint8_t make_eds_mask(bool eds3_blend, bool eds3_polygon, bool eds3_clamp, bool eds3_a2c) {L1 (should fix): The conditional expressions mix enumerators with unsigned integers, which GCC diagnoses under -Wextra.
When: On a Linux setup using g++, both test_vk_pipe_fast.py and test_saveload_warm_cache.py compile this header with -Wextra -Werror, so the enum/non-enum conditional warnings make the checks fail.
Do: Give both operands the same unsigned type, for example by casting the enumerators, and keep the checks working with GCC as well as Clang.
@ -0,0 +194,4 @@dst.prog_variant = prog_variant;dst.fs_write_mask = fs_wm_out;dst.vloads_mask = vloads_out;dst.valid = 1;L3 (should fix): Exercise the new lookup on the other Tier 1 systems and the non-EDS3 path before merging.
When: Every graphics draw can use this cache, including on Linux, AMD and Steam Deck, while the only reported game run is one Windows Market run and does not identify its GPU or driver.
Do: Run the check mode through representative open and dungeon scenes on the affected Tier 1 Windows and Linux hardware, including Steam Deck and a non-EDS3 device; report rendering and mismatch results.
@ -3393,0 +3509,4 @@auto& mine = pf_st.mine;eds_mask = mkwvk::pipe_fast::make_eds_mask(dev.eds3_blend, dev.eds3_polygon, dev.eds3_clamp, dev.eds3_a2c);pf_st.stats.calls++;PipeEntry* fast_l1_pe = mkwvk::pipe_fast::lookup(pf_st, p, s, at, topo_c, eds_mask);L2 (should fix): Measure the overall gain against the actual base at player settings.
When: The reported 0.99% comparison uses this branch for both sides; its off path also has the new mode selection and TLS state, so it does not establish the effect of the complete change against main.
Do: Run interleaved base and head builds in the target and heavy scenes at the device's normal resolution and Auto-selected quality, reporting average and 1% low fps, frame times and pipeline time.
30189bffc208bdce51e4Addressed the review feedback in commit
08bdce51e:gpu/vk/pipe_fast.h:29): Cast the enumerator operands (kEdsBlend,kEdsPolygon,kEdsClamp,kEdsA2c) touint32_tinmake_eds_mask()so both ternary operands share an unsigned type under GCC-Wextra -Werror. Also updatedtests/test_vk_pipe_fast.pycompiler fallback (CXX->clang++->g++) and Windows DLLPATHsetup for--cxx g++.Assisted-by: Antigravity (Google DeepMind)to the commit message.clang++andg++(-std=c++20 -Wall -Wextra -Werror -fsyntax-only) ongpu/vk/pipe_fast.hpython -I -B tests/test_vk_pipe_fast.pywith--cxx clang++,--cxx g++.exe, and default compiler (all 10 broken variants caught)python -I -B tests/test_saveload_warm_cache.pywith--cxx clang++,--cxx g++.exe, and default compilerpython -I -B tests/test_hos_ab.py --cc clang,tests/test_tls_objects.py,tests/test_vk_braces.py@review
@beanstalk
Beanstalk test farm · an earlier run: commit
08bdce5(the newer results are in a comment below)Commit
08bdce5· approved by HumanBean (reviewed) · dashboard⚠️ Note: The small reported speedup and pipeline-lookup time cannot be reliably resolved by these frame-time samples; verification mode adds overhead and is not used for performance judgment.
⚠️ Note: The farm cannot select or guarantee a non-EDS3 device, run the requested standalone unit tests, or reproduce Auto-selected player quality while holding render settings fixed.
Started at 15:45 UTC.
Estimate: done in about 3 h 45 min, from the queue and the testers online now; some jobs can't start yet.
nvidiawindows+amdlinux+radvintelsteamdeckWhat was tested
What will be tested · AI plan (
gpt-6.1-terra)The farm will compare main and the PR in Market and the Deku Tree on NVIDIA, AMD, Intel and Steam Deck systems, including Windows and RADV coverage. Three uncapped starts per side measure CPU-oriented frame times, while one additional start per side exercises pipeline verification mode in Hyrule Field and the dungeon. Stationary performance-scene screenshots are compared with main; the PR fails for a crash, a logged verification mismatch, excessive picture differences or a frame-time regression over the stated limits. Each tester's game runs take approximately 50 minutes.
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 Inside the Deku Tree, take the picture deku to compare with main, measure deku for 30 s (after 10 s warm-up); 3 runs on each side.castle-gate(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 Hyrule Field, take the picture field-check, measure field-check for 20 s (after 10 s warm-up), teleport to Inside the Deku Tree, take the picture deku-check, measure deku-check for 20 s (after 10 s warm-up); 1 run on each side.Measurements on `windows+amd`, for the PR description
Verdict: pass on windows+amd (2 reports): no rule failed and no PR run crashed.
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: 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); verification, from the repository's save castle-gate (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, deku 30 s after 10 s warm-up; verification: 1 game start a side, field-check 20 s after 10 s warm-up, deku-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)56823e208bdce5RX_VK_PIPE_FAST=check (PR only)· deku-check · median frame time (ms)RX_VK_PIPE_FAST=check (PR only)· field-check · median frame time (ms)RX_VK_PIPE_FAST=check (PR only)· deku-check · frame time (p99) (ms)RX_VK_PIPE_FAST=check (PR only)· field-check · frame time (p99) (ms)RX_VK_PIPE_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_PIPE_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 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM; 2: linux+amd+radv+igpuAMD Radeon 890M Graphics (RADV STRIX1), 26.1.99AMD Ryzen Z2 Extreme, 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); verification, from the repository's save castle-gate (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, deku 30 s after 10 s warm-up; verification: 1 game start a side, field-check 20 s after 10 s warm-up, deku-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)56823e208bdce5RX_VK_PIPE_FAST=check (PR only)· deku-check · median frame time (ms)RX_VK_PIPE_FAST=check (PR only)· field-check · median frame time (ms)RX_VK_PIPE_FAST=check (PR only)· deku-check · frame time (p99) (ms)RX_VK_PIPE_FAST=check (PR only)· field-check · frame time (p99) (ms)RX_VK_PIPE_FAST=check (PR only)· forbidden log linesFlags and settings
RX_VK_PIPE_FASTcheckAs Markdown for the PR description:
The testers' hardware
windows+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 5 9600X 6-Core Processor, 32 GB RAMlinux+radvAMD Radeon 890M Graphics (RADV STRIX1), 26.1.99AMD Ryzen Z2 Extreme, 32 GB RAMRecommendation: Approve. The code is ready: only testing is left. The GCC warning is fixed, but the net gain against the actual base and coverage on other affected Tier 1 systems remain unmeasured. The reported same-build switch comparison shows a small gain, but it does not settle the base-versus-head result. Recommend approval; not approved on the forge.
The change caches graphics pipeline lookups to reduce per-draw CPU work. It adds a substantial cache and verification path in exchange for a reported small frame-time improvement.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:3512: Measure the overall gain against the actual base at player settings. When: The reported 0.99% comparison uses this branch for both sides; its off path also has the new mode selection and TLS state, so it does not establish the effect of the complete change against main. Do: Run interleaved base and head builds in the target and heavy scenes at the device's normal resolution and Auto-selected quality, reporting average and 1% low fps, frame times and pipeline time.gpu/vk/pipe_fast.h:197: Exercise the new lookup on the other Tier 1 systems and the non-EDS3 path before merging. When: Every graphics draw can use this cache, including on Linux, AMD and Steam Deck, while the only reported game run is one Windows Market run and does not identify its GPU or driver. Do: Run the check mode through representative open and dungeon scenes on the affected Tier 1 Windows and Linux hardware, including Steam Deck and a non-EDS3 device; report rendering and mismatch results.Since the last review (on
30189bffc2)Resolved: L1 (The conditional expressions mix enumerators with unsigned integers, which GCC diagnoses un…)
Still open: L2 (Measure the overall gain against the actual base at player settings.); L3 (Exercise the new lookup on the other Tier 1 systems and the non-EDS3 path before merging.)
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 actual base. The author reports 79.87 versus 79.08 fps and a 0.125 ms pooled mean frame-time reduction over 147 paired periods on Windows, but both sides used the PR build with the switch toggled; p99 frame time increased from 15.84 to 15.88 ms.
Other systems: The renderer change can affect Vulkan devices with and without EDS3, including Windows, Linux, Steam Deck, AMD and Intel systems. The reported live check covers Windows; the other Tier 1 and non-EDS3 runs remain pending.
Switches: RX_VK_PIPE_FAST is added, default 1; 0 selects the baseline path and check enables verification. Its default is supported by the same-build comparison, but the net gain against the base remains unproven.
Reviewed:
08bdce51e4against56823e27a1: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the reported ledger and runs, the fix diff, and portions of the changed cache, renderer and test code. The combined output for the full changed files was truncated; the remaining changed code and its dependencies were not fully reviewed. docs/review-checklist.md is absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. The author reports compiler and game-free checks passing; CI is still running.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Independent Linux Market A/B on PR head
08bdce51e4df.RX_VK_PIPE_FASTdefaults to on in this revision.Within the run-to-run spread. Median average FPS changed by +2.13%.
0)1)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.
@rebase
I rebased this pull request onto
main(54877b1a4d): the new head is2a27568797.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.
08bdce51e42a27568797Beanstalk test farm
Commit
2a27568· 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 reported speedup compares two modes of the PR build, so the net gain against the actual base remains unproven. Other affected Tier 1 systems and the non-EDS3 path still need live coverage. Recommend approval; not approved on the forge.
The change caches graphics pipeline lookups and shader masks to reduce per-draw CPU work, at the cost of a larger per-thread cache and more lookup logic.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:3512: Measure the overall gain against the actual base at player settings. When: The reported 0.99% comparison uses this branch for both sides; its off path also has the new mode selection and TLS state, so it does not establish the effect of the complete change against main. Do: Run interleaved base and head builds in the target and heavy scenes at the device's normal resolution and Auto-selected quality, reporting average and 1% low fps, frame times and pipeline time.gpu/vk/pipe_fast.h:197: Exercise the new lookup on the remaining affected Tier 1 systems and the non-EDS3 path. When: The cache selects and compares pipeline state differently when EDS3 features are unavailable; those live renderer paths remain untested. Do: Run the lookup in game on the remaining affected Tier 1 systems and a non-EDS3 device, including check mode.Since the last review (on
08bdce51e4)Still open: L2 (Measure the overall gain against the actual base at player settings.); L3 (Exercise the new lookup on the remaining affected Tier 1 systems and the non-EDS3 path.)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven against the base. The PR reports a 0.99% FPS gain and 0.125 ms lower mean frame time over 147 paired Windows periods, but both sides use the PR build. An independent Linux PR-build comparison reported a 2.13% median FPS gain within run-to-run spread.
Other systems: The lookup affects Vulkan rendering across GPU vendors and operating systems, including non-EDS3 devices. Windows live check mode reported no mismatches, and Linux NVIDIA received an independent run; other Tier 1 systems and non-EDS3 live coverage remain pending.
Switches: RX_VK_PIPE_FAST is added, default on; 0 selects the baseline lookup and check validates both paths. The default's net benefit against the base remains unproven.
Reviewed:
2a27568797against54877b1a4d: Read AGENTS.md, CONTRIBUTING.md, the PR template, the pipeline cache implementation and relevant graphics_pipeline code; inspected the switch and shutdown integration. The full renderer files, tests, and recorded runs were not read in full. docs/review-checklist.md is absent.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run the project were executed. CI is still running; the author reports Windows check-mode and game-free test passes.
Overlaps and merge order: Not checked.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.
AMD Lab Market A/B on PR head
2a2756879764, usingRX_VK_PIPE_FAST=0andRX_VK_PIPE_FAST=1on the same build.Inconclusive with this run-to-run variation. Median average FPS changed by -0.99%.
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 12 / 72 / 14 frames on side A and 40 / 26 / 24 on side B across the three captures. The FPS and tail numbers include those frames.
This was merged (head
2a27568, after BeanBot's rebase) before I answered. Here is a summary of the results posted since. The description can't be edited after the merge (our forge tooling refuses merged PRs), so they are recorded here.Test farm (Beanstalk, run on
08bdce5, main against the PR): passed on all 4 reports, with no crashes and no check-mode mismatch. Frame time p99 (ms), main → PR:RX_VK_PIPE_FAST=checkThe NVIDIA, Intel and Steam Deck jobs had not reported when it merged.
@HumanBean's A/Bs,
RX_VK_PIPE_FAST=0against=1on the same build: thanks.On the RX 580 tail: that is one system, and the farm's two RADV PCs and the RTX 3090 show equal or better tails. So I'm not changing the shipped default on this data. One finding argues against the cache causing the tail: on every farm PC, check mode found the L1 cache's key equal to the baseline
pipeline_keyfor every draw (0 key mismatches in 1.3M–13M checks), so the cache doesn't ask for pipelines the baseline wouldn't. The RX 580 captures also still had pipeline or shader activity after warm-up on both sides (12/72/14 off, 40/26/24 on). Next to check: an RX 580 run withRX_VK_PIPE_FAST=checkand a longer warm-up, to see whether the slow frames are compiles (the same on both sides) or lookups.BeanBot's testing items:
No code change and nothing run from my side for this reply.