Skip to content

Review let-there-be-names branch#2

Open
ClayCampaigne wants to merge 59 commits intomasterfrom
clay/let-there-be-names-in-lp-files
Open

Review let-there-be-names branch#2
ClayCampaigne wants to merge 59 commits intomasterfrom
clay/let-there-be-names-in-lp-files

Conversation

@ClayCampaigne
Copy link
Owner

Local review PR syncing upstream feature branch

senhalil and others added 5 commits May 29, 2025 15:56
- I have two questions in NOTES
- I want to add a small test to verify that the variable names do appear in the exported LP files
- I need to remove the lines that export the LPs
@github-actions
Copy link

github-actions bot commented Sep 22, 2025

Benchmarks that have improved:

   before           after         ratio
 [a97464e8]       [946e39ca]
  •     1.51±0s          1.36±0s     0.90  matrix_stuffing.ParamConeMatrixStuffing.time_compile_problem
    
  •    46.3±0ms         39.8±0ms     0.86  matrix_stuffing.SmallMatrixStuffing.time_compile_problem
    
  •     249±0ms          168±0ms     0.68  high_dim_convex_plasticity.ConvexPlasticity.time_compile_problem
    
  •     583±0ms         14.3±0ms     0.02  simple_QP_benchmarks.ParametrizedQPBenchmark.time_compile_problem
    
  •     2.44±0s         14.5±0ms     0.01  simple_LP_benchmarks.SimpleFullyParametrizedLPBenchmark.time_compile_problem
    

Benchmarks that have stayed the same:

   before           after         ratio
 [a97464e8]       [946e39ca]
      3.00±0s          3.23±0s     1.08  quantum_hilbert_matrix.QuantumHilbertMatrix.time_compile_problem
      235±0ms          240±0ms     1.02  gini_portfolio.Murray.time_compile_problem
      253±0ms          256±0ms     1.01  simple_QP_benchmarks.SimpleQPBenchmark.time_compile_problem
      1.09±0s          1.09±0s     1.00  finance.FactorCovarianceModel.time_compile_problem
      297±0ms          297±0ms     1.00  slow_pruning_1668_benchmark.SlowPruningBenchmark.time_compile_problem
      346±0ms          344±0ms     0.99  gini_portfolio.Yitzhaki.time_compile_problem
      22.9±0s          22.7±0s     0.99  sdp_segfault_1132_benchmark.SDPSegfault1132Benchmark.time_compile_problem
      5.09±0s          5.04±0s     0.99  optimal_advertising.OptimalAdvertising.time_compile_problem
      13.4±0s          13.3±0s     0.99  finance.CVaRBenchmark.time_compile_problem
      5.38±0s          5.30±0s     0.99  svm_l1_regularization.SVMWithL1Regularization.time_compile_problem
      1.91±0s          1.89±0s     0.98  simple_QP_benchmarks.UnconstrainedQP.time_compile_problem
      4.74±0s          4.65±0s     0.98  huber_regression.HuberRegression.time_compile_problem
      876±0ms          859±0ms     0.98  simple_QP_benchmarks.LeastSquares.time_compile_problem
      961±0ms          937±0ms     0.98  simple_LP_benchmarks.SimpleScalarParametrizedLPBenchmark.time_compile_problem
      11.9±0s          11.6±0s     0.97  simple_LP_benchmarks.SimpleLPBenchmark.time_compile_problem
      541±0ms          522±0ms     0.97  semidefinite_programming.SemidefiniteProgramming.time_compile_problem
      1.14±0s          1.10±0s     0.96  gini_portfolio.Cajas.time_compile_problem
      299±0ms          285±0ms     0.95  matrix_stuffing.ParamSmallMatrixStuffing.time_compile_problem
      732±0ms          684±0ms     0.94  matrix_stuffing.ConeMatrixStuffingBench.time_compile_problem
      1.81±0s          1.67±0s     0.92  tv_inpainting.TvInpainting.time_compile_problem

PTNobel and others added 24 commits October 10, 2025 14:35
* Removes assert that prevents canonicalizing without parameter values

* renames c -> q in the ParamConicProg so it has the same API as ParamQuadProg

* Fixes a bug in the tests

* Fixes a bug
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 6 to 7.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@v6...v7)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fixes .name() for multiply expressions

* Fixes tests lol

* Fixes HiGHS tests
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.6 to 4.31.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@64d10c1...0499de3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* adding variable bounds to pdlp

* add check for none variable bounds

---------

Co-authored-by: William Zijie Zhang <william@gridmatic.com>
* dev container + powconeND template

* working on supporting powconeND

* added more support for powconeND

* trying to add support for ND cone

* tested passing generalized power cones to clarabel

* continuing working on nd, new example

* preliminary version, pre-dual handling. Need to check axis

* fixed axis handling, starting tests for general variable orderin

* tested variable switching for powconeND

* fix shape problems for power cone nd dual vars

* fix shape problems for power cone nd dual vars

* found bug in conversion of nd->3d cones

* clean-up changes, removed stale TODOs, more testing

* "cleaning up"

* moved checking for exotic constraints to within each solver loop

* slight logic improvement

* removed stale TODOs and cleaned up code

* fixed powconeND shape property when axis=1

* implemented additional checks in solving_chain, made powconeND tests compatible with cvxpy test set

* improved testing depth and readability

* suggested changes by Steven and William

* added explanation in power.py

* fixed bug causing unnecessary constraints to be added to the problem

* removed redundant axis checks in cone_matrix_stuffing

* Removed stale note in power.py

Removed note about potential 3-tuple return type.
…implementation (cvxpy#2985)

* support float k in sum_largest and sum_smallest

* support float k in lambda_sum_largest and lambda_sum_smallest

* reimplement cvar using sum_largest instead of dotsort
…2976)

* Use NumPy validation in hstack, vstack, concatenate, and sum

Replaces custom validation with NumPy's input validation using mock
arrays. Improves error messages by adding CVXPY context. Adds missing
test_hstack coverage.

This addresses the atoms specifically mentioned in cvxpy#2613 and improves
error message traceability as requested in cvxpy#2620. Other atoms may
benefit from similar improvements in future work.

* Refactor per reviewer feedback

- Consolidate validation: validate_arguments() now calls shape_from_args()
- Add cp. prefix to error messages for clarity
- Eliminates code duplication while maintaining error handling
* Added feasibility example + associated test

* Added feasibility example + associated test

* Modified feasibility speedup test to ensure same rng

* Apply suggestions from code review

Co-authored-by: Parth Nobel <parthnobel@berkeley.edu>

---------

Co-authored-by: Parth Nobel <parthnobel@berkeley.edu>
* change copt write test to use pytest skipif

* change gurobi as well
…n to return solution even if clarabel returns InsufficientProgress. (cvxpy#2987)

* Added options to Reduction.invert(). Added solver option "accept_unkown" for clarabel solver to return solution if status is InsufficientProgress.

* fix code style.

* Update cvxpy/tests/test_clarbel.py

Co-authored-by: Parth Nobel <parthnobel@berkeley.edu>

* Adding default value for solver options in Reduction.invert()

* Undo changes to function signature of Reduction.invert(). Add class SolverInverseData, which wraps inverse data and contains the solver instance and options.

* Fix code style and Problem.get_problem_data() to use solver inverse data class.

* Fix typo test_clarabel.py

---------

Co-authored-by: Parth Nobel <parthnobel@berkeley.edu>
cvxpy#3005)

* make get_problem_data work with dgp and no param values

* add tests for get_problem_data(gp=True, ...) with no param values

* clearer comment and another test

* fix comment for tests

* more comments
* dev container + powconeND template

* working on supporting powconeND

* added more support for powconeND

* trying to add support for ND cone

* tested passing generalized power cones to clarabel

* continuing working on nd, new example

* preliminary version, pre-dual handling. Need to check axis

* fixed axis handling, starting tests for general variable orderin

* tested variable switching for powconeND

* fix shape problems for power cone nd dual vars

* fix shape problems for power cone nd dual vars

* found bug in conversion of nd->3d cones

* clean-up changes, removed stale TODOs, more testing

* "cleaning up"

* moved checking for exotic constraints to within each solver loop

* slight logic improvement

* removed stale TODOs and cleaned up code

* fixed powconeND shape property when axis=1

* implemented additional checks in solving_chain, made powconeND tests compatible with cvxpy test set

* improved testing depth and readability

* suggested changes by Steven and William

* added explanation in power.py

* fixed bug causing unnecessary constraints to be added to the problem

* removed redundant axis checks in cone_matrix_stuffing

* power v2 elementwise tests

* power tests

* added nonnegativity constraints

* Update cvxpy/reductions/dcp2cone/canonicalizers/power_canon.py

Co-authored-by: Parth Nobel <parthnobel@berkeley.edu>

* refactoring tests for pytest compatability

* removed stale todos

* added approx to get_data method of power class

* removed extra lines

* removed stale notes

---------

Co-authored-by: Parth Nobel <parthnobel@berkeley.edu>
* fix canonicalization

* iterating on bug

* Refactor QP solver tests to use inheritance for conic solver testing

- Create QPTestBase class with shared setUp() and test helper methods
- TestQp inherits from QPTestBase for native QP solvers
- Add TestConicQuadObj class for conic solvers with use_quad_obj=True
- Verify QP canonicalization by checking no SOC cones are introduced
- Handle REQUIRES_CONSTR solvers by skipping unconstrained tests

This eliminates ~280 lines of duplicate _conic test helper methods
while maintaining full test coverage for both QP and conic solvers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add license checking for conic solvers in TestConicQuadObj

Move license checking functions (is_mosek_available, is_knitro_available,
is_xpress_available) to QPTestBase as static methods and add
filter_licensed_solvers helper. Apply filtering in TestConicQuadObj.setUp()
to fix CI failures when KNITRO is installed but unlicensed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add license checking for conic solvers in TestConicQuadObj

Move license checking functions (is_mosek_available, is_knitro_available,
is_xpress_available) to QPTestBase as static methods and add
filter_licensed_solvers helper. Apply filtering in TestConicQuadObj.setUp()
to fix CI failures when KNITRO is installed but unlicensed.

Strengthen KNITRO check to test parameter setting (KN_set_int_param) since
KN_new() can succeed even when KNITRO is partially broken (error -521).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* just skip knitro for the new tests

---------

Co-authored-by: Claude <noreply@anthropic.com>
* removing QP canonicalization code, switching over to conic

* skip contorl check

* tests passing

* KNITRO failing on windows

* fix problem.is_qp()

* fix comment
* tiny speedup

* remove flaky test
* install cvxpygen from sources

* checkout submodules
* Fix formatting bug

* Whitespace nit
…xpy#3020)

* first cut

* cleaned up tests

* switch to explicit NonNeg

* clarifying comment on vectorization

* condense tests

* fixed elementwise SOC

* more condensation of tests

* use socp_1/2 from solver_test_helpers

* circular type issue
* Adds moreau

* Adds interface file

* Responds to reviews
govindchari and others added 30 commits December 9, 2025 17:17
* Cuda backend

* Fix cast

* Fix comparison

* Ruff

* Allow qoco to handle error
* "Claude PR Assistant workflow"

* "Claude Code Review workflow"
* clean DPP + complex support

* generalized many GP and complex specific codes

* got tests passing

* reorganized and condensed tests

* proper handling of Hermitian parameters

* try to fix windows cylp

* can't do cylp on windows

* switch uv installation approach

* try no uv

* really use no uv

* drop windows for now

* add comment
…icalization path (cvxpy#3033)

* beautiful handling of block diagonal quadratic forms

* mirroring between QuadForm and SymbolicQuadForm

* claude addressed claude's comments

* fix typo
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](pypa/cibuildwheel@v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…3036)

Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.7.2 to 4.7.6.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](JamesIves/github-pages-deploy-action@v4.7.2...v4.7.6)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-version: 4.7.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.2 to 4.31.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@0499de3...1b168cd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…vxpy#3038)

* remove examples and move them to another repo

* fix review from claude, including all hyperlinks
* Adding einsum atom; squashed commits

* isolated DGP test

* removed incorrect import, updated docstrings

* fixing tricky canonicalization issue

* adding docs

* removing dependance on numpy internals; documented implementation more thoroughly

* minor edit to einsum docstring

* ran ruff format
* removing completed projects

* deletes more stuff

* update contributing list again

* update docs with more suggestions from steven

* adds type check on list
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.8 to 4.31.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@1b168cd...5d4e8d1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* experimenting with new SCIPY backend

* Setup testing infra

* cleaning up lazy backend

* cleaning up coo backend

* more tests are passing

* all tests passing

* update dpp benchmarks

* pass on COO backend

* added ND tests

* some reorg

* drop benchmarks code

* remove warning for too large problems

* minor fixes

* safer logic for backend selection

* fix tests

* claude responds to claude

* addressed massive memory allocation

* working on addressing will's comments

* iterating on tests

* tests pass

* fix bug

* another speedup

* Addressed remaining comments

* renamed to CooTensor

* fix failing tests

* better handling of sparse data

* round of addressing comments

* alignment with scipy backend and a few Coo backend tests

* some refactoring to indexing and its helpers

---------

Co-authored-by: William Zijie Zhang <william@gridmatic.com>
* Fixes quad_over_lin

* Adds unittest
* first attempt

* axis = None failing

* axis = None passes

* added ND grad tests

* simplification

* remove special case code

* added future warning for cumsum(scalar) behavior

* remove graph_implementaiton

* clarify 0D warning

* fix dqcp test raising future warning

* create lower triangular sparse matrix directly, rathern than through dense to sparse
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* minimal step towards axis arg for sum_squares

* more proper canonicalization

* more full featured implementation

* vectorized SOC constraints

* inherit from AxisAtom

* address claude's comments

* Remove redundant sum_squares_axis test

Removed redundant test for sum of squares as it is covered by another test.

* Clean up comments in quad_over_lin.py

Removed unnecessary comments about inherited methods.
* attempting a more systematic validation of _grad
  Add expression-level gradcheck utility and fix gradient bugs

  Implement a PyTorch-style gradcheck for systematically validating
  expression-level gradients (expr.grad[var]) against numerical finite
  differences.

  New test infrastructure (test_expression_gradcheck.py):
  - expression_gradcheck() using central finite differences
  - expression_gradcheck_multi() for multi-variable atoms
  - AtomInputGenerator for domain-aware input generation
  - Parametrized tests covering ~50 atoms with multiple random seeds
  - 185 passing tests, 64 skipped (atoms without gradient support)

  Bug fixes discovered by gradcheck:

  1. cumsum._grad (cumsum.py):
     - Was returning standard Jacobian (lower triangular) instead of
       CVXPY convention grad[i,j] = d(out[j])/d(in[i]) (upper triangular)
     - Fixed axis=None case with correct F-order permutation handling

  2. quad_over_lin._grad (quad_over_lin.py):
     - Used np.reshape() without order='F', returning C-order instead
       of CVXPY's F-order vectorization convention
     - Fixed scalar handling when y is a 1-element array

  Updated test_grad.py to use corrected gradient conventions.

  Known issues (skipped in tests):
  - pnorm_inf/norm_inf: Gradient not implemented
  - matmul/multiply: Bugs in binary_operators.py for bilinear gradients

* fixed matmul and mul elemwise grads

* validated more atoms

* pass at consolidation

* fixed domains

* added more ND checks

* consolidating test_grad

* consolidate grad further

* address claude's comments

* remove tril

* Inline test ID helper functions per review feedback

Remove get_atom_config_ids(), get_multi_var_config_ids(), and
get_domain_violation_ids() functions and inline their list
comprehensions directly at the call sites.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…ling (cvxpy#3044)

* Add ignore_nan option to solver and validation tests for NaN/Inf handling

* Moved to ParamConeProg and made some performance enhancements.

* Update doc/source/tutorial/solvers/index.rst

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update cvxpy/problems/problem.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* stripped down nan checking

* clarify where inf is allowed

* moved nan check

* clarifying comment

* more efficient nan check

* better test

---------

Co-authored-by: Matthew Glover <matthew.l.glover@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Steven Diamond <diamond@cs.stanford.edu>
* add CSR option

* Changes what order argument does

---------

Co-authored-by: Parth Nobel <parthnobel@berkeley.edu>
* document current sum of list behaviour

* support generator input

* use GeneratorType to make generator support cleaner

---------

Co-authored-by: Muhammad Yasirroni <yasirroni@users.noreply.github.com>
- Fix type hint: validate_column_name returns None, not bool
- Extract set_column_names_from_variables() helper to reduce duplication
- Remove outdated TODO about HiGHS PR cvxpy#2274 (merged in v1.11.0)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.