fix(solver): build weight vector after pre-passes to match free param count #35

Merged
forbes merged 1 commits from fix/weight-vector-after-prepass into main 2026-02-23 03:19:28 +00:00

1 Commits

Author SHA1 Message Date
forbes-0023
0825578778 fix(solver): build weight vector after pre-passes to match free param count
The weight vector was built before substitution_pass and
single_equation_pass, which can fix variables and reduce the free
parameter count. This caused a shape mismatch in newton_solve when
the Jacobian had fewer columns than the weight vector had entries:

  ValueError: operands could not be broadcast together with shapes
  (55,27) (1,28)

Move build_weight_vector() after both pre-passes so its length
matches the actual free parameters used by the Jacobian.
2026-02-22 21:06:21 -06:00