Correct quadratic-constraint claims in formulation skill#1407
Conversation
The concepts-only formulation skill claimed QP supports only linear
constraints and that quadratic constraints are unsupported. cuOpt does
support convex quadratic constraints (PSD, inequality only), which it
converts to second-order cones and solves with the barrier method;
non-convex or equality quadratic constraints remain unsupported. Fixes
the LP/MILP/QP table Constraints row and the formulation-questions note.
Also adds a boundary to the post-solve sensitivity note: dual values are
not returned when the model includes quadratic constraints, so users do
not expect a dual off a second-order cone constraint.
Verified against python/cuopt/cuopt/tests/socp/test_socp.py (quadratic
constraints solved with SolverMethod.Barrier) and
docs/cuopt/source/cuopt-c/convex/convex-examples.rst ("dual variables
are not currently returned for problems with quadratic constraints").
Phrasing aligned with the sibling cuopt-multi-objective-exploration
skill for consistency.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: cafzal <cameron.afzal@gmail.com>
…vior cpp/src/pdlp/solve.cu (has_quadratic_constraints -> thrust::fill the entire dual_solution + reduced_cost with quiet_NaN) shows a single quadratic constraint suppresses duals for the *whole* solve, not just that constraint's row. Reword "no dual for a quadratic constraint" -> "any quadratic constraint makes cuOpt return no duals for the whole solve" in Step 3 and the QP eval, for consistency with PRs NVIDIA#1407 (formulation) and NVIDIA#1408 (api skills, "NaN-filled"). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: cafzal <cameron.afzal@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughClarifies that QP supports linear plus convex quadratic (inequality-only) constraints via second-order cones, updates post-solve sensitivity guidance to state duals are unavailable when quadratic constraints exist, and expands the constraints checklist to exclude non-convex and equality quadratic constraints. ChangesQP Constraint Capabilities and Post-Solve Guidance Documentation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@skills/cuopt-numerical-optimization-formulation/SKILL.md`:
- Line 32: Update the table entry text "Linear + convex quadratic (PSD,
inequality) via second-order cones" to explicitly state the convexity condition
for both inequality directions: specify that quadratic forms with "≤" require a
positive semidefinite (PSD) Hessian, while quadratic forms with "≥" require a
negative semidefinite (NSD) Hessian (i.e., −H is PSD); apply this same
clarification to the other occurrence of the phrase at the second location
referenced.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 04fa816c-d234-4d6a-a54f-f145a60bff1c
📒 Files selected for processing (1)
skills/cuopt-numerical-optimization-formulation/SKILL.md
Per review feedback: "PSD, inequality" is incomplete — a `<=` quadratic constraint needs a PSD Hessian while a `>=` needs NSD. Drop the linear-algebra detail and say just "convex quadratic constraints (inequality only)", which is correct for both directions; the existing "non-convex ... not" clause carries the rest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: cafzal <cameron.afzal@gmail.com>
Replace "shadow prices" with "dual values" in the LP/MILP/QP sensitivity row
and the post-solve note, keeping the decision meaning ("where to invest").
Consistent with the api-* skill trim in NVIDIA#1408.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: cafzal <cameron.afzal@gmail.com>
#1408) Corrects the dual-value scope in the `cuopt-numerical-optimization-api-python` and `-api-c` skills from "LP only" to **LP/QP**: cuOpt's barrier solver is primal-dual, so a QP with linear constraints returns shadow prices and reduced costs (the "LP only" wording predates the 26.06 QP/barrier work). Documents the boundary — problems with quadratic constraints return no duals (`NaN`-filled), so the constraints you read duals from must be linear — and adds a short QP-duals example to the Python references. Verified in source (`cuopt_c.h`, `pdlp/solve.cu`) and empirically on a 26.08 nightly (`budget` dual ≈ 6.667; quadratic constraint → `NaN`). Follows #1393; companion to #1407 (formulation). Existing `lp_duals` assets unchanged; `validate_skills.sh` passes. Authors: - Cameron Afzal (https://github.com/cafzal) Approvers: - Ramakrishnap (https://github.com/rgsl888prabhu) - Miles Lubin (https://github.com/mlubin) URL: #1408
Description
Corrects a stale claim in the concepts-only
cuopt-numerical-optimization-formulationskill: it stated quadratic constraints are unsupported, but cuOpt supports convex quadratic constraints (PSD, inequality) via second-order cones, with non-convex and equality forms still unsupported. Three concepts-level edits (no API symbols): the LP/MILP/QP constraints row, the constraints formulation question, and one line noting duals aren't returned when the model has quadratic constraints.Verified in source (
tests/socp/test_socp.py,barrier/translate_soc.hpp). Follows #1393; companion to #1408 (API dual scope).validate_skills.shpasses; generated artifacts regenerate via NVSkills-Eval.Checklist