Shader tests: a cross-device VALU fuzzer (hardware adapters vs WARP) #1613

Open
alexdeliu wants to merge 8 commits from upstream-pr/1614 into main
alexdeliu commented 2026-11-24 19:47:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexdeliu on 2026-11-24T19:47:24Z.


An ignored test that looks for shaders that compute different values on different GPUs. Every VOP3-encoded opcode the translator lowers runs as a one-thread compute shader on every hardware adapter and on WARP, on the same inputs, and the test reports where the devices disagree. The inputs are signed zeros, denormals, infinities, quiet and signalling NaNs, integer and f16 edges in either half, and seeded pseudo-random dwords.

Comparison rules:

  • Results must match bit for bit.
  • Any NaN matches any NaN.
  • Approximate ops (rcp, rsq, sqrt, log, exp, sin, cos) get a few ULPs.

A disagreement means the translation leans on behaviour that DXIL leaves to the device. The test is test-only and doesn't run in CI:

cargo test -p victory-shader --lib fuzz_tests -- --ignored --nocapture

Environment variables:

  • VICTORY_FUZZ_CASES: inputs per opcode (default 160).
  • VICTORY_FUZZ_OPS: comma-separated name filter.
  • VICTORY_FUZZ_OUT: write a Markdown report.

Each device runs alone, because two at once suspend WARP. A removed device is released before a new one is made, because D3D12 hands back the same removed device while a reference is alive.

What it found on main @ ffe310eb

Devices: RX 9070 (RDNA4), Ryzen 7700 iGPU (gfx1036, RDNA2) and WARP. 212 opcodes, 200 inputs each.

Finding Devices Status
Ordered v_cmp_*_{i64,u64} wrong when the operands share a dword AMD fixed in #1599
f16 results rounded toward zero by legacyF32ToF16 AMD #422 fixes it (0 differences with it)
fcmp false / fcmp true (v_cmp_f/tru_f{16,32}) remove the device WARP #1326 fixes it
Denormal inputs: AMD and WARP flush or keep them, and pick the sign of a flushed zero, differently. Affects v_min/max/min3/max3/med3_f32, v_cubesc/tc_f32, v_sin_f32 all open: the translation sets no fp32 denorm mode
v_fma_f32 / v_fmac_f32 are fused on AMD and not on WARP (1 ULP) known FMad shortcut (lower.rs)
v_cvt_f32_u32 misrounds, v_log_f32 is 20% off at 1 - 2^-24 WARP WARP's own; CI results can mislead

The full report and the per-opcode tables are in the gist: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87

Later commits add VOP3P (v_pk_*, v_fma_mix*) and modifier variants (VICTORY_FUZZ_MODS=1): #422 also fixes the packed f16 ops and v_fmac_f16/v_fma_f16 on AMD.

Checks

  • Both CI clippy runs are clean.
  • The test is #[ignore]d, so cargo test --workspace is unchanged.
  • It is skipped where no SM 6.6 hardware device exists.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5479174745 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614). Originally posted by [alexdeliu](https://github.com/alexdeliu) on 2026-11-24T19:47:24Z. --- An **ignored** test that looks for shaders that compute different values on different GPUs. Every VOP3-encoded opcode the translator lowers runs as a one-thread compute shader on **every hardware adapter and on WARP**, on the same inputs, and the test reports where the devices disagree. The inputs are signed zeros, denormals, infinities, quiet and signalling NaNs, integer and f16 edges in either half, and seeded pseudo-random dwords. Comparison rules: - Results must match bit for bit. - Any NaN matches any NaN. - Approximate ops (`rcp`, `rsq`, `sqrt`, `log`, `exp`, `sin`, `cos`) get a few ULPs. A disagreement means the translation leans on behaviour that DXIL leaves to the device. The test is test-only and doesn't run in CI: ``` cargo test -p victory-shader --lib fuzz_tests -- --ignored --nocapture ``` Environment variables: - `VICTORY_FUZZ_CASES`: inputs per opcode (default 160). - `VICTORY_FUZZ_OPS`: comma-separated name filter. - `VICTORY_FUZZ_OUT`: write a Markdown report. Each device runs alone, because two at once suspend WARP. A removed device is released before a new one is made, because D3D12 hands back the same removed device while a reference is alive. ## What it found on `main` @ `ffe310eb` Devices: RX 9070 (RDNA4), Ryzen 7700 iGPU (gfx1036, RDNA2) and WARP. 212 opcodes, 200 inputs each. | Finding | Devices | Status | |---|---|---| | Ordered `v_cmp_*_{i64,u64}` wrong when the operands share a dword | AMD | fixed in #1599 | | f16 results rounded toward zero by `legacyF32ToF16` | AMD | #422 fixes it (0 differences with it) | | `fcmp false` / `fcmp true` (`v_cmp_f/tru_f{16,32}`) remove the device | WARP | #1326 fixes it | | Denormal inputs: AMD and WARP flush or keep them, and pick the sign of a flushed zero, differently. Affects `v_min/max/min3/max3/med3_f32`, `v_cubesc/tc_f32`, `v_sin_f32` | all | open: the translation sets no fp32 denorm mode | | `v_fma_f32` / `v_fmac_f32` are fused on AMD and not on WARP (1 ULP) | | known `FMad` shortcut (`lower.rs`) | | `v_cvt_f32_u32` misrounds, `v_log_f32` is 20% off at `1 - 2^-24` | WARP | WARP's own; CI results can mislead | The full report and the per-opcode tables are in the gist: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87 Later commits add VOP3P (`v_pk_*`, `v_fma_mix*`) and modifier variants (`VICTORY_FUZZ_MODS=1`): #422 also fixes the packed f16 ops and `v_fmac_f16`/`v_fma_f16` on AMD. ## Checks - Both CI clippy runs are clean. - The test is `#[ignore]`d, so `cargo test --workspace` is unchanged. - It is skipped where no SM 6.6 hardware device exists. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DenRakEiw commented 2026-11-24 19:56:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T19:56:46Z.

Review: APPROVED


Verified locally merged onto origin/main (Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test -p victory-shader --lib emit::fuzz_tests:: — compiles cleanly and respects #[ignore]
  • cargo clippy -p victory-shader --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean opt-in cross-device VALU fuzzer comparing hardware adapters against WARP. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6046366492 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#pullrequestreview-6046366492). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T19:56:46Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test -p victory-shader --lib emit::fuzz_tests::` — compiles cleanly and respects `#[ignore]` - `cargo clippy -p victory-shader --all-targets` — 0 warnings - `cargo xtask policy` — ok Clean opt-in cross-device VALU fuzzer comparing hardware adapters against WARP. Looks good. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-24 20:05:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:05:27Z.

Review: COMMENTED


Static review only: fuzz_tests is #[cfg(all(test, windows))] and every case is #[ignore]d (run via cargo test -p victory-shader --lib fuzz_tests -- --ignored), so nothing here executes on macOS (suite stays at 96). The harness design is sound — deterministic cross-device VALU fuzzing of hardware adapters vs WARP with per-case reporting is exactly what this codebase needs for the lowering churn. Two requests: (1) wire the --ignored run into the Windows CI leg (or document the exact command in the PR/README), since ignored tests rot quickly; (2) a note on how failures are minimized/reportered (shrinking to a minimal VALU case would make reports actionable).

<!-- greyfinch-sync:Marvisak/VIctory:review:6046495545 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#pullrequestreview-6046495545). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T20:05:27Z. **Review:** COMMENTED --- Static review only: `fuzz_tests` is `#[cfg(all(test, windows))]` and every case is `#[ignore]`d (run via `cargo test -p victory-shader --lib fuzz_tests -- --ignored`), so nothing here executes on macOS (suite stays at 96). The harness design is sound — deterministic cross-device VALU fuzzing of hardware adapters vs WARP with per-case reporting is exactly what this codebase needs for the lowering churn. Two requests: (1) wire the `--ignored` run into the Windows CI leg (or document the exact command in the PR/README), since ignored tests rot quickly; (2) a note on how failures are minimized/reportered (shrinking to a minimal VALU case would make reports actionable).
alexdeliu commented 2026-11-24 21:03:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexdeliu on 2026-11-24T20:33:18Z.


@catminou4 thanks, both done in f1125da, and @DenRakEiw thanks for the approval:

  1. Running it. The README now gives the command next to cargo test --workspace. I didn't wire it into CI: the fuzzer only learns something by comparing two devices, and CI's runners have WARP alone. With fewer than two SM 6.6 devices it now returns ("nothing to compare") instead of failing. The useful runs are the ones contributors make on their own GPUs. @DrDarkDK's RTX 4070 Ti + Ryzen iGPU run on #1599 is the model.
  2. Actionable reports. Every finding is one instruction with four input dwords, so there is little left to shrink. Rows are now sorted simplest first (fewest non-zero dwords), and each finding ends with the instruction words and inputs a regression test needs:
Repro: `build(&[0xd4e10014, 0x02020501, 0xd5010000, 0x00510280])` with v1..v4 = `[0x00000000, 0xffff8000, 0x83ff7bff, 0x1fbd4000]`.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7143724028 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7143724028). Originally posted by [alexdeliu](https://github.com/alexdeliu) on 2026-11-24T20:33:18Z. --- @catminou4 thanks, both done in `f1125da`, and @DenRakEiw thanks for the approval: 1. **Running it.** The README now gives the command next to `cargo test --workspace`. I didn't wire it into CI: the fuzzer only learns something by comparing two devices, and CI's runners have WARP alone. With fewer than two SM 6.6 devices it now returns ("nothing to compare") instead of failing. The useful runs are the ones contributors make on their own GPUs. @DrDarkDK's RTX 4070 Ti + Ryzen iGPU run on #1599 is the model. 2. **Actionable reports.** Every finding is one instruction with four input dwords, so there is little left to shrink. Rows are now sorted simplest first (fewest non-zero dwords), and each finding ends with the instruction words and inputs a regression test needs: ``` Repro: `build(&[0xd4e10014, 0x02020501, 0xd5010000, 0x00510280])` with v1..v4 = `[0x00000000, 0xffff8000, 0x83ff7bff, 0x1fbd4000]`. ```
tumbubu commented 2026-11-24 22:02:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by tumbubu on 2026-11-24T21:51:46Z.


A run on RDNA3 (RX 7900 XT): same findings as on the RX 9070 and gfx1036, nothing specific to RDNA3.

c3372c1, cargo test -p victory-shader --locked --lib fuzz_tests -- --ignored --nocapture --test-threads=1, default 160 inputs. RX 7900 XT, driver 32.0.31036.15, Windows 11 26300.

  • 234 opcodes compared, 31 differ, 112 refused, 4 lost a device. It took about 6 minutes.
  • The 31 opcodes that differ are the ones in your gist's 200-input run. The only one missing is v_med3_f16, at 2 of 200 there, which 160 inputs may not reach. Counts per opcode are in the same range: i64/u64 compares 57 to 110, v_cubetc_f32 32, v_sin_f32 54, v_pk_add_f16 11, and so on.
  • The 4 lost devices are WARP on v_cmp_f/tru_f{32,16} ("device instance has been suspended"), as in your table (#1326). The 7900 XT lost no device.
  • WARP's v_cvt_f32_u32(0xde84975e) = 0x4f5e8498 against 0x4f5e8497 on the 7900 XT: the same WARP misrounding you report. There is a second case: 0xeb8bc49b gives 0x4f6b8bc4 on WARP and 0x4f6b8bc5 on AMD.
  • v_cos_f32 at half a turn gives exactly -1.0 (0xbf800000) on the 7900 XT against 0xbf7ffff9 on WARP. That is WARP being inexact once more (FIND-5).

The full report is available if useful. AI-assisted (Claude Code); every run was on this machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7145486892 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7145486892). Originally posted by [tumbubu](https://github.com/tumbubu) on 2026-11-24T21:51:46Z. --- **A run on RDNA3 (RX 7900 XT): same findings as on the RX 9070 and gfx1036, nothing specific to RDNA3.** `c3372c1`, `cargo test -p victory-shader --locked --lib fuzz_tests -- --ignored --nocapture --test-threads=1`, default 160 inputs. RX 7900 XT, driver 32.0.31036.15, Windows 11 26300. - 234 opcodes compared, **31 differ**, 112 refused, 4 lost a device. It took about 6 minutes. - The 31 opcodes that differ are the ones in your gist's 200-input run. The only one missing is `v_med3_f16`, at 2 of 200 there, which 160 inputs may not reach. Counts per opcode are in the same range: i64/u64 compares 57 to 110, `v_cubetc_f32` 32, `v_sin_f32` 54, `v_pk_add_f16` 11, and so on. - The 4 lost devices are WARP on `v_cmp_f/tru_f{32,16}` ("device instance has been suspended"), as in your table (#1326). The 7900 XT lost no device. - WARP's `v_cvt_f32_u32(0xde84975e)` = `0x4f5e8498` against `0x4f5e8497` on the 7900 XT: the same WARP misrounding you report. There is a second case: `0xeb8bc49b` gives `0x4f6b8bc4` on WARP and `0x4f6b8bc5` on AMD. - `v_cos_f32` at half a turn gives exactly `-1.0` (`0xbf800000`) on the 7900 XT against `0xbf7ffff9` on WARP. That is WARP being inexact once more (FIND-5). The full report is available if useful. AI-assisted (Claude Code); every run was on this machine.
tumbubu commented 2026-11-24 23:05:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by tumbubu on 2026-11-24T22:30:23Z.


The new main on RDNA3: the same 17 disagreements as on the RX 9070 and gfx1036, and no lost device.

50cbc89 (this PR merged onto 70564ae), VICTORY_FUZZ_CASES=200. RX 7900 XT, driver 32.0.31036.15, against WARP.

  • 243 opcodes compared, 17 differ, 107 refused, 0 lost a device (ffe310e: 31 differ, 4 lost).
  • The 17 are the ones @alexdeliu lists for 70564ae in #1633:
    • the 8 ordered v_cmp_{lt,le,gt,ge}_{i64,u64} (#1599);
    • fused v_fma_f32/v_fmac_f32;
    • v_cubesc/tc_f32 (#1766);
    • WARP's inexact v_cvt_f32_u32, v_log_f32, v_sin/cos_f32, v_sin_f16.
  • Counts per opcode at 200 inputs match your gist's ffe310e table exactly for the i64/u64 compares (79 to 138), v_cubetc_f32 (45) and v_sin_f32 (63). v_sin_f16 is 14 here against 11 in the gist, which ran before 77053a0 changed f16 rounding.

So on all three AMD generations the f16 rounding, min/max/med3 and WARP device-loss findings are gone with 77053a0.

AI-assisted (Claude Code); every run was on this machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146310440 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7146310440). Originally posted by [tumbubu](https://github.com/tumbubu) on 2026-11-24T22:30:23Z. --- **The new `main` on RDNA3: the same 17 disagreements as on the RX 9070 and gfx1036, and no lost device.** `50cbc89` (this PR merged onto `70564ae`), `VICTORY_FUZZ_CASES=200`. RX 7900 XT, driver 32.0.31036.15, against WARP. - 243 opcodes compared, **17 differ**, 107 refused, **0 lost a device** (`ffe310e`: 31 differ, 4 lost). - The 17 are the ones @alexdeliu lists for `70564ae` in #1633: - the 8 ordered `v_cmp_{lt,le,gt,ge}_{i64,u64}` (#1599); - fused `v_fma_f32`/`v_fmac_f32`; - `v_cubesc/tc_f32` (#1766); - WARP's inexact `v_cvt_f32_u32`, `v_log_f32`, `v_sin/cos_f32`, `v_sin_f16`. - Counts per opcode at 200 inputs match your gist's `ffe310e` table exactly for the i64/u64 compares (79 to 138), `v_cubetc_f32` (45) and `v_sin_f32` (63). `v_sin_f16` is 14 here against 11 in the gist, which ran before `77053a0` changed f16 rounding. So on all three AMD generations the f16 rounding, min/max/med3 and WARP device-loss findings are gone with `77053a0`. AI-assisted (Claude Code); every run was on this machine.
DeerSilver commented 2026-11-25 00:06:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DeerSilver on 2026-11-24T23:06:31Z.


Ran the fuzzer at 50cbc89 on a machine with two hardware adapters, so all three columns are filled. Setup: one laptop with an NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell, 10de:2d59, driver 621.24) and an Intel UHD Graphics (Raptor Lake Xe-LP, 8086:a788, driver 32.0.101.7088), Windows 11 26300, Rust 1.98.1. The PR was merged onto main 70564ae.

  • cargo test --workspace --all-features --locked --no-fail-fast -- --test-threads=1 with the D3D12 debug layer on (VICTORY_D3D12_DEBUG=1, and a local, uncommitted change that also turns the debug layer on in victory-shader's test Host): 475 passed, 5 failed, 8 ignored (the fuzzer is the new ignored one). The 5 failures are the ones main 70564ae has by itself on NVIDIA (the view-heap cap and the structured-view stride, already reported in #1744); this PR adds none.
  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: clean
  • cargo test --locked -p victory-shader --lib fuzz_tests -- --ignored --nocapture --test-threads=1 with VICTORY_FUZZ_OUT set and default settings (160 inputs) finished in 1583 s in a debug build. 243 opcodes compared on the RTX 5060 Laptop, the Intel UHD and WARP: 28 differ, 107 refused by the translator, 0 lost a device.

I also ran the earlier head, c3372c1, on ffe310e: 234 compared, 31 differ, 4 lost. The difference between the two runs shows what the main update changed. The v_min/max_f32, v_min3/max3_f32 and v_med3_f32 differences are gone. So are the 4 WARP device losses on v_cmp_f/tru_f32/f16. Everything below still differs on 70564ae. For each opcode the table names the odd device out, counted over the rows the report shows:

Odd one out Opcodes What it looks like
Intel UHD all 14 f16 compares (v_cmp_lt/eq/le/gt/lg/ge/nge/nlg/ngt/nle/neq/nlt_f16) subnormal halves compare as zero, e.g. v_cmp_le_f16(0x0001, 0x8001) is 1 on Intel, 0 on the RTX and WARP
Intel UHD v_cmp_o_f32, v_cmp_u_f32 inverted when an operand is NaN: v_cmp_o_f32(NaN, π) is 1 on Intel. This looks like the fcmp ord/uno fold that med3 had, and these two compares don't use the bit test
Intel UHD v_cvt_flr_i32_f32 (7), v_cvt_rpi_i32_f32 (14) new on 70564ae. A NaN input gives 0 on Intel and 0x7fffffff or 0x80000000 on the RTX and WARP. I haven't checked which one RDNA2 gives
Intel UHD v_mac_f32, v_mad_f32, v_fract_f32 (1–2 rows each)
RTX 5060 v_cubesc_f32, v_cubetc_f32 keeps subnormal results (0x80000001) that Intel and WARP flush to -0
all three differ v_sin_f16 (34), v_log_f32 (3) low bits on subnormal inputs (0x0003 / 0x0006 / 0x0006), precision
WARP v_sin_f32 (57), v_cos_f32, v_fmac_f32, v_fma_f32, v_cvt_f32_u32 precision, and f32 subnormals WARP keeps

I stopped the VICTORY_FUZZ_MODS=1 pass before it finished. I can attach either report (about 38 KB of synthetic inputs and results) if that helps.

No game data used. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147022259 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7147022259). Originally posted by [DeerSilver](https://github.com/DeerSilver) on 2026-11-24T23:06:31Z. --- Ran the fuzzer at `50cbc89` on a machine with two hardware adapters, so all three columns are filled. **Setup:** one laptop with an NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell, `10de:2d59`, driver 621.24) and an Intel UHD Graphics (Raptor Lake Xe-LP, `8086:a788`, driver 32.0.101.7088), Windows 11 26300, Rust 1.98.1. The PR was merged onto `main` `70564ae`. - `cargo test --workspace --all-features --locked --no-fail-fast -- --test-threads=1` with the D3D12 debug layer on (`VICTORY_D3D12_DEBUG=1`, and a local, uncommitted change that also turns the debug layer on in victory-shader's test `Host`): 475 passed, 5 failed, 8 ignored (the fuzzer is the new ignored one). The 5 failures are the ones `main` `70564ae` has by itself on NVIDIA (the view-heap cap and the structured-view stride, already reported in #1744); this PR adds none. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`: clean - `cargo test --locked -p victory-shader --lib fuzz_tests -- --ignored --nocapture --test-threads=1` with `VICTORY_FUZZ_OUT` set and default settings (160 inputs) finished in 1583 s in a debug build. **243 opcodes compared on the RTX 5060 Laptop, the Intel UHD and WARP: 28 differ, 107 refused by the translator, 0 lost a device.** I also ran the earlier head, `c3372c1`, on `ffe310e`: 234 compared, 31 differ, 4 lost. The difference between the two runs shows what the `main` update changed. The `v_min/max_f32`, `v_min3/max3_f32` and `v_med3_f32` differences are gone. So are the 4 WARP device losses on `v_cmp_f/tru_f32/f16`. Everything below still differs on `70564ae`. For each opcode the table names the odd device out, counted over the rows the report shows: | Odd one out | Opcodes | What it looks like | |---|---|---| | Intel UHD | all 14 f16 compares (`v_cmp_lt/eq/le/gt/lg/ge/nge/nlg/ngt/nle/neq/nlt_f16`) | subnormal halves compare as zero, e.g. `v_cmp_le_f16(0x0001, 0x8001)` is 1 on Intel, 0 on the RTX and WARP | | Intel UHD | `v_cmp_o_f32`, `v_cmp_u_f32` | inverted when an operand is NaN: `v_cmp_o_f32(NaN, π)` is 1 on Intel. This looks like the `fcmp ord`/`uno` fold that med3 had, and these two compares don't use the bit test | | Intel UHD | `v_cvt_flr_i32_f32` (7), `v_cvt_rpi_i32_f32` (14) | new on `70564ae`. A NaN input gives `0` on Intel and `0x7fffffff` or `0x80000000` on the RTX and WARP. I haven't checked which one RDNA2 gives | | Intel UHD | `v_mac_f32`, `v_mad_f32`, `v_fract_f32` (1–2 rows each) | | | RTX 5060 | `v_cubesc_f32`, `v_cubetc_f32` | keeps subnormal results (`0x80000001`) that Intel and WARP flush to `-0` | | all three differ | `v_sin_f16` (34), `v_log_f32` (3) | low bits on subnormal inputs (`0x0003` / `0x0006` / `0x0006`), precision | | WARP | `v_sin_f32` (57), `v_cos_f32`, `v_fmac_f32`, `v_fma_f32`, `v_cvt_f32_u32` | precision, and f32 subnormals WARP keeps | I stopped the `VICTORY_FUZZ_MODS=1` pass before it finished. I can attach either report (about 38 KB of synthetic inputs and results) if that helps. No game data used. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 04:06:55 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Merge candidate. This adds an #[ignore]d test, emit/fuzz_tests.rs, that runs each lowered VOP3/VOP3P opcode as a one-thread compute shader on every hardware adapter and on WARP and reports where they disagree, plus a short README note. It is test-only, uses only the existing windows features and Host, holds ONE_AT_A_TIME, and writes a file only when VICTORY_FUZZ_OUT is set. Since the last review it has three changes. It merges main and fills in the new view_marks fields. agree now takes a result's type from the first type token in the opcode name, which is right for v_cvt_* and v_dot2_f32_f16 alike. hardware_adapters now also requires DedicatedVideoMemory > 0, as host.rs's hardware_adapter does.

Thanks for taking up the adapter nit; that point is resolved.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151995721 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7151995721). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T03:31:33Z. --- <!-- victory-triage v1 head=c147a1894e56532ed8f1c1c3b5d574ac34087bd0 verdict=merge-candidate at=2026-11-25T06:23:30Z --> Automated triage for the maintainers. **Merge candidate.** This adds an `#[ignore]`d test, `emit/fuzz_tests.rs`, that runs each lowered VOP3/VOP3P opcode as a one-thread compute shader on every hardware adapter and on WARP and reports where they disagree, plus a short README note. It is test-only, uses only the existing `windows` features and `Host`, holds `ONE_AT_A_TIME`, and writes a file only when `VICTORY_FUZZ_OUT` is set. Since the last review it has three changes. It merges `main` and fills in the new `view_marks` fields. `agree` now takes a result's type from the first type token in the opcode name, which is right for `v_cvt_*` and `v_dot2_f32_f16` alike. `hardware_adapters` now also requires `DedicatedVideoMemory > 0`, as `host.rs`'s `hardware_adapter` does. Thanks for taking up the adapter nit; that point is resolved. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
alexdeliu commented 2026-11-25 05:06:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexdeliu on 2026-11-25T05:00:34Z.


Merged main (940d32f) in as 170a6c8; 03593cb follows it. 03593cb adds view_marks (cd94d35) and takes up the triage nit: hardware_adapters now requires dedicated video memory as well as no software flag, like host.rs's hardware_adapter from #1911/#1925. On the RX 9070 + gfx1036 machine, both CI clippy runs are clean and cargo test --workspace --locked passes, except the 2 PSV0 tests main itself fails with the SDK's dxil.dll 1.7. A full fuzz of the new main is running; I'll post it if anything changed from the 17 known disagreements.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153363817 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7153363817). Originally posted by [alexdeliu](https://github.com/alexdeliu) on 2026-11-25T05:00:34Z. --- Merged `main` (`940d32f`) in as `170a6c8`; `03593cb` follows it. `03593cb` adds `view_marks` (cd94d35) and takes up the triage nit: `hardware_adapters` now requires dedicated video memory as well as no software flag, like `host.rs`'s `hardware_adapter` from #1911/#1925. On the RX 9070 + gfx1036 machine, both CI clippy runs are clean and `cargo test --workspace --locked` passes, except the 2 PSV0 tests `main` itself fails with the SDK's `dxil.dll` 1.7. A full fuzz of the new `main` is running; I'll post it if anything changed from the 17 known disagreements.
alexdeliu commented 2026-11-25 06:02:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexdeliu on 2026-11-25T05:23:50Z.


The full fuzz of 940d32f on the RX 9070, gfx1036 and WARP (200 inputs per opcode) shows the same 17 disagreements as before. There are now 251 opcodes compared, up from 243 (8 more are lowered), and 0 lost devices. c147a18 fixes a fuzzer classification bug: an op like v_dot2_f32_f16 had its f32 result treated as f16 for NaN matching. The result type is now the first type in the name. It changes no finding here.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153729945 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7153729945). Originally posted by [alexdeliu](https://github.com/alexdeliu) on 2026-11-25T05:23:50Z. --- The full fuzz of `940d32f` on the RX 9070, gfx1036 and WARP (200 inputs per opcode) shows the same 17 disagreements as before. There are now 251 opcodes compared, up from 243 (8 more are lowered), and 0 lost devices. `c147a18` fixes a fuzzer classification bug: an op like `v_dot2_f32_f16` had its f32 result treated as f16 for NaN matching. The result type is now the first type in the name. It changes no finding here.
fuzeofficlal commented 2026-11-26 02:07:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:25:46Z.


Code review and triple-adapter (NVIDIA RTX 5090 + AMD Radeon iGPU + WARP) verification at head c147a1894e56 merged onto main (63bcca43c6a0; emit/lower.rs untouched):

  • Compile blocker after merging onto main (crates/victory-shader/src/emit/fuzz_tests.rs:716):
    • Git merges cleanly with zero text conflicts, but victory-shader fails to compile on main (63bcca43):
      error: cannot construct 'emit::host::Host' with struct literal syntax due to private fields
    • Host now has a private warp: bool field (emit/host.rs:17-20, 194-197); changing Ok(Host { device }) at fuzz_tests.rs:716 to Ok(Host::from_device(device)) fixes compilation and clippy cleanly with 0 warnings.
  • Two non-blocking agree() edge notes (fuzz_tests.rs:376-391):
    1. Line 376 let float = name.contains("_f") || ... matches integer-destination conversions like v_cvt_i32_f32/v_cvt_u32_f32, which would let integer results > 0x7F80_0000 (e.g. i32::MAX) pass as is_f32_nan; checking the destination type (first type suffix) avoids false matches.
    2. Lines 385-391 (approximate f16 path) compare only a & 0xFFFF / b & 0xFFFF without verifying the preserved upper half a >> 16 == b >> 16 (unlike line 380's NaN branch), and 0x7BFF vs 0x7C00 (+inf) are 1 bit apart.
  • Triple-adapter live run (with only line 716 locally changed to Host::from_device(device)):
    • cargo xtask policy: 192 files ok; cargo clippy --locked -p victory-shader --tests -- -D warnings: 0 warnings
    • VICTORY_FUZZ_OPS=v_add_f32,v_rcp_f32,v_pk_add_f16,v_bfe_u32 VICTORY_FUZZ_CASES=32 VICTORY_FUZZ_MODS=1 cargo test --locked -p victory-shader --lib fuzz_tests -- --ignored --nocapture (with dxil.dll 10.0.26100.0):
      Passed across NVIDIA GeForce RTX 5090 + AMD Radeon Graphics + WARP (18 opcodes compared, 32 inputs each; 0 differ; 0 refused by the translator; 0 lost a device, 51.07s).

Updating line 716 to Host::from_device(device) will make this build cleanly on main.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179763616 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7179763616). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T01:25:46Z. --- Code review and triple-adapter (NVIDIA RTX 5090 + AMD Radeon iGPU + WARP) verification at head `c147a1894e56` merged onto `main` (`63bcca43c6a0`; `emit/lower.rs` untouched): - **Compile blocker after merging onto `main` (`crates/victory-shader/src/emit/fuzz_tests.rs:716`)**: - Git merges cleanly with zero text conflicts, but `victory-shader` fails to compile on `main` (`63bcca43`): `error: cannot construct 'emit::host::Host' with struct literal syntax due to private fields` - `Host` now has a private `warp: bool` field (`emit/host.rs:17-20, 194-197`); changing `Ok(Host { device })` at `fuzz_tests.rs:716` to `Ok(Host::from_device(device))` fixes compilation and `clippy` cleanly with 0 warnings. - **Two non-blocking `agree()` edge notes (`fuzz_tests.rs:376-391`)**: 1. Line 376 `let float = name.contains("_f") || ...` matches integer-destination conversions like `v_cvt_i32_f32`/`v_cvt_u32_f32`, which would let integer results `> 0x7F80_0000` (e.g. `i32::MAX`) pass as `is_f32_nan`; checking the destination type (first type suffix) avoids false matches. 2. Lines 385-391 (`approximate` `f16` path) compare only `a & 0xFFFF` / `b & 0xFFFF` without verifying the preserved upper half `a >> 16 == b >> 16` (unlike line 380's NaN branch), and `0x7BFF` vs `0x7C00` (`+inf`) are 1 bit apart. - **Triple-adapter live run (with only line 716 locally changed to `Host::from_device(device)`)**: - `cargo xtask policy`: `192 files ok`; `cargo clippy --locked -p victory-shader --tests -- -D warnings`: 0 warnings - `VICTORY_FUZZ_OPS=v_add_f32,v_rcp_f32,v_pk_add_f16,v_bfe_u32 VICTORY_FUZZ_CASES=32 VICTORY_FUZZ_MODS=1 cargo test --locked -p victory-shader --lib fuzz_tests -- --ignored --nocapture` (with `dxil.dll` 10.0.26100.0): Passed across **NVIDIA GeForce RTX 5090 + AMD Radeon Graphics + WARP** (`18 opcodes compared, 32 inputs each; 0 differ; 0 refused by the translator; 0 lost a device`, 51.07s). Updating line 716 to `Host::from_device(device)` will make this build cleanly on `main`.
ColorMeBoom commented 2026-11-26 19:12:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-26T19:12:14Z.


RDNA1 run on current main — RX 5700 XT (Navi 10), driver 32.0.21045.29003, Windows 11 26200; main 63bcca4 with this PR merged locally.

Build note: on current main fuzz_tests.rs:716 no longer compiles (Host has a private warp field); Ok(Host::from_device(device)) fixes it.

251 opcodes × 160 inputs: 4 differ, 99 refused, 0 device losses. All four are transcendental:

  • v_log_f32 (1/160): log2(1 − 2⁻²⁴), RX 5700 XT 0xb3b8aa3c is right, WARP 0xb3e00000 is ~21 % off (FIND-5).
  • v_cos_f32 (4/160): near 0.5/1 revolution the RX 5700 XT gives the correctly rounded ±1.0, WARP is 7 ULP off.
  • v_sin_f16 (12/160): on the rows checked the RX 5700 XT is right and WARP is ~10 f16 ULP off.
  • v_sin_f32 (54/160): mixed. On small inputs the RX 5700 XT is ~6–7 ULP low (sin(2π·2⁻¹²⁶): 0x01c90fd5, exact 0x01c90fdb); on others WARP flushes to 0 or is percent-level off.

None of the findings in the PR description (i64 shared-dword compares, f16 rounding, denormals) show up on RDNA1 at current main.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7201307970 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7201307970). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-26T19:12:14Z. --- **RDNA1 run on current main** — RX 5700 XT (Navi 10), driver 32.0.21045.29003, Windows 11 26200; main `63bcca4` with this PR merged locally. Build note: on current main `fuzz_tests.rs:716` no longer compiles (`Host` has a private `warp` field); `Ok(Host::from_device(device))` fixes it. 251 opcodes × 160 inputs: 4 differ, 99 refused, 0 device losses. All four are transcendental: - `v_log_f32` (1/160): `log2(1 − 2⁻²⁴)`, RX 5700 XT `0xb3b8aa3c` is right, WARP `0xb3e00000` is ~21 % off (FIND-5). - `v_cos_f32` (4/160): near 0.5/1 revolution the RX 5700 XT gives the correctly rounded ±1.0, WARP is 7 ULP off. - `v_sin_f16` (12/160): on the rows checked the RX 5700 XT is right and WARP is ~10 f16 ULP off. - `v_sin_f32` (54/160): mixed. On small inputs the RX 5700 XT is ~6–7 ULP low (sin(2π·2⁻¹²⁶): `0x01c90fd5`, exact `0x01c90fdb`); on others WARP flushes to 0 or is percent-level off. None of the findings in the PR description (i64 shared-dword compares, f16 rounding, denormals) show up on RDNA1 at current main. AI use: Claude Code (Claude Opus 5.5).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1614:upstream-pr/1614'
git switch 'upstream-pr/1614'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1614'
git switch 'upstream-pr/1614'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1614'
git switch 'upstream-pr/1614'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1614'
git switch 'main'
git merge --squash 'upstream-pr/1614'
git switch 'main'
git merge --ff-only 'upstream-pr/1614'
git switch 'main'
git merge 'upstream-pr/1614'
git push origin 'main'
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!1613
No description provided.