Skip to content

Merge develop into main: NETLIB integration, MATLAB MPS loader, and accumulated develop history#12

Merged
napinoco merged 17 commits into
mainfrom
develop
Jul 5, 2026
Merged

Merge develop into main: NETLIB integration, MATLAB MPS loader, and accumulated develop history#12
napinoco merged 17 commits into
mainfrom
develop

Conversation

@napinoco

@napinoco napinoco commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

This brings main up to date with develop, which had diverged significantly. Highlights from this session's work:

  • NETLIB LP benchmark integration: merged in the previously separate claude/add-netlib-benchmark-aCnsP branch (94 NETLIB problems, MPS loader, registry entries) and resolved conflicts with develop's original-status-preservation work.
  • NETLIB benchmark results: ran all 94 NETLIB problems against all 9 Python solvers (846 runs) and against matlab_sedumi/matlab_sdpt3 (188 runs).
  • New MATLAB MPS loader (scripts/data_loaders/matlab/mps_loader.m): NETLIB problems previously failed on MATLAB solvers ("Unsupported file type: mps"); this adds proper support, including correct SeDuMi free/nonnegative variable ordering (validated against known optimal values).
  • NETLIB known objective values: populated known_objective_value for 93/94 NETLIB problems from the official NETLIB LP summary table (netlib.org/lp/data/readme), documented in docs/guides/NETLIB_KNOWN_OBJECTIVES.md.
  • Data quality finding (documented, not fixed): scripts/data_loaders/python/mps_loader.py doesn't reorder free variables, causing wrong OPTIMAL objective values from CVXPY/SciPy backends on 11 NETLIB problems with FR/MI bounds.
  • Plus all previously accumulated develop-only history (subprocess isolation architecture, timeout controls, Docker attempt + revert, database management refactors, report redesigns, etc.) that had not yet been merged to main.

Test plan

  • pytest tests/ passes (75 passed, 1 skipped — submodule-dependent)
  • ruff check / ruff format --check pass
  • python main.py --validate passes (9/9 Python solvers)
  • NETLIB benchmark: 846/846 Python runs completed, 188/188 MATLAB runs completed
  • New MATLAB MPS loader validated against known optimal values (afiro, capri including free-variable case)

napinoco and others added 17 commits August 16, 2025 00:51
- Enhanced SDPT3 termcode mapping with more precise status categories
- Added STALLED status for algorithm progress stagnation (termcodes -2, -5, -7, -8, -9)
- Added NUM_ERROR for true numerical failures (termcodes 3, -3, -4)
- Improved MAX_ITER handling for iteration limits (termcodes -1, -6)
- Updated HTML report generator with new status styles and legend
- Better distinction between numerical errors and algorithmic stagnation

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Enhanced SEDUMI numerr code mapping with precision distinction
- Added 'optimal (inaccurate)' status for numerr=1 (matches CVXPY convention)
- Kept num_error status for numerr=2 (complete numerical failure)
- Updated HTML report generator to handle 'optimal (inaccurate)' consistently
- Better diagnostic capability for SEDUMI numerical issues

Changes:
- SEDUMI numerr=1: 'optimal (inaccurate)' (solution found but low accuracy)
- SEDUMI numerr=2: 'num_error' (complete numerical failure)
- Status format now consistent with CVXPY: 'OPTIMAL (INACCURATE)'
- Removed incorrect 'optimal_inaccurate' format from HTML report

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Added original_status field to SDPT3 and SEDUMI result structures
- Preserved complete solver-specific status information in database
- Enhanced reproducibility and debugging capabilities for research use

SDPT3 original status preservation:
- termcode: SDPT3's internal termination code (-2, -3, etc.)
- iter: iteration count
- full_info: complete info structure from SDPT3

SEDUMI original status preservation:
- pinf: primal infeasibility flag (0/1)
- dinf: dual infeasibility flag (0/1)
- numerr: numerical error level (0/1/2)
- feasratio: feasibility indicator
- full_info: complete info structure from SEDUMI

Implementation:
- Modified MATLAB runner functions to include original_status
- Updated JSON conversion pipeline to preserve original status
- Extended Python interface to store original_status in additional_info
- Verified database storage contains complete solver metadata

Benefits:
- Future status mapping changes can reinterpret historical data
- Complete traceability for debugging solver behavior
- Research publications can reference exact solver exit codes
- Enhanced reproducibility for scientific use

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Extended original_status preservation to Python solver ecosystem
- Enhanced reproducibility and debugging for CVXPY and SciPy solvers
- Comprehensive solver metadata collection for research applications

CVXPY original status preservation:
- cvxpy_status: Original CVXPY status string ('optimal', 'optimal_inaccurate', etc.)
- cvxpy_value: Objective function value from CVXPY
- solver_stats: Complete solver statistics (solve_time, num_iters, extra_stats)

SciPy original status preservation:
- scipy_status: Original SciPy status code (0=optimal, 1=max_iter, etc.)
- scipy_success: Success boolean flag
- scipy_message: Detailed solver message (includes backend info)
- scipy_fun: Objective function value
- scipy_nit: Number of iterations
- Backend-specific metrics: crossover_nit, mip_dual_bound, mip_gap, etc.

Implementation:
- Added original_status to additional_info in both CVXPY and SciPy runners
- Preserved all available solver-specific metadata
- Maintained backward compatibility with existing result format
- Verified database storage contains complete original information

Testing verified:
- CVXPY CLARABEL: cvxpy_status='optimal_inaccurate', complete solver_stats
- SciPy HiGHS: scipy_status=0, scipy_success=True, detailed backend info

Benefits:
- Complete traceability for all solver backends
- Enhanced debugging capabilities for numerical issues
- Research-grade reproducibility for academic publications
- Future-proof result reinterpretation capabilities

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive status code documentation to detail_design.md
- Document NUM_ERROR, STALLED, MAX_ITER, OPTIMAL (INACCURATE) status codes
- Add complete original_status structure for MATLAB and Python solvers
- Update basic_design.md with reproducibility enhancement mention
- Ensure documentation consistency with new original status feature

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Netlib repository as git submodule (94 LP problems)
- Implement MPS file loader with SeDuMi format conversion
- Register MPS loader in problem_interface.py
- Add all 94 Netlib problems to problem_registry.yaml
- Convert inequality constraints to equality with slack variables
- Handle variable bounds through cone structure

https://claude.ai/code/session_014WRtEFZErWR9kZd5dXoHTq
- Remove unused imports (List, Tuple, Optional, csr_matrix)
- Fix import order to comply with isort rules
- Rename unused loop variables to _lo, _up convention

https://claude.ai/code/session_014WRtEFZErWR9kZd5dXoHTq
- Add NETLIB to KNOWN_LIBRARIES in registry integrity test
- Fix test_problem_files_exist skip condition to require all submodules
- Add mps to expected supported_formats in statistics test

https://claude.ai/code/session_014WRtEFZErWR9kZd5dXoHTq
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WRtEFZErWR9kZd5dXoHTq
…P' into develop

# Conflicts:
#	docs/development/detail_design.md
#	scripts/reporting/html_generator.py
#	scripts/solvers/matlab/matlab_process_interface.py
#	scripts/solvers/python/cvxpy_runner.py
#	scripts/solvers/python/scipy_runner.py
Post-merge cleanup: ruff format normalized the manually re-applied
original_status blocks in cvxpy_runner.py and scipy_runner.py.
…t modules

The html_generator.py -> report module split (from the netlib branch
merge) dropped the STALLED/MAX_ITER/NUM_ERROR CSS classes and status
legend entries that develop had added to the old monolithic
html_generator.py. Re-add them to results_matrix_report.py and
raw_data_report.py, and extend raw_data_report.py's status_class
mapping to also cover TIMEOUT/SIGKILL/SUBPROCESS_ERROR/UNKNOWN
(previously only handled in the results matrix view).
Run the 94-problem NETLIB LP library against all 9 registered Python
solvers (846 runs, 100% completion rate: 594 OPTIMAL, 42 OPTIMAL
(INACCURATE), 121 ERROR, 31 UNBOUNDED, 28 INFEASIBLE, 27
SUBPROCESS_ERROR, 3 TIMEOUT). Regenerated HTML reports and JSON/CSV
data exports to include the new results.
Port the NETLIB MPS parsing/conversion logic (scripts/data_loaders/python/mps_loader.py)
to MATLAB as scripts/data_loaders/matlab/mps_loader.m, and wire it into
matlab_solver_runner.m for file_type='mps'. This lets matlab_sedumi and
matlab_sdpt3 run NETLIB problems, which previously failed with
"Unsupported file type: mps".

Unlike the Python loader, variables are explicitly reordered so free
variables (K.f) come before nonnegative variables (K.l), matching
SeDuMi's strict cone ordering convention. Validated against afiro
(no free vars, matches known optimal -464.7531) and capri (14 free
vars, matches the known optimal 2690.0129 exactly).
Run the 94-problem NETLIB LP library against matlab_sedumi and
matlab_sdpt3 (188 runs, 100% completion rate). matlab_sedumi: 83
OPTIMAL, 5 OPTIMAL (INACCURATE), 4 SUBPROCESS_ERROR, 1 each of
UNBOUNDED/TIMEOUT/NUM_ERROR/INFEASIBLE. matlab_sdpt3: 59 OPTIMAL, 17
MAX_ITER, 13 STALLED, 4 SUBPROCESS_ERROR, 1 each of
TIMEOUT/INFEASIBLE/ERROR. Regenerated HTML reports and JSON/CSV data
exports to include the new results.
Populate known_objective_value for 93 of the 94 NETLIB registry
entries from the official NETLIB LP problem summary table
(netlib.org/lp/data/readme, MINOS 5.3 on VAX). standgub is left
without a value per the source's own caveat (MINOS cannot report an
optimal value for its GUB markers).

Add docs/guides/NETLIB_KNOWN_OBJECTIVES.md documenting the source,
its caveats, the registry-key-to-NETLIB-name mapping, and a data
quality issue found while cross-checking: mps_loader.py's mishandling
of free-variable ordering causes wrong OPTIMAL objective values for
CVXPY/SciPy backends on the 11 NETLIB problems with FR/MI bounds
(not fixed here — tracked as a known issue).
Reflect the newly populated known_objective_value fields in the
accuracy comparisons shown in results_matrix.html/raw_data.html and
the JSON/CSV data exports.
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

📊 Preview Reports Ready!

Your preview has been deployed and is available at:

🔗 View Preview Reports

Preview Details

Available Reports

Notes

  • Preview uses the pre-built reports from your branch
  • Preview will be updated automatically when you push new commits
  • Preview will be cleaned up automatically when the PR is closed

Preview deployment powered by GitHub Actions

@napinoco napinoco merged commit 23f729f into main Jul 5, 2026
2 checks passed
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.

2 participants