Skip to content

Commit 3986e54

Browse files
perf: avoid duplicate soft weight clearing
Let the model update hook own clearing and assigning per-knot soft weights. The core dispatcher now only calls the hook for structural soft models, avoiding a second L1/L2 vector clear before generated soft models run. Harness: core5+specialist Scope: solver-core Evidence: pytest -q tests/minimodel/test_constraints.py tests/minimodel/test_model_safety.py; cmake --build build -j16; ctest --test-dir build --output-on-failure -j16; nmpc-bench race_cars fixed-binary A/B in /tmp/nmpc-bench-commit3-race-repeat/summary.csv; git diff --check
1 parent d37c3e1 commit 3986e54

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

include/minisolver/core/constraint_semantics.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ template <typename Model, typename Knot> void update_soft_constraint_weights(Kno
124124
{
125125
if constexpr (model_may_have_l1_constraints<Model>()
126126
|| model_may_have_l2_constraints<Model>()) {
127-
kp.l1_weight.setZero();
128-
kp.l2_weight.setZero();
129127
if constexpr (has_update_soft_constraint_weights<Model, Knot>::value) {
130128
Model::template update_soft_constraint_weights<double>(kp);
131129
}

0 commit comments

Comments
 (0)