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

Open
github-bot wants to merge 1 commit from github-bot/gh-63 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:11 UTC · original
ubiquitarianism:old-pr/9787 → main · +36 −1 · 2 files · 1 commits · draft

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

**@⁠Andretuta** on GitHub · 2026-11-24 02:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/63) `ubiquitarianism:old-pr/9787` → `main` · +36 −1 · 2 files · 1 commits · draft > 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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:42:48 +00:00
Author
Owner

@⁠wavehs on GitHub · 2026-11-24 02:47 UTC · original

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.

**@⁠wavehs** on GitHub · 2026-11-24 02:47 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/63#issuecomment-7120487718) **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.
Author
Owner

@⁠Dezmonius on GitHub · 2026-11-24 07:50 UTC · original

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

**@⁠Dezmonius** on GitHub · 2026-11-24 07:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/63#issuecomment-7125439156) 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).
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/63/head:github-bot/gh-63'
git switch 'github-bot/gh-63'

Merge

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