Reap semantic test children that race cancellation (SEMANTIC-RUNNER-REGISTER-CANCEL) #2073

Closed
leonida/mandy
alexandersato0830 wants to merge 0 commits from codex/semantic-runner-register-cancel into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

alexandersato0830 commented 2026-11-25 19:35:43 +00:00

Claimed in the coordination issue as: SEMANTIC-RUNNER-REGISTER-CANCEL

What and why

The parallel runner can report cancellation while a worker is between launching its subprocess and registering it. The cancellation snapshot then misses the child. Share a cancellation event with workers and check it before launch and under the registration lock. A late child is terminated and reaped by its worker. The regression holds a real subprocess launch at that boundary with thread events.

Tested

  • Windows 11, Python 3.14.9. Main e18b59a printed interrupted and returned 130, then the held child reported normal completion. The regression passed with the fix.
  • py -3.14 -I tests/test_run_semantic_tests.py ran 27 cases successfully with the POSIX signal case skipped.
  • Parallel semantic CLI smoke with test_library_compute_forms.py passed (12 tests).
  • git merge-tree confirmed this patch applies alongside #2071.
  • Verified git diff --check and the source-only check.

GPUs tested: n/a.

AI-assisted: yes.

  • Based on current main.
  • One topic.
  • Uses source and synthetic fixtures.
Claimed in the coordination issue as: [SEMANTIC-RUNNER-REGISTER-CANCEL](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172445639) ### What and why The parallel runner can report cancellation while a worker is between launching its subprocess and registering it. The cancellation snapshot then misses the child. Share a cancellation event with workers and check it before launch and under the registration lock. A late child is terminated and reaped by its worker. The regression holds a real subprocess launch at that boundary with thread events. ### Tested - Windows 11, Python 3.14.9. Main `e18b59a` printed `interrupted` and returned 130, then the held child reported normal completion. The regression passed with the fix. - `py -3.14 -I tests/test_run_semantic_tests.py` ran 27 cases successfully with the POSIX signal case skipped. - Parallel semantic CLI smoke with `test_library_compute_forms.py` passed (12 tests). - `git merge-tree` confirmed this patch applies alongside #2071. - Verified `git diff --check` and the source-only check. GPUs tested: n/a. AI-assisted: yes. - [x] Based on current `main`. - [x] One topic. - [x] Uses source and synthetic fixtures.
DeadlyChirp commented 2026-11-26 10:01:14 +00:00

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_run_semantic_tests.py: 26 passed, 1 skipped (the POSIX process-group SIGINT test), 33 subtests passed. On main the same file has 25 tests, all passing.

(AI-assisted test run; output checked by hand.)

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_run_semantic_tests.py`: 26 passed, 1 skipped (the POSIX process-group SIGINT test), 33 subtests passed. On main the same file has 25 tests, all passing. (AI-assisted test run; output checked by hand.)
DadaCap commented 2026-11-28 08:06:55 +00:00

Thanks for this fix! It passed our maintainer testing (local release candidate, Windows 11: translator and Python suites with no new failure, game runs with no regression), but it now conflicts with main: #1437, merged a few minutes ago, rewrote the same lines of run_semantic_tests.py's run_module().

To get this merged, a rebase on main is all it needs. The resolution we used and tested locally:

  • keep #1437's result_path, env = result_environment(scratch) line,
  • add your cancel check right after it (if cancelled is not None and cancelled.is_set(): return 130, 0, ""),
  • drop the old count_path lines, which nothing reads any more.

Once it's rebased we'll re-run the tests and merge.

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

Thanks for this fix! It passed our maintainer testing (local release candidate, Windows 11: translator and Python suites with no new failure, game runs with no regression), but it now conflicts with `main`: #1437, merged a few minutes ago, rewrote the same lines of `run_semantic_tests.py`'s `run_module()`. To get this merged, a rebase on `main` is all it needs. The resolution we used and tested locally: - keep #1437's `result_path, env = result_environment(scratch)` line, - add your cancel check right after it (`if cancelled is not None and cancelled.is_set(): return 130, 0, ""`), - drop the old `count_path` lines, which nothing reads any more. Once it's rebased we'll re-run the tests and merge. _AI-assisted (Claude Code), posted for DadaCap (maintainer)._
TheGeogeo commented 2026-11-28 22:16:47 +00:00

Duplicate check (diff reading only, no build): not a duplicate of #2201. This PR closes the race between Ctrl+C cancellation and a worker still inside Popen. #2201 kills a timed worker's whole process group on POSIX. They conflict textually in scripts/run_semantic_tests.py (git merge-tree).

Suggest keeping both: this one first once rebased (needs rebase; run_module on main now uses result_environment), then #2201 on top of it.

AI-assisted (Claude Code).

Duplicate check (diff reading only, no build): not a duplicate of #2201. This PR closes the race between Ctrl+C cancellation and a worker still inside `Popen`. #2201 kills a timed worker's whole process group on POSIX. They conflict textually in `scripts/run_semantic_tests.py` (`git merge-tree`). Suggest keeping both: this one first once rebased (`needs rebase`; `run_module` on `main` now uses `result_environment`), then #2201 on top of it. AI-assisted (Claude Code).
aslan2142 reviewed 2026-12-01 11:56:15 +00:00
aslan2142 left a comment
No description provided.
Reviewed against current `main`: closing the cancellation/registration race for semantic test children in `scripts/run_semantic_tests.py` looks solid (and distinct from `#2201`), but this branch conflicts with `main` and has no green CI run. Please rebase onto current `main` so CI runs cleanly. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 17:24:58 +00:00

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No description provided.