Recompiler: assemble and sign DXIL from LLVM IR text #1373

Closed
github-bot wants to merge 2 commits from gh-pr/1373/head into gh-pr/1373/base
Owner

@⁠Sr-0w on GitHub · 2026-11-24 15:20 UTC · original
Sr-0w:recomp-assemble-ir → main · +109 −0 · 2 files · 2 commits · closed without merging

Part of #1269 (direct DXIL backend).

dxcompiler.dll's IDxcAssembler::AssembleToContainer parses its input with LLVM's parseIR, so it takes a DXIL module as LLVM IR text (or bitcode) and builds the container from the module's dx.* metadata; dxil.dll's IDxcValidator with DxcValidatorFlags_InPlaceEdit then validates and signs it. Neither DXC's HLSL front end nor its optimiser runs.

Measured (RX 7800 XT, DXC 1.9.2602.17), one retail compute program of ≈21 000 instructions:

time DXIL
its HLSL through dxc::compile (-O1) 24.9 s 1 042 KB
the same module as IR text (DXC's own -Fc listing, 8.6 MB) through dxc::assemble 0.75 s same

So a backend that writes the IR itself needs no bitcode writer and no container writer of its own. It still has to write clean SSA, since no optimiser runs after it.

What is in it

  • crates/xcl/src/gpu/recomp/dxc.rs: pub fn assemble(ir: &str) -> Result<Vec<u8>, String> — IDxcUtils::CreateBlob → IDxcAssembler::AssembleToContainer → IDxcValidator::Validate (in place: signs), errors from either as text. Not called by the runtime yet.
  • crates/xcl/src/gpu/recomp/tests.rs: ir_text_assembles_signs_and_runs — a hand-written CS of the ABI root signature (mem[i] = 3 i + 1 through u2) is assembled, run on the GPU and its output checked; a module with a use before its definition comes back as a validation error, not a container.

One thing learned on the way, written in the function's comment: without an !llvm.ident the container validates, but the AMD driver faults in CreateComputePipelineState.

Tested

  • Windows 11, AMD Radeon RX 7800 XT, DXC 1.9.2602.17 (Windows SDK 10.0.26100).
  • cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored; no SKIPPED tests.
  • ir_text_assembles_signs_and_runs passes (GPU output checked).

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: AMD  Radeon RX 7800 XT
title: a retail title
seconds: 60
exit: 0x0
frames shown: 1521 (PresentX 1521)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18201 MB

PR head:

xcl-smoke v1
commit: 3485cbfde5578cd139fcbf77437459d007227051
gpu: AMD  Radeon RX 7800 XT
title: a retail title
seconds: 60
exit: 0x0
frames shown: 1534 (PresentX 1535)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18008 MB

Not tested

  • NVIDIA / Intel drivers, and DXC releases other than 1.9.2602.17 (the assembler and validator interfaces are the same since 1.6).
  • The function is not used by the runtime yet; the smoke runs only check that nothing else changed.

AI use

  • Claude Code (Claude Opus 5.5) found the assembler path, measured it, wrote the function, the test and this description, under author review.

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-24 15:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373) `Sr-0w:recomp-assemble-ir` → `main` · +109 −0 · 2 files · 2 commits · closed without merging Part of #1269 (direct DXIL backend). `dxcompiler.dll`'s `IDxcAssembler::AssembleToContainer` parses its input with LLVM's `parseIR`, so it takes a DXIL module as **LLVM IR text** (or bitcode) and builds the container from the module's `dx.*` metadata; `dxil.dll`'s `IDxcValidator` with `DxcValidatorFlags_InPlaceEdit` then validates and signs it. Neither DXC's HLSL front end nor its optimiser runs. Measured (RX 7800 XT, DXC 1.9.2602.17), one retail compute program of ≈21 000 instructions: | | time | DXIL | |---|---|---| | its HLSL through `dxc::compile` (`-O1`) | 24.9 s | 1 042 KB | | the same module as IR text (DXC's own `-Fc` listing, 8.6 MB) through `dxc::assemble` | **0.75 s** | same | So a backend that writes the IR itself needs no bitcode writer and no container writer of its own. It still has to write clean SSA, since no optimiser runs after it. **What is in it** - `crates/xcl/src/gpu/recomp/dxc.rs`: `pub fn assemble(ir: &str) -> Result<Vec<u8>, String>` — `IDxcUtils::CreateBlob` → `IDxcAssembler::AssembleToContainer` → `IDxcValidator::Validate` (in place: signs), errors from either as text. Not called by the runtime yet. - `crates/xcl/src/gpu/recomp/tests.rs`: `ir_text_assembles_signs_and_runs` — a hand-written CS of the ABI root signature (`mem[i] = 3 i + 1` through `u2`) is assembled, run on the GPU and its output checked; a module with a use before its definition comes back as a validation error, not a container. One thing learned on the way, written in the function's comment: without an `!llvm.ident` the container validates, but the AMD driver faults in `CreateComputePipelineState`. **Tested** - Windows 11, AMD Radeon RX 7800 XT, DXC 1.9.2602.17 (Windows SDK 10.0.26100). - `cargo test --workspace -- --test-threads=4`: 752 passed, 0 failed, 41 ignored; no SKIPPED tests. - `ir_text_assembles_signs_and_runs` passes (GPU output checked). **Regression run** `main`: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: AMD Radeon RX 7800 XT title: a retail title seconds: 60 exit: 0x0 frames shown: 1521 (PresentX 1521) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18201 MB ``` PR head: ``` xcl-smoke v1 commit: 3485cbfde5578cd139fcbf77437459d007227051 gpu: AMD Radeon RX 7800 XT title: a retail title seconds: 60 exit: 0x0 frames shown: 1534 (PresentX 1535) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18008 MB ``` **Not tested** - NVIDIA / Intel drivers, and DXC releases other than 1.9.2602.17 (the assembler and validator interfaces are the same since 1.6). - The function is not used by the runtime yet; the smoke runs only check that nothing else changed. **AI use** - Claude Code (Claude Opus 5.5) found the assembler path, measured it, wrote the function, the test and this description, under author review. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`dxc::assemble` turns a DXIL module written as LLVM IR (text or bitcode)
into a signed container: dxcompiler.dll's assembler builds the container
from the module's `dx.*` metadata and dxil.dll's validator checks and signs
it. No HLSL front end and no optimiser run.

A retail compute program's module (8.6 MB of IR, 1 MB of DXIL) assembles in
0.75 s; its HLSL takes 25 s through DXC. This is the base for a backend that
writes the IR itself (#1269).

The test assembles a hand-written CS of the ABI root signature, runs it on
the GPU and checks what it wrote, and checks that a module the validator
rejects comes back as an error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Windows SDK's bin\<ver>\x64 has dxcompiler.dll without dxil.dll, so
ir_text_assembles_signs_and_runs failed with 'no dxil.dll to sign with'
instead of skipping (reported by justrhoto on #1269; the same fix as on
the per-lane branch).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:52:17 +00:00
github-bot closed this pull request 2026-11-26 04:52:17 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-24 15:27 UTC · original

Tested 3485cbf on an AMD RDNA4 GPU, Windows, DXC 1.8.2502.11 (the Windows SDK's). The path works and the time is confirmed. One change is needed before this can go in: the new test fails with a DXC older than 1.9.

1. The test needs DXC 1.9. cargo test --workspace --no-fail-fast -- --test-threads=4 (debug): 751 passed, 1 failed, 41 ignored, no SKIPPED. The failure is ir_text_assembles_signs_and_runs (tests.rs:7640):

validate: error: Validator version in metadata (1.9) is not supported; maximum: (1.8).

The module's !dx.valver is {1, 9}. With {1, 6}, and with {1, 8}, the test passes here, GPU output included. SM 6.6 needs no more than 1.6, so please use !2 = !{i32 1, i32 6}. A backend on top of this should write 1.6 as well, so that any DXC that can sign SM 6.6 accepts it.

2. Time. Four retail compute programs (native wave64, 4 memory windows; the HLSL through dxc::compile at its own level, then DXC's listing of that DXIL through dxc::assemble, three times each; a local release build):

instructions HLSL DXC IR text assemble + sign DXIL
3 621 0.9 MB 1.3 s 1.8 MB 0.06 s 212 KB
8 239 2.2 MB 13.1 s 4.1 MB 0.17 – 0.18 s 522 KB
16 414 4.2 MB 9.4 s 8.5 MB 0.39 – 0.40 s 1 066 KB
25 107 6.7 MB 12.6 s 10.4 MB 0.48 – 0.50 s 1 231 KB

The container that comes back has the same listing as DXC's (comment lines aside) and the same size in KB in all four. As you say, the IR was already optimised here, so this is what the assembler costs, not what a backend will cost in all.

3. Smaller points

  • !llvm.ident: confirmed on RDNA4. Without it, the module is assembled and signed, then the test process ends with 0xc0000005. A comment is easy to miss for whoever writes the emitter; please have assemble return an error for a module without one, with a line in the test.
  • The error texts end with a NUL ("Validation failed.\n\0"); compile_here trims it.
  • errors builds a slice from the error buffer without looking at its size: if an empty buffer ever comes with a null pointer, from_raw_parts is undefined behaviour.

Not tested: a title run (nothing calls assemble yet), NVIDIA, the driver's time (the DXIL is the same), other DXC releases.

AI use: Claude Code (Claude Opus 5.5) ran the tests and measurements and wrote this.

**@⁠ivall** on GitHub · 2026-11-24 15:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7136048702) Tested `3485cbf` on an AMD RDNA4 GPU, Windows, DXC 1.8.2502.11 (the Windows SDK's). The path works and the time is confirmed. One change is needed before this can go in: the new test fails with a DXC older than 1.9. **1. The test needs DXC 1.9.** `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): **751 passed, 1 failed, 41 ignored**, no SKIPPED. The failure is `ir_text_assembles_signs_and_runs` (tests.rs:7640): ``` validate: error: Validator version in metadata (1.9) is not supported; maximum: (1.8). ``` The module's `!dx.valver` is `{1, 9}`. With `{1, 6}`, and with `{1, 8}`, the test passes here, GPU output included. SM 6.6 needs no more than 1.6, so please use `!2 = !{i32 1, i32 6}`. A backend on top of this should write 1.6 as well, so that any DXC that can sign SM 6.6 accepts it. **2. Time.** Four retail compute programs (native wave64, 4 memory windows; the HLSL through `dxc::compile` at its own level, then DXC's listing of that DXIL through `dxc::assemble`, three times each; a local release build): | instructions | HLSL | DXC | IR text | assemble + sign | DXIL | |---|---|---|---|---|---| | 3 621 | 0.9 MB | 1.3 s | 1.8 MB | 0.06 s | 212 KB | | 8 239 | 2.2 MB | 13.1 s | 4.1 MB | 0.17 – 0.18 s | 522 KB | | 16 414 | 4.2 MB | 9.4 s | 8.5 MB | 0.39 – 0.40 s | 1 066 KB | | 25 107 | 6.7 MB | 12.6 s | 10.4 MB | 0.48 – 0.50 s | 1 231 KB | The container that comes back has the same listing as DXC's (comment lines aside) and the same size in KB in all four. As you say, the IR was already optimised here, so this is what the assembler costs, not what a backend will cost in all. **3. Smaller points** - `!llvm.ident`: confirmed on RDNA4. Without it, the module is assembled and signed, then the test process ends with `0xc0000005`. A comment is easy to miss for whoever writes the emitter; please have `assemble` return an error for a module without one, with a line in the test. - The error texts end with a NUL (`"Validation failed.\n\0"`); `compile_here` trims it. - `errors` builds a slice from the error buffer without looking at its size: if an empty buffer ever comes with a null pointer, `from_raw_parts` is undefined behaviour. **Not tested:** a title run (nothing calls `assemble` yet), NVIDIA, the driver's time (the DXIL is the same), other DXC releases. AI use: Claude Code (Claude Opus 5.5) ran the tests and measurements and wrote this.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 15:26 UTC · original · edited 2026-11-24 15:28 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 3485cbf (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: ir_text_assembles_signs_and_runs.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 15:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7136025462) · edited 2026-11-24 15:28 UTC Full-suite run, since this PR has no test report yet. Tested exact head `3485cbf` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `ir_text_assembles_signs_and_runs`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠t4l03 on GitHub · 2026-11-24 15:29 UTC · original

Additional NVIDIA test, plus an IR round trip for one large compute shader

Tested clean head 3485cbfde5578cd139fcbf77437459d007227051 on an RTX 4070 Ti (Ada), Windows 11 build 26300, driver 617.14, DXC and validator 1.9.2609.5. With XCL_ADAPTER=nvidia and XCL_REQUIRE_GPU=mesh, cargo test --locked -p xcl --lib -j 4 ir_text_assembles_signs_and_runs -- --nocapture completed with 1 passed, 0 failed, 0 ignored, no skip. This includes the GPU output and invalid-IR checks.

I also called the unchanged dxc::assemble from a scratch executable on 11,375,976 bytes of already lowered LLVM IR text from the ActivateRays experiment. Assembly and signing took 0.261 s and produced 2,786,924 bytes of DXIL, accepted by dxv.exe. Disassembly kept the same counts before and after: 6,418 explicit block labels, 44,484 SSA definitions, 2,078 phis and 536 switches. The subsequent D3D12 pipeline attempt, with a fresh XCL cache and the same root signature and static samplers, reached a 75-second time cap at 4.05 GiB peak private commit. The assembly timing starts with ready IR. NVIDIA's global disk cache remained enabled.

Not tested: the older 1.8 validator, full suite on this PR, or dispatch output of the retail shader.

AI use: Codex (gpt-6.2-sol) ran the tests and wrote this report.

**@⁠t4l03** on GitHub · 2026-11-24 15:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7136114522) **Additional NVIDIA test, plus an IR round trip for one large compute shader** Tested clean head `3485cbfde5578cd139fcbf77437459d007227051` on an RTX 4070 Ti (Ada), Windows 11 build 26300, driver 617.14, DXC and validator 1.9.2609.5. With `XCL_ADAPTER=nvidia` and `XCL_REQUIRE_GPU=mesh`, `cargo test --locked -p xcl --lib -j 4 ir_text_assembles_signs_and_runs -- --nocapture` completed with **1 passed, 0 failed, 0 ignored, no skip**. This includes the GPU output and invalid-IR checks. I also called the unchanged `dxc::assemble` from a scratch executable on 11,375,976 bytes of already lowered LLVM IR text from the [ActivateRays experiment](https://github.com/ivall/xcl/issues/1269#issuecomment-7135372390). Assembly and signing took **0.261 s** and produced 2,786,924 bytes of DXIL, accepted by `dxv.exe`. Disassembly kept the same counts before and after: 6,418 explicit block labels, 44,484 SSA definitions, 2,078 phis and 536 switches. The subsequent D3D12 pipeline attempt, with a fresh XCL cache and the same root signature and static samplers, reached a 75-second time cap at 4.05 GiB peak private commit. The assembly timing starts with ready IR. NVIDIA's global disk cache remained enabled. **Not tested:** the older 1.8 validator, full suite on this PR, or dispatch output of the retail shader. **AI use:** Codex (`gpt-6.2-sol`) ran the tests and wrote this report.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 15:40 UTC · original

Confirmed ivall’s validator-version finding on an RTX 3080 Ti (621.35), Windows 11 build 26300, with Windows SDK DXC and DXIL validator 1.8.2502.11.

  • 3485cbf fails ir_text_assembles_signs_and_runs because the fixture requires validator 1.9.
  • Changing only the fixture’s !dx.valver to 1.6 gives 1 passed, 0 skipped. All 64 GPU readbacks matched.

cargo test --offline --locked -p xcl --lib ir_text_assembles_signs_and_runs -- --nocapture --test-threads=1. Focused synthetic test only.

AI-assisted. Codex (GPT-6 family, exact variant unavailable) ran the comparison and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-24 15:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7136433903) Confirmed [ivall’s validator-version finding](https://github.com/ivall/xcl/pull/1373#issuecomment-7136048702) on an RTX 3080 Ti (621.35), Windows 11 build 26300, with Windows SDK DXC and DXIL validator 1.8.2502.11. - [3485cbf](https://github.com/ivall/xcl/commit/3485cbfde5578cd139fcbf77437459d007227051) fails `ir_text_assembles_signs_and_runs` because the fixture requires validator 1.9. - Changing only the fixture’s `!dx.valver` to 1.6 gives 1 passed, 0 skipped. All 64 GPU readbacks matched. `cargo test --offline --locked -p xcl --lib ir_text_assembles_signs_and_runs -- --nocapture --test-threads=1`. Focused synthetic test only. AI-assisted. Codex (GPT-6 family, exact variant unavailable) ran the comparison and drafted this report.
Author
Owner

@⁠ArturoWolff on GitHub · 2026-11-24 15:33 UTC · original · edited 2026-11-24 15:55 UTC

RTX 4060 / Proton: the original and reassembled split-wave shader produced the same GPU output, including reads across waves. Tested the real dxc::assemble at 3485cbfde5578cd139fcbf77437459d007227051 on a generated 2,048-round compute kernel (four memory windows, wave64 split over wave32). The input to the assembler was DXC’s unedited listing of the original DXIL. The executable bitcode was not byte-identical after reassembly (62,916 → 62,856 bytes). Both signed containers passed a separate dxil.dll validation before dispatch. Each 6,400-byte readback matched the CPU reference: 768 local values, 768 values exchanged via LDS, 64 untouched prefix words.

Stage Time
Ready 401,231-byte IR listing → assembled, validated and signed DXIL 21.1 ms median, four runs
Existing HLSL → signed DXIL 1,462.1 ms median, four runs
Cold PSO creation, original / reassembled 563 / 586 ms, one each

Fresh processes, balanced order. Producing the listing from the original container was a separate 8.7 ms disassembly. The assembler timing starts after lowering and optimization; it does not estimate end-to-end direct-backend speed. One PSO attempt per arm is not a driver benchmark.

Tested: Linux, Ryzen 5 5600, RTX 4060, NVIDIA 620.73.04, GE-Proton11-14, vkd3d-proton 4522cc1a8b1347f+. Both loaded DLLs were 1.9.2609.5; listing declared DXIL 1.6, validator 1.9, cs_6_6. Offline Windows-target release library, private probe: one disassembly, four HLSL compiles, four assemblies, two dispatch/readbacks; 11 passed, 0 failed/ignored/skipped. Not tested: validator 1.8, full suite, retail title, or direct RDNA-to-IR lowering.

AI use: Hermes Agent, gpt-6.2-astra (fixture, execution, verification and report).

Bitcode follow-up (same two outputs, no new dispatch): llvm-bcanalyzer --dump found one function with 44 basic blocks in both. All 10,458 decoded INST_* records matched in order, including operands. Within the function block the only remaining decoded-record differences after ignoring abbreviation IDs were three metadata attachments: their kind IDs were renumbered but resolved to the same llvm.loop and dx.controlflow.hints names. The different bitcode hashes alone therefore do not show different instructions here. This is not a whole-module or driver-ISA equivalence claim.

Linux downstream check (same fixture and stack): Two fresh pso_readback --exact --nocapture --test-threads=1 dispatches with VKD3D_SHADER_DUMP_PATH set: 2 passed, 0 failed/ignored/skipped. Each dumped DXIL matched its input byte for byte; both 6,400-byte GPU readbacks matched the expected result. Both SPIR-V modules were 263,892 bytes and passed spirv-val --target-env vulkan1.3. spirv-dis --raw-id differed only in the input filename in OpString; after spirv-opt --strip-debug the binaries compared identical with cmp. On this shader, reassembly changed DXIL bytes but not the SPIR-V instructions submitted through vkd3d-proton. Not a driver-ISA comparison or a timing result.

**@⁠ArturoWolff** on GitHub · 2026-11-24 15:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7136233460) · edited 2026-11-24 15:55 UTC **RTX 4060 / Proton: the original and reassembled split-wave shader produced the same GPU output, including reads across waves.** Tested the real `dxc::assemble` at `3485cbfde5578cd139fcbf77437459d007227051` on a generated 2,048-round compute kernel (four memory windows, wave64 split over wave32). The input to the assembler was DXC’s unedited listing of the original DXIL. The executable bitcode was **not byte-identical** after reassembly (62,916 → 62,856 bytes). Both signed containers passed a separate `dxil.dll` validation before dispatch. Each 6,400-byte readback matched the CPU reference: 768 local values, 768 values exchanged via LDS, 64 untouched prefix words. | Stage | Time | |---|---:| | Ready 401,231-byte IR listing → assembled, validated and signed DXIL | 21.1 ms median, four runs | | Existing HLSL → signed DXIL | 1,462.1 ms median, four runs | | Cold PSO creation, original / reassembled | 563 / 586 ms, one each | Fresh processes, balanced order. Producing the listing from the original container was a separate 8.7 ms disassembly. The assembler timing **starts after lowering and optimization**; it does not estimate end-to-end direct-backend speed. One PSO attempt per arm is not a driver benchmark. **Tested:** Linux, Ryzen 5 5600, RTX 4060, NVIDIA 620.73.04, GE-Proton11-14, vkd3d-proton `4522cc1a8b1347f+`. Both loaded DLLs were 1.9.2609.5; listing declared DXIL 1.6, validator 1.9, `cs_6_6`. Offline Windows-target release library, private probe: one disassembly, four HLSL compiles, four assemblies, two dispatch/readbacks; 11 passed, 0 failed/ignored/skipped. **Not tested:** validator 1.8, full suite, retail title, or direct RDNA-to-IR lowering. **AI use:** Hermes Agent, gpt-6.2-astra (fixture, execution, verification and report). **Bitcode follow-up (same two outputs, no new dispatch):** `llvm-bcanalyzer --dump` found one function with 44 basic blocks in both. All 10,458 decoded `INST_*` records matched in order, including operands. Within the function block the only remaining decoded-record differences after ignoring abbreviation IDs were three metadata attachments: their kind IDs were renumbered but resolved to the same `llvm.loop` and `dx.controlflow.hints` names. The different bitcode hashes alone therefore do not show different instructions here. This is not a whole-module or driver-ISA equivalence claim. **Linux downstream check (same fixture and stack):** Two fresh `pso_readback --exact --nocapture --test-threads=1` dispatches with `VKD3D_SHADER_DUMP_PATH` set: 2 passed, 0 failed/ignored/skipped. Each dumped DXIL matched its input byte for byte; both 6,400-byte GPU readbacks matched the expected result. Both SPIR-V modules were 263,892 bytes and passed `spirv-val --target-env vulkan1.3`. `spirv-dis --raw-id` differed only in the input filename in `OpString`; after `spirv-opt --strip-debug` the binaries compared identical with `cmp`. On this shader, reassembly changed DXIL bytes but not the SPIR-V instructions submitted through vkd3d-proton. Not a driver-ISA comparison or a timing result.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 16:41 UTC · original

Test report — RTX 3060 Ti (Windows 11), DXC dxcompiler 1.8.2502.11, branch merged with current main (b7aa9f3):

cargo test -p xcl --lib -- --test-threads=1: 1 failure (722 passed, 1 failed, 21 ignored):

gpu::recomp::tests::ir_text_assembles_signs_and_runs
called `Result::unwrap()` on an `Err` value: "validate: error: Validator version in metadata (1.9)
is not supported; maximum: (1.8).\nValidation failed."

The LLVM IR → DXIL path emits module metadata with validator version 1.9, but the DXC in the Windows SDK (1.8.2502.11) only accepts ≤1.8 — the emitted IR probably needs llvm.ident/module-flag metadata pinned, or the assemble step needs to strip/override the version flag before validation.

**@⁠DavidM1911** on GitHub · 2026-11-24 16:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7138066774) Test report — RTX 3060 Ti (Windows 11), DXC dxcompiler 1.8.2502.11, branch merged with current `main` (`b7aa9f3`): `cargo test -p xcl --lib -- --test-threads=1`: **1 failure** (722 passed, 1 failed, 21 ignored): ``` gpu::recomp::tests::ir_text_assembles_signs_and_runs called `Result::unwrap()` on an `Err` value: "validate: error: Validator version in metadata (1.9) is not supported; maximum: (1.8).\nValidation failed." ``` The LLVM IR → DXIL path emits module metadata with validator version 1.9, but the DXC in the Windows SDK (1.8.2502.11) only accepts ≤1.8 — the emitted IR probably needs `llvm.ident`/module-flag metadata pinned, or the assemble step needs to strip/override the version flag before validation.
Author
Owner

@⁠Sr-0w on GitHub · 2026-11-24 18:17 UTC · original

042d3a6 "Tests: the IR assemble test skips without dxil.dll": the same fix as 9a24907 on the per-lane branch, for the gap @⁠justrhoto found on #1269. A stock Windows SDK's bin\<ver>\x64 has dxcompiler.dll without dxil.dll, so ir_text_assembles_signs_and_runs panicked with no dxil.dll to sign with instead of skipping.

Checked (RX 7800 XT, release):

  • with the full DXC 1.9 folder, the test passes;
  • with XCL_DXC_DIR set to a folder holding only the SDK's dxcompiler.dll, it prints SKIPPED gpu::recomp::tests::ir_text_assembles_signs_and_runs: no dxil.dll;
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignored.

AI use: Claude Code (Claude Opus 5.5) made the commit, ran the tests and wrote this comment.

**@⁠Sr-0w** on GitHub · 2026-11-24 18:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7140440278) [`042d3a6`](https://github.com/Sr-0w/xcl/commit/042d3a6) "Tests: the IR assemble test skips without dxil.dll": the same fix as `9a24907` on the per-lane branch, for the gap @⁠justrhoto found on #1269. A stock Windows SDK's `bin\<ver>\x64` has `dxcompiler.dll` without `dxil.dll`, so `ir_text_assembles_signs_and_runs` panicked with `no dxil.dll to sign with` instead of skipping. **Checked** (RX 7800 XT, release): - with the full DXC 1.9 folder, the test passes; - with `XCL_DXC_DIR` set to a folder holding only the SDK's `dxcompiler.dll`, it prints `SKIPPED gpu::recomp::tests::ir_text_assembles_signs_and_runs: no dxil.dll`; - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. AI use: Claude Code (Claude Opus 5.5) made the commit, ran the tests and wrote this comment.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:26 UTC · original

Regression run of 042d3a62 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 042d3a62c51645c96c86a9789b4790fc6cef2492
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1628 (PresentX 1628)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-25 03:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7151921963) Regression run of `042d3a62` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 042d3a62c51645c96c86a9789b4790fc6cef2492 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1628 (PresentX 1628) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:57 UTC · original

Tested

PR #1373 was open at 042d3a62c51645c96c86a9789b4790fc6cef2492 before and after testing. The existing checkout was clean and detached at that SHA. No equivalent same-head Arc A770 result was found in the PR description, eight discussion entries, review submissions, or 173 comments on GPU issue #42.

STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 x64 build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 on stable-x86_64-pc-windows-msvc. The fixture logged dxcompiler and dxil 1.9.2609.5 from the configured XCL_DXC_DIR.

  • Prebuild outside the Arc mutex: cargo test --locked -p xcl --lib --no-run. Exit 0, one existing deprecation warning. The unoptimized test profile used two Cargo jobs, incremental off, dev/test debug info off, the assigned target, and per-run TEMP/TMP.
  • Under Invoke-ArcTest.ps1 -Test with XCL_ADAPTER=A770, ran the exact prebuilt binary with gpu::recomp::tests::ir_text_assembles_signs_and_runs --exact --nocapture --test-threads=1. Captured fixture and wrapper exit 0. 1 passed, 0 failed, 0 ignored, 0 skipped, 728 filtered out, 0.15 s.
  • DXC loaded and assembly plus in-place validation/signing succeeded for the stock cs_6_6 module, whose validator metadata requests 1.9. The fixture would skip if DXC could not load, if assembly returned its no-dxil.dll signing error, or if no usable GPU was available. None triggered. A D3D12 compute dispatch ran on the A770 and the readback assertion matched 3*i+1 for every i from 0 to 63.
  • The first fixture invocation also printed a pass and released the Arc mutex, but the PowerShell launcher failed to retrieve its exit code. The reported result is from a rerun of the same binary with separate stdout, stderr, and reliable process exit capture. The wrapper confirmed Arc mutex release. The target slot handle was released at 2026-11-25T07:54:14.5030935+01:00.

Not tested

Other DXC/validator versions, adapters, extra IR inputs, large-shader round trips, upstream or retail data, and the workspace suite.

AI use

T3 Code / Codex (gpt-6.2-sol) verified the commit and deduplication, ran the stock fixture, and wrote the report.

Evidence in this directory includes environment.log, dedup.log, cargo.stdout.log, cargo.stderr.log and cargo.exit.txt. The retry directory contains fixture.command.txt, fixture.stdout.log, fixture.stderr.log, fixture.exit.txt, wrapper.stdout.log, wrapper.stderr.log, wrapper.exit.txt, both checkout checks, and slot-release.log.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7155336178) **Tested** PR #1373 was open at 042d3a62c51645c96c86a9789b4790fc6cef2492 before and after testing. The existing checkout was clean and detached at that SHA. No equivalent same-head Arc A770 result was found in the PR description, eight discussion entries, review submissions, or 173 comments on GPU issue #42. STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 x64 build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 on stable-x86_64-pc-windows-msvc. The fixture logged dxcompiler and dxil 1.9.2609.5 from the configured XCL_DXC_DIR. - Prebuild outside the Arc mutex: cargo test --locked -p xcl --lib --no-run. Exit 0, one existing deprecation warning. The unoptimized test profile used two Cargo jobs, incremental off, dev/test debug info off, the assigned target, and per-run TEMP/TMP. - Under Invoke-ArcTest.ps1 -Test with XCL_ADAPTER=A770, ran the exact prebuilt binary with gpu::recomp::tests::ir_text_assembles_signs_and_runs --exact --nocapture --test-threads=1. Captured fixture and wrapper exit 0. 1 passed, 0 failed, 0 ignored, 0 skipped, 728 filtered out, 0.15 s. - DXC loaded and assembly plus in-place validation/signing succeeded for the stock cs_6_6 module, whose validator metadata requests 1.9. The fixture would skip if DXC could not load, if assembly returned its no-dxil.dll signing error, or if no usable GPU was available. None triggered. A D3D12 compute dispatch ran on the A770 and the readback assertion matched 3*i+1 for every i from 0 to 63. - The first fixture invocation also printed a pass and released the Arc mutex, but the PowerShell launcher failed to retrieve its exit code. The reported result is from a rerun of the same binary with separate stdout, stderr, and reliable process exit capture. The wrapper confirmed Arc mutex release. The target slot handle was released at 2026-11-25T07:54:14.5030935+01:00. **Not tested** Other DXC/validator versions, adapters, extra IR inputs, large-shader round trips, upstream or retail data, and the workspace suite. **AI use** T3 Code / Codex (gpt-6.2-sol) verified the commit and deduplication, ran the stock fixture, and wrote the report. Evidence in this directory includes environment.log, dedup.log, cargo.stdout.log, cargo.stderr.log and cargo.exit.txt. The retry directory contains fixture.command.txt, fixture.stdout.log, fixture.stderr.log, fixture.exit.txt, wrapper.stdout.log, wrapper.stderr.log, wrapper.exit.txt, both checkout checks, and slot-release.log.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 01:09 UTC · original

Closing because main already has this change, from 9b8db83f ("Recompiler: assemble and sign a DXIL module from LLVM IR text"). crates/xcl/src/gpu/recomp/dxil/assemble.rs on main has assemble(ir: &str), which takes the same CreateBlob, AssembleToContainer and in-place IDxcValidator signing path with the same !llvm.ident note. Its ir_text_assembles_signs_and_runs test matches this one, uses !dx.valver 1.6, and skips when dxil.dll is missing (6bdef802).

Compared at head 1b08dfae against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.

**@⁠Prime1997** on GitHub · 2026-11-26 01:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7179494658) Closing because main already has this change, from 9b8db83f ("Recompiler: assemble and sign a DXIL module from LLVM IR text"). `crates/xcl/src/gpu/recomp/dxil/assemble.rs` on main has `assemble(ir: &str)`, which takes the same CreateBlob, AssembleToContainer and in-place IDxcValidator signing path with the same `!llvm.ident` note. Its `ir_text_assembles_signs_and_runs` test matches this one, uses `!dx.valver 1.6`, and skips when dxil.dll is missing (6bdef802). Compared at head 1b08dfae against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 05:03 UTC · original

Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-26 05:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/1373#issuecomment-7183140864) Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.