mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 23:38:37 +00:00
After the merge the tree held this branch's older states of files main maintains. Run against main's code, tests/test_acphal_abi.py and 11 of the 15 translator tests that differed failed, and the C++ runtime would have been built from two generations of its sources. So that the merge cannot break what main builds and tests: - runtime/ is main's, file for file (68 files only this branch had are not carried over); - every file under tools/, tests/ and docs/ that both sides have is main's (80 files); - ten translator tests only this branch has, which test rules main's translator does not have, and their fixtures are left out. What main gains: d3d12/ (the Rust D3D12 runtime), its launchers and helpers (Launcher.bat, scripts/play*.ps1, play-linux.sh, port_ctl.py, smooth-motion.ps1, fetch_vkd3d_proton.py, sync_victory.py), mods/example_lua, eleven notes under docs/, seven tools and the tests that pass with main's code, the README's sections and credits, and the "Runtime traps" section of AGENTS.md. Everything left out here is on the branch port/d3d12-nvidia. Checked: compileall; make_game.py --help; check_no_game_data.py over every file this adds to main; the line-ending, docs-encoding, CI-registration and docs tests; each test file that differs from main, on its own. Not run: the whole translator suite, the C++ build, cargo over d3d12/ after the merge (d3d12/ is byte for byte the branch's), CI. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
22 lines
1.2 KiB
Python
22 lines
1.2 KiB
Python
"""How many worker processes one pool can have on this platform.
|
|
|
|
Windows waits on a pool's workers with WaitForMultipleObjects, which takes at most 64 handles. Above 61 workers
|
|
concurrent.futures.ProcessPoolExecutor raises `ValueError: max_workers must be <= 61`, and multiprocessing.Pool
|
|
prints `ValueError: need at most 63 handles` from its result thread and never returns (measured on Windows 11,
|
|
Python 3.12.5: 62 workers were killed after 60 s, 61 finished in 0.8 s). A tool whose --jobs defaults to half the
|
|
CPU count, or is handed make_game.py's, reaches that on a large machine with no option given.
|
|
|
|
A pool is therefore created with process_workers(jobs): the same number everywhere else, 61 at most on Windows.
|
|
Threads have no such limit. tools/world_census.py rejects --jobs above the limit instead (its MAX_JOBS).
|
|
"""
|
|
import os
|
|
|
|
MAX_PROCESS_WORKERS = 61 if os.name == "nt" else None
|
|
|
|
|
|
def process_workers(jobs):
|
|
"""`jobs`, lowered to the most worker processes one pool can have here."""
|
|
if jobs is None:
|
|
return None if MAX_PROCESS_WORKERS is None else min(os.cpu_count() or 1, MAX_PROCESS_WORKERS)
|
|
return jobs if MAX_PROCESS_WORKERS is None else min(jobs, MAX_PROCESS_WORKERS)
|