Skip to content

ps-plate-04-refine: attitude re-fit, RA/Dec/Roll, FOV/distortion refinement, residuals, and solution outputs#82

Merged
bryantharpe merged 4 commits into
mainfrom
polecat/furiosa/ps-plate-04-refine@mrutn32m
Jul 21, 2026
Merged

ps-plate-04-refine: attitude re-fit, RA/Dec/Roll, FOV/distortion refinement, residuals, and solution outputs#82
bryantharpe merged 4 commits into
mainfrom
polecat/furiosa/ps-plate-04-refine@mrutn32m

Conversation

@bryantharpe

Copy link
Copy Markdown
Owner

Implements the refinement stage of the lost-in-space plate solver.

  • Re-fits attitude over all matched pairs with the SVD Wahba solver.
  • Extracts RA/Dec/Roll from the refined rotation matrix.
  • Refines FOV and optionally radial distortion from matched pairs.
  • Computes residual statistics (RMSE/P90E/MAXE) in arcseconds.
  • Assembles a fully populated Solution including camera, matches, and status.
  • Adds VerificationOutcome to carry matched pairs from verification to refinement.
  • Wires refine_solution into the solve loop on first accepted candidate.

All existing tests pass.

@bryantharpe bryantharpe added the integrity:graded authoring-integrity: transcript scanned, no recovery reconnaissance label Jul 21, 2026
@bryantharpe

Copy link
Copy Markdown
Owner Author

review/judge — APPROVE on 0a48c92d0aac

VERDICT: APPROVE
BLOCKING: NONE
NITS: crates/plate-solver/src/refine.rs:22 — parameter named _candidate is actually used (vec![*_candidate]); drop the underscore prefix to avoid implying it is unused.
NITS: crates/plate-solver/src/verify.rs:52 — doc comment says "Returns None if the candidate is rejected before the projection/match stage" but None is also returned when the binomial test rejects after matching; consider rewording to "Returns None if the candidate is rejected at any stage."
NITS: crates/plate-solver/src/refine.rs:82 — refine_fov(...).0 discards a second return value without comment; a named binding or brief comment would clarify what is being dropped.


Independent U3 review by the judge role (glm-5.2, Zhipu — different lineage
than every author seat). Verdict is on blocking findings, not a score. To
supersede with human sign-off (U4): judge-pr.sh override 82 "<reason>".

@bryantharpe
bryantharpe enabled auto-merge (squash) July 21, 2026 17:30
CI repair on an already-submitted PR. The authoring polecat (furiosa) had
already run `gt done` and exited, so no seat remained to own the red checks
(ps-ops-17-fmt-pre-done-gate, second occurrence after PR #80).

Changes are deliberately minimal — the authoring design is left intact for
the judge to review:

- `cargo fmt --all` over refine.rs, solve.rs, verify.rs (whitespace only).
- verify.rs: replace a `match ... { Some(r) => r, None => return None }`
  with `?` (clippy::question_mark). Semantically identical.
- verify.rs: `#[allow(clippy::too_many_arguments)]` and
  `#[allow(clippy::type_complexity)]` on `match_projected_to_centroids`,
  matching existing precedent in solve.rs and preparation.rs rather than
  redesigning the function signature pre-review.

Verified locally: `cargo fmt --all --check` clean, `cargo clippy --workspace
--all-targets --all-features --locked -- -D warnings` clean, 137 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qz1AHuSpjFqRYJWVVVq9mp
@bryantharpe

Copy link
Copy Markdown
Owner Author

CI repair — authoring seat had already exited

rustfmt and clippy were both red on this PR. The authoring polecat (furiosa) had already run gt done and exited (checkout back on main, zero commits), so no seat remained to own the red checks. This is the second live occurrence of ps-ops-17-fmt-pre-done-gate, after PR #80.

Repaired by hand in 90254a5. All 12 checks are now green.

Changes were kept deliberately minimal — the authoring design is untouched, so the judge reviews furiosa's work, not mine:

Fix Location Nature
cargo fmt --all refine.rs, solve.rs, verify.rs whitespace only
clippy::question_mark verify.rs:77 match { Some(r) => r, None => return None }?; semantically identical
clippy::too_many_arguments (8/7) verify.rs:204 #[allow]
clippy::type_complexity (5-tuple return) verify.rs:213 #[allow]

On the two #[allow]s: I used suppressions rather than redesigning match_projected_to_centroids, matching existing precedent in this codebase (solve.rs:42, solve.rs:80, preparation.rs:104 all carry #[allow(clippy::too_many_arguments)] from previously-merged PRs). If the judge thinks the 5-tuple return and 8-arg signature deserve a real refactor, that is a legitimate finding and should be filed — I deliberately did not pre-empt that call on someone else's PR.

Verified locally before push: cargo fmt --all --check clean, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean, 137 tests pass.

Note for ps-ops-17: clippy escaped here too, not just rustfmt — that widens the bead's defect statement. Detail in the bead comment.

@bryantharpe

Copy link
Copy Markdown
Owner Author

review/judge — APPROVE on 90254a5b2b71

VERDICT: APPROVE
BLOCKING: NONE
NITS: crates/plate-solver/src/verify.rs:267 — .expect("matched catalog star index valid") is a panic vector; consider returning an error or filtering invalid indices gracefully instead.
NITS: crates/plate-solver/src/refine.rs — no unit tests for refine_solution or refine_camera; consider adding tests to lock in the refinement behavior.
NITS: crates/plate-solver/src/refine.rs:30 — _rotation is computed but unused; the refined rotation is not stored in the Solution, only its RA/Dec/Roll decomposition — confirm this is intentional per spec.


Independent U3 review by the judge role (glm-5.2, Zhipu — different lineage
than every author seat). Verdict is on blocking findings, not a score. To
supersede with human sign-off (U4): judge-pr.sh override 82 "<reason>".

@bryantharpe
bryantharpe merged commit e6799aa into main Jul 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrity:graded authoring-integrity: transcript scanned, no recovery reconnaissance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant