feat(cam-lower): typed + windowed PathEval curvature surface #118

Merged
patman merged 4 commits from patman/curvature-sups into patman/orient-law 2026-08-24 02:23:23 +00:00 AGit
Owner

SE(3) S-c. curvature_bounds() raw (f64,f64,f64) -> typed CurvatureSups struct; piece_windows(); blend_kappa_third_sup (CurvatureThird producer, S5 recommended: symbolic dense-sampled, revisable); seam_kappa_second_jump_sum. Behavior-preserving: golden value pins the refactored kappa-second sup; MVT-based FD dominance check with zero slack. Opus review PASS after C1/C2.

SE(3) S-c. curvature_bounds() raw (f64,f64,f64) -> typed CurvatureSups struct; piece_windows(); blend_kappa_third_sup (CurvatureThird producer, S5 recommended: symbolic dense-sampled, revisable); seam_kappa_second_jump_sum. Behavior-preserving: golden value pins the refactored kappa-second sup; MVT-based FD dominance check with zero slack. Opus review PASS after C1/C2.
feat(cam-lower): typed + windowed PathEval curvature surface
Some checks failed
CI / build-test (pull_request) Failing after 5s
a6eee2c6d5
Stack step S-c of the SE(3) angular lowering design
(docs/superpowers/se3-lowering-design.md sections 3.2, 3.3a and 7).
Behaviour-preserving for the translational certificate.

- curvature_bounds() now returns a typed CurvatureSups { kappa,
  kappa_rate, kappa_second, kappa_third } instead of a raw
  (f64, f64, f64). lower_core unwraps at the r4_sup call site, which is
  otherwise untouched.
- piece_windows() gives per-piece curvature sups paired with the piece's
  s-range, and curvature_bounds() is now literally the max-fold over it
  (one source of truth, no second implementation to drift).
- blend_kappa_third_sup: the producer CurvatureThird did not have.
  Mirrors blend_kappa_second_sup one derivative up on the same 1024-sample
  sweep, differencing at interval midpoints so the second difference stays
  centred on the non-uniform arc-length grid. The shared sweep and the
  'max + half the largest adjacent change' margin rule are factored out.
- seam_kappa_second_jump_sum(): 2 * sum over blends of sup|kappa''|, the
  angular certificate's Peano jump term. kappa'' jumps at every host/blend
  seam (a host has kappa'' == 0), which is why this term has no
  translational sibling.

Behaviour preservation is pinned from two directions, because neither
test alone is enough. typed_curvature_bounds_match_the_legacy_raw_fold
compares against a transcription of the pre-typed fold, which pins the
fold structure (iteration order, per-kind dispatch, the pieces/entries
index correspondence, newtype round-trip) but CANNOT pin the per-blend
helpers, since both sides call the same ones -- and this change is
exactly what refactored blend_kappa_second_sup's internals. So
blend_kappa_second_sup_matches_its_golden_value pins that helper with a
hardcoded number; if it ever needs updating, that is the alarm working.

blend_kappa_third_sup is cross-checked against a second central
difference of kappa' in arc length, which by the divided-difference mean
value theorem is a genuine sample of kappa''' for any step size. The
reference is deliberately coarse so it biases low, which lets the
assertion be 'sup >= measured' with no slack on the unsound side; the
non-vacuity slack sits on the other comparison.

DECISIONS (Patrick-revisable; recorded because he may come back to them):

S5 -- implemented the design doc's recommended option: a symbolic,
dense-sampled kappa''' sup mirroring the merged blend_kappa_second_sup
heuristic. The logged alternative is to bound TV(zeta) by dense-sampling
zeta itself, needing only kappa'' and counting jumps automatically -- one
term instead of two, and no fourth-order finite difference. The recorded
trigger for falling back is kappa''' sampling proving numerically noisy
on real blends; on the rounded-rect fixtures here it is not. Revisit if
stiffer geometry says otherwise.

S6 -- implemented the design doc's recommended per-piece (windowed) sup
accumulation, which is what piece_windows() exists for. It is applied to
the angular certificate only; the translational certificate keeps its
pass-wide sup, since changing a merged pinned bound is out of scope here.
Applying the same windowing translationally is a contained,
strictly-tightening follow-up.

Co-authored-by: patman-assist <patrick-ai@kgroo.co>
chore: normalize comments
Some checks failed
CI / build-test (pull_request) Failing after 5s
0863a1b5ee
Co-authored-by: patman-assist <patrick-ai@kgroo.co>
style: rustfmt --edition 2024 drift fix
All checks were successful
CI / build-test (pull_request) Successful in 8m51s
4b116838ce
Reformats files that predate the runner's current rustfmt; no code changes.

Co-authored-by: patman-assist <patrick-ai@kgroo.co>
merge: sync main into curvature-sups (post track2 merge)
All checks were successful
CI / build-test (pull_request) Successful in 8m44s
ad75d8ff18
Co-authored-by: patman-assist <patrick-ai@kgroo.co>
patman merged commit b68d8f18d3 into patman/orient-law 2026-08-24 02:23:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
patman/KGROO!118
No description provided.