Skip to content

WP 13.4: the preview reads the lit part of an obstructed frame, and a defocused frame is not called obstructed (#1287) - #1351

Merged
epim merged 4 commits into
mainfrom
wave13/wp-13-4
Nov 30, 2026
Merged

epim merged 4 commits into
mainfrom
wave13/wp-13-4

Conversation

@epim

@epim epim commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Plan 3, wave 13, WP 13.4. Closes #1287.

What changed

  1. The preview reads the lit part of an obstructed frame. Hub._publish_preview searched the whole frame for the published star count, the HFR, the star marks, the defocus screen and the Bahtinov centre. When find_obstruction finds a foreground, those now read the lit side's stars as the block-by-block detector finds them. A frame of one population publishes exactly what it did, held by a golden taken before the change.
  2. A defocused frame, or a frame with a faint gradient, is no longer called obstructed. find_obstruction gains two conditions: the drop from the sky to the dark region must reach one pixel sigma, and the lit side must still hold three stars when detected block by block.
  3. The obstruction is searched once a frame. cloud_score takes the one its caller found, and reads its lit stars instead of detecting again.

Evidence

Every real fixture was rendered and looked at before any figure was read.

fixtures before after
eight defocused focus-sweep crops (focus_4900 to focus_10900) obstructed stars, cloud or unknown
jump_R60 (in focus, a 0.2 sigma gradient, no foreground) obstructed unknown
the other 17 real fixtures their class unchanged
real in-focus fields behind a composited foreground, and the synthetic trees obstructed obstructed
  • Preview on a half-covered frame with 80 planted stars: 80 published (the whole-frame list finds 67), no mark on the foreground. A real field behind a foreground: 162 published against the whole frame's 40.
  • _publish_preview on a 26 MP frame, median of 5 on a busy machine: 5.6 s unobstructed and 4.9 s obstructed, at or under main within the noise.
  • Mutants, each from a byte backup and restored byte-identical: the preview reading whole-frame stars, the regional confirmation removed, the drop floor removed, the hand-over to cloud_score removed, the defocus screen given whole-frame stars. Each fails a test.

Known limit

A foreground is not found where the sky sits within a pixel sigma of the dark floor. From the real fixtures, the most an opaque foreground could drop the frame is 5.3 sigma and up on 60 s broadband subs, 1.8 to 3.3 on 4 s focus frames, and 0.2 to 1.8 on the 300 s Ha sub (the pedestal at that gain is not recorded). So a tree on a narrowband sub is probably missed and reads as cloud or unknown, as it did before #1145. The limit is in the constant's comment and pinned by two tests named as limits. No real obstructed frame is in the repository; recording some is #1349.

Follow-ups filed

🤖 Generated with Claude Code

https://claude.ai/code/session_01K7CHb44VFtZLGUDLF4us2p

epim and others added 2 commits November 30, 2026 01:47
…rame, and a defocused or faintly graded frame is not called obstructed (#1287)

_publish_preview searched the whole frame for the published star count,
the HFR, the marks, the defocus screen and the Bahtinov centre. On a
frame partly behind a foreground those now read the lit side's stars as
the block-by-block detector finds them (Obstruction.lit_stars). A frame
of one population keeps its whole-frame list exactly, held by a golden
taken on the tree before the change. The obstruction is searched once a
frame: cloud_score takes the one its caller found.

find_obstruction gains two conditions. The drop from the sky to the dark
region must reach one pixel sigma (OBSTRUCTION_MIN_DROP_SIGMA), and the
lit side must still hold three stars when detected block by block. Nine
real fixtures that read OBSTRUCTED no longer do: eight defocused
focus-sweep crops and one in-focus NGC 604 sub with a 0.2 sigma gradient.
Every other real fixture keeps its class, and real fields behind a
composited foreground still read obstructed.

Known limit, stated in the constant's comment and pinned by two tests: a
foreground is not found where the sky sits within a pixel sigma of the
dark floor, which is the case for narrowband subs. Such a frame reads as
cloud or unknown, as it did before #1145.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7CHb44VFtZLGUDLF4us2p
epim and others added 2 commits November 30, 2026 02:08
…nce in process; the recorded golden is removed (#1287)

The golden payload recorded on a Windows machine failed on the Linux
runner for donutfield_L60: the aggregates agreed (hfr 4.01, 43 stars)
but one blended donut blob was split into three detections with
different centroids, so three star_list entries and some tilt zones
differed. A recording compared to four decimals across platforms pins
the machine, not the code.

The test now asserts the claim directly, in one process: a frame with
no obstruction hands every analysis the whole-frame star list (spies on
the four analyses as hub.py calls them), and every figure it publishes
equals what the same functions return for that list. The payload's key
set is a literal. Counts that sat at a threshold on this machine were
given margins: three class-table entries accept STARS or UNKNOWN (never
OBSTRUCTED), planted-star counts take a window that still excludes the
whole-frame count, and two composites moved to edges with a wide lit
count.

Tests only; no product code changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7CHb44VFtZLGUDLF4us2p
@epim

epim commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

The second commit on this branch (head a0497ad) changes the tests only.

The first CI run failed on this pull request's own test test_a_frame_of_one_population_publishes_exactly_what_it_did[donutfield_L60]: it compared the preview payload with one recorded on a Windows machine, and the Linux runner splits one blended donut blob into three detections differently (same 43 stars, same median HFR). That difference is filed as #1359.

The recorded file is removed. The test now proves the claim in one process: a frame with no obstruction hands each of the four analyses the whole-frame star list (spies at the calls hub.py makes), and every published figure equals what the same functions return for that list. The key set is a literal. Mutant: an unobstructed frame measured on a shortened list fails on all three frames ("grade was handed 42 stars, the whole-frame list holds 43").

Counts that sat on a threshold on the recording machine were given margins, for the same reason: three class-table entries accept STARS or UNKNOWN and never OBSTRUCTED; planted-star counts take a window of 76 to 82 that still excludes the whole-frame count of 67; two composites moved to edges where the lit count is 7 or more against the threshold of 3.

@epim
epim merged commit 16fe4d1 into main Nov 30, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After #1145: the preview's star count and HFR are still whole-frame on an obstructed frame, and a defocused frame can still read as obstructed

1 participant