S4.5 — SpaceInformation migration
Intent
Introduce SpaceInformation — the state space plus the state validity checker plus the motion validator — as the single source of validity, so planners and the future path simplifier (0.10.0) can never judge validity differently. This is 0.9.0's big breaking change; do it alone, with no feature work mixed in.
Decisions (ADR-0003; grilling Q1/Q8/Q9/Q9′/Q10/Q11/Q12)
- Name
SpaceInformation, as in OMPL (glossary:CONTEXT.md§ Validity, "Space information"). SpaceInformation::new(space: Arc<SP>, checker: Arc<dyn StateValidityChecker<S>>)— the checker is required (OMPL silently installs an all-valid checker; we don't). The discrete motion validator is installed by default.set_motion_validator(&mut self, mv: Arc<dyn MotionValidator<S>>)keeps OMPL's name but needs exclusive access: configure first, then share asArc<SpaceInformation<..>>. Once shared it is frozen — this prevents a PRM roadmap built under one validator being queried under another (a silent hazard in OMPL's mutable model) and keeps locks off the hottest path.ProblemDefinitionholdsArc<SpaceInformation<..>>instead of itspub spacefield. Exactly one path to the space.Planner::setup(&mut self, problem_def)— the checker argument goes. Bindings dropsetupentirely: their planner constructors already receive the problem definition.- Bindings: Python
SpaceInformation(space, is_valid_fn, motion_validator=None); JSnew SpaceInformation(space, isValidFn)plussetMotionValidator. JS'sStateValidityCheckerwrapper class is removed. The checker stays a plain function in both bindings. - Binding setters use
Arc::get_mut; if aProblemDefinitionalready holds the SpaceInformation, raise "SpaceInformation is already used by a ProblemDefinition; configure it first" (typed asConfigurationErroronce S4.6 lands). - Binding spaces are shared, not copied: today
ProblemDefinitionconstructors snapshot the space (lock().unwrap().clone()— py 3 sites, js 6 sites), so configuring a space afterwards is a silent no-op. After this story, mutating a space already used by a SpaceInformation raises the same "already in use" error. - Out of scope (additive later): reusing a PRM roadmap across problem definitions sharing one SpaceInformation ptr_eq.
Acceptance criteria
Tasks
Risks
- Scale: mechanical but large; keep the PR to the migration only. Consider a codemod (sed/ast-grep) for the test suites.
- Python/JS API shape is public and permanent until 0.10.0 — get names right in this PR.
Source
Agreed in the senior-engineer grilling 2026-10-08 (decisions: repo docs/planning/adr/0003-motion-validation.md; glossary: CONTEXT.md). Regeneration spec: oxmpl - sprint-004. Line references are as of origin/main c558556 (2026-10-08), before E3. E3 renames things (rand Rng→RngExt, PyO3 with_gil→attach, edition 2024), so re-grep before trusting a line number.