xcl run: preparation workers count the commit left in MiB, not bytes #2705
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!2705
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2705"
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?
@pr1sm-dev on GitHub · 2026-11-26 07:22 UTC · original
pr1sm-dev:prep-workers-mib→nvidia-dev· +18 −1 · 1 files · 1 commits · openprepare_workerspasseshost::system_commit(), which is in bytes (commit pages times the page size,host.rs:11-22), toworkers_for(cores, free_mb), which divides by 3072 as MiB (shaders.rs). So the 3 GB-per-worker bound never applied, and the count was always the logical processors less four (at most 32): 16 threads with 6 GiB of commit left got 12 workers instead of 2. Reported by @pickles976 in #2624; introduced with the worker processes inb09acbc(#2624).The commit figures are now converted to MiB in a new
workers_for_commit, whichprepare_workerscalls.workers_forand its tests are unchanged;XCL_PREPARE_WORKERSstill sets the count directly.What is in it
crates/xcl/src/shaders.rs:workers_for_commit(cores, used, limit)(bytes → MiB, thenworkers_for), called byprepare_workers; testpreparation_workers_take_the_commit_left_in_byteswith the figures in bytes.Tested
30b0eb9bwith #257's patch; Rust 1.100.0,x86_64-pc-windows-gnu, release. Not Windows.cargo test -p xcl --lib shaders::tests(test binary under Wine): 12 passed, 0 failed, 0 ignored. With the conversion taken out, the new test fails (left: 12, right: 2).K32GetPerformanceInfogives under Wine here (a small probe calling it assystem_commitdoes): limit 64,209 MiB (the RAM, no swap), 57,580 MiB left, 16 threads: 12 workers both before and after this change. So on this machine the processor bound decides and the change makes no difference; it does on hosts with less than about 3 GB of commit left per worker.Regression run
scripts/linux/smoke.shof #257 (the Linux port ofscripts/smoke.ps1, closed, not merged) under Wine, not withsmoke.ps1. A retail title, 120 s,VKD3D_CONFIG=ignore_shared_fence,no_descriptor_heapon all, no input. Thenvidia-devand PR runs hadXCL_PREPARE=0, so they do not reach the changed code (see Not tested).main (made last night for another PR, same setup):
nvidia-devaf2cecc(the base):PR:
af2ceccwith the same settings ended at 10 s: an access in Wine'sheap_free_blockthrough a corrupted block header on a title thread building compute pipelines (reported as0xc00000fd). It did not happen in the next two runs (the base and PR blocks above). The preparation code was off in that run; I am looking into it separately.Not tested
XCL_PREPAREon): the runs above leave it out, and on this machine the worker count is the same before and after.shaders::testsfilter was run.peak commitis not reported under Wine (0 MB on all).AI use
🤖 Generated with Claude Code
@luckyteagirl on GitHub · 2026-11-26 07:46 UTC · original
Windows verification of exact PR head
231c4f1d06b567d5fece22ab659d1b0ecd21c7f8on itsnvidia-devparentaf2cecc40886a8682ecf3267f5328c6dc4b66ad7(Windows 11 Home build 26200, Ryzen 9 5980HX, RX 6800M driver30.0.13002.13003, Rust 1.99.0 MSVC):cargo test --locked -p xcl --lib shaders::tests::preparation_workers_take_the_commit_left_in_bytes -j 1 -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed/ignored, 1,648 filtered. This is CPU worker-count arithmetic, not a GPU exercise.cargo test --locked -p xcl --lib shaders::tests -j 1 -- --test-threads=1 --nocapture, withXCL_ADAPTER=6800M: 12 harness passes, 0 failed/ignored, 1,637 filtered. Two of those passes explicitly skipped their intended work: the driver-cache-control case needs Windows Developer Mode, and the retail-pack sample had noXCL_SAMPLE_RPF. Thus 10 tests exercised their bodies.cargo build --locked --release -p xcl -j 1: passed; executable SHA-256C88C0292136C827923389A1D8E10BE8AE7B5887D0E87A4A6F41B104A969FB2FC.I tried a guarded preparation-on title launch with isolated data/DXIL caches. I stopped it after about 30 seconds, at 292 of 26,503 shader records translated, before it reached the changed worker-spawn stage or title frames. It is not a completed smoke result. I did not build/run the
nvidia-devparent, run the full workspace suite, or measure the real worker count under low available commit. AI-assisted test report with Codex.@Decodere on GitHub · 2026-11-26 09:05 UTC · original
Independent RTX 4060 (8 GB) / Windows 11 verification of PR #2705 at
231c4f1d06b567d5fece22ab659d1b0ecd21c7f8(exact parentorigin/nvidia-devaf2cecc40886a8682ecf3267f5328c6dc4b66ad7). Targeted test verification only; not a full source review.Setup
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5, release builds, quiet machineTargeted release unit tests (
231c4f1d)cargo test --release -p xcl --lib shaders::tests::preparation_workers_take_the_commit_left_in_bytes -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit0).cargo test --release -p xcl --lib shaders::tests:: -- --test-threads=4 --nocapture: 12 passed, 0 failed, 0 ignored (0.40 s, exit0). Note:shaders::tests::pso_measurement_compiles_an_exact_synthetic_recordprinted a pre-existing host-gatedSKIPPED(cannot disable the driver cache (Windows Developer Mode is required),0x887A002D) and returnedok; the remaining 11shaders::tests::cases executed in full, including bothpreparation_workers_take_the_commit_left_in_bytesandpreparation_workers_leave_two_processors_and_follow_the_commit_left.cargo test --release -p xcl --lib host:: -- --test-threads=4 --nocapture: 2 passed, 0 failed, 0 ignored (0.00 s, exit0), confirminghost::tests::the_system_commit_is_known_and_under_its_limitandhost::tests::low_commit_is_logged_under_the_mark_and_at_each_halvingpass on this Windows 11 host.Observations
limit.saturating_sub(used)from bytes to MiB (>> 20) insideworkers_for_commitcompiles cleanly in release onorigin/nvidia-dev(af2cecc4) and passes the new byte-scale worker-budget unit test (6 GiBfree on 16 threads ->2workers,64 GiB->12, unknown(0, 0)->1, over-limit(20 GiB, 16 GiB)->1) alongside all othershaders::tests::andhost::tests::checks.Limits of coverage
xcl runpreparation pass under artificial low-commit pressure was run on this 32 GB RAM (~98 GB commit limit) host, and no 60 s runtime smoke was run for this preparation-only fix.231c4f1d(only targetedshaders::tests::andhost::release tests).shaders::tests::pso_measurement_compiles_an_exact_synthetic_recordskipped on this host because Windows Developer Mode is disabled (0x887A002D).AI use
Ran the targeted release unit tests with assistance from Google Antigravity (Gemini 4 Neon); all test counts and exit codes were taken directly from
cargo testoutput.@pr1sm-dev on GitHub · 2026-11-26 09:54 UTC · original
A measurement for the 3 GB-per-worker figure in
workers_for(not part of this PR's change): on this machine a preparation worker held 6.7–10.9 GB while building the large compute pipelines.nvidia-devaf2cecc+ #684, Linux (Wine 11.22, vkd3d-proton30b0eb9b), RTX 3070 8 GB, NVIDIA 595.91.07, 16 threads, 62 GB RAM; HLSL path, preparation of the shaders earlier runs used (used-shaders.txt1,528,used-pipelines.txt2,025), each run inside a 48 GiB memory cgroup.XCL_PREPARE_WORKERS=6: the cgroup went from 9.5 GB just before the compute-pipeline workers started to a 48.0 GB peak, near its cap, in about 5 minutes. My memory guard ended the run with 4.9 GB of RAM left, before the title started.XCL_PREPARE_WORKERS=3: each worker was compiling one large compute pipeline (100 % of one core), at a resident size of 10.9, 6.7 and 6.7 GB; the host process was 1.1 GB, the cgroup 27.3 GB.Unset, the count here would be 12 with or without this PR (57,580 MB of commit left under Wine, so the processor bound decides). At these sizes 12 workers would need about 80–130 GB. Not measured on Windows, where the driver's memory per compile may differ, or with
XCL_DIRECT_DXIL=1, which makes these programs much smaller.AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this comment.
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.