Skip to content

Widen --auto's robust_pca auto-upgrade ceiling from N=10 to N=25 - #24

Merged
hd152 merged 1 commit into
mainfrom
widen-robust-pca-auto-threshold
Sep 22, 2026
Merged

hd152 merged 1 commit into
mainfrom
widen-robust-pca-auto-threshold

Conversation

@hd152

@hd152 hd152 commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • The ROBUST_PCA_AUTO_MAX_FRAMES threshold (gates when --auto silently upgrades a calibration master's combine method from median to robust_pca) was set from a benchmark on a synthetic 2000x3000x3 array — larger than any real calibration frame this camera produces, so it overstated the real cost.
  • Direct measurement on real mono frames at the real shape (2048x3056), after this session's robust_pca native-kernel fusion, shows N=25 today costs less than half of what N=10 cost when 10 was first judged tolerable: N=10 45s, N=15 89s, N=20 164s, N=25 258s, N=30 377s/~6.3min (fit cross-checked with a direct N=30 measurement, not just extrapolated).
  • Widened to 25. Updated stale comments in cli.py and a test docstring that referenced the old synthetic-shape benchmark.

Test plan

  • Full test suite passes (1647 tests) — threshold is referenced dynamically by tests, not hardcoded, so behavior scales automatically
  • ruff check . clean

🤖 Generated with Claude Code

The original threshold was set from a benchmark on a synthetic
2000x3000x3 (RGB-shaped, P=18M) array, larger than any real
calibration frame this camera produces (raw mono FITS, 2048x3056,
P=6.26M) -- it overstated the real cost.

Direct measurement on real mono frames of the real shape, after
2.2.5's robust_pca native-kernel fusion (which changed what dominates
the per-iteration cost), gave: N=10 45s, N=15 89s, N=20 164s, N=25
258s, N=30 377s/~6.3min (fit validated against a direct N=30
measurement, not just extrapolated). Today's N=25 costs less than half
of what N=10 cost when 10 was first judged tolerable for a silent
--auto default.

Widened ROBUST_PCA_AUTO_MAX_FRAMES to 25 on that basis. N=30's
~6.3min sits right at the old N=10 tolerance bar, so left as the next
candidate rather than taken now. Updated the stale comments in
cli.py and test_master_method_auto.py that referenced the old
synthetic-shape benchmark and threshold history.

Tests reference the constant dynamically (not hardcoded), so no test
changes needed beyond the stale docstring; full suite (1647 tests)
passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@hd152
hd152 merged commit 50f0080 into main Sep 22, 2026
7 checks passed
@hd152
hd152 deleted the widen-robust-pca-auto-threshold branch September 22, 2026 20:20
@hd152 hd152 mentioned this pull request Sep 23, 2026
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.

1 participant