Direct DXIL: XCL_DXIL_DIFF=1 differential kernel runs (both backends) #1934
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1934
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@mastrr9 on GitHub · 2026-11-24 23:43 UTC · original
mastrr9:feat/dxil-diff-kernel-mode→main· +758 −2 · 6 files · 1 commits · draftXCL_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
@upipibi on GitHub · 2026-11-24 23:46 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-25 02:41 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@upipibi on GitHub · 2026-11-25 06:52 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-26 00:42 UTC · original
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
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.