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
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#3196
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@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
main63bcca4, this machine fails 7 of 295victory-shadertests. Three of them are a single ULP in the BVH hit distance, andv_med3_f32_matches_rdna2_with_nan— the subject of #726 — passes here, though it failed onffe310etwo days ago.Environment
main63bcca4, unmodified tree fromcodeloadThe seven
emit::bvh_tests::intersections_on_nodes_in_title_memory_equal_the_referenceleft: [1118671093, …]vsright: [1118671094, …]— 1 ULP in the first dword of the hitemit::bvh_tests::intersections_on_the_gpu_equal_the_referenceemit::bvh_tests::intersections_with_64_bit_pointers_on_the_gpu_equal_the_reference1140801401vs1140801402— 1 ULPemit::semantics_tests::arithmetic_matches_the_hardwaresemantics_tests.rs:660emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zerosstride_tests.rs:350emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_productshardware: [cc165000, 0c0de901],2147483504vs2147483312— 192 offemit::valu_tests::image_atomics_of_64_bitsvalu_tests.rs:1979Both 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
fmareached 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 onffe310emainffe310e:hardware: v_med3_f32(1.0, 2.0, NaN) = 2 (0x40000000), want 1— reported with the WARP cross-check in #726.main63bcca4:emit::valu_tests::v_med3_f32_matches_rdna2_with_nan ... ok, also alone, 2 of 2 runs.med3still picks the NaN case withfcmp uno(lower.rs:2442-2444), so the bit-compare form is not what changed. What did change between those heads isftzandmax_min_flushedaround it (lower.rs:2436-2441) — the min/max the median is built from is now the flushed one. So on this driver theunocompares 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..63bcca4for 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-shaderandvictory-gpuon 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: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:789isassert_eq!(got, want, …), soleftis the GPU andrightis the reference: the GPU returns1118671093, the reference1118671094. 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 ofbvh_tests.rsinto 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: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:emit/lower/bvh.rsemits 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;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:14 UTC · original
Read the lowering: the program is left-associated, and the GPU is the one that moved.
emit/lower/bvh.rs:476-480builds the numerator exactly as the reference does:So the console program and the test's reference agree — left-associated — and
1118671094is the correct answer for this case. The Intel Arc returns1118671093, 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
faddchain — the one thing a DXIL consumer is not allowed to do withoutfaston the instruction, andBin::Addemits a plainfadd.Two questions, in the order that matters for this project:
preciseas!dx.preciseon the instruction; ifLowercan put it ontnumanddet, the test would pass on this driver without a special case, at whatever costprecisehas on the other vendors.bvh_testsfor a value that is the sum of three products? My own preference is (1) — a wrongtin 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: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 DXILFMad, andvictory-gpuwarns once at device creation when it does not (host.rs:242), with the defect pinned bydefect_multiply_adds_fused_only_where_the_host_fuses(semantics_tests.rs:2879,#[ignore]).On this Intel Arc that probe returns 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
faddchain 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(), sayreassociates_fadd(), running the same three-product sum the BVH test uses and comparing against the left-associated answer. Then:victory-gpucan name a host that reassociates the way it already names one that does not fuse (host.rs:242);bvh_testswould have a way to say "this host is known to reassociate" instead of failing for a reason the maintainer has to rediscover;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_testsis 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: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: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" andoutput_multipliers_give_positive_zero, on the other side of the flush.valu_tests::fspx_programs_run_with_the_hardwares_dot_products—2147483504vs2147483312, 192 apart; a dot-product accumulation. Since this host fusesFMad(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,CreateCommittedResourceorDispatchis 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_SUPPORTwithD3D12_FORMAT_SUPPORT2_UAV_ATOMIC_*for theR32G32_*format answers it without guessing, and the crate already has theHostfor such queries (fuses_fmadis the same shape).If it helps, the
E_INVALIDARGones 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).
@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*b2andr = w*c2. Values are the FP32 result bits.(p+q)+rp+(q+r)(p+r)+q0x42ad90f60x42ad90f50x42ad90f50x42ad90f50x43ff3f7a0x43ff3f7a0x43ff3f790x43ff3f79Adding
p+rfirst matches both Arc results. Addingq+rfirst 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 typelines? Run withVICTORY_WARPunset.The DXIL precise-qualifier spec defines precision for
faddandfmulby the absence of fast-math flags. It describes!dx.precisefor 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.
@zzm1234560621-prog on GitHub · 2026-11-26 12:31 UTC · original
One of the two
E_INVALIDARGfailures 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:0x3c0is 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)(aCheckFeatureSupportfor the format'sSupport2), 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_zerosis 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:55 UTC · original
The other
E_INVALIDARGnarrowed: it is Intel-specific, it is theClose()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:
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:i.e. user data at
b0, and one root SRV at register 255 inMEMORY_SPACE, which the test binds to an 8-byte upload buffer (Root::View { srv: true, data: vec![4, 0] }). TheE_INVALIDARGcomes out oflist.Close()(host.rs:2029), so it is a recording the driver rejects rather than aDispatchfailure.What I could not do here: the debug layer is not installed on this machine, so
EnableDebugLayergave no message (noD3D12 ERRORlines 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:reg 255inMEMORY_SPACEcolliding with the heap-directly-indexed convention on this driver;SetDescriptorHeapswith an empty sampler heap (d.samplersis[], so the heap is created withNumDescriptors: 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: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 withNumDescriptors: n.max(1)(host.rs:1531), so the sampler heap is never zero-sized even whend.samplersis 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 255inMEMORY_SPACE, the view-marks table, next toCBV_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
63bcca4untouched.No game files. AI-assisted (Claude).
@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:
The test host asks for a
HEAP_VIEWS-sized (2^21) shader-visible heap whenever aDispatch's views end withView::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 ofdispatch, which is why it read like a bad command list.Two corrections to what I wrote earlier in this thread, both mine:
list.Close(). With all threeClose()sites instrumented, none of them fails — the error comes from the heap creation, before the list is closed.ResourceBindingTierand 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_zerosfails 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
slotsto 1,000,000 (.min(PORTABLE_VIEWS)). That removes theE_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 theHEAP_VIEWSclamp 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: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.
bvh_tests::intersections_*(3)equal (551 boxes and 76 triangles hit)… all three passvalu_tests::fspx_programs_run_with_the_hardwares_dot_products2147483504vs2147483312stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zerosE_INVALIDARG(2^21 heap over the 1M cap)By class:
(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.opsel(1) —v_dot4_i32_i8with the inline 2.0 in src1 andopsel_hi/lo0b010/0b101: 192 apart, WARP exact. I have not worked out which of the two readings ofopselon 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.View::NullBuffersasks forHEAP_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 atHEAP_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).