ps_sweep: preserve proven color mismatches in exact reports (BUILD-3988) #63

Closed
Andretuta wants to merge 1 commit from upstream-pr/63 into main
Andretuta commented 2026-11-24 02:11:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:11:00Z.


Carried over from old PR 9787 by olegmkrv in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9787, 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.
olegmkrv: 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):

Summary

compare --exact could classify a draw as missing or incompatible if depth was unusable, even when complete color readbacks already proved a mismatch. Preserve the draw mismatch and keep the separate depth_class diagnostic. Matching color with unusable depth is still classified as missing or incompatible. Tolerance-based comparison is unchanged.

Coordination: BUILD-3988 claim.

Tests

macOS 26.5.2 arm64, Python 3.14.6, CPU-only synthetic fixtures; no game files, GPU, or driver used.

  • python3 -I -B tests/test_ps_sweep.py — 22 passed, 3 skipped (require a Vulkan worker), with the patch merged locally onto main 2d53a8055.
  • python3 -I -B tests/test_ab_control_flow.py — 64 passed on the branch.
  • Negative control: the new regression fails on unpatched 5d74c2723, which reports two proven color mismatches as missing/incompatible draws.

AI-assisted (OpenCode, Muse Spark 1.3 and GPT-6.2 Sol).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464751689 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/63). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:11:00Z. --- > Carried over from **old PR 9787** by `olegmkrv` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9787`, 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. > `olegmkrv`: 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): ## Summary `compare --exact` could classify a draw as `missing` or `incompatible` if depth was unusable, even when complete color readbacks already proved a mismatch. Preserve the draw `mismatch` and keep the separate `depth_class` diagnostic. Matching color with unusable depth is still classified as missing or incompatible. Tolerance-based comparison is unchanged. Coordination: [BUILD-3988 claim](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115365033). ## Tests macOS 26.5.2 arm64, Python 3.14.6, CPU-only synthetic fixtures; no game files, GPU, or driver used. - `python3 -I -B tests/test_ps_sweep.py` — 22 passed, 3 skipped (require a Vulkan worker), with the patch merged locally onto `main` `2d53a8055`. - `python3 -I -B tests/test_ab_control_flow.py` — 64 passed on the branch. - Negative control: the new regression fails on unpatched `5d74c2723`, which reports two proven color mismatches as missing/incompatible draws. AI-assisted (OpenCode, Muse Spark 1.3 and GPT-6.2 Sol).
wavehs commented 2026-11-24 02:47:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T02:47:51Z.


macOS arm64 verification (Apple M3 Pro) — the one-line fix is right, and it makes --exact agree with the non-exact path; measured

Head fae4bbc90 (branch base 5d74c2723, 877 commits behind), merged onto main (9ec34cdff) as 7c9f7d68d with no conflicts. 2 files +36/−1, and git diff ubi/main is exactly that change. Host: macOS 27.2.1, Apple M3 Pro (arm64), CPython 3.15.2, MoltenVK 1.4.0, KosmicKrisp (Mesa 26.3.0).

Check Merged 7c9f7d68d main 9ec34cdff
tests/test_ps_sweep.py 25 run, OK (3 skipped: Vulkan worker) same file + main's ps_sweep.py: 1 failure, the new test
scripts/run_semantic_tests.py tests/semantic 463 files, 6,075 tests, 2 failed 463 / 6,075 / 2
the two failing files test_exec_computed, test_image_atomics_guard the same two
run_gpu_tests.py all cases, MoltenVK 182/248 passed, 61 skipped 182/248, 61 skipped
run_gpu_tests.py all cases, KosmicKrisp 177/248 passed, 64 skipped 177/248, 64 skipped

The GPU rows are identical to main line for line on both drivers (after normalising work paths) — this touches only the report path of a tool, not the translator or the fixtures.

Negative control: main's tools/ps_sweep.py with the new test file gives exactly one failure:

FAIL: test_exact_keeps_color_mismatch_with_bad_depth
AssertionError: {'missing': 2, 'incompatible': 1} != {'mismatch': 2, 'missing': 1}

so the test bites, and only it. (I first ran the branch's own base 5d74c2723 and got a second, unrelated failure, test_non_positive_timeout_is_a_usage_error — that file predates main's usage-error handling by 877 commits, which is why the NC above uses main's file. Worth knowing when re-running: the branch tree is stale, the merged tree is what matters.)

The fix is the consistent one. The non-exact compare already only lets an unusable depth override a draw that was otherwise OK on both (cmd_compare: if c == "OK on both" and depth.get("depth_class") in (...)). The exact path did not: it replaced a proven color mismatch with missing/incompatible, which are measurement failures (no .raw.depth, wrong length, bad samples_passed), not evidence that the color matches. After the change the row keeps class: mismatch and still carries depth_class and the rest of the depth measurements, so nothing is hidden. The test covers the three cases that matter — absent depth on one side, short depth on one side, and a matching-color control with absent depth (still classified missing, targets: ["non-clear exact"]) — at both sides of the pair.

One non-blocking note for whoever compares reports across this change: draws now counts those rows under mismatch instead of missing/incompatible, so a re-run of the same corpus will show both numbers moving even though the GPU results did not. The per-row depth_class still lets anyone recover the depth tally (Counter(r["depth_class"] for r in rows if r["depth_class"] not in ("exact", None))); if the headline is meant to be read alone, a small depth_draws counter in the report would keep the depth problems visible at the top level.

No game files. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7120487718 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/63#issuecomment-7120487718). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T02:47:51Z. --- **macOS arm64 verification (Apple M3 Pro) — the one-line fix is right, and it makes `--exact` agree with the non-exact path; measured** Head `fae4bbc90` (branch base `5d74c2723`, 877 commits behind), merged onto `main` (`9ec34cdff`) as `7c9f7d68d` with no conflicts. 2 files +36/−1, and `git diff ubi/main` is exactly that change. Host: macOS 27.2.1, Apple M3 Pro (arm64), CPython 3.15.2, MoltenVK 1.4.0, KosmicKrisp (Mesa 26.3.0). | Check | Merged `7c9f7d68d` | `main` `9ec34cdff` | |---|---|---| | `tests/test_ps_sweep.py` | **25 run, OK (3 skipped: Vulkan worker)** | same file + main's `ps_sweep.py`: **1 failure**, the new test | | `scripts/run_semantic_tests.py tests/semantic` | **463 files, 6,075 tests, 2 failed** | 463 / 6,075 / 2 | | the two failing files | `test_exec_computed`, `test_image_atomics_guard` | the same two | | `run_gpu_tests.py` all cases, MoltenVK | **182/248 passed, 61 skipped** | 182/248, 61 skipped | | `run_gpu_tests.py` all cases, KosmicKrisp | **177/248 passed, 64 skipped** | 177/248, 64 skipped | The GPU rows are identical to `main` line for line on both drivers (after normalising work paths) — this touches only the report path of a tool, not the translator or the fixtures. **Negative control:** main's `tools/ps_sweep.py` with the new test file gives exactly one failure: ``` FAIL: test_exact_keeps_color_mismatch_with_bad_depth AssertionError: {'missing': 2, 'incompatible': 1} != {'mismatch': 2, 'missing': 1} ``` so the test bites, and only it. (I first ran the branch's own base `5d74c2723` and got a second, unrelated failure, `test_non_positive_timeout_is_a_usage_error` — that file predates main's usage-error handling by 877 commits, which is why the NC above uses main's file. Worth knowing when re-running: the branch tree is stale, the merged tree is what matters.) **The fix is the consistent one.** The non-exact `compare` already only lets an unusable depth override a draw that was otherwise `OK on both` (`cmd_compare`: `if c == "OK on both" and depth.get("depth_class") in (...)`). The exact path did not: it replaced a proven color mismatch with `missing`/`incompatible`, which are *measurement* failures (no `.raw.depth`, wrong length, bad `samples_passed`), not evidence that the color matches. After the change the row keeps `class: mismatch` and still carries `depth_class` and the rest of the depth measurements, so nothing is hidden. The test covers the three cases that matter — absent depth on one side, short depth on one side, and a matching-color control with absent depth (still classified `missing`, `targets: ["non-clear exact"]`) — at both sides of the pair. One non-blocking note for whoever compares reports across this change: `draws` now counts those rows under `mismatch` instead of `missing`/`incompatible`, so a re-run of the same corpus will show both numbers moving even though the GPU results did not. The per-row `depth_class` still lets anyone recover the depth tally (`Counter(r["depth_class"] for r in rows if r["depth_class"] not in ("exact", None))`); if the headline is meant to be read alone, a small `depth_draws` counter in the report would keep the depth problems visible at the top level. No game files. AI-assisted.
Dezmonius commented 2026-11-24 07:50:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Dezmonius on 2026-11-24T07:50:57Z.


Independent Windows check of fae4bbc90 on current main (1c93c86), CPython 3.14.7. The PR applies cleanly. test_ps_sweep.py reports 25 tests, OK (3 Vulkan-worker skips). With the new test on unmodified main, it fails as expected: {'missing': 2, 'incompatible': 1} instead of {'mismatch': 2, 'missing': 1}.

I also ran compare --exact on five synthetic rows with complete color and depth files. When one side's samples_passed is one above the pixel count, the patched report keeps class: mismatch for differing colors with depth_class: incompatible; the matching-color control remains incompatible. A genuine one-pixel depth mismatch still reports class: mismatch and depth_different_pixels: 1 with both matching and differing colors. The matching-color/depth control remains exact.

Synthetic results only, CPU-only. AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7125439156 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/63#issuecomment-7125439156). Originally posted by [Dezmonius](https://github.com/Dezmonius) on 2026-11-24T07:50:57Z. --- Independent Windows check of `fae4bbc90` on current `main` (`1c93c86`), CPython 3.14.7. The PR applies cleanly. `test_ps_sweep.py` reports 25 tests, OK (3 Vulkan-worker skips). With the new test on unmodified main, it fails as expected: `{'missing': 2, 'incompatible': 1}` instead of `{'mismatch': 2, 'missing': 1}`. I also ran `compare --exact` on five synthetic rows with complete color and depth files. When one side's `samples_passed` is one above the pixel count, the patched report keeps `class: mismatch` for differing colors with `depth_class: incompatible`; the matching-color control remains `incompatible`. A genuine one-pixel depth mismatch still reports `class: mismatch` and `depth_different_pixels: 1` with both matching and differing colors. The matching-color/depth control remains exact. Synthetic results only, CPU-only. AI-assisted (Codex).
MoonEyes commented 2026-11-27 19:43:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T19:43:52Z.


Thanks a lot for carrying this over, @Andretuta. The same change is in #1318: it cherry-picks olegmkrv's commit from old-pr/9787 with the same diff to tools/ps_sweep.py and tests/test_ps_sweep.py, and it was claimed in #14 as DRAFT-63.

I am closing this draft so the review happens in one place. Please continue the discussion on #1318, or reopen this one if you see something it misses.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226814989 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/63#issuecomment-7226814989). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T19:43:52Z. --- Thanks a lot for carrying this over, @Andretuta. The same change is in #1318: it cherry-picks olegmkrv's commit from `old-pr/9787` with the same diff to `tools/ps_sweep.py` and `tests/test_ps_sweep.py`, and it was claimed in #14 as DRAFT-63. I am closing this draft so the review happens in one place. Please continue the discussion on #1318, or reopen this one if you see something it misses. AI-assisted (Claude Code, Claude Opus 5.5)

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