Shaders: gate offline --pipelines large DXIL builds on commit headroom #2179
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2179
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2179"
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?
@O5-7 on GitHub · 2026-11-25 07:54 UTC · original
O5-7:shaders/offline-pipelines-memory-gate→main· +325 −47 · 2 files · 2 commits · openPart of #1598
What is in it
Tested
ustc 1.100.0 (0ef1bc386 2026-11-09), debug tests & release smoke run, DXC 1.8.2502.11 (D:\Windows Kits\10\bin\10.0.26100.0\x64).
Regression run
Not tested
AI use
@Kalmarv on GitHub · 2026-11-25 07:59 UTC · original
Heads-up from #2098, which changes
huge_pso_concurrency()'s default in the same lines.git merge-treeof this head against #2098's55eafb2gives a conflict inreal.rsat that function: this PR changes its visibility, and #2098 changes its body todefault_huge_pso_concurrency(cpus). The conflict is only textual, and whichever lands second needs a one-line rebase. With #2098, this PR's offline gate would get its CPU-scaled default too: one slot per four logical CPUs, from 1 to 7, unlessXCL_HUGE_PSO_CONCURRENCYis set. #2130 (the commit-wait bound) merges cleanly with this PR.AI use: Claude Code (Claude Opus 5.5) ran the merge check and wrote this note.
@itsSio on GitHub · 2026-11-25 09:54 UTC · original
Tested
Independent verification on clean head
864698ab2158d5e02f026112ddeae10646a703b7. Both PCs: Windows 11 Pro build 26200, NVIDIA driver 610.88, debug MSVC.cargo build --workspace --locked -j 4exited 0 on both.cargo test -p xcl --locked -j 4 offline_gate -- --nocapturewas 3 passed, 0 failed, 0 ignored, 0 skips on each (huge/giant serialization and injected commit-headroom policy).cargo test --workspace --locked -j 4 --no-fail-fast -- --test-threads=4 --nocapture:The 2080 SUPER run failed
hle::xgameruntime::gamesave::tests::case_insensitive_blob_and_container_matching_on_ntfs:XGameSaveSubmitUpdatereturnedE_FAIL(0x80004005) ingamesave.rs:1029. Isolated reruns (cargo test -p xcl --lib --locked -j 4 case_insensitive_blob_and_container_matching_on_ntfs -- --nocapture --test-threads=1) were 1 passed, 0 failed, 0 ignored, 0 skips per GPU and revision on both the head above and basecbc296ab65a2661a61e3e2da109134bcd5319f60. The full-suite failure did not reproduce in isolation; this comparison does not establish its cause.Not tested: Full suite on the base, paired retail smoke, retail offline peak commit, or actual low-memory driver compilation. The gate tests inject headroom values rather than exhausting system memory.
AI use
Ran via Samaritan:
@raylitebull on GitHub · 2026-11-25 10:45 UTC · original
Code review on
864698a:OfflineGatecleanly applieshuge_pso_bytes/huge_pso_concurrency/GIANT_DRIVER_COMPILEandbig_compile_headroomcommit-headroom gating to cold--pipelinesbuilds while avoiding low-commit deadlock whenactive_cold == 0, withRunningSlot/OfflineGateGuardRAII cleanup and 3 unit tests.Remaining before merge:
Build and testfinishing green plus dual-vendor (AMD + NVIDIA) verification on864698a.@Toons29 on GitHub · 2026-11-25 12:02 UTC · original
Regression run of
54a7d2d4on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon568e7db7, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 104 % 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; a script posted this right after the run, with both blocks exactly as printed.@DavidM1911 on GitHub · 2026-11-25 15:39 UTC · original
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!
@raylitebull on GitHub · 2026-11-25 18:28 UTC · original
Code review on
54a7d2d(crates/xcl/src/shaders.rs):offline_gate/free_commitgating for large DXIL--pipelinesbuilds looks clean, and CI is green.Remaining before merge: Independent AMD and NVIDIA test passes on
54a7d2dexercisingshaders::tests(offline_gate), since earlier NVIDIA test coverage was on864698aand smoke runs do not exercisexcl shaders.@tiagonleal on GitHub · 2026-11-25 18:58 UTC · original
Verification on NVIDIA RTX 5070 Ti (Windows 11), head
54a7d2d40577e014eb17b00828e63a49308a9d8f:shaders::testsandoffline_gatepassTested
54a7d2d40577e014eb17b00828e63a49308a9d8f(git rev-parse HEADof a clean detached worktree, no local changes, built as is, not merged withmain). The PR was open and the head unchanged when I started and again before writing this. The earlier NVIDIA run in the thread was on864698a.cargo test --release --locked -p xcl --lib shaders::tests -j 8 -- --nocapture: 7 passed, 0 failed, 0 ignored (1196 filtered out).retail_pack_sampleprintedXCL_SAMPLE_RPF not set - skippingand counts as passed.cargo test --release --locked -p xcl --lib offline_gate -j 8 -- --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored. Tests:offline_gate_runs_giant_compile_alone_even_with_higher_huge_concurrency,offline_gate_serializes_huge_compiles_while_small_compiles_proceed,offline_gate_waits_for_headroom_while_another_compile_is_active_and_avoids_deadlock_when_alone.cargo test --release --locked -p xcl --lib shaders:: -j 8 -- --nocapture(both modules together): 12 passed, 0 failed, 0 ignored. NoSKIPPEDlines other than theXCL_SAMPLE_RPFone above.git status --shortwas empty afterwards.Not tested
cargo test --workspace, a debug build, the retail game andxcl-smoke, a realxcl shaders --precompile --pipelinesrun, low-memory driver compilation (the gate tests inject headroom values).Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).
@O5-7 on GitHub · 2026-11-26 02:50 UTC · original · reviewed
Rebased onto main (
b49be18) to resolve the conflict in crates/xcl/src/shaders.rs against #2338 (adapting self.gate.enter to use make_one's per-piece dxil.len()), now at7bc00bc. Re-verified offline_gate (3/3), pipeline_cap_tests (3/3), big_compile_tests@luckyteagirl on GitHub · 2026-11-26 09:05 UTC · original · reviewed
On
7bc00bc, the firstCreateComputePipelineStatecall for a nonempty cached blob runs with onlyRunningSlot, beforeself.gate.enter. The comment here correctly notes that a driver can reject the blob internally, compile the DXIL, and still returnOk. That means a stale or incompatible blob can trigger a full multi-gigabyte driver compile inside the supposedly cheap probe. For two large cached programs, both probes can run at once even when the new huge/giant gate permits only one compile or commit headroom is low. The size-cap check and gated no-blob retry happen after this work has already occurred.Could the gate cover every native call that may compile, including the cached probe (without holding it twice on the fallback), or use a verified cache-only probe? A fake cached-create callback that simulates a slow internal fallback could check that the giant lane admits only one concurrent call. Source review only; I did not run a low-memory driver repro.
@O5-7 on GitHub · 2026-11-26 12:05 UTC · original
@luckyteagirl Fixed in
9483d436:build_with_gateincrates/xcl/src/shaders.rssoPipelines::make_oneentersOfflineGateandRunningSlotonce around both the cachedCreateComputePipelineStateprobe and any no-blob fallback (without double-acquiring the gate/slot, while still skippingcached.is_none() && over_capearly before entering).offline_gate_serializes_giant_cached_probe_fallbackusing concurrent simulated slow stale-blob fallbacks to verifymax_concurrent == 1across both the probe and cold fallback.Re-verified
cargo test -p xcl --lib shaders::(14 passed, 0 failed) and 60 ssmoke.ps1on9483d436.@Prime1997 on GitHub · 2026-11-26 13:06 UTC · original · reviewed
Good within the reviewed scope; retain for integration. The offline large-DXIL admission logic is worth keeping. The current revision also gates the cached-blob probe; the older finding that this path bypassed admission no longer describes this head.
PR head
9483d4363b9cc6a798902ccebdbeca35de54e4cdintegrated locally with current mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. The detached worktree remains at main with the combined changes staged, tree80596ba379dc6679bb264be3a4cb3da089d936f3; it is an uncommitted integration candidate, not a clean PR-head run. Source patch SHA-2566bfe43cdbc0f84bb42d6cdc7a1efc2f220f42e985890f13f56020f1f33be39da.Targeted result: 4 passed, 0 failed, 0 ignored, 0 skipped. Each exact filter ran in a fresh process:
shaders::offline_gate_tests::offline_gate_serializes_huge_compiles_while_small_compiles_proceedshaders::offline_gate_tests::offline_gate_waits_for_headroom_while_another_compile_is_active_and_avoids_deadlock_when_aloneshaders::offline_gate_tests::offline_gate_runs_giant_compile_alone_even_with_higher_huge_concurrencyshaders::offline_gate_tests::offline_gate_serializes_giant_cached_probe_fallbackBuild:
cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run:<test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work.Not tested: The four tests exercise admission, cached-probe classification and guard cleanup with bounded synthetic inputs. They do not reproduce sustained system commit pressure or measure driver compile memory. No whole suite or retail smoke was run for this batch; this is not merge certification.
AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.