Shaders: release offline DXIL after each pipeline build #3043
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3043"
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?
Imported from ivall/xcl. Originally posted by gefydev on 2026-11-27T17:23:51Z.
The offline
xcl shaders --precompile --pipelinespass 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.rslets 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 6andcargo test --workspace --no-fail-fast -j 6 -- --test-threads=4 --nocaptureond8dae08d. Cargo reported 1466 passed, 0 failed, and 47 ignored. The pass count includes 28SKIPPEDdiagnostics (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
6089122aandd8dae08d, withXCL_PREPARE=0on 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.
Regression run
Not tested
AI use
AI use: Codex (gpt-6.2-sol) wrote the change and regression test and ran the validation.
Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-27T17:45:04Z.
Exact-head Wine verification at
d8dae08ddb1fd30a688cb1e56c5e3daa87e889e0, immediate parent6089122a1c96dff16e93b6fdf04c8ed20cfb6102, clean detachedxcl-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.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.
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
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
\\powershell
cargo test -p xcl --lib shaders::pipeline_selection_tests:: -- --nocapture
\\
Result: 3 passed; 0 failed; 0 ignored; 0 skipped (0.00s).
Integration Suite (\shaders_e2e):
\\powershell
cargo test -p xcl --test shaders_e2e
\\
Result: 9 passed; 0 failed; 0 ignored; 0 skipped (0.22s).
Offline Driver Pipeline Cap Test (\shaders::pipeline_cap_tests::stale_blob_cannot_bypass_the_offline_pipeline_cap):
Observations
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.
AI disclosure: Testing executed independently on physical hardware; report drafted with agent assistance.
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 verbatimrun_pipeline_jobshelper and checked-in one-worker control fromd8dae08ddb1fd30a688cb1e56c5e3daa87e889e0. 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.