[PR #1324] conformance: preserve traceback and exit 2 for unexpected exceptions (DRAFT-114) #1354

Open
opened 2026-11-26 20:20:57 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1324
Author: @fin-github
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: codex/draft-114


📝 Commits (1)

  • 9946837 conformance/compare.py: import traceback, so an unexpected crash exits 2 and not the mismatch code 1

📊 Changes

2 files changed (+59 additions, -0 deletions)

View changed files

➕ tests/test_conformance_compare_crash.py (+58 -0)
📝 tools/conformance/compare.py (+1 -0)

📄 Description

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/9848 was cherry-picked with -x onto main at 4a50cafc7.

compare.py now imports traceback so 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 raised NameError and the subprocess test returned 1. Reproduced in PowerShell with:

git show 9aece26a3:tests/test_conformance_compare_crash.py | python -I -c "exec(compile(__import__('sys').stdin.read(), __file__ := 'tests/test_conformance_compare_crash.py', 'exec'))"

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.

python -I tests/test_conformance_compare_crash.py
python -I tests/test_conformance_png_transparency.py
python -I tools/conformance/compare.py selftest
$changed = git diff --name-only upstream/main...HEAD
python -m compileall -q @changed
python -I scripts/check_no_game_data.py @changed
git diff --check upstream/main...HEAD
git merge-tree --write-tree HEAD codex/draft-256

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

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1324 **Author:** [@fin-github](https://github.com/fin-github) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/draft-114` --- ### 📝 Commits (1) - [`9946837`](https://github.com/ubiquitarianism/leonida/commit/99468371e8e5bff50342d7b51b65eb1ae016a98b) conformance/compare.py: import traceback, so an unexpected crash exits 2 and not the mismatch code 1 ### 📊 Changes **2 files changed** (+59 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_conformance_compare_crash.py` (+58 -0) 📝 `tools/conformance/compare.py` (+1 -0) </details> ### 📄 Description 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/9848` was cherry-picked with `-x` onto `main` at `4a50cafc7`. `compare.py` now imports `traceback` so 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 raised `NameError` and the subprocess test returned 1. Reproduced in PowerShell with: ```powershell git show 9aece26a3:tests/test_conformance_compare_crash.py | python -I -c "exec(compile(__import__('sys').stdin.read(), __file__ := 'tests/test_conformance_compare_crash.py', 'exec'))" ``` 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. ```powershell python -I tests/test_conformance_compare_crash.py python -I tests/test_conformance_png_transparency.py python -I tools/conformance/compare.py selftest $changed = git diff --name-only upstream/main...HEAD python -m compileall -q @changed python -I scripts/check_no_game_data.py @changed git diff --check upstream/main...HEAD git merge-tree --write-tree HEAD codex/draft-256 ``` 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 - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1354
No description provided.