Repository navigation
Shaders: lower binary64 fractional parts - #2728
andrewpozdnakov7-jpg wants to merge 2 commits into
Conversation
|
Impressive lowering. Verified the hard parts:
Test matrix is genuinely exhaustive. LGTM. |
|
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP + Verification (
|
|
Automated triage for the maintainers. This adds a lowering for What I checked:
The behaviour cites the public RDNA2 ISA document and published hardware measurements. The tests cover 32 inputs through VGPR and SGPR pairs, plus abs and neg. CI: Generated by Claude Code |
|
First Radeon run of
So the lowered binary64 fract matches on RDNA3 hardware as well as on the RTX 5090 and WARP. |
Dukestar69
left a comment
There was a problem hiding this comment.
Tested merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP, dxil.dll validator active):
cargo test -p victory-shader --lib emit::valu_tests::fract_f64: 2 passed, 0 failed (fract_f64_vop1_returns_both_words_below_oneandfract_f64_vop3_literals_obey_abs_and_negpass on both RTX 5090 hardware and WARP).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 192 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
…arts # Conflicts: # crates/victory-shader/src/emit/lower.rs
…arts # Conflicts: # crates/victory-shader/src/emit/lower.rs
Summary
Lower RDNA 2 V_FRACT_F64 in VOP1 and VOP3. The lowering uses two 32-bit words, rounds ties to even and keeps finite results below one. It writes both destination words under the lane guard and requires neither host doubles nor int64. VOP3 source abs and neg are supported.
The RDNA 2 ISA defines the operation as x minus floor(x). RDNA 2 and RDNA 4 measurements confirm that tiny negative inputs return the largest binary64 value below one.
Verification
Coordination claim
Please retain the Git author if cherry-picking or rebasing this commit. If folding it into another commit, add Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com.
AI-assisted. The regression uses synthetic inputs.