feat(solver): Phase 3a — JSON serialization for KCSolve types #155

Open
opened 2026-02-20 02:01:26 +00:00 by forbes · 0 comments
Owner

Phase 3a: JSON Serialization

Add to_dict() / from_dict() methods to all KCSolve types in the pybind11 module, enabling JSON transport of SolveContext and SolveResult between client, server, and runner.

See docs/SOLVER.md — Phase 3a

Files to modify

  • src/Mod/Assembly/Solver/bindings/kcsolve_py.cpp — add dict conversion methods

Types requiring serialization

  • SolveContext (parts, constraints, motions, simulation params)
  • SolveResult (status, placements, dof, diagnostics)
  • Transform (position [x,y,z], quaternion [w,x,y,z])
  • Constraint.Limit, MotionDef, SimulationParams
  • Enum types serialize as strings matching Python names (e.g. "Revolute", "Success")

Verification

ctx.to_dict() must round-trip through SolveContext.from_dict() without loss.

Notes

  • This work is in the Kindred Create repo, not Silo
  • Blocking dependency for Phase 3b (server endpoints) and Phase 3c (runner support)
  • Can be developed and tested independently of Silo server changes
## Phase 3a: JSON Serialization Add `to_dict()` / `from_dict()` methods to all KCSolve types in the pybind11 module, enabling JSON transport of `SolveContext` and `SolveResult` between client, server, and runner. See [docs/SOLVER.md — Phase 3a](../docs/SOLVER.md#phase-3a-json-serialization) ### Files to modify - `src/Mod/Assembly/Solver/bindings/kcsolve_py.cpp` — add dict conversion methods ### Types requiring serialization - `SolveContext` (parts, constraints, motions, simulation params) - `SolveResult` (status, placements, dof, diagnostics) - `Transform` (position `[x,y,z]`, quaternion `[w,x,y,z]`) - `Constraint.Limit`, `MotionDef`, `SimulationParams` - Enum types serialize as strings matching Python names (e.g. `"Revolute"`, `"Success"`) ### Verification `ctx.to_dict()` must round-trip through `SolveContext.from_dict()` without loss. ### Notes - This work is in the Kindred Create repo, not Silo - Blocking dependency for Phase 3b (server endpoints) and Phase 3c (runner support) - Can be developed and tested independently of Silo server changes
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo#155