Test a four-dword load at byte 328 of a 340-byte view on D3D12 hardware #1176

Open
BradRoland wants to merge 2 commits from upstream-pr/1179 into main
BradRoland commented 2026-11-25 22:57:03 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by BradRoland on 2026-11-25T22:57:03Z.


Run 277 reported black water with grouped scalar loads enabled. The README identified a specific untested hardware case: four 32-bit values loaded at byte 328 of a 340-byte raw view, with the fourth value unused by the shader. This test reproduces that instruction and binding geometry with synthetic data. Run notes

On an NVIDIA RTX 4080 (driver 621.14) and Microsoft WARP, both VICTORY_SHADER_OPT=63 and 127 preserved all three in-bounds values. When the shader also consumed the fourth value, it read zero at byte 340. The same backing buffer contained 0x4badf00d at that location. Widening only the view to 344 bytes exposed that value, and narrowing it to 336 bytes zeroed the third and fourth values. The variant that discards the fourth load writes an independent marker to that output.

All 24 dispatches returned the expected values across both adapters, optimizer settings, output variants and three view lengths. The validated shader disassembly for the three-result case showed three individual calls at 328/332/336 with optimization 63 and one four-component call at 328 with 127. The permanent fixture checks the load counts so it continues to exercise both paths.

Run cargo test --locked -p victory-shader --lib scalar_buffer_load_at_328_respects_the_raw_view_end -- --nocapture. It runs each optimizer setting in a fresh process. Leave VICTORY_WARP unset to try both adapters, or set 0 for hardware and 1 for WARP. The full shader library passed 217 tests with three ignored. The shader crate also passed Clippy with --all-targets --all-features -- -D warnings.

The patch changes the test harness only. The result narrows the suspected driver behavior on this RTX 4080. Run 279 reports blue water and floating boats with the revised hash length and grouped loads disabled. The exact reason the grouped path produced black water in run 277 remains open. Run 279 AI-assisted implementation and testing.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6615454335 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1179). Originally posted by [BradRoland](https://github.com/BradRoland) on 2026-11-25T22:57:03Z. --- Run 277 reported black water with grouped scalar loads enabled. The README identified a specific untested hardware case: four 32-bit values loaded at byte 328 of a 340-byte raw view, with the fourth value unused by the shader. This test reproduces that instruction and binding geometry with synthetic data. [Run notes](https://github.com/fxceless/victory-fork/blob/44bff61/README.md#L85-L89) On an NVIDIA RTX 4080 (driver 621.14) and Microsoft WARP, both `VICTORY_SHADER_OPT=63` and `127` preserved all three in-bounds values. When the shader also consumed the fourth value, it read zero at byte 340. The same backing buffer contained `0x4badf00d` at that location. Widening only the view to 344 bytes exposed that value, and narrowing it to 336 bytes zeroed the third and fourth values. The variant that discards the fourth load writes an independent marker to that output. All 24 dispatches returned the expected values across both adapters, optimizer settings, output variants and three view lengths. The validated shader disassembly for the three-result case showed three individual calls at 328/332/336 with optimization 63 and one four-component call at 328 with 127. The permanent fixture checks the load counts so it continues to exercise both paths. Run `cargo test --locked -p victory-shader --lib scalar_buffer_load_at_328_respects_the_raw_view_end -- --nocapture`. It runs each optimizer setting in a fresh process. Leave `VICTORY_WARP` unset to try both adapters, or set `0` for hardware and `1` for WARP. The full shader library passed 217 tests with three ignored. The shader crate also passed Clippy with `--all-targets --all-features -- -D warnings`. The patch changes the test harness only. The result narrows the suspected driver behavior on this RTX 4080. Run 279 reports blue water and floating boats with the revised hash length and grouped loads disabled. The exact reason the grouped path produced black water in run 277 remains open. [Run 279](https://github.com/fxceless/victory-fork/commit/d827419) AI-assisted implementation and testing.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1179:upstream-pr/1179'
git switch 'upstream-pr/1179'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1179'
git switch 'upstream-pr/1179'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1179'
git switch 'upstream-pr/1179'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1179'
git switch 'main'
git merge --squash 'upstream-pr/1179'
git switch 'main'
git merge --ff-only 'upstream-pr/1179'
git switch 'main'
git merge 'upstream-pr/1179'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!1176
No description provided.