conformance: return exit 2 for unreadable expect inputs (DRAFT-256) #1322

Closed
fin-github wants to merge 2 commits from upstream-pr/1322 into main
fin-github commented 2026-11-24 21:51:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fin-github on 2026-11-24T21:51:06Z.


Claimed in the coordination issue as: DRAFT-256 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145350336)

What and why

Supersedes carried-over draft #256. Both of Tayar's original commits from old-pr/9987 were cherry-picked with -x onto main at 4a50cafc7.

compare.py expect now returns exit 2 for missing or unreadable images, even when another scene has a pixel mismatch. It still reports every scene. Exit 1 indicates pixel mismatches across readable inputs, and exit 0 indicates a match. The documentation and selftest reflect those statuses.

Tested

On baseline 4a50cafc7, the missing and corrupt PNG subtests both returned 1. Reproduced in PowerShell with:

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

All four exit-status subtests, four PNG transparency tests and all 22 comparison selftest checks passed. Compilation, changed-file game-data check and whitespace checks passed.

python -I tests/test_conformance_expect_status.py
python -I tests/test_conformance_png_transparency.py
python -I tools/conformance/compare.py selftest
python -m compileall -q make_game.py tools tests
$changed = git diff --name-only upstream/main...HEAD
python -I scripts/check_no_game_data.py @changed
git diff --check upstream/main...HEAD

Windows 11 build 26200, Python 3.14.4, synthetic inputs only.

GPUs tested: n/a (CPU-only).

AI-assisted (Codex): rebasing and verification.

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480929659 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1322). Originally posted by [fin-github](https://github.com/fin-github) on 2026-11-24T21:51:06Z. --- Claimed in the coordination issue as: DRAFT-256 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145350336) ### What and why Supersedes carried-over draft #256. Both of Tayar's original commits from `old-pr/9987` were cherry-picked with `-x` onto `main` at `4a50cafc7`. `compare.py expect` now returns exit 2 for missing or unreadable images, even when another scene has a pixel mismatch. It still reports every scene. Exit 1 indicates pixel mismatches across readable inputs, and exit 0 indicates a match. The documentation and selftest reflect those statuses. ### Tested On baseline `4a50cafc7`, the missing and corrupt PNG subtests both returned 1. Reproduced in PowerShell with: ```powershell git show bd1569b47:tests/test_conformance_expect_status.py | python -I -c "exec(compile(__import__('sys').stdin.read(), __file__ := 'tests/test_conformance_expect_status.py', 'exec'))" ``` All four exit-status subtests, four PNG transparency tests and all 22 comparison selftest checks passed. Compilation, changed-file game-data check and whitespace checks passed. ```powershell python -I tests/test_conformance_expect_status.py python -I tests/test_conformance_png_transparency.py python -I tools/conformance/compare.py selftest python -m compileall -q make_game.py tools tests $changed = git diff --name-only upstream/main...HEAD python -I scripts/check_no_game_data.py @changed git diff --check upstream/main...HEAD ``` Windows 11 build 26200, Python 3.14.4, synthetic inputs only. GPUs tested: n/a (CPU-only). AI-assisted (Codex): rebasing and verification. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption.
whoalin1 commented 2026-11-24 23:40:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-24T23:40:07Z.


Independent verification (overnight shift, CPU/tooling only, no game data).

Commands run on head 520b3525 (Git Bash, py -3.14):

  • py -3.14 -m compileall -q tools/conformance/compare.py tests/test_conformance_expect_status.py — clean
  • py -3.14 -I tests/test_conference_expect_status.py — wait, tests/test_conformance_expect_status.py: Ran 1 test, OK
  • py -3.14 -I tests/test_conformance_png_transparency.py: Ran 4 tests, OK
  • py -3.14 -I tools/conformance/compare.py selftest: selftest passed
  • Manual repro: manifest with one scene whose image has a wrong pixel plus one scene whose PNG is missing → both FAIL rows printed (pixel FAIL and image problem: cannot read PNG image ...), summary 2 scenes, 2 checks: 0 passed, 2 failed, 1 image could not be read, process exit 2. Confirms image errors take precedence over pixel mismatches and every scene is still reported.

Code check: command_expect returns EXIT_ERROR (2) when any SceneOutcome.image_problem is set, else 1/0 by pixel result; verify_scene converts ToolError from read_png into image_problem, so unreadable images never reach the pixel path. COMPARE.md exit-code documentation updated consistently.

Verdict: verified, no issues found.

AI-assisted verification (Devin).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7147661849 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1322#issuecomment-7147661849). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-24T23:40:07Z. --- Independent verification (overnight shift, CPU/tooling only, no game data). Commands run on head 520b3525 (Git Bash, py -3.14): - `py -3.14 -m compileall -q tools/conformance/compare.py tests/test_conformance_expect_status.py` — clean - `py -3.14 -I tests/test_conference_expect_status.py` — wait, `tests/test_conformance_expect_status.py`: Ran 1 test, OK - `py -3.14 -I tests/test_conformance_png_transparency.py`: Ran 4 tests, OK - `py -3.14 -I tools/conformance/compare.py selftest`: selftest passed - Manual repro: manifest with one scene whose image has a wrong pixel plus one scene whose PNG is missing → both FAIL rows printed (pixel FAIL and `image problem: cannot read PNG image ...`), summary `2 scenes, 2 checks: 0 passed, 2 failed, 1 image could not be read`, process exit 2. Confirms image errors take precedence over pixel mismatches and every scene is still reported. Code check: `command_expect` returns `EXIT_ERROR` (2) when any `SceneOutcome.image_problem` is set, else 1/0 by pixel result; `verify_scene` converts `ToolError` from `read_png` into `image_problem`, so unreadable images never reach the pixel path. COMPARE.md exit-code documentation updated consistently. Verdict: verified, no issues found. AI-assisted verification (Devin).
DadaCap commented 2026-11-28 10:33:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:33:20Z.


Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures.

Reason: duplicate of older #256.

If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237972095 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1322#issuecomment-7237972095). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T10:33:20Z. --- Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures. Reason: duplicate of older #256. If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

Pull request closed

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!1322
No description provided.