Shader tests: the gather-at-a-level test reads its records through a raw view (false failure on NVIDIA) #2323

Open
github-bot wants to merge 1 commit from github-bot/gh-2323 into main AGit
Owner

@⁠Bullet18x on GitHub · 2026-11-25 10:40 UTC · original
Bullet18x:fix/gather-test-raw-view → main · +1 −1 · 1 files · 1 commits · open

Problem

emit::synthetic_tests::gathers_at_a_level_match_the_hardware fails on NVIDIA, and it looks like a gather bug. It is not one.

The test reads each lane's record (offset, u, v, level) by byte offset through a structured view (Stride::Structured(16)). On NVIDIA a raw load through a structured descriptor multiplies the offset by the stride (the bug #2178 fixes at runtime), so every lane reads zeros. Every lane then returns the gather of (0, 0) at level 0, [0, 1, 0, 0]. So does got(2), the native gather the test checks itself against. RTX 5090, driver 621.40, all 32 lanes:

hardware lane 4  u=0.0624 v=0.0936 level=0  got [0, 1, 0, 0]  want [65, 66, 34, 33]
hardware lane 20 u=0.16   v=0.2044 level=1  got [0, 1, 0, 0]  want [1066, 1067, 1035, 1034]
...

Change

The records go through a raw view (Stride::Raw), as #2178 does for stride_tests. The view's kind is incidental to what the test checks. One line.

Tested

  • RTX 5090: gathers_at_a_level_match_the_hardware passes on the hardware and on WARP. The gathers were right all along.
  • cargo test -p victory-shader --lib on that machine: 237 passed, 10 failed (was 11). The 10 are the two stride_tests (#2178) and 8 that fail only on this Windows build's WARP (10.0.28000), where the hardware matches.
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠Bullet18x** on GitHub · 2026-11-25 10:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/2323) `Bullet18x:fix/gather-test-raw-view` → `main` · +1 −1 · 1 files · 1 commits · open ## Problem `emit::synthetic_tests::gathers_at_a_level_match_the_hardware` fails on NVIDIA, and it looks like a gather bug. It is not one. The test reads each lane's record (offset, u, v, level) by byte offset through a structured view (`Stride::Structured(16)`). On NVIDIA a raw load through a structured descriptor multiplies the offset by the stride (the bug #2178 fixes at runtime), so every lane reads zeros. Every lane then returns the gather of (0, 0) at level 0, `[0, 1, 0, 0]`. So does `got(2)`, the native gather the test checks itself against. RTX 5090, driver 621.40, all 32 lanes: ``` hardware lane 4 u=0.0624 v=0.0936 level=0 got [0, 1, 0, 0] want [65, 66, 34, 33] hardware lane 20 u=0.16 v=0.2044 level=1 got [0, 1, 0, 0] want [1066, 1067, 1035, 1034] ... ``` ## Change The records go through a raw view (`Stride::Raw`), as #2178 does for `stride_tests`. The view's kind is incidental to what the test checks. One line. ## Tested - RTX 5090: `gathers_at_a_level_match_the_hardware` passes on the hardware and on WARP. The gathers were right all along. - `cargo test -p victory-shader --lib` on that machine: 237 passed, 10 failed (was 11). The 10 are the two `stride_tests` (#2178) and 8 that fail only on this Windows build's WARP (10.0.28000), where the hardware matches. - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings`: clean. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
gathers_at_a_level_match_the_hardware reads each lane's record (offset,
u, v, level) by byte offset through a structured view (stride 16). On
NVIDIA a raw load through a structured descriptor multiplies the offset by
the stride (#2178), so every lane read zeros and every lane failed with the
gather of (0, 0) at level 0, [0, 1, 0, 0], including the native gather the
test compares against: it looked like a gather bug, and is none.

The records go through a raw view, as #2178 does for stride_tests. On an
RTX 5090 the test then passes on the hardware and on WARP; the gathers
were right all along.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:02:17 +00:00
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-25 10:48 UTC · original

Confirmed on an RTX 5080 (driver 621.40). Changing the input view to raw fixed all 64 gather comparisons from my earlier report. The generated gather shader was byte-for-byte identical on the parent and PR. Earlier #1752 readback

I ran the existing test on parent 940d32f and head 9c6e094. I also collected all 32 lanes and ran a separate input check that writes each four-dword record directly to the output immediately after the same record load.

Adapter Input records correct, parent → PR Plain gathers correct, parent → PR Offset gathers correct, parent → PR
RTX 5080 0/32 → 32/32 0/32 → 32/32 0/32 → 32/32
Windows built-in WARP 32/32 → 32/32 32/32 → 32/32 32/32 → 32/32
Microsoft WARP 1.0.22 32/32 → 32/32 32/32 → 32/32 32/32 → 32/32

On the RTX parent, 29 lanes read four zero dwords. The other three lanes (5, 6, 7) each repeated one offset value across all four dwords. Lane 4 is an example of the effect on the result. It gathered [0, 1, 0, 0] on the parent and the expected [65, 66, 34, 33] on the PR. The RTX hardware-only comparison against its native level-zero gather improved from 13/16 to 16/16. Both WARP runs used the expected software device and their respective DLLs.

The original assertions failed on the parent RTX and passed on the PR RTX. Both WARP versions passed the original assertions on both revisions. I ran the existing test on Windows with the following command.

cargo test -p victory-shader --lib --locked emit::synthetic_tests::gathers_at_a_level_match_the_hardware -- --exact --nocapture --test-threads=1
**@⁠steven-seagull27** on GitHub · 2026-11-25 10:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/2323#issuecomment-7160199238) Confirmed on an RTX 5080 (driver 621.40). Changing the input view to raw fixed all 64 gather comparisons from my earlier report. The generated gather shader was byte-for-byte identical on the parent and PR. [Earlier #1752 readback](https://git.gtahub.st/github/Marvisak--VIctory/pulls/1752) I ran the existing test on parent `940d32f` and head `9c6e094`. I also collected all 32 lanes and ran a separate input check that writes each four-dword record directly to the output immediately after the same record load. | Adapter | Input records correct, parent → PR | Plain gathers correct, parent → PR | Offset gathers correct, parent → PR | |---|---:|---:|---:| | RTX 5080 | 0/32 → 32/32 | 0/32 → 32/32 | 0/32 → 32/32 | | Windows built-in WARP | 32/32 → 32/32 | 32/32 → 32/32 | 32/32 → 32/32 | | Microsoft WARP 1.0.22 | 32/32 → 32/32 | 32/32 → 32/32 | 32/32 → 32/32 | On the RTX parent, 29 lanes read four zero dwords. The other three lanes (5, 6, 7) each repeated one offset value across all four dwords. Lane 4 is an example of the effect on the result. It gathered `[0, 1, 0, 0]` on the parent and the expected `[65, 66, 34, 33]` on the PR. The RTX hardware-only comparison against its native level-zero gather improved from 13/16 to 16/16. Both WARP runs used the expected software device and their respective DLLs. The original assertions failed on the parent RTX and passed on the PR RTX. Both WARP versions passed the original assertions on both revisions. I ran the existing test on Windows with the following command. ```powershell cargo test -p victory-shader --lib --locked emit::synthetic_tests::gathers_at_a_level_match_the_hardware -- --exact --nocapture --test-threads=1 ```
Author
Owner

@⁠JAEdotUK on GitHub · 2026-11-25 10:52 UTC · original

Tested PR #2323 on Windows 11 with an AMD Radeon RX 9070 XT. Ran cargo test -p victory-shader --lib --locked -- --test-threads=1 — all 247 tests passed (0 failed) with no regressions on RDNA 4.

**@⁠JAEdotUK** on GitHub · 2026-11-25 10:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/2323#issuecomment-7160277402) Tested PR #2323 on Windows 11 with an AMD Radeon RX 9070 XT. Ran cargo test -p victory-shader --lib --locked -- --test-threads=1 — all 247 tests passed (0 failed) with no regressions on RDNA 4.
Author
Owner

@⁠welisonzika14-jpg on GitHub · 2026-11-25 11:37 UTC · original

RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC. No game files, unit tests only. Head 9c6e094 merged onto main 940d32f, cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast.

victory-shader: 245 ok, 2 fail (main: 244 ok, 3 fail). gathers_at_a_level_match_the_hardware passes on this card with it. The two left are the stride test and the view heap cap test from #1744. No new failures.

Note: #2322 makes the whole test host's structured views raw, and with it both the gather and the stride test pass here (248 ok, 1 fail). So #2322 looks like it covers this one too.

Written with AI help (Claude/Kiro); the numbers are from runs on my machine.

**@⁠welisonzika14-jpg** on GitHub · 2026-11-25 11:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/2323#issuecomment-7161297361) RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC. No game files, unit tests only. Head `9c6e094` merged onto `main` `940d32f`, `cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast`. `victory-shader`: 245 ok, 2 fail (`main`: 244 ok, 3 fail). `gathers_at_a_level_match_the_hardware` passes on this card with it. The two left are the stride test and the view heap cap test from #1744. No new failures. Note: #2322 makes the whole test host's structured views raw, and with it both the gather and the stride test pass here (248 ok, 1 fail). So #2322 looks like it covers this one too. Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
Author
Owner

@⁠qtLkz on GitHub · 2026-11-25 12:38 UTC · original

Tested on an RTX 4070 Ti (NVIDIA driver 621.01, Windows 11 Pro build 26300, Rust 1.98.1 pinned), on top of main 940d32f, cargo test -p victory-shader --lib --locked --no-fail-fast:

  • synthetic_tests::gathers_at_a_level_match_the_hardware: now passes, as described
  • the two stride_tests NVIDIA failures from #2317 (a_heap_buffer_read_by_element_takes_the_views_stride, a_heap_buffer_read_where_no_buffer_view_is_reads_zeros) are unchanged, as expected since this PR does not touch them

Result: 245 passed, 2 failed, 3 ignored (on plain 940d32f: 244 passed, 3 failed).

Overlap note: #2322 fixes the same gather failure through the shared test harness, plus both stride tests; on this card it gives 249 passed, 0 failed (#2317). #2357 is a third PR on the same failures. Only one of the three should land.

AI-assisted (Claude).

**@⁠qtLkz** on GitHub · 2026-11-25 12:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2323#issuecomment-7162650861) Tested on an RTX 4070 Ti (NVIDIA driver 621.01, Windows 11 Pro build 26300, Rust 1.98.1 pinned), on top of main `940d32f`, `cargo test -p victory-shader --lib --locked --no-fail-fast`: - `synthetic_tests::gathers_at_a_level_match_the_hardware`: now passes, as described - the two `stride_tests` NVIDIA failures from #2317 (`a_heap_buffer_read_by_element_takes_the_views_stride`, `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`) are unchanged, as expected since this PR does not touch them Result: 245 passed, 2 failed, 3 ignored (on plain `940d32f`: 244 passed, 3 failed). Overlap note: #2322 fixes the same gather failure through the shared test harness, plus both stride tests; on this card it gives 249 passed, 0 failed (https://git.gtahub.st/github/Marvisak--VIctory/issues/2317). #2357 is a third PR on the same failures. Only one of the three should land. AI-assisted (Claude).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:18 UTC · original

Automated triage for the maintainers.

Proposed close (duplicate). The change is correct: the gather test reads its records by byte address, so a raw view is the right fixture, and the NVIDIA readbacks in the comments confirm it. However, open PR #2357 makes exactly this one-line change in synthetic_tests::gathers_at_a_level_match_the_hardware and also fixes the matching NVIDIA failure in stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride, so only one of them should land. CI: passing.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/2323#issuecomment-7166623198) <!-- victory-triage v1 head=9c6e094241315666e1e11cb3c6ece627f649f8cd verdict=proposed-close at=2026-11-25T15:19:00Z --> Automated triage for the maintainers. **Proposed close (duplicate).** The change is correct: the gather test reads its records by byte address, so a raw view is the right fixture, and the NVIDIA readbacks in the comments confirm it. However, open PR #2357 makes exactly this one-line change in `synthetic_tests::gathers_at_a_level_match_the_hardware` and also fixes the matching NVIDIA failure in `stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride`, so only one of them should land. CI: passing. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2323/head:github-bot/gh-2323'
git switch 'github-bot/gh-2323'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2323'
git switch 'github-bot/gh-2323'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2323'
git switch 'github-bot/gh-2323'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2323'
git switch 'main'
git merge --squash 'github-bot/gh-2323'
git switch 'main'
git merge --ff-only 'github-bot/gh-2323'
git switch 'main'
git merge 'github-bot/gh-2323'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
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
github/Marvisak--VIctory!2323
No description provided.