Shaders: hardware probes for the 64-bit scalar logic and shift ops #2570
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!2570
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2570"
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?
@LouisRiverstone on GitHub · 2026-11-25 16:03 UTC · original
LouisRiverstone:shaders/s-logic-shift-b64-probes→main· +68 −0 · 1 files · 1 commits · openAdds 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.
@Mericas77 on GitHub · 2026-11-25 17:34 UTC · original
Tested on NVIDIA: RTX 4070, driver 621.01, Windows 11, rustc 1.100.0. Head
f70c8c4againstmain67e8ae1.scalar_alu_matches_the_hardware: passes. 39 probes here vs 28 onmain; the 11 new 64-bit ones (s_and/or/xor/andn2/orn2/nand/nor/xnor_b64,s_lshl_b64,s_lshr_b64,s_ashr_i64) all report hardware 0 / warp 0 mismatches, so they ran on the NVIDIA adapter and on WARP.cargo test -p victory-shader --lib --locked(with--skip heap_direct_texture_reads_mark_their_heap_index, which crashes the process onmainhere too, #2571): 266 / 3 / 3, same asmain, same 3 known NVIDIA failures.No game data; the title was not run.
AI-assisted.
@Marvisak on GitHub · 2026-11-25 19:23 UTC · original
Automated triage for the maintainers.
Merge candidate. This is a recommendation to look, not an approval. It merges cleanly into
main. CI:checkpassing.The PR adds
scalar_64_probestoscalar_probesincrates/victory-shader/src/emit/semantics_tests.rs. It covers the 64-bit SOP2 opss_and/or/xor/andn2/orn2/nand/nor/xnor_b64ands_lshl/lshr_b64/s_ashr_i64over 64-bit edge pairs, checking both result dwords and SCC. The opcodes (0x0F–0x23, odd) match the SOP2 table ingfx10/opcodes.rs. The model's six-bit shift count and SCC = result != 0 match the RDNA2 ISA and the existing lowering arms inlower.rs. Register use fitsprogram(): inputs in s16–s19, the result in s[20:21], SCC to s22 vias_cselect, and outputs from v5–v7.mainhas no probe for these ops yet.Generated by Claude Code
@fyernald on GitHub · 2026-11-25 17:01 UTC · original · approved these changes
Checked on real NVIDIA hardware: RTX 3080 (617.42), Windows 10 (19045), plus WARP,
main67e8ae1+ #486 + #2596 (without #2596 the suite crashes on NVIDIA, #2571).cargo test -p victory-shader --lib --locked -- --test-threads=1gives 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
_b64logic ops at 0x0F to 0x1D (odd), thens_lshl_b64/s_lshr_b64/s_ashr_i64at 0x1F/0x21/0x23. The shift references mask the count to 6 bits as the hardware does.@fuzeofficlal on GitHub · 2026-11-26 19:35 UTC · original · approved these changes
Looks good to me — clean test-only expansion of
scalar_probescovering all eight 64-bit SOP2 bitwise ops and all three 64-bit scalar shifts, includingSCC(!= 0) and 6-bit shift-count masking.Verified locally on Windows 11 with head
f70c8c4ecleanly merged ontomain(63bcca43):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.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-2814mentionss[16:17]ands[18:19]as operands for all 11 ops, whereas the three shift ops only read scalars18[5:0](withs19holdingOLDand unused).@Dukestar69 on GitHub · 2026-11-26 20:18 UTC · original · approved these changes
LGTM — verified on RTX 5090 and
VICTORY_WARP=1(Windows / D3D12) againstorigin/main(63bcca4).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).
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.