Repository navigation
xcl run: preparation workers count the commit left in MiB, not bytes - #3085
Conversation
prepare_workers passes host::system_commit(), which is in bytes (commit pages times the page size), to workers_for(cores, free_mb), which divides by 3072 as MiB. The commit bound therefore never applied: the count was always the logical processors less four (at most 32), so 16 threads with 6 GiB of commit left got 12 workers instead of 2. Reported by pickles976 on xcl-dev#2624. The commit figures are now converted to MiB in a new workers_for_commit, which prepare_workers calls; workers_for and its tests are unchanged, and XCL_PREPARE_WORKERS still sets the count directly. The new test passes the figures in bytes; without the conversion it fails (12, expected 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BuVT2rKpD9DAmDGg1zuzbB (cherry picked from commit 231c4f1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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. |
|
Windows run (listed under Not tested): the whole suite passes, the new test fails without the Tested:
So on Windows the bound applies now too. Not tested: a launch or AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch checks and wrote this report. |
|
Ran the new worker-count tests on both Linux/Wine lanes at head
rig2 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 |
main gained 345 commits since 753e8b1, most of them bmjask's stack (xcl-dev#2959), plus xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086 from this branch. Conflicts, per PR: - xcl-dev#2404 + xcl-dev#2633 (split chained ExecuteIndirect): main's xcl-dev#2959 took both over (ed98461, a05fbc4, 8626d5b: IndirectBuild/IndirectChain on a CBV root, one-command slicer, separate cache namespace). Main's side kept in dispatch_chain.rs, pso.rs (slicer, command signature, chain root), bind.rs (ExecuteIndirect path), device_x.rs (signature traits), pso_async.rs (no background whole build, so no build_waited_on), real.rs (ComputeBuild, driver_cache names) and shaders.rs (blob names). Dropped with them: slab_count, record_slicer, abi_signature_id names, the direct root-CBV constant blocks, list_x::predicated, the split.rs/runner.rs ExecuteIndirect test and the list_x chain-scratch test. Not in main: xcl-dev#2404 ran the pieces before any whole form was built; main runs the whole form (built on the title's thread) until the indirect set is ready. - xcl-dev#2707 (allocator reclaim): main has it (31930d8, 057f463, 8e7b566). alloc_pool.rs is main's, with xcl-dev#867's changes on top; bind.rs takes main's native_backing; xcl-dev#2707's tests and bind::push_uma_for_test go. - xcl-dev#867 + xcl-dev#2477 (Wine vtables and fences), adapted to main's new code: real.rs keeps the in-place patching, UnadoptGuard and FenceProxy beside main's native_queue_* helpers; guards in cl_reset, bind_pipeline_exact, clear_pipeline_exact, reset_pc_allocator, the title ExecuteCommandLists closure and native_queue_execute; Signal/Wait unwrap the title's fence (also in native_queue_signal/wait); list_x guards in reset_reserved_segment and KickoffX's submit closures; create_raw_fence for main's new internal fences in alloc_pool.rs (SubmissionGate), title_textures.rs, present.rs, vram.rs, sparse.rs, cpu_writes.rs; tests as xcl-dev#2477 had them; runner.rs is main's plus submit_list. - xcl-dev#1803 (heap addresses): kept, carried into main's PreparedSplit and PreparedAbiState (prepared_abi_io takes the heaps). - xcl-dev#1368 (NodeMask 0): kept in compute_container, before main's per-node blob names, so names and pipeline use node 0. - xcl-dev#1860, xcl-dev#2082 (cfg.rs, module/opt.rs): cfg.rs is 1567f72's version (xcl-dev#1860 on main's Succs); opt.rs is that plus xcl-dev#2082's arm and test. - xcl-dev#2229 (rodata): kept through main's kernel.rs entry points; translate_entry_rodata loses wave32_only as main dropped per-GPU tables (3cde0cc); pso.rs and coverage.rs call it with main's options (no_remap, split for graphics); recomp Options keeps rodata and no_remap. - xcl-dev#1975: kept in emit.rs and lower_valu.rs; its mesh barrier guard and its test dropped, main's wider guard (2ca9127) covers it; the now-unused lower::has_non_uniform_barrier goes. - xcl-dev#2070 (64 MB stacks): pso_async::WORKER_STACK on main's worker, helper and preload threads; shaders.rs's piece threads on worker_thread. - xcl-dev#2551 (whole forms prebuilt): split_whole_roots(false) is DirectChain, so the precompile builds every split program's whole form; main built it only for programs an earlier run used through ExecuteIndirect. - xcl-dev#688 (dxc.rs imports), xcl-dev#2762 (host.rs log line), xcl-dev#3090 (list_x tests), arch/window-title-commit (present.rs with_commit on main's compiling_text), README.md: both sides. - list_x.rs: main dropped title_textures::list_reset; main's side. - sparse.rs, vram.rs: main's quarantine_tiles_for and per-device retire state, with create_raw_fence. - xcl-dev#3090, xcl-dev#3092 tests: runner::device and Uma::block_len added from nvidia-dev (5 and 12 lines) so the lib tests compile. - xcl-dev#751: its commit is already in main (b84e037, via xcl-dev#2844); it leaves the README table with xcl-dev#2404, xcl-dev#2633, xcl-dev#2707, xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 xcl run: preparation workers count the commit left in MiB, not bytes #3085 and Shaders: share verified compute blobs across preparation worker counts #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