fix(vk): map global loads across the reserved register boundary #2179

Merged
HumanBean merged 3 commits from nachochee3e/Longshot:fix/203-vector-load-register-boundary into main 2026-11-23 00:46:29 +00:00
Contributor

Summary

Fixes #203. In frozen Zora's Domain as Adult Link, look down from the stairs at the snow-covered rocks around the round pedestal. Parts of the rocks flash pink and green.

The mesh shader loads four registers starting at R204. Its reserved range begins at R206, so the upper two values must go to extended registers 462 and 463. The Ampere-to-Maxwell translator checked only R204 and skipped the register map. This applies nachochee3e's fix to check every destination a global load writes. Original patch and in-game comparison

Testing

Tested: On November 22, I checked the rocks around the round pedestal in frozen Zora's Domain as Adult Link. They flashed pink and green on main (a2dc538) and looked correct on PR #2179 (5888b3a). Both runs used native mesh shaders on Windows with an RTX 4070 SUPER and NVIDIA driver 621.14.

I repeated the comparison using copies of the same adult save and a scripted camera tilt. On a2dc538, the rocks at Link’s feet showed pink and green patches. On 5888b3a, they kept their snow shading with native mesh shaders and with RX_VK_MESH_SHADERS=compute. The renderer log confirmed the compute path, and the rocks kept their color in four frames sampled during a camera pan. Matching screenshots on the current builds

The game-free register-map regression now covers register-address and uniform-address global loads. I compiled the same test at 62dd3d9 against the headers from both revisions using LLVM-MinGW Clang and MSVC on Windows. Both 128-bit cases failed on main (a2dc538) and passed on the PR, where one prefix covers R206–R207. All four 32-bit and 64-bit controls passed on both revisions. The strict Windows runner also passed the updated test. Commit 62dd3d9 changes only the test. The in-game comparisons above used the same renderer code.

I also ran both translator revisions locally on the full mesh shader from the report, bc3f20d8b42b27c1. At byte offset 0x81b0, main emitted no register-map prefix. The PR emitted a single run mapping R206–R207 to extended registers 462–463.

The patch author's earlier in-game run on this PC used the nightly-411 Vulkan renderer, a nightly-407 host, and the same manual save for both captures. On Windows 11 with an RTX 4070 SUPER, driver 621.14, and native mesh shaders, the patched renderer restored blue-white shading and the rocks retained their surface detail. The patch in that comparison is byte-for-byte identical to the supplied attachment. Before and after

The strict Windows checks selected for the changed files passed 16 of 17. The same failure reproduced on untouched main: test_lower_atomg_cas.py expects the IR opcode table to have a literal size of 544, while main declares it with NUM_OPCODES.

Across the full strict Windows suite and its reruns, 844 checks passed, 58 failed, and 50 were skipped for this platform. All 58 failures also reproduced on untouched main and are listed below. The last outstanding check, tests/test_job_queue.py, passed in 4.3 seconds at 5888b3a when run in its own Windows process group with localhost ping available. In the restricted runner, the same fixture errored on both revisions because its temporary ping process exited before the test could find it. The control-bridge test passed on an isolated rerun after a temporary log-file sharing error. The no-GPU startup fixture passed using an ASCII-only temporary directory in the workspace.

Checks that also failed on main
  • nx2/test_import_windows.py
  • nx2/test_nup_codec.py
  • nx2/test_nup_paths.py
  • nx2/test_nup_read_name.py
  • nx2/test_nup_stand_in.py
  • nx2/test_nup_verify.py
  • tests/test_auto_handheld.py
  • tests/test_build_long_paths.py
  • tests/test_close_waits_for_save.py
  • tests/test_compile_zero_byte.py
  • tests/test_control.py
  • tests/test_copy_writable.py
  • tests/test_crash_dialog.py
  • tests/test_damaged_rom_files.py
  • tests/test_dev_ab.py
  • tests/test_dev_build.py
  • tests/test_dev_migrate.py
  • tests/test_dev_packs.py
  • tests/test_dev_update.py
  • tests/test_discover.py
  • tests/test_draw_stream_visibility.py
  • tests/test_fs_save_commit.py
  • tests/test_fsr3fi_hud_layer.py
  • tests/test_fsr3fi_hudless_colour.py
  • tests/test_fsr_uniform_ownership.py
  • tests/test_game_menu_mouse_buttons.py
  • tests/test_guest_copies.py
  • tests/test_hold_toggle.py
  • tests/test_input_movie.py
  • tests/test_insn_fixed_convert.py
  • tests/test_lift_lookups.py
  • tests/test_linux_preflight.py
  • tests/test_long_paths.py
  • tests/test_lower_atomg_cas.py
  • tests/test_make_game_cache.py
  • tests/test_menu_i18n.py
  • tests/test_menu_keys.py
  • tests/test_menu_slider_ends.py
  • tests/test_native_zstd.py
  • tests/test_options_path.py
  • tests/test_pads_after_menu.py
  • tests/test_perf_report.py
  • tests/test_pipeline_cache_file.py
  • tests/test_portable_builder_home.py
  • tests/test_portable_builder_startup.py
  • tests/test_prepare_at_build.py
  • tests/test_prompt_guide_lines.py
  • tests/test_prompt_hand_guides.py
  • tests/test_prompt_picture_tint.py
  • tests/test_prompt_speed.py
  • tests/test_recording_admission.py
  • tests/test_sampler_admission.py
  • tests/test_sdiv_overflow.py
  • tests/test_sim_turf_pools.py
  • tests/test_switch_table.py
  • tests/test_tls_objects.py
  • tests/test_vibration_menu.py
  • tests/test_walk.py

Still to test:

  • On Linux with NVIDIA, on Windows and Linux with an AMD RX 6000–9000 card (Mesa RADV on Linux), and on Steam Deck, repeat the frozen-domain comparison by hand. Check that the foreground rocks retain their snow shading as the camera moves.

Measurements

Verdict: The failing 128-bit load now writes both upper destination registers where the lighting calculation reads them.

Load at R204 with the reserved range starting at R206 Before: main @ a2dc538 After: this PR @ 62dd3d9
32-bit and 64-bit No prefix, as expected No prefix, as expected
128-bit Missing prefix One prefix covering R206–R207

Risks

Both register-address and uniform-address global loads use this check. Other shaders whose global loads straddle the reserved range can also change. Issue #2243 tracks the local-load case in four depth and shadow mesh shaders and documents the synthetic shared-load case. Updating the translator changes the shader-cache stamp, so the next start rebuilds cached shaders. Reverting the translator change restores the previous behavior.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Screenshots of the same spot on main and here, for a change that shows on screen. Main and PR captures
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Complete the remaining in-game checks. The other Tier 1 configurations listed under Still to test remain open.
    • Repeat the pedestal check with the compute mesh fallback on the Windows RTX 4070 SUPER.
  • Verify affected Tier 1 hardware. Windows RTX 4070 SUPER passed with driver 621.14. NVIDIA on Linux, AMD desktop on Windows and Linux, and Steam Deck remain open.
  • Obtain review approval.
  • Confirm CI passes on the PR head.
## Summary Fixes #203. In frozen Zora's Domain as Adult Link, look down from the stairs at the snow-covered rocks around the round pedestal. Parts of the rocks flash pink and green. The mesh shader loads four registers starting at R204. Its reserved range begins at R206, so the upper two values must go to extended registers 462 and 463. The Ampere-to-Maxwell translator checked only R204 and skipped the register map. This applies nachochee3e's fix to check every destination a global load writes. [Original patch and in-game comparison](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/203#issuecomment-45300) ## Testing **Tested:** On November 22, I checked the rocks around the round pedestal in frozen Zora's Domain as Adult Link. They flashed pink and green on `main` (`a2dc538`) and looked correct on PR #2179 (`5888b3a`). Both runs used native mesh shaders on Windows with an RTX 4070 SUPER and NVIDIA driver 621.14. I repeated the comparison using copies of the same adult save and a scripted camera tilt. On `a2dc538`, the rocks at Link’s feet showed pink and green patches. On `5888b3a`, they kept their snow shading with native mesh shaders and with `RX_VK_MESH_SHADERS=compute`. The renderer log confirmed the compute path, and the rocks kept their color in four frames sampled during a camera pan. [Matching screenshots on the current builds](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2179#issuecomment-71440) The game-free register-map regression now covers register-address and uniform-address global loads. I compiled the same test at `62dd3d9` against the headers from both revisions using LLVM-MinGW Clang and MSVC on Windows. Both 128-bit cases failed on main (`a2dc538`) and passed on the PR, where one prefix covers R206–R207. All four 32-bit and 64-bit controls passed on both revisions. The strict Windows runner also passed the updated test. Commit `62dd3d9` changes only the test. The in-game comparisons above used the same renderer code. I also ran both translator revisions locally on the full mesh shader from the report, `bc3f20d8b42b27c1`. At byte offset `0x81b0`, main emitted no register-map prefix. The PR emitted a single run mapping R206–R207 to extended registers 462–463. The patch author's earlier in-game run on this PC used the nightly-411 Vulkan renderer, a nightly-407 host, and the same manual save for both captures. On Windows 11 with an RTX 4070 SUPER, driver 621.14, and native mesh shaders, the patched renderer restored blue-white shading and the rocks retained their surface detail. The patch in that comparison is byte-for-byte identical to the supplied attachment. [Before and after](https://git.magicbean.dev/attachments/8e7da227-074c-43d9-993a-e5c1d238111c) The strict Windows checks selected for the changed files passed 16 of 17. The same failure reproduced on untouched main: `test_lower_atomg_cas.py` expects the IR opcode table to have a literal size of 544, while main declares it with `NUM_OPCODES`. Across the full strict Windows suite and its reruns, 844 checks passed, 58 failed, and 50 were skipped for this platform. All 58 failures also reproduced on untouched main and are listed below. The last outstanding check, `tests/test_job_queue.py`, passed in 4.3 seconds at `5888b3a` when run in its own Windows process group with localhost ping available. In the restricted runner, the same fixture errored on both revisions because its temporary ping process exited before the test could find it. The control-bridge test passed on an isolated rerun after a temporary log-file sharing error. The no-GPU startup fixture passed using an ASCII-only temporary directory in the workspace. <details> <summary>Checks that also failed on main</summary> - `nx2/test_import_windows.py` - `nx2/test_nup_codec.py` - `nx2/test_nup_paths.py` - `nx2/test_nup_read_name.py` - `nx2/test_nup_stand_in.py` - `nx2/test_nup_verify.py` - `tests/test_auto_handheld.py` - `tests/test_build_long_paths.py` - `tests/test_close_waits_for_save.py` - `tests/test_compile_zero_byte.py` - `tests/test_control.py` - `tests/test_copy_writable.py` - `tests/test_crash_dialog.py` - `tests/test_damaged_rom_files.py` - `tests/test_dev_ab.py` - `tests/test_dev_build.py` - `tests/test_dev_migrate.py` - `tests/test_dev_packs.py` - `tests/test_dev_update.py` - `tests/test_discover.py` - `tests/test_draw_stream_visibility.py` - `tests/test_fs_save_commit.py` - `tests/test_fsr3fi_hud_layer.py` - `tests/test_fsr3fi_hudless_colour.py` - `tests/test_fsr_uniform_ownership.py` - `tests/test_game_menu_mouse_buttons.py` - `tests/test_guest_copies.py` - `tests/test_hold_toggle.py` - `tests/test_input_movie.py` - `tests/test_insn_fixed_convert.py` - `tests/test_lift_lookups.py` - `tests/test_linux_preflight.py` - `tests/test_long_paths.py` - `tests/test_lower_atomg_cas.py` - `tests/test_make_game_cache.py` - `tests/test_menu_i18n.py` - `tests/test_menu_keys.py` - `tests/test_menu_slider_ends.py` - `tests/test_native_zstd.py` - `tests/test_options_path.py` - `tests/test_pads_after_menu.py` - `tests/test_perf_report.py` - `tests/test_pipeline_cache_file.py` - `tests/test_portable_builder_home.py` - `tests/test_portable_builder_startup.py` - `tests/test_prepare_at_build.py` - `tests/test_prompt_guide_lines.py` - `tests/test_prompt_hand_guides.py` - `tests/test_prompt_picture_tint.py` - `tests/test_prompt_speed.py` - `tests/test_recording_admission.py` - `tests/test_sampler_admission.py` - `tests/test_sdiv_overflow.py` - `tests/test_sim_turf_pools.py` - `tests/test_switch_table.py` - `tests/test_tls_objects.py` - `tests/test_vibration_menu.py` - `tests/test_walk.py` </details> **Still to test:** - On Linux with NVIDIA, on Windows and Linux with an AMD RX 6000–9000 card (Mesa RADV on Linux), and on Steam Deck, repeat the frozen-domain comparison by hand. Check that the foreground rocks retain their snow shading as the camera moves. ## Measurements **Verdict:** The failing 128-bit load now writes both upper destination registers where the lighting calculation reads them. | Load at R204 with the reserved range starting at R206 | Before: main @ a2dc538 | After: this PR @ 62dd3d9 | | --- | --- | --- | | 32-bit and 64-bit | No prefix, as expected | No prefix, as expected | | 128-bit | Missing prefix | One prefix covering R206–R207 | ## Risks Both register-address and uniform-address global loads use this check. Other shaders whose global loads straddle the reserved range can also change. [Issue #2243](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2243) tracks the local-load case in four depth and shadow mesh shaders and documents the synthetic shared-load case. Updating the translator changes the shader-cache stamp, so the next start rebuilds cached shaders. Reverting the translator change restores the previous behavior. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. [Main and PR captures](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2179#issuecomment-71440) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Complete the remaining in-game checks. The other Tier 1 configurations listed under *Still to test* remain open. - [x] Repeat the pedestal check with the compute mesh fallback on the Windows RTX 4070 SUPER. - [ ] Verify affected Tier 1 hardware. Windows RTX 4070 SUPER passed with driver 621.14. NVIDIA on Linux, AMD desktop on Windows and Linux, and Steam Deck remain open. - [ ] Obtain review approval. - [ ] Confirm CI passes on the PR head.
Assisted-by: OpenAI Codex
fix(vk): map global loads across the reserved register boundary
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 6s
beanstalk/approval waiting for a BigBean's 👍 on the request
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
5888b3a476
Use the full destination width to decide whether a global load needs a register-map prefix. The affected mesh shader then writes the two extended registers used to light the snow-covered rocks.

Assisted-by: OpenAI Codex
Author
Contributor

Tested in game: The patch author compared the same save in frozen adult Zora's Domain on this PC using the nightly-411 Vulkan renderer on a nightly-407 host (Windows 11, RTX 4070 SUPER, NVIDIA 621.14, native mesh shaders). The rocks around the pedestal changed from pink and green to blue-white with the surface detail intact. See the comparison in issue 203. The regression was rerun separately on this PR head.

Tested in game: The patch author compared the same save in frozen adult Zora's Domain on this PC using the nightly-411 Vulkan renderer on a nightly-407 host (Windows 11, RTX 4070 SUPER, NVIDIA 621.14, native mesh shaders). The rocks around the pedestal changed from pink and green to blue-white with the surface detail intact. See the comparison in issue 203. The regression was rerun separately on this PR head.
Author
Contributor

Compared the rocks at the foot of the stairs in frozen Zora’s Domain using the same adult save and downward camera tilt on Windows 11 with an RTX 4070 SUPER and NVIDIA driver 621.14. Look at the rocks on either side of Link’s boots. On main they have pink and green patches. On the PR they keep their snow shading with both native mesh shaders and the compute fallback.

Main a2dc538, native mesh shaders

Main with pink and green patches on the foreground rocks

PR 5888b3a, native mesh shaders

PR with snow-colored rocks at the same spot

PR 5888b3a, compute mesh fallback

PR with the same snow shading on the compute fallback

With RX_VK_MESH_SHADERS=compute, the renderer log confirmed that the game used the compute path. The snow kept its color in four additional frames sampled while panning the camera.

Compared the rocks at the foot of the stairs in frozen Zora’s Domain using the same adult save and downward camera tilt on Windows 11 with an RTX 4070 SUPER and NVIDIA driver 621.14. Look at the rocks on either side of Link’s boots. On `main` they have pink and green patches. On the PR they keep their snow shading with both native mesh shaders and the compute fallback. **Main `a2dc538`, native mesh shaders** ![Main with pink and green patches on the foreground rocks](https://git.magicbean.dev/attachments/c938d411-688d-4932-b230-8cb65d047805) **PR `5888b3a`, native mesh shaders** ![PR with snow-colored rocks at the same spot](https://git.magicbean.dev/attachments/50b2771b-c183-4a79-be74-45fed13a9f72) **PR `5888b3a`, compute mesh fallback** ![PR with the same snow shading on the compute fallback](https://git.magicbean.dev/attachments/253f5a64-015d-4705-a1c2-17346c9c1516) With `RX_VK_MESH_SHADERS=compute`, the renderer log confirmed that the game used the compute path. The snow kept its color in four additional frames sampled while panning the camera.
nachochee3e changed title from WIP: fix(vk): map vector loads across the reserved register boundary to fix(vk): map vector loads across the reserved register boundary 2026-11-22 03:09:29 +00:00
Author
Contributor

@Beanstalk Please compare main (a2dc538) and this PR (5888b3a) in frozen Zora’s Domain. We still need coverage on NVIDIA RTX on Linux, AMD RX 6000–9000 on Windows and Linux (Mesa RADV on Linux), and Steam Deck.

Load adult Link in frozen Zora’s Domain. At the round pedestal by the stairs, tilt the camera down toward the snow-covered rocks on either side of Link, then pan slowly. Please capture the same view on each build and report the GPU, OS, driver, and mesh path used. The regression on main is pink and green patches on those rocks. On the PR they should keep their snow shading as the camera moves. The Windows RTX 4070 SUPER comparison shows the location and expected result. Reference screenshots

@Beanstalk Please compare `main` (`a2dc538`) and this PR (`5888b3a`) in frozen Zora’s Domain. We still need coverage on NVIDIA RTX on Linux, AMD RX 6000–9000 on Windows and Linux (Mesa RADV on Linux), and Steam Deck. Load adult Link in frozen Zora’s Domain. At the round pedestal by the stairs, tilt the camera down toward the snow-covered rocks on either side of Link, then pan slowly. Please capture the same view on each build and report the GPU, OS, driver, and mesh path used. The regression on `main` is pink and green patches on those rocks. On the PR they should keep their snow shading as the camera moves. The Windows RTX 4070 SUPER comparison shows the location and expected result. [Reference screenshots](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2179#issuecomment-71440)
Member

@nachochee3e only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 5888b3a, and the PR has changed since (62dd3d9), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@nachochee3e only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `5888b3a`, and the PR has changed since (`62dd3d9`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Author
Contributor

Could a maintainer review the vector-load register mapping fix for #203 at 5888b3a and approve the fork workflows so CI can run? The regression test covers a 128-bit load starting at R204 that crosses the reserved boundary at R206. The in-game comparison on Windows shows the snow shading restored on both native mesh shaders and the compute fallback. Comparison screenshots

Nine jobs are pending. The Python source-check job in run 48777 says approval is required to run workflows for this fork PR. Please also check the pending Guide screenshots and Third-party parts runs. CI run 48777 · Guide screenshots · Third-party parts

Could a maintainer review the vector-load register mapping fix for #203 at `5888b3a` and approve the fork workflows so CI can run? The regression test covers a 128-bit load starting at R204 that crosses the reserved boundary at R206. The in-game comparison on Windows shows the snow shading restored on both native mesh shaders and the compute fallback. [Comparison screenshots](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2179#issuecomment-71440) Nine jobs are pending. The Python source-check job in run 48777 says approval is required to run workflows for this fork PR. Please also check the pending Guide screenshots and Third-party parts runs. [CI run 48777](https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/48777/jobs/1) · [Guide screenshots](https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/48778/jobs/0) · [Third-party parts](https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/48779/jobs/0)
dazemc left a comment

The fix is right for the reported global load, and the new test fails on main for exactly the reported reason — but the same boundary crossing is left in the local and shared vector loads.

The reported bug and the fix. 0x381/0x981 (register- and uniform-address LDG) at R204 with the reserved window starting at R206. The first pass only asked reg >= reserved_base, so R204 looked below the window, any_high stayed false, and the two upper destinations (R206–R207) never went through the register map. The new 2/4-register width makes a 128-bit load at R204 set any_high, so it gets one REGMAP_nx2 prefix for R206–R207 → extended 462–463. That is the reported mesh shader.

Red on main, green here. I applied the PR to a2dc538 and compiled regmap_marker_test.cpp against both headers. With main's header it prints incorrect register map for 128-bit LDG at R204 / FAILED; the 32- and 64-bit controls pass. With the PR's header it prints ok. The new case fails on main for the bug's reason, not incidentally.

The gap (strongest finding). load_dest covers only 0x381/0x981, but 0x983 (LDL) and 0x984 (LDS) also write 1/2/4 destination registers, and this file already models them that way (writes_link around line 3376, and their size→words lowering). A 128-bit LDL/LDS at R204 with the same UR36 reserved base still takes the old reg >= reserved_base test: any_high stays false, no prefix is emitted, and the upper destinations are written as plain R206/R207 — the same reserved window. I lowered both through the PR's header:

LDG.128 (0x381) R204, [R8]: 4 words, register_map_words=1  (prefix for R206-R207)
LDL.128 (0x983) R204, [R8]: 6 words, register_map_words=0  (ef44 words name R204, R205, R206, R207)
LDS.128 (0x984) R204, [R8]: 3 words, register_map_words=0  (ef4e, width 6: writes R204-R207)

So "a vector load crossing the reserved boundary" is not fully closed. The title says vector loads; either extend the width to 0x983/0x984 (the second loop's span_of(204) is already 4, so only the first-loop width is missing) or narrow the title/claim to global loads and file the local/shared case. It is not the reported mesh shader, but it is the same mechanism and the same corruption.

Test. Only 0x381 is exercised; 0x981, which the fix also changes, has no test — add the uniform-address case. The 32/64-bit controls are good; a 64-bit load with an odd reserved base (e.g. 205) would be a second boundary. Add LDL/LDS if that scope is taken.

Mapping. No existing mapping is widened unintentionally: width is 1 for every opcode other than 0x381/0x981, which is exactly the old test, and the second loop still marks only numbers at or above the base. The pre-existing regmap test and both controls pass on the PR.

x86-64 / ARM64. The change is pure integer/bit logic with no host conditional, so both hosts lower the same words. Only Windows x86-64 was run (LLVM-MinGW and MSVC); there is no ARM64 build. The Linux/AMD/Steam Deck in-game checks in Still to test remain open, and CI on 5888b3a is still pending (blocked on approval), per the commit status.

Already solved? No: main still has the old reg >= reserved_base check, the new test fails there, and no other open or merged PR covers it. #203 is still open.

No approval, no claim.

**The fix is right for the reported global load, and the new test fails on main for exactly the reported reason — but the same boundary crossing is left in the local and shared vector loads.** **The reported bug and the fix.** `0x381`/`0x981` (register- and uniform-address `LDG`) at R204 with the reserved window starting at R206. The first pass only asked `reg >= reserved_base`, so R204 looked below the window, `any_high` stayed false, and the two upper destinations (R206–R207) never went through the register map. The new 2/4-register width makes a 128-bit load at R204 set `any_high`, so it gets one `REGMAP_nx2` prefix for R206–R207 → extended 462–463. That is the reported mesh shader. **Red on main, green here.** I applied the PR to `a2dc538` and compiled `regmap_marker_test.cpp` against both headers. With main's header it prints `incorrect register map for 128-bit LDG at R204` / `FAILED`; the 32- and 64-bit controls pass. With the PR's header it prints `ok`. The new case fails on main for the bug's reason, not incidentally. **The gap (strongest finding).** `load_dest` covers only `0x381`/`0x981`, but `0x983` (LDL) and `0x984` (LDS) also write 1/2/4 destination registers, and this file already models them that way (`writes_link` around line 3376, and their size→words lowering). A 128-bit LDL/LDS at R204 with the same UR36 reserved base still takes the old `reg >= reserved_base` test: `any_high` stays false, no prefix is emitted, and the upper destinations are written as plain R206/R207 — the same reserved window. I lowered both through the PR's header: ``` LDG.128 (0x381) R204, [R8]: 4 words, register_map_words=1 (prefix for R206-R207) LDL.128 (0x983) R204, [R8]: 6 words, register_map_words=0 (ef44 words name R204, R205, R206, R207) LDS.128 (0x984) R204, [R8]: 3 words, register_map_words=0 (ef4e, width 6: writes R204-R207) ``` So "a vector load crossing the reserved boundary" is not fully closed. The title says `vector loads`; either extend the width to `0x983`/`0x984` (the second loop's `span_of(204)` is already 4, so only the first-loop width is missing) or narrow the title/claim to global loads and file the local/shared case. It is not the reported mesh shader, but it is the same mechanism and the same corruption. **Test.** Only `0x381` is exercised; `0x981`, which the fix also changes, has no test — add the uniform-address case. The 32/64-bit controls are good; a 64-bit load with an odd reserved base (e.g. 205) would be a second boundary. Add LDL/LDS if that scope is taken. **Mapping.** No existing mapping is widened unintentionally: `width` is 1 for every opcode other than `0x381`/`0x981`, which is exactly the old test, and the second loop still marks only numbers at or above the base. The pre-existing regmap test and both controls pass on the PR. **x86-64 / ARM64.** The change is pure integer/bit logic with no host conditional, so both hosts lower the same words. Only Windows x86-64 was run (LLVM-MinGW and MSVC); there is no ARM64 build. The Linux/AMD/Steam Deck in-game checks in Still to test remain open, and CI on `5888b3a` is still pending (blocked on approval), per the commit status. **Already solved?** No: `main` still has the old `reg >= reserved_base` check, the new test fails there, and no other open or merged PR covers it. #203 is still open. No approval, no claim.
test(vk): cover uniform-address global loads at the register boundary
Some checks failed
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval can't be tested as asked: see the farm's comment
62dd3d97c4
Exercise the 128-bit LDG at R204 with a uniform address, alongside the register-address form and the 32-bit and 64-bit controls.

Assisted-by: OpenAI Codex
nachochee3e changed title from fix(vk): map vector loads across the reserved register boundary to fix(vk): map global loads across the reserved register boundary 2026-11-22 11:45:20 +00:00
Author
Contributor

@Beanstalk Please repeat the frozen Zora’s Domain comparison for #203 on main (a2dc538) and the current PR head (62dd3d9). The previous request was tied to 5888b3a. The new commit adds a regression test for the uniform-address global load. The renderer code is identical to the version already tested on Windows with an RTX 4070 SUPER.

The outstanding configurations are NVIDIA RTX on Linux, AMD RX 6000–9000 on Windows and Linux (Mesa RADV on Linux), and Steam Deck. As Adult Link, stand at the round pedestal by the stairs in frozen Zora’s Domain. Look down at the snow-covered rocks beside Link and pan slowly. Please report whether the pink and green flashing seen on main clears on the PR, along with the GPU, OS, driver, and mesh path. Reference screenshots

@Beanstalk Please repeat the frozen Zora’s Domain comparison for #203 on `main` (`a2dc538`) and the current PR head (`62dd3d9`). The previous request was tied to `5888b3a`. The new commit adds a regression test for the uniform-address global load. The renderer code is identical to the version already tested on Windows with an RTX 4070 SUPER. The outstanding configurations are NVIDIA RTX on Linux, AMD RX 6000–9000 on Windows and Linux (Mesa RADV on Linux), and Steam Deck. As Adult Link, stand at the round pedestal by the stairs in frozen Zora’s Domain. Look down at the snow-covered rocks beside Link and pan slowly. Please report whether the pink and green flashing seen on main clears on the PR, along with the GPU, OS, driver, and mesh path. [Reference screenshots](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2179#issuecomment-71440)
Member

@nachochee3e only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@nachochee3e only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Contributor

@HumanBean: #203's pink/green rocks fix is ready for the fork CI and a review at 62dd3d9; the earlier ask was for 5888b3a.

  • Fixed: global loads crossing the reserved window at R206 now map both upper destinations (R206-R207 -> 462-463); the title is narrowed to global loads, with the local/shared case in #2243.
  • Evidence: in-game comparison on Windows RTX 4070 SUPER: pink/green on main a2dc538, correct on the PR with native mesh shaders and the compute fallback; the new regmap test fails on main and passes here, and the full Windows run had 844 passed, 58 failures all reproduced on main, 50 skipped.
  • Review: the review asked for LDL/LDS scope and a uniform-address test; the head since adds that test and narrows the claim.
  • Wanted: approve the fork CI runs and review 62dd3d9. Nine fork-CI checks are blocked pending approval; the Test Farm request is also waiting for a BigBean, separate from this ask.
@HumanBean: #203's pink/green rocks fix is ready for the fork CI and a review at `62dd3d9`; the earlier ask was for `5888b3a`. - Fixed: global loads crossing the reserved window at R206 now map both upper destinations (R206-R207 -> 462-463); the title is narrowed to global loads, with the local/shared case in #2243. - Evidence: [in-game comparison](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2179#issuecomment-71440) on Windows RTX 4070 SUPER: pink/green on main `a2dc538`, correct on the PR with native mesh shaders and the compute fallback; the new regmap test fails on main and passes here, and the full Windows run had 844 passed, 58 failures all reproduced on main, 50 skipped. - Review: [the review](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2179#issuecomment-72729) asked for LDL/LDS scope and a uniform-address test; the head since adds that test and narrows the claim. - Wanted: approve the fork CI runs and review `62dd3d9`. Nine fork-CI checks are blocked pending approval; the Test Farm request is also waiting for a BigBean, separate from this ask.
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported rock corruption is fixed in the Windows NVIDIA comparison, and the regression test exercises both global-load address forms. The affected Tier 1 configurations and head CI still need results before merge. Recommend approval; not approved on the forge.

Maps the upper destinations of global loads that cross the reserved register boundary, preventing the reported incorrect rock shading. The change adds a small amount of translator logic and invalidates the shader cache.

Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)

  • L1: The Linux NVIDIA path still needs the affected Tier 1 in-game check. When: The changed translator also produces shaders on Linux NVIDIA; the supplied comparison only covers Windows NVIDIA. Do: Compare main and the PR at the frozen-domain rocks on Linux NVIDIA, including a camera pan, and report the driver and mesh path.
  • L2: The Windows and Linux AMD paths still need the affected Tier 1 in-game checks. When: The same translated shader runs on AMD drivers, but the supplied comparison covers only NVIDIA. Do: Compare main and the PR at the frozen-domain rocks on AMD RX 6000–9000 on Windows and Linux with RADV, including a camera pan.
  • L3: The Steam Deck path still needs the affected Tier 1 in-game check. When: The translator change also affects shaders on Steam Deck, which is not covered by the supplied Windows run. Do: Compare main and the PR at the frozen-domain rocks on Steam Deck, including a camera pan and the mesh path used.

Checks: Still running: 9 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes. The PR reports pink and green rocks on main and correct snow shading on the same Windows RTX 4070 SUPER setup with the PR, using both native and compute mesh paths. Its game-free 128-bit cases fail on main and pass on the PR; the 32-bit and 64-bit controls pass on both.

Other systems: The translator is shared across GPUs and operating systems and can change other shaders with global loads crossing the boundary. Windows NVIDIA native and compute paths were tested; Linux NVIDIA, Windows and Linux AMD, and Steam Deck remain untested. Local and shared loads have the pre-existing boundary issue tracked in #2243.

Switches: None added, changed or removed.

Reviewed: 62dd3d97c4 against a2dc538590: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the PR template, both diffs, commit messages, the complete regression test and the changed translator logic and its register-map and load-lowering context. Skimmed the remaining translator file, test runner and register-map consumer. docs/review-checklist.md and ../Tooling/AGENTS.md were absent; linked screenshots and recorded runs were not accessible.; nothing run (a code review).

Checked and fine:

  • Both changed commits record AI assistance in trailers.
  • The test uses synthetic instructions and checks the emitted register-map prefix; no game-derived output is added.
  • No renderer API, generated shader, switch table or third-party file changes.

Testing: Read-only review; no code or tests were run. Nine head CI checks are pending, and the PR records the Windows comparison and game-free test results.

Overlaps and merge order: No overlapping PR identified in the supplied material; network access was unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The reported rock corruption is fixed in the Windows NVIDIA comparison, and the regression test exercises both global-load address forms. The affected Tier 1 configurations and head CI still need results before merge. Recommend approval; not approved on the forge. Maps the upper destinations of global loads that cross the reserved register boundary, preventing the reported incorrect rock shading. The change adds a small amount of translator logic and invalidates the shader cache. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1**: The Linux NVIDIA path still needs the affected Tier 1 in-game check. *When:* The changed translator also produces shaders on Linux NVIDIA; the supplied comparison only covers Windows NVIDIA. **Do:** Compare main and the PR at the frozen-domain rocks on Linux NVIDIA, including a camera pan, and report the driver and mesh path. - **L2**: The Windows and Linux AMD paths still need the affected Tier 1 in-game checks. *When:* The same translated shader runs on AMD drivers, but the supplied comparison covers only NVIDIA. **Do:** Compare main and the PR at the frozen-domain rocks on AMD RX 6000–9000 on Windows and Linux with RADV, including a camera pan. - **L3**: The Steam Deck path still needs the affected Tier 1 in-game check. *When:* The translator change also affects shaders on Steam Deck, which is not covered by the supplied Windows run. **Do:** Compare main and the PR at the frozen-domain rocks on Steam Deck, including a camera pan and the mesh path used. **Checks:** Still running: 9 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The PR reports pink and green rocks on main and correct snow shading on the same Windows RTX 4070 SUPER setup with the PR, using both native and compute mesh paths. Its game-free 128-bit cases fail on main and pass on the PR; the 32-bit and 64-bit controls pass on both. **Other systems:** The translator is shared across GPUs and operating systems and can change other shaders with global loads crossing the boundary. Windows NVIDIA native and compute paths were tested; Linux NVIDIA, Windows and Linux AMD, and Steam Deck remain untested. Local and shared loads have the pre-existing boundary issue tracked in #2243. **Switches:** None added, changed or removed. **Reviewed:** 62dd3d97c4a2 against a2dc53859018: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the PR template, both diffs, commit messages, the complete regression test and the changed translator logic and its register-map and load-lowering context. Skimmed the remaining translator file, test runner and register-map consumer. docs/review-checklist.md and ../Tooling/AGENTS.md were absent; linked screenshots and recorded runs were not accessible.; nothing run (a code review). **Checked and fine:** - Both changed commits record AI assistance in trailers. - The test uses synthetic instructions and checks the emitted register-map prefix; no game-derived output is added. - No renderer API, generated shader, switch table or third-party file changes. **Testing:** Read-only review; no code or tests were run. Nine head CI checks are pending, and the PR records the Windows comparison and game-free test results. **Overlaps and merge order:** No overlapping PR identified in the supplied material; network access was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Member

@Beanstalk

@Beanstalk
Member

Beanstalk test farm · ⛔ can't be tested as asked

Commit 62dd3d9 · approved by llun (untrusted) · dashboard

Not run: the farm can't test this as asked, so nothing is built or run:

The requested comparison requires a known position and camera view at the pedestal and a determination that pink and green flashing clears during a pan. The farm has no checkpoint or positioning control for that exact view, and its screenshot comparison cannot judge the snow’s color or prove an improvement over a corrupted main image; the alternative can only sample nearby rendering and regressions.

⚠️ Note: The pan image is uploaded without an automatic comparison because movement can land differently between starts.
⚠️ Note: A large image difference can also reflect the intended fix, so the screenshot rule is not a direct test that the rocks are correct.
⚠️ Note: The farm plan does not run the game-free register-map regression or explicitly verify the native and compute mesh paths.

What it could test instead: The alternative plan compares main and the PR in adult Zora’s Domain and Hyrule Field on the affected NVIDIA, AMD, and Steam Deck configurations. Three starts per side capture stationary images, plus an unjudged image after a camera pan; crashes or large stationary-image differences fail the plan. It takes about 35 minutes per tester, but cannot establish that the specific pedestal rocks have recovered their snow shading.

A member of BigBeans can comment @Beanstalk <new words> to ask for something else, or @Beanstalk test it anyway to run the plan regardless.

<!-- beanstalk:sticky --> ### Beanstalk test farm · ⛔ can't be tested as asked Commit `62dd3d9` · approved by llun (untrusted) · [dashboard](https://beanstalk.magicbean.dev/prs/2179) **Not run: the farm can't test this as asked**, so nothing is built or run: > The requested comparison requires a known position and camera view at the pedestal and a determination that pink and green flashing clears during a pan. The farm has no checkpoint or positioning control for that exact view, and its screenshot comparison cannot judge the snow’s color or prove an improvement over a corrupted main image; the alternative can only sample nearby rendering and regressions. ⚠️ **Note:** The pan image is uploaded without an automatic comparison because movement can land differently between starts. ⚠️ **Note:** A large image difference can also reflect the intended fix, so the screenshot rule is not a direct test that the rocks are correct. ⚠️ **Note:** The farm plan does not run the game-free register-map regression or explicitly verify the native and compute mesh paths. What it could test instead: The alternative plan compares main and the PR in adult Zora’s Domain and Hyrule Field on the affected NVIDIA, AMD, and Steam Deck configurations. Three starts per side capture stationary images, plus an unjudged image after a camera pan; crashes or large stationary-image differences fail the plan. It takes about 35 minutes per tester, but cannot establish that the specific pedestal rocks have recovered their snow shading. A member of `BigBeans` can comment `@Beanstalk <new words>` to ask for something else, or `@Beanstalk test it anyway` to run the plan regardless.
Member

Tested in the game on another GPU: on main the patches are there, and on this PR they're gone.

  • PC: Windows, RTX 5080 (Blackwell), NVIDIA 621.24, native mesh shaders.
  • Builds: main at 753fb5af against main with this PR's head 62dd3d9 merged. Both were packs over the same base, run through the job queue with no window.
  • Path: both runs used the same script. It loads the kokiri-start save, switches to adult and teleports to ZoraDomain_Adult. Link then walks out to the top of the stairs and the camera tilts down toward the round pedestal. After that he walks down to the foot of the building by the frozen lake. 11 screenshots were taken along the way, and Link's positions matched between the runs to within a few centimetres.

In each picture below, main is on the left and the PR is on the right.

The round pedestal by the stairs. On main, the rocks at its base have neon green, cyan and purple patches, and there are magenta specks on the snow beside the stairs. On the PR, the rocks and snow keep their snow shading.

The round pedestal: main on the left, PR on the right

The foot of the building by the frozen lake. On main, the snow has purple and magenta patches with cyan in them. On the PR, the snow is plain.

The building's foot: main on the left, PR on the right

The other 9 pairs show no other difference beyond Navi and particle noise. Neither run's log has an error, and both games closed cleanly.

This also matches a nightly-755 player report on #1045, whose video shows the same patches on an RTX 5060 Ti. Its log shows the shader bc3f20d8b42b27c1 in use.

Still untested from the list in the description: NVIDIA on Linux, AMD on Windows and Linux, and Steam Deck.

Posted by an AI agent (Claude Code) for llun.

Tested in the game on another GPU: on main the patches are there, and on this PR they're gone. - **PC:** Windows, RTX 5080 (Blackwell), NVIDIA 621.24, native mesh shaders. - **Builds:** `main` at `753fb5af` against `main` with this PR's head `62dd3d9` merged. Both were packs over the same base, run through the job queue with no window. - **Path:** both runs used the same script. It loads the `kokiri-start` save, switches to adult and teleports to `ZoraDomain_Adult`. Link then walks out to the top of the stairs and the camera tilts down toward the round pedestal. After that he walks down to the foot of the building by the frozen lake. 11 screenshots were taken along the way, and Link's positions matched between the runs to within a few centimetres. In each picture below, main is on the left and the PR is on the right. **The round pedestal by the stairs.** On main, the rocks at its base have neon green, cyan and purple patches, and there are magenta specks on the snow beside the stairs. On the PR, the rocks and snow keep their snow shading. ![The round pedestal: main on the left, PR on the right](https://git.magicbean.dev/attachments/abeff991-86b5-4af3-a274-58db872bb7d6) **The foot of the building by the frozen lake.** On main, the snow has purple and magenta patches with cyan in them. On the PR, the snow is plain. ![The building's foot: main on the left, PR on the right](https://git.magicbean.dev/attachments/456e3c7d-d764-4e61-ba98-f14674e87544) The other 9 pairs show no other difference beyond Navi and particle noise. Neither run's log has an error, and both games closed cleanly. This also matches a nightly-755 player report on #1045, whose video shows the same patches on an RTX 5060 Ti. Its log shows the shader `bc3f20d8b42b27c1` in use. Still untested from the list in the description: NVIDIA on Linux, AMD on Windows and Linux, and Steam Deck. *Posted by an AI agent (Claude Code) for llun.*
HumanBean deleted branch fix/203-vector-load-register-boundary 2026-11-23 00:46:30 +00:00
Some checks failed
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval can't be tested as asked: see the farm's comment
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2179
No description provided.