Repository navigation
Shaders: hardware probes for the 64-bit scalar logic and shift ops - #2570
LouisRiverstone wants to merge 1 commit into
Conversation
fyernald
left a comment
There was a problem hiding this comment.
Checked on real NVIDIA hardware: RTX 3080 (617.42), Windows 10 (19045), plus WARP, main 67e8ae1 + #486 + #2596 (without #2596 the suite crashes on NVIDIA, #2571). cargo test -p victory-shader --lib --locked -- --test-threads=1 gives 267 passed, 3 failed, the same as the base. The 3 are the #1835 failures. The new probes agree with the model on both adapters.
The SOP2 opcodes match RDNA2: the _b64 logic ops at 0x0F to 0x1D (odd), then s_lshl_b64/s_lshr_b64/s_ashr_i64 at 0x1F/0x21/0x23. The shift references mask the count to 6 bits as the hardware does.
|
Tested on NVIDIA: RTX 4070, driver 621.01, Windows 11, rustc 1.100.0. Head
No game data; the title was not run. AI-assisted. |
|
Automated triage for the maintainers. Merge candidate. This is a recommendation to look, not an approval. It merges cleanly into The PR adds Generated by Claude Code |
…ogic and shift ops
…ogic and shift ops
fuzeofficlal
left a comment
There was a problem hiding this comment.
Looks good to me — clean test-only expansion of scalar_probes covering all eight 64-bit SOP2 bitwise ops and all three 64-bit scalar shifts, including SCC (!= 0) and 6-bit shift-count masking.
Verified locally on Windows 11 with head f70c8c4e cleanly merged onto main (63bcca43):
- Audited all 11 SOP2 opcodes in
scalar_64_probes(crates/victory-shader/src/emit/semantics_tests.rs:2816-2878):0x0F..=0x1D(odd:s_and/or/xor/andn2/orn2/nand/nor/xnor_b64) and0x1F/0x21/0x23(s_lshl_b64,s_lshr_b64,s_ashr_i64) matchgfx10/opcodes.rsand RDNA2 semantics, capturings[20:21]andSCCvias_cselect_b32. - Formatting check (
rustfmt --edition 2024 --config skip_children=true) shows no diffs on the added lines. cargo run -p xtask -- policy(191 files ok) andcargo clippy --locked -p victory-shader --all-targets -- -D warnings(both default and--all-features) pass.cargo test --locked -p victory-shader --lib scalar_alu_matches_the_hardware -- --nocapturepasses on bothVICTORY_WARP=0(2.41s) andVICTORY_WARP=1(0.22s): all 39 probes (including all 11 new probes across 64 logic pairs / 72 shift inputs) reportmodel mismatches ["hardware 0", "warp 0"], hardware/warp differ on 0.
Tiny non-blocking doc-comment nit: semantics_tests.rs:2813-2814 mentions s[16:17] and s[18:19] as operands for all 11 ops, whereas the three shift ops only read scalar s18[5:0] (with s19 holding OLD and unused).
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on RTX 5090 and VICTORY_WARP=1 (Windows / D3D12) against origin/main (63bcca4).
- Adding 64-bit scalar logic and shift probes to
scalar_alu_matches_the_hardwareexpands hardware-verified coverage cleanly on both RTX 5090 and WARP. cargo test -p victory-shader --lib emit::semantics_tests::scalar_alu_matches_the_hardware -- --test-threads=1: passed on RTX 5090 andVICTORY_WARP=1.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Adds probes for s_and/or/xor/andn2/orn2/nand/nor/xnor_b64 (SOP2 0x0F-0x1D) and s_lshl_b64, s_lshr_b64, s_ashr_i64 (0x1F, 0x21, 0x23) to scalar_probes: both result dwords and SCC, over 64-bit edge values, with shift counts that pin the six-bit mask (63, 64, 65, garbage in the high bits). Only a single s_ashr_i64 case was tested before. Test-only.