Skip to content

Add libneo sparse_mod integration test consolidating NEO-2/MEPHIT/KAMEL solver - #60

Open
slopqueue[bot] wants to merge 3 commits into
mainfrom
slopqueue/019fe0933d99-cefd2e9e
Open

Add libneo sparse_mod integration test consolidating NEO-2/MEPHIT/KAMEL solver#60
slopqueue[bot] wants to merge 3 commits into
mainfrom
slopqueue/019fe0933d99-cefd2e9e

Conversation

@slopqueue

@slopqueue slopqueue Bot commented Aug 8, 2026

Copy link
Copy Markdown

Closes #13

Problem

NEO-2, MEPHIT and KAMEL each carried a byte-level fork of sparse_mod, the
UMFPACK/SuiteSparse front end used for their linear systems. Maintaining
three copies is error-prone; issue #13 asks for a single libneo "unique version"
that all codes link against.

Change

This PR adds tests/libneo/src/sparse/test_sparse_mod.f90, an integration test
for the consolidated libneo sparse_mod shipping as the LIBNEO::sparse
target. It exercises the API surface the three consumers rely on:

  • (a) the sparse_example(1) reference vector kept in
    KAMEL/QL-Balance/src/test/test_sparse.f90
  • (b) the decoupled-DOF case (structurally empty row/column), which must now
    return exact zeros instead of uninitialised heap
  • (c) the complex overload
  • (d) sparse_solve_method 2 vs 3 (umf4solr vs umf4sol) both converge
  • (e) the iopt 1/2/3 factorize-solve-free cycle used by
    KAMEL/QL-Balance/src/base/evolvestep.f90

The subdirectory is registered in tests/libneo/src/CMakeLists.txt only when
the installed libneo provides the optional sparse target, so hosts without a
SuiteSparse build are unaffected.

Tests

Regression coverage runs as the test_sparse_mod CTest (LABELS sparse)
under tests/libneo, invoking the consolidated libneo solver and failing
with error stop on any residual or reference mismatch.

Add tests/libneo/src/sparse/test_sparse_mod.f90, an integration test for
the libneo unique sparse_mod that consolidates the three byte-level forks
currently living in NEO-2, MEPHIT and KAMEL (#13).  It exercises
the sparse_example reference vector, the decoupled-DOF zero-init fix, the
complex overload, both refinement modes and the iopt 1/2/3 factorize-solve-free
cycle.  The subdirectory is registered in tests/libneo/src/CMakeLists.txt only
when the installed libneo provides the optional sparse target, so hosts without
a SuiteSparse build are unaffected.

@krystophny krystophny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review verdict: Request changes

Summary: The PR adds a useful sparse solver integration test, but its CMake guard prevents the test from ever being registered in the standalone tests/libneo project.

Findings:

  1. [major] tests/libneo/src/CMakeLists.txt:22 — This project never calls find_package(libneo) or adds libneo’s CMake targets, so TARGET sparse is false even when the installed libneo provides LIBNEO::sparse. A local configure registers only the existing field test, and CI does not run this test directory. Import/discover the libneo target correctly or use an appropriate availability check, and ensure CI executes the resulting CTest.

Verdict: Request changes — the added regression test is currently silently skipped.

The standalone tests/libneo project links against libneo's build-tree
libraries via link_directories and never imports a CMake package, so the
previous 'if(TARGET sparse)' guard was always false and silently skipped
the sparse_mod regression test. Guard on the actual availability of the
sparse library in the libneo build directory via find_library so the test
is registered and executed whenever libneo ships the optional
SuiteSparse-backed sparse library.

@krystophny krystophny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review verdict: Request changes

Summary: The PR adds useful sparse solver coverage, but the standalone CMake project does not import libneo’s LIBNEO::sparse target or its SuiteSparse dependencies.

Findings:

  1. [major] tests/libneo/src/sparse/CMakeLists.txt:4 — sparse is linked as a bare -lsparse, while this project defines no sparse target. For libneo’s static sparse archive, its transitive UMFPACK/SuiteSparse dependencies are therefore omitted and the test will fail to link when the archive is found. Import/link the exported LIBNEO::sparse target (including its module path), or explicitly provide the complete dependency closure.

Verdict: Request changes — the test is not buildable on hosts where the sparse library is available.

The standalone libneo CMake project links build-tree archives via
link_directories rather than the exported LIBNEO::sparse target, so the
bare sparse archive link omitted UMFPACK/SuiteSparse and failed to link
on hosts where the optional sparse library is built. Supply the complete
UMFPACK dependency closure (umfpack, amd, colamd, suitesparseconfig,
BLAS, LAPACK) explicitly.

@krystophny krystophny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review verdict: Request changes

Summary: The sparse integration test provides useful coverage, but it is not executed by the repository’s CI workflow.

Findings:

  1. [major] tests/libneo/src/CMakeLists.txt:24-26 — The test is registered only in the standalone tests/libneo CMake project, which .github/workflows/main.yml never configures or runs. CI run #349 succeeds without compiling or executing test_sparse_mod, so regressions in this new coverage can pass unnoticed. Add this project to CI and run its CTest suite.

Verdict: Request changes — the added regression test is currently unverified by CI.

@slopqueue
slopqueue Bot force-pushed the slopqueue/019fe0933d99-cefd2e9e branch from 812d3b0 to e11f0c4 Compare August 9, 2026 04:18
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.

Replace sparse_mod in NEO-2, MEPHIT and KAMEL by libneo unique version

1 participant