Skip to content

[codex] Fix constraint violation logging#27

Merged
nepfaff merged 1 commit into
mainfrom
codex/fix-constraint-violation-logging
May 13, 2026
Merged

[codex] Fix constraint violation logging#27
nepfaff merged 1 commit into
mainfrom
codex/fix-constraint-violation-logging

Conversation

@nepfaff
Copy link
Copy Markdown
Owner

@nepfaff nepfaff commented May 13, 2026

Summary

Fix W&B constraint violation logging so equality tolerances are assigned from each constraint row rather than from a zipped Lagrange-multiplier equality mask.

Root Cause

AugmentedLagrangianNonsmooth.is_equality() is ordered by Lagrange multiplier, while prog.GetAllConstraints() is ordered by constraint object. A two-sided inequality contributes two inequality multiplier entries, so zipping constraints with is_equality() can shift later equality constraints onto False mask entries. In that case endpoint equalities are checked with the stricter inequality tolerance.

Changes

  • Iterate over constraints and constraint types only, tracking lag_idx separately for multiplier/residue indexing.
  • Choose equality vs inequality tolerance from each constraint row's bounds (lb == ub).
  • Add assertions to catch future metadata/order mismatches.
  • Simplify constraint-type counter initialization.

Validation

  • python3 -m py_compile robot_payload_id/optimization/nevergrad_augmented_lagrangian.py

Full Drake runtime reproduction was not run in this scratch environment because pydrake is not installed.

@nepfaff nepfaff force-pushed the codex/fix-constraint-violation-logging branch from 96d801b to d56c5f2 Compare May 13, 2026 18:57
@nepfaff nepfaff marked this pull request as ready for review May 13, 2026 18:57
@nepfaff nepfaff merged commit 651de92 into main May 13, 2026
0 of 2 checks passed
@nepfaff nepfaff deleted the codex/fix-constraint-violation-logging branch May 13, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant