Shaders: validate raw fixtures and signed MAD64 with full-word regression #2774
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2774
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2774"
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?
@LogicGrove on GitHub · 2026-11-25 20:13 UTC · original
LogicGrove:validation/nvidia-raw-fixtures-mad64→main· +78 −3 · 4 files · 3 commits · openSummary
On RTX 2060, the existing stride/gather fixtures fail because they bind structured views for raw loads. Separately, a negative literal in
v_mad_i64_i32loses its sign. This integrates the small corrections from #2357 (LICObr) and #2254 (BastienRodz), preserving their authors in separate commits, and adds an independent CPU-oracle regression covering both result words.Our additional test covers six dynamic input pairs, three literal bit patterns, signed/unsigned variants, and both 32-bit words: 72 word comparisons per backend. No game files, extracted shaders, console SDK, or proprietary fixtures were used. This changes neither heap limits nor carry-out handling.
This is an integration/validation PR, not a claim to have authored the existing fixes. If the original PRs are preferred, the final commit can be cherry-picked onto #2254 independently.
Evidence
Windows 11 Home build 26200, RTX 2060 6 GB, NVIDIA driver 610.88, Rust 1.98.1 MSVC. Base:
13f91ca.After #2357 alone:
a_heap_buffer_read_by_element_takes_the_views_strideandgathers_at_a_level_match_the_hardwarepass. The two GPU heap tests and the null-buffer-view shader test still fail.mad_literal_addends_match_cpu_in_both_wordsfail on hardware: the high word of0 * 0 - 100is0, expected0xffffffff.After: both regressions pass in debug and release. The fixture corrections also pass targeted release runs. The shader harness loops over hardware and WARP; no backend-skipped messages appeared in these successful targeted runs.
cargo clippy -p victory-shader --all-targets --locked -- -D warnings: pass.cargo xtask policy: pass.git diff --check: pass. Added regression formatted with rustfmt.Full workspace run completed (exit 101): victory-gpu: 193 passed, 2 failed, 1 ignored; victory-shader: 271 passed, 1 failed, 3 ignored. Remaining failures: descriptor::host::tests::dynamic_slots_are_held_until_released; memory::tests::lists_share_a_table_and_copies_keep_their_views; emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros. All three were reproduced before this PR. No additional failure names appeared.
The local full-workspace run also includes the previously validated loader tests/reference fix from #2418, which are not included in this shader-only PR. The four shader files in this PR match those tested locally. No FPS or game-playability claim is made.
AI use: Codex assisted with independent reproduction, the additional CPU-oracle test, validation, and this description. Reused changes are credited above.
Merge Danger
Door: Two-way; revert the commits to restore prior behavior.
Blast Radius: Shaders. The production change affects signed MAD literal extension; other changes are synthetic test fixtures and regression coverage. The remaining NVIDIA heap failures are not fixed here.
@oni-swr on GitHub · 2026-11-25 20:36 UTC · original
Independent verification of head
cca9102f(WARP/CPU): looks good.v_mad_i64_i32now sign-extends its 32-bit literal addend (v_mad_u64_u32still zero-extends, per the new test), plus two fixtures changed from structured to raw buffer views. The change is small and in scope.victory-shader --lib269 pass, 3 fail. The same 3 fail onorigin/main(WARP has no 32-lane pipeline:gathers_at_a_level_match_the_hardware,permutes_read_the_lane_named_and_zero_from_lanes_left_out,a_mask_joined_with_data_at_a_uniform_loop_is_its_number), so they are baseline WARP failures. Note thatgathers_at_a_level...is one of the two fixtures this PR edits, so that edit cannot be checked on WARP. The other fixture edit (stride_tests) passes. Clippy-D warningsis clean.lower.rschange reverted toorigin/main, both new tests (mad_i64_i32_sign_extends_literal_addend,mad_literal_addends_match_cpu_in_both_words) fail. They pass with the fix, and they compare both result words against CPU integer arithmetic.Method: WARP/CPU only (no physical GPU;
VICTORY_WARP=1,VICTORY_D3D12_WARP=1, Windows SDKdxil.dllon PATH, so DXIL validation ran),cargo test -p <crate> --lib --lockedandcargo clippy -p <crate> --all-targets --locked -- -D warnings, compared withorigin/main13f91cae. Nothing from the game was used.AI-assisted review (Claude Code / Claude Sonnet 5.5).
@fuzeofficlal on GitHub · 2026-11-25 20:38 UTC · original
Reviewed and verified
cca9102fon Windows 11 (RTX 5090 + WARP + Windows SDK10.0.26100.0dxil.dll) againstmain(13f91ca).Operand::Literal(x)viai64::from(x as i32)forv_mad_i64_i32(lower.rs:6487-6489) matches inline-constant behavior, and switching byte-addressed fixtures instride_tests.rs/synthetic_tests.rstoStride::Rawfixes thea_heap_buffer_read_by_element_takes_the_views_stridefailure on RTX 5090 as well.dxil.dll:mad_2/2 passed,valu_tests::32/32 passed,synthetic_tests::7/7 passed,stride_tests::7/8 passed (only the separate pre-existing NVIDIAa_heap_buffer_read_where_no_buffer_view_is_reads_zerosfailure remains, as noted in the PR).cargo clippy --locked -p victory-shader --all-targets -- -D warnings(default &--features host): 0 warnings;cargo xtask policy: 184 files ok; cleangit merge-treevs13f91ca,#2768, and#2766.@kotekompotek on GitHub · 2026-11-25 20:39 UTC · original
Correct: v_mad_i64_i32's name doesn't match the _i64 suffix check so its S2 literal was zero-extended - the explicit-name addition matches LLVM's operand rules (S2.i64 sign-extends). The test splits the cases well (mad_i64 sign-extends -100, mad_u64 zero-extends). Raw-stride fixture changes also fix the tests to match how the host actually views heap buffers.
@Marvisak on GitHub · 2026-11-25 23:23 UTC · original
Automated triage for the maintainers.
This PR re-packages changes from other PRs: the
lower.rssrc64change and themad_i64_i32_sign_extends_literal_addendtest are those of #2254, which is still open and already marked as a merge candidate, and thestride_tests.rs/synthetic_tests.rsfixture changes are those of #2357. The only new part ismad_literal_addends_match_cpu_in_both_words. That test would be better offered to #2254 (as a suggestion on that PR), and the fixture change can be raised again on its own if a maintainer wants it, so review happens in one place. CI passes on this head.This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the
triage: proposed closelabel.Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.