Shaders: v_min3/max3/med3 integer variants (i32, u32) have no synthetic hardware tests #800
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#800
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@kss306 on GitHub · 2026-11-24 11:10 UTC · original
Six integer three-way operations are implemented in
crates/victory-shader/src/emit/lower.rsbut have no synthetic hardware tests incrates/victory-shader/src/emit/valu_tests.rs. Their float siblings (v_med3_f32,v_min3_f32,v_max3_f32) are tested; the integer variants are not.Affected instructions
v_min3_i32v_min3_f32(0x151) ✓v_min3_u32v_min3_f32(0x151) ✓v_max3_i32v_max3_f32(0x154) ✓v_max3_u32v_max3_f32(0x154) ✓v_med3_i32v_med3_f32(0x157) ✓v_med3_u32v_med3_f32(0x157) ✓Implementation evidence
lower.rs,valu_op()around line 4889:The signed/unsigned predicate switch (
SLT/SGTvsIULT/IUGT) is the only difference from the float path and is exercised by no test.Missing test
valu_tests.rscontainsfn v_med3_f32_matches_rdna2_with_nan()(line 262) andfn v_med3_f16_matches_rdna2_with_nan()(line 335) for the float variants. No function in the file references opcodes0x152–0x159.Suggested test
Add
fn v_med3_min3_max3_integer_matches_rdna2()tovalu_tests.rs:No game data needed; the test skips when no SM 6.6 device is available and runs on WARP.
AI-assisted: found with Kiro (Claude) and independently confirmed by five separate analysis passes without cross-contamination; no hardware run, no game data.
@fuzeofficlal on GitHub · 2026-11-24 11:56 UTC · original
I added one synthetic test for the six integer min3, med3, and max3 instructions. It checks the decoded opcode names and uses CPU sorting in the requested signed or unsigned order as the oracle. The main triplet puts the same three bit patterns at different ranks in the two orderings, and all six operand permutations are checked. Ties and the signed and unsigned boundaries have separate cases.
All 66 readbacks passed on the hardware D3D12 adapter and on WARP, with neither backend skipped. The changed file passed rustfmt, and Clippy and the repo asset check passed. Test-only commit
d7aabea@towiice on GitHub · 2026-11-24 11:57 UTC · original
I implemented the synthetic hardware tests for all six integer operations (
v_min3_i32,v_min3_u32,v_max3_i32,v_max3_u32,v_med3_i32,v_med3_u32) as proposed, covering ascending, reversed, equal, signed negative, and signed extreme boundaries:Branch: https://github.com/towiice/VIctory/tree/test/valu-integer-min3-max3-med3 (commit
89fa58e)Hardware Test Results:
stable-x86_64-pc-windows-gnullvm.cargo +stable-x86_64-pc-windows-gnullvm test -p victory-shader --lib v_med3_min3 -- --nocapturevictory-shadersuite: 121 passed, 0 failed, 1 ignored.Since direct PR creation on this repository is currently restricted to collaborators, the commit is ready on the branch above if a maintainer wants to pull it.
@geiyiliyabumo on GitHub · 2026-11-24 11:58 UTC · original
Added the requested synthetic hardware test
v_min3_max3_med3_integers_match_rdna2covering all six integer three-way instructions (v_min3_i320x152,v_min3_u320x153,v_max3_i320x155,v_max3_u320x156,v_med3_i320x158,v_med3_u320x159) across signed/unsigned boundary triplets (i32::MIN,-1/u32::MAX,0,1,i32::MAX), all 6 permutations, and duplicate values.External PRs are currently
collaborators_only, so the verified commit (combined with #799 and #802 incrates/victory-shader/src/emit/valu_tests.rs, based onmainffe310e) is ready on my fork:github.com/geiyiliyabumo/VIctory@9a173fcVerification (Windows 11 Pro 26100, AMD Radeon RX 9060 XT driver
32.0.32029.2010+ WARP, Rust1.98.1):rustfmt --edition 2024 --check crates/victory-shader/src/emit/valu_tests.rs: PASScargo xtask policy: PASS (154 files ok)cargo clippy --workspace --all-targets --locked -- -D warnings(default +--features diagnostics): PASScargo test -p victory-shader --locked -- valu_tests: 16/16 PASS (verified on both RX 9060 XT and WARP viarun_cases)cargo test --workspace --locked: PASS (0 failed)AI-assisted; synthetic tests only, no game files.
@Altorru on GitHub · 2026-11-24 12:17 UTC · original
v_med3_min3_max3_integer_matches_rdna2 covers all six opcodes (0x152/0x153/0x155/0x156/0x158/0x159) with ascending, reversed, equal and duplicated operands, signed negatives, and INT_MIN/INT_MAX. Implemented in fork PR Altorru/VIctory#1 (upstream PR creation is collaborator-only), commit
bb3a37b. Windows CI passed: cargo test --workspace on https://github.com/Altorru/VIctory/actions/runs/45391712656, where the new test ran on WARP. No game data.