You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three solvers hand-roll the same polish tail, and it has already started to drift (the #462 completeness invariant -- filter limits after polish, not before -- currently lives in only one of them):
Each builds identical _fk/_jac closures around poe_forward_kinematics/kinbody_jacobian, calls lm_refine_batch, keeps rows with res <= atol (and, for two of them, in-limits), then dedup_by_wrap_close. ~20 lines x 3, plus the invariant duplicated.
This sits one layer belowpostprocess.finalize_solutions (which is Solutions -> limits -> seed-rank -> truncate); the new helper is raw seeds -> polish -> FK-accept -> dedup -> Solutions.
Plan
Extractrefinement.polish_candidates(kb, seeds, T, *, accept_fk_atol, dedup_tol, lm_fk_atol, lm_max_iters, limits=None, batched=False, solution_factory=None, max_solutions=None) -> list[Solution]. The completeness invariant (polish first, filter limits second, never pre-filter) is documented and enforced here, once.
Delegate all three paths to it, preserving each caller's exact params (behavior-preserving; validated against the existing green SRS/7R suite). Callers keep only their arm-specific seed generation.
Problem
Three solvers hand-roll the same polish tail, and it has already started to drift (the #462 completeness invariant -- filter limits after polish, not before -- currently lives in only one of them):
seven_r/srs_polished.py(solve)seven_r/spherical_shoulder_polished.py(_polished)seven_r/_swivel_limits.py(resolve_in_limits, approximate path)Each builds identical
_fk/_jacclosures aroundpoe_forward_kinematics/kinbody_jacobian, callslm_refine_batch, keeps rows withres <= atol(and, for two of them, in-limits), thendedup_by_wrap_close. ~20 lines x 3, plus the invariant duplicated.This sits one layer below
postprocess.finalize_solutions(which is Solutions -> limits -> seed-rank -> truncate); the new helper is raw seeds -> polish -> FK-accept -> dedup -> Solutions.Plan
refinement.polish_candidates(kb, seeds, T, *, accept_fk_atol, dedup_tol, lm_fk_atol, lm_max_iters, limits=None, batched=False, solution_factory=None, max_solutions=None) -> list[Solution]. The completeness invariant (polish first, filter limits second, never pre-filter) is documented and enforced here, once.jointlock.seven_ris deliberately out of scope: exact HP per locked-joint sample, no polish, in-sweep filter on exact configs. Its gap (ROBOTERA Star1 7R: respect_limits branch-coverage gap (tier-1 jointlock+HP), raw solver is complete #459) is sampling density, a different fix.Payoff
Follow-up to #462 / #465.