Subcategory: Code structure & readability — score 9 → 10
Source: rhiza_quality assessment
Problem
On the inner="exact" path, solve_nnqp_eq.sub_solve calls the shared _make_free_solve closure once for the v0 right-hand side and once per Schur-complement column — p + 1 calls, all on the same free set idx. The exact branch of _make_free_solve evaluates op.rcond_free(idx) on every call, so the (potentially O(|F|^3)) conditioning estimate is recomputed p + 1 times per free set even though the free block is identical across them.
Where
src/nncg/solver.py — _make_free_solve, exact branch (the op.rcond_free(idx) guard)
- Called
p + 1 times per free set from solve_nnqp_eq.sub_solve
Done when
The exact equality path evaluates op.rcond_free(idx) at most once per free set (e.g. hoist the guard into sub_solve before the column loop, or memoize on idx), the solve_nnqp path is unaffected, and make test stays green at 100% coverage.
Subcategory: Code structure & readability — score 9 → 10
Source: rhiza_quality assessment
Problem
On the
inner="exact"path,solve_nnqp_eq.sub_solvecalls the shared_make_free_solveclosure once for thev0right-hand side and once per Schur-complement column —p + 1calls, all on the same free setidx. Theexactbranch of_make_free_solveevaluatesop.rcond_free(idx)on every call, so the (potentiallyO(|F|^3)) conditioning estimate is recomputedp + 1times per free set even though the free block is identical across them.Where
src/nncg/solver.py—_make_free_solve,exactbranch (theop.rcond_free(idx)guard)p + 1times per free set fromsolve_nnqp_eq.sub_solveDone when
The
exactequality path evaluatesop.rcond_free(idx)at most once per free set (e.g. hoist the guard intosub_solvebefore the column loop, or memoize onidx), thesolve_nnqppath is unaffected, andmake teststays green at 100% coverage.