Intel Arc (Xe-LPG) baseline on 63bcca4: 7 of 295 shader tests fail, 3 of them one ULP in the BVH hit distance; v_med3_f32 passes here #3196

Open
opened 2026-11-26 12:07:51 +00:00 by github-bot · 10 comments
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:05 UTC · original

Baseline for one Intel GPU, because I could not find one in the issues: on unmodified main 63bcca4, this machine fails 7 of 295 victory-shader tests. Three of them are a single ULP in the BVH hit distance, and v_med3_f32_matches_rdna2_with_nan — the subject of #726 — passes here, though it failed on ffe310e two days ago.

Environment

  • Windows 11 Pro for Workstations (26200), Core Ultra 9 185H, 32 GB
  • Intel(R) Arc(TM) Graphics (Xe-LPG integrated), driver 32.0.101.6127
  • Rust 1.98.1 (pinned), MSVC 14.51
  • main 63bcca4, unmodified tree from codeload
cargo test -p victory-shader --lib
test result: FAILED. 295 passed; 7 failed; 3 ignored; 0 measurable; finished in 207s

The seven

test what it says
emit::bvh_tests::intersections_on_nodes_in_title_memory_equal_the_reference left: [1118671093, …] vs right: [1118671094, …] — 1 ULP in the first dword of the hit
emit::bvh_tests::intersections_on_the_gpu_equal_the_reference same, type 1
emit::bvh_tests::intersections_with_64_bit_pointers_on_the_gpu_equal_the_reference same, type 3, 1140801401 vs 1140801402 — 1 ULP
emit::semantics_tests::arithmetic_matches_the_hardware plain assert at semantics_tests.rs:660
emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros stride_tests.rs:350
emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products hardware: [cc165000, 0c0de901], 2147483504 vs 2147483312 — 192 off
emit::valu_tests::image_atomics_of_64_bits valu_tests.rs:1979

Both diffs that print a value are consistent with one cause: a host that contracts or rounds differently from the reference. One ULP in a float whose low bits differ by one is what an fma reached in the reference's arithmetic, or a reciprocal with a different approximation, looks like from outside; a dot product 192 apart at that magnitude is the same shape of difference. The three BVH failures are all the same intersection, so this is likely one fix, not three.

I have not diagnosed it further: telling contraction from precision needs the emitted DXIL and the reference both, and I would rather report the observation than guess at which instruction.

v_med3_f32: passes here now, failed on ffe310e

  • main ffe310e: hardware: v_med3_f32(1.0, 2.0, NaN) = 2 (0x40000000), want 1 — reported with the WARP cross-check in #726.
  • main 63bcca4: emit::valu_tests::v_med3_f32_matches_rdna2_with_nan ... ok, also alone, 2 of 2 runs.

med3 still picks the NaN case with fcmp uno (lower.rs:2442-2444), so the bit-compare form is not what changed. What did change between those heads is ftz and max_min_flushed around it (lower.rs:2436-2441) — the min/max the median is built from is now the flushed one. So on this driver the uno compares do not fold, and the failure in #726 belongs to the UHD iGPUs in that thread rather than to Xe-LPG generally; the triage line "confirmed on current main" is true for those machines and not for this one.

I can bisect ffe310e..63bcca4 for the commit that flips it if that would help — it is one test and the range is a day of merges, so it is a mechanical run rather than a guess.

What I can run

This machine has no game files, so no title census and no world runs. It can run anything in victory-shader and victory-gpu on a real Xe-LPG adapter, on any head, and report hardware-versus-WARP per test — say which head and I will run it.

No game files were used. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:05 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196) Baseline for one Intel GPU, because I could not find one in the issues: on unmodified `main` `63bcca4`, this machine fails **7 of 295** `victory-shader` tests. Three of them are a single ULP in the BVH hit distance, and `v_med3_f32_matches_rdna2_with_nan` — the subject of #726 — **passes here**, though it failed on `ffe310e` two days ago. ## Environment - Windows 11 Pro for Workstations (26200), Core Ultra 9 185H, 32 GB - Intel(R) Arc(TM) Graphics (Xe-LPG integrated), driver **32.0.101.6127** - Rust 1.98.1 (pinned), MSVC 14.51 - `main` `63bcca4`, unmodified tree from `codeload` ``` cargo test -p victory-shader --lib test result: FAILED. 295 passed; 7 failed; 3 ignored; 0 measurable; finished in 207s ``` ## The seven | test | what it says | |---|---| | `emit::bvh_tests::intersections_on_nodes_in_title_memory_equal_the_reference` | `left: [1118671093, …]` vs `right: [1118671094, …]` — **1 ULP** in the first dword of the hit | | `emit::bvh_tests::intersections_on_the_gpu_equal_the_reference` | same, type 1 | | `emit::bvh_tests::intersections_with_64_bit_pointers_on_the_gpu_equal_the_reference` | same, type 3, `1140801401` vs `1140801402` — **1 ULP** | | `emit::semantics_tests::arithmetic_matches_the_hardware` | plain assert at `semantics_tests.rs:660` | | `emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` | `stride_tests.rs:350` | | `emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products` | `hardware: [cc165000, 0c0de901]`, `2147483504` vs `2147483312` — **192 off** | | `emit::valu_tests::image_atomics_of_64_bits` | `valu_tests.rs:1979` | Both diffs that print a value are consistent with one cause: a host that contracts or rounds differently from the reference. One ULP in a float whose low bits differ by one is what an `fma` reached in the reference's arithmetic, or a reciprocal with a different approximation, looks like from outside; a dot product 192 apart at that magnitude is the same shape of difference. The three BVH failures are all the same intersection, so this is likely one fix, not three. I have not diagnosed it further: telling contraction from precision needs the emitted DXIL and the reference both, and I would rather report the observation than guess at which instruction. ## `v_med3_f32`: passes here now, failed on `ffe310e` - `main` `ffe310e`: `hardware: v_med3_f32(1.0, 2.0, NaN) = 2 (0x40000000), want 1` — reported with the WARP cross-check in #726. - `main` `63bcca4`: `emit::valu_tests::v_med3_f32_matches_rdna2_with_nan ... ok`, also alone, 2 of 2 runs. `med3` still picks the NaN case with `fcmp uno` (`lower.rs:2442-2444`), so the bit-compare form is not what changed. What did change between those heads is `ftz` and `max_min_flushed` around it (`lower.rs:2436-2441`) — the min/max the median is built from is now the flushed one. So on this driver the `uno` compares do **not** fold, and the failure in #726 belongs to the UHD iGPUs in that thread rather than to Xe-LPG generally; the triage line "confirmed on current main" is true for those machines and not for this one. I can bisect `ffe310e..63bcca4` for the commit that flips it if that would help — it is one test and the range is a day of merges, so it is a mechanical run rather than a guess. ## What I can run This machine has no game files, so no title census and no world runs. It can run anything in `victory-shader` and `victory-gpu` on a real Xe-LPG adapter, on any head, and report hardware-versus-WARP per test — say which head and I will run it. _No game files were used. AI-assisted (Claude)._
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:07:51 +00:00
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:13 UTC · original

Narrowed the BVH failure from "one ULP, probably contraction" to a single disagreeing sum, and correcting my own reading of the assertion while I am at it.

Which side is which. bvh_tests.rs:789 is assert_eq!(got, want, …), so left is the GPU and right is the reference: the GPU returns 1118671093, the reference 1118671094. My issue text quoted both without saying which, and then said "an fma reached in the reference's arithmetic" — that direction was wrong.

What I did. I copied triangle() out of bvh_tests.rs into a standalone program, fed it the exact ray and node from the failing case (type 1, Ray { extent: 5.0, origin: [6.125, 0.890625, 0.359375], dir: [-1.0, -0.796875, -0.796875] }), and evaluated the last line in several forms:

plain        (u*a2 + v*b2) + ww*c2           1118671094   <- the reference
sum order    u*a2 + (v*b2 + ww*c2)           1118671093   <- the GPU
fma u only   fma(u,a2,v*b2) + ww*c2          1118671094
fma ww only  u*a2 + fma(v,b2,ww*c2)          1118671094
fma both     fma(u,a2,fma(v,b2,ww*c2))       1118671094
edge with fma in the cross product           1118671094 / 1118671093 (by association, as above)

So contraction is not the cause: every fused form lands on the reference's value. The GPU's number is exactly u*a2 + (v*b2 + ww*c2), the other association of the same three products.

What that leaves. One of the two is reassociating t = (u*a2 + v*b2) + ww*c2:

  • if emit/lower/bvh.rs emits the left-associated form, then this Intel driver reassociated it (not allowed without fast-math, but drivers do), and it is a lowering/robustness question;
  • if the lowering emits the right-associated form, then the reference is what disagrees with the console program, and AMD and NVIDIA would be the ones reassociating into the reference's value.

I have not read the lowering for that sum yet, which is the next step and decides which of the two it is. The standalone probe is 60 lines and reproduces both numbers; I can attach it or paste it if useful.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7191729373) Narrowed the BVH failure from "one ULP, probably contraction" to a single disagreeing sum, and correcting my own reading of the assertion while I am at it. **Which side is which.** `bvh_tests.rs:789` is `assert_eq!(got, want, …)`, so `left` is the **GPU** and `right` is the reference: the GPU returns `1118671093`, the reference `1118671094`. My issue text quoted both without saying which, and then said "an fma reached in the reference's arithmetic" — that direction was wrong. **What I did.** I copied `triangle()` out of `bvh_tests.rs` into a standalone program, fed it the exact ray and node from the failing case (`type 1`, `Ray { extent: 5.0, origin: [6.125, 0.890625, 0.359375], dir: [-1.0, -0.796875, -0.796875] }`), and evaluated the last line in several forms: ``` plain (u*a2 + v*b2) + ww*c2 1118671094 <- the reference sum order u*a2 + (v*b2 + ww*c2) 1118671093 <- the GPU fma u only fma(u,a2,v*b2) + ww*c2 1118671094 fma ww only u*a2 + fma(v,b2,ww*c2) 1118671094 fma both fma(u,a2,fma(v,b2,ww*c2)) 1118671094 edge with fma in the cross product 1118671094 / 1118671093 (by association, as above) ``` So contraction is **not** the cause: every fused form lands on the reference's value. The GPU's number is exactly `u*a2 + (v*b2 + ww*c2)`, the other association of the same three products. **What that leaves.** One of the two is reassociating `t = (u*a2 + v*b2) + ww*c2`: - if `emit/lower/bvh.rs` emits the left-associated form, then this Intel driver reassociated it (not allowed without fast-math, but drivers do), and it is a lowering/robustness question; - if the lowering emits the right-associated form, then the **reference** is what disagrees with the console program, and AMD and NVIDIA would be the ones reassociating into the reference's value. I have not read the lowering for that sum yet, which is the next step and decides which of the two it is. The standalone probe is 60 lines and reproduces both numbers; I can attach it or paste it if useful. _No game files. AI-assisted (Claude)._
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:14 UTC · original

Read the lowering: the program is left-associated, and the GPU is the one that moved.

emit/lower/bvh.rs:476-480 builds the numerator exactly as the reference does:

let ua = self.s.m.bin(c, Bin::Mul, u, a[2]);
let vb = self.s.m.bin(c, Bin::Mul, v, b[2]);
let wc = self.s.m.bin(c, Bin::Mul, ww, cc[2]);
let uv = self.s.m.bin(c, Bin::Add, ua, vb);
let tnum = self.s.m.bin(c, Bin::Add, uv, wc);   // (u*a2 + v*b2) + ww*c2

So the console program and the test's reference agree — left-associated — and 1118671094 is the correct answer for this case. The Intel Arc returns 1118671093, which is the right-associated value.

Together with the probe above, that pins it down: not contraction (six fused forms all give the reference's number), but reassociation of the fadd chain — the one thing a DXIL consumer is not allowed to do without fast on the instruction, and Bin::Add emits a plain fadd.

Two questions, in the order that matters for this project:

  1. Can the emitter mark this sum so it cannot be reassociated? DXIL carries precise as !dx.precise on the instruction; if Lower can put it on tnum and det, the test would pass on this driver without a special case, at whatever cost precise has on the other vendors.
  2. If not, is a one-ULP tolerance acceptable in bvh_tests for a value that is the sum of three products? My own preference is (1) — a wrong t in the BVH is a ray that sorts differently, and the whole point of these tests is bit-exactness against the console.

det (l.475: u + (v + ww)) is right-associated on purpose and I did not see it move, so the deviation is specific to the mixed mul/add chain rather than to adds in general.

No claim yet about which Intel compilers do this — one GPU, one driver (32.0.101.6127). If it is reproducible on other Arc parts, it is worth an Intel bug, and the workaround is the same either way.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:14 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7191745287) Read the lowering: the program is left-associated, and the GPU is the one that moved. `emit/lower/bvh.rs:476-480` builds the numerator exactly as the reference does: ```rust let ua = self.s.m.bin(c, Bin::Mul, u, a[2]); let vb = self.s.m.bin(c, Bin::Mul, v, b[2]); let wc = self.s.m.bin(c, Bin::Mul, ww, cc[2]); let uv = self.s.m.bin(c, Bin::Add, ua, vb); let tnum = self.s.m.bin(c, Bin::Add, uv, wc); // (u*a2 + v*b2) + ww*c2 ``` So the console program and the test's reference agree — left-associated — and `1118671094` is the correct answer for this case. The Intel Arc returns `1118671093`, which is the right-associated value. Together with the probe above, that pins it down: **not contraction** (six fused forms all give the reference's number), but **reassociation of the `fadd` chain** — the one thing a DXIL consumer is not allowed to do without `fast` on the instruction, and `Bin::Add` emits a plain `fadd`. Two questions, in the order that matters for this project: 1. Can the emitter mark this sum so it cannot be reassociated? DXIL carries `precise` as `!dx.precise` on the instruction; if `Lower` can put it on `tnum` and `det`, the test would pass on this driver without a special case, at whatever cost `precise` has on the other vendors. 2. If not, is a one-ULP tolerance acceptable in `bvh_tests` for a value that is the sum of three products? My own preference is (1) — a wrong `t` in the BVH is a ray that sorts differently, and the whole point of these tests is bit-exactness against the console. `det` (`l.475`: `u + (v + ww)`) is right-associated on purpose and I did not see it move, so the deviation is specific to the mixed mul/add chain rather than to adds in general. No claim yet about which Intel compilers do this — one GPU, one driver (32.0.101.6127). If it is reproducible on other Arc parts, it is worth an Intel bug, and the workaround is the same either way. _No game files. AI-assisted (Claude)._
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:17 UTC · original

One more data point, and it rules the existing fusion defect out of this one.

The crate already has the right shape for host arithmetic quirks: Host::fuses_fmad() (emit/host.rs:604) probes whether the device fuses DXIL FMad, and victory-gpu warns once at device creation when it does not (host.rs:242), with the defect pinned by defect_multiply_adds_fused_only_where_the_host_fuses (semantics_tests.rs:2879, #[ignore]).

On this Intel Arc that probe returns true:

cargo test -p victory-shader --lib -- hosts_that_do_not_fuse_are_named --nocapture
hardware adapter fuses FMad: true

So this host fuses multiply-adds like the RX 6700 XT does, and is not in WARP's "leaves FMad unfused" camp. The BVH failure is therefore not that documented defect: it is a plain fadd chain being reassociated, which nothing in the crate probes for and nothing in DXIL allows.

Which suggests the fix that costs least: a sibling probe next to fuses_fmad(), say reassociates_fadd(), running the same three-product sum the BVH test uses and comparing against the left-associated answer. Then:

  • victory-gpu can name a host that reassociates the way it already names one that does not fuse (host.rs:242);
  • bvh_tests would have a way to say "this host is known to reassociate" instead of failing for a reason the maintainer has to rediscover;
  • and if a precise/op-shaping fix lands later, the probe is the regression test for it, on a host where the problem is visible.

I am not writing that probe into the tests unasked — the arithmetic in semantics_tests is a designed system (defect, probes, check), and adding a probe class to it should follow whatever the maintainers intend for it. Say the word and it is a small PR.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:17 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7191822875) One more data point, and it rules the existing fusion defect out of this one. The crate already has the right shape for host arithmetic quirks: `Host::fuses_fmad()` (`emit/host.rs:604`) probes whether the device fuses DXIL `FMad`, and `victory-gpu` warns once at device creation when it does not (`host.rs:242`), with the defect pinned by `defect_multiply_adds_fused_only_where_the_host_fuses` (`semantics_tests.rs:2879`, `#[ignore]`). On this Intel Arc that probe returns **true**: ``` cargo test -p victory-shader --lib -- hosts_that_do_not_fuse_are_named --nocapture hardware adapter fuses FMad: true ``` So this host fuses multiply-adds like the RX 6700 XT does, and is not in WARP's "leaves FMad unfused" camp. The BVH failure is therefore not that documented defect: it is a plain `fadd` chain being reassociated, which nothing in the crate probes for and nothing in DXIL allows. Which suggests the fix that costs least: a sibling probe next to `fuses_fmad()`, say `reassociates_fadd()`, running the same three-product sum the BVH test uses and comparing against the left-associated answer. Then: - `victory-gpu` can name a host that reassociates the way it already names one that does not fuse (`host.rs:242`); - `bvh_tests` would have a way to say "this host is known to reassociate" instead of failing for a reason the maintainer has to rediscover; - and if a `precise`/op-shaping fix lands later, the probe is the regression test for it, on a host where the problem is visible. I am not writing that probe into the tests unasked — the arithmetic in `semantics_tests` is a designed system (`defect`, `probes`, `check`), and adding a probe class to it should follow whatever the maintainers intend for it. Say the word and it is a small PR. _No game files. AI-assisted (Claude)._
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:18 UTC · original

Triage of the seven so nobody has to re-run them: they are three classes, not one.

Value differs (5)

  • bvh_tests ×3 — the reassociation above, one ULP in the hit.

  • semantics_tests::arithmetic_matches_the_hardware — signed zero, not precision:

    in [00800000, 80800000, 00000000, …]  want [00000000]  got [80000000]
    

    The operands are ±the smallest normal, so this is a product that the console flushes and calls +0, where this host gives -0. The same shape as #682's "denormal operands as zero" and output_multipliers_give_positive_zero, on the other side of the flush.

  • valu_tests::fspx_programs_run_with_the_hardwares_dot_products — 2147483504 vs 2147483312, 192 apart; a dot-product accumulation. Since this host fuses FMad (previous comment), it is probably the same "which rounding" family rather than the unfused one.

The device refuses the call (2)

  • stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros — hardware: dispatch failed: 参数错误 (E_INVALIDARG).
  • valu_tests::image_atomics_of_64_bits — same, 参数错误.

Neither is a value mismatch: CreatePipelineState, CreateCommittedResource or Dispatch is being rejected on this adapter. For the second one that may simply be hardware — 64-bit image atomics are not a given on Xe — and then the test wants a capability gate rather than a failure. D3D12_FEATURE_FORMAT_SUPPORT with D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_* for the R32G32_* format answers it without guessing, and the crate already has the Host for such queries (fuses_fmad is the same shape).

If it helps, the E_INVALIDARG ones are the cheapest to settle: they either become a skip with a queried reason or they name a real adapter limitation, and I can add that gate if you want it.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7191836225) Triage of the seven so nobody has to re-run them: they are three classes, not one. **Value differs (5)** - `bvh_tests` ×3 — the reassociation above, one ULP in the hit. - `semantics_tests::arithmetic_matches_the_hardware` — signed zero, not precision: ``` in [00800000, 80800000, 00000000, …] want [00000000] got [80000000] ``` The operands are ±the smallest normal, so this is a product that the console flushes and calls `+0`, where this host gives `-0`. The same shape as `#682`'s "denormal operands as zero" and `output_multipliers_give_positive_zero`, on the other side of the flush. - `valu_tests::fspx_programs_run_with_the_hardwares_dot_products` — `2147483504` vs `2147483312`, 192 apart; a dot-product accumulation. Since this host fuses `FMad` (previous comment), it is probably the same "which rounding" family rather than the unfused one. **The device refuses the call (2)** - `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` — `hardware: dispatch failed: 参数错误` (`E_INVALIDARG`). - `valu_tests::image_atomics_of_64_bits` — same, `参数错误`. Neither is a value mismatch: `CreatePipelineState`, `CreateCommittedResource` or `Dispatch` is being rejected on this adapter. For the second one that may simply be hardware — 64-bit image atomics are not a given on Xe — and then the test wants a capability gate rather than a failure. `D3D12_FEATURE_FORMAT_SUPPORT` with `D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_*` for the `R32G32_*` format answers it without guessing, and the crate already has the `Host` for such queries (`fuses_fmad` is the same shape). If it helps, the `E_INVALIDARG` ones are the cheapest to settle: they either become a skip with a queried reason or they name a real adapter limitation, and I can add that gate if you want it. _No game files. AI-assisted (Claude)._
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 12:29 UTC · original

I checked the two reported hit distances against all three addition orders, using the operands from the existing synthetic BVH cases. For the table, p = u*a2, q = v*b2 and r = w*c2. Values are the FP32 result bits.

Case Current lowering (p+q)+r p+(q+r) (p+r)+q Reported Arc
Type 1 0x42ad90f6 0x42ad90f5 0x42ad90f5 0x42ad90f5
Type 3 0x43ff3f7a 0x43ff3f7a 0x43ff3f79 0x43ff3f79

Adding p+r first matches both Arc results. Adding q+r first changes type 1 only. This narrows the hypothesis. The full BVH lowering and the standalone arithmetic may still behave differently on Arc.

I put a test-only probe in 8374f9e, based on upstream 63bcca4. It supplies the three edge operands at dispatch time, keeps the shear depths constant, and prints the results for all three groupings. WARP 1.0.22 with Agility 1.620.2 matched all six entries. The existing BVH tests also passed 14/14 in the same WARP setup.

Could you try this on the same Arc driver and share the six hardware type lines? Run with VICTORY_WARP unset.

git fetch https://github.com/andrewpozdnakov7-jpg/VIctory.git refs/heads/followup/3196-bvh-sum-probe
git worktree add --detach ../bvh3196 8374f9ecfc80884b6ed7def2f4337d732343fc13
cd ../bvh3196
cargo test --locked -p victory-shader --lib emit::valu_tests::bvh_distance_add_order_probe -- --exact --ignored --nocapture --test-threads=1

The DXIL precise-qualifier spec defines precision for fadd and fmul by the absence of fast-math flags. It describes !dx.precise for calls. The current emitter already leaves fast-math flags off those arithmetic instructions.

If you reuse the probe, please retain its Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding it into your commit.

AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 12:29 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7192061323) I checked the two reported hit distances against all three addition orders, using the operands from the existing synthetic BVH cases. For the table, `p = u*a2`, `q = v*b2` and `r = w*c2`. Values are the FP32 result bits. | Case | Current lowering `(p+q)+r` | `p+(q+r)` | `(p+r)+q` | Reported Arc | | --- | --- | --- | --- | --- | | Type 1 | `0x42ad90f6` | `0x42ad90f5` | `0x42ad90f5` | `0x42ad90f5` | | Type 3 | `0x43ff3f7a` | `0x43ff3f7a` | `0x43ff3f79` | `0x43ff3f79` | Adding `p+r` first matches both Arc results. Adding `q+r` first changes type 1 only. This narrows the hypothesis. The full BVH lowering and the standalone arithmetic may still behave differently on Arc. I put a test-only probe in [8374f9e](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/8374f9ecfc80884b6ed7def2f4337d732343fc13), based on upstream `63bcca4`. It supplies the three edge operands at dispatch time, keeps the shear depths constant, and prints the results for all three groupings. WARP 1.0.22 with Agility 1.620.2 matched all six entries. The existing BVH tests also passed 14/14 in the same WARP setup. Could you try this on the same Arc driver and share the six `hardware type` lines? Run with `VICTORY_WARP` unset. ```sh git fetch https://github.com/andrewpozdnakov7-jpg/VIctory.git refs/heads/followup/3196-bvh-sum-probe git worktree add --detach ../bvh3196 8374f9ecfc80884b6ed7def2f4337d732343fc13 cd ../bvh3196 cargo test --locked -p victory-shader --lib emit::valu_tests::bvh_distance_add_order_probe -- --exact --ignored --nocapture --test-threads=1 ``` The [DXIL precise-qualifier spec](https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst#precise-qualifier) defines precision for `fadd` and `fmul` by the absence of fast-math flags. It describes `!dx.precise` for calls. The current emitter already leaves fast-math flags off those arithmetic instructions. If you reuse the probe, please retain its Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding it into your commit. AI-assisted with Codex.
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:31 UTC · original

One of the two E_INVALIDARG failures is now a gate: #3203.

The failing call was compute_pipeline, not the dispatch, and the adapter genuinely has nothing to offer for that format:

D3D12_FEATURE_FORMAT_SUPPORT, R32G32_UINT
hardware: Support2 0x3c0    warp: Support2 0x3c0

0x3c0 is the typed load/store cluster with no atomic bits at all (0x1–0x20), on the Arc and on WARP, so the test could not have run in either half — and because it panicked on the hardware half, the WARP half never ran either, which is why it looked like one failure instead of a test that cannot run on this machine at all.

#3203 adds Host::uav_atomic_support(format) (a CheckFeatureSupport for the format's Support2), skips the test when the three atomics it needs are missing, and prints the mask. Suite goes 295/7 → 296/6 on this adapter; adapters that do have the atomics run it as before.

stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros is the other one and stays failing: that is a dispatch error rather than a pipeline, so it is a different query and I have not chased it yet — it could be the same root view/no-view path rather than a format capability.

Test-only. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:31 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7192112646) One of the two `E_INVALIDARG` failures is now a gate: #3203. The failing call was `compute_pipeline`, not the dispatch, and the adapter genuinely has nothing to offer for that format: ``` D3D12_FEATURE_FORMAT_SUPPORT, R32G32_UINT hardware: Support2 0x3c0 warp: Support2 0x3c0 ``` `0x3c0` is the typed load/store cluster with no atomic bits at all (`0x1`–`0x20`), on the Arc **and** on WARP, so the test could not have run in either half — and because it panicked on the hardware half, the WARP half never ran either, which is why it looked like one failure instead of a test that cannot run on this machine at all. #3203 adds `Host::uav_atomic_support(format)` (a `CheckFeatureSupport` for the format's `Support2`), skips the test when the three atomics it needs are missing, and prints the mask. Suite goes 295/7 → 296/6 on this adapter; adapters that do have the atomics run it as before. `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` is the other one and stays failing: that is a **dispatch** error rather than a pipeline, so it is a different query and I have not chased it yet — it could be the same root view/no-view path rather than a format capability. _Test-only. AI-assisted (Claude)._
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:55 UTC · original

The other E_INVALIDARG narrowed: it is Intel-specific, it is the Close() of the command list, and the root signature is the same on both sides.

With the test temporarily made to continue instead of panic, so both halves run:

hardware (Intel Arc): dispatch failed, 参数错误
warp:                 dispatch succeeded, zeros as expected

So WARP records and runs this dispatch fine; this driver refuses it. What is recorded is small enough to state exactly — printed from root_signature_for:

signature params = [(32BIT_CONSTANTS, vis ALL, reg 0, space 0),
                    (SRV,             vis ALL, reg 255, space 1)]
set root parameters = [0, 1]

i.e. user data at b0, and one root SRV at register 255 in MEMORY_SPACE, which the test binds to an 8-byte upload buffer (Root::View { srv: true, data: vec![4, 0] }). The E_INVALIDARG comes out of list.Close() (host.rs:2029), so it is a recording the driver rejects rather than a Dispatch failure.

What I could not do here: the debug layer is not installed on this machine, so EnableDebugLayer gave no message (no D3D12 ERROR lines at all). If someone has the Graphics Tools feature, that is the shortest path — the layer names the offending call. Otherwise the candidates I would look at first, in order:

  1. the root SRV bound to an upload-heap resource (this driver may refuse it where WARP does not);
  2. reg 255 in MEMORY_SPACE colliding with the heap-directly-indexed convention on this driver;
  3. a SetDescriptorHeaps with an empty sampler heap (d.samplers is [], so the heap is created with NumDescriptors: 0) — the test passes &[] here.

I can bisect any of those locally in a few minutes each, since the two halves now report separately — say which one you want checked, or I will start from 3 because it is the cheapest (skip the sampler heap when there are no samplers).

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:55 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7192643739) The other `E_INVALIDARG` narrowed: it is Intel-specific, it is the **`Close()` of the command list**, and the root signature is the same on both sides. With the test temporarily made to continue instead of panic, so both halves run: ``` hardware (Intel Arc): dispatch failed, 参数错误 warp: dispatch succeeded, zeros as expected ``` So WARP records and runs this dispatch fine; this driver refuses it. What is recorded is small enough to state exactly — printed from `root_signature_for`: ``` signature params = [(32BIT_CONSTANTS, vis ALL, reg 0, space 0), (SRV, vis ALL, reg 255, space 1)] set root parameters = [0, 1] ``` i.e. user data at `b0`, and one root SRV at register 255 in `MEMORY_SPACE`, which the test binds to an 8-byte upload buffer (`Root::View { srv: true, data: vec![4, 0] }`). The `E_INVALIDARG` comes out of `list.Close()` (`host.rs:2029`), so it is a recording the driver rejects rather than a `Dispatch` failure. What I could not do here: the debug layer is not installed on this machine, so `EnableDebugLayer` gave no message (no `D3D12 ERROR` lines at all). If someone has the Graphics Tools feature, that is the shortest path — the layer names the offending call. Otherwise the candidates I would look at first, in order: 1. the root SRV bound to an **upload-heap** resource (this driver may refuse it where WARP does not); 2. `reg 255` in `MEMORY_SPACE` colliding with the heap-directly-indexed convention on this driver; 3. a `SetDescriptorHeaps` with an empty sampler heap (`d.samplers` is `[]`, so the heap is created with `NumDescriptors: 0`) — the test passes `&[]` here. I can bisect any of those locally in a few minutes each, since the two halves now report separately — say which one you want checked, or I will start from 3 because it is the cheapest (skip the sampler heap when there are no samplers). _No game files. AI-assisted (Claude)._
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 12:57 UTC · original

Two of the three candidates are out, so the next person does not start there.

3 (empty sampler heap) — out. heap() already creates with NumDescriptors: n.max(1) (host.rs:1531), so the sampler heap is never zero-sized even when d.samplers is empty.

1 (root SRV on an upload-heap resource) — out. Several tests record Root::View (an upload buffer bound as a root SRV) and they pass on this same adapter: bvh_tests.rs:764, diff_tests.rs:1496/1522/1529, memory_tests.rs:285/287/608/739. None of them is among the six failures here, so this driver accepts that pattern.

That leaves 2 (reg 255 in MEMORY_SPACE, the view-marks table, next to CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED) and anything I have not thought of. Without the debug layer I would be guessing between them, and a guess here costs more than it saves — the layer names the call in one line, and this machine does not have Graphics Tools installed.

Everything above is with the temporary instrumentation reverted; the tree is 63bcca4 untouched.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 12:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7192686804) Two of the three candidates are out, so the next person does not start there. **3 (empty sampler heap) — out.** `heap()` already creates with `NumDescriptors: n.max(1)` (`host.rs:1531`), so the sampler heap is never zero-sized even when `d.samplers` is empty. **1 (root SRV on an upload-heap resource) — out.** Several tests record `Root::View` (an upload buffer bound as a root SRV) and they pass on this same adapter: `bvh_tests.rs:764`, `diff_tests.rs:1496/1522/1529`, `memory_tests.rs:285/287/608/739`. None of them is among the six failures here, so this driver accepts that pattern. That leaves **2** (`reg 255` in `MEMORY_SPACE`, the view-marks table, next to `CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED`) and anything I have not thought of. Without the debug layer I would be guessing between them, and a guess here costs more than it saves — the layer names the call in one line, and this machine does not have Graphics Tools installed. Everything above is with the temporary instrumentation reverted; the tree is `63bcca4` untouched. _No game files. AI-assisted (Claude)._
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 13:14 UTC · original

The debug layer named it, now that Graphics Tools is installed. It is not a lowering or a recording problem at all:

ID3D12Device::CreateDescriptorHeap: D3D12_DESCRIPTOR_HEAP_DESC.NumDescriptors 2097152,
but the limit for shader visible view heaps is 1000000

The test host asks for a HEAP_VIEWS-sized (2^21) shader-visible heap whenever a Dispatch's views end with View::NullBuffers (emit/host.rs:1593), and this adapter enforces the D3D12 cap of 1,000,000 for Tier 1/2. The refusal surfaces later as 参数错误 out of dispatch, which is why it read like a bad command list.

Two corrections to what I wrote earlier in this thread, both mine:

  1. Not list.Close(). With all three Close() sites instrumented, none of them fails — the error comes from the heap creation, before the list is closed.
  2. Tier 3 does not mean "no cap". My first fix queried ResourceBindingTier and returned "unlimited" at Tier 3; this Arc reports Tier 3 and still caps at 1,000,000, so the query is not a reliable test. Same lesson as #3178, in a second place.

What that means: a_heap_buffer_read_where_no_buffer_view_is_reads_zeros fails on any device that enforces the 1M cap, and passes on WARP (Tier 3, accepts 2^21) — which is exactly the pair of results here. It is a test-host issue, not a translator one.

I tried clamping slots to 1,000,000 (.min(PORTABLE_VIEWS)). That removes the E_INVALIDARG, but the test process then dies with exit code 2173 before printing anything, so the clamp alone is not the fix — most likely the shader still indexes at the HEAP_VIEWS clamp against a smaller heap and the device faults. I did not chase that further; the honest state is "the cap is identified, the clamp is not sufficient".

Nothing in the tree is left from this: 63bcca4, untouched.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 13:14 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7193068127) The debug layer named it, now that Graphics Tools is installed. It is **not** a lowering or a recording problem at all: ``` ID3D12Device::CreateDescriptorHeap: D3D12_DESCRIPTOR_HEAP_DESC.NumDescriptors 2097152, but the limit for shader visible view heaps is 1000000 ``` The test host asks for a `HEAP_VIEWS`-sized (2^21) shader-visible heap whenever a `Dispatch`'s views end with `View::NullBuffers` (`emit/host.rs:1593`), and this adapter enforces the D3D12 cap of 1,000,000 for Tier 1/2. The refusal surfaces later as `参数错误` out of `dispatch`, which is why it read like a bad command list. Two corrections to what I wrote earlier in this thread, both mine: 1. **Not `list.Close()`.** With all three `Close()` sites instrumented, none of them fails — the error comes from the heap creation, before the list is closed. 2. **Tier 3 does not mean "no cap".** My first fix queried `ResourceBindingTier` and returned "unlimited" at Tier 3; this Arc reports Tier 3 and still caps at 1,000,000, so the query is not a reliable test. Same lesson as #3178, in a second place. What that means: `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` fails on **any** device that enforces the 1M cap, and passes on WARP (Tier 3, accepts 2^21) — which is exactly the pair of results here. It is a test-host issue, not a translator one. I tried clamping `slots` to 1,000,000 (`.min(PORTABLE_VIEWS)`). That removes the `E_INVALIDARG`, but the test process then dies with exit code 2173 before printing anything, so the clamp alone is not the fix — most likely the shader still indexes at the `HEAP_VIEWS` clamp against a smaller heap and the device faults. I did not chase that further; the honest state is "the cap is identified, the clamp is not sufficient". Nothing in the tree is left from this: `63bcca4`, untouched. _No game files. AI-assisted (Claude)._
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 13:20 UTC · original

Closing picture for this adapter, and it is a clean split: every remaining failure here is host behaviour, not the translator. Each one passes when its hardware half runs on WARP instead, so the emitted DXIL and the reference agree and this driver is the outlier.

test on the Arc hardware half on WARP
bvh_tests::intersections_* (3) 1 ULP off, the reassociated sum equal (551 boxes and 76 triangles hit) … all three pass
valu_tests::fspx_programs_run_with_the_hardwares_dot_products 2147483504 vs 2147483312 passes
stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros E_INVALIDARG (2^21 heap over the 1M cap) passes

By class:

  1. Reassociation (3 tests) — the lowering emits (u*a2 + v*b2) + ww*c2 (lower.rs:476-480), the reference matches it, and this driver returns the right-associated value. Any of the six fma forms gives the reference's number, so it is not contraction.
  2. Integer dot with opsel (1) — v_dot4_i32_i8 with the inline 2.0 in src1 and opsel_hi/lo 0b010/0b101: 192 apart, WARP exact. I have not worked out which of the two readings of opsel on an inline constant this driver takes; the test's expectation is the one WARP reproduces, so the expectation is probably right and the driver wrong.
  3. Test-host heap size (1) — View::NullBuffers asks for HEAP_VIEWS (2^21) descriptors; D3D12 caps shader-visible view heaps at 1,000,000 for the tiers that cap them, and this part caps them even though it reports binding tier 3. Clamping the request alone is not enough (the process then dies, exit 2173), because the shaders still clamp their indices at HEAP_VIEWS − 1; the clamp constant and the heap the host can make have to agree, which is the design question I flagged earlier.

Two of the seven are fixed in PRs: #3203 (the atomic capability gate) and #3212 (the MAD product flush, which was a real lowering difference and is the one thing here that was not the driver's fault).

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 13:20 UTC · [original](https://github.com/Marvisak/VIctory/issues/3196#issuecomment-7193212987) Closing picture for this adapter, and it is a clean split: **every remaining failure here is host behaviour, not the translator.** Each one passes when its hardware half runs on WARP instead, so the emitted DXIL and the reference agree and this driver is the outlier. | test | on the Arc | hardware half on WARP | |---|---|---| | `bvh_tests::intersections_*` (3) | 1 ULP off, the reassociated sum | `equal (551 boxes and 76 triangles hit)` … all three pass | | `valu_tests::fspx_programs_run_with_the_hardwares_dot_products` | `2147483504` vs `2147483312` | passes | | `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` | `E_INVALIDARG` (2^21 heap over the 1M cap) | passes | By class: 1. **Reassociation** (3 tests) — the lowering emits `(u*a2 + v*b2) + ww*c2` (`lower.rs:476-480`), the reference matches it, and this driver returns the right-associated value. Any of the six fma forms gives the reference's number, so it is not contraction. 2. **Integer dot with `opsel`** (1) — `v_dot4_i32_i8` with the inline 2.0 in src1 and `opsel_hi/lo` 0b010/0b101: 192 apart, WARP exact. I have not worked out which of the two readings of `opsel` on an inline constant this driver takes; the test's expectation is the one WARP reproduces, so the expectation is probably right and the driver wrong. 3. **Test-host heap size** (1) — `View::NullBuffers` asks for `HEAP_VIEWS` (2^21) descriptors; D3D12 caps shader-visible view heaps at 1,000,000 for the tiers that cap them, and this part caps them even though it reports binding tier 3. Clamping the request alone is not enough (the process then dies, exit 2173), because the shaders still clamp their indices at `HEAP_VIEWS − 1`; the clamp constant and the heap the host can make have to agree, which is the design question I flagged earlier. Two of the seven are fixed in PRs: #3203 (the atomic capability gate) and #3212 (the MAD product flush, which was a real lowering difference and is the one thing here that was *not* the driver's fault). _No game files. AI-assisted (Claude)._
This discussion has been locked. Commenting is limited to contributors.
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#3196
No description provided.