COMPUTE-WORKERS-WIN-VENV: launch Windows compute workers with sys._base_executable #2678
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2678
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/compute-workers-win-venv"
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?
Pull request successfully merged and closed
Claimed in #2570 as
COMPUTE-WORKERS-WIN-VENV.What and why
In
scripts/compute_workers_win.py, Windows worker processes were launched withsys.executable, which inside a Windows virtual environment (.venv) spawns the venv redirector launcher (venvlauncher.exe) instead of the real base Python interpreter, breaking worker creation / handle inheritance. Usinggetattr(sys, "_base_executable", sys.executable) or sys.executablelaunches the underlying Python binary directly while keeping identical behavior outside a venv.Verification (Red -> Green)
Hardware / OS: native Windows 11 Pro (
10.0.26200), Python 3.12.main(40e7fe69d).python -m unittest tests/test_translate_pipeline_compute.py -v— ALL PASS (including the new venv_base_executableregression test).python -I scripts/check_no_game_data.py scripts/compute_workers_win.py tests/test_translate_pipeline_compute.py— PASS.AI-assisted: Antigravity (Gemini 4 Neon)
Independent Windows A/B on
fb163d9a9c6fee18c29d1796e6b5210d253faa3amerged locally into182d0c17462f86d788c2203da6dd524442a76a8d. Native Windows 10 22H2 (build 19045), Ryzen 9 5950X, CPython 3.10.9 and 3.12.1, SPIRV-Tools v2026.4.--jobs 2reproducedWindows compute job limits not in forcein both workers on both Python versions. The run exited 1.tests/test_translate_pipeline_compute.pyfile passed all four Windows cases on both Python versions, including the single-worker/parallel parity, cache reuse, and lock/interruption checks. The Linux-only test was skipped.The two arms differed only in
scripts/compute_workers_win.py. I ran the existing checked-in synthetic inputs and the repository's no-game-data check on both changed files.AI-assisted.
Independent verification on this machine (Windows 11, Python 3.13.14, RTX 4090), including the negative control:
1. It applies.
git merge-tree --write-tree origin/main refs/pull/2678/headis clean, and the single commitfb163d9a9cherry-picks ontomain1d22590b9without a conflict.2. Its tests pass.
3. The new test catches the old behaviour - this is the part I check before believing a fix.
With the PR applied but
scripts/compute_workers_win.pyreverted tomain's version:So
test_windows_venv_workerfails on the old script and passes on the new one. That is a real red->green on Windows, not just a test that agrees with itself.What I did not test: the venv path on Linux/macOS, and the actual worker launch with a real
sys._base_executablein an activated virtual environment -test_windows_venv_workerexercises it with the fixture the PR provides, not with a hand-built venv. Someone on a machine with a venv in use should confirm the end-to-end case; what is proven here is that the code path the test names is the one that changed and that the test catches its absence.Written with an AI assistant.
Merging. Head
fb163d9a9merges cleanly withmain1b0f657f3and does not force a rebase of #2566. Red/green from lixonik (two Python versions) and fiestorra (above), redone on Windows 11, Python 3.14: without the change the venv test fails, with it tests/test_translate_pipeline_compute.py and tests/test_compute_workers_win.py pass (its first run took 151 s, the two after it 8 s; not explained). The job limits are still checked before the worker gets its work. The script is used by scripts/translate_pipeline_compute.py only, not by make_game.py or the runtime; its digest is part of that script's cache recipe, so that script's caches are made again. Approved by the owner. Merged by MoonEyes.AI-assisted (Claude Code).