Fail semantic runs that exit without a trustworthy result (SEMANTIC-RUNNER-COMPLETION) #1437
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1437"
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?
Imported from ubiquitarianism/leonida. Originally posted by titoreinaldo on 2026-11-25T00:14:37Z.
Claimed in the coordination issue as: SEMANTIC-RUNNER-COMPLETION (#14 claim).
What and why
An incomplete semantic run can report success. A synthetic module calling
os._exit(0)during import leaves no unittest result; the parallel runner counts zero for that worker and accepts its process status, and the serial runner simply forwards success. An exit handler can also overwrite the status after unittest has completed with a failure.Use unittest’s completed result as well as the process exit status in both modes. Status 0 without a result, or after unittest reported a nonzero status, is an error. Empty package initializers are still ignored based on the recorded result, and timeouts retain their existing diagnostics. Discovery rules are unchanged.
Tested
1154976dwith either-j 1or-j 2: four false-green cases before, all four detected after.python -I tests/test_run_semantic_tests.py: 24 tests pass.python -I scripts/run_semantic_tests.py tests/semantic -j 8: 476 files, 6,223 tests, zero failing files.GPUs tested: none, Linux x86-64 / Python 3.12.14, CPU-only. No game files, keys, decryption, or online game services. AI-assisted: yes, OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T15:27:14Z.
Reviewed
84f8fee73: run_semantic_tests.py now takes the verdict from the child's{testsRun, exitCode}result file: a child that exits 0 without a result, or against unittest's own verdict, fails the run, and-j 1shares the child program instead of a barepython -m unittest discover. Ran tests/test_run_semantic_tests.py on both trees: 24 tests OK on the PR, and on main exactly the two new tests fail; both bugs reproduce (an import-timeos._exit(0)and an atexit-forced exit 0 after a failed test report "0 files failed" on main). Ran the runner ontests/semantic -p 'test_alu_add*.py'in both modes on both trees: 6 files, 69 tests, 0 failed, identical output. Probed a passing module with an atexitos._exit(0)(still passes; no false positive) and a mid-test SIGKILL (still fails). No findings. Note, follow-up material only: a module that deliberately writes LEONIDA_TEST_COUNT can still forge a green verdict everywhere except main's serial mode, which was immune by accident.AI-assisted review.
Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T23:36:12Z.
Hi @titoreinaldo, thanks for this. #1749 by
lixonik(SEMANTIC-WORKER-RESULT-REQUIRED) fixes the same false pass for the parallel runner only. Yours is the broader fix (it also covers-j 1and a nonzero unittest status hidden by an exit handler) and your claim came first, but it now conflicts withmain.Could you rebase it? When you do, please also add the case #1749 tests and yours does not: a module whose worker exits with status 0 in the middle of a test (yours exits at import) next to a healthy module under
-j 2. After that, #1749 can be closed in favor of this one. cc @lixonik, no action needed from you yet.AI-assisted (Claude Code, Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by akimfomin on 2026-11-28T01:25:16Z.
I ran
python -I tests/test_run_semantic_tests.pyon53bc0e3ain a standalone Windows checkout of the runner and its fixtures. It finished with 28 passed and one platform skip. The intentional nestedboom-msgfailure did not make the outer suite fail. VIctory #3636 has a related false-green control for worker initialization. If you publish a CI summary from this runner, labeling that nested diagnostic separately would keep it from looking like a failed verification.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:01:28Z.
Merged into
main(merge commit7e4093c9e), 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. Note: #2073 touches the same lines of
run_semantic_tests.py; it will be asked to rebase on this. The merge was pinned to the head commit that was tested (53bc0e3a8).AI-assisted (Claude Code), posted for DadaCap.