xcl run: preparation workers count the commit left in MiB, not bytes #3085
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3085"
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 Royalflamejlh on 2026-11-28T02:42:33Z.
Port of #2705 to
main: the same commit, cherry-picked unchanged (pr1sm-dev's, merged intonvidia-devon 2026-11-28).mainhas the sameprepare_workersand the same bug; when #2572 bringsnvidia-devintomain, this is the same change.prepare_workerspasseshost::system_commit(), which is in bytes (commit pages times the page size), toworkers_for(cores, free_mb), which divides by 3072 as MiB. So the memory bound never applies and the count is always the logical processors less four. On a 32-thread machine under Wine that is 28 workers: the launch pass ofmain753e8b1a(on our Linux branch, which merges it) went over 34 GB and was stopped by our run harness at 131 s, before the title started (1 run). The same pass withXCL_PREPARE_WORKERS=8stayed at about 22 GB.What is in it
crates/xcl/src/shaders.rs:workers_for_commitconverts the commit figures to MiB beforeworkers_for; a test passes them in bytes (12 workers without the conversion, 2 with it).Tested
x86_64-pc-windows-gnu:cargo test -p xcl --lib workers -- --test-threads=4: 6 passed, 0 failed, 0 ignored (1404 filtered out), among thempreparation_workers_take_the_commit_left_in_byteslinux/stackwith #3085 and #3086 merged (1 launch): the pass picked 25 workers here, against 28 without it. The bound now applies, but under Wine the commit limit includes swap (121,298 MB with 55 GB of swap on this 62 GB machine), so 25 still does not fit; we stopped it and setXCL_PREPARE_WORKERS=8.Regression run
scripts/smoke.ps1needs Windows (see Not tested).Not tested
scripts/smoke.ps1onmainand on this head.AI use
Imported from ivall/xcl. Originally posted by ZekkJJ on 2026-11-28T03:00:40Z.
The unit conversion fix makes sense and restores the intended memory-based worker limit.
One remaining concern is that available system commit can substantially exceed available physical RAM, particularly on systems with large pagefiles or swap. The reported 25-worker selection after the fix demonstrates that limitation.
Physical-memory-aware worker admission would be worth investigating separately, but I wouldn’t consider it a blocker for this PR.
Good catch.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-28T03:08:10Z.
Windows run (listed under Not tested): the whole suite passes, the new test fails without the
>> 20, and on this machine the pass now picks 3 workers instead of 12.Tested:
651867a(its base is currentmain753e8b1, so head = merged). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X (16 threads), 16 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.cargo test --workspace --no-fail-fast -- --test-threads=4SKIPPEDlines (no wave64, refused per-lane f16/f32 forms,heap_window_out_of_memory_falls_back_to_the_switch_form)preparation_workers_take_the_commit_left_in_bytesalone>> 20removed (scratch)left: 12, right: 2host::system_commit()on this machine, both formulasmain's formula gives 12 workers, this PR's gives 3So on Windows the bound applies now too.
Not tested: a launch or
scripts/smoke.ps1with this change (no title here), a release build.AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch checks and wrote this report.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-28T03:21:05Z.
Ran the new worker-count tests on both Linux/Wine lanes at head
651867a4(onlyshaders.rschanges):cargo test -p xcl --lib -- preparation_workers: 2 passed / 0 failed, x3 runsrig2 is the class of machine the MiB-vs-bytes mix-up would hit hardest (commit left reads as enormous, worker count goes absurd), and the corrected computation holds there too.
Relevant to #3077 (precompile never finishing on 32 GB): that OOM at 23,000 programs is a per-program cap question, separate from this units fix; counts from the fix itself are green on both lanes.
Tested: the 2
preparation_workerstests, x3 per lane at651867a4.Not tested: a full 26k-program precompile run end to end, native Windows, full suite on this head.
AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.