Skip to main content

Module debug

Module debug 

Source
Expand description

Shared interior-point debugger abstraction.

The interactive solver debugger (a “pdb for the interior-point loop”) is driven by a DebugHook that the solver fires at well-defined Checkpoints. The hook receives a &mut dyn DebugState — a live, possibly-mutable view of the solver’s per-iteration state — and returns a DebugAction telling the loop whether to keep solving.

These traits live in pounce-common so that every solver can be debugged by the same REPL: the NLP filter-IPM (pounce-algorithm) and the convex / conic IPM (pounce-convex) both implement DebugState over their own state, and the CLI’s SolverDebugger implements DebugHook once against the trait.

DebugState splits its surface in two:

  • Generic accessors every interior-point method has — iteration index, μ, objective, primal/dual infeasibility, complementarity, step lengths, and named iterate / search-direction blocks — are required methods.
  • Solver-specific extras (the NLP error metric, bound-slack active-set view, KKT inertia / matrix / factor capture, line-search trial count, snapshot/restore, mutation) have default impls that report “unsupported”, so a solver overrides only what it actually has. The REPL turns an unsupported result into a friendly message.

Structs§

KktReport
KKT-factorization report (see DebugState::kkt). The inertia of a well-posed primal-dual system is (n_pos = n, n_neg = m, n_zero = 0); a mismatch (or nonzero regularization) is the classic signal that the step is being stabilized.
Residual
One signed residual component at the current iterate: its space, its index within that space, and its value. See DebugState::constraint_residuals / DebugState::dual_residuals.

Enums§

Checkpoint
Where in a solver’s loop a checkpoint fired.
DebugAction
What the solver should do after a DebugHook returns.
ResidKind
Which residual space a Residual entry comes from.

Traits§

DebugHook
A consumer that a solver pauses at each Checkpoint. The CLI’s REPL / agent driver is the production implementation; the same hook instance can drive any solver that exposes a DebugState.
DebugState
A live view of solver state handed to a DebugHook at a checkpoint.
IterSnapshot
An opaque, readable snapshot of a solver’s primal-dual state at one iteration, returned by DebugState::snapshot and replayed by DebugState::restore.

Type Aliases§

KktTriplets
Assembled KKT matrix triplets for viz kkt: (dim, irn, jcn, vals) (1-based lower triangle).
LFactor
Captured LDLᵀ factor for viz L: (n, perm, l_irn, l_jcn, l_vals).