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

Open
github-bot wants to merge 8 commits from github-bot/gh-1614 into main AGit
Owner

@⁠alexdeliu on GitHub · 2026-11-24 19:47 UTC · original
alexdeliu:valu-fuzz → main · +724 −0 · 3 files · 8 commits · open

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

**@⁠alexdeliu** on GitHub · 2026-11-24 19:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614) `alexdeliu:valu-fuzz` → `main` · +724 −0 · 3 files · 8 commits · open 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)
An ignored test runs every VOP3-encoded opcode the translator lowers as a
one-thread compute shader on each hardware adapter and on WARP, on the
same inputs (signed zeros, denormals, infinities, quiet and signalling
NaNs, integer and f16 edges, pseudo-random dwords), and reports where the
devices disagree: any NaN matches any NaN, approximate operations get a
few ULPs. A disagreement means the translation leans on behaviour DXIL
leaves to the device.

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

VICTORY_FUZZ_CASES, VICTORY_FUZZ_OPS and VICTORY_FUZZ_OUT set the inputs
per opcode, an opcode-name filter and a Markdown report.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fuzzer also runs every VOP3P opcode the translator lowers
(v_pk_*, v_fma_mix*), comparing each f16 half on its own and the high
half of v_fma_mixhi_f16, with any NaN matching any NaN.

On main, v_pk_add_f16, v_pk_fma_f16 and v_fma_mix{lo,hi}_f16 differ on
AMD (f16 rounded toward zero by legacyF32ToF16); with #422 the RX 9070,
a gfx1036 iGPU and WARP agree on all of them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-up. Each finding lists its simplest disagreeing inputs
first (fewest non-zero dwords) and ends with the instruction words and
the v1..v4 inputs a regression test needs. With fewer than two devices
(CI's runners have WARP only) the test returns instead of failing. The
README names the command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- VICTORY_FUZZ_MODS=1 also runs each float VOP3 opcode with abs, neg,
  clamp and omod (seven combinations).
- v0 now starts as v4, so v_mac_*/v_fmac_*, which read their
  destination, no longer accumulate an undefined register. Their earlier
  signed-zero "differences" were that.
- A conversion's result type is the first one in its name
  (v_cvt_f32_f16 gives f32), and v_cvt_pkrtz_f16_f32 is compared half by
  half, so NaNs no longer count as differences there.
- The report shows v4 too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lowering's Parts and HostShader gained view_marks (cd94d35). And as
host.rs's hardware_adapter (#1911, #1925), an adapter without dedicated
video memory (CI's basic render driver) is not a hardware column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
v_dot2_f32_f16 counted as an f16 result (its name has 16 and _f),
so two f32 NaNs with different payloads read as a disagreement. The
first type in the name (v_cvt_f16_f32, v_dot2_f32_f16) is the result's.
A full run on 940d32f (RX 9070, gfx1036, WARP) gives the same 17
disagreements as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:38:28 +00:00
Author
Owner

@⁠alexdeliu on GitHub · 2026-11-24 20:33 UTC · original

@⁠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]`.
**@⁠alexdeliu** on GitHub · 2026-11-24 20:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7143724028) @⁠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]`. ```
Author
Owner

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

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** on GitHub · 2026-11-24 21:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7145486892) **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.
Author
Owner

@⁠tumbubu on GitHub · 2026-11-24 22:30 UTC · original

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.

**@⁠tumbubu** on GitHub · 2026-11-24 22:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7146310440) **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.
Author
Owner

@⁠DeerSilver on GitHub · 2026-11-24 23:06 UTC · original

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).

**@⁠DeerSilver** on GitHub · 2026-11-24 23:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7147022259) 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).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:31 UTC · original · edited 2026-11-25 06:22 UTC

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

**@⁠Marvisak** on GitHub · 2026-11-25 03:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7151995721) · edited 2026-11-25 06:22 UTC <!-- 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)_
Author
Owner

@⁠alexdeliu on GitHub · 2026-11-25 05:00 UTC · original

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** on GitHub · 2026-11-25 05:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7153363817) 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.
Author
Owner

@⁠alexdeliu on GitHub · 2026-11-25 05:23 UTC · original

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.

**@⁠alexdeliu** on GitHub · 2026-11-25 05:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7153729945) 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.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:25 UTC · original

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.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/1614#issuecomment-7179763616) 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`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1614/head:github-bot/gh-1614'
git switch 'github-bot/gh-1614'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1614'
git switch 'github-bot/gh-1614'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1614'
git switch 'github-bot/gh-1614'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1614'
git switch 'main'
git merge --squash 'github-bot/gh-1614'
git switch 'main'
git merge --ff-only 'github-bot/gh-1614'
git switch 'main'
git merge 'github-bot/gh-1614'
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!1614
No description provided.