Shader tests: f32/int conversions saturate, take NaN as 0, round to even #1602
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!1602
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@vladbondarenko97 on GitHub · 2026-11-24 19:41 UTC · original
vladbondarenko97:shader-tests/f32-int-conversions-v2→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, 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
@Calvix2k on GitHub · 2026-11-24 21:13 UTC · original
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.@Marvisak on GitHub · 2026-11-25 01:31 UTC · original
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
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.