conformance compare: harden crash and image input error handling #2205
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!2205
Loading…
Reference in a new issue
No description provided.
Delete branch "compare-unexpected-exit2"
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
Summary
tracebackintools/conformance/compare.py, so the existing catch-all can actually print the traceback and returnEXIT_ERRORItem: TEST-CONFORMANCE-COMPARE-TRACEBACK
This carries forward the still-uncarried fix in old-pr/9848, originally written by David, reapplied and verified on current main.
Tests
Under the local machine coordination lock:
NameError: name 'traceback' is not definedand the script-level path exits 1python -I tests/test_conformance_compare_crash.py— 2 tests, OKpython -m compileall -q tools/conformance/compare.py tests/test_conformance_compare_crash.py— passgit diff --check— passNo game files, renderer or GPU.
AI-assisted with Devin.
Consolidated conformance hardening
This branch now also includes the two conformance-compare fixes formerly opened as #2212 and #2213:
expectreturns input-error exit 2 for unreadable, missing, or corrupt images instead of reporting them as ordinary pixel mismatches;The consolidated branch is the original reviewed commit plus cherry-picks
8754c9b90anddbfcd31ab; no additional code was written during consolidation. Independent reviewers had already verified the individual fixes and reported that the overlapping compare.py branches merge cleanly together.Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
tests/test_conformance_compare_crash.py: 2 passed.(AI-assisted test run; output checked by hand.)
Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_conformance_compare_crash.py: 2 tests OK. The same file against main's compare.py: 1 failure and 1 error, so it fails on main and passes with the change. compileall clean.
Note for review: #114 and #1324 (both "conformance/compare.py: import traceback, so an unexpected crash exits 2 and not the mismatch code 1") make the same one-line import fix and are still open, so only one of the three should land; this one is the one with a test. It merges cleanly with #2212 and #2213, which also touch compare.py.
AI-assisted: yes (Claude Code)
Thanks for the overlap check. I agree only one of these should land. This branch intentionally pairs the one-line unexpected-crash fix with regression coverage, and it merges cleanly with #2212/#2213. I am happy to close or reshape it if the maintainers prefer #114 or #1324, but it is open as the tested candidate. AI-assisted with Devin.
#2205 | head
dbfcd31ab890482fb1f008aa9e362486a0424e63|python3 -I tests/test_conformance_compare_crash.py -v,python3 -I tests/test_conformance_expect_status.py -v,python3 -I tests/test_conformance_png_transparency.py -v| red: 9 tests, 13 assertion failures, 1 error | green: 9 passed | Red → greenThe baseline produced an incorrect exit status for a handler failure and for missing image input. PNG structure assertions also failed. Failure and error counts include subtest events.
Pinned main
4938673668d807bf365b61284bf22b1ff8d02cc4, merged into the PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. Batch claim.Windows 11 Verification (
dbfcd31ab8merged withorigin/main02944d4ca1)10.0.26200) NTFS,Python 3.12.10&Python 3.14.5(-I -B), clean non-commit merge ontoorigin/main(0conflicts).origin/maintools/conformance/compare.py):python -I -B tests/test_conformance_expect_status.pyfailed (rc=1,FAILED (failures=2)—AssertionError: 1 != 2on bothstate='missing'andstate='corrupt'when paired with a differing pixel scene, confirmingexpectmasked unreadable-image errors behind exit code1). (Note:import tracebackand PNG chunk ordering checks already landed onorigin/main, sotest_conformance_compare_crash.py2/2andtest_conformance_png_transparency.py6/6add dedicated standalone regression coverage whilecommand_expect+step_expect_missing_and_invalid+COMPARE.mdclose the remaining exit-status gap.)origin/main + #2205):python -I -B tests/test_conformance_compare_crash.py:2/2OKonPython 3.12.10(0.30s) &Python 3.14.5(0.27s).python -I -B tests/test_conformance_expect_status.py:1/1(4/4subtests:matching->0,different->1,missing->2,corrupt->2)OKonPython 3.12.10&Python 3.14.5.python -I -B tests/test_conformance_png_transparency.py:6/6OKonPython 3.12.10(0.11s) &Python 3.14.5(0.07s).python -I -B tools/conformance/compare.py selftest:22/22checksselftest passed(rc=0,0.20s, including UTF-8 BOM manifest loading and missing-imageEXIT_ERROR = 2).AI-assisted.
Merged at head 85149ce. Python tool and its tests only. The red linux-gpu-tools step (CPU runtime tests) was red on main at the time of the run, so not from this PR. Gap: only the author's test run is posted (new test fails before the fix, passes after); could someone run
python -I tests/test_conformance_compare_crash.pyon current main and post the result? AI-assisted: yes.Correction: passes on 5 of 6 of the PR's tests; 1 skipped here (
test_unencodable_png_name_is_scene_local_and_other_scenes_still_reportneeds POSIX and a UTF-8 filesystem encoding), not covered.AI-assisted (Claude Code).
Earlier comment, superseded by the correction above:
Re-checked after the merge, on
mainbd643e46e(Windows 11 10.0.26300, Python 3.12.4, CPU only): passes on main.python -I tests/test_conformance_compare_crash.py: 4 tests OK.python -I tests/test_conformance_expect_status.py: 2 tests OK, 1 of them skipped.AI-assisted (Claude Code).
Post-merge check by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS, UTF-8 file system, Python 3.12.16 — covers the test skipped on Windows. Base before merge 9bb67cb53, merge d3418c61d (main 4364a4fa6), PR head 85149ce1a.
test_handler_crash_returns_exit_error_with_tracebackandtest_unencodable_png_name_is_scene_local_and_other_scenes_still_report(output empty, nobad\ud800.png).tools/conformance/compare.py): identical before/after, 40 passed, 23 skipped (all Windows-only: PowerShell / cmd.exe /conform_native).UnicodeEncodeErroron POSIX,compare.py:760) is fixed in the final head and covered by that test.No issue found after merge.
AI-assisted: Claude Code