feat(dispatch): subproblem dispatcher to backend solvers #28
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
dispatcher.py— routes each subproblem from the solve plan DAG to the appropriate backend solver, executing in bottom-up topological order.Context
The dispatcher is the bridge between graph decomposition and numerical solving. It takes the
SolvePlanDAG from the decomposer, builds a miniSolveContextfor each subproblem, and routes it to either a closed-form pattern solver or the Ondsel backend via the existingSolverRegistry. This is where the pluggable architecture pays off — the decomposition solver is itself a plugin that uses other plugins as backends.Depends on: #26 (decomposer — produces the SolvePlan), #27 (patterns — analytical solvers for matched subproblems)
Design
Dispatch flow
For each subproblem in execution order (leaves first):
subproblem.patternis set, use the analytical solverpart_idsin the subproblemconstraint_idsin the subproblemkcsolve.load(self._backend_id).solve(sub_ctx)Shared part placement propagation
When subproblem B depends on subproblem A via shared part P:
API
Error handling
Tasks
SubproblemDispatcherclassSolveContextbuilder (part/constraint subsetting from full context)kcsolve.load()tests/decomposition/test_dispatcher.py:Acceptance criteria