Repository navigation
Shaders: bound default compile workers by available memory - #572
WebIdentity1 wants to merge 1 commit into
Conversation
Budget one GiB per worker after the existing title or offline reserve, using the smaller of free physical memory and available commit. Preserve explicit XCL_DXC_THREADS overrides and set the offline reserve before choosing the worker count. Part of xcl-dev#542. Native Windows tests: policy 3 passed; old-decision control 1 passed and 2 failed. Workspace 682 passed, 1 pre-existing integer CLAMP failure, 41 ignored, four explicit skips. Retail regression not run; draft only.
|
Independent test (Grimkaaah) – friend's target is an RTX 4060 Ti 8 GB; this PR is the right mitigation for the cold-compile stampede on that class of card (#542 was filed on a 3060 8 GB). Tested
Looks good to undraft once CI/smoke are happy. Explicit |
…hort With the compile thread count bounded by free memory (ivall#572), a machine with ~8 GB of commit free gets two compile threads, and the dedicated compute pool (ivall#533) took half of that: one worker. A single driver build of tens of seconds then held every other compute pipeline behind it, and the per-frame wait budget handed the title stand-ins for all of them. Measured: bounded_compute_wait_shares_per_frame_budget_across_pipelines failed with 8.3 GB of commit free (one compute worker) and passed with XCL_DXC_THREADS=8. The pool now has 2 to 4 workers.
|
Test report from the machine in #542 (i9-14900K, 32 threads, 32 GB), with Tested
What ends the runs now: commit, not physical memory
Not tested
AI use
|
…hort With the compile thread count bounded by free memory (ivall#572), a machine with ~8 GB of commit free gets two compile threads, and the dedicated compute pool (ivall#533) took half of that: one worker. A single driver build of tens of seconds then held every other compute pipeline behind it, and the per-frame wait budget handed the title stand-ins for all of them. Measured: bounded_compute_wait_shares_per_frame_budget_across_pipelines failed with 8.3 GB of commit free (one compute worker) and passed with XCL_DXC_THREADS=8. The pool now has 2 to 4 workers.
…hort With the compile thread count bounded by free memory (xcl-dev#572), a machine with ~8 GB of commit free gets two compile threads, and the dedicated compute pool (xcl-dev#533) took half of that: one worker. A single driver build of tens of seconds then held every other compute pipeline behind it, and the per-frame wait budget handed the title stand-ins for all of them. Measured: bounded_compute_wait_shares_per_frame_budget_across_pipelines failed with 8.3 GB of commit free (one compute worker) and passed with XCL_DXC_THREADS=8. The pool now has 2 to 4 workers.
…hort With the compile thread count bounded by free memory (xcl-dev#572), a machine with ~8 GB of commit free gets two compile threads, and the dedicated compute pool (xcl-dev#533) took half of that: one worker. A single driver build of tens of seconds then held every other compute pipeline behind it, and the per-frame wait budget handed the title stand-ins for all of them. Measured: bounded_compute_wait_shares_per_frame_budget_across_pipelines failed with 8.3 GB of commit free (one compute worker) and passed with XCL_DXC_THREADS=8. The pool now has 2 to 4 workers. (cherry picked from commit 8b9313f)
…hort With the compile thread count bounded by free memory (ivall#572), a machine with ~8 GB of commit free gets two compile threads, and the dedicated compute pool (ivall#533) took half of that: one worker. A single driver build of tens of seconds then held every other compute pipeline behind it, and the per-frame wait budget handed the title stand-ins for all of them. Measured: bounded_compute_wait_shares_per_frame_budget_across_pipelines failed with 8.3 GB of commit free (one compute worker) and passed with XCL_DXC_THREADS=8. The pool now has 2 to 4 workers. (cherry picked from commit 8b9313f)
…hort With the compile thread count bounded by free memory (xcl-dev#572), a machine with ~8 GB of commit free gets two compile threads, and the dedicated compute pool (xcl-dev#533) took half of that: one worker. A single driver build of tens of seconds then held every other compute pipeline behind it, and the per-frame wait budget handed the title stand-ins for all of them. Measured: bounded_compute_wait_shares_per_frame_budget_across_pipelines failed with 8.3 GB of commit free (one compute worker) and passed with XCL_DXC_THREADS=8. The pool now has 2 to 4 workers. (cherry picked from commit 8b9313f)
|
Built and tested the PR head on a Windows 10 machine that has no Shader Model 6.6 and only a GNU toolchain. Every count below is pasted from the run, not written by hand. Machine
Apply / build
Tests
all 16 are Forcing the requirement shows the SM 6.5 cap directly ( What this machine can and cannot verify. The three worker tests pass, and DXC 1.9.2609.5 itself loads and compiles here (those 17 AI use: an agent (DeepSeek Harness, "auto" route - I do not know the underlying model) built the head, ran the tests and pasted the output. |
…hort With the compile thread count bounded by free memory (ivall#572), a machine with ~8 GB of commit free gets two compile threads, and the dedicated compute pool (ivall#533) took half of that: one worker. A single driver build of tens of seconds then held every other compute pipeline behind it, and the per-frame wait budget handed the title stand-ins for all of them. Measured: bounded_compute_wait_shares_per_frame_budget_across_pipelines failed with 8.3 GB of commit free (one compute worker) and passed with XCL_DXC_THREADS=8. The pool now has 2 to 4 workers. (cherry picked from commit 8b9313f)
|
Regression run of Against the limits in CONTRIBUTING.md: 90 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
Limit the default DXC and feeding PSO worker count by available memory. Part of #542: a 32-thread CPU currently starts up to 31 workers regardless of free physical RAM.
November 24 status
Still a draft; no source refresh yet. Main
b7aa9f3now admits up to six wanted compiles under memory pressure (9a272d4). This startup cap can create only one or two DXC/feeding-PSO workers when initial headroom is low, and its cached count does not grow when memory recovers. Before refreshing, that interaction needs a throughput/memory comparison; the existing policy tests do not establish watchdog safety. The admission-slot race is already covered by #1364 / #1417 and is outside this PR. All counts below remain evidence for the original revisions, not current-main integration or gameplay.What is in it
dxc.rs: one worker per GiB remaining after the existing reserve, using the smaller of available physical memory and commit; also keep the CPU-minus-one / 1–64 bounds. ExplicitXCL_DXC_THREADSretains its override. Without a memory reading, default to one worker.shaders.rs: set the offline 2 GiB reserve before the count is cached. Normal title runs retain the 6 GiB reserve. README documents the startup cap.Tested
XCL_DXC_THREADSunset.cargo test --locked -p xcl --lib worker_tests -- --nocapture --test-threads=1: 3 passed / 0 failed / 0 ignored. Restoring the old CPU-only decision while retaining these tests: 1 passed / 2 failed. Covers memory boundaries, CPU limits, offline reserve and overrides.cargo build --locked --workspace: exit 0.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output: 682 passed / 1 failed / 41 ignored. Samegpu_clamp_and_omod_per_instructionfailure as main508a0c7(679/1/41); Recompiler: complete remaining RDNA2 integer CLAMP=1 saturation (#105) #202 addresses it. Interactive desktop session.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64);test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state(no debug layer). Sample inputs unset; system XGameRuntime comparison unavailable.Regression run
Not run: no retail title available. Keeping this draft; the required main/head smoke blocks are missing.
Not tested
Retail loading, memory-pressure performance, release builds or runaway compiler allocations. The count is fixed at first use; future memory changes remain the live gate's responsibility. No gameplay or total-memory reduction claim.
Independent follow-up
AI use
Codex (GPT-6) inspected the code, implemented the patch/tests, ran native Windows validation and prepared this description.