fix(cam-blend): conditioning-scaled tolerances in the G3 spline proptests #129

Merged
patman merged 3 commits from patman/blend-proptest-tolerance into main 2026-08-24 02:25:38 +00:00 AGit
Owner

Fixes two flaky proptests properly (no coverage loss, no seeds deleted, all recorded seeds still pass). reconstructs_g3_data_at_both_ends: real driver is coefficient magnitude (kappa-prime up to 1000 -> septic coefficients ~3e3 -> Horner residue above the 1e-12 floor; measured 0.98x = live flake) — tolerance now max(floor, 8x endpoint_recon_error_bounds). curvature_rate FD sibling was failing outright (12/300k samples, worst 17.7x): tolerance now max(1e-4scale, 8(E_trunc+E_round)) with Richardson-measured truncation (|FD(2h)-FD(h)|/3) + propagated roundoff. Reviewer verified the /3, structural non-circularity (tolerance never calls the function under test), and that buck2 DOES replay recorded seeds (settled by mutation experiment: 256+2 cases, deterministic head). 5/5 consecutive green. Opus review PASS.

Fixes two flaky proptests properly (no coverage loss, no seeds deleted, all recorded seeds still pass). reconstructs_g3_data_at_both_ends: real driver is coefficient magnitude (kappa-prime up to 1000 -> septic coefficients ~3e3 -> Horner residue above the 1e-12 floor; measured 0.98x = live flake) — tolerance now max(floor, 8x endpoint_recon_error_bounds). curvature_rate FD sibling was failing outright (12/300k samples, worst 17.7x): tolerance now max(1e-4*scale, 8*(E_trunc+E_round)) with Richardson-measured truncation (|FD(2h)-FD(h)|/3) + propagated roundoff. Reviewer verified the /3, structural non-circularity (tolerance never calls the function under test), and that buck2 DOES replay recorded seeds (settled by mutation experiment: 256+2 cases, deterministic head). 5/5 consecutive green. Opus review PASS.
fix(cam-blend): conditioning-scaled tolerances in the G3 spline proptests
Some checks failed
CI / build-test (pull_request) Failing after 4s
104f1aae71
reconstructs_g3_data_at_both_ends asserted against fixed absolute floors
(1e-12 position, 1e-9 tangent/kappa, 1e-6 kappa-rate) that do not scale
with its own input distribution. With kappa' up to 1000 the septic
coefficients reach ~3e3 and point_at(1.0) sums all eight of them, so the
irreducible Horner residue 16*eps*c is ~1e-11 -- an order above the
position floor. Over 3e5 samples of exactly this distribution the worst
residual reached 0.98x the position floor and 0.18x the kappa-rate
floor: a live flake. It now uses max(floor, 8 x endpoint_recon_error_
bounds), the running rounding bound its randomized-eta sibling already
uses. No prop_assume is added: EtaParams::default() pins |p'| to
eta1 = eta2 = 1 m at both ends (measured deviation 5e-12), so endpoint
separation does not condition this test and no input is excluded.

curvature_rate_matches_arc_length_finite_difference had the same
disease in relative form: kappa carries |p'|^-3 and dkappa/ds |p'|^-6,
and its only guard is speed > 1e-3, so a u drawn near a speed dip leaves
the central difference's asymptotic regime -- 12 of the same 3e5 samples
exceeded its flat 1e-4 relative band, the worst by 17.7x. Its tolerance
is now max(1e-4*scale, 8*(E_trunc + E_round)) with E_trunc =
|FD(2h) - FD(h)|/3 (Richardson: the error is C*h^2, so the difference of
the two step sizes measures it rather than modelling it) and E_round =
(err_k(u+h) + err_k(u-h))/(2h)/|p'|. Both terms vanish for a gentle
spline, so the well-conditioned region keeps the original band: the
bound rose above it in 0.27% of samples and the residual/tolerance ratio
peaked at 0.13. The tolerance filters no input; the one added
prop_assume only widens the pre-existing stencil-domain guard from the
+/-h stencil to the +/-2h one Richardson reads.

Both seeds recorded in CAM/blend/proptest-regressions/spline.txt are
replayed automatically by buck2 test (verified: the run generates 258
cases, the first 2 byte-identical across runs) and pass, additionally
confirmed by replaying their values explicitly (worst ratio 2.5e-2);
none were removed. buck2 test //CAM/blend:cam-blend-tests green 5/5
consecutive.

Co-authored-by: patman-assist <patrick-ai@kgroo.co>
chore: normalize comments
Some checks failed
CI / build-test (pull_request) Failing after 4s
77843146a8
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 8m40s
96fcb963ae
Reformats files that predate the runner's current rustfmt; no code changes.

Co-authored-by: patman-assist <patrick-ai@kgroo.co>
patman merged commit 78a4cfb937 into main 2026-08-24 02:25:38 +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!129
No description provided.