[PR #256] Conformance expect returns input-error status for unreadable images #308

Open
opened 2026-11-26 20:17:27 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/256
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9987


📝 Commits (2)

  • bd1569b Distinguish unreadable expect inputs from pixel mismatches
  • a631bc6 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

Carried over from old PR 9987 by lucastayaralvarenga-ui in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9987, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
lucastayaralvarenga-ui: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Restores #7167 after the repository-transfer closure. The original PR cannot be reopened by its author (viewerCanReopen: false). This resubmission uses the same branch and unchanged head a631bc68c4ce2ad4f7fb1993e6611aedfcf486da. Original independent review/test evidence: https://github.com/ProjectLeonida/Leonida/pull/7167#issuecomment-7111095925.

An unreadable image in compare.py expect now returns exit 2, matching the tool's documented input-error contract. The command still reports every scene, and readable images with mismatched pixels return 1. This also updates the built-in selftest and the conflicting exit-code note in COMPARE.md. Following review, the expect documentation explicitly lists exit codes 0, 1 and 2, including image-error precedence in mixed runs.

Claimed in coordination.

Rebased onto main 1ce6eb5f5. Tested head a631bc68c on Windows with Python 3.12.16 and synthetic inputs only. The regression's missing and corrupt images failed on the original parent. All four input states pass on this head, including mixed image errors and pixel mismatches. The four transparency tests and all 22 built-in selftest checks pass. Compilation, git diff --check and the game-data check pass. CPU-only, no GPU run.

AI-assisted (Codex).

Fresh integration verification against ProjectLeonida/Leonida main "d083a2cc3": clean merge, tests/test_conformance_expect_status.py: 1 test with 4 input-state subtests; tests/test_conformance_png_transparency.py: 4 tests; compare.py selftest: all 22 checks passed. Whitespace and changed-file game-data checks passed. Windows, Python 3.12.16, CPU only, synthetic inputs; no GPU run. AI-assisted (Codex).

Resubmission claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116960294


🔄 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/256 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9987` --- ### 📝 Commits (2) - [`bd1569b`](https://github.com/ubiquitarianism/leonida/commit/bd1569b47446f5b056c9eaba928a6db18df8a7b8) Distinguish unreadable expect inputs from pixel mismatches - [`a631bc6`](https://github.com/ubiquitarianism/leonida/commit/a631bc68c4ce2ad4f7fb1993e6611aedfcf486da) 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 > Carried over from **old PR 9987** by `lucastayaralvarenga-ui` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9987`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `lucastayaralvarenga-ui`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Restores `#7167` after the repository-transfer closure. The original PR cannot be reopened by its author (`viewerCanReopen: false`). This resubmission uses the same branch and unchanged head `a631bc68c4ce2ad4f7fb1993e6611aedfcf486da`. Original independent review/test evidence: https://github.com/ProjectLeonida/Leonida/pull/7167#issuecomment-7111095925. An unreadable image in `compare.py expect` now returns exit 2, matching the tool's documented input-error contract. The command still reports every scene, and readable images with mismatched pixels return 1. This also updates the built-in selftest and the conflicting exit-code note in COMPARE.md. Following review, the `expect` documentation explicitly lists exit codes 0, 1 and 2, including image-error precedence in mixed runs. Claimed in [coordination](https://github.com/ProjectLeonida/Leonida/issues/7049#issuecomment-7106575790). Rebased onto main `1ce6eb5f5`. Tested head `a631bc68c` on Windows with Python 3.12.16 and synthetic inputs only. The regression's missing and corrupt images failed on the original parent. All four input states pass on this head, including mixed image errors and pixel mismatches. The four transparency tests and all 22 built-in selftest checks pass. Compilation, `git diff --check` and the game-data check pass. CPU-only, no GPU run. AI-assisted (Codex). Fresh integration verification against ProjectLeonida/Leonida main "d083a2cc3": clean merge, tests/test_conformance_expect_status.py: 1 test with 4 input-state subtests; tests/test_conformance_png_transparency.py: 4 tests; compare.py selftest: all 22 checks passed. Whitespace and changed-file game-data checks passed. Windows, Python 3.12.16, CPU only, synthetic inputs; no GPU run. AI-assisted (Codex). Resubmission claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116960294 --- <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#308
No description provided.