Cancel Windows semantic test subprocess trees (SEMANTIC-RUNNER-WINDOWS-CHILD-CANCEL) #2071

Merged
alexandersato0830 merged 1 commit from upstream-pr/2071 into main 2026-11-28 08:01:37 +00:00
alexandersato0830 commented 2026-11-25 19:31:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by alexandersato0830 on 2026-11-25T19:31:31Z.


Claimed in the coordination issue as: SEMANTIC-RUNNER-WINDOWS-CHILD-CANCEL

What and why

After #1936, interrupt cleanup terminates the parent before running Windows taskkill /T. With the parent gone, the child can continue running and keep the runner's output pipe open. Ask Windows to end the process tree while the parent is live, then fall back to killing the parent through its process handle. The Windows regression starts a synthetic descendant that inherits stdout and checks whether it survives cancellation.

Tested

  • Windows 11, Python 3.14.9. On main e48ff03 the descendant lived long enough to write its completion marker to the pipe. With the fix the regression passed.
  • 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).
  • 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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5497813468 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2071). Originally posted by [alexandersato0830](https://github.com/alexandersato0830) on 2026-11-25T19:31:31Z. --- Claimed in the coordination issue as: [SEMANTIC-RUNNER-WINDOWS-CHILD-CANCEL](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172350113) ### What and why After #1936, interrupt cleanup terminates the parent before running Windows `taskkill /T`. With the parent gone, the child can continue running and keep the runner's output pipe open. Ask Windows to end the process tree while the parent is live, then fall back to killing the parent through its process handle. The Windows regression starts a synthetic descendant that inherits stdout and checks whether it survives cancellation. ### Tested - Windows 11, Python 3.14.9. On main `e48ff03` the descendant lived long enough to write its completion marker to the pipe. With the fix the regression passed. - `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). - 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.
MSedgeMC commented 2026-11-25 19:35:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-25T19:35:59Z.

Review: APPROVED


Verified on the PR branch: python3 -m unittest tests.test_run_semantic_tests -> 27 tests OK (1 skipped — the new Windows descendant-kill test is guarded by @skipUnless(os.name=='nt'), which cannot execute on this Linux host). The fix is sound: on Windows, taskkill /F /T needs the root alive, so it no longer pre-terminates processes with p.terminate(), and _kill_process_tree is skipped when the root has already exited; POSIX termination behaviour is unchanged. Advisory: branch carries ~60 older commits not on current main; rebase before merge.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6063820745 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2071#pullrequestreview-6063820745). Originally posted by [MSedgeMC](https://github.com/MSedgeMC) on 2026-11-25T19:35:59Z. **Review:** APPROVED --- Verified on the PR branch: python3 -m unittest tests.test_run_semantic_tests -> 27 tests OK (1 skipped — the new Windows descendant-kill test is guarded by @skipUnless(os.name=='nt'), which cannot execute on this Linux host). The fix is sound: on Windows, taskkill /F /T needs the root alive, so it no longer pre-terminates processes with p.terminate(), and _kill_process_tree is skipped when the root has already exited; POSIX termination behaviour is unchanged. Advisory: branch carries ~60 older commits not on current main; rebase before merge.
DeadlyChirp commented 2026-11-26 10:01:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-26T10:01:04Z.


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.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7188795180 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2071#issuecomment-7188795180). Originally posted by [DeadlyChirp](https://github.com/DeadlyChirp) on 2026-11-26T10:01:04Z. --- 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:01:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:01:39Z.


Merged into main (merge commit 4314c1f33), approved by DadaCap (maintainer). Thanks!

Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (c50333730).

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236313766 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2071#issuecomment-7236313766). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T08:01:39Z. --- Merged into `main` (merge commit 4314c1f33), approved by DadaCap (maintainer). Thanks! Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (c50333730). _AI-assisted (Claude Code), posted for DadaCap._
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!2071
No description provided.