feat(cam-lower): total-variation angular bound (2.3-2.4x tightening) #133

Merged
patman merged 4 commits from patman/tv-variation into patman/seam-endpoint-jump 2026-08-24 02:25:43 +00:00 AGit
Owner

SE(3) extension S-j, the design S5-alternative and the lever that moved the number. Everywhere the cert wrote Omega_supD for int|Omega|dt, the two blowup terms convert to arc length (ds = v dt, v cancelling): int|k3|v^4 dt <= v^3TV_s(k2) and 6|k2|v^2|vdot| <= 6v|vdot|*TV_s(k1) — each one derivative LOWER than the sup it replaces; top-order term needs no kappa-third at all. Reviewer-driven additions: third conversion 4|k1|v|vddot| <= 4|vddot|*TV_s(kappa) (the "divides by v" objection was false for this term — v cancels exactly; -4.5% gentle), Lipschitz margins on all grid TVs (+0.08%, makes the TV route carry the same inter-sample defence as the symbolic route min() compares against), deliberate-double-count comment at the straddler fold. Per-window min(TV-route, sup-route) makes never-worse a code property. Gentle orientation 3.76e-2 -> 1.60e-2 rad (2.34x), stiff omega 2.41x, hexapod 2.40x. Cumulative S-h+S-i+S-j: 4.08x gentle / 5.17x stiff omega. HONEST LIMITS recorded: grid TVs are dense-sampling estimates (same epistemic class as the merged translational cert inputs); stiff-fixture orientation remains >pi (uninformative) after three levers — structurally loose on tight corridors at high feed. kappa-third machinery stays live (min() second route + S-i margin); retiring any of it is a separate discussion. Opus review PASS, conditions closed.

SE(3) extension S-j, the design S5-alternative and the lever that moved the number. Everywhere the cert wrote Omega_sup*D for int|Omega|dt, the two blowup terms convert to arc length (ds = v dt, v cancelling): int|k3|v^4 dt <= v^3*TV_s(k2) and 6|k2|v^2|vdot| <= 6v|vdot|*TV_s(k1) — each one derivative LOWER than the sup it replaces; top-order term needs no kappa-third at all. Reviewer-driven additions: third conversion 4|k1|v|vddot| <= 4|vddot|*TV_s(kappa) (the "divides by v" objection was false for this term — v cancels exactly; -4.5% gentle), Lipschitz margins on all grid TVs (+0.08%, makes the TV route carry the same inter-sample defence as the symbolic route min() compares against), deliberate-double-count comment at the straddler fold. Per-window min(TV-route, sup-route) makes never-worse a code property. Gentle orientation 3.76e-2 -> 1.60e-2 rad (2.34x), stiff omega 2.41x, hexapod 2.40x. Cumulative S-h+S-i+S-j: 4.08x gentle / 5.17x stiff omega. HONEST LIMITS recorded: grid TVs are dense-sampling estimates (same epistemic class as the merged translational cert inputs); stiff-fixture orientation remains >pi (uninformative) after three levers — structurally loose on tight corridors at high feed. kappa-third machinery stays live (min() second route + S-i margin); retiring any of it is a separate discussion. Opus review PASS, conditions closed.
feat(cam-lower): bound the angular variation without forming kappa'''
Some checks failed
CI / build-test (pull_request) Failing after 6s
96bdf6ee01
Stack step S-j: the design doc's logged S5 ALTERNATIVE
(docs/superpowers/se3-lowering-design.md, S5: "bound TV(zeta) by
dense-sampling ... needs only kappa''"). S-i's numbers pointed here --
they showed the bound is dominated by the windowed variation term whose
leading factor is |kappa'''| v^4, so the seam term could not move it.

THE DERIVATION. Everywhere the certificate writes Omega_sup,p * D_p it is
standing in for the integral of |Omega| over the window -- the total
variation of zeta there. Bounding that by sup x duration is what makes the
blend terms explode, because on a corner blend |kappa'''| is enormous over
a very short arc. Converting the time integral to an arc-length one with
ds = v dt removes the sup for the three terms that carry a factor of v:

  int |k'''| v^4 dt        = int |k'''| v^3 ds    <= v^3 * int|k'''| ds
  int 6|k''| v^2|v_dot| dt = int 6|k''| v|v_dot| ds <= 6v|v_dot| * int|k''| ds
  int 4|k'| v|v_ddot| dt   = int 4|k'||v_ddot| ds <= 4|v_ddot| * int|k'| ds

and int|k'''| ds IS the arc-length total variation of k'', int|k''| ds that
of k', int|k'| ds that of k -- each one derivative LOWER than the quantity
it replaces. So the top-order term needs no kappa''' at all and the
fourth-order finite difference leaves the certificate path.

The third line matters and an earlier revision of this work got it wrong:
that term carries a single factor of v which cancels EXACTLY against the
dt = ds/v Jacobian, so the conversion is free. Only two terms genuinely
resist it -- 3|k'|v_dot^2 and |k||v_dddot| carry no v to cancel, so
converting them would leave a 1/v that is unbounded at the rest-to-rest
endpoints. Those two keep the sup form.

  bound = v^3*TV_s(k'') + 6v|v_dot|*TV_s(k') + 4|v_ddot|*TV_s(k)
        + [ 3|k'|v_dot^2 + |k||v_dddot| ] * D_p

NEVER WORSE, term by term, using L_p <= v_p * D_p and int|f| ds <= sup|f| * L_p,
each converted term is dominated by its sup-form counterpart. lower_core
takes the MINIMUM of the two routes anyway, so "never worse than what S-i
certified" is a property of the code, not only of the argument.

MARGINS. All three grid TVs go through tv_with_lipschitz_margin
(TV + 0.5 * max adjacent step), the total-variation counterpart of the
sup rule its siblings use. This is not decoration: a grid TV is a LOWER
bound on the true variation (sampling can miss an excursion, never invent
one), so without the margin the TV route would be the only estimate in the
module lacking the half-largest-step defence -- and since lower_core takes
a min() against the symbolic route, the LESS DEFENDED estimate is
systematically the one selected. Measured cost is ~0.08% (below).

The straddler discipline carries over: a step charged to piece p may reach
into a neighbour, so the neighbour's variation is folded in too -- by
SUMMING, not maxing, because total variation is additive over adjacent
intervals where a sup maxes. That fold deliberately double-counts (the
neighbour keeps its own TV as well); the comment at the site says so, since
apportioning it without bounding the sliver would turn a safe over-count
into a possible under-count.

HONESTY. Even margined, the arc-length TVs are dense-sampling estimates
rather than certified interval bounds -- the same epistemic status as
Eta3Spline::curvature_extrema and blend_kappa_second_sup, both of which
already feed the merged TRANSLATIONAL certificate. The design doc logs the
trade explicitly. The min() against the symbolic route means the shipped
bound can only be tighter than one that was already certified.

DEVIATION from the design's phrasing: it folds seam jumps into the TV and
applies dt^2/8 uniformly ("one term instead of two"). This keeps the seam
jumps as the separate dt^2/8 angular_jump_sum term and leaves the windowed
variation under dt^2/12, so the change moves exactly one thing and the S-i
seam work stays independently reviewable. Folding them is a further,
separable tightening.

ACHIEVED IMPROVEMENT -- the first lever that materially moves the number:

  gentle (200x150 mm, 1 mm corridor, 50 mm/s, dt 0.5 ms)
    orientation  3.7565905e-2 -> 1.6034705e-2 rad   (2.34x)
    omega        2.9413682e-3 -> 1.2550540e-3 rad/s (2.34x)
  stiff (60x40 mm, 0.2 mm corridor, 0.35 m/s, dt 1 ms)
    omega        9.8024359e0  -> 4.0624330e0  rad/s (2.41x)
  hexapod-dump binary (cert_orientation_rad)
    0.036141360 -> 0.015077671                      (2.40x)

Decomposed, measured by toggling each piece independently:
    TV route, no margin, two conversions   gentle 1.6770838e-2  stiff 4.0636712e0
    + Lipschitz margins on all three TVs   gentle 1.6784330e-2  stiff 4.0672640e0  (+0.080% / +0.088%)
    + third conversion (4|v_ddot|*TV_s(k)) gentle 1.6034705e-2  stiff 4.0624330e0  (-4.47% / -0.119%)

The third conversion is small, as expected -- kappa rises near-monotonically
across a blend, so int|k'| ds is close to |k'|_sup * L and the crude bound
was nearly tight. It is worth taking anyway: it more than pays for the
margins on the gentle fixture, and it makes the justification TRUE rather
than leaving a real conversion mislabelled as impossible.

Cumulative over S-h + S-i + S-j: gentle orientation 6.546571e-2 ->
1.6034705e-2 (4.08x), stiff omega 2.100633e1 -> 4.0624330e0 (5.17x). The
stiff fixture's orientation bound is still past pi and still uninformative
-- three levers have not rescued it, which is itself the finding: on tight
corridors at high feed the bound is structurally loose, not incidentally so.

kappa''' MACHINERY IS NOT DEAD and is deliberately retained.
blend_kappa_third_sup still feeds (a) the symbolic route that min() compares
against and (b) the half-step margin in S-i's seam-endpoint bound.
CurvatureThird likewise. No removal is proposed here: S-c is pushed as #118,
so retiring any of it would be a separate PR for Patrick to weigh rather
than a silent deletion.

Co-authored-by: patman-assist <patrick-ai@kgroo.co>
chore: normalize comments
Some checks failed
CI / build-test (pull_request) Failing after 5s
7a983c58d6
Co-authored-by: patman-assist <patrick-ai@kgroo.co>
style: rustfmt --edition 2024 drift fix
Some checks are pending
CI / build-test (pull_request) Waiting to run
86d3ccd796
Reformats files that predate the runner's current rustfmt; no code changes.

Co-authored-by: patman-assist <patrick-ai@kgroo.co>
patman force-pushed patman/tv-variation from 86d3ccd796
Some checks are pending
CI / build-test (pull_request) Waiting to run
to 14434a9665
All checks were successful
CI / build-test (pull_request) Successful in 8m55s
2026-08-24 01:48:32 +00:00
Compare
patman merged commit b2ae56e20f into patman/seam-endpoint-jump 2026-08-24 02:25:43 +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!133
No description provided.