Uh oh!
There was an error while loading. Please reload this page.
Extend the barrier solver to SOCP problems - #1051
Conversation
Build the cone-local Jordan-product, scaling, and corrector kernels needed for the SOCP barrier path before augmented-system integration.
Wire the SOCP cone Hessian updates into the augmented solve path and fold in the follow-up cleanup that removes now-redundant kernel plumbing.
Tighten the augmented-system SOCP updates so the barrier path converges on the mixed LP/QP cone cases covered by the new regression tests.
Flatten the remaining SOCP barrier plumbing, remove superseded cone kernels, and harden presolve so linear columns stay ahead of the trailing cone block.
…hecks Add row-cone and presolve regression cases around the SOCP barrier path, clean up the PR-facing test wording, and align the cone layout validation with the shared infinity convention. Signed-off-by: Yan Zaretskiy <yzaretskiy@nvidia.com>
… note that we separate quadratical constraint from the constraint matrix A and RHS
Removed unused temporary file variable in test.
Signed-off-by: yuwenchen95 <yuwchen@nvidia.com>
| } | ||
| } | ||
| if (!(problem.lower[j] == -inf && problem.upper[j] == inf)) { | ||
| presolve_info.phase1_bounded_linear_indices.push_back(j); |
There was a problem hiding this comment.
We should not have a variable named phase_1_bounded_linear_indices
| } | ||
| } | ||
| // Barrier presolve phase 2: negate one-sided bounds (-inf < x <= u -> -u <= x < inf). |
There was a problem hiding this comment.
Remove "Barrier presolve phase 2" from comment.
| // The original problem may have nonzero lower bounds | ||
| // 0 != l_j <= x_j <= u_j | ||
| // Barrier presolve phase 3: shift nonzero lower bounds to zero (cone/stack columns not shifted). |
There was a problem hiding this comment.
Remove "Barrier phase 3". Put back the original comment that was deleted.
Fine to add something about "Cone variables should not be shifted"
| } | ||
| // Check for empty rows | ||
| // Barrier presolve phase 4: remove empty rows and empty linear columns. |
There was a problem hiding this comment.
Remove "Barrier presolve phase 4"
| if (settings.barrier_presolve && free_variables > 0 && problem.Q.n > 0) { | ||
| presolve_info.free_variable_indices.clear(); | ||
| for (i_t j = 0; j < problem.num_cols; j++) { | ||
| // Barrier presolve phase 5: free linear variables — 5a native (QP/SOCP) or 5b v-w split (LP). |
There was a problem hiding this comment.
Remove "Barrier presolve phase 5" comment. And "5a, 5b"
| for (i_t j = 0; j < linear_cols; j++) { | ||
| if (problem.lower[j] == -inf && problem.upper[j] == inf) { | ||
| presolve_info.free_variable_indices.push_back(j); | ||
| presolve_info.native_free_linear_indices.push_back(j); |
There was a problem hiding this comment.
Why are we changing from free_variable_indices to native_free_linear_indices? Let's keep the old name
| } | ||
| } else if (settings.barrier_presolve && free_variables > 0) { | ||
| settings.log.printf( | ||
| "Keeping %d native free linear variables for augmented-system barrier (QP/SOCP)\n", |
There was a problem hiding this comment.
"Keeping %d free variables"
| "Keeping %d native free linear variables for augmented-system barrier (QP/SOCP)\n", | ||
| native_free_count); | ||
| } else if (settings.barrier_presolve && !has_cones && free_variables > 0) { | ||
| // Phase 5b: x_j = v - w with v, w >= 0 (LP without cones; SOCP/QP use phase 5a). |
There was a problem hiding this comment.
Remove "Phase 5" and "phase 5a" from comment. You could delete this comment.
| // becomes | ||
| // sum_{k != j} c_k x_k + c_j v - c_j w | ||
| std::vector<i_t> pair_index(problem.num_cols, -1); |
There was a problem hiding this comment.
Why does any of this code need to change. This is for the LP case. Just make sure we aren't in an SOCP or QP and then use this code. I'd suggest reverting these changes.
| Q_j[row_starts[partner_row]] = partner_col; | ||
| Q_x[row_starts[partner_row]] = qij; | ||
| row_starts[partner_row]++; | ||
| } |
There was a problem hiding this comment.
Please revert all changes from line 1196/1135 to here.
| problem.A.i[q] = i; | ||
| problem.A.x[q] = -aij; | ||
| q++; | ||
| csc_matrix_t<i_t, f_t> expanded_A(problem.A.m, num_cols, nnz); |
There was a problem hiding this comment.
Can you do this expansion only in the SOCP case?
| } | ||
| if (!presolve_info.phase1_bounded_linear_indices.empty()) { | ||
| settings.log.printf("Post-solve: %d linear column(s) had phase-1 bound tightening (x unchanged)\n", |
There was a problem hiding this comment.
The user should not be expected to know the internal phases of presolve!
Remove this print and this block of code entirely.
| const i_t u = free_variable_pairs[k]; | ||
| const i_t v = free_variable_pairs[k + 1]; | ||
| input_x[u] -= input_x[v]; | ||
| remove_partner[v] = true; |
| settings.log.printf("Post-solve: Correcting duals for %d bounded free variables\n", | ||
| static_cast<i_t>(presolve_info.bounded_free_variables.size())); | ||
| const csc_matrix_t<i_t, f_t>& A = original_problem.A; | ||
| csr_matrix_t<i_t, f_t> A_row(A.m, A.n, A.nnz()); |
There was a problem hiding this comment.
Revert these changes. Converting to A_row is not needed
| if (w_j == 0.0) { continue; } | ||
| const f_t du = w_j / bfv.coefficient; | ||
| input_y[bfv.constraint] += du; | ||
| for (i_t j = 0; j < A.n; j++) { |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| settings.method = method_t::Barrier; | ||
| settings.presolver = presolver_t::None; | ||
| // Quadratic objective support is minimization-only. |
There was a problem hiding this comment.
Is this correct? I thought we supported maximizing with quadratic objectives.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rg20
left a comment
There was a problem hiding this comment.
I reviewed only a subset of files. I will continue to review.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
chris-maes
commented
May 23, 2026
This PR is moved to #1290 . Please make all comments and changes on that PR. |
…ing, unify MPS CSR path
This is a draft PR that extends the 2x2 augmented system formulation of the barrier solver to solve SOCP problems. It supports both explicit cone variables as well as the cone rows in the Ax=b constraint, both of which can be specified in the CBF format. It uses Nesterov-Todd scaling to make the conic diagonal blocks symmetric.