Shaders: release offline DXIL after each pipeline build #3043

Merged
gefydev merged 1 commit from upstream-pr/3043 into main 2026-11-27 21:27:54 +00:00
gefydev commented 2026-11-27 17:23:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-27T17:23:51Z.


The offline xcl shaders --precompile --pipelines pass keeps all translated compute jobs alive until the last driver build returns. This change releases each job's DXIL and dispatch-chain pieces when that job finishes. Part of #2088.

What is in it

  • shaders.rs lets workers take ownership of jobs in the existing priority order. A regression test checks that inputs stay alive during the build and are released before the next job starts.

Tested

  • Ryzen 5 1600, GeForce GTX 1650 (driver 621.24), Windows 11 Pro build 26300, Rust 1.100.0.

  • Focused regression on the original base. The old queue failed with completed jobs still hold their inputs. The changed queue passed.

  • cargo build --workspace -j 6 and cargo test --workspace --no-fail-fast -j 6 -- --test-threads=4 --nocapture on d8dae08d. Cargo reported 1466 passed, 0 failed, and 47 ignored. The pass count includes 28 SKIPPED diagnostics (21 for wave64, 3 expected translator refusals, 3 for the D3D12 debug layer, 1 for heap windows).

  • Four 45-second title runs on release builds of 6089122a and d8dae08d, with XCL_PREPARE=0 on both. The second pair had 1,053 and 1,015 frames and peak process commit of 11,315 and 10,795 MiB for main and head, respectively. All four exited with code 0 and recorded zero crashes or device removals.

  • Four offline runs in main–head–head–main order with xcl shaders <pack> --precompile --only cs --pipelines. Same initial translation cache, direct DXIL, heap windows, six DXC threads, one driver worker, 32 KiB DXIL cap, and driver PSO disk caching disabled. Each queued 2,689 compute programs and created 996 driver pipelines with zero refusals.

  • At the first sample reporting 725 completed driver pipelines, process commit fell by 1,064 and 1,074 MiB in the two pairs. The sampled peak during the driver pass fell by 138 and 116 MiB. Memory in MiB, sampled at about 150 ms intervals.

Measure Main 1 Head 1 Main 2 Head 2
Process commit at 725 pipelines 2654.8 1591.0 2577.3 1503.7
Working set at 725 pipelines 2639.1 1553.7 2526.0 1379.6
Peak commit during driver pass 2655.2 2517.7 2583.3 2467.1
Peak commit across the process 2655.2 2601.6 2606.3 2596.8

Regression run

xcl-smoke v1
commit: 6089122a1c96dff16e93b6fdf04c8ed20cfb6102
gpu: NVIDIA GeForce GTX 1650
title: eddfb802
seconds: 45
exit: 0x0
frames shown: 974 (PresentX 975)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 10115 MB
xcl-smoke v1
commit: d8dae08ddb1fd30a688cb1e56c5e3daa87e889e0
gpu: NVIDIA GeForce GTX 1650
title: eddfb802
seconds: 45
exit: 0x0
frames shown: 1015 (PresentX 1015)
presents per 2 s (last 3): 56 61 45
device removals: 0
crashes: 0
peak commit: 10899 MB

Not tested

  • AMD or Intel GPUs, loading into the title's world, and the uncapped driver pass. The short title smoke covers launch. The offline CLI benchmark covers the affected queue with one driver worker.

AI use

AI use: Codex (gpt-6.2-sol) wrote the change and regression test and ran the validation.

<!-- greyfinch-sync:ivall/xcl:issue:5530607812 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3043). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-27T17:23:51Z. --- The offline `xcl shaders --precompile --pipelines` pass keeps all translated compute jobs alive until the last driver build returns. This change releases each job's DXIL and dispatch-chain pieces when that job finishes. Part of [#2088](https://github.com/xcl-dev/xcl/issues/2088). **What is in it** - `shaders.rs` lets workers take ownership of jobs in the existing priority order. A regression test checks that inputs stay alive during the build and are released before the next job starts. **Tested** - Ryzen 5 1600, GeForce GTX 1650 (driver 621.24), Windows 11 Pro build 26300, Rust 1.100.0. - Focused regression on the original base. The old queue failed with `completed jobs still hold their inputs`. The changed queue passed. - `cargo build --workspace -j 6` and `cargo test --workspace --no-fail-fast -j 6 -- --test-threads=4 --nocapture` on `d8dae08d`. Cargo reported 1466 passed, 0 failed, and 47 ignored. The pass count includes 28 `SKIPPED` diagnostics (21 for wave64, 3 expected translator refusals, 3 for the D3D12 debug layer, 1 for heap windows). - Four 45-second title runs on release builds of `6089122a` and `d8dae08d`, with `XCL_PREPARE=0` on both. The second pair had 1,053 and 1,015 frames and peak process commit of 11,315 and 10,795 MiB for main and head, respectively. All four exited with code 0 and recorded zero crashes or device removals. - Four offline runs in main–head–head–main order with `xcl shaders <pack> --precompile --only cs --pipelines`. Same initial translation cache, direct DXIL, heap windows, six DXC threads, one driver worker, 32 KiB DXIL cap, and driver PSO disk caching disabled. Each queued 2,689 compute programs and created 996 driver pipelines with zero refusals. - At the first sample reporting 725 completed driver pipelines, process commit fell by 1,064 and 1,074 MiB in the two pairs. The sampled peak during the driver pass fell by 138 and 116 MiB. Memory in MiB, sampled at about 150 ms intervals. | Measure | Main 1 | Head 1 | Main 2 | Head 2 | | --- | ---: | ---: | ---: | ---: | | Process commit at 725 pipelines | 2654.8 | 1591.0 | 2577.3 | 1503.7 | | Working set at 725 pipelines | 2639.1 | 1553.7 | 2526.0 | 1379.6 | | Peak commit during driver pass | 2655.2 | 2517.7 | 2583.3 | 2467.1 | | Peak commit across the process | 2655.2 | 2601.6 | 2606.3 | 2596.8 | **Regression run** ``` xcl-smoke v1 commit: 6089122a1c96dff16e93b6fdf04c8ed20cfb6102 gpu: NVIDIA GeForce GTX 1650 title: eddfb802 seconds: 45 exit: 0x0 frames shown: 974 (PresentX 975) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 10115 MB ``` ``` xcl-smoke v1 commit: d8dae08ddb1fd30a688cb1e56c5e3daa87e889e0 gpu: NVIDIA GeForce GTX 1650 title: eddfb802 seconds: 45 exit: 0x0 frames shown: 1015 (PresentX 1015) presents per 2 s (last 3): 56 61 45 device removals: 0 crashes: 0 peak commit: 10899 MB ``` **Not tested** - AMD or Intel GPUs, loading into the title's world, and the uncapped driver pass. The short title smoke covers launch. The offline CLI benchmark covers the affected queue with one driver worker. **AI use** AI use: Codex (gpt-6.2-sol) wrote the change and regression test and ran the validation.
pickles976 commented 2026-11-27 17:45:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-27T17:45:04Z.


Exact-head Wine verification at d8dae08ddb1fd30a688cb1e56c5e3daa87e889e0, immediate parent 6089122a1c96dff16e93b6fdf04c8ed20cfb6102, clean detached xcl-pr3043; no source modifications.

cargo test --locked --target x86_64-pc-windows-msvc -p xcl --lib shaders::pipeline_selection_tests:: -- --nocapture --test-threads=1: 3/3 pass, 0 ignored, 0.00 s after fresh intended-worktree compilation (26.34 s).

  • offline_pipeline_jobs_drop_their_inputs_after_each_build: one-worker weak-reference fixture proves completed inputs are released before later jobs run, while current/queued inputs remain owned; all release after completion.
  • Used-first / descending-size ordering remains correct.
  • Record and pipeline selectors still match the intended jobs.

These are CPU ownership/policy tests, not actual driver compilation or measured DXIL/driver/whole-process peak-memory savings. No matched-parent port, multithreaded overlap fixture, retail precompile or title run. Source takes one owned job under the mutex and releases the lock before invoking the builder; the supplied lifetime fixture covers serial release, not a concurrent stress test.

Linux6.17/i7-13620H/16GiB/Wine11/Rust1.98.1. Unchanged9GiB/512MiB guarded scope. Evidence .compat-runtime/logs/verify-xcl3043-offline-retention-20261127T174138Z/ (27.08 s whole command; sampled availableRAM minimum9543.5MiB, disk minimum11.843GiB). No GPU adapter was opened by these tests. This clears the focused offline-retention contract locally; it does not fix the separate Game-Init producer-completion failure.

AI-assisted local verification: OpenAI Codex GPT-6-Astra. No game assets, saves or imagery attached.

<!-- greyfinch-sync:ivall/xcl:comment:7224746815 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3043#issuecomment-7224746815). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T17:45:04Z. --- Exact-head Wine verification at `d8dae08ddb1fd30a688cb1e56c5e3daa87e889e0`, immediate parent `6089122a1c96dff16e93b6fdf04c8ed20cfb6102`, clean detached `xcl-pr3043`; no source modifications. `cargo test --locked --target x86_64-pc-windows-msvc -p xcl --lib shaders::pipeline_selection_tests:: -- --nocapture --test-threads=1`: **3/3 pass**, 0 ignored, 0.00 s after fresh intended-worktree compilation (26.34 s). - `offline_pipeline_jobs_drop_their_inputs_after_each_build`: one-worker weak-reference fixture proves completed inputs are released before later jobs run, while current/queued inputs remain owned; all release after completion. - Used-first / descending-size ordering remains correct. - Record and pipeline selectors still match the intended jobs. These are **CPU ownership/policy tests**, not actual driver compilation or measured DXIL/driver/whole-process peak-memory savings. No matched-parent port, multithreaded overlap fixture, retail precompile or title run. Source takes one owned job under the mutex and releases the lock before invoking the builder; the supplied lifetime fixture covers serial release, not a concurrent stress test. Linux6.17/i7-13620H/16GiB/Wine11/Rust1.98.1. Unchanged9GiB/512MiB guarded scope. Evidence `.compat-runtime/logs/verify-xcl3043-offline-retention-20261127T174138Z/` (27.08 s whole command; sampled availableRAM minimum9543.5MiB, disk minimum11.843GiB). No GPU adapter was opened by these tests. This clears the focused offline-retention contract locally; it does not fix the separate Game-Init producer-completion failure. AI-assisted local verification: OpenAI Codex GPT-6-Astra. No game assets, saves or imagery attached.
Lum7nt commented 2026-11-27 18:04:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Lum7nt on 2026-11-27T18:04:48Z.


Native Windows 11 + NVIDIA RTX 3060 verification of PR #3043

Tested PR #3043 head \d8dae08ddb\ on native Windows 11 on NVIDIA RTX 3060 (12 GB, native wave32).

Environment

  • GPU: NVIDIA GeForce RTX 3060 (12 GB / 12,115 MiB VRAM), driver \32.0.15.8142\ (WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-10400 CPU @ 2.90GHz (6C / 12T), 32 GB RAM, Windows 11 Build 22631 (NT 10.0.22631.0)
  • Toolchain:
    ustc 1.100.0 (0ef1bc386 2026-11-09)\ x86_64-pc-windows-msvc, Windows SDK DXC \1.8.2502.11\ / dxil \1.8.2502.11\

Test Results

  1. Pipeline Selection & Lifetime Unit Tests (\shaders::pipeline_selection_tests):
    \\powershell
    cargo test -p xcl --lib shaders::pipeline_selection_tests:: -- --nocapture
    \\
  • \offline_pipeline_jobs_drop_their_inputs_after_each_build\ ? PASS
  • \earlier_pipelines_go_first_then_largest_first\ ? PASS
  • \selectors_name_record_and_pipeline_matches\ ? PASS
    Result: 3 passed; 0 failed; 0 ignored; 0 skipped (0.00s).
  1. Integration Suite (\shaders_e2e):
    \\powershell
    cargo test -p xcl --test shaders_e2e
    \\
    Result: 9 passed; 0 failed; 0 ignored; 0 skipped (0.22s).

  2. Offline Driver Pipeline Cap Test (\shaders::pipeline_cap_tests::stale_blob_cannot_bypass_the_offline_pipeline_cap):

  • PASS on live RTX 3060 hardware (\dapter=NVIDIA GeForce RTX 3060).

Observations

  • Verified that
    un_pipeline_jobs\ correctly consumes jobs via \Mutex\ and drops each job's buffers as soon as its driver build returns, preventing memory accumulation during offline precompilation.
  • Precompile job ordering (used-first, then largest) remains intact across worker threads.

AI disclosure: Testing executed independently on physical hardware; report drafted with agent assistance.

<!-- greyfinch-sync:ivall/xcl:comment:7225100396 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3043#issuecomment-7225100396). Originally posted by [Lum7nt](https://github.com/Lum7nt) on 2026-11-27T18:04:48Z. --- ### Native Windows 11 + NVIDIA RTX 3060 verification of PR #3043 Tested PR #3043 head \d8dae08ddb1fd30a688cb1e56c5e3daa87e889e0\ on native Windows 11 on NVIDIA RTX 3060 (12 GB, native wave32). ### Environment - **GPU:** NVIDIA GeForce RTX 3060 (12 GB / 12,115 MiB VRAM), driver \32.0.15.8142\ (WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-10400 CPU @ 2.90GHz (6C / 12T), 32 GB RAM, Windows 11 Build 22631 (NT 10.0.22631.0) - **Toolchain:** \ ustc 1.100.0 (0ef1bc386 2026-11-09)\ x86_64-pc-windows-msvc, Windows SDK DXC \1.8.2502.11\ / dxil \1.8.2502.11\ ### Test Results 1. **Pipeline Selection & Lifetime Unit Tests (\shaders::pipeline_selection_tests\):** \\\powershell cargo test -p xcl --lib shaders::pipeline_selection_tests:: -- --nocapture \\\ - \offline_pipeline_jobs_drop_their_inputs_after_each_build\ ? **PASS** - \earlier_pipelines_go_first_then_largest_first\ ? **PASS** - \selectors_name_record_and_pipeline_matches\ ? **PASS** **Result:** **3 passed; 0 failed; 0 ignored; 0 skipped** (0.00s). 2. **Integration Suite (\shaders_e2e\):** \\\powershell cargo test -p xcl --test shaders_e2e \\\ **Result:** **9 passed; 0 failed; 0 ignored; 0 skipped** (0.22s). 3. **Offline Driver Pipeline Cap Test (\shaders::pipeline_cap_tests::stale_blob_cannot_bypass_the_offline_pipeline_cap\):** - **PASS** on live RTX 3060 hardware (\dapter=NVIDIA GeForce RTX 3060\). ### Observations - Verified that \ un_pipeline_jobs\ correctly consumes jobs via \Mutex<IntoIter>\ and drops each job's buffers as soon as its driver build returns, preventing memory accumulation during offline precompilation. - Precompile job ordering (used-first, then largest) remains intact across worker threads. *AI disclosure: Testing executed independently on physical hardware; report drafted with agent assistance.*
JJAutoCompare commented 2026-11-27 19:52:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T19:52:56Z.


Tested

CPU-only on Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC debug. I reran the pinned standalone harness with pr3043_lifetime-1d1eeddbfcd48e09.exe --test-threads=1 --nocapture. The harness includes the verbatim run_pipeline_jobs helper and checked-in one-worker control from d8dae08ddb1fd30a688cb1e56c5e3daa87e889e0. I verified both extracts against the exact Git source blob and checked the executable SHA-256 before and after the run.

The two-worker fixture supplied four synthetic jobs with three inputs each. While worker A held job 0 in its callback, worker B completed jobs 1 and 2 and released each job's inputs before taking the next job. Inputs for active and queued jobs stayed live at the checked points. After the workers joined, each job had run once and all 12 inputs had dropped exactly once.

The concurrent fixture and one-worker control both passed in the standalone executable. 2 passed, 0 failed, 0 ignored, 0 skipped. Native exit 0.

Not tested

XCL integration, driver compilation, GPU behavior, retail precompile, and performance or memory savings.

AI use

T3 Code / Codex (gpt-6.2-sol) wrote the synthetic test, independently reran the pinned harness, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7226961281 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3043#issuecomment-7226961281). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-27T19:52:56Z. --- **Tested** CPU-only on Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC debug. I reran the pinned standalone harness with `pr3043_lifetime-1d1eeddbfcd48e09.exe --test-threads=1 --nocapture`. The harness includes the verbatim `run_pipeline_jobs` helper and checked-in one-worker control from `d8dae08ddb1fd30a688cb1e56c5e3daa87e889e0`. I verified both extracts against the exact Git source blob and checked the executable SHA-256 before and after the run. The two-worker fixture supplied four synthetic jobs with three inputs each. While worker A held job 0 in its callback, worker B completed jobs 1 and 2 and released each job's inputs before taking the next job. Inputs for active and queued jobs stayed live at the checked points. After the workers joined, each job had run once and all 12 inputs had dropped exactly once. The concurrent fixture and one-worker control both passed in the standalone executable. **2 passed, 0 failed, 0 ignored, 0 skipped.** Native exit 0. **Not tested** XCL integration, driver compilation, GPU behavior, retail precompile, and performance or memory savings. **AI use** T3 Code / Codex (`gpt-6.2-sol`) wrote the synthetic test, independently reran the pinned harness, and drafted this report.
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!3043
No description provided.