Shader tests: f32/int conversions saturate, take NaN as 0, round to even #1601
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1602"
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?
Imported from Marvisak/VIctory. Originally posted by vladbondarenko97 on 2026-11-24T19:41:34Z.
Adds 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, over the integer-range edges, a signalling NaN and a denormal.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. The lowering relies on the host'sfptosi/fptoui/uitofp, and its comment says this was checked on an RX 6700 XT and WARP only; this adds an NVIDIA run. One finding on the way: WARP'suitofpis not correctly rounded for some u32 ≥ 2^31 (0xffffff7fgives0x4f800000= 2^32, not0x4f7fffff), in repeated runs. The RTX 3080 Ti is exact. So WARP (what CI runs) gets one ULP on that op for inputs ≥ 2^31, with a printed note; hardware stays exact. Tests only.Tested
mainffe310e: both new tests pass on both.cargo test --workspace --locked(idle GPU): 344 passed, 0 failed, 6 ignored.cargo clippy --workspace --all-targets --locked -- -D warningsand with--all-features: clean.Not tested
AI use
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T21:13:36Z.
Hardware run of the two new tests on head
94a2e99, since the PR asks for a non-WARP reference:D3D12Core.dllplus the two exports; not part of the repo) to reach SM 6.6.cargo test -p victory-shader --locked v_cvt_ -- --test-threads=1 --nocapture— 4 passed, 0 failed (the two new tests plus the existingv_cvt_norm_*pair).v_cvt_i32_and_u32_f32_truncate_saturate_and_take_nan_as_zero: passed on hardware.v_cvt_f32_i32_u32_and_ubyte_round_to_nearest_even: passed on hardware, including the tie cases past 2^24/2^31/2^32.uitofprounding note here. The hardware side agrees with the expectations.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:31:51Z.
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-shader/src/emit/valu_tests.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:39:24Z.
Review: COMMENTED
Shader tests: f32/int conversions saturate, NaN as 0, round to even — merge conflict with main (
940d32f69b), verified locally. Conversion-semantics tests are valuable; rebase needed and I will re-run.Imported from Marvisak/VIctory. Originally posted by noobezlol on 2026-11-27T07:17:14Z.
Opened #3479 with the remaining
v_cvt_f32_i32rounding midpoint tests rebased onto currentmain(with co-author credit to @vladbondarenko97).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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.