feat(assembly): add diagnostic logging to solver and assembly #313

Merged
forbes merged 1 commits from feat/solver-diagnostic-logging into main 2026-02-21 16:11:36 +00:00
Owner

Summary

Add diagnostic logging throughout the solver pipeline — both C++ (AssemblyObject) and Python (kindred_solver submodule) — to make constraint failures, drag issues, and performance problems diagnosable from the FreeCAD log panel.

C++ (AssemblyObject)

  • getOrCreateSolver(): log which solver backend was loaded and the requested name
  • solve(): log assembly name, grounded/joint counts, context size, result status with DOF and placement count, per-constraint diagnostics on failure
  • preDrag()/doDragStep()/postDrag(): log drag part count, per-step solver failures and validation rejections, summary (total steps / rejected count)
  • buildSolveContext(): log grounded/free part counts, constraint count, limits count, bundle_fixed flag

Python (kindred_solver submodule)

  • solver.py: log solve entry/exit with timing, system build stats (free bodies, residuals, free params), decomposition decisions, Newton/BFGS fallback events with timing, drag lifecycle (pre_drag parts, drag_step status, post_drag summary), skipped constraints (inactive/missing body/unsupported)
  • decompose.py: log cluster count summary, per-cluster body/boundary/constraint/residual stats, per-cluster convergence failures with BFGS fallback
  • Init.py: add _FreeCADLogHandler routing Python logging.* calls to FreeCAD.Console (PrintLog/PrintWarning/PrintError), attached to the kindred_solver logger at DEBUG level

Log levels

  • DEBUG: per-step drag timing, per-cluster stats, monolithic Newton convergence, skipped constraints
  • INFO: solve entry/exit with timing, drag lifecycle start/end, decomposition decisions, BFGS fallback events
  • WARNING: solve failures, BFGS failures, drag steps with failed solves, per-constraint diagnostics on failure
## Summary Add diagnostic logging throughout the solver pipeline — both C++ (AssemblyObject) and Python (kindred_solver submodule) — to make constraint failures, drag issues, and performance problems diagnosable from the FreeCAD log panel. ## C++ (AssemblyObject) - **getOrCreateSolver()**: log which solver backend was loaded and the requested name - **solve()**: log assembly name, grounded/joint counts, context size, result status with DOF and placement count, per-constraint diagnostics on failure - **preDrag()/doDragStep()/postDrag()**: log drag part count, per-step solver failures and validation rejections, summary (total steps / rejected count) - **buildSolveContext()**: log grounded/free part counts, constraint count, limits count, bundle_fixed flag ## Python (kindred_solver submodule) - **solver.py**: log solve entry/exit with timing, system build stats (free bodies, residuals, free params), decomposition decisions, Newton/BFGS fallback events with timing, drag lifecycle (pre_drag parts, drag_step status, post_drag summary), skipped constraints (inactive/missing body/unsupported) - **decompose.py**: log cluster count summary, per-cluster body/boundary/constraint/residual stats, per-cluster convergence failures with BFGS fallback - **Init.py**: add `_FreeCADLogHandler` routing Python `logging.*` calls to `FreeCAD.Console` (PrintLog/PrintWarning/PrintError), attached to the `kindred_solver` logger at DEBUG level ## Log levels - **DEBUG**: per-step drag timing, per-cluster stats, monolithic Newton convergence, skipped constraints - **INFO**: solve entry/exit with timing, drag lifecycle start/end, decomposition decisions, BFGS fallback events - **WARNING**: solve failures, BFGS failures, drag steps with failed solves, per-constraint diagnostics on failure
forbes added 1 commit 2026-02-21 16:09:11 +00:00
feat(assembly): add diagnostic logging to solver and assembly
Some checks failed
Build and Test / build (pull_request) Has been cancelled
c682c5d153
C++ (AssemblyObject):
- getOrCreateSolver: log which solver backend was loaded
- solve: log assembly name, grounded/joint counts, context size,
  result status with DOF and placement count, per-constraint
  diagnostics on failure
- preDrag/doDragStep/postDrag: log drag part count, per-step
  validation failures, and summary (total steps / rejected count)
- buildSolveContext: log grounded/free part counts, constraint count,
  limits count, and bundle_fixed flag

Python (kindred_solver submodule):
- solver.py: log solve entry/exit with timing, system build stats,
  decomposition decisions, Newton/BFGS fallback events, drag lifecycle
- decompose.py: log cluster stats and per-cluster convergence
- Init.py: FreeCAD log handler routing Python logging to Console
forbes merged commit 441cf9e826 into main 2026-02-21 16:11:36 +00:00
forbes deleted branch feat/solver-diagnostic-logging 2026-02-21 16:11:37 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#313