Skip to content

Remove the LGPL CSparse-derived code that came in with cuPDLP-C. - #3719

Open
galabovaa wants to merge 1 commit into
latestfrom
cupdlp-csparse
Open

galabovaa wants to merge 1 commit into
latestfrom
cupdlp-csparse

Conversation

@galabovaa

@galabovaa galabovaa commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

highs/pdlp/cupdlp/cupdlp_cs.c and cupdlp_cs.h are adapted from Tim Davis's CSparse, which is LGPL-2.1-or-later. Upstream cuPDLP-C now labels them as such. Downstream distributions that need permissively licensed bundled code, such as SciPy, can't ship them.

They had only one use: csc2csr (and the unused csr2csc) in cupdlp_utils.c. These transposed the constraint matrix so that cuPDLP-C holds both a CSC and a CSR copy.

Changes:

  • CupdlpWrapper.cpp: the new csr_alloc_from_csc builds the CSR copy from the scaled CSC matrix with HiGHS's own HighsSparseMatrix::ensureRowwise, then passes it to csr_alloc_matrix as a CSR source. data_alloc now returns RETCODE_FAILED for any input format other than CSC. The wrapper only ever passes CSC.
  • cupdlp_utils.c/.h: deletes csc2csr, csr2csc and the CSR↔CSC cases in csr_alloc_matrix/csc_alloc_matrix. csr_copy now copies with CUPDLP_COPY_VEC and creates the cuSPARSE CSR descriptor, matching csc_copy. csc2csr used to do both, so GPU builds keep their device CSR matrix. As a result csr_copy returns cupdlp_int instead of void.
  • Deletes cupdlp_cs.c/.h and removes them from cupdlp.h, cmake/sources.cmake, the CUDA source list in highs/CMakeLists.txt, highs/meson.build and cupdlp/Diff. Bazel picks up *.c by glob, so it needs no change.
  • cupdlp/README.md: notes why the files were removed.

These are internal cuPDLP-C symbols, so the HiGHS API and the language bindings are unchanged. The installed internal header include/highs/pdlp/cupdlp/cupdlp_cs.h no longer exists.

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)

Related issue

Closes #3712

@galabovaa galabovaa changed the title wip Remove the LGPL CSparse-derived code that came in with cuPDLP-C. Nov 17, 2026
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.05%. Comparing base (3ee6913) to head (1093dc2).
⚠️ Report is 35 commits behind head on latest.

Files with missing lines Patch % Lines
highs/pdlp/CupdlpWrapper.cpp 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #3719      +/-   ##
==========================================
+ Coverage   75.97%   76.05%   +0.08%     
==========================================
  Files         461      460       -1     
  Lines      114795   114697      -98     
  Branches    17990    17969      -21     
==========================================
+ Hits        87215    87234      +19     
+ Misses      27294    27177     -117     
  Partials      286      286              

☔ 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.

This branch has not been deployed

No deployments
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.

2 participants