Shaders: single-round v_fma_mixlo_f16 and v_fma_mixhi_f16 to binary16 #1608

Open
github-bot wants to merge 1 commit from github-bot/gh-1608 into main AGit
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 19:44 UTC · original
geiyiliyabumo:fix/shader-fma-mix-f16-single-round → main · +421 −21 · 2 files · 1 commits · open

Summary

Fixes double-rounding in v_fma_mixlo_f16 and v_fma_mixhi_f16 so both opcodes compute exact a * b + c and round once to IEEE-754 binary16 (round-to-nearest-even) without requiring f64 or INT64 DXIL capabilities (tracking issue #1242, VIC-BT-041).

Previously, Lower::valu computed self.fmad(xs[0], xs[1], xs[2]) in binary32 (rounding once to f32, and DXIL FMad opcode 46 does not even guarantee fused arithmetic) and then narrowed via legacyF32ToF16 (rounding a second time to f16). Inputs whose exact result lies strictly above or below a binary16 midpoint could round onto the midpoint in f32 and double-round in the wrong direction (e.g., returning 0x3C00 instead of 0x3C01).

Changes

  • crates/victory-shader/src/emit/lower.rs:
    • Implement exact 48-bit significand product + sticky-bit alignment in pure 32-bit integer DXIL (i32 pairs), rounding once directly to binary16 nearest-even, handling signed zero, infinities, canonical quiet NaN (0x7E00), and post-rounding clamp ([0.0, 1.0], mapping negative/NaN to +0.0), while preserving the untouched destination half.
    • Keep SFI0 free of DoublePrecision and Int64 feature flags.
  • crates/victory-shader/src/emit/valu_tests.rs:
    • Add 4 GPU-executed regression tests (59 synthetic dispatches) covering both double-rounding midpoint directions, v_fma_mixlo_f16 & v_fma_mixhi_f16, untouched-half preservation, mixed f16/f32 source selection, special values, clamp, and verifying neither DoublePrecision nor Int64 is declared in SFI0.

Verification

  • cargo test -p victory-shader --lib valu_tests: 17/17 passed on AMD Radeon RX 9060 XT (RDNA4, SM 6.6) and WARP.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 154 files OK.

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 19:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608) `geiyiliyabumo:fix/shader-fma-mix-f16-single-round` → `main` · +421 −21 · 2 files · 1 commits · open ## Summary Fixes double-rounding in `v_fma_mixlo_f16` and `v_fma_mixhi_f16` so both opcodes compute exact `a * b + c` and round **once** to IEEE-754 binary16 (round-to-nearest-even) without requiring `f64` or `INT64` DXIL capabilities (tracking issue #1242, `VIC-BT-041`). Previously, `Lower::valu` computed `self.fmad(xs[0], xs[1], xs[2])` in binary32 (rounding once to `f32`, and DXIL `FMad` opcode 46 does not even guarantee fused arithmetic) and then narrowed via `legacyF32ToF16` (rounding a second time to `f16`). Inputs whose exact result lies strictly above or below a binary16 midpoint could round onto the midpoint in `f32` and double-round in the wrong direction (e.g., returning `0x3C00` instead of `0x3C01`). ### Changes - `crates/victory-shader/src/emit/lower.rs`: - Implement exact 48-bit significand product + sticky-bit alignment in pure 32-bit integer DXIL (`i32` pairs), rounding once directly to binary16 nearest-even, handling signed zero, infinities, canonical quiet NaN (`0x7E00`), and post-rounding `clamp` (`[0.0, 1.0]`, mapping negative/NaN to `+0.0`), while preserving the untouched destination half. - Keep `SFI0` free of `DoublePrecision` and `Int64` feature flags. - `crates/victory-shader/src/emit/valu_tests.rs`: - Add 4 GPU-executed regression tests (59 synthetic dispatches) covering both double-rounding midpoint directions, `v_fma_mixlo_f16` & `v_fma_mixhi_f16`, untouched-half preservation, mixed f16/f32 source selection, special values, `clamp`, and verifying neither `DoublePrecision` nor `Int64` is declared in `SFI0`. ### Verification - `cargo test -p victory-shader --lib valu_tests`: **17/17 passed** on **AMD Radeon RX 9060 XT (RDNA4, SM 6.6)** and **WARP**. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 154 files OK. *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:38:13 +00:00
Author
Owner

@⁠Luislariosss on GitHub · 2026-11-24 20:48 UTC · original

Your new v_fma_mix_f16 tests fail on a machine that runs the GPU tests — and it is not a numeric mismatch, it is DXIL validation:

DXIL validation failed: "Function: main: error: 'dx.op.binaryWithTwoOuts.i32' is not a
DXILOpFunction for DXILOpcode 'UMul'. note: at '%44 = call %dx.types.i32
@dx.op.binaryWithTwoOuts.i32(i32 42, i32 %29, i32 %36)' ... error: ExtractValue should
only be used on dxil struct types and cmpxchg. ..."

at crates\victory-shader\src\emit\valu_tests.rs:78 (the module is validated before it runs), so the exact numbers never get compared. The emitted two-outs binary form is only valid for UDiv/SDiv; the two-outs form of a 32x32 multiply is dx.op.umul. All four fail the same way (rounds_once, clamps_the_rounded_half, preserves_special_values, selects_and_modifies_sources).

Seen on forge/main 63b03a77 (the merge of this PR is 954b1cd), Windows 11 26200, AMD RX 9060 XT 16 GB (RDNA4, driver 32.0.32015.7029), Rust 1.98.1. The failure is vendor-independent — any machine on which the GPU tests run sees it; the GPU-less runner skips these tests before validation, which is why CI is green on it. On the same machine the rest of valu_tests passes (v_cmp_class_f16_matches_rdna2, the packed ops, ...).

Repro: cargo test -p victory-shader emit::valu_tests::v_fma_mix_f16 -- --test-threads=1 where the GPU tests run.

AI use: opencode — HY4 Flash Free ran the suite on the forge branch; Sonnet reviewed the diagnosis. The validation text above is the test's own panic output.

**@⁠Luislariosss** on GitHub · 2026-11-24 20:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7144080992) Your new `v_fma_mix_f16` tests fail on a machine that runs the GPU tests — and it is not a numeric mismatch, it is DXIL validation: ``` DXIL validation failed: "Function: main: error: 'dx.op.binaryWithTwoOuts.i32' is not a DXILOpFunction for DXILOpcode 'UMul'. note: at '%44 = call %dx.types.i32 @dx.op.binaryWithTwoOuts.i32(i32 42, i32 %29, i32 %36)' ... error: ExtractValue should only be used on dxil struct types and cmpxchg. ..." ``` at `crates\victory-shader\src\emit\valu_tests.rs:78` (the module is validated before it runs), so the exact numbers never get compared. The emitted two-outs binary form is only valid for UDiv/SDiv; the two-outs form of a 32x32 multiply is `dx.op.umul`. All four fail the same way (`rounds_once`, `clamps_the_rounded_half`, `preserves_special_values`, `selects_and_modifies_sources`). Seen on `forge/main` `63b03a77` (the merge of this PR is `954b1cd`), Windows 11 26200, AMD RX 9060 XT 16 GB (RDNA4, driver 32.0.32015.7029), Rust 1.98.1. The failure is vendor-independent — any machine on which the GPU tests run sees it; the GPU-less runner skips these tests before validation, which is why CI is green on it. On the same machine the rest of `valu_tests` passes (`v_cmp_class_f16_matches_rdna2`, the packed ops, ...). Repro: `cargo test -p victory-shader emit::valu_tests::v_fma_mix_f16 -- --test-threads=1` where the GPU tests run. AI use: opencode — HY4 Flash Free ran the suite on the forge branch; Sonnet reviewed the diagnosis. The validation text above is the test's own panic output.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 21:05 UTC · original

Two of this pull request's own tests fail: the emitted DXIL is not valid

I found it while listing the tests the integration train (forge/main, which merges this pull request as 954b1cd) breaks. At that merge, and at today's train tip, the four v_fma_mix_f16 tests fail every time (3 of 3 runs at the merge, 10 of 10 at the tip):

$ cargo test -p victory-shader --locked v_fma_mix_f16
thread 'emit::valu_tests::v_fma_mix_f16_rounds_once' panicked at crates\victory-shader\src\emit\valu_tests.rs:78:31:
DXIL validation failed:
  Function: main: error: 'dx.op.binaryWithTwoOuts.i32' is not a DXILOpFuncition for DXILOpcode 'UMul'.
    note: at '%44 = call %dx.types.i32 @dx.op.binaryWithTwoOuts.i32(i32 42, i32 %29, i32 %36)' in block '#0' of function 'main'.
  Function: main: error: ExtractValue should only be used on dxil struct types and cmpxchg.
    note: at '%45 = extractvalue %dx.types.i32 %44, 0'
  Function: main: error: ExtractValue should only be used on dxil struct types and cmpxchg.
    note: at '%46 = extractvalue %dx.types.i32 %44, 1'
  Function: main: error: DXIL intrinsic overload must be valid.
Validation failed.

What it says precisely: the two-output multiply is emitted with opcode 42, UMul, and binaryWithTwoOuts is not a valid intrinsic for it (the two-output form is for 64-bit multiplies, UMul64/SMul64 — 42 is the opcode for the 32-bit one), so the result type stays i32 and the two extractvalues read fields out of a non-struct. emit::valu_tests.rs:78 is the shared validation helper, so all four tests (rounds_once, clamps_the_rounded_half, preserves_special_values, selects_and_modifies_sources) stop there rather than at their numeric assertions — the arithmetic may well be right and only the encoding wrong.

Two consequences worth more than the test failure:

  1. In the game it would be a refused program, not a wrong number. The validator is what the runtime's shader path goes through, so a program containing v_fma_mixlo_f16/v_fma_mixhi_f16 would be refused rather than miscompiled — a drop, not corruption.
  2. Nothing caught it before the train did: the tests are in this pull request, CI on a first-time contributor's PR stays in action_required until a maintainer approves it, and the forge checks cargo check, not cargo test. So the four tests have never passed anywhere.

dx.op.binaryWithTwoOuts is right for the 64-bit multiply; for a 32-bit one the emitter needs the plain multiply and a single result (or UMul64 on i64 operands) — whichever the lowering intends. The command above is the whole reproduction; the shader is synthetic, no game files.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 21:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7144459772) **Two of this pull request's own tests fail: the emitted DXIL is not valid** I found it while listing the tests the integration train (`forge/main`, which merges this pull request as `954b1cd`) breaks. At that merge, and at today's train tip, the four `v_fma_mix_f16` tests fail **every time** (3 of 3 runs at the merge, 10 of 10 at the tip): ``` $ cargo test -p victory-shader --locked v_fma_mix_f16 thread 'emit::valu_tests::v_fma_mix_f16_rounds_once' panicked at crates\victory-shader\src\emit\valu_tests.rs:78:31: DXIL validation failed: Function: main: error: 'dx.op.binaryWithTwoOuts.i32' is not a DXILOpFuncition for DXILOpcode 'UMul'. note: at '%44 = call %dx.types.i32 @dx.op.binaryWithTwoOuts.i32(i32 42, i32 %29, i32 %36)' in block '#0' of function 'main'. Function: main: error: ExtractValue should only be used on dxil struct types and cmpxchg. note: at '%45 = extractvalue %dx.types.i32 %44, 0' Function: main: error: ExtractValue should only be used on dxil struct types and cmpxchg. note: at '%46 = extractvalue %dx.types.i32 %44, 1' Function: main: error: DXIL intrinsic overload must be valid. Validation failed. ``` What it says precisely: the two-output multiply is emitted with **opcode 42, `UMul`**, and `binaryWithTwoOuts` is not a valid intrinsic for it (the two-output form is for 64-bit multiplies, `UMul64`/`SMul64` — 42 is the opcode for the 32-bit one), so the result type stays `i32` and the two `extractvalue`s read fields out of a non-struct. `emit::valu_tests.rs:78` is the shared validation helper, so all four tests (`rounds_once`, `clamps_the_rounded_half`, `preserves_special_values`, `selects_and_modifies_sources`) stop there rather than at their numeric assertions — the arithmetic may well be right and only the encoding wrong. Two consequences worth more than the test failure: 1. **In the game it would be a refused program, not a wrong number.** The validator is what the runtime's shader path goes through, so a program containing `v_fma_mixlo_f16`/`v_fma_mixhi_f16` would be refused rather than miscompiled — a drop, not corruption. 2. **Nothing caught it before the train did**: the tests are in this pull request, CI on a first-time contributor's PR stays in `action_required` until a maintainer approves it, and the forge checks `cargo check`, not `cargo test`. So the four tests have never passed anywhere. `dx.op.binaryWithTwoOuts` is right for the 64-bit multiply; for a 32-bit one the emitter needs the plain multiply and a single result (or `UMul64` on `i64` operands) — whichever the lowering intends. The command above is the whole reproduction; the shader is synthetic, no game files. Written with an AI assistant.
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 21:06 UTC · original

Thanks @⁠DenRakEiw and @⁠Luislariosss for catching the dxil.dll validation failure!

Fixed in ced51de: replaced the dx.op.binaryWithTwoOuts.i32 (opcode 42) call with pure 32-bit LLVM 16-bit partial-product arithmetic (still zero INT64 flags). Re-verified locally with Microsoft dxil.dll validation enabled (VICTORY_DXIL) on both AMD Radeon RX 9060 XT and WARP:

  • cargo test -p victory-shader --lib valu_tests: 17 passed, 0 failed (all 4 v_fma_mix_f16_* tests validate with dxil.dll and pass on hardware + WARP).
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 154 files ok.

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 21:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7144492733) Thanks @⁠DenRakEiw and @⁠Luislariosss for catching the `dxil.dll` validation failure! Fixed in `ced51de`: replaced the `dx.op.binaryWithTwoOuts.i32` (opcode 42) call with pure 32-bit LLVM 16-bit partial-product arithmetic (still zero `INT64` flags). Re-verified locally with Microsoft `dxil.dll` validation enabled (`VICTORY_DXIL`) on both **AMD Radeon RX 9060 XT** and **WARP**: - `cargo test -p victory-shader --lib valu_tests`: **17 passed, 0 failed** (all 4 `v_fma_mix_f16_*` tests validate with `dxil.dll` and pass on hardware + WARP). - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 154 files ok. *AI-assisted; synthetic tests only, no game files.*
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 21:08 UTC · original

What DXC does with the same multiply — and it does not use that intrinsic at all

Following the failure I reported above, I compiled the equivalent on this machine with the SDK's own compiler (DXC from 10.0.26100.0, -T cs_6_6):

uint a = tid.x * 2654435761u + 1u;
uint b = tid.y * 40503u + 7u;
uint64_t p = (uint64_t)a * (uint64_t)b;

and the emitted DXIL is a plain 64-bit multiply, no intrinsic:

%8  = zext i32 %5 to i64
%9  = zext i32 %7 to i64
%10 = mul nuw i64 %9, %8
%11 = lshr i64 %10, 32

So DXIL allows native i64 multiply, and the two-output form is not needed for this computation at all. Two consequences for this pull request:

  1. The current call is wrong in two ways at once, which is why the validator complains twice. Opcode 42 is UMul, a one-result operation, while the function is declared as the two-output form ('dx.op.binaryWithTwoOuts.i32' is not a DXILOpFuncition for DXILOpcode 'UMul'). And the result is declared with named_struct("dx.types.i32", …) — that name is the module's alias for i32 itself, so the two extractvalues read fields out of an i32 (ExtractValue should only be used on dxil struct types).
  2. The direct route is available in this codebase. bitcode.rs already has Ty::Int(i64) and int_const(ty, i64), so zext both significands to i64, Bin::Mul, and lshr/trunc give exactly what DXC emits — no new intrinsic, no result-type struct, and the same single-rounding arithmetic you are after (the product is exact before it is rounded to f16).

If the two-output intrinsic is wanted anyway (for a target without native i64 multiply), it needs the opcode whose class name matches the function name — umul64-style — and a result type declared as a new struct, not reused from the dx.types.i32 alias. The DXC reference above says it is avoidable for the case at hand.

Reproduction of the failure itself, and the four tests that stop at the validator: #1608

No game data is involved: a synthetic shader and the SDK's own compiler.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 21:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7144519851) **What DXC does with the same multiply — and it does not use that intrinsic at all** Following the failure I reported above, I compiled the equivalent on this machine with the SDK's own compiler (DXC from `10.0.26100.0`, `-T cs_6_6`): ```hlsl uint a = tid.x * 2654435761u + 1u; uint b = tid.y * 40503u + 7u; uint64_t p = (uint64_t)a * (uint64_t)b; ``` and the emitted DXIL is a plain 64-bit multiply, no intrinsic: ```llvm %8 = zext i32 %5 to i64 %9 = zext i32 %7 to i64 %10 = mul nuw i64 %9, %8 %11 = lshr i64 %10, 32 ``` So DXIL allows native `i64` multiply, and the two-output form is not needed for this computation at all. Two consequences for this pull request: 1. **The current call is wrong in two ways at once**, which is why the validator complains twice. Opcode `42` is `UMul`, a one-result operation, while the function is declared as the two-output form (`'dx.op.binaryWithTwoOuts.i32' is not a DXILOpFuncition for DXILOpcode 'UMul'`). And the result is declared with `named_struct("dx.types.i32", …)` — that name is the module's alias **for i32 itself**, so the two `extractvalue`s read fields out of an `i32` (`ExtractValue should only be used on dxil struct types`). 2. **The direct route is available in this codebase.** `bitcode.rs` already has `Ty::Int(i64)` and `int_const(ty, i64)`, so `zext` both significands to i64, `Bin::Mul`, and `lshr`/`trunc` give exactly what DXC emits — no new intrinsic, no result-type struct, and the same single-rounding arithmetic you are after (the product is exact before it is rounded to f16). If the two-output intrinsic is wanted anyway (for a target without native i64 multiply), it needs the opcode whose class name matches the function name — `umul64`-style — and a result type declared as a *new* struct, not reused from the `dx.types.i32` alias. The DXC reference above says it is avoidable for the case at hand. Reproduction of the failure itself, and the four tests that stop at the validator: https://git.gtahub.st/github/Marvisak--VIctory/pulls/1608 No game data is involved: a synthetic shader and the SDK's own compiler. Written with an AI assistant.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 21:09 UTC · original

Correction to my suggestion above, with the experiment that corrects it

I said the direct route was a native mul i64, and I tried it. It does make the DXIL valid — and it fails this pull request for a reason I should have read first:

-        // UMul returns the exact 48-bit product as two i32s (high, low).
-        let pair_type = m.named_struct("dx.types.i32", vec![i32t, i32t]);
-        let product = self.s.op(c, "binaryWithTwoOuts.i32", Attr::ReadNone, pair_type, 42, &[sig_a, sig_b]);
-        let m = &mut self.s.m;
-        let product_hi = m.extract(c, product, 0);
-        let product_lo = m.extract(c, product, 1);
+        let i64t = m.int(64);
+        let a64 = m.cast(c, Cast::ZExt, sig_a, i64t);
+        let b64 = m.cast(c, Cast::ZExt, sig_b, i64t);
+        let product = m.bin(c, Bin::Mul, a64, b64);
+        let m = &mut self.s.m;
+        let k32w = m.int_const(i64t, 32);
+        let product_hi = m.bin(c, Bin::LShr, product, k32w);
+        let product_hi = m.cast(c, Cast::Trunc, product_hi, i32t);
+        let product_lo = m.cast(c, Cast::Trunc, product, i32t);
+        self.s.flags |= flags::INT64;

With that in place, all four tests get past the validator (no more DXIL validation failed) and stop at valu_tests.rs:359 instead:

assertion `left == right` failed
  left: 32768      # 0x8000, flags::INT64 in SFI0
 right: 0

which is this test's own requirement:

const WIDE_OPS: u64 = 0x0001 | 0x0020 | 0x8000; // Doubles, double extensions, int64.
assert_eq!(requirements & WIDE_OPS, 0);

So the two-output intrinsic is not an accident — it is how this lowering stays free of Int64, and that is the right goal: dx.op.umul64 takes two i32s and returns two i32s precisely so a shader can multiply 64 bits wide without declaring 64-bit integer support. The native mul i64 inside mul_hi above (lower.rs, which sets flags::INT64) is not usable here, and my earlier suggestion would have made the container demand a capability the original console shader never asked for.

Which leaves the encoding, and only the encoding:

  1. the opcode: 42 is UMul, a single-result operation. The two-result 64-bit multiply has its own opcode, and the function name's class must match it (…umul64…, not binaryWithTwoOuts);
  2. the result type: named_struct("dx.types.i32", …) reuses the module's alias for i32 itself, so the call's result is an i32 and both extractvalues are invalid. It needs a type of its own (an anonymous or uniquely named {i32, i32}), not that name.

Two experiments for whoever picks it up, both cheap: after any change, cargo test -p victory-shader --locked v_fma_mix_f16 either stops at valu_tests.rs:78 (the validator still refuses the encoding) or at the numeric assertions (the encoding is right and the arithmetic is next); and the SFI0 assertion above also tells you immediately if the route stopped being Int64-free.

No game data is involved: a synthetic shader and the SDK's own compiler.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 21:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7144546984) **Correction to my suggestion above, with the experiment that corrects it** I said the direct route was a native `mul i64`, and I tried it. It does make the DXIL valid — and it fails this pull request for a reason I should have read first: ```diff - // UMul returns the exact 48-bit product as two i32s (high, low). - let pair_type = m.named_struct("dx.types.i32", vec![i32t, i32t]); - let product = self.s.op(c, "binaryWithTwoOuts.i32", Attr::ReadNone, pair_type, 42, &[sig_a, sig_b]); - let m = &mut self.s.m; - let product_hi = m.extract(c, product, 0); - let product_lo = m.extract(c, product, 1); + let i64t = m.int(64); + let a64 = m.cast(c, Cast::ZExt, sig_a, i64t); + let b64 = m.cast(c, Cast::ZExt, sig_b, i64t); + let product = m.bin(c, Bin::Mul, a64, b64); + let m = &mut self.s.m; + let k32w = m.int_const(i64t, 32); + let product_hi = m.bin(c, Bin::LShr, product, k32w); + let product_hi = m.cast(c, Cast::Trunc, product_hi, i32t); + let product_lo = m.cast(c, Cast::Trunc, product, i32t); + self.s.flags |= flags::INT64; ``` With that in place, all four tests get **past the validator** (no more `DXIL validation failed`) and stop at `valu_tests.rs:359` instead: ``` assertion `left == right` failed left: 32768 # 0x8000, flags::INT64 in SFI0 right: 0 ``` which is this test's own requirement: ```rust const WIDE_OPS: u64 = 0x0001 | 0x0020 | 0x8000; // Doubles, double extensions, int64. assert_eq!(requirements & WIDE_OPS, 0); ``` **So the two-output intrinsic is not an accident — it is how this lowering stays free of `Int64`**, and that is the right goal: `dx.op.umul64` takes two `i32`s and returns two `i32`s precisely so a shader can multiply 64 bits wide without declaring 64-bit integer support. The native `mul i64` inside `mul_hi` above (`lower.rs`, which sets `flags::INT64`) is not usable here, and my earlier suggestion would have made the container demand a capability the original console shader never asked for. Which leaves the encoding, and only the encoding: 1. **the opcode**: `42` is `UMul`, a single-result operation. The two-result 64-bit multiply has its own opcode, and the function name's class must match it (`…umul64…`, not `binaryWithTwoOuts`); 2. **the result type**: `named_struct("dx.types.i32", …)` reuses the module's alias **for `i32` itself**, so the call's result is an `i32` and both `extractvalue`s are invalid. It needs a type of its own (an anonymous or uniquely named `{i32, i32}`), not that name. Two experiments for whoever picks it up, both cheap: after any change, `cargo test -p victory-shader --locked v_fma_mix_f16` either stops at `valu_tests.rs:78` (the validator still refuses the encoding) or at the numeric assertions (the encoding is right and the arithmetic is next); and the `SFI0` assertion above also tells you immediately if the route stopped being `Int64`-free. No game data is involved: a synthetic shader and the SDK's own compiler. Written with an AI assistant.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 21:11 UTC · original

Settled: there is no two-output multiply in DXIL, and with a native 64-bit multiply your four tests pass

I finished the experiments. Three results, in the order that matters.

1. The intrinsic this pull request calls does not exist, and nothing like it does. I probed which class the validator assigns to each opcode by emitting a deliberately wrong name and reading back … is not a DXILOpFuncition for DXILOpcode '<class>':

opcode class opcode class opcode class
40 UMin 44 UAddc 48 IMad
41 IMul 45 USubb 49 UMad
42 UMul 46 FMad 50 Msad
43 UDiv 47 Fma 51 Ibfe
52 Ubfe

UAddc and USubb are the two-output ones (add/subtract with carry). There is no multiply that returns two results, so binaryWithTwoOuts.i32 with opcode 42 — one result — cannot be made to work by renaming it; I also tried umul.i32 with a single i32 result and with a distinct two-field struct, and the validator refuses both.

2. The canonical compiler does not use an intrinsic either. DXC (cs_6_6 and cs_6_0) compiles (uint64)a * (uint64)b to a native mul nuw i64 and declares Int64 in SFI0.

3. With a native 64-bit multiply your arithmetic is correct. I replaced the product with zext → mul i64 → lshr 32/trunc (the same shape as mul_hi in lower.rs), set flags::INT64, and relaxed the WIDE_OPS assertion in run_fma_mix_f16 to see past it:

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 331 filtered out

All four pass on the numbers — single rounding, the clamping, the special values and the source selection — not just the validator. So the arithmetic in this pull request is right; what fails is only the container's requirement that Int64 stay unset.

The choice, then, is a policy one, and it is not mine to make:

  • allow Int64 for this lowering (relax the WIDE_OPS assertion, keep the native multiply): four tests green, arithmetic verified, and every D3D12 host that can run shader model 6.6 reports Int64ShaderOps — the runtime already refuses mesh shaders by capability, so it could name this one the same way;
  • keep it Int64-free, in which case the high half has to be built from 32-bit pieces: split each significand into 16-bit halves and combine four partial products (16x16 products fit in 32 bits), which is exact and needs no 64-bit type. It is more code, and mul_hi above is the wrong template for it because it sets flags::INT64.

Either way, the current intrinsic call cannot validate, and the two-output form is not the way in.

No game data is involved: a synthetic shader, the SDK's validator and its compiler.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 21:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7144601345) **Settled: there is no two-output multiply in DXIL, and with a native 64-bit multiply your four tests pass** I finished the experiments. Three results, in the order that matters. **1. The intrinsic this pull request calls does not exist, and nothing like it does.** I probed which class the validator assigns to each opcode by emitting a deliberately wrong name and reading back `… is not a DXILOpFuncition for DXILOpcode '<class>'`: | opcode | class | opcode | class | opcode | class | |---|---|---|---|---|---| | 40 | `UMin` | 44 | `UAddc` | 48 | `IMad` | | 41 | `IMul` | 45 | `USubb` | 49 | `UMad` | | 42 | `UMul` | 46 | `FMad` | 50 | `Msad` | | 43 | `UDiv` | 47 | `Fma` | 51 | `Ibfe` | | | | | | 52 | `Ubfe` | `UAddc` and `USubb` are the two-output ones (add/subtract with carry). There is **no** multiply that returns two results, so `binaryWithTwoOuts.i32` with opcode 42 — one result — cannot be made to work by renaming it; I also tried `umul.i32` with a single `i32` result and with a distinct two-field struct, and the validator refuses both. **2. The canonical compiler does not use an intrinsic either.** DXC (`cs_6_6` and `cs_6_0`) compiles `(uint64)a * (uint64)b` to a native `mul nuw i64` and declares `Int64` in `SFI0`. **3. With a native 64-bit multiply your arithmetic is correct.** I replaced the product with `zext` → `mul i64` → `lshr 32`/`trunc` (the same shape as `mul_hi` in `lower.rs`), set `flags::INT64`, and relaxed the `WIDE_OPS` assertion in `run_fma_mix_f16` to see past it: ``` test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 331 filtered out ``` All four pass on the numbers — single rounding, the clamping, the special values and the source selection — not just the validator. So the arithmetic in this pull request is right; what fails is only the container's requirement that `Int64` stay unset. **The choice, then, is a policy one, and it is not mine to make:** - **allow `Int64`** for this lowering (relax the `WIDE_OPS` assertion, keep the native multiply): four tests green, arithmetic verified, and every D3D12 host that can run shader model 6.6 reports `Int64ShaderOps` — the runtime already refuses mesh shaders by capability, so it could name this one the same way; - **keep it `Int64`-free**, in which case the high half has to be built from 32-bit pieces: split each significand into 16-bit halves and combine four partial products (`16x16` products fit in 32 bits), which is exact and needs no 64-bit type. It is more code, and `mul_hi` above is the wrong template for it because it sets `flags::INT64`. Either way, the current intrinsic call cannot validate, and the two-output form is not the way in. No game data is involved: a synthetic shader, the SDK's validator and its compiler. Written with an AI assistant.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 21:13 UTC · original

A patch that keeps Int64 out and makes the four tests pass

Following the two results above (DXIL has no two-output multiply, and a native mul i64 makes the arithmetic correct but declares Int64, which your own WIDE_OPS assertion forbids), I wrote the third way: build the exact product from 32-bit pieces. Both significands are below 2^24, so splitting each into 16-bit halves gives four exact partial products, and

(a0 + 2^16 a1)(b0 + 2^16 b1) = a0b0 + 2^16 (a0b1 + a1b0) + 2^32 a1b1

with a0b1 + a1b0 < 2^25 and a1b1 < 2^16, so every term fits in 32 bits.

-        // UMul returns the exact 48-bit product as two i32s (high, low).
-        let pair_type = m.named_struct("dx.types.i32", vec![i32t, i32t]);
-        let product = self.s.op(
-            c,
-            "binaryWithTwoOuts.i32",
-            Attr::ReadNone,
-            pair_type,
-            42,
-            &[sig_a, sig_b],
-        );
+        // The exact 48-bit product in two dwords, without declaring Int64:
+        // both significands are below 2^24, so splitting each into 16-bit
+        // halves gives four exact partial products, and
+        //     (a0 + 2^16 a1) (b0 + 2^16 b1) = a0 b0 + 2^16 (a0 b1 + a1 b0) + 2^32 a1 b1
+        // where a0 b1 + a1 b0 is below 2^25 and a1 b1 below 2^16: every term
+        // fits in 32 bits. DXIL has no two-output multiply to lean on.
+        let (k16, k16m) = (m.i32(16), m.i32(0xFFFF));
+        let a0 = m.bin(c, Bin::And, sig_a, k16m);
+        let a1 = m.bin(c, Bin::LShr, sig_a, k16);
+        let b0 = m.bin(c, Bin::And, sig_b, k16m);
+        let b1 = m.bin(c, Bin::LShr, sig_b, k16);
+        let p00 = m.bin(c, Bin::Mul, a0, b0);
+        let cross = m.bin(c, Bin::Mul, a0, b1);
+        let other = m.bin(c, Bin::Mul, a1, b0);
+        let cross = m.bin(c, Bin::Add, cross, other);
+        let p11 = m.bin(c, Bin::Mul, a1, b1);
+        let carry_in = m.bin(c, Bin::Shl, cross, k16);
+        let product_lo = m.bin(c, Bin::Add, p00, carry_in);
+        let wrapped = m.cmp(c, pred::IULT, product_lo, p00);
+        let wrapped = m.cast(c, Cast::ZExt, wrapped, i32t);
+        let cross_hi = m.bin(c, Bin::LShr, cross, k16);
+        let product_hi = m.bin(c, Bin::Add, p11, cross_hi);
+        let product_hi = m.bin(c, Bin::Add, product_hi, wrapped);
         let m = &mut self.s.m;
-        let product_hi = m.extract(c, product, 0);
-        let product_lo = m.extract(c, product, 1);

product_hi and product_lo come out exactly as the code below them expects, so nothing else changes.

Verification, with your tests untouched (including the SFI0 assertion):

cargo test -p victory-shader --locked v_fma_mix_f16
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 331 filtered out

cargo test -p victory-shader --locked
test result: ok. 331 passed; 0 failed; 4 ignored; 0 measured

cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings   # clean

So the single-rounding arithmetic you wrote is right, the container stays free of Int64 (which is what the lowering wants, since the console's v_fma_mix*_f16 never needed it), and the cost is four multiplies and a carry instead of an intrinsic that DXIL does not have.

One trap, in case you write a variant: the unsigned carry compare must be pred::IULT, not pred::ULT — the latter is a float predicate and the validator rejects the module with Invalid predicate in ICmp instruction!.

Patches are yours to take or rewrite; I have no branch in your repository. No game data is involved: a synthetic shader.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 21:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7144642647) **A patch that keeps `Int64` out and makes the four tests pass** Following the two results above (DXIL has no two-output multiply, and a native `mul i64` makes the arithmetic correct but declares `Int64`, which your own `WIDE_OPS` assertion forbids), I wrote the third way: build the exact product from 32-bit pieces. Both significands are below 2^24, so splitting each into 16-bit halves gives four exact partial products, and ``` (a0 + 2^16 a1)(b0 + 2^16 b1) = a0b0 + 2^16 (a0b1 + a1b0) + 2^32 a1b1 ``` with `a0b1 + a1b0 < 2^25` and `a1b1 < 2^16`, so every term fits in 32 bits. ```diff - // UMul returns the exact 48-bit product as two i32s (high, low). - let pair_type = m.named_struct("dx.types.i32", vec![i32t, i32t]); - let product = self.s.op( - c, - "binaryWithTwoOuts.i32", - Attr::ReadNone, - pair_type, - 42, - &[sig_a, sig_b], - ); + // The exact 48-bit product in two dwords, without declaring Int64: + // both significands are below 2^24, so splitting each into 16-bit + // halves gives four exact partial products, and + // (a0 + 2^16 a1) (b0 + 2^16 b1) = a0 b0 + 2^16 (a0 b1 + a1 b0) + 2^32 a1 b1 + // where a0 b1 + a1 b0 is below 2^25 and a1 b1 below 2^16: every term + // fits in 32 bits. DXIL has no two-output multiply to lean on. + let (k16, k16m) = (m.i32(16), m.i32(0xFFFF)); + let a0 = m.bin(c, Bin::And, sig_a, k16m); + let a1 = m.bin(c, Bin::LShr, sig_a, k16); + let b0 = m.bin(c, Bin::And, sig_b, k16m); + let b1 = m.bin(c, Bin::LShr, sig_b, k16); + let p00 = m.bin(c, Bin::Mul, a0, b0); + let cross = m.bin(c, Bin::Mul, a0, b1); + let other = m.bin(c, Bin::Mul, a1, b0); + let cross = m.bin(c, Bin::Add, cross, other); + let p11 = m.bin(c, Bin::Mul, a1, b1); + let carry_in = m.bin(c, Bin::Shl, cross, k16); + let product_lo = m.bin(c, Bin::Add, p00, carry_in); + let wrapped = m.cmp(c, pred::IULT, product_lo, p00); + let wrapped = m.cast(c, Cast::ZExt, wrapped, i32t); + let cross_hi = m.bin(c, Bin::LShr, cross, k16); + let product_hi = m.bin(c, Bin::Add, p11, cross_hi); + let product_hi = m.bin(c, Bin::Add, product_hi, wrapped); let m = &mut self.s.m; - let product_hi = m.extract(c, product, 0); - let product_lo = m.extract(c, product, 1); ``` `product_hi` and `product_lo` come out exactly as the code below them expects, so nothing else changes. **Verification, with your tests untouched (including the `SFI0` assertion):** ``` cargo test -p victory-shader --locked v_fma_mix_f16 test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 331 filtered out cargo test -p victory-shader --locked test result: ok. 331 passed; 0 failed; 4 ignored; 0 measured cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings # clean ``` So the single-rounding arithmetic you wrote is right, the container stays free of `Int64` (which is what the lowering wants, since the console's `v_fma_mix*_f16` never needed it), and the cost is four multiplies and a carry instead of an intrinsic that DXIL does not have. One trap, in case you write a variant: the unsigned carry compare must be `pred::IULT`, not `pred::ULT` — the latter is a float predicate and the validator rejects the module with `Invalid predicate in ICmp instruction!`. Patches are yours to take or rewrite; I have no branch in your repository. No game data is involved: a synthetic shader. Written with an AI assistant.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:32 UTC · original · edited 2026-11-25 15:53 UTC

Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-shader/src/emit/valu_tests.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (needs work) was for an older state of main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7149656216) · edited 2026-11-25 15:53 UTC <!-- victory-triage v1 head=ae0cf040f96fb0a8a9649f49c15bd211080ef7c3 verdict=needs-rebase at=2026-11-25T15:54:00Z --> Automated triage for the maintainers. This pull request no longer merges cleanly into `main` (conflicts in `crates/victory-shader/src/emit/valu_tests.rs`). It will be reviewed once it is rebased onto the current `main`. The earlier verdict (needs work) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 01:48 UTC · original

Rebased cleanly onto \main\ (\ccfb029) and verified the pure 32-bit (\Int64-free) 16x16 partial-product lowering: \cargo test -p victory-shader --locked v_fma_mix_f16\ (4/4 passed on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll\ validation, with \WIDE_OPS/\Int64\ unset), \cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings, and \cargo xtask policy\ all pass.

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 01:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7149973397) Rebased cleanly onto \main\ (\ccfb029\) and verified the pure 32-bit (\Int64\-free) 16x16 partial-product lowering: \cargo test -p victory-shader --locked v_fma_mix_f16\ (4/4 passed on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll\ validation, with \WIDE_OPS\/\Int64\ unset), \cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings\, and \cargo xtask policy\ all pass.
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 03:39 UTC · original

Updated \Lower::fma_mix_f16\ to flush f32 denormal inputs to signed zero before the fused multiply-add, matching \semantics_tests.rs's RDNA2 hardware model while keeping \WIDE_OPS/\Int64\ unset. Rebased onto \main\ (\940d32f); verified on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll: \semantics_tests\ (32 passed, 0 failed), \ _fma_mix_f16\ (4 passed, 0 failed), \clippy -D warnings, and \xtask policy\ all pass.

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 03:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7152120280) Updated \Lower::fma_mix_f16\ to flush f32 denormal inputs to signed zero before the fused multiply-add, matching \semantics_tests.rs\'s RDNA2 hardware model while keeping \WIDE_OPS\/\Int64\ unset. Rebased onto \main\ (\940d32f\); verified on physical AMD RX 9060 XT + WARP + Microsoft \dxil.dll\: \semantics_tests\ (32 passed, 0 failed), \ _fma_mix_f16\ (4 passed, 0 failed), \clippy -D warnings\, and \xtask policy\ all pass.
Author
Owner

@⁠DenRakEiw on GitHub · 2026-11-24 19:56 UTC · original · reviewed

Tested locally merged onto origin/main (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, with dxil.dll validator):

  • cargo clippy -p victory-shader --all-targets — 0 warnings
  • cargo xtask policy — ok
  • DXIL validation failure on all 4 new v_fma_mix_f16_* tests (v_fma_mix_f16_rounds_once, v_fma_mix_f16_preserves_special_values, v_fma_mix_f16_selects_and_modifies_sources, v_fma_mix_f16_clamps_the_rounded_half) on both RTX 5090 and WARP:
DXIL validation failed:
Function: main: error: 'dx.op.binaryWithTwoOuts.i32' is not a DXILOpFuncition for DXILOpcode 'UMul'.
note: at '%44 = call %dx.types.i32 @dx.op.binaryWithTwoOuts.i32(i32 42, i32 %29, i32 %36)' in block '#0' of function 'main'.
Function: main: error: ExtractValue should only be used on dxil struct types and cmpxchg.
note: at '%45 = extractvalue %dx.types.i32 %44, 0' in block '#0' of function 'main'.
Function: main: error: ExtractValue should only be used on dxil struct types and cmpxchg.
note: at '%46 = extractvalue %dx.types.i32 %44, 1' in block '#0' of function 'main'.
Function: main: error: DXIL intrinsic overload must be valid.
note: at '%44 = call %dx.types.i32 @dx.op.binaryWithTwoOuts.i32(i32 42, i32 %29, i32 %36)' in block '#0' of function 'main'.
Validation failed.

Holding off approval until the emitted DXIL passes dxil.dll validation and the tests pass on hardware/WARP.

AI-assisted (Gemini 4 Neon).

**@⁠DenRakEiw** on GitHub · 2026-11-24 19:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#pullrequestreview-6046368028) · **reviewed** Tested locally merged onto `origin/main` (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, with `dxil.dll` validator): - `cargo clippy -p victory-shader --all-targets` — 0 warnings - `cargo xtask policy` — ok - **DXIL validation failure on all 4 new `v_fma_mix_f16_*` tests** (`v_fma_mix_f16_rounds_once`, `v_fma_mix_f16_preserves_special_values`, `v_fma_mix_f16_selects_and_modifies_sources`, `v_fma_mix_f16_clamps_the_rounded_half`) on both RTX 5090 and WARP: ``` DXIL validation failed: Function: main: error: 'dx.op.binaryWithTwoOuts.i32' is not a DXILOpFuncition for DXILOpcode 'UMul'. note: at '%44 = call %dx.types.i32 @dx.op.binaryWithTwoOuts.i32(i32 42, i32 %29, i32 %36)' in block '#0' of function 'main'. Function: main: error: ExtractValue should only be used on dxil struct types and cmpxchg. note: at '%45 = extractvalue %dx.types.i32 %44, 0' in block '#0' of function 'main'. Function: main: error: ExtractValue should only be used on dxil struct types and cmpxchg. note: at '%46 = extractvalue %dx.types.i32 %44, 1' in block '#0' of function 'main'. Function: main: error: DXIL intrinsic overload must be valid. note: at '%44 = call %dx.types.i32 @dx.op.binaryWithTwoOuts.i32(i32 42, i32 %29, i32 %36)' in block '#0' of function 'main'. Validation failed. ``` Holding off approval until the emitted DXIL passes `dxil.dll` validation and the tests pass on hardware/WARP. AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 20:05 UTC · original · approved these changes

Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked. GPU/valu execution tests are Windows-gated and were not run here.

v_fma_mixlo_f16/v_fma_mixhi_f16 now round to binary16 in a single step: wide_shr_sticky/wide_negate_if/round_wide_to_f16 do the 64-bit sticky-shift rounding without an intermediate f32, and fma_mix_f16 wires it with clamp and source modifiers. Four valu tests pin single-rounding, specials, clamp and modifier selection — hardware/WARP only, so the rounding path is validated there, not here; macOS suite green (96).

**@⁠catminou4** on GitHub · 2026-11-24 20:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#pullrequestreview-6046495365) · **approved these changes** Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), `cargo test -p victory-shader --locked`. GPU/valu execution tests are Windows-gated and were not run here. `v_fma_mixlo_f16`/`v_fma_mixhi_f16` now round to binary16 in a single step: `wide_shr_sticky`/`wide_negate_if`/`round_wide_to_f16` do the 64-bit sticky-shift rounding without an intermediate f32, and `fma_mix_f16` wires it with clamp and source modifiers. Four valu tests pin single-rounding, specials, clamp and modifier selection — hardware/WARP only, so the rounding path is validated there, not here; macOS suite green (96).
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 17:30 UTC · original

I integrated each PR separately on current main (63bcca4) and ran the same five synthetic tests with Microsoft WARP 1.0.22, Agility 1.620.2, and DXIL validation. The shared set covers the midpoint, clamp, special values, source modifiers, and the positive and negative cases for MODE rounding toward zero.

Build Shared tests passed VALU suite
63bcca4 with the test changes only 2/5
#1608 integration, 19fa93b 5/5 40/40
#1588 integration, d4ff5dd 5/5 41/41

On main, a midpoint rounds to 3c00 instead of 3c01, a corresponding clamped case reads 3800 instead of 3801, and the finite multiply with a negative-infinity addend yields NaN instead of fc00. Both integrations fix those rows. Both have zero mismatches in the separate 55,486-input mixed-precision comparison and clear the wide-operation feature bits in the shared tests. Clippy with all features and asset policy also passed for both.

In the #1608 integration, the existing main path still handles explicit toward-zero mode, and the exact integer implementation handles nearest-even. The #1588 integration keeps its existing mode selection. Both preserve the original Git commits. If you use either merge resolution, please retain its author or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding it into another commit. AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 17:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1608#issuecomment-7199130315) I integrated each PR separately on current `main` (`63bcca4`) and ran the same five synthetic tests with Microsoft WARP 1.0.22, Agility 1.620.2, and DXIL validation. The shared set covers the midpoint, clamp, special values, source modifiers, and the positive and negative cases for MODE rounding toward zero. | Build | Shared tests passed | VALU suite | | --- | ---: | ---: | | `63bcca4` with the test changes only | 2/5 | | | [#1608 integration, `19fa93b`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/19fa93b259e02e07b8d1ffd198be24e1dd863df4) | 5/5 | 40/40 | | [#1588 integration, `d4ff5dd`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/d4ff5dd39db470dafa01e9e4b0814daf174c3773) | 5/5 | 41/41 | On main, a midpoint rounds to `3c00` instead of `3c01`, a corresponding clamped case reads `3800` instead of `3801`, and the finite multiply with a negative-infinity addend yields NaN instead of `fc00`. Both integrations fix those rows. Both have zero mismatches in the separate 55,486-input mixed-precision comparison and clear the wide-operation feature bits in the shared tests. Clippy with all features and asset policy also passed for both. In the #1608 integration, the existing main path still handles explicit toward-zero mode, and the exact integer implementation handles nearest-even. The #1588 integration keeps its existing mode selection. Both preserve the original Git commits. If you use either merge resolution, please retain its author or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding it into another commit. AI-assisted with Codex.
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/lower.rs
  • crates/victory-shader/src/emit/valu_tests.rs
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.
git fetch -u origin '+refs/pull/1608/head:github-bot/gh-1608'
git switch 'github-bot/gh-1608'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1608'
git switch 'github-bot/gh-1608'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1608'
git switch 'github-bot/gh-1608'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1608'
git switch 'main'
git merge --squash 'github-bot/gh-1608'
git switch 'main'
git merge --ff-only 'github-bot/gh-1608'
git switch 'main'
git merge 'github-bot/gh-1608'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1608
No description provided.