Direct DXIL: XCL_DXIL_DIFF=1 draws the graphics tests through both backends #1925

Open
mastrr9 wants to merge 1 commit from upstream-pr/1935 into main
mastrr9 commented 2026-11-24 23:43:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T23:43:46Z.


With XCL_DXIL_DIFF=1, the GPU tests that translate console VS / PS code (and the mesh-mode first pass) draw a second time with the direct DXIL translations and compare render targets and live mesh records bit for bit. With the variable unset nothing extra is translated or drawn. It uses the same switch as the kernel half but does not depend on it; the two merge cleanly in either order.

Draft: the head commit has not been built or tested yet.

What is in it

  • gpu/recomp/diff_graphics.rs: direct translation of the stages, comparison, report, with tests
  • gpu/recomp/mod.rs: the module line
  • gpu/recomp/tests.rs: one check / check_mesh call before each covered draw (12 added lines)

Tested
These runs are from before the final rebase, on a combined branch (376f968, based on main 689f2db; it holds this change, the other half of the differential mode, and six direct-translator parity fixes), not on this PR's head commit.

  • Windows 11 x64, NVIDIA GeForce RTX 5080 16 GB, cargo test debug build. Driver, CPU and Rust versions were not recorded.
  • cargo test -p xcl --lib recomp::diff_graphics -- --nocapture --test-threads=1: 10 passed, 0 failed.
  • XCL_DXIL_DIFF=1 (with XCL_DXIL_DIFF_TABLE, XCL_DIRECT_DXIL unset), 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.
  • On this 32-lane GPU, three of the mismatches were wave64 VS / PS tests (spill slots and a reduction), among them gpu_wave64_ps_spill_slots and gpu_wave64_vs_spill_slots_and_identity with 256 of 256 pixels different. The direct translator has no upper-lane form for these, the gap #1895 describes on the runtime route. This mode calls the translator itself, so a routing fix such as #1913 would not by itself clear them: expect those tests to fail in this mode on such GPUs until the translator handles or refuses these programs.

Regression run
Not run: there are no xcl-smoke blocks for this change.

Not tested

  • The head commit (rebased onto main f5136a6) has not been built or tested: it was rebased on macOS, with no Rust toolchain.
  • cargo test --workspace was not run for this change on its own.
  • AMD and Intel GPUs; release build.

AI use

  • Code and tests: written by Claude Opus 5.5 in an agent session (Duet) with no Windows or GPU.
  • RTX 5080 test runs above: a Claude Sonnet 5.5 agent.
  • Overlap check, rebase and this description: Claude Code, Claude Sonnet 5.5.
<!-- greyfinch-sync:ivall/xcl:issue:5482268302 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1935). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T23:43:46Z. --- With `XCL_DXIL_DIFF=1`, the GPU tests that translate console VS / PS code (and the mesh-mode first pass) draw a second time with the direct DXIL translations and compare render targets and live mesh records bit for bit. With the variable unset nothing extra is translated or drawn. It uses the same switch as the kernel half but does not depend on it; the two merge cleanly in either order. Draft: the head commit has not been built or tested yet. **What is in it** - `gpu/recomp/diff_graphics.rs`: direct translation of the stages, comparison, report, with tests - `gpu/recomp/mod.rs`: the module line - `gpu/recomp/tests.rs`: one `check` / `check_mesh` call before each covered draw (12 added lines) **Tested** These runs are from before the final rebase, on a **combined branch** ([`376f968`](https://github.com/mastrr9/xcl/commit/376f968), based on main `689f2db`; it holds this change, the other half of the differential mode, and six direct-translator parity fixes), **not on this PR's head commit**. - Windows 11 x64, NVIDIA GeForce RTX 5080 16 GB, `cargo test` debug build. Driver, CPU and Rust versions were not recorded. - `cargo test -p xcl --lib recomp::diff_graphics -- --nocapture --test-threads=1`: 10 passed, 0 failed. - `XCL_DXIL_DIFF=1` (with `XCL_DXIL_DIFF_TABLE`, `XCL_DIRECT_DXIL` unset), `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. - On this 32-lane GPU, three of the mismatches were wave64 VS / PS tests (spill slots and a reduction), among them `gpu_wave64_ps_spill_slots` and `gpu_wave64_vs_spill_slots_and_identity` with 256 of 256 pixels different. The direct translator has no upper-lane form for these, the gap #1895 describes on the runtime route. This mode calls the translator itself, so a routing fix such as #1913 would not by itself clear them: expect those tests to fail in this mode on such GPUs until the translator handles or refuses these programs. **Regression run** Not run: there are no `xcl-smoke` blocks for this change. **Not tested** - The head commit (rebased onto main `f5136a6`) has not been built or tested: it was rebased on macOS, with no Rust toolchain. - `cargo test --workspace` was not run for this change on its own. - AMD and Intel GPUs; release build. **AI use** - Code and tests: written by Claude Opus 5.5 in an agent session (Duet) with no Windows or GPU. - RTX 5080 test runs above: a Claude Sonnet 5.5 agent. - Overlap check, rebase and this description: Claude Code, Claude Sonnet 5.5.
upipibi commented 2026-11-25 00:09:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T23:49:50Z.


Ran on NVIDIA: RTX 3070 8 GB (split wave64), driver 616.56, Windows 11, debug, e7cc810 merged onto main 20cf130. XCL_DXIL_DIFF=1 over gpu::dxil::graphics and the gpu_ps / gpu_vs recomp tests: 25 passed, 1 differs. gpu_ps_image_sample_offset_implicit_lod_between_mips: 48 of 256 pixels, e.g. (0, 0) HLSL 26.0 vs direct 25.75.

That is the case #1940 fixes (an implicit-LOD image_sample_o offsets each blended mip by its own texels). With #1940 (54269d7) merged in as well, the same differential run of that test passes. So on this machine the graphics differences on main come down to that one fix. Kernel-side results for #1934 are on that PR.

AI-assisted (Claude Code). Synthetic tests only.

<!-- greyfinch-sync:ivall/xcl:comment:7147842174 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1935#issuecomment-7147842174). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T23:49:50Z. --- Ran on NVIDIA: RTX 3070 8 GB (split wave64), driver 616.56, Windows 11, debug, `e7cc810` merged onto `main` `20cf130`. `XCL_DXIL_DIFF=1` over `gpu::dxil::graphics` and the `gpu_ps` / `gpu_vs` recomp tests: 25 passed, **1 differs**. `gpu_ps_image_sample_offset_implicit_lod_between_mips`: 48 of 256 pixels, e.g. (0, 0) HLSL 26.0 vs direct 25.75. That is the case #1940 fixes (an implicit-LOD `image_sample_o` offsets each blended mip by its own texels). With #1940 (`54269d7`) merged in as well, the same differential run of that test passes. So on this machine the graphics differences on `main` come down to that one fix. Kernel-side results for #1934 are on that PR. AI-assisted (Claude Code). Synthetic tests only.
DavidM1911 commented 2026-11-25 03:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:41:03Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7151042582 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1935#issuecomment-7151042582). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T02:41:03Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
github-actions[bot] commented 2026-11-28 08:01:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:21Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7236310319 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1935#issuecomment-7236310319). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:01:21Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 07:07:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:07:21Z.


Triage (#1607) – head e7cc810

No open or merged PR does the same. #1934 (same author) is the kernel / compute half of XCL_DXIL_DIFF. This PR is the graphics half (recomp/diff_graphics.rs, hooked into the draw tests in recomp/tests.rs). It does not depend on #1934 and the two do not overlap, except for duplicated enabled() / translator_failed() helpers.
No problems found in the diff. The head commit has not been built or tested (per the description), and the only failing check is the PR description.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7303670227 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1935#issuecomment-7303670227). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:07:21Z. --- **Triage (#1607)** – head e7cc810 No open or merged PR does the same. #1934 (same author) is the kernel / compute half of `XCL_DXIL_DIFF`. This PR is the graphics half (`recomp/diff_graphics.rs`, hooked into the draw tests in `recomp/tests.rs`). It does not depend on #1934 and the two do not overlap, except for duplicated `enabled()` / `translator_failed()` helpers. No problems found in the diff. The head commit has not been built or tested (per the description), and the only failing check is the PR description. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1935:upstream-pr/1935'
git switch 'upstream-pr/1935'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/1935'
git switch 'upstream-pr/1935'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1935'
git switch 'upstream-pr/1935'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1935'
git switch 'main'
git merge --squash 'upstream-pr/1935'
git switch 'main'
git merge --ff-only 'upstream-pr/1935'
git switch 'main'
git merge 'upstream-pr/1935'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
xcl-dev/xcl!1925
No description provided.