feat(cam): lookahead velocity chaining across path spans #58

Merged
patman merged 1 commit from patman/cam-lookahead into main 2026-07-09 23:28:14 +00:00 AGit
Owner

PR6 of the adaptive-clearing roadmap: chain(spans, limits) — two-pass junction-velocity lookahead over speed-capped path spans, then one boundary-velocity double-S per span, flattened into a single continuous jerk schedule. v_reach is monotone bisection against the SAME half_phase ramp-distance the per-span planner prechecks (bitwise-consistent, pub(crate) shared), so every accepted junction pair is feasible by construction. Review highlight: the reviewer REFUTED a supervisor-suspected soundness hole (d_min has an interior maximum in the lower velocity at u = a^2/2j, so the feasible set is not downward-closed) with an induction over the pass interleaving — the backward sweep re-establishes the down-ramp bound at every junction — plus 15k adversarial bump-band configs with zero failures; a bump-band regression test now pins it. Failure envelope even hypothetically: spurious Infeasible only, never an emitted schedule violating limits. Line-count note: 278 feature lines, above the ~216 flex precedent — reviewer recommends keeping it whole because splitting fractures the by-construction feasibility proof; flagging for your call. Stacked on patman/cam-boundary-v (#56).

PR6 of the adaptive-clearing roadmap: chain(spans, limits) — two-pass junction-velocity lookahead over speed-capped path spans, then one boundary-velocity double-S per span, flattened into a single continuous jerk schedule. v_reach is monotone bisection against the SAME half_phase ramp-distance the per-span planner prechecks (bitwise-consistent, pub(crate) shared), so every accepted junction pair is feasible by construction. Review highlight: the reviewer REFUTED a supervisor-suspected soundness hole (d_min has an interior maximum in the lower velocity at u = a^2/2j, so the feasible set is not downward-closed) with an induction over the pass interleaving — the backward sweep re-establishes the down-ramp bound at every junction — plus 15k adversarial bump-band configs with zero failures; a bump-band regression test now pins it. Failure envelope even hypothetically: spurious Infeasible only, never an emitted schedule violating limits. Line-count note: 278 feature lines, above the ~216 flex precedent — reviewer recommends keeping it whole because splitting fractures the by-construction feasibility proof; flagging for your call. Stacked on patman/cam-boundary-v (#56).
Add CAM/plan/src/lookahead.rs: chain() turns a sequence of speed-capped
Spans into one continuous rest-to-rest jerk schedule (Chained). Junction
velocities are seeded from adjacent speed caps, then tightened by a
forward pass (v_reach: bisection on the max speed reachable over a span's
length) and a time-reversal-symmetric backward pass, before each span is
solved with plan_with_boundary_velocities. v_reach bisects over the exact
same minimum-ramp-distance function (half_phase, now pub(crate) in
scurve.rs) that plan_with_boundary_velocities prechecks, so every per-span
plan is feasible by construction; a documented two-step junction-velocity
back-off covers residual rounding at the bisection boundary before
propagating PlanError::Infeasible. PlanError::InvalidSpan (added by a
prior interrupted attempt in this workspace) is reused for invalid span
lists.

Co-authored-by: patman-assist <patrick-ai@kgroo.co>
patman changed target branch from patman/cam-boundary-v to main 2026-07-09 23:28:13 +00:00
patman merged commit 6687a09720 into main 2026-07-09 23:28:14 +00:00
Sign in to join this conversation.
No description provided.