Fix false infeasibility for badly scaled QPs in daqp_ldp#137
Closed
Fix false infeasibility for badly scaled QPs in daqp_ldp#137
Conversation
…2 in fval_bound
For poorly conditioned Hessians with large f, v = R^{-T}*f can be very large.
The internal LDP objective ||u||^2 ≈ ||v||^2 at the optimum can then exceed
the old hard limit 2*fval_bound (= 2e30 by default), causing daqp_ldp to
return INFEASIBLE for feasible problems.
Fix: compute v_norm2 = ||work->v||^2 at the start of daqp_ldp and use
fval_bound = 2*settings->fval_bound + v_norm2
so the check is equivalent to testing whether the QP objective
0.5*(||u||^2 - ||v||^2) > settings->fval_bound,
which is the semantically correct condition.
Also adds a regression test (test_08_badly_scaled) covering the non-prox path
(H just above zero_tol) and the prox path (H below zero_tol).
Co-authored-by: darnstrom <55484604+darnstrom@users.noreply.github.com>
Agent-Logs-Url: https://github.com/darnstrom/daqp/sessions/51944423-3526-446b-b4a2-85d457f1ecb8
Copilot
AI
changed the title
[WIP] Fix numerical handling for DAQP infeasible problems
Fix false infeasibility for badly scaled QPs in daqp_ldp
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For poorly conditioned Hessians combined with a large
f, the LDP transformation producesv = R⁻ᵀfwith very large norm. The internal objective||u||²equals roughly||v||²at the optimum, which was incorrectly exceeding the hard internal limit2 * settings->fval_bound(default2e30) and causingDAQP_EXIT_INFEASIBLEon feasible problems. This affects both the directdaqp_ldppath and the inner solve insidedaqp_prox.Example that previously returned
INFEASIBLE:Changes
src/daqp.c— At the start ofdaqp_ldp, computev_norm2 = ||work->v||²and use:This makes the check equivalent to
0.5*(||u||² − ||v||²) > settings->fval_bound— i.e. the actual QP objective exceeds the user-specified bound — which is the correct condition regardless of problem scaling.interfaces/daqp-eigen/tests/08_badly_scaled.cpp— Regression test covering:H = 1e-10,||v||² ≈ 1e36)H = 1e-20, innerdaqp_ldpwith||v||² ≈ 1e32)H = diag(1e8, 1e-8))💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.