Repository navigation
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
|
Windows verification of exact PR head
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 |
|
Independent RTX 4060 (8 GB) / Windows 11 verification of PR #2705 at Setup
Targeted release unit tests (
|
|
A measurement for the 3 GB-per-worker figure in
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 AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this comment. |
|
macOS (CrossOver + D3DMetal) report for this change: here it does change the count, 14 workers before, 6 or 7 after. I hit the same bug while porting #2624's workers to my Mac branch and made the same change ( Setup: M5 Pro, 18 logical processors, 48 GB RAM + 6 GB swap, macOS 27.2.1, CrossOver 26.3 + D3DMetal;
Not tested: this PR's exact head commit, Windows, a retail title. AI use: Claude Code with Claude Opus 5.5 ran the tests on my machine and drafted this comment. I checked it before posting. |
prepare_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 (comment); 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 Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #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 Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #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