Skip to content

Conversation

@dfridovi
Copy link
Member

Adds an additional kwarg in the solver which allows the user to specify how the Newton step computation should be regularized. Currently supports three options:

  • :none (no regularization)
  • :identity (adds scaled identity to the KKT Jacobian)
  • :internal (assumes that the Symbolics-generated KKT Jacobian accepts a regularization parameter directly)

Also adds an example of :internal regularization in game.jl where we add a scaled identity only to the blocks of the KKT Jacobian that correspond to the Hessian of each player's Lagrangian wrt its decision variable.

Also adds some minimal logic to adjust regularization strength depending upon success/failure of inner loop solves.

…cluding lagrangian hessian regularization for games
@dfridovi dfridovi requested review from lassepe and leedh0124 August 14, 2025 21:55
Copy link
Collaborator

@lassepe lassepe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo minor comments

mcp.∇F_z!(∇F, x, y, s; θ, ϵ)
end

if regularize_linear_solve === :identity
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be folded into a elseif of above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but thought the logic was simpler this way. Basically, for :internal mode you need to regularize ∇F directly when computed in place, and for both :identity and :none you compute it without the extra parameter. Then, for :identity only do you modify it when passing to the linear solver by adding an explicit scaled identity (if ∇F is square).

src/mcp.jl Outdated
"""
struct PrimalDualMCP{T1,T2,T3}
"A callable `F!(result, x, y, s; θ, ϵ)` which computes the KKT error in-place."
"A callable `F!(result, x, y, s; θ, ϵ, [η])` to the KKT error in-place."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"A callable `F!(result, x, y, s; θ, ϵ, [η])` to the KKT error in-place."
"A callable `F!(result, x, y, s; θ, ϵ, [η])` to compute the KKT error in-place."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol thanks

@dfridovi dfridovi merged commit 6c79536 into main Aug 15, 2025
2 checks passed
@dfridovi dfridovi deleted the feature/better-regularization branch August 15, 2025 13:03
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.

3 participants