Skip to content

Consolidate zero-match recovery to one floored ladder (ADR 0010) + default auto-exposure#474

Merged
brickbots merged 1 commit into
mainfrom
worktree-adr0010-zero-match-recovery
Jun 16, 2026
Merged

Consolidate zero-match recovery to one floored ladder (ADR 0010) + default auto-exposure#474
brickbots merged 1 commit into
mainfrom
worktree-adr0010-zero-match-recovery

Conversation

@brickbots

Copy link
Copy Markdown
Owner

Summary

Executes ADR 0010 (created docs-only in #467): consolidates zero-match recovery to a single fixed-ladder strategy, and resolves the deferred default-regime question by shipping solver-driven auto-exposure as the default.

Recovery consolidation (ADR 0010)

  • Recovery is now the single concrete ZeroMatchRecovery class. Deleted the ZeroStarHandler ABC and the Exponential / Reset / Histogram strategies, the set_ae_handler command, the Experimental "AE Algo" menu, and the auto_exposure_zero_star_handler config key (stale config values are ignored).
  • Recovery ladder floored at 200 ms[400, 800, 1000, 200] ms (was 7 rungs down to 25 ms). The floor bounds recovery's blind search only — the match-count controller's feedback clamp still reaches 25 ms.
  • Renamed recovery code to the Camera glossary: ZeroMatchRecovery, _zero_match_count, _handle_zero_match, _recovery. The two controllers (ExposurePIDController/ExposureSNRController) and the set_ae_mode:pid/snr wire protocol are intentionally left alone (out of ADR 0010's scope).
  • generate_exposure_sweep kept (the diagnostic exposure sweep capture still uses it); docstring updated.

Default exposure regime → "auto"

  • default_config.json: camera_exp: 400000"auto". Solver-driven auto-exposure now runs out of the box. The ladder starts at 400 ms (the previous fixed default), so the first frame is unchanged. All camera backends + the display callback + daytime-align already handle "auto"; existing users keep their saved camera_exp.
  • This was ADR 0010's explicitly-deferred open question; resolved here in favour of auto since the floored single-ladder recovery makes auto-exposure safe by default. ADR 0010 and docs/ax/camera.md §7 now cross-reference the resolution.

Docs & i18n

  • Internal: docs/ax/camera.md, docs/ax/camera/CONTEXT.md, docs/adr/0010-* — removed the "until the consolidation lands" hedges, applied the rename, recorded the default-regime resolution.
  • User-facing: docs/source/menu_map.rst (removed AE Algo, noted Auto is the default), docs/source/troubleshooting.rst (AUTO-first exposure guidance).
  • Re-extracted/compiled translations (the 5 removed UI strings become #~ obsolete entries).

Testing

  • pytest -m unit → 453 passed; pytest -m smoke → 5 passed; rewritten test_auto_exposure.py → 22 passed
  • ruff check / ruff format --check clean; mypy clean on auto_exposure.py + camera_interface.py
  • sphinx-build -n → 0 warnings; pybabel compile clean for all 4 languages
  • Live headless boot: app starts on the new default and the Experimental menu shows only SQM / Polar Align / Dev Tools

Note

Removed 3 pre-existing tests in the old TestPIDIntegration that referenced a gains= constructor arg the controller never had — they were unmarked (never collected by pytest -m unit) and would error if run. Can be rewritten against the real gains_increase/gains_decrease API as separate work.

🤖 Generated with Claude Code

Execute ADR 0010: keep the Sweep ladder as the only zero-match recovery
behavior and remove the rest. Delete the ZeroStarHandler ABC and the
Exponential/Reset/Histogram strategies, the set_ae_handler command, the
Experimental "AE Algo" menu, and the auto_exposure_zero_star_handler
config key (stale values are ignored). Floor the recovery ladder at
200 ms -> [400, 800, 1000, 200] ms; the match-count controller's
feedback clamp still reaches 25 ms.

Rename the surviving recovery to the Camera glossary: ZeroMatchRecovery,
_zero_match_count, _handle_zero_match, _recovery. The two controllers and
the pid/snr wire protocol are left unchanged (out of ADR 0010's scope).

Flip the shipped default to camera_exp: "auto" so solver-driven
auto-exposure runs out of the box; the ladder starts at 400 ms so the
first frame is unchanged, and all camera backends already handle "auto".
Existing users keep their saved camera_exp.

Update docs (camera.md, camera/CONTEXT.md, ADR 0010, menu_map.rst,
troubleshooting.rst) and re-extract/compile translations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@brickbots brickbots merged commit 0e0ec03 into main Jun 16, 2026
1 check 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.

1 participant