D3D12.X: big compiles of bound programs take turns under a bind budget #1686
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!1686
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1686"
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?
@CalvyPZ on GitHub · 2026-11-24 19:16 UTC · original
CalvyPZ:bound-compute-compiles→main· +142 −1 · 2 files · 1 commits · openWith
XCL_PSO_WAIT_MSset, a bind waits for a compute pipeline within a budget and then goes on with the stand-in. Its build stayed "wanted", and a wanted build of a big program (256 KB of DXIL or more) takes neither the one slot for big driver compiles nor waits for 3 GB of free commit. That rule is for a bind that waits until the pipeline is built; with a budget nothing holds the title, and the builds piled up in the driver. Under a budget a big build now always takes a turn. WithoutXCL_PSO_WAIT_MSnothing changes. Part of #1269 (claimed there: https://github.com/ivall/xcl/issues/1269#issuecomment-7136933575).What is in it
crates/xcl/src/hle/d3d12x/real.rs:bound_compile_turn– under a bind budget, a big build nobody has bound stays in the one-at-a-time queue (BIG_COMPILES); one the title has bound takes a slot of a second queue and waits for the commit like the others.bound_compiles_at_oncesizes that queue from the machine: half the logical processors, one per 8 GB of memory, at least one (4 on 16 threads / 32 GB). Testsbound_builds_go_several_at_once_and_wait_for_the_commit,bound_builds_at_once_follow_the_threads_and_the_memory.crates/xcl/src/hle/d3d12x/pso_async.rs:binds_have_a_budgetandbuild_is_bound(a bind waits for the build, or went on without it). Testa_build_hears_that_its_pipeline_is_bound.Tested
NVIDIA GeForce RTX 5070 Ti 16 GB (32-lane waves), driver 32.0.16.1088; Ryzen 7 5800X (16 threads), 32 GB RAM; Windows 11 Pro 26300; rustc 1.96.1
stable-x86_64-pc-windows-msvc; DXC 1.9.2609.5; tests in debug, title runs in release.cargo build --workspace+cargo test --workspace -- --test-threads=4on6bf360e: 861 passed, 0 failed, 42 ignored.SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Retail title, world start,
XCL_PSO_WAIT_MS=100,XCL_PSO_DISK_CACHE=0, a new exe name per run (cold driver cache), scripted A presses. These runs were onmain930e8b4with temporary log lines around the driver's compile of big programs (not in this PR), before the rebase:930e8b4The "with this change" column is a run of an earlier form of the change that put every bound build back into the one-at-a-time queue. A run of the form in this PR (with #1273 applied locally on top) also had one big compile in the driver at a time and none begun under 3 GB free; its bound builds were waiting for the commit, which was under 3 GB from 90 s on (0.6 GB at 122 s) from the world load alone.
Regression run
scripts/smoke.ps1 -Game <folder> -Seconds 60, release, mainc160d86and this PR's head6bf360e:Not tested
XCL_PSO_WAIT_MSand without input, so the title stays in its front end.threads / 2and one per 8 GB are the right sizes.6bf360ewithXCL_PSO_WAIT_MS(the measurements above are on930e8b4).AI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-24 21:47 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@not-rex on GitHub · 2026-11-24 23:20 UTC · original
Reading this against
main20cf1302:resolve_within(pso_async.rs:588) marks a late pipeline wanted and nothing clears it, and this PR stops that from bypassing the big-compile turn and the commit wait inreal.rs. Two other places still treat a late, skipped build as wanted, in case you want them in scope:dxc.rs:427,wait_for_memory: throughwanted_here(), up to six wanted compiles skip the 6 GB + 1 GB-per-compile reserve, so late DXC compiles under a bind budget still run past it.pso_async.rs:72-104: a preload worker building a wanted pipeline is raised from LOWEST to NORMAL priority, so late builds keep competing with the title's threads after the bind has given up on them.Context from an RTX 3080 world run with
XCL_PSO_WAIT_MS=50: all 23xcl-psoworkers were inside the driver compiler on one heap lock (the pool is cores - 1), and in another run commit jumped from ~31 GB to 55 GB at ~690 s, which fits unthrottled late builds. I haven't run this PR yet.AI use: Claude Code (Claude Opus 5.5) read the code and wrote this note.
@JJAutoCompare on GitHub · 2026-11-25 04:38 UTC · original
XCL PR #1686 — Windows / Intel Arc A770 verification
Head
6bf360e6e8089b52d2df9662b81d64f0522fd5c5, detached and clean before and after testing. The diff changescrates/xcl/src/hle/d3d12x/pso_async.rsandcrates/xcl/src/hle/d3d12x/real.rs.STOR-WINLAB ran Windows 11 Enterprise Evaluation x64 (build 26200.9974) on an AMD Ryzen 7 3800X and Intel Arc A770 (driver 32.0.101.9175).
dxc.exe --versionreported 1.9.2609.5. Rust was 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), with unoptimized profiles and debug info disabled.Tested
cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the Arc mutex. The latter built 19 test executables.cargo test -p xcl --lib a_build_hears_that_its_pipeline_is_boundpassed 1 test. It checked that a worker sees no bind initially and sees the pipeline as bound both during the wait and after the 300 ms budget returns the stand-in.cargo test -p xcl --lib bound_builds_passed 2 tests. They checked that bound builds wait for a slot and free commit, that a queued background build moves to the bound slots when bound, and that CPU threads and memory cap concurrency with a minimum of one. Both focused commands were CPU-only withXCL_ADAPTER=NONE_CPU_ONLY, with 0 failures, 0 ignored and 0 skip lines.cargo test --workspace --no-fail-fast -- --test-threads=4ran once insideInvoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1. Cargo exited 101. Summing all 20 result lines (19 test executables and one doc-test target) gave 843 passed, 18 failed, 42 ignored. All three focused tests also passed in this run.Workspace failures and skips
The library had 17 failures. Thirteen reported
CreateComputePipelineStateerror 0x80070057. Four reported GPU result mismatches (fused arithmetic, mip sampling, packed 16-bit ALU and wave reductions). The test-title e2e failed its dynamic depth-bias pixel check. Six lines began withSKIPPED: two for wave64, two for missing D3D12 debug-layer support, one for tiled tier < 2 and one for unavailable heap windows. These skips provide no coverage.Not tested
No matched main run, retail-title smoke run, or measurement of driver compile concurrency under retail load. Optional game sample variables were unset. Other GPU vendors were outside this run.
AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1686-suite.logand published.@justrhoto on GitHub · 2026-11-25 05:41 UTC · original
Test report: #1686 rebased onto
main6020a33, RTX 4070 Ti SUPER, retail title withXCL_PSO_WAIT_MS=500This is a local rebase, not the PR head.
6bf360edoes not cherry-pick cleanly onto6020a33:mainhas moved the compute gate intodriver_compile_identified, sizes the commit wait per program (big_compile_headroom) and has a separate lane for compiles of 4 MiB and up (GIANT_COMPILES). How I resolved it:binds_have_a_budgetbranch now sits indriver_compile_identified(compute only) instead of at the compute call site, which ismain's as it is;bound_compile_turngets|| big_compile_commit_free(big_compile_headroom(bytes)), and the PR's no-argumentbig_compile_commit_freeis dropped;GIANT_COMPILESfor both lanes under a budget, so it stays one at a time and is never let through without a slot.#751 was applied on the same tree (it applied cleanly and only touches
title_textures.rs). Tested commit: localaa1f25d=6020a33+ #751 + this PR as resolved above.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4onaa1f25d: 1159 passed, 0 failed, 46 ignored. The PR's three new tests pass.SKIPPED(26): 20 no wave64; 3 f16 / f32 cases the recompiler refuses (#1426 semantics);ir_text_assembles_signs_and_runs(no dxil.dll);heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows);pso_measurement_compiles_an_exact_synthetic_record(needs Developer Mode).XCL_PSO_WAIT_MS=500, nothing else set. The driver blob cache was warm from earlier runs, so most big programs came from disk. One run, 475 s:big compute programs the title has bound are built 6 at once(12 threads, 64 GB:min(6, 8)).gated, with up to 5 in the driver at once. A 10.9 MB program (95cc13288a27a96e) ran on the giant lane from 17 s and had not finished at 475 s.wanted at once (no slot)lines are cached graphics pipelines (2 ms each), which this path does not gate.game_scarlett_master.exe+0x8ac62c, write at0x376d0, on the main thread inside window-message dispatch (USER32frames). It is not in code this PR changes, and I don't know its cause.XCL_PSO_WAIT_MS=500on a build without this PR (aroundcbc296a; I can't confirm the exact commit, and its cache was colder) had 10 or more big compiles in the driver at once, allwanted at once (no slot). 260–440 KB programs took 35–70 s each there.Regression run
scripts/smoke.ps1.Not tested
6bf360eitself.XCL_PSO_DISK_CACHE=0). Only 7 cold big compiles reached the new queue in this run.AI use
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.Merge
Merge the changes and update on Forgejo.