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

Closed
leonida/mandy
fin-github wants to merge 0 commits from codex/draft-256 into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

fin-github commented 2026-11-24 21:51:06 +00:00

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.
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

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).

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

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.

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.
Sign in to join this conversation.
No description provided.