Shader tests: f32/int conversions saturate, take NaN as 0, round to even #320
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!320
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-320"
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?
@vladbondarenko97 on GitHub · 2026-11-24 23:32 UTC · original
vladbondarenko97:shader-tests/f32-int-conversions→main· +110 −0 · 1 files · 1 commits · openAdds two synthetic GPU tests in
crates/victory-shader/src/emit/valu_tests.rs:v_cvt_i32_f32/v_cvt_u32_f32: truncation, saturation (infinities too) and NaN as 0.v_cvt_f32_i32/v_cvt_f32_u32/v_cvt_f32_ubyte0..3: nearest-even ties past 2^24, 2^31 and 2^32.The reference is Rust's
as, which matches RDNA2. One finding: WARP'suitofpis not correctly rounded for some u32 ≥ 2^31 (0xffffff7fgives0x4f800000= 2^32, not0x4f7fffff), so WARP gets one ULP on that op with a printed note; hardware stays exact. Port of Marvisak/VIctory#1602 (same author). Tests only.Tested
2119b0e: both new tests pass on both; WARP shows the one-ULPuitofpdifference.cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.Not tested
victory-shadersuite on this head.AI use
🤖 Generated with Claude Code
@HAL9000RELOADED on GitHub · 2026-11-25 08:08 UTC · original
An AMD run for the "not tested on AMD" note.
Setup: Radeon RX 7900 XTX (RDNA3, waves of 32 to 64 lanes), Adrenalin 32.0.32015.7029, i7-13700KF, Windows 10 Pro 22H2 (19045), Rust 1.98.1. Windows 10's in-box D3D12 stops at SM 6.5, so the tree also carries the D3D12 Agility SDK 1.620 (the same approach as #69). The DXIL validator comes from SDK 10.0.26100 (
VICTORY_DXIL). WARP stays below SM 6.6 on this machine, so the GPU cases ran on the card only. No game data used.Base:
mainc96b4f2plus the Agility patch and the stack-headroom test fix from Marvisak/VIctory#742. The PR headd0b8108was merged on top of it.v_cvt_f32_i32_u32_and_ubyte_round_to_nearest_evenandv_cvt_i32_and_u32_f32_truncate_saturate_and_take_nan_as_zeropass on the card. Only WARP printed "skipped", so the hardware device ran every case. The whole workspace with this PR: 507 passed, 0 failed.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.