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

Open
github-bot wants to merge 2 commits from github-bot/gh-1322 into main AGit
Owner

@⁠fin-github on GitHub · 2026-11-24 21:51 UTC · original
fin-github:codex/draft-256 → main · +63 −9 · 3 files · 2 commits · open

Claimed in the coordination issue as: DRAFT-256 (#14)

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.
**@⁠fin-github** on GitHub · 2026-11-24 21:51 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1322) `fin-github:codex/draft-256` → `main` · +63 −9 · 3 files · 2 commits · open Claimed in the coordination issue as: DRAFT-256 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:47:25 +00:00
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-24 23:40 UTC · original

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

**@⁠whoalin1** on GitHub · 2026-11-24 23:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1322#issuecomment-7147661849) 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).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1322/head:github-bot/gh-1322'
git switch 'github-bot/gh-1322'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1322'
git switch 'github-bot/gh-1322'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1322'
git switch 'github-bot/gh-1322'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1322'
git switch 'main'
git merge --squash 'github-bot/gh-1322'
git switch 'main'
git merge --ff-only 'github-bot/gh-1322'
git switch 'main'
git merge 'github-bot/gh-1322'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.