rdna2spirv: start a tool again when a Windows job refuses it with ERROR_NOT_ENOUGH_QUOTA (COMPUTE-WORKER-SPAWN-QUOTA) #2367

Merged
budanga merged 4 commits from upstream-pr/2367 into main 2026-12-01 15:20:23 +00:00
budanga commented 2026-11-26 16:05:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by budanga on 2026-11-26T16:05:26Z.


Claimed in the coordination issue as: COMPUTE-WORKER-SPAWN-QUOTA (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7196128221)

What and why

scripts/translate_pipeline_compute.py --jobs N on native Windows fails now and then with

OSError: [WinError 1816] Not enough quota is available to process this command
RuntimeError: Windows translation worker failed: [1, None]

and tests/test_translate_pipeline_compute.py (WorkerParity) fails the same way.

Cause: each Windows worker runs in a job that allows two active processes, itself and one tool (TWO_ACTIVE in scripts/compute_workers_win.py). The worker runs spirv-as, then spirv-opt or spirv-val, one after another through _run_spirv_tool in tools/rdna2spirv.py. subprocess.run returns once the previous tool has exited, but the job can still count that process for a moment, so CreateProcess refuses the next tool with ERROR_NOT_ENOUGH_QUOTA (1816).

Measured with a minimal script that makes the job with compute_workers_win.job(mib, True), puts a Python child in it and has the child start a short tool back to back (Windows 11 26300, Python 3.14.10, the machine busy with other work):

spawns refused with 1816
spirv-val --version, in the job 3 x 300 6, 6, 8
cmd /c rem, in the job 3 x 300 23, 28, 15
spirv-val --version, no job 2 x 300 0, 0

Change:

  • _run_spirv_tool starts a tool again when CreateProcess refuses it with winerror 1816, with a doubling delay from 5 ms up to 100 ms, for at most SPAWN_RETRY_SECONDS (10 s); then the error is raised as before, with a note saying how many times the tool was refused and for how long. The refused tool never started, so starting it again repeats nothing. It is the backoff tools/replace_retry.py uses for renames.
  • 10 s is measured: with every hardware thread busy at the workers' priority, the longest run of refusals was 3.76 s (see the review reply for the table).
  • Every other error, and the existing WinError 2 naming, is unchanged.
  • The job's limit of two is left as it is.

New test, tests/test_rdna2spirv_spawn_quota.py (standard library):

  • four unit tests with a faked 1816: refusals are started again with the same arguments; a refusal that lasts is raised once the time is up; other errors are not retried; a missing tool still names itself;
  • one Windows-only test that starts 150 cmd /c rem through _run_spirv_tool inside a job made by compute_workers_win.job(), as the worker does.

On main the new file fails (2 failures, 1 error, including the job test with WinError 1816); with the change it passes.

Tested

On fbf100b1b, Windows 11 Home 26300.9974, Python 3.14.10, SPIRV-Tools v2026.4 (Vulkan SDK 1.4.363.0), with the machine busy translating shaders in the background, as in the table:

  • python -I tests/test_translate_pipeline_compute.py, 12 runs each: main 3 passed, 9 failed (all WinError 1816); this branch 12 passed.
  • python -I tests/test_rdna2spirv_spawn_quota.py: fails on main; passes 7 of 7 runs here.
  • python -m compileall -q make_game.py tools tests: clean.
  • The 56 standard-library test files that use rdna2spirv: all pass. (test_make_game_argparse.py failed once under the load and passed 3 of 3 reruns, on main as well.)
  • python -I scripts/run_semantic_tests.py tests/semantic: 500 files, 6365 tests, 0 files failed.
  • python -I scripts/check_no_game_data.py on both files: passes.

GPUs tested: n/a (no GPU involved)

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator rule; this changes how the tools are started)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5513339429 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367). Originally posted by [budanga](https://github.com/budanga) on 2026-11-26T16:05:26Z. --- Claimed in the coordination issue as: COMPUTE-WORKER-SPAWN-QUOTA (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7196128221) ### What and why `scripts/translate_pipeline_compute.py --jobs N` on native Windows fails now and then with ``` OSError: [WinError 1816] Not enough quota is available to process this command RuntimeError: Windows translation worker failed: [1, None] ``` and `tests/test_translate_pipeline_compute.py` (`WorkerParity`) fails the same way. Cause: each Windows worker runs in a job that allows two active processes, itself and one tool (`TWO_ACTIVE` in `scripts/compute_workers_win.py`). The worker runs spirv-as, then spirv-opt or spirv-val, one after another through `_run_spirv_tool` in `tools/rdna2spirv.py`. `subprocess.run` returns once the previous tool has exited, but the job can still count that process for a moment, so `CreateProcess` refuses the next tool with ERROR_NOT_ENOUGH_QUOTA (1816). Measured with a minimal script that makes the job with `compute_workers_win.job(mib, True)`, puts a Python child in it and has the child start a short tool back to back (Windows 11 26300, Python 3.14.10, the machine busy with other work): | | spawns | refused with 1816 | |---|---:|---:| | `spirv-val --version`, in the job | 3 x 300 | 6, 6, 8 | | `cmd /c rem`, in the job | 3 x 300 | 23, 28, 15 | | `spirv-val --version`, no job | 2 x 300 | 0, 0 | Change: - `_run_spirv_tool` starts a tool again when `CreateProcess` refuses it with winerror 1816, with a doubling delay from 5 ms up to 100 ms, for at most `SPAWN_RETRY_SECONDS` (10 s); then the error is raised as before, with a note saying how many times the tool was refused and for how long. The refused tool never started, so starting it again repeats nothing. It is the backoff `tools/replace_retry.py` uses for renames. - 10 s is measured: with every hardware thread busy at the workers' priority, the longest run of refusals was 3.76 s (see the review reply for the table). - Every other error, and the existing WinError 2 naming, is unchanged. - The job's limit of two is left as it is. New test, `tests/test_rdna2spirv_spawn_quota.py` (standard library): - four unit tests with a faked 1816: refusals are started again with the same arguments; a refusal that lasts is raised once the time is up; other errors are not retried; a missing tool still names itself; - one Windows-only test that starts 150 `cmd /c rem` through `_run_spirv_tool` inside a job made by `compute_workers_win.job()`, as the worker does. On `main` the new file fails (2 failures, 1 error, including the job test with WinError 1816); with the change it passes. ### Tested On `fbf100b1b`, Windows 11 Home 26300.9974, Python 3.14.10, SPIRV-Tools v2026.4 (Vulkan SDK 1.4.363.0), with the machine busy translating shaders in the background, as in the table: - `python -I tests/test_translate_pipeline_compute.py`, 12 runs each: `main` 3 passed, 9 failed (all WinError 1816); this branch 12 passed. - `python -I tests/test_rdna2spirv_spawn_quota.py`: fails on `main`; passes 7 of 7 runs here. - `python -m compileall -q make_game.py tools tests`: clean. - The 56 standard-library test files that use `rdna2spirv`: all pass. (`test_make_game_argparse.py` failed once under the load and passed 3 of 3 reruns, on `main` as well.) - `python -I scripts/run_semantic_tests.py tests/semantic`: 500 files, 6365 tests, 0 files failed. - `python -I scripts/check_no_game_data.py` on both files: passes. GPUs tested: n/a (no GPU involved) AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule; this changes how the tools are started) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lixonik commented 2026-11-26 18:02:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T18:02:06Z.

Review: COMMENTED


Windows 11: all 5 quota tests passed, including the native restricted worker's back-to-back tools, bounded retries and unrelated OSError handling. No findings from these checks.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6078731021 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#pullrequestreview-6078731021). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-26T18:02:06Z. **Review:** COMMENTED --- Windows 11: all 5 quota tests passed, including the native restricted worker's back-to-back tools, bounded retries and unrelated OSError handling. No findings from these checks. AI-assisted.
wavehs commented 2026-11-26 18:03:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-26T18:03:26Z.

Review: COMMENTED


macOS arm64 check of #2367 (COMPUTE-WORKER-SPAWN-QUOTA). The behaviour is Windows-only, so what runs here is the retry control flow and the rest of the tree; I say below what this machine cannot prove.

Tested head 80930f0d1 merged onto main bd6ba97ab as merge 9661baf6b (clean merge). main has moved two commits since (bdbc7e923, the precompile skip-list work); neither touches tools/rdna2spirv.py or tests/.

Environment: Apple M3 Pro, arm64 (subgroups 4..32), macOS 27.2.1, CPython 3.15.2, Apple clang 21.0.0, SPIRV-Tools v2026.4, llvm-mc 23.1.5, MoltenVK 1.4.0; KosmicKrisp and lavapipe = Mesa 26.3.0.

The new test bites

  • At the head: python -I tests/test_rdna2spirv_spawn_quota.py -> Ran 5 tests ... OK (skipped=1). The skip is the nt-only job-object test.
  • Negative control (new test file kept, tools/rdna2spirv.py put back to main's version): FAILED (failures=1, errors=1, skipped=1) - ERROR test_quota_refusals_are_started_again (no SPAWN_RETRY_SECONDS), FAIL test_a_refusal_that_lasts_is_raised_once_the_time_is_up. So the two behaviour tests are not vacuous.
  • What this run cannot show: the OS half. Off Windows OSError has no .winerror, so the fake in win_error() is the only 1816 the code ever sees here, and the 150-spawn job test is skipped. I did not run it.

No regressions

  • Semantic suite: 500 files / 6,367 tests / 0 files failed at main bd6ba97ab, and the same at 9661baf6b. Delta 0. (The new file lives in tests/, not tests/semantic/, so the suite does not count it; it was run on its own above.)
  • GPU fixtures (268): MoltenVK 195 PASS / 3 FAIL / 70 SKIP at both main and the merge; KosmicKrisp 190 / 5 / 73 at both. A line diff of the PASS/FAIL/SKIP output differs only in the per-run temp directory quoted in SKIP reasons. The failures are the pre-existing ones at main (MV: cs_fma_fused, cs_imgatomic_ext, ps_ssharp; KK: cs_bvh, cs_bvh32, cs_imgatomic_ext, ps_cndmask_sign_mods, ps_valu16_mad_sel).

Static

  • _run_spirv_tool is the only subprocess.run in tools/rdna2spirv.py (line 19949 at the head), and spirv-as, spirv-opt and spirv-val all go through it, so the shard path is covered. Nothing else in scripts/translate_pipeline_compute.py starts a process; the worker imports the translator.
  • The limit being worked around is info.basic.processes = (2 if worker else 0) in scripts/compute_workers_win.py (job()/verify()), and only CreateProcess can produce 1816 here. A refused CreateProcess leaves no child behind, so re-running does not repeat work, and FileNotFoundError is still caught before the generic OSError.
  • check_no_game_data.py on both changed files: clean. compileall: clean.

Findings (none blocks)

  1. tools/rdna2spirv.py:19941-19958: when the budget runs out the original OSError is re-raised unchanged, so the traceback is the same [WinError 1816] a first refusal gives. Nothing says ~28 starts were attempted over 2 s; on a loaded host the user has no clue the retry ran out rather than never existing. An exc.add_note(...) (3.11+) with the attempt count and elapsed time would cost nothing.
  2. SPAWN_RETRY_SECONDS = 2.0 is a guess at how long the job counts a tool that has exited. The PR measures refusal rates (5-9%), not the longest refusal streak, and the Windows test shows 150 back-to-back starts passing on one host. If a slower machine holds the slot longer than 2 s, the same failure returns with no way to raise the budget. Measuring the lag (loop until 1,000 starts pass and record the longest run of refusals) or taking the seconds from the environment would make the number defensible.
  3. Minor: this is the second bounded doubling retry in tools/ (tools/replace_retry.py has one with 5 s); keeping them separate is fine, but a line saying why it is not shared would help the next reader.

The cause in the description matches the code: the job counts the worker plus one tool, the exited tool can be counted for a moment, and 1816 is CreateProcess refusing before the child exists.

No game files. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6078742576 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#pullrequestreview-6078742576). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-26T18:03:26Z. **Review:** COMMENTED --- **macOS arm64 check of #2367** (COMPUTE-WORKER-SPAWN-QUOTA). The behaviour is Windows-only, so what runs here is the retry control flow and the rest of the tree; I say below what this machine cannot prove. Tested head `80930f0d1` merged onto `main` `bd6ba97ab` as merge `9661baf6b` (clean merge). `main` has moved two commits since (`bdbc7e923`, the precompile skip-list work); neither touches `tools/rdna2spirv.py` or `tests/`. Environment: Apple M3 Pro, arm64 (subgroups 4..32), macOS 27.2.1, CPython 3.15.2, Apple clang 21.0.0, SPIRV-Tools v2026.4, llvm-mc 23.1.5, MoltenVK 1.4.0; KosmicKrisp and lavapipe = Mesa 26.3.0. **The new test bites** - At the head: `python -I tests/test_rdna2spirv_spawn_quota.py` -> `Ran 5 tests ... OK (skipped=1)`. The skip is the nt-only job-object test. - Negative control (new test file kept, `tools/rdna2spirv.py` put back to `main`'s version): `FAILED (failures=1, errors=1, skipped=1)` - ERROR `test_quota_refusals_are_started_again` (no `SPAWN_RETRY_SECONDS`), FAIL `test_a_refusal_that_lasts_is_raised_once_the_time_is_up`. So the two behaviour tests are not vacuous. - What this run cannot show: the OS half. Off Windows `OSError` has no `.winerror`, so the fake in `win_error()` is the only 1816 the code ever sees here, and the 150-spawn job test is skipped. I did not run it. **No regressions** - Semantic suite: 500 files / 6,367 tests / 0 files failed at `main` `bd6ba97ab`, and the same at `9661baf6b`. Delta 0. (The new file lives in `tests/`, not `tests/semantic/`, so the suite does not count it; it was run on its own above.) - GPU fixtures (268): MoltenVK 195 PASS / 3 FAIL / 70 SKIP at both `main` and the merge; KosmicKrisp 190 / 5 / 73 at both. A line diff of the PASS/FAIL/SKIP output differs only in the per-run temp directory quoted in SKIP reasons. The failures are the pre-existing ones at `main` (MV: `cs_fma_fused`, `cs_imgatomic_ext`, `ps_ssharp`; KK: `cs_bvh`, `cs_bvh32`, `cs_imgatomic_ext`, `ps_cndmask_sign_mods`, `ps_valu16_mad_sel`). **Static** - `_run_spirv_tool` is the only `subprocess.run` in `tools/rdna2spirv.py` (line 19949 at the head), and `spirv-as`, `spirv-opt` and `spirv-val` all go through it, so the shard path is covered. Nothing else in `scripts/translate_pipeline_compute.py` starts a process; the worker imports the translator. - The limit being worked around is `info.basic.processes = (2 if worker else 0)` in `scripts/compute_workers_win.py` (`job()`/`verify()`), and only CreateProcess can produce 1816 here. A refused `CreateProcess` leaves no child behind, so re-running does not repeat work, and `FileNotFoundError` is still caught before the generic `OSError`. - `check_no_game_data.py` on both changed files: clean. `compileall`: clean. **Findings (none blocks)** 1. `tools/rdna2spirv.py:19941-19958`: when the budget runs out the original `OSError` is re-raised unchanged, so the traceback is the same `[WinError 1816]` a first refusal gives. Nothing says ~28 starts were attempted over 2 s; on a loaded host the user has no clue the retry ran out rather than never existing. An `exc.add_note(...)` (3.11+) with the attempt count and elapsed time would cost nothing. 2. `SPAWN_RETRY_SECONDS = 2.0` is a guess at how long the job counts a tool that has exited. The PR measures refusal rates (5-9%), not the longest refusal streak, and the Windows test shows 150 back-to-back starts passing on one host. If a slower machine holds the slot longer than 2 s, the same failure returns with no way to raise the budget. Measuring the lag (loop until 1,000 starts pass and record the longest run of refusals) or taking the seconds from the environment would make the number defensible. 3. Minor: this is the second bounded doubling retry in `tools/` (`tools/replace_retry.py` has one with 5 s); keeping them separate is fine, but a line saying why it is not shared would help the next reader. The cause in the description matches the code: the job counts the worker plus one tool, the exited tool can be counted for a moment, and 1816 is CreateProcess refusing before the child exists. No game files. AI-assisted.
budanga commented 2026-11-26 20:41:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by budanga on 2026-11-26T20:41:41Z.


Thanks for the careful check. All three points are taken in the new commit:

  1. The retry running out is now visible. When the time is up, the OSError gets a note: spirv-as: refused N times in T s (SPAWN_RETRY_SECONDS = 10.0). The unit test checks the note, and that other errors get none.

  2. The budget is now measured, and 2 s was not enough. I measured the longest run of refusals: a child in the worker's job (compute_workers_win.job(4096, True), BELOW_NORMAL) starts a short tool until 1,000 starts succeed, retrying each refused start at once, and records the longest streak (Windows 11 26300, Ryzen 5 9600X, 6 cores / 12 threads):

    load tool runs x starts refused longest streak
    idle cmd /c rem 3 x 1,000 4, 2, 0 53 ms
    idle spirv-val --version 2 x 1,000 0, 0 -
    12 busy loops at BELOW_NORMAL cmd /c rem 3 x 1,000 254, 319, 279 0.42 s, 3.76 s, 0.80 s
    12 busy loops at BELOW_NORMAL spirv-val --version 2 x 1,000 232, 242 3.63 s, 2.77 s

    With every thread busy at the workers' priority, streaks went past 2 s, so SPAWN_RETRY_SECONDS is now 10 s (about 2.7x the longest seen), with a comment giving the measurement. Under the same load, 3 x 1,000 starts through _run_spirv_tool itself: 0 failed; the slowest single call took 6.1 s. I kept it a constant rather than an environment variable, since the measured headroom seemed enough; happy to add one if you prefer.

  3. The comment now says why it does not share tools/replace_retry.py: that one retries a rename, this one a process start.

Re-tested on the new head: tests/test_rdna2spirv_spawn_quota.py 3 of 3; tests/test_translate_pipeline_compute.py 6 of 6; compileall clean; the 63 standard-library test files that use rdna2spirv pass; the 14 pytest files that use it, 1,244 passed / 11 skipped / 2 failed, the same as main (the 2 are cs_dpp_cmp.asm, which this llvm-mc refuses on main, #1444); semantic suite 500 files, 6,365 tests, 0 failed; check_no_game_data.py clean on both files.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7202978184 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2367#issuecomment-7202978184). Originally posted by [budanga](https://github.com/budanga) on 2026-11-26T20:41:41Z. --- Thanks for the careful check. All three points are taken in the new commit: 1. **The retry running out is now visible.** When the time is up, the `OSError` gets a note: `spirv-as: refused N times in T s (SPAWN_RETRY_SECONDS = 10.0)`. The unit test checks the note, and that other errors get none. 2. **The budget is now measured, and 2 s was not enough.** I measured the longest run of refusals: a child in the worker's job (`compute_workers_win.job(4096, True)`, `BELOW_NORMAL`) starts a short tool until 1,000 starts succeed, retrying each refused start at once, and records the longest streak (Windows 11 26300, Ryzen 5 9600X, 6 cores / 12 threads): | load | tool | runs x starts | refused | longest streak | |---|---|---:|---:|---:| | idle | `cmd /c rem` | 3 x 1,000 | 4, 2, 0 | 53 ms | | idle | `spirv-val --version` | 2 x 1,000 | 0, 0 | - | | 12 busy loops at `BELOW_NORMAL` | `cmd /c rem` | 3 x 1,000 | 254, 319, 279 | 0.42 s, **3.76 s**, 0.80 s | | 12 busy loops at `BELOW_NORMAL` | `spirv-val --version` | 2 x 1,000 | 232, 242 | **3.63 s**, 2.77 s | With every thread busy at the workers' priority, streaks went past 2 s, so `SPAWN_RETRY_SECONDS` is now 10 s (about 2.7x the longest seen), with a comment giving the measurement. Under the same load, 3 x 1,000 starts through `_run_spirv_tool` itself: 0 failed; the slowest single call took 6.1 s. I kept it a constant rather than an environment variable, since the measured headroom seemed enough; happy to add one if you prefer. 3. **The comment** now says why it does not share `tools/replace_retry.py`: that one retries a rename, this one a process start. Re-tested on the new head: `tests/test_rdna2spirv_spawn_quota.py` 3 of 3; `tests/test_translate_pipeline_compute.py` 6 of 6; `compileall` clean; the 63 standard-library test files that use `rdna2spirv` pass; the 14 pytest files that use it, 1,244 passed / 11 skipped / 2 failed, the same as `main` (the 2 are `cs_dpp_cmp.asm`, which this `llvm-mc` refuses on `main`, #1444); semantic suite 500 files, 6,365 tests, 0 failed; `check_no_game_data.py` clean on both files. AI-assisted (Claude Code).
lixonik commented 2026-11-26 20:50:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T20:50:21Z.

Review: COMMENTED


Retested the updated retry budget and error note on Windows 11 with CPython 3.12.1, merged with fac8b4bb9. All five quota tests passed. For an additional check, I occupied the second slot in a real two-process Windows job for the whole retry window. _run_spirv_tool raised WinError 1816 with the note cmd: refused 103 times in 10.0 s (SPAWN_RETRY_SECONDS = 10.0). After releasing the second slot, the next command completed successfully in the same worker.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6080354390 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#pullrequestreview-6080354390). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-26T20:50:21Z. **Review:** COMMENTED --- Retested the updated retry budget and error note on Windows 11 with CPython 3.12.1, merged with `fac8b4bb9`. All five quota tests passed. For an additional check, I occupied the second slot in a real two-process Windows job for the whole retry window. `_run_spirv_tool` raised WinError 1816 with the note `cmd: refused 103 times in 10.0 s (SPAWN_RETRY_SECONDS = 10.0)`. After releasing the second slot, the next command completed successfully in the same worker. AI-assisted.
DadaCap commented 2026-11-28 07:21:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T07:21:07Z.


Thanks for this! Retrying spirv-as/spirv-val when the Windows worker job refuses a start with ERROR_NOT_ENOUGH_QUOTA addresses a real flaky failure.

During maintainer testing (local, 2026-11-28) (head 1860dc591, merged on main b1619e0a3 / 6dfca6428, Windows 11, Python tests via pytest/unittest) we found:

  • The PR's own new test tests/test_rdna2spirv_spawn_quota.py::TwoProcessJobTests::test_back_to_back_tools_in_the_worker_job fails on our Windows 11 host with this PR alone on main (traceback in _run_spirv_tool(['cmd','/c','rem'])).

To get this merged:

  • Make the test robust on hosts without the two-process job limit, or document (and check) the precondition it needs.

AI-assisted (Claude Code), posted for DadaCap (maintainer).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7235878107 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#issuecomment-7235878107). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T07:21:07Z. --- Thanks for this! Retrying spirv-as/spirv-val when the Windows worker job refuses a start with ERROR_NOT_ENOUGH_QUOTA addresses a real flaky failure. During maintainer testing (local, 2026-11-28) (head 1860dc591, merged on main b1619e0a3 / 6dfca6428, Windows 11, Python tests via pytest/unittest) we found: - The PR's own new test `tests/test_rdna2spirv_spawn_quota.py::TwoProcessJobTests::test_back_to_back_tools_in_the_worker_job` fails on our Windows 11 host with this PR alone on main (traceback in `_run_spirv_tool(['cmd','/c','rem'])`). To get this merged: - Make the test robust on hosts without the two-process job limit, or document (and check) the precondition it needs. _AI-assisted (Claude Code), posted for DadaCap (maintainer)._
budanga commented 2026-11-28 13:45:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by budanga on 2026-11-28T13:45:03Z.


Thanks for testing it. I could reproduce the failure: it happens when the test runs from a virtual environment.

Cause. On Windows a venv's python.exe is a launcher that starts the base interpreter as a second process. The test started its child with sys.executable, so inside the worker's job (two active processes allowed) the launcher and the real interpreter took both slots, and every tool start was refused; the note from the retry says so: cmd: refused 102 times in 10.0 s (SPAWN_RETRY_SECONDS = 10.0). AGENTS.md runs the pytest files from a venv, which fits your setup.

Fix (new commit, test only, tools/rdna2spirv.py unchanged):

  • The child is started with the base interpreter, sys._base_executable (the same as sys.executable outside a venv), so it is the job's one process, as the worker is.
  • The precondition is checked: the child reports its PID, and the test reads the job's process list (JOBOBJECT_BASIC_PROCESS_ID_LIST via compute_workers_win.query_job). If the interpreter that starts the tools is not the job's only process, the test is skipped with that reason instead of failing. A check from inside the child is not enough: the venv launcher puts the real interpreter in a job of its own, nested in the worker's, where it sees one process.

Checked on Windows 11 26300, Python 3.14.10, at the branch merged with main 259be59b9 (merges cleanly):

how the test runs before now
base python -I tests/... pass pass, 3 of 3
venv python -I tests/... fail (1816 after 10 s) pass, 3 of 3
python -m pytest tests/test_rdna2spirv_spawn_quota.py from a venv fail 5 passed
child forced through the venv launcher fail skipped: ... is not the worker job's only process ([4344, 21508], runner 4344): a launcher in between leaves the tools no slot
main's tools/rdna2spirv.py with the new test - fails with WinError 1816, 3 of 3 (the test still catches the original bug)

Related, but not this pull request: on main, without this change, tests/test_translate_pipeline_compute.py also fails from a venv (RuntimeError: Windows compute job limits not in force), because scripts/compute_workers_win.py starts the worker with sys.executable too. I'll post it as a finding in the coordination issue.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7240158687 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#issuecomment-7240158687). Originally posted by [budanga](https://github.com/budanga) on 2026-11-28T13:45:03Z. --- Thanks for testing it. I could reproduce the failure: it happens when the test runs from a virtual environment. **Cause.** On Windows a venv's `python.exe` is a launcher that starts the base interpreter as a second process. The test started its child with `sys.executable`, so inside the worker's job (two active processes allowed) the launcher and the real interpreter took both slots, and every tool start was refused; the note from the retry says so: `cmd: refused 102 times in 10.0 s (SPAWN_RETRY_SECONDS = 10.0)`. AGENTS.md runs the pytest files from a venv, which fits your setup. **Fix (new commit, test only, `tools/rdna2spirv.py` unchanged):** - The child is started with the base interpreter, `sys._base_executable` (the same as `sys.executable` outside a venv), so it is the job's one process, as the worker is. - The precondition is checked: the child reports its PID, and the test reads the job's process list (`JOBOBJECT_BASIC_PROCESS_ID_LIST` via `compute_workers_win.query_job`). If the interpreter that starts the tools is not the job's only process, the test is skipped with that reason instead of failing. A check from inside the child is not enough: the venv launcher puts the real interpreter in a job of its own, nested in the worker's, where it sees one process. **Checked** on Windows 11 26300, Python 3.14.10, at the branch merged with `main` `259be59b9` (merges cleanly): | how the test runs | before | now | |---|---|---| | base `python -I tests/...` | pass | pass, 3 of 3 | | venv `python -I tests/...` | fail (1816 after 10 s) | pass, 3 of 3 | | `python -m pytest tests/test_rdna2spirv_spawn_quota.py` from a venv | fail | 5 passed | | child forced through the venv launcher | fail | skipped: `... is not the worker job's only process ([4344, 21508], runner 4344): a launcher in between leaves the tools no slot` | | `main`'s `tools/rdna2spirv.py` with the new test | - | fails with WinError 1816, 3 of 3 (the test still catches the original bug) | Related, but not this pull request: on `main`, without this change, `tests/test_translate_pipeline_compute.py` also fails from a venv (`RuntimeError: Windows compute job limits not in force`), because `scripts/compute_workers_win.py` starts the worker with `sys.executable` too. I'll post it as a finding in the coordination issue. AI-assisted (Claude Code).
budanga commented 2026-11-28 14:04:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by budanga on 2026-11-28T14:04:59Z.


Note on the six red CI checks of this run: none of them comes from this pull request, which only touches tools/rdna2spirv.py and tests/test_rdna2spirv_spawn_quota.py (neither appears among the failures).

  • check, stdlib-tests-linux, macos-python: tests/test_build_runtime_fallback.py (test_the_loader_gets_the_stack_reserve_cmake_gives_it).
  • semantic-tests: tests/semantic/test_valu_cvt_f16_int16_mods.py (test_f16_to_int16_output_modifiers_still_rejected, v_cvt_u16_f16 and v_cvt_i16_f16).

Both fail the same way on plain main 9c49bd533 without this change (run locally, Windows 11, Python 3.14). macos and linux-gpu-tools are GPU fixture runs on MoltenVK and llvmpipe, which this change does not touch. The windows job, the only one that runs the job-object test, passed.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7240402783 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#issuecomment-7240402783). Originally posted by [budanga](https://github.com/budanga) on 2026-11-28T14:04:59Z. --- Note on the six red CI checks of this run: none of them comes from this pull request, which only touches `tools/rdna2spirv.py` and `tests/test_rdna2spirv_spawn_quota.py` (neither appears among the failures). - `check`, `stdlib-tests-linux`, `macos-python`: `tests/test_build_runtime_fallback.py` (`test_the_loader_gets_the_stack_reserve_cmake_gives_it`). - `semantic-tests`: `tests/semantic/test_valu_cvt_f16_int16_mods.py` (`test_f16_to_int16_output_modifiers_still_rejected`, `v_cvt_u16_f16` and `v_cvt_i16_f16`). Both fail the same way on plain `main` `9c49bd533` without this change (run locally, Windows 11, Python 3.14). `macos` and `linux-gpu-tools` are GPU fixture runs on MoltenVK and llvmpipe, which this change does not touch. The `windows` job, the only one that runs the job-object test, passed. AI-assisted (Claude Code).
lixonik commented 2026-11-28 14:33:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T14:33:34Z.

Review: APPROVED


Re-reviewed 913b9aa4d and verified the Windows virtual-environment fix on Windows 11.

Code audit (913b9aa4d):

  • tests/test_rdna2spirv_spawn_quota.py: launching the job child via getattr(sys, "_base_executable", None) or sys.executable cleanly avoids placing both the Windows venv launcher and base interpreter inside the two-process worker job, and checking JOBOBJECT_BASIC_PROCESS_ID_LIST from the parent skips with a clear diagnostic if an intermediate launcher is still present.

Verification (Windows 11, CPython 3.12.1):

  • Base interpreter (python -I tests/test_rdna2spirv_spawn_quota.py -v): 5/5 passed (0.818 s).
  • Fresh Windows venv (<venv>\Scripts\python.exe -I tests/test_rdna2spirv_spawn_quota.py -v): 5/5 passed (0.862 s).
  • python -I scripts/check_no_game_data.py: passed.

AI-assisted (Antigravity, Gemini).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6098408827 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#pullrequestreview-6098408827). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-28T14:33:34Z. **Review:** APPROVED --- Re-reviewed `913b9aa4d` and verified the Windows virtual-environment fix on Windows 11. Code audit (`913b9aa4d`): - `tests/test_rdna2spirv_spawn_quota.py`: launching the job child via `getattr(sys, "_base_executable", None) or sys.executable` cleanly avoids placing both the Windows venv launcher and base interpreter inside the two-process worker job, and checking `JOBOBJECT_BASIC_PROCESS_ID_LIST` from the parent skips with a clear diagnostic if an intermediate launcher is still present. Verification (Windows 11, CPython 3.12.1): - Base interpreter (`python -I tests/test_rdna2spirv_spawn_quota.py -v`): **5/5 passed** (0.818 s). - Fresh Windows `venv` (`<venv>\Scripts\python.exe -I tests/test_rdna2spirv_spawn_quota.py -v`): **5/5 passed** (0.862 s). - `python -I scripts/check_no_game_data.py`: passed. AI-assisted (Antigravity, Gemini).
Rezn0r27 commented 2026-11-28 22:21:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Rezn0r27 on 2026-11-28T22:21:59Z.


Tested commit 913b9aa4d on Windows 11 (build 26300.9974) with Python 3.12.10. I ran py -3.12 -I tests/test_rdna2spirv_spawn_quota.py -v in PowerShell. All 5 tests passed in 1.976 seconds, including the Windows-specific test_back_to_back_tools_in_the_worker_job. No skips. Python exit code: 0

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246684738 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#issuecomment-7246684738). Originally posted by [Rezn0r27](https://github.com/Rezn0r27) on 2026-11-28T22:21:59Z. --- Tested commit 913b9aa4d on Windows 11 (build 26300.9974) with Python 3.12.10. I ran py -3.12 -I tests/test_rdna2spirv_spawn_quota.py -v in PowerShell. All 5 tests passed in 1.976 seconds, including the Windows-specific test_back_to_back_tools_in_the_worker_job. No skips. Python exit code: 0
zmasi commented 2026-11-29 01:38:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:38:50Z.


#2367 | head 913b9aa4dd (merged cleanly onto origin/main d8c10dd5e1) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Independent Verification (Windows 11 + Win32 Job Object)

  • Diff & safety audit: Inspected 100% of the diff across tools/rdna2spirv.py (_run_spirv_tool bounded retry with exponential backoff up to SPAWN_RETRY_SECONDS = 10.0 on winerror == 1816 ERROR_NOT_ENOUGH_QUOTA and exception __notes__ on deadline expiry) and tests/test_rdna2spirv_spawn_quota.py. python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_rdna2spirv_spawn_quota.py passed (rc=0).
  • Red -> Green on native Windows 11:
    • Red (origin/main d8c10dd5e1 tools/rdna2spirv.py): Running #2367's tests/test_rdna2spirv_spawn_quota.py -v against unpatched tools/rdna2spirv.py failed (FAILED (failures=1, errors=1): unhandled OSError: [WinError 1816] Not enough quota is available to process this command in test_quota_refusals_are_started_again and call_count == 1 in test_a_refusal_that_lasts_is_raised_once_the_time_is_up).
    • Green (#2367 + origin/main):
      • python -I tests/test_rdna2spirv_spawn_quota.py -v -> 5/5 passed (0 skipped, OK, 12.822s), including the Windows-only TwoProcessJobTests.test_back_to_back_tools_in_the_worker_job executing 150 back-to-back child spawns inside a real 2-active-process compute_workers_win.job(1024, True) Win32 Job Object (rc=0).
      • python -I tests/test_compute_workers_win.py -> 4/4 passed (OK, 0.006s).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248921509 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#issuecomment-7248921509). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T01:38:50Z. --- #2367 | head 913b9aa4dd8d30dc85f9def1ec96d34e81e9035e (merged cleanly onto origin/main d8c10dd5e1) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes ### Independent Verification (Windows 11 + Win32 Job Object) - **Diff & safety audit**: Inspected 100% of the diff across `tools/rdna2spirv.py` (`_run_spirv_tool` bounded retry with exponential backoff up to `SPAWN_RETRY_SECONDS = 10.0` on `winerror == 1816` `ERROR_NOT_ENOUGH_QUOTA` and exception `__notes__` on deadline expiry) and `tests/test_rdna2spirv_spawn_quota.py`. `python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_rdna2spirv_spawn_quota.py` passed (`rc=0`). - **Red -> Green on native Windows 11**: - **Red (`origin/main` `d8c10dd5e1` `tools/rdna2spirv.py`)**: Running `#2367`'s `tests/test_rdna2spirv_spawn_quota.py -v` against unpatched `tools/rdna2spirv.py` failed (`FAILED (failures=1, errors=1)`: unhandled `OSError: [WinError 1816] Not enough quota is available to process this command` in `test_quota_refusals_are_started_again` and `call_count == 1` in `test_a_refusal_that_lasts_is_raised_once_the_time_is_up`). - **Green (`#2367 + origin/main`)**: - `python -I tests/test_rdna2spirv_spawn_quota.py -v` -> **`5/5` passed (`0` skipped, `OK`, `12.822s`)**, including the Windows-only `TwoProcessJobTests.test_back_to_back_tools_in_the_worker_job` executing `150` back-to-back child spawns inside a real 2-active-process `compute_workers_win.job(1024, True)` Win32 Job Object (`rc=0`). - `python -I tests/test_compute_workers_win.py` -> `4/4` passed (`OK`, `0.006s`).
timbot103 commented 2026-11-29 04:28:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:28:41Z.

Review: COMMENTED


Static audit of 913b9aa4d only. No builds, tests, or GPU runs.

tools/rdna2spirv.py routes spirv-as, spirv-opt, and spirv-val through the same helper. The retry matches Windows winerror 1816, preserving the missing-tool diagnostic and propagation of POSIX errno errors and subprocess timeouts. A refused start leaves the assembler's input bytes available for the next attempt. CPython closes the failed spawn's pipes, and the assembly finally removes the staging file if the exception escapes. The unit tests cover recovery, exhaustion, unrelated errors, and missing tools. The Windows integration test uses the two-process job from scripts/compute_workers_win.py and checks the interpreter PID before releasing its stdin gate.

  • tools/rdna2spirv.py:19967 — The final sleep can consume the remaining retry budget, but the loop still attempts another spawn. If the slot clears during that sleep, the tool can start at or after the deadline. Check the clock after sleeping, raise the last quota error with its note on expiry, and assert spawn times in the fake-clock test.
  • tests/test_rdna2spirv_spawn_quota.py:152 — The launcher precondition can skip before communicate, leaving stdin, stdout, and stderr open until finalization even though the child is reaped. Close the parent streams after process and job teardown on this path.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6101400142 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#pullrequestreview-6101400142). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-29T04:28:41Z. **Review:** COMMENTED --- Static audit of `913b9aa4d` only. No builds, tests, or GPU runs. `tools/rdna2spirv.py` routes `spirv-as`, `spirv-opt`, and `spirv-val` through the same helper. The retry matches Windows `winerror` 1816, preserving the missing-tool diagnostic and propagation of POSIX `errno` errors and subprocess timeouts. A refused start leaves the assembler's input bytes available for the next attempt. CPython closes the failed spawn's pipes, and the assembly `finally` removes the staging file if the exception escapes. The unit tests cover recovery, exhaustion, unrelated errors, and missing tools. The Windows integration test uses the two-process job from `scripts/compute_workers_win.py` and checks the interpreter PID before releasing its stdin gate. - `tools/rdna2spirv.py:19967` — The final sleep can consume the remaining retry budget, but the loop still attempts another spawn. If the slot clears during that sleep, the tool can start at or after the deadline. Check the clock after sleeping, raise the last quota error with its note on expiry, and assert spawn times in the fake-clock test. - `tests/test_rdna2spirv_spawn_quota.py:152` — The launcher precondition can skip before `communicate`, leaving stdin, stdout, and stderr open until finalization even though the child is reaped. Close the parent streams after process and job teardown on this path. AI-assisted.
MoonEyes commented 2026-11-29 19:18:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T19:18:46Z.


Tested 913b9aa4d merged (no commit) with main 7c330c76d: Python 3.12, Windows 11 10.0.26300, CPU only. Ran the PR's tests plus every test file that imports the changed tools, with the PR and with its tools back to main.

  • The PR's own test: tests/test_rdna2spirv_spawn_quota.py 5 OK with the PR, FAILED (failures=1, errors=1) with tools/ back to main.
  • But it breaks two other files on the merge: tests/test_bvh_shaders_stage.py and tests/test_exe_shaders_stage.py each give FAILED (failures=1) with this PR, while both pass on main (13 OK and 11 OK in the same run on other PRs). They still fail with the tools back to main, so it comes from the PR's non-tool changes. Not mergeable until those two pass.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7261179434 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#issuecomment-7261179434). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T19:18:46Z. --- Tested `913b9aa4d` merged (no commit) with `main` `7c330c76d`: Python 3.12, Windows 11 10.0.26300, CPU only. Ran the PR's tests plus every test file that imports the changed tools, with the PR and with its tools back to `main`. - The PR's own test: `tests/test_rdna2spirv_spawn_quota.py` 5 OK with the PR, `FAILED (failures=1, errors=1)` with `tools/` back to `main`. - **But it breaks two other files on the merge**: `tests/test_bvh_shaders_stage.py` and `tests/test_exe_shaders_stage.py` each give `FAILED (failures=1)` with this PR, while both pass on `main` (13 OK and 11 OK in the same run on other PRs). They still fail with the tools back to `main`, so it comes from the PR's non-tool changes. Not mergeable until those two pass. AI-assisted (Claude Code).
budanga commented 2026-11-29 19:32:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by budanga on 2026-11-29T19:32:42Z.


Thanks for the further checks.

test_bvh_shaders_stage and test_exe_shaders_stage (MoonEyes). They do not come from this pull request; they come from #1235, which reached main at 545f610fa (2026-11-29 20:00). Run here (Windows 11 26300, Python 3.14), python -I tests/<file>.py:

tree test_bvh_shaders_stage test_exe_shaders_stage
7c330c76d (your main) OK OK
7c330c76d + this PR OK OK
cf6e55921 (main just before #1235) OK OK
545f610fa (the #1235 merge), without this PR FAILED (failures=1) FAILED (failures=1)
main dd87aa405 + this PR FAILED (failures=1) FAILED (failures=1)

The failing assertion is the second stage() call, which should run nothing but runs ['fspx_unpack.py', 'rdna2spirv.py'] again. Since bb68bb93a ("make_game: rebuild empty cached compute shader modules"), make_game rebuilds a cached empty .spv, and these two tests' fake_py still writes an empty one (write("", out, name + ".spv")). #1235 updated the same fake in test_fspx_shaders_stage.py and test_library_shaders_stage.py, but not in these two. This pull request touches only tools/rdna2spirv.py and its own test file, and the two files pass with it on the main you tested.

timbot103's two points.

  1. A start at or after the deadline: I'd keep this. The bound is there so that a refusal that lasts cannot hang the worker. One last attempt after the final sleep costs at most one CreateProcess call. If the slot has cleared by then, the tool runs; raising instead would turn a start that works into a failure. The unit test already asserts that the error comes no later than SPAWN_RETRY_SECONDS on the fake clock.
  2. Pipes left open on the skip path: right. The new commit closes the parent's three pipes in the finally, after the child is killed and waited for, so the skip path no longer leaves them to finalization.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7261363474 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#issuecomment-7261363474). Originally posted by [budanga](https://github.com/budanga) on 2026-11-29T19:32:42Z. --- Thanks for the further checks. **`test_bvh_shaders_stage` and `test_exe_shaders_stage` (MoonEyes).** They do not come from this pull request; they come from #1235, which reached `main` at `545f610fa` (2026-11-29 20:00). Run here (Windows 11 26300, Python 3.14), `python -I tests/<file>.py`: | tree | `test_bvh_shaders_stage` | `test_exe_shaders_stage` | |---|---|---| | `7c330c76d` (your `main`) | OK | OK | | `7c330c76d` + this PR | OK | OK | | `cf6e55921` (`main` just before #1235) | OK | OK | | `545f610fa` (the #1235 merge), without this PR | FAILED (failures=1) | FAILED (failures=1) | | `main` `dd87aa405` + this PR | FAILED (failures=1) | FAILED (failures=1) | The failing assertion is the second `stage()` call, which should run nothing but runs `['fspx_unpack.py', 'rdna2spirv.py']` again. Since `bb68bb93a` ("make_game: rebuild empty cached compute shader modules"), `make_game` rebuilds a cached empty `.spv`, and these two tests' `fake_py` still writes an empty one (`write("", out, name + ".spv")`). #1235 updated the same fake in `test_fspx_shaders_stage.py` and `test_library_shaders_stage.py`, but not in these two. This pull request touches only `tools/rdna2spirv.py` and its own test file, and the two files pass with it on the `main` you tested. **timbot103's two points.** 1. *A start at or after the deadline:* I'd keep this. The bound is there so that a refusal that lasts cannot hang the worker. One last attempt after the final sleep costs at most one `CreateProcess` call. If the slot has cleared by then, the tool runs; raising instead would turn a start that works into a failure. The unit test already asserts that the error comes no later than `SPAWN_RETRY_SECONDS` on the fake clock. 2. *Pipes left open on the skip path:* right. The new commit closes the parent's three pipes in the `finally`, after the child is killed and waited for, so the skip path no longer leaves them to finalization. AI-assisted (Claude Code).
aslan2142 commented 2026-12-01 11:43:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:43:43Z.

Review: APPROVED


Reviewed the diff against main: tools/rdna2spirv.py:19938-19973 cleanly retries subprocess.run with bounded exponential backoff (SPAWN_RETRY_SECONDS = 10.0) exclusively on Windows ERROR_NOT_ENOUGH_QUOTA (winerror == 1816), preserving FileNotFoundError tool naming and attaching retry notes on timeout, with portable unit tests plus a Windows job-object test in tests/test_rdna2spirv_spawn_quota.py. Clean-room verified. Approving; please merge/rebase current main for a fresh green CI run before merge.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130551086 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2367#pullrequestreview-6130551086). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:43:43Z. **Review:** APPROVED --- Reviewed the diff against `main`: `tools/rdna2spirv.py:19938-19973` cleanly retries `subprocess.run` with bounded exponential backoff (`SPAWN_RETRY_SECONDS = 10.0`) exclusively on Windows `ERROR_NOT_ENOUGH_QUOTA` (`winerror == 1816`), preserving `FileNotFoundError` tool naming and attaching retry notes on timeout, with portable unit tests plus a Windows job-object test in `tests/test_rdna2spirv_spawn_quota.py`. Clean-room verified. Approving; please merge/rebase current `main` for a fresh green CI run before merge. *(AI-assisted review.)*
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2367
No description provided.