conformance: preserve traceback and exit 2 for unexpected exceptions (DRAFT-114) #1324
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!1324
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/draft-114"
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 the coordination issue as: DRAFT-114 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145478287)
What and why
Supersedes carried-over draft #114. David's original commit from
old-pr/9848was cherry-picked with-xontomainat4a50cafc7.compare.pynow importstracebackso an unexpected command-handler exception prints the original exception and exits 2. Exit 1 remains the pixel mismatch status. The missing import had raised a second exception inside the error handler and caused Python to exit 1.Tested
On baseline
4a50cafc7, the direct test raisedNameErrorand the subprocess test returned 1. Reproduced in PowerShell with:Both crash regressions, all four PNG transparency tests and all 22 comparison selftest checks passed. Touched-file compilation, changed-file game-data and whitespace checks passed. The merge simulation with #1322 was clean.
Windows 11 build 26200, Python 3.14.4, synthetic inputs only.
GPUs tested: n/a (CPU-only).
AI-assisted: original patch by Claude Code (Claude Opus 5.5), rebase and verification by Codex.
Checklist
mainand merges cleanly.Independent verification (overnight shift, CPU/tooling only, no game data).
Commands run on head 99468371 (Git Bash, py -3.14):
py -3.14 -m compileall -q tools/conformance/compare.py tests/test_conformance_compare_crash.py— cleanpy -3.14 -I tests/test_conformance_compare_crash.py: Ran 2 tests, OK (covers both in-process exit code and the real CLI subprocess exit status)py -3.14 -I tools/conformance/compare.py selftest: selftest passedConfirmed the bug is real on the merge base:
4a50cafc7:tools/conformance/compare.pyline 1867 callstraceback.print_exc()insidemain()'s catch-allexcept Exception, buttracebackis never imported — so an unexpected exception would itself raise NameError inside the handler and escapemain(), which Python reports as exit 1, indistinguishable from a pixel mismatch. The one-lineimport tracebackfixes exactly that; the new test's crash path now prints the traceback, the 'bug in compare.py, not a pixel mismatch' message, and returns EXIT_ERROR (2).Verdict: verified, minimal correct fix.
AI-assisted verification (Devin).
Red/green:
pytest tests/test_conformance_compare_crash.pyfails on main (2 failed) and passes on head 99468371e8e5 merged with main (2 passed).Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)