Skip to content

Add comprehensive SDP test suite and evaluation harness#23

Open
mpf wants to merge 4 commits intomasterfrom
claude/sdp-solver-production-plan-J63s7
Open

Add comprehensive SDP test suite and evaluation harness#23
mpf wants to merge 4 commits intomasterfrom
claude/sdp-solver-production-plan-J63s7

Conversation

@mpf
Copy link
Copy Markdown
Member

@mpf mpf commented Feb 16, 2026

Summary

This PR adds a complete test suite for the SDP (semidefinite programming) solver implementation, including 40+ unit tests covering core SDP operations, standard problem instances, edge cases, and an evaluation harness for systematic validation.

Key Changes

  • New test file test/sdp_tests.jl (583 lines): Comprehensive test suite organized into sections:

    • Unit tests for vecm/mat round-trip and inner product preservation
    • VecCongurance block operations (multiplication, inversion, composition)
    • Nesterov-Todd scaling identity verification
    • SDP cone arithmetic (xsdc!, dsdc!) and their inverse relationship
    • Line search (maxstep_sdc) correctness
    • Block operations with mixed cone types
    • Multiple SDP blocks and mixed R+Q+S cone problems
    • Edge cases (1×1 scalar, 2×2 matrices, already-PSD, zero matrix, highly non-PSD targets)
    • Cross-solver consistency (QR, sparse, 2×2 KKT solvers)
  • New problem generator file test/sdp_problems.jl (420 lines): Reusable SDP problem instances:

    • sdp_psd_projection: Project matrices with mixed-sign eigenvalues onto PSD cone
    • sdp_trace_minimization: Minimize trace subject to PSD constraint
    • sdp_max_cut_relaxation: Goemans-Williamson relaxation for random graphs
    • sdp_lovasz_theta: Lovász theta number computation
    • sdp_nearest_correlation: Find nearest correlation matrix with unit diagonal
    • sdp_multiple_blocks: Multiple independent SDP blocks
    • sdp_mixed_cones: Heterogeneous R+, SOC, and SDP cones
    • sdp_with_equality: SDP with equality constraints
    • sdp_rank_one: SDP with rank-1 optimal solution
    • sdp_identity_feasible: Trivially feasible problem
    • sdp_larger: Scaling test with n=10
  • New evaluation harness test/sdp_harness.jl (272 lines):

    • SDPResult struct for collecting detailed diagnostics (status, iterations, solve time, feasibility, objective error, solution error)
    • sdp_solve(): Run single problem with validation against known solutions
    • run_sdp_harness(): Batch execution across multiple problems
    • run_sdp_harness_all_solvers(): Cross-solver validation
    • print_sdp_report(): Formatted summary table with pass/fail indicators
  • Integration into test suite: Added include("sdp_tests.jl") to test/runtests.jl

  • Development container: Added .devcontainer/devcontainer.json for Julia 1.10 development environment

  • Production plan document SDP_PRODUCTION_PLAN.md: Detailed roadmap for moving SDP from experimental to production status, covering:

    • Current state assessment
    • Five phases: correctness coverage, numerical robustness, performance, KKT solver integration, MOI wrapper completeness
    • Specific issues and recommended fixes (e.g., nestod_sdc Cholesky robustness, maxstep_sdc eigenvalue handling, VecCongurance KKT solver integration)

Notable Implementation Details

  • Tests validate both correctness (solution accuracy) and numerical properties (PSD verification via eigenvalues)
  • Problem generators include known optimal solutions where available for validation
  • Harness supports optional equality constraints (G, d) and handles both QP and LP formulations
  • Cross-solver testing ensures consistency across kktsolver_qr, kktsolver_sparse, and kktsolver_2x2
  • Helper functions _vdim() and _extract_sdp_matrix() abstract away vectorization details
  • All tests use configurable tolerances (optTol, tol) for robustness across

https://claude.ai/code/session_01PNGZft69CuPURr3qSAt8xe

claude and others added 4 commits February 15, 2026 20:45
Comprehensive analysis of what's needed to move SDP cone support
from experimental to production quality, covering correctness bugs,
test coverage, numerical robustness, performance, KKT solver
integration, MOI wrapper completeness, and documentation.

https://claude.ai/code/session_01PNGZft69CuPURr3qSAt8xe
Adapt test problem generators and test suite to use Vector instead
of n×1 Matrix, matching the refactor in 4f17f4a.
@mpf mpf force-pushed the claude/sdp-solver-production-plan-J63s7 branch from 953da34 to 58d7952 Compare February 16, 2026 05:05
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