Shaders: honor --precompile for a single shader file #642

Open
github-bot wants to merge 1 commit from github-bot/gh-642 into main AGit
Owner

@⁠CallMeBrado on GitHub · 2026-11-24 02:49 UTC · original
CallMeBrado:fix/single-shader-precompile → main · +39 −6 · 3 files · 1 commits · open

What is in it

xcl shaders file.dxbc --precompile printed shader stats and exited successfully, but the cache stayed empty. The single-file path returned before the CLI checked --precompile.

  • A single shader now goes through the same precompiler as a directory or archive. It reuses the bytes the CLI already read. Running the command without --precompile still prints stats.
  • Added a CLI regression test with a synthetic DXBC file and a single-file example in the README.

Tested

  • RTX 5090, driver 621.24, Ryzen 9 9950X3D, Windows 11 Pro build 26200, Rust 1.96.0.
  • Debug workspace build passed. cargo test --workspace -- --test-threads=4 reported 687 passed, 0 failed, 41 ignored. Two GPU tests skipped internally for lack of wave64: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
  • The new CLI test failed on main and passed with this change in release mode. Starting with an empty cache, main wrote no files for a real compute shader. With the fix, the same shader produced 3,380 bytes of DXIL and one compute pipeline. Filtering for pixel shaders left the cache empty, as expected.

Regression run

Main

xcl-smoke v1
commit: 3db536ebe231418d76e8d6e52ccee0b47330a522
gpu: NVIDIA GeForce RTX 5090
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1420 (PresentX 1420)
presents per 2 s (last 3): 60 59 58
device removals: 0
crashes: 0
peak commit: 15293 MB

PR

xcl-smoke v1
commit: f1e90c149b5ff9e8a260c424d6dd53c0fe816031
gpu: NVIDIA GeForce RTX 5090
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1366 (PresentX 1366)
presents per 2 s (last 3): 46 47 53
device removals: 0
crashes: 0
peak commit: 15309 MB

Not tested

  • AMD and Intel GPUs. The 60-second game runs cover startup. Gameplay and loading-time effects were not measured.

AI use

  • Codex (GPT-6.2 Astra) reproduced the bug, wrote the fix and regression test, ran the checks, and drafted this description.
**@⁠CallMeBrado** on GitHub · 2026-11-24 02:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/642) `CallMeBrado:fix/single-shader-precompile` → `main` · +39 −6 · 3 files · 1 commits · open **What is in it** `xcl shaders file.dxbc --precompile` printed shader stats and exited successfully, but the cache stayed empty. The single-file path returned before the CLI checked `--precompile`. - A single shader now goes through the same precompiler as a directory or archive. It reuses the bytes the CLI already read. Running the command without `--precompile` still prints stats. - Added a CLI regression test with a synthetic DXBC file and a single-file example in the README. **Tested** - RTX 5090, driver 621.24, Ryzen 9 9950X3D, Windows 11 Pro build 26200, Rust 1.96.0. - Debug workspace build passed. `cargo test --workspace -- --test-threads=4` reported 687 passed, 0 failed, 41 ignored. Two GPU tests skipped internally for lack of wave64: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. - The new CLI test failed on main and passed with this change in release mode. Starting with an empty cache, main wrote no files for a real compute shader. With the fix, the same shader produced 3,380 bytes of DXIL and one compute pipeline. Filtering for pixel shaders left the cache empty, as expected. **Regression run** Main ``` xcl-smoke v1 commit: 3db536ebe231418d76e8d6e52ccee0b47330a522 gpu: NVIDIA GeForce RTX 5090 title: 419239bf seconds: 60 exit: 0x0 frames shown: 1420 (PresentX 1420) presents per 2 s (last 3): 60 59 58 device removals: 0 crashes: 0 peak commit: 15293 MB ``` PR ``` xcl-smoke v1 commit: f1e90c149b5ff9e8a260c424d6dd53c0fe816031 gpu: NVIDIA GeForce RTX 5090 title: 419239bf seconds: 60 exit: 0x0 frames shown: 1366 (PresentX 1366) presents per 2 s (last 3): 46 47 53 device removals: 0 crashes: 0 peak commit: 15309 MB ``` **Not tested** - AMD and Intel GPUs. The 60-second game runs cover startup. Gameplay and loading-time effects were not measured. **AI use** - Codex (GPT-6.2 Astra) reproduced the bug, wrote the fix and regression test, ran the checks, and drafted this description.
Standalone blobs returned their analysis before the precompile options were read. Use the same precompiler as folders and packs, borrowing the already-read blob. Keep single-file statistics on the calling thread.

Assisted-by: Codex (GPT-6.2 Astra)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:28:13 +00:00
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 03:24 UTC · original

Test run of f1e90c149b5ff9e8a260c424d6dd53c0fe816031 on AMD RDNA4. I merged it onto current main 91f9a5e locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 693 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 652 passed, 0 failed, 21 ignored
  • 0 SKIPPED; precompile_accepts_a_single_file passes.

Review: A single file now goes through the same precompiler as a directory or pack, reusing the bytes the CLI already read (Cow::Borrowed), and without --precompile it still prints stats. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 03:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/642#issuecomment-7121066615) Test run of `f1e90c149b5ff9e8a260c424d6dd53c0fe816031` on AMD RDNA4. I merged it onto current `main` `91f9a5e` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **693 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 652 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `precompile_accepts_a_single_file` passes. **Review:** A single file now goes through the same precompiler as a directory or pack, reusing the bytes the CLI already read (`Cow::Borrowed`), and without `--precompile` it still prints stats. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠Alpha325 on GitHub · 2026-11-25 02:29 UTC · original

I reused XCL’s synthetic compute shader builder to exercise single-file precompilation through DXC on Windows 11 with an RX 9060 XT and DXC 1.9.2602.17.

  • PR f1e90c1: shaders compute.dxbc --precompile --split 0 --only cs wrote one 3,080-byte .dxil file containing a DXIL part.
  • Parent 18c105a: the same command printed shader statistics and wrote zero cache entries. The new test failed as expected.
  • On the PR, switching to --only ps left a separate empty cache untouched.
  • Both shaders_e2e tests and both gpu_compute_e2e tests passed on the PR, with zero skips.

The patch shares the existing synthetic shader builder between the test suites. No runtime code changed. AI use — OpenAI Codex (GPT-6) wrote and ran the fixture and drafted this report.

**@⁠Alpha325** on GitHub · 2026-11-25 02:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/642#issuecomment-7150785914) I reused XCL’s synthetic compute shader builder to exercise single-file precompilation through DXC on Windows 11 with an RX 9060 XT and DXC 1.9.2602.17. - PR `f1e90c1`: `shaders compute.dxbc --precompile --split 0 --only cs` wrote one 3,080-byte `.dxil` file containing a DXIL part. - Parent `18c105a`: the same command printed shader statistics and wrote zero cache entries. The new test failed as expected. - On the PR, switching to `--only ps` left a separate empty cache untouched. - Both `shaders_e2e` tests and both `gpu_compute_e2e` tests passed on the PR, with zero skips. The patch shares the existing synthetic shader builder between the test suites. No runtime code changed. AI use — OpenAI Codex (GPT-6) wrote and ran the fixture and drafted this report.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 02:54 UTC · original

Test of XCL PR #642 at clean detached head f1e90c149b5ff9e8a260c424d6dd53c0fe816031. GitHub and refs/pull/642/head still matched the tested commit, and the PR was open at 2026-11-25T02:46:26.0766439Z. I found no Arc A770 report for this test and head in the PR discussion or issue #42.

Tested

  • Windows 11 Enterprise Evaluation 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust and Cargo 1.100.0 x86_64-pc-windows-msvc, unoptimized test profile. The configured DXC directory contained dxcompiler.dll and dxil.dll version 1.9.2609.5.

  • Process environment for the build and test used CARGO_TARGET_DIR=L:/XclTooling/pr2014-1c971de6/target, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0, XCL_ADAPTER=A770, and XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64. TEMP and TMP were L:/XclTooling/pr642/temp for build and L:/XclTooling/pr642/temp/test for execution. The test process used XCL_DXIL_CACHE=L:/XclTooling/pr642/shader-cache and XCL_DATA_ROOT=L:/XclTooling/pr642/xcl-data. The DXIL directory also contains any on-disk translated-shader entries made by this path.

  • Prebuild command and exact prebuilt test invocation, expressed as PowerShell calls:

    & "$env:USERPROFILE/.cargo/bin/cargo.exe" test --locked -p xcl --test shaders_e2e --no-run --jobs 2
    & 'L:/XclTooling/pr2014-1c971de6/target\debug\build\xcl/2a253c9aa814b338\out\shaders_e2e-2a253c9aa814b338.exe' precompile_accepts_a_single_file --exact --nocapture --test-threads=1
    
  • Build exit 0. Test exit 0. Libtest reported test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.73s. GPU SKIPPED markers: 0.

  • The test invoked xcl shaders <fixture> --precompile --split 0 with XCL_DXC_THREADS=1 and asserted a successful child exit, precompiling 1 , and compiled 0, already cached 0, errors 0. The fixture is a 32-byte synthetic DXBC container with zero parts. A file watcher recorded creation, change, and deletion of xcl-single-shader-1440.dxbc under the private test temp directory. The watched temp, shader cache and data roots contained 0 entries before and 0 entries after, with 0 filesystem events in the cache and data roots during execution.

  • The explicit split argument bypassed GPU probing, and the fixture runs without --pipelines. This CLI check ran on the Arc host without acquiring the GPU lock.

Not tested

GPU execution, DXC compilation, shader or PSO cache population with a compilable program, baseline comparison on main, full workspace suite, release profile, other adapters, and retail-title smoke runs.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in test, inspected the local outputs, and drafted this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 02:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/642#issuecomment-7151333594) Test of [XCL PR #642](https://git.gtahub.st/github/xcl-dev--xcl/pulls/642) at clean detached head `f1e90c149b5ff9e8a260c424d6dd53c0fe816031`. GitHub and `refs/pull/642/head` still matched the tested commit, and the PR was open at 2026-11-25T02:46:26.0766439Z. I found no Arc A770 report for this test and head in the PR discussion or issue #42. **Tested** - Windows 11 Enterprise Evaluation 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust and Cargo 1.100.0 x86_64-pc-windows-msvc, unoptimized test profile. The configured DXC directory contained `dxcompiler.dll` and `dxil.dll` version 1.9.2609.5. - Process environment for the build and test used `CARGO_TARGET_DIR=L:/XclTooling/pr2014-1c971de6/target`, `CARGO_INCREMENTAL=0`, `CARGO_PROFILE_DEV_DEBUG=0`, `CARGO_PROFILE_TEST_DEBUG=0`, `XCL_ADAPTER=A770`, and `XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`. `TEMP` and `TMP` were `L:/XclTooling/pr642/temp` for build and `L:/XclTooling/pr642/temp/test` for execution. The test process used `XCL_DXIL_CACHE=L:/XclTooling/pr642/shader-cache` and `XCL_DATA_ROOT=L:/XclTooling/pr642/xcl-data`. The DXIL directory also contains any on-disk translated-shader entries made by this path. - Prebuild command and exact prebuilt test invocation, expressed as PowerShell calls: ```powershell & "$env:USERPROFILE/.cargo/bin/cargo.exe" test --locked -p xcl --test shaders_e2e --no-run --jobs 2 & 'L:/XclTooling/pr2014-1c971de6/target\debug\build\xcl/2a253c9aa814b338\out\shaders_e2e-2a253c9aa814b338.exe' precompile_accepts_a_single_file --exact --nocapture --test-threads=1 ``` - Build exit 0. Test exit 0. Libtest reported `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.73s`. GPU `SKIPPED` markers: 0. - The test invoked `xcl shaders <fixture> --precompile --split 0` with `XCL_DXC_THREADS=1` and asserted a successful child exit, `precompiling 1 `, and `compiled 0, already cached 0, errors 0`. The fixture is a 32-byte synthetic DXBC container with zero parts. A file watcher recorded creation, change, and deletion of `xcl-single-shader-1440.dxbc` under the private test temp directory. The watched temp, shader cache and data roots contained 0 entries before and 0 entries after, with 0 filesystem events in the cache and data roots during execution. - The explicit split argument bypassed GPU probing, and the fixture runs without `--pipelines`. This CLI check ran on the Arc host without acquiring the GPU lock. **Not tested** GPU execution, DXC compilation, shader or PSO cache population with a compilable program, baseline comparison on main, full workspace suite, release profile, other adapters, and retail-title smoke runs. **AI use** T3 Code / Codex (gpt-6.2-sol) ran the checked-in test, inspected the local outputs, and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 12:31 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 12:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/642#issuecomment-7162495802) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/xcl/src/shaders.rs
  • crates/xcl/tests/shaders_e2e.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/642/head:github-bot/gh-642'
git switch 'github-bot/gh-642'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-642'
git switch 'github-bot/gh-642'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-642'
git switch 'github-bot/gh-642'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-642'
git switch 'main'
git merge --squash 'github-bot/gh-642'
git switch 'main'
git merge --ff-only 'github-bot/gh-642'
git switch 'main'
git merge 'github-bot/gh-642'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.