Shaders: v_mul_legacy_f32 treats denormal operands as zero #682

Merged
senchsus merged 3 commits from upstream-pr/682 into main 2026-11-25 21:49:24 +00:00
senchsus commented 2026-11-24 06:45:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by senchsus on 2026-11-24T06:45:05Z.


RDNA2 treats denormal operands of the legacy multiplies (v_mul_legacy_f32, v_mac_legacy_f32, v_mad_legacy_f32) as zero, so 0 × anything = 0 also holds for them. The lowering only compared each operand with 0.0, so a denormal times inf/NaN gave NaN instead of 0, and the result depended on the host's denormal mode.

legacy_mul now checks each operand's exponent bits (bits & 0x7F800000 == 0), which covers ±0 and denormals and does not depend on how the host handles denormals. Follow-up to the lower-priority item in #2.

Tests

  • New v_mul_legacy_f32_treats_denormals_as_zero in valu_tests.rs: zero/denormal × inf/NaN/large gives +0, the smallest normal is not flushed, and ordinary products still match.
  • cargo test -p victory-shader, clippy and cargo check --tests --target x86_64-pc-windows-msvc pass; cargo xtask policy passes.
  • Not yet run on a GPU or WARP. The new test only runs on Windows, and I couldn't run it there. It would be great if someone could run it (@MiguelMatMar offered GPU testing in #2).
<!-- greyfinch-sync:Marvisak/VIctory:issue:6576258818 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682). Originally posted by [senchsus](https://github.com/senchsus) on 2026-11-24T06:45:05Z. --- RDNA2 treats denormal operands of the legacy multiplies (`v_mul_legacy_f32`, `v_mac_legacy_f32`, `v_mad_legacy_f32`) as zero, so `0 × anything = 0` also holds for them. The lowering only compared each operand with `0.0`, so a denormal times inf/NaN gave NaN instead of 0, and the result depended on the host's denormal mode. `legacy_mul` now checks each operand's exponent bits (`bits & 0x7F800000 == 0`), which covers ±0 and denormals and does not depend on how the host handles denormals. Follow-up to the lower-priority item in #2. ### Tests - New `v_mul_legacy_f32_treats_denormals_as_zero` in `valu_tests.rs`: zero/denormal × inf/NaN/large gives +0, the smallest normal is not flushed, and ordinary products still match. - `cargo test -p victory-shader`, `clippy` and `cargo check --tests --target x86_64-pc-windows-msvc` pass; `cargo xtask policy` passes. - **Not yet run on a GPU or WARP.** The new test only runs on Windows, and I couldn't run it there. It would be great if someone could run it (@MiguelMatMar offered GPU testing in #2).
catminou4 commented 2026-11-24 06:54:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:53:07Z.

Review: COMMENTED


cargo test -p victory-shader --locked on macOS 26 arm64, rustc 1.98.1: compiles clean, 56 passed / 0 failed — same count as main, because the new coverage went into valu_tests.rs, which is #[cfg(all(test, windows))] (needs the Windows host backend). So the denormal-operand change itself is verified to compile and not regress the ungated tests, but the new execution tests need a Windows run.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034901380 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#pullrequestreview-6034901380). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:53:07Z. **Review:** COMMENTED --- `cargo test -p victory-shader --locked` on macOS 26 arm64, rustc 1.98.1: compiles clean, 56 passed / 0 failed — same count as main, because the new coverage went into `valu_tests.rs`, which is `#[cfg(all(test, windows))]` (needs the Windows host backend). So the denormal-operand change itself is verified to compile and not regress the ungated tests, but the new execution tests need a Windows run.
LAKSHYA-cmd-tech commented 2026-11-24 07:01:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:59:41Z.

Review: APPROVED


LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 70 unit tests in ictory-shader passed cleanly, including the new _mul_legacy_f32_treats_denormals_as_zero test running on Windows D3D12/WARP. Masking exponent bits its & 0x7F800000 == 0 correctly flushes denormals to +0 without relying on host FPU denormal handling.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034971214 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#pullrequestreview-6034971214). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:59:41Z. **Review:** APPROVED --- LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 70 unit tests in ictory-shader passed cleanly, including the new _mul_legacy_f32_treats_denormals_as_zero test running on Windows D3D12/WARP. Masking exponent bits its & 0x7F800000 == 0 correctly flushes denormals to +0 without relying on host FPU denormal handling.
lameloball2813-ui commented 2026-11-24 08:02:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lameloball2813-ui on 2026-11-24T07:40:17Z.


Ran it on a GPU and WARP: Windows 11, RTX 5060 Ti (the only adapter), NVIDIA driver 32.0.16.1088, Rust 1.98.1, debug.

Code v_mul_legacy_f32_treats_denormals_as_zero
this PR 3d73ea9 passes (hardware + WARP; neither was skipped)
main d2a4bae with only this PR's valu_tests.rs also passes

All 8 valu_tests on 3d73ea9 pass with --test-threads=1.

So on this NVIDIA card and on WARP the old lowering already gives +0 for denormal × inf/NaN. Most likely those hosts flush the denormal operand, so the old == 0.0 compare is true, which fits the PR's note that the old result "depended on the host's denormal mode". The fix makes it independent of that, but on these two hosts the test can't tell the old code from the new. A host that keeps fp32 denormals (an AMD GPU, maybe) would be needed to see it fail on main; I don't have one.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7125242689 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#issuecomment-7125242689). Originally posted by [lameloball2813-ui](https://github.com/lameloball2813-ui) on 2026-11-24T07:40:17Z. --- Ran it on a GPU and WARP: Windows 11, **RTX 5060 Ti** (the only adapter), NVIDIA driver 32.0.16.1088, Rust 1.98.1, debug. | Code | `v_mul_legacy_f32_treats_denormals_as_zero` | |---|---| | this PR `3d73ea9` | passes (hardware + WARP; neither was skipped) | | `main` `d2a4bae` with only this PR's `valu_tests.rs` | **also passes** | All 8 `valu_tests` on `3d73ea9` pass with `--test-threads=1`. So on this NVIDIA card and on WARP the old lowering already gives +0 for denormal × inf/NaN. Most likely those hosts flush the denormal operand, so the old `== 0.0` compare is true, which fits the PR's note that the old result "depended on the host's denormal mode". The fix makes it independent of that, but on these two hosts the test can't tell the old code from the new. A host that keeps fp32 denormals (an AMD GPU, maybe) would be needed to see it fail on `main`; I don't have one.
mercuryVM commented 2026-11-24 11:03:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T10:33:45Z.

Review: COMMENTED


Tested e1bd18f on Windows 11, RTX 5070, MSVC: cargo test -p victory-shader -- --test-threads=1 78 passed, including v_mul_legacy_f32_treats_denormals_as_zero on the GPU backend. cargo clippy -p victory-shader --all-targets is clean.

The lowering does what the description says, and testing exponent bits removes the dependence on the host's denormal mode, which is a real improvement for the 0 × inf/NaN case. One question on the semantics before approving:

  • lower.rs (legacy_mul) now flushes denormal operands unconditionally. As I understand the RDNA2 ISA text, the legacy zero rule is stated for 0.0, while denormal flushing of f32 operands follows MODE.FP_DENORM, which titles can set with s_denorm_mode / s_setreg. This translator currently ignores s_denorm_mode (ir.rs:742), so the PR hardcodes the flush-to-zero setting. That matches the common default, but in denormal-preserving mode denorm × 2^100 would be about 2^-49, not 0. Can you point to the source (ISA section or a hardware capture) showing the legacy check ignores FP_DENORM? If it does depend on the mode, a comment saying "assumes f32 denormals flushed (MODE default); s_denorm_mode is not modelled" would document the assumption, and the denorm × 2^100 case would be better described as testing that default than as a hardware rule.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6037622309 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#pullrequestreview-6037622309). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T10:33:45Z. **Review:** COMMENTED --- Tested e1bd18f on Windows 11, RTX 5070, MSVC: `cargo test -p victory-shader -- --test-threads=1` 78 passed, including `v_mul_legacy_f32_treats_denormals_as_zero` on the GPU backend. `cargo clippy -p victory-shader --all-targets` is clean. The lowering does what the description says, and testing exponent bits removes the dependence on the host's denormal mode, which is a real improvement for the `0 × inf/NaN` case. One question on the semantics before approving: - `lower.rs` (`legacy_mul`) now flushes denormal *operands* unconditionally. As I understand the RDNA2 ISA text, the legacy zero rule is stated for 0.0, while denormal flushing of f32 operands follows `MODE.FP_DENORM`, which titles can set with `s_denorm_mode` / `s_setreg`. This translator currently ignores `s_denorm_mode` (`ir.rs:742`), so the PR hardcodes the flush-to-zero setting. That matches the common default, but in denormal-preserving mode `denorm × 2^100` would be about 2^-49, not 0. Can you point to the source (ISA section or a hardware capture) showing the legacy check ignores `FP_DENORM`? If it does depend on the mode, a comment saying "assumes f32 denormals flushed (MODE default); `s_denorm_mode` is not modelled" would document the assumption, and the `denorm × 2^100` case would be better described as testing that default than as a hardware rule. AI-assisted (Claude Code).
slint6614-dev commented 2026-11-24 11:04:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by slint6614-dev on 2026-11-24T10:16:54Z.


AMD hardware check, Windows 11, Adrenalin driver: RX 9070 (RDNA4) and Ryzen 9600X iGPU (RDNA2, gfx1036), each picked as the hardware device of run_cases (local adapter-selection patch, not part of this PR); cargo test -p victory-shader --release valu_tests at the PR head. Negative control: the PR's non-test files reverted to its merge base, its new tests kept.

  • With this PR, v_mul_legacy_f32_treats_denormals_as_zero passes on both AMD GPUs.
  • Negative control: it also passes without the fix, on both AMD GPUs and on the WARP pass of run_cases. Those hosts already flush the denormal operands (D3D's default f32 denormal mode), so main's lowering gives +0 there anyway.
  • So the test cannot catch a regression on these hosts. The fix only matters on a host that keeps f32 denormals. A case only such a host would fail, or a check that the DXIL now flushes explicitly, would make the test useful.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7128562914 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#issuecomment-7128562914). Originally posted by [slint6614-dev](https://github.com/slint6614-dev) on 2026-11-24T10:16:54Z. --- AMD hardware check, Windows 11, Adrenalin driver: RX 9070 (RDNA4) and Ryzen 9600X iGPU (RDNA2, gfx1036), each picked as the hardware device of `run_cases` (local adapter-selection patch, not part of this PR); `cargo test -p victory-shader --release valu_tests` at the PR head. Negative control: the PR's non-test files reverted to its merge base, its new tests kept. - With this PR, `v_mul_legacy_f32_treats_denormals_as_zero` passes on both AMD GPUs. - Negative control: it **also passes without the fix**, on both AMD GPUs and on the WARP pass of `run_cases`. Those hosts already flush the denormal operands (D3D's default f32 denormal mode), so main's lowering gives +0 there anyway. - So the test cannot catch a regression on these hosts. The fix only matters on a host that keeps f32 denormals. A case only such a host would fail, or a check that the DXIL now flushes explicitly, would make the test useful.
ErRusso commented 2026-11-24 12:04:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ErRusso on 2026-11-24T11:19:18Z.


Audit: ✅ Looks good — verified & tested

Reviewed this PR as part of an audit of mergeable PRs.

  • Scope: crates/victory-shader/src/emit/lower.rs + valu_tests.rs (+48/-5). v_mul_legacy_f32 now treats denormal operands as zero via bit-level exponent check (0x7F80_0000 mask) instead of a float compare, whose result would depend on the host's denormal mode. Matches RDNA2 semantics.
  • Merges cleanly into main.
  • Tests: cargo test -p victory-shader -- emit::lower:: → 5/5 passed; the new GPU diff test v_mul_legacy_f32_treats_denormals_as_zero compiles cleanly (needs a Windows/D3D12 host to execute — this environment is Linux).
  • Test coverage is thorough: zero×∞, -0×NaN, NaN×0, denorm×∞, NaN×neg-denorm, denorm×2^100, smallest-normal×2, and ordinary products — all asserted as exact bit patterns.

No issues found. The exponent-bit probe is the right approach for denormal-as-zero on RDNA2.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129946106 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#issuecomment-7129946106). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-24T11:19:18Z. --- ## Audit: ✅ Looks good — verified & tested Reviewed this PR as part of an audit of mergeable PRs. - **Scope:** `crates/victory-shader/src/emit/lower.rs` + `valu_tests.rs` (+48/-5). `v_mul_legacy_f32` now treats denormal operands as zero via bit-level exponent check (`0x7F80_0000` mask) instead of a float compare, whose result would depend on the host's denormal mode. Matches RDNA2 semantics. - **Merges cleanly** into `main`. - **Tests:** `cargo test -p victory-shader -- emit::lower::` → 5/5 passed; the new GPU diff test `v_mul_legacy_f32_treats_denormals_as_zero` compiles cleanly (needs a Windows/D3D12 host to execute — this environment is Linux). - **Test coverage is thorough:** zero×∞, -0×NaN, NaN×0, denorm×∞, NaN×neg-denorm, denorm×2^100, smallest-normal×2, and ordinary products — all asserted as exact bit patterns. No issues found. The exponent-bit probe is the right approach for denormal-as-zero on RDNA2.
upipibi commented 2026-11-24 15:03:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T14:14:04Z.


A cross-check from AnyPS5's hardware-matched model; behaviour only, no code. It narrows when this PR's rule holds.

  • AnyPS5's legacy multiply counts an operand as zero for 0 × anything = 0 only when it is exactly ±0 ((bits & 0x7fffffff) == 0) after the operand has gone through the f32 input-denormal handling of the current mode (FP_DENORM).
  • Its legacy MAD/MAC model matched an RDNA1 card (gfx1010) on 45 504 oracle rows in all four f32 denormal modes, with the 144 edge combinations among them (boykopovar/AnyPS5#26098).
  • So in a mode that flushes f32 input denormals (the D3D default, and what every host above ran), a denormal operand is zero and both models give +0 for denormal × inf/NaN. That is why the negative controls on NVIDIA, WARP and AMD all passed without the fix.
  • In a mode that keeps f32 denormals, that model does not count the denormal as zero, and denormal × inf goes through the normal product (inf). This PR's exponent test returns +0 there.

This only matters if VIctory ever runs a program in a mode that keeps f32 denormals (s_setreg of MODE, or a title setting FLOAT_MODE). If it always assumes the flushing default, the exponent test is the host-independent way to get the hardware answer, and this PR is right for that. Derived from AnyPS5's sources and its measured rows; I have not run RDNA2 hardware in a preserving mode myself.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134047278 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#issuecomment-7134047278). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T14:14:04Z. --- A cross-check from AnyPS5's hardware-matched model; behaviour only, no code. It narrows when this PR's rule holds. - AnyPS5's legacy multiply counts an operand as zero for `0 × anything = 0` only when it is exactly ±0 (`(bits & 0x7fffffff) == 0`) *after* the operand has gone through the f32 input-denormal handling of the current mode (`FP_DENORM`). - Its legacy MAD/MAC model matched an RDNA1 card (gfx1010) on 45 504 oracle rows in all four f32 denormal modes, with the 144 edge combinations among them (boykopovar/AnyPS5#26098). - So in a mode that **flushes** f32 input denormals (the D3D default, and what every host above ran), a denormal operand is zero and both models give +0 for denormal × inf/NaN. That is why the negative controls on NVIDIA, WARP and AMD all passed without the fix. - In a mode that **keeps** f32 denormals, that model does not count the denormal as zero, and denormal × inf goes through the normal product (inf). This PR's exponent test returns +0 there. This only matters if VIctory ever runs a program in a mode that keeps f32 denormals (`s_setreg` of MODE, or a title setting FLOAT_MODE). If it always assumes the flushing default, the exponent test is the host-independent way to get the hardware answer, and this PR is right for that. Derived from AnyPS5's sources and its measured rows; I have not run RDNA2 hardware in a preserving mode myself. AI-assisted (Claude Code).
senchsus commented 2026-11-24 18:06:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by senchsus on 2026-11-24T18:00:03Z.


A cross-check from AnyPS5's hardware-matched model; behaviour only, no code. It narrows when this PR's rule holds.

  • AnyPS5's legacy multiply counts an operand as zero for 0 × anything = 0 only when it is exactly ±0 ((bits & 0x7fffffff) == 0) after the operand has gone through the f32 input-denormal handling of the current mode (FP_DENORM).
  • Its legacy MAD/MAC model matched an RDNA1 card (gfx1010) on 45 504 oracle rows in all four f32 denormal modes, with the 144 edge combinations among them (fix(shader): flush the v_mad_legacy_f32 and v_mac_legacy_f32 product by its tininess after rounding boykopovar/AnyPS5#26098).
  • So in a mode that flushes f32 input denormals (the D3D default, and what every host above ran), a denormal operand is zero and both models give +0 for denormal × inf/NaN. That is why the negative controls on NVIDIA, WARP and AMD all passed without the fix.
  • In a mode that keeps f32 denormals, that model does not count the denormal as zero, and denormal × inf goes through the normal product (inf). This PR's exponent test returns +0 there.

This only matters if VIctory ever runs a program in a mode that keeps f32 denormals (s_setreg of MODE, or a title setting FLOAT_MODE). If it always assumes the flushing default, the exponent test is the host-independent way to get the hardware answer, and this PR is right for that. Derived from AnyPS5's sources and its measured rows; I have not run RDNA2 hardware in a preserving mode myself.

AI-assisted (Claude Code).

Thanks, this is a fair point and I should have qualified the RDNA2 claim, which I didn't verify on hardware. VIctory doesn't set float mode anywhere (s_denorm_mode is a no-op in ir.rs), so the fix assumes the flushing default. I'll state that assumption in the PR description. If a title ever switches to preserving denormals, this rule would be wrong for denormal × inf, so it would need to read the mode first.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140011495 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#issuecomment-7140011495). Originally posted by [senchsus](https://github.com/senchsus) on 2026-11-24T18:00:03Z. --- > A cross-check from AnyPS5's hardware-matched model; behaviour only, no code. It narrows when this PR's rule holds. > > * AnyPS5's legacy multiply counts an operand as zero for `0 × anything = 0` only when it is exactly ±0 (`(bits & 0x7fffffff) == 0`) _after_ the operand has gone through the f32 input-denormal handling of the current mode (`FP_DENORM`). > * Its legacy MAD/MAC model matched an RDNA1 card (gfx1010) on 45 504 oracle rows in all four f32 denormal modes, with the 144 edge combinations among them ([fix(shader): flush the v_mad_legacy_f32 and v_mac_legacy_f32 product by its tininess after rounding boykopovar/AnyPS5#26098](https://github.com/boykopovar/AnyPS5/pull/26098)). > * So in a mode that **flushes** f32 input denormals (the D3D default, and what every host above ran), a denormal operand is zero and both models give +0 for denormal × inf/NaN. That is why the negative controls on NVIDIA, WARP and AMD all passed without the fix. > * In a mode that **keeps** f32 denormals, that model does not count the denormal as zero, and denormal × inf goes through the normal product (inf). This PR's exponent test returns +0 there. > > This only matters if VIctory ever runs a program in a mode that keeps f32 denormals (`s_setreg` of MODE, or a title setting FLOAT_MODE). If it always assumes the flushing default, the exponent test is the host-independent way to get the hardware answer, and this PR is right for that. Derived from AnyPS5's sources and its measured rows; I have not run RDNA2 hardware in a preserving mode myself. > > AI-assisted (Claude Code). Thanks, this is a fair point and I should have qualified the RDNA2 claim, which I didn't verify on hardware. VIctory doesn't set float mode anywhere (s_denorm_mode is a no-op in ir.rs), so the fix assumes the flushing default. I'll state that assumption in the PR description. If a title ever switches to preserving denormals, this rule would be wrong for denormal × inf, so it would need to read the mode first.
Marvisak commented 2026-11-25 01:08:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:34:33Z.


Automated triage for the maintainers.

Merge candidate. The branch now merges cleanly. legacy_mul in crates/victory-shader/src/emit/lower.rs decides "operand is zero" on the exponent bits instead of a float == 0.0. That covers ±0 and f32 denormals, and the result no longer depends on the host's denormal mode. The change reaches v_mul_legacy_f32, v_mac_legacy_f32 and v_mad_legacy_f32. It matches main's existing convention that f32 denormals are read as zero (ftz, max_min), and VIctory does not model a mode that keeps denormals (s_denorm_mode is a no-op in ir.rs). The author acknowledged that limit after the cross-check in the thread. Recommending a look, not approving.

Notes (not blocking):

  • The new v_mul_legacy_f32_treats_denormals_as_zero test cannot tell old code from new on the hosts reported in this thread (NVIDIA, AMD RDNA2/RDNA4, WARP), because they all flush denormals by default. It documents the intended result but is not a regression guard there.
  • The bit test could reuse the existing ftz helper (e.g. compare ftz(a) with 0) instead of repeating the mask.
  • The same legacy_mul change is also part of the larger bundle in #1330; this PR is the focused version.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148654554 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#issuecomment-7148654554). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:34:33Z. --- <!-- victory-triage v1 head=32b4f8e6ae2798109843d27141fa5bab870ad88f verdict=merge-candidate at=2026-11-25T09:16:15Z --> Automated triage for the maintainers. **Merge candidate.** The branch now merges cleanly. `legacy_mul` in `crates/victory-shader/src/emit/lower.rs` decides "operand is zero" on the exponent bits instead of a float `== 0.0`. That covers ±0 and f32 denormals, and the result no longer depends on the host's denormal mode. The change reaches `v_mul_legacy_f32`, `v_mac_legacy_f32` and `v_mad_legacy_f32`. It matches main's existing convention that f32 denormals are read as zero (`ftz`, `max_min`), and VIctory does not model a mode that keeps denormals (`s_denorm_mode` is a no-op in `ir.rs`). The author acknowledged that limit after the cross-check in the thread. Recommending a look, not approving. Notes (not blocking): - The new `v_mul_legacy_f32_treats_denormals_as_zero` test cannot tell old code from new on the hosts reported in this thread (NVIDIA, AMD RDNA2/RDNA4, WARP), because they all flush denormals by default. It documents the intended result but is not a regression guard there. - The bit test could reuse the existing `ftz` helper (e.g. compare `ftz(a)` with 0) instead of repeating the mask. - The same `legacy_mul` change is also part of the larger bundle in #1330; this PR is the focused version. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
senchsus commented 2026-11-25 09:06:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by senchsus on 2026-11-25T08:26:50Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-shader/src/emit/valu_tests.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.

Generated by Claude Code

Merged main into the branch, the conflict in valu_tests.rs is resolved (kept both the new tests and this one). It merges cleanly now.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157035282 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/682#issuecomment-7157035282). Originally posted by [senchsus](https://github.com/senchsus) on 2026-11-25T08:26:50Z. --- > Automated triage for the maintainers. > > **Needs rebase.** This PR does not merge cleanly into current `main` ([ac2525d](https://github.com/Marvisak/VIctory/commit/ac2525dce10e98d16da9b4fd4bf7ea0e4876f4ff)). Conflicting files: `crates/victory-shader/src/emit/valu_tests.rs`. > > The content has not been reviewed yet; it will be once the branch is rebased onto `main`. > > _Generated by [Claude Code](https://claude.ai/code)_ Merged main into the branch, the conflict in valu_tests.rs is resolved (kept both the new tests and this one). It merges cleanly now.
upstream-sync closed this pull request 2026-11-25 22:02:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!682
No description provided.