perf(vk): the guest page table's lookup in 32-bit words (RX_VK_GP_FAST32) #2839
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2839
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/gp-fast32"
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
Every global load a translated shader makes through the guest page table worked out its table entry in 64-bit integers: three subtractions of the windows' bases, three compares, and 64-bit shifts. GCN (RX 400/500, Vega) has no 64-bit add or compare, and its 64-bit shift is slow, so each load paid about 15 extra instructions before its dependent table load.
This does the same lookup in 32-bit words. Each of the table's three windows starts on a multiple of its own power-of-two size of at least 4 GB, so the address's high word alone says which window it is in,
(hi & mask) == base_hi. The entry is((hi + delta) << 20) | (lo >> 12), and the page offset is the low word's 12 bits. Every address gets the same entry and the same words as before. On the RX 580 lab PC, median fps goes up 4.6 % (41.4 to 43.3).It builds on #2515's
RX_VK_GP_FAST32(greenwafflezz, Davi Bezerra), credited with aCo-Authored-Bytrailer. From it this takes the idea and the switch name: the 32-bit window test and index forpage_loadandguest_lookup. What is new here:guest_page_fast32.h, withstatic_asserts that the windows allow it), so a window change cannot silently break the lookup.#2515's other parts (mesh fallback batching, culling, barriers, wg_warp32) are not in this PR.
Read first:
gpu/vk/eden/shader_recompiler/backend/spirv/guest_page_fast32.h, thentable_window32and its two uses inspirv_emit_context.cpp(guest_lookup,page_load).Not in this PR, from the investigation's list for address translation:
RX_VK_GP_TABLE=1). Stores and atomics keep the search becauseRX_VK_FOLLOW_STORESis off, and changing that is a behaviour change of its own.DontInlineload helpers. It is left for a follow-up.Testing
Tested: RX 580 8 GB / RADV Mesa 26.2.6 / Linux (the AMD lab PC): Market to Hyrule Field route, 3 laps a run, 3 interleaved runs each with
RX_VK_GP_FAST32=0and with the default, same build, warm caches. The screenshots at the Market and in the Field look the same on both sides. Linux build of the game and the renderer passes (lab and this PC,dev.py pack).tests/test_guest_page_fast32.pypasses: the rule in C++ at 2.28 million addresses, and the emitter's ownguest_lookupandpage_load(cut fromspirv_emit_context.cppwithpsb_load,table_windowandtable_window32, built with the repository's Sirit, valid forspirv-val) run in a small SPIR-V evaluator at 1851 addresses (window edges, page edges, 4 GB boundaries, below 4 GB, above 1 TB, random ones) over a page table with unmapped entries. Every answer matches the 64-bit rule withRX_VK_GP_FAST32unset and with 0. With the low and high words' composite extracts swapped it gives 2366 wrong answers, so the check sees the word extraction. On main46291934(rebased; only the test changed): the touched tests pass (test_switch_table's one failure, LONGSHOT_LAUNCHER_STARTUP, is main's), the Linux pack builds, and the renderer builds for Windows with llvm-mingw (longshot_vk.dll linked).Tested on the Test Farm (Beanstalk), at
8941ff29: field-and-forest (Hyrule Field and Kokiri Forest, 2 starts a side,RX_VK_GP_FAST32unset and 0 against main, pictures compared with main):RX_VK_GP_FAST32=0, main's lookup, crashed (0xC0000005, access violation, and a hang); the other ran clean. That crash is what failed the target. The farm's −536870909 is the median of that start's exit code and 0, not an exit code of its own.Still to test:
RX_VK_GP_FAST32unset vs 0, so the farm shows a GPU-bound difference (@Beanstalk, asked).@Beanstalk, the intel and linux+anv targets of the uncapped run; they wait for a tester).@Beanstalk, in the uncapped run when a Steam Deck is online).Measurements
Verdict: +4.6 % median fps on the RX 580 (GPU-bound), a gain in each of the three interleaved pairs. Stutter (1 % low) is unchanged. On an RTX 3090 at 4K (GPU-bound) it is neutral to a small gain: median 81.1 against 78.5 fps (+3.3 %), ahead in 3 of 4 pairs, within the spread. The default is on for every GPU.
Baseline: both sides are one build of this PR,
8941ff29(on main6f5f99fc): the switch set to 0 (main's 64-bit lookup, the same code) against unset.Setup: RX 580 8 GB, RADV Mesa 26.2.6, Linux; 1440p output, fixed render resolution, no upscaler, no pass timing; route: teleport to the Market, walk into Hyrule Field, walk forward 30 s, 3 laps a run; runs interleaved off/on in one build (the switch off is main's lookup); frame trace, rows after the first 600.
8941ff298941ff29dev.py ab, 2 interleaved runs each, NOISY, superseded below)On the RTX 3090 the first run was too noisy to settle NVIDIA: one run of this PR had 10 cold frames and memory stalls (the PC had about 30 GB of swap in use). The rerun,
dev.py ab --env RX_VK_GP_FAST32=0 --scene hyrule-field --runs 4, 4K native, no upscaler, uncapped, 4 interleaved pairs, 60 s each after a warm-up (dev.py ab's write-up; the swap was still in use, and 5 of the 8 runs are marked NOISY for memory stalls of 1.1 to 1.5 %):8941ff298941ff29This PR is ahead in 3 of the 4 pairs.
dev.py abcalls it within the runs' spread, so on NVIDIA it is neutral to a small gain, and not a loss. The default is on for every GPU.The 1 % low comes from texture-upload and descriptor stalls this change does not touch, and its spread is noise from run to run.
Shader statistics (RADV, GFX8, from
vkGetPipelineExecutableStatisticsKHRon the lab; counts only):The gain is in fewer instructions and shorter latency, not registers.
Test Farm, at
8941ff29(field-and-forest, median frame time, the PR's default against main on the same PC; most testers capped at 60 fps):On the 5600G
RX_VK_GP_FAST32=0matches main (33.5 → 33.4 ms, 34.8 → 34.9 ms), so the gain there is the 32-bit lookup's. The numbers above are from8941ff29on main6f5f99fc. The rebase onto46291934changes only the test, so they still hold.Risks
static_assert).RX_VK_GP_FAST32=0.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (tests/run_all.py: 31 failures here, all of which also fail onmain6f5f99fcin a clean workspace on this PC, e.g. test_switch_table (LONGSHOT_LAUNCHER_STARTUP has no row), test_lifter, test_bug_report, test_crt_options. test_mesh_mode_switch and test_switches_removed failed once under load and pass alone.)main, or Measurements says why there is nothing to measure. (the switch off is main's lookup, same build)third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def. (on everywhere: +4.6 % on GCN, neutral to +3 % on the RTX 3090)tests/that reads changed source is updated, not weakened. (tests/test_mesh_fallback_pages.py and tests/test_page_table_census.py read spirv_emit_context.cpp and pass unchanged, since the 64-bit form and the constants they check stay; tests/test_switch_table.py reads switches.def, and the new row satisfies it (its one failure, LONGSHOT_LAUNCHER_STARTUP, is main's); the new tests/test_guest_page_fast32.py reads the header and builds and runs the emitter's lookup)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: RX 580 8 GB / RADV Mesa 26.2.6 / Linux: Market to Hyrule Field route, 3 laps, 3 interleaved runs each with RX_VK_GP_FAST32=0 and the default; same picture, median fps 41.4 to 43.3. RTX 3090 / Linux: dev.py ab in Hyrule Field at 4K native, uncapped, 2 runs each; renders the same, no difference in fps.
@beanstalk
Beanstalk test farm · an earlier run: commit
8941ff2(the newer results are in a comment below)Commit
8941ff2· approved by HumanBean (reviewed) · dashboard⚠️ Note: Two starts per side fit both switch modes within the run-time limit, but provide less confidence than three; the thresholds cannot establish the reported 4.6% gain. The farm cannot reproduce the reported 1440p or 4K output settings, the walking route, or the exhaustive address test in this plan.
⚠️ Note: The disabled PR lookup is intended to match main's lookup, so that comparison is chiefly a control; the default-versus-disabled comparison isolates the new lookup within the PR.
Started at 2026-11-29 23:21 UTC.
Estimate: done in about 15 min, from the queue and the testers online now; some jobs can't start yet.
linux+radvwindows+amdlinux+nvidiawindows+nvidiaintellinux+anvfield-and-forest· frame time p99 (ms)RX_VK_GP_FAST32=RX_VK_GP_FAST32=0(reference)linux+radvwindows+amdlinux+nvidiawindows+nvidiaintellinux+anvWhy it failed
windows+amd:field-and-forest · RX_VK_GP_FAST32=0 (PR only)crash:1 PR run crashedlinux+nvidia:field-and-forest · RX_VK_GP_FAST32= (PR only)screenshot.max_diff:0.1 → 0.2; 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.
windows+amd, report 2:Insufficient frame-time evidence for 14 required comparison(s). See rule results.What was tested
What will be tested · AI plan (
gpt-6.1-terra)Compare the default 32-bit guest-page lookup with the disabled 64-bit lookup and main in Hyrule Field and Kokiri Forest, using two starts per side and 20-second measurements at each place. The switch axis isolates the lookup while screenshots check for missing foliage or other rendering differences. Crashes, substantial frame-time regressions or picture differences fail the plan. Linux ANV testing will wait for a matching tester. No tester online now matches linux+anv: that target waits for one.
0(PR only).kokiri-start, then teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 10 s warm-up), teleport to Kokiri Forest, take the picture forest to compare with main, measure forest 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 `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+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+dgpuAMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAMScene: field-and-forest, from the repository's save kokiri-start; 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); field-and-forest: 2 game starts a side, field 20 s after 10 s warm-up, forest 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)6f5f99f8941ff2RX_VK_GP_FAST32= (PR only)· field · median frame time (ms)RX_VK_GP_FAST32= (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· field · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (worst 1%) (ms)Flags and settings
RX_VK_GP_FAST320As Markdown for the PR description:
Measurements on `windows+amd`, for the PR description
Verdict: fail on windows+amd (2 reports):
field-and-forest crashfailed.Hardware: 1: windows+amd+amd-proprietary+igpu+xess
AMD Radeon(TM) Graphics, 2.0.279AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM; 2: windows+amd+amd-proprietary+dgpu+xessAMD Radeon RX 6700 XT, 2.0.353AMD Ryzen 7 2700X Eight-Core Processor, 16 GB RAMScene: field-and-forest, from the repository's save kokiri-start; 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); field-and-forest: 2 game starts a side, field 20 s after 10 s warm-up, forest 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)6f5f99f8941ff2RX_VK_GP_FAST32= (PR only)· field · median frame time (ms)RX_VK_GP_FAST32= (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· field · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (worst 1%) (ms)Flags and settings
RX_VK_GP_FAST320As Markdown for the PR description:
Measurements on `linux+nvidia`, for the PR description
Verdict: fail on linux+nvidia (1 report):
field-and-forest screenshot.max_difffailed.Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 5070, 620.73.4AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMScene: field-and-forest, from the repository's save kokiri-start; 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); field-and-forest: 2 game starts a side, field 20 s after 10 s warm-up, forest 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)6f5f99f8941ff2RX_VK_GP_FAST32= (PR only)· field · median frame time (ms)RX_VK_GP_FAST32= (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· field · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (worst 1%) (ms)Flags and settings
RX_VK_GP_FAST320As Markdown for the PR description:
Measurements on `windows+nvidia`, for the PR description
Verdict: pass on windows+nvidia (2 reports): no rule failed and no PR run crashed.
Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+dlss+xess
NVIDIA GeForce RTX 4090, 621.40.013th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAMScene: field-and-forest, from the repository's save kokiri-start; 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); field-and-forest: 2 game starts a side, field 20 s after 10 s warm-up, forest 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)6f5f99f8941ff2RX_VK_GP_FAST32= (PR only)· field · median frame time (ms)RX_VK_GP_FAST32= (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· field · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (worst 1%) (ms)Flags and settings
RX_VK_GP_FAST320As Markdown for the PR description:
The testers' hardware
linux+radvAMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAMlinux+radvAMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAMwindows+amdAMD Radeon(TM) Graphics, 2.0.279AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAMwindows+amdAMD Radeon RX 6700 XT, 2.0.353AMD Ryzen 7 2700X Eight-Core Processor, 16 GB RAMlinux+nvidiaNVIDIA GeForce RTX 5070, 620.73.4AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMwindows+nvidiaNVIDIA GeForce RTX 4090, 621.40.013th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAMwindows+nvidiaNVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAMWIP: perf(vk): the guest page table's lookup in 32-bit words (RX_VK_GP_FAST32)to perf(vk): the guest page table's lookup in 32-bit words (RX_VK_GP_FAST32)@review
Recommendation: Approve. The RX 580 runs show a roughly 4.6% median FPS gain, but this shader change defaults on across GPUs and still needs the listed Windows, AMD, Intel and Steam Deck coverage before merge. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change replaces 64-bit guest page-table lookup arithmetic with 32-bit operations, retaining the old path behind a kill switch. It reduces shader instructions on the tested RX 580 at the cost of another lookup implementation and shader-cache invalidation.
Should fix (1): not blocking, but worth doing before merging.
tests/test_guest_page_fast32.py:111: The behavioral test exercises the separate C++ lookup, while the emitter is checked by searching for fragments of source text. (more on the line) Do: Test the emitted lookup's behavior, including its word extraction and both call sites, against the reference for representative addresses.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/eden/shader_recompiler/backend/spirv/spirv_emit_context.cpp:1231: The new lookup runs by default on Windows and Linux across GPU vendors, but the reported game runs cover only Linux RX 580 and RTX 3090. (more on the line) Do: Run the listed on/off picture and performance comparisons on Windows NVIDIA and AMD, Linux newer AMD, Intel, and Steam Deck, including foliage and the mesh fallback where applicable.@fixcan do L2.Checks: Failing on this head, which is behind its base, where they pass:
CI / Third-party parts and guide screenshots (pull_request),CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request),CI / Website build and checks (pull_request),CI / Game-free checks (run_all.py, part 1/2) (pull_request),CI / Game-free checks (run_all.py, part 2/2) (pull_request).@rebase(or@fix) brings it up to date and runs them again; not held against it.More: does it help, other systems, switches, what was read
Does it help: Yes on the tested RX 580: three interleaved runs reported median FPS of 41.4 off versus 43.3 on. The RTX 3090 result was within the spread; the other affected systems remain unmeasured.
Other systems: The lookup is emitted for graphics, compute, task and mesh paths, including the mesh fallback and optional followed stores and atomics. Linux RX 580 and RTX 3090 game runs are reported; Windows, newer AMD GPUs, Intel and Steam Deck still need coverage.
Switches: RX_VK_GP_FAST32 is added, default on; 0 selects the old 64-bit lookup. It has a switches.def row and is included in the program-cache stamp through the RX_VK_GP_ prefix. The default is supported by the RX 580 measurement, but its suitability on other systems remains to be measured.
Reviewed:
8941ff29deagainst6f5f99fce9: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards.md, the complete diff, commit, new header and test, and page_table_census.h. Read the changed emitter function and its nearby callers and cache-stamp logic; the remainder of spirv_emit_context.cpp and switches.def was skimmed. docs/review-checklist.md is absent. No recorded runs or generated files were changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no build, tests or project scripts were run. The reported RX 580 and RTX 3090 runs are the author's evidence.
Overlaps and merge order: #2515 is credited as prior work; its other changes are outside this pull request. No merge-order dependency was established.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -1218,0 +1228,4 @@Id in_window, slot_bytes, offset;};const auto table_window32 = [&](Id addr) {const Id words{OpBitcast(U32[2], addr)};L1 (should fix): The new lookup runs by default on Windows and Linux across GPU vendors, but the reported game runs cover only Linux RX 580 and RTX 3090.
When: A driver or GPU compiler could handle the new emitted SPIR-V differently in a graphics, compute, task or mesh shader; the existing runs would not show a resulting rendering or performance regression on that system.
Do: Run the listed on/off picture and performance comparisons on Windows NVIDIA and AMD, Linux newer AMD, Intel, and Steam Deck, including foliage and the mesh fallback where applicable.
@ -0,0 +108,4 @@ap.add_argument("--source", type=Path, default=ROOT)a = ap.parse_args()src = a.sourceemitter = (src / EMITTER).read_text(encoding="utf-8")L2 (should fix): The behavioral test exercises the separate C++ lookup, while the emitter is checked by searching for fragments of source text.
When: If the emitter's low and high composite-extract indices are swapped, the fixture still tests the correct C++ lookup and every listed source fragment remains present, even though emitted shaders use the wrong address words.
Do: Test the emitted lookup's behavior, including its word extraction and both call sites, against the reference for representative addresses.
8941ff29dedb93219a06Answering BeanBot's review (92242). forge.py can't reply inside the review's threads, so both answers are here.
L2 (92241, the emitted lookup's behaviour): done in
db93219a.tests/test_guest_page_fast32.pynow cuts the emitter's owntable_window,table_window32,guest_lookup,page_loadandpsb_loadfromspirv_emit_context.cppwithsrccut.between/blockand builds them with the repository's Sirit into a module with three helpers:guest_lookupfor a 4-byte and a 16-byte access, andpage_loadof a word. It builds the module twice, once withRX_VK_GP_FAST32unset and once with0.spirv-val --target-env vulkan1.3passes both modules.A small SPIR-V evaluator in the test runs each helper at 1851 addresses: window edges, page edges either side of an access's fit, every 4 GB boundary in and around each window, below 4 GB, above 1 TB, the top of the address space, window addresses with high bits set, and random ones. The page table has one unmapped entry in five. The evaluator checks each answer against the 64-bit rule: the device address
guest_lookuphands its access (or the miss), and the wordpage_loadreads (or 0). Both forms match everywhere, and the 32-bit form is the one taken by default. The same cut with the low and high composite-extract indices swapped gives 2366 wrong answers, and the test fails if that mutant ever passes. It needs no Vulkan, no GPU and no game. It takes about 10 s and is skipped on Windows, like test_coop_spirv, because it needs spirv-val.The branch is rebased onto main
46291934, and only the test changed. The touched tests pass; test_switch_table's one failure (LONGSHOT_LAUNCHER_STARTUP) is main's own. The Linux pack builds, and the renderer builds for Windows with llvm-mingw (longshot_vk.dll linked). I made no game runs for this push.L1 (92240, coverage): the Test Farm ran field-and-forest (Hyrule Field and Kokiri Forest, the switch unset and 0 against main) at
8941ff29:RX_VK_GP_FAST32=0, main's lookup: 0xC0000005 with a hang. The other start with 0 ran clean.=0matched main there.Next I'm asking the farm for an uncapped run in a separate comment.
@Beanstalk measure frame times uncapped (frame_rate_cap = 6, vsync off) so the GPU is the limit: Hyrule Field and Kokiri Forest with RX_VK_GP_FAST32 unset vs 0 on the PR, against main; same picture, frame time not worse. Every GPU maker online, Windows and Linux split for AMD; include Intel/ANV and a Steam Deck if one is online.
Beanstalk test farm · 🔄 testing (3 of 7 reports so far, a failure already)
Commit
db93219· approved by HumanBean (reviewed) · dashboard⚠️ Note: The PR's 0 setting uses the old lookup, so its comparison with main is largely a control; the direct PR comparison tests unset against 0.
⚠️ Note: Two starts per side fit the time limit, but the claimed 4.6% gain may be smaller than run-to-run noise, and uncapping does not guarantee a GPU bottleneck.
⚠️ Note: The farm cannot reproduce the reported 1440p or 4K output configuration, or independently exercise the game-free address-edge test in this plan.
Done (started 01:36 UTC, last report 02:18 UTC). Comment
@Beanstalkto run it again.windows+nvidialinux+nvidiawindows+amdlinux+radvintellinux+anvsteamdeckfield-and-forest· frame time p99 (ms)RX_VK_GP_FAST32=RX_VK_GP_FAST32=0(reference)windows+nvidialinux+nvidiawindows+amdlinux+radvintellinux+anvsteamdeckWhy it failed
windows+nvidia:field-and-forest · RX_VK_GP_FAST32= (PR only)screenshot.max_diff:0.0 → 0.7; limit 0.2linux+radv:field-and-forest · RX_VK_GP_FAST32= (PR only)forest.frametime_1pct_low_ms: RX_VK_GP_FAST32= vs RX_VK_GP_FAST32=0 (PR):11.8 → 15.1 (+27.7%); limit 20.0; the PR's own cells: RX_VK_GP_FAST32= against RX_VK_GP_FAST32=0 (RX_VK_GP_FAST32=0 (PR only))linux+radv:field-and-forest · RX_VK_GP_FAST32=0 (PR only)field.frametime_p50_ms.max_delta_pct:22.3 → 28.6 (+28.0%); limit 15.0linux+radv:field-and-forest · RX_VK_GP_FAST32=0 (PR only)forest.frametime_p50_ms.max_delta_pct:20.2 → 29.0 (+43.6%); limit 15.0linux+radv:field-and-forest · RX_VK_GP_FAST32=0 (PR only)field.frametime_p99_ms.max_delta_pct:24.3 → 31.0 (+27.2%); limit 20.0linux+radv:field-and-forest · RX_VK_GP_FAST32=0 (PR only)forest.frametime_p99_ms.max_delta_pct:22.5 → 32.1 (+42.8%); limit 20.0linux+radv:field-and-forest · RX_VK_GP_FAST32=0 (PR only)field.frametime_1pct_low_ms.max_delta_pct:25.3 → 35.5 (+40.5%); limit 20.0linux+radv:field-and-forest · RX_VK_GP_FAST32=0 (PR only)forest.frametime_1pct_low_ms.max_delta_pct:22.8 → 34.2 (+49.6%); limit 20.0What was tested
What will be tested · AI plan (
gpt-6.1-terra)Compare the PR with RX_VK_GP_FAST32 unset and set to 0 against main in Hyrule Field and Kokiri Forest, using uncapped frame rates and V-Sync off. Two starts per side and setting measure warmed-up frame times and compare stationary pictures; the unset setting is also compared directly with 0 on the PR. Crashes, picture differences above the tolerance, or frame-time regressions above the noise allowance fail the plan. The Intel ANV target will wait for a matching tester. No tester online now matches linux+anv: that target waits for one.
0(PR only).kokiri-start(settings vsync=2, frame_rate_cap=6), then teleport to Hyrule Field, take the picture field to compare with main, measure field for 30 s (after 10 s warm-up), teleport to Kokiri Forest, take the picture forest to compare with main, measure forest for 30 s (after 10 s warm-up); 2 runs on each side for each of 2 cells (2 game starts a run).Measurements on `windows+nvidia`, for the PR description
Verdict: fail on windows+nvidia (1 report):
field-and-forest screenshot.max_difffailed.Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu
NVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAMScene: field-and-forest, from the repository's save kokiri-start (vsync=2, frame_rate_cap=6); 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); field-and-forest: 2 game starts a side, field 30 s after 10 s warm-up, forest 30 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)4629193db93219RX_VK_GP_FAST32= (PR only)· field · median frame time (ms)RX_VK_GP_FAST32= (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· field · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (worst 1%) (ms)Flags and settings
RX_VK_GP_FAST320As Markdown for the PR description:
Measurements on `linux+radv`, for the PR description
Verdict: fail on linux+radv (2 reports):
field-and-forest forest.frametime_1pct_low_ms: RX_VK_GP_FAST32= vs RX_VK_GP_FAST32=0 (PR) (+27.7%);field-and-forest field.frametime_p50_ms.max_delta_pct (+28.0%);field-and-forest forest.frametime_p50_ms.max_delta_pct (+43.6%)failed.Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 9070 (RADV GFX1201), 26.0.8AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpuAMD Radeon RX 580 Series (RADV POLARIS10), 26.3.1AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAMScene: field-and-forest, from the repository's save kokiri-start (vsync=2, frame_rate_cap=6); 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); field-and-forest: 2 game starts a side, field 30 s after 10 s warm-up, forest 30 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)4629193db93219RX_VK_GP_FAST32= (PR only)· field · median frame time (ms)RX_VK_GP_FAST32= (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32= (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32= (PR only)· forest · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· field · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· forest · median frame time (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (p99) (ms)RX_VK_GP_FAST32=0 (PR only)· field · frame time (worst 1%) (ms)RX_VK_GP_FAST32=0 (PR only)· forest · frame time (worst 1%) (ms)Flags and settings
RX_VK_GP_FAST320As Markdown for the PR description:
The testers' hardware
windows+nvidiaNVIDIA GeForce RTX 4070, 621.24.0AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAMlinux+radvAMD Radeon RX 9070 (RADV GFX1201), 26.0.8AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAMlinux+radvAMD Radeon RX 580 Series (RADV POLARIS10), 26.3.1AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAM