Reject non-finite channels in First Light readbacks (FIRST-LIGHT-FINITE-READBACK) #2040

Merged
alexandersato0830 merged 1 commit from upstream-pr/2040 into main 2026-11-28 10:47:48 +00:00
alexandersato0830 commented 2026-11-25 18:47:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by alexandersato0830 on 2026-11-25T18:47:18Z.


Claimed in the coordination issue as: FIRST-LIGHT-FINITE-READBACK

What and why

First Light checks image coverage and selected pixels. A non-finite color outside those probes can leave both checks passing and produce a successful render verdict. Reject non-finite readback channels before calculating coverage or comparing probes. The standalone preview writer still handles those values when it is used for diagnostics.

Tested

  • The new synthetic regression for an unprobed covered pixel fails with NaN and both infinities on 9f9a7c5f3, then passes with the fix.
  • python -I tests/test_first_light.py ran 49 tests with 8 environment-dependent skips. tests/test_first_light_mesh_draw.py (3 tests) and tests/test_first_light_bad_json.py (12 tests) all passed. Tested on Windows 11 with Python 3.11.17.
  • git diff --check and the source-only check passed.

GPUs tested: n/a (synthetic readbacks)

AI-assisted: yes (Codex)

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5497180430 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2040). Originally posted by [alexandersato0830](https://github.com/alexandersato0830) on 2026-11-25T18:47:18Z. --- Claimed in the coordination issue as: [FIRST-LIGHT-FINITE-READBACK](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7171370282) ### What and why First Light checks image coverage and selected pixels. A non-finite color outside those probes can leave both checks passing and produce a successful render verdict. Reject non-finite readback channels before calculating coverage or comparing probes. The standalone preview writer still handles those values when it is used for diagnostics. ### Tested - The new synthetic regression for an unprobed covered pixel fails with NaN and both infinities on `9f9a7c5f3`, then passes with the fix. - `python -I tests/test_first_light.py` ran 49 tests with 8 environment-dependent skips. `tests/test_first_light_mesh_draw.py` (3 tests) and `tests/test_first_light_bad_json.py` (12 tests) all passed. Tested on Windows 11 with Python 3.11.17. - `git diff --check` and the source-only check passed. GPUs tested: n/a (synthetic readbacks) AI-assisted: yes (Codex) ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys or decryption.
DeadlyChirp commented 2026-11-26 10:32:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-26T10:32:35Z.


Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_first_light.py: 45 passed, 8 skipped, 95 subtests passed (main: 44 passed). The skips are environment ones (no symlink privilege, vk_harness not built), the same on main.

(AI-assisted test run; output checked by hand.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7189504333 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2040#issuecomment-7189504333). Originally posted by [DeadlyChirp](https://github.com/DeadlyChirp) on 2026-11-26T10:32:35Z. --- Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_first_light.py`: 45 passed, 8 skipped, 95 subtests passed (main: 44 passed). The skips are environment ones (no symlink privilege, `vk_harness` not built), the same on main. (AI-assisted test run; output checked by hand.)
sodove commented 2026-11-28 10:11:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T10:11:56Z.


#2040 | head 4171724fb3db097f0a6ba70cccf9f8357f6d0201 | python3 -I tests/test_first_light.py -v | red: 49 run, 3 failures, 4 skips | green: 45 passed, 4 skipped | Red → green

Three assertions accepted non-finite readback channels on main. Three checks requiring a First Light fixture directory and one optional native harness check skipped on both sides.

Pinned main 33db04a7010e81c40a7a6a15624525aa0c4a3a58, merged into this PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. Batch claim.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237738091 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2040#issuecomment-7237738091). Originally posted by [sodove](https://github.com/sodove) on 2026-11-28T10:11:56Z. --- #2040 | head `4171724fb3db097f0a6ba70cccf9f8357f6d0201` | `python3 -I tests/test_first_light.py -v` | red: 49 run, 3 failures, 4 skips | green: 45 passed, 4 skipped | **Red → green** Three assertions accepted non-finite readback channels on main. Three checks requiring a First Light fixture directory and one optional native harness check skipped on both sides. Pinned main `33db04a7010e81c40a7a6a15624525aa0c4a3a58`, merged into this PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. [Batch claim](https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7237628300).
DadaCap commented 2026-11-28 10:47:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:47:50Z.


Merged, thank you @alexandersato0830!

What it does: Reject non-finite channels in First Light readbacks (FIRST-LIGHT-FINITE-READBACK)

How it was checked: sodove tested this PR at head 4171724fb on main 33db04a70: the PR's own test fails on main and passes with this PR merged in (his result is linked from the batch summary in #1608). We then re-ran the same test locally on Windows 11 and got the same verdict: on main, red (3 failures); with the PR, green (49 OK, 8 skips).

CI: the red jobs on this PR fail the same way on main, or on the older main it was built on (the cs_dpp_cmp.asm translator fixture, since fixed on main, and the Windows runner's Visual Studio setup), so none comes from this change.

Merged one by one with 20 other PRs of the same reviewed batch, pinned to the tested head.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238128194 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2040#issuecomment-7238128194). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T10:47:50Z. --- Merged, thank you @alexandersato0830! **What it does:** Reject non-finite channels in First Light readbacks (FIRST-LIGHT-FINITE-READBACK) **How it was checked:** sodove tested this PR at head `4171724fb` on main `33db04a70`: the PR's own test fails on main and passes with this PR merged in (his result is linked from the batch summary in #1608). We then re-ran the same test locally on Windows 11 and got the same verdict: on main, red (3 failures); with the PR, green (49 OK, 8 skips). **CI:** the red jobs on this PR fail the same way on main, or on the older main it was built on (the `cs_dpp_cmp.asm` translator fixture, since fixed on main, and the Windows runner's Visual Studio setup), so none comes from this change. Merged one by one with 20 other PRs of the same reviewed batch, pinned to the tested head. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.
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!2040
No description provided.