feat(solver): DecompositionSolver entry point and kcsolve registration #30
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement
solver.py— theIKCSolversubclass that orchestrates the full decomposition pipeline and registers as"decomposition"in the KCSolve solver registry.Context
This is the thin orchestration layer that ties all components together. It implements the
IKCSolverinterface (via the pybind11PySolvertrampoline), wiringStructuralAnalyzer→Decomposer→SubproblemDispatcher→Reconcilerinto thesolve()method. It also provides thediagnose()fast path that returns structural diagnostics without any numerical solving.Depends on: #25 (analyzer), #26 (decomposer), #28 (dispatcher), #29 (reconciler)
Design
Class definition
Registration
At module import time or via explicit registration:
Called from
solver/decomposition/__init__.pyor from the Create module's addon loader.Incremental update support
The
update()method is the key performance optimization:SolvePlanfrom the lastsolve()callupdate(), check if the constraint graph structure has changed (new/removed parts or constraints)solve()This maps directly to the
IKCSolver.update()optional method and enables fast re-solving during joint parameter editing.Fallback behavior
If the decomposition produces a single subproblem (triconnected graph, no decomposition benefit), the solver should detect this via
SolvePlan.is_trivial()and dispatch directly to the backend without decomposition overhead.Tasks
DecompositionSolverclass inheriting fromkcsolve.IKCSolversolve()diagnose()fast path (structural analysis only)update()with cached plan and incremental re-dispatchsupported_joints()delegation to backendis_deterministic()delegation to backend__init__.pyentry pointAcceptance criteria
DecompositionSolverimplements the fullIKCSolverinterfacesolve()produces correct results for well-constrained assembliesdiagnose()returns structural diagnostics without invoking any numerical solverupdate()demonstrably faster thansolve()for parameter-only changes"decomposition"and is discoverable viakcsolve.available()