Repository navigation
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Clean lowering of
v_cvt_f32_f64viadoublebitcast +FpTruncwithflags::FLOAT64and PSV feature bit0x1, refusing toward-zero mode (mode16 == Some(3)). cargo test -p victory-shader a_64_bit_value_converts_to_f32_round_to_nearest: 1/1 passed on RTX 5090, 1/1 passed on WARP.cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.
AI-assisted (Gemini 4 Neon).
|
I checked the The smallest and largest This extends the existing underflow-to-zero cases to inputs that must produce a nonzero subnormal. Default rounding only. No game data used. AI-assisted with Codex. |
Xvania7
left a comment
There was a problem hiding this comment.
Static review and local verification of 91fa9dd:
- Clean lowering of
v_cvt_f32_f64todx.op.unary(80, ...)/fptruncto float emit::lower::tests::(21 passed)cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warningscargo xtask policy: 182 files ok- CI hardware test run is verified green on GitHub Actions Windows CI.
Approving.
|
Third hardware vendor, and the boundary cases are the ones I wanted checked: For the record, the AMD result on the same head ( |
|
Two source-authored cases exposed operand and rounding issues while integrating this revision. On an RTX 4060, a literal operand of The |
|
Both findings hold, and both are fixed in The literal source. You are right that a literal in a 64-bit operand is the high word of the binary64: One detail that fell out of it: the literal form builds the 64 bits with integer shifts, so the module has to declare the 64-bit integer feature as well ( The mode check. Tightened to Lib suite after both: 249 passed, 0 failed, 3 ignored (the new literal case included); clippy clean. If your two regressions are on top of |
|
Automated triage for the maintainers. Needs rebase. This PR no longer merges cleanly into From the earlier needs-work note, still open: refuse or apply VOP3 Generated by Claude Code |
Review feedback on Marvisak#2348: `v_cvt_f32_f64` lowers an inline float constant (operand codes 240-248) through `src64`'s fallback, which zero-extends the **f32** bit pattern — `1.0` became 0x000000003F800000, a subnormal that converts to 0, where the hardware uses the binary64 of the value (RDNA 2 ISA 6.2.1). The instruction now maps 240-248 to the same values as binary64 (including 1/(2π)) and builds the bits with an integer constant; register pairs and literals keep their paths. `a_64_bit_inline_constant_source_is_the_same_value` converts code 242 (1.0) and expects 1.0; before this it got 0.
6f8acac to
f956a66
Compare
|
The gap is fixed in One note on verification: this Windows 10 machine's test harness reaches SM 6.5 on hardware and 6.2 on WARP (no Agility opt-in in the test binary), so the GPU-backed cases skip locally and CI runs them; local |
|
Measured offline on the title's shaders (the method in #1247): head The result is 0 gained, 0 lost. Exactly 5 programs change, all compute shaders, and they are the only ones on
I added a local diagnostic at that refusal, and it says why. The values the conversion needs come out of whole-wave sections that are 64-bit float wave reductions: So on this title, the conversion counts only once the whole-wave simulation can follow an f64 add over lane pairs, giving a |
|
From a tester working with Claude (AI-assisted, Claude Code): #2978 stacks on this PR. In this title the five programs that stop at |
|
Passing on a review finding from #2978 (which stacks on this PR), since it's in this PR's code: @fuzeofficlal notes that in |
|
An addition to my note above: I missed that #2978 (stacked on this PR, linked by Anzymanz above) already models exactly that step, the binary64 sums in whole-wave sections. I measured it on |
|
Confirmed the source-modifier issue reported by @fuzeofficlal and @Anzymanz on Cherry-pick The same commit cherry-picks cleanly onto the #2978 stack. Its three wave-sum readback tests, including the full-width sparse-mask regression, passed on RTX 5080 and app-local WARP 1.0.22. The combined stack also passed For the outstanding main conflict, fast-forward |
The console's 64-bit to 32-bit conversion: the VGPR pair is bitcast to a `double` and truncated with the host's `fptrunc`, round to nearest even, which is MODE's default. The toward-zero 64-bit mode has no DXIL form and is refused by name rather than mis-rounded. The IR had no 64-bit float type: it gains `double` (bitcode type 4) and the `fptrunc` cast (LLVM opcode 7). A module that uses it declares the doubles feature — SFI0 0x1 and the module's feature-info bit 2 — which dxil.dll checks against the module. Ten cases run on the card, checked against Rust's `as f32`: 1.0, -2.5, 0.1, a tie that rounds to even, the two smallest subnormals (0), f64 max (inf), ±inf and a NaN (payload kept). WARP tops out at SM 6.2 here, so the hardware device is the one exercised; the DXIL is validated by dxil.dll.
…nverts Two findings from the review (tyr0nsur): - A literal source of `v_cvt_f32_f64` is the **high** word of the binary64 (RDNA 2 ISA 6.2.1), the low word zero: 0xC0020000 is -2.25. `src64` reads a literal as the sign-extended integer its bits are, so the value became garbage there. The literal is handled in the lowering now, and `a_64_bit_literal_source_is_the_high_word` runs it on the card. - The round-mode check admitted every mode but toward-zero: the directed modes (1, 2) and a mode written at run time (`None`) have no DXIL form, and `fptrunc` rounds nearest-even regardless. Only MODE's default (0) converts now; anything else is refused by name. Lib suite 249 passed, 0 failed, 3 ignored; clippy `-D warnings` clean.
Review feedback on Marvisak#2348: `v_cvt_f32_f64` lowers an inline float constant (operand codes 240-248) through `src64`'s fallback, which zero-extends the **f32** bit pattern — `1.0` became 0x000000003F800000, a subnormal that converts to 0, where the hardware uses the binary64 of the value (RDNA 2 ISA 6.2.1). The instruction now maps 240-248 to the same values as binary64 (including 1/(2π)) and builds the bits with an integer constant; register pairs and literals keep their paths. `a_64_bit_inline_constant_source_is_the_same_value` converts code 242 (1.0) and expects 1.0; before this it got 0.
f956a66 to
fd01035
Compare
|
Rebased on today's main. Upstream's dedicated |
Three of the compute shaders this title's frame runs once per frame —
5dc3b259…,6f225b64…,926c46ba…, the shape of full-screen post-processing passes — do not translate, and the reason isv_cvt_f32_f64:What the fix does
The VGPR pair is read as 64 bits (
src64), bitcast to adouble, and truncated with the host'sfptrunc— round to nearest even, which is MODE's default for 64-bit ops. MODE's toward-zero mode has no DXIL form and is refused by name rather than mis-rounded.The IR had no 64-bit float type, so it gains
double(bitcode type 4) and thefptrunccast (LLVM opcode 7); a module that uses it declares the doubles feature — SFI00x1and the module feature-info bit 2. Both are needed: without the feature-info bitdxil.dllsaysFlags must match usage, and without the SFI0 bit the container no longer matches the module.Verification
a_64_bit_value_converts_to_f32_round_to_nearest: ten cases run on the card (Windows 10 / RX 7800 XT, SM 6.6 through the Agility runtime for the test binaries) and checked against Rust'sas f32— 1.0, −2.5, 0.1, a tie that rounds to even, the two smallest subnormals (→ 0), f64 max (→ inf), ±inf, and a NaN (a NaN out with a payload). WARP here tops out at SM 6.2, so hardware is the device exercised; the DXIL is validated bydxil.dll.cargo test -p victory-shader --lib: 248 passed, 0 failed, 3 ignored;clippy -D warningsclean.