Direct DXIL: XCL_DXIL_DIFF=1 differential kernel runs (both backends) #1924
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1934"
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?
Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T23:43:44Z.
XCL_DXIL_DIFF=1runs the recompiler's kernel tests through both HLSL + DXC and the direct DXIL translator and fails on any difference.XCL_DXIL_DIFF_TABLE=<path>also records each paired program, for a per-opcode parity table. This is the proof the direct DXIL spec asks for before phase 7 (default-on). With the variable unset the tests run as before.Draft: the head commit has not been built or tested yet.
What is in it
gpu/recomp/diff_kernel.rs: pairing, comparison and mismatch report, with testsgpu/recomp/diff_table.rs: the per-program log and per-opcode summary, with testsgpu/recomp/runner.rs,mod.rs: early returns taken only when the mode is on or a container was pairedgpu/recomp/tests.rs: pairs the tests that compile their own HLSLdocs/specs/2026-11-24-direct-dxil.md: 9 lines describing the switch (can be dropped if you prefer the spec untouched)Tested
These runs are from before the final rebase, on a combined branch (
376f968, based on main689f2db; it holds this change, the other half of the differential mode, and six direct-translator parity fixes), not on this PR's head commit.cargo testdebug build. Driver, CPU and Rust versions were not recorded.cargo test -p xcl --lib recomp::diff_kernel -- --nocapture --test-threads=1: passed.XCL_DXIL_DIFF=1(withXCL_DXIL_DIFF_TABLE,XCL_DIRECT_DXILunset),cargo test -p xcl --lib recomp:: -- --test-threads=1: 285 tests ran, 279 passed, 6 reported HLSL / direct mismatches. Not all of the 285 run both backends (some only translate). The combined tree had direct-translator fixes that this PR does not, so this PR alone may report differently.gpu_compute_tg_size_counts_a_partial_last_wave(HLSL2, direct1) and two 1–5 ULP floating-point differences in BVH ray intersection. Three more were wave64 VS / PS draws, found by the graphics half (separate PR).Regression run
Not run: there are no
xcl-smokeblocks for this change.Not tested
f5136a6) has not been built or tested: it was rebased on macOS, with no Rust toolchain.cargo test --workspacewas not run for this change on its own.gpu_safe_s_barrier_multi_warp_and_early_endpgmis deliberately not paired (see #1793).AI use
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T23:46:48Z.
Built and ran, since the description says the head wasn't yet: RTX 3070 8 GB (32-lane waves, split wave64), driver 616.56, Windows 11, debug,
d2758cbmerged ontomain20cf130(clean).diff_kernel/diff_tableunit tests: 13 passed.XCL_DXIL_DIFF=1 cargo test -p xcl --lib -- gpu::recomp::tests --test-threads=4: 119 passed, 4 differ, 17 ignored. The mode does what it says and found these:gpu_compute_tg_size_counts_a_partial_last_wavedxil/kernel.rssets TG_SIZE's wave count tototal / lanes; the test (and the HLSL path) wanttotal.div_ceil(lanes)(96 threads in wave64 are 2 waves). The test compiles only HLSL, so it never saw thisgpu_format_stores_atomics_global_lds0x64vs direct0xa3, v260x1vs0x44gpu_built_bvh_nodes_match_the_cpu_node_test,gpu_triangle_pair_and_box16_nodes0xc0dd6761vs…63)I'll open a small PR for the TG_SIZE one. The ulp cases might want a tolerance option in the comparison, so a known-inexact op doesn't hide a real difference in the same test.
AI-assisted (Claude Code). Synthetic tests only.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:41:06Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T06:52:53Z.
Second run with
XCL_DXIL_DIFF=1: RTX 3070, driver 616.56, debug. I mergedd2758cbwithmain568e7db; one hunk intests.rsconflicts, and I keptmain'sdirect_or(...)line, which also pairs in this mode.gpu_tests,--test-threads=1: 130 passed, 5 differ.gpu_compute_tg_size_counts_a_partial_last_wavegpu_format_stores_atomics_global_lds,gpu_atomic_fcmpswap_x2buffer_atomic_umaxGLC old value: HLSL0, 0x64, 0x65, …, direct0xa3on every lane;ds_add_rtn_u32old values in another order)XCL_DIRECT_DXIL=1the test passes 5 of 5 runs, and in diff mode it differed in 4 runs and matched in 1.gpu_f64_math_randomv_rsq_f64high dword: HLSL0x7ff00000, direct0x7ff80000(low dword equal)gpu_built_bvh_nodes_match_the_cpu_node_test,gpu_triangle_pair_and_box16_nodesgpu_image_get_resinfo_1d_arraymainFor the comparison, it might help to compare the destinations of returning atomics as multisets, or let a test mark them as unordered. Compare NaNs by class or by payload, as a test chooses. Otherwise the noise hides a real difference in the same test.
AI-assisted (Claude Code). Synthetic tests only.
upstream-sync referenced this pull request2026-11-25 10:09:30 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:42:48Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:29Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:07:05Z.
Triage (#1607) – head
ddc4f5aNo open or merged PR adds an
XCL_DXIL_DIFFmode. #1935 (same author) is the graphics half (diff_graphics.rs, VS / PS / mesh draws). This PR is the kernel / compute half (diff_kernel.rs,diff_table.rs). They touch different code paths and are not duplicates. The per-opcode parity PRs (#2084, #2087, #2143, #2276 …) add fixed tests, not a mode.Notes: the head commit was never built (rebased without a toolchain, per the description). It is +758 lines, above the ~400 target. The
docs/specs/edit should go into the PR description instead (CONTRIBUTING.md).enabled()andtranslator_failed()exist in both this PR and #1935: once both land they could share one copy.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.