Skip to content

Fix 3679 cupdlp infeas - #3689

Merged
jajhall merged 5 commits into
latestfrom
fix-3679-cupdlp-infeas
Nov 21, 2026
Merged

jajhall merged 5 commits into
latestfrom
fix-3679-cupdlp-infeas

Conversation

@Yanyu000

@Yanyu000 Yanyu000 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes #3679

PDLP (cuPDLP-C) wrongly reported UnboundedOrInfeasible on LPs with a very
small coefficient and presolve off, e.g. max x s.t. 1e-8 x <= 1, 1e8 x >= 1, x >= 0 (optimum 1e8), after one iteration. The mirror image
min x s.t. 1e-8 x >= 1, x >= 0 was wrongly reported as primal infeasible
(final status Unbounded). It was not a step size problem.

Cause: in PDHG_Compute_Dual_Infeasibility and
PDHG_Compute_Primal_Infeasibility the residual of the candidate ray was
converted back to unscaled units (rowScale/colScale). For these LPs the
residual/objective ratio was 1e-8, equal to dFeasTol, so the ray was
accepted.

Fix: measure the ray residuals in scaled space (CPU and GPU kernel
paths). A ray has no rhs to compare against, so the test should not depend on
row/column scaling. This differs from the optimality criteria, which still
use unscaled residuals, so I'd welcome a review of whether that is the right
choice.

Tests: pdlp-small-row-coefficient covers both LPs. The first LP needs
~8e7 iterations to reach optimality (~23 s on CPU), so the test only checks
that the status is no longer UnboundedOrInfeasible after 1000 iterations.
The mirror LP is solved to kOptimal.

Checked: pdlp-infeasible-lp and pdlp-unbounded-lp behave as before. Also
run on a CUDA build (CUPDLP_GPU=ON): no longer reports
UnboundedOrInfeasible.

Checklist

  • I have read the contributing guidelines
  • This PR targets the latest branch
  • Tests are passing
  • Documentation was updated where relevant
  • This PR is not primarily AI-generated (per the AI contributions policy in CONTRIBUTING.md)

@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.98%. Comparing base (38856a1) to head (3a864cc).
⚠️ Report is 5 commits behind head on latest.

Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #3689      +/-   ##
==========================================
+ Coverage   75.96%   75.98%   +0.01%     
==========================================
  Files         467      467              
  Lines      116460   116543      +83     
  Branches    18162    18163       +1     
==========================================
+ Hits        88471    88555      +84     
+ Misses      27749    27748       -1     
  Partials      240      240              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jajhall jajhall left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Has this been tested on other instances so that it doesn't now create new false positives?

Also, please merge latest into this branch so that the changes you've made aren't obscured by the many changes to latest

@BenChampion

Copy link
Copy Markdown
Collaborator
  • [ x] This PR targets the latest branch

In fact, it's targeting master.

(I don't have an option to change it, I think that's something you have to do @Yanyu000)

@jajhall
jajhall changed the base branch from master to latest November 19, 2026 15:58
@jajhall

jajhall commented Nov 19, 2026 •

Copy link
Copy Markdown
Member
  • [ x] This PR targets the latest branch

In fact, it's targeting master.

(I don't have an option to change it, I think that's something you have to do @Yanyu000)

Thanks @BenChampion Fixed!

Guess I have the necessary admin privilege

- Remove scaling variables no longer used in
  PDHG_Compute_Primal/Dual_Infeasibility
- Comment why ray residuals are measured in scaled space and label
  the ifScaled=0 kernel arguments
- Remove stray whitespace lines
- pdlp-small-row-coefficient: require kIterationLimit rather than
  just "not kUnboundedOrInfeasible"; add trailing newline
Measuring the ray residual only in unscaled space gave false positives
on LPs with tiny coefficients (#3679). Measuring it only in scaled space
could introduce false positives the original test would not give.

Compute the ray residual in both the scaled and unscaled spaces and
return the larger, on both the CPU and GPU paths. The rays accepted are
therefore a subset of those accepted before, so no new false positives
are possible, while #3679 is still fixed.
@Yanyu000

Copy link
Copy Markdown
Collaborator Author

Merged latest into the branch。

On false positives: I haven’t run a systematic test over other instances. However, I’ve changed the fix so that it cannot create new false positives relative to the original code. The ray residual is now computed in both the scaled and unscaled spaces, and the ray is only accepted if it passes the tolerance in both. So the set of rays accepted is a subset of those accepted before, and any infeasibility/unboundedness declared now would also have been declared by the original code. The cost is that some infeasible/unbounded LPs that were detected before might now only be detected later, or not at all.

The existing [pdlp] unit tests (including pdlp-infeasible-lp and pdlp-unbounded-lp) pass, and the new test now checks for kIterationLimit on the #3679 LP and kOptimal on its mirror.

@jajhall

jajhall commented Nov 21, 2026

Copy link
Copy Markdown
Member

Thanks, further experiments will determine whether this conservative strategy is needed

@jajhall jajhall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fine, thanks

@jajhall
jajhall merged commit 0eb18f9 into latest Nov 21, 2026
578 of 579 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDLP wrong on dynamic-range LP with presolve off (others Optimal 1e8)

3 participants