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

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/1322
Author: @fin-github
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: codex/draft-256


📝 Commits (2)

  • a50d23a Distinguish unreadable expect inputs from pixel mismatches
  • 520b352 Clarify expect exit codes and image-error precedence

📊 Changes

3 files changed (+63 additions, -9 deletions)

View changed files

➕ tests/test_conformance_expect_status.py (+51 -0)
📝 tools/conformance/COMPARE.md (+7 -7)
📝 tools/conformance/compare.py (+5 -2)

📄 Description

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.

🔄 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/1322 **Author:** [@fin-github](https://github.com/fin-github) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/draft-256` --- ### 📝 Commits (2) - [`a50d23a`](https://github.com/ubiquitarianism/leonida/commit/a50d23a1ee3be56ecc4c2f919f6cb49ccbc0966e) Distinguish unreadable expect inputs from pixel mismatches - [`520b352`](https://github.com/ubiquitarianism/leonida/commit/520b352553b5f25cb3894c0edac2b5796c2e00c9) Clarify expect exit codes and image-error precedence ### 📊 Changes **3 files changed** (+63 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_conformance_expect_status.py` (+51 -0) 📝 `tools/conformance/COMPARE.md` (+7 -7) 📝 `tools/conformance/compare.py` (+5 -2) </details> ### 📄 Description 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. --- <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#1351
No description provided.