Skip to content

ci: get the test + benchmark workflows green (VMEC2000-from-source, fork-PR benchmark guard)#583

Closed
krystophny wants to merge 6 commits into
proximafusion:mainfrom
itpplasma:ci-bazel-build-fixes
Closed

ci: get the test + benchmark workflows green (VMEC2000-from-source, fork-PR benchmark guard)#583
krystophny wants to merge 6 commits into
proximafusion:mainfrom
itpplasma:ci-bazel-build-fixes

Conversation

@krystophny

@krystophny krystophny commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Scope: CI only, standalone. No source or build-system changes. Independent of
the differentiable-VMEC++ PR stack (#564-#582); please review and merge this one
first so those PRs inherit green CI from main.

What it fixes

1. VMEC2000 compatibility test (test_ensure_vmec2000_input_from_vmecpp_input).
The pinned vmec-0.0.6 cp310 wheel was f90wrapped against numpy 1.x. The test
env now resolves numpy 2.x, under which importing that wheel dies in the f90wrap
array interface:

ValueError: _vmec._vmec.f90wrap_vmec_input__array__rbc:
  failed to create array ... 0-th dimension must be fixed to 2 but got 4

So the test could never actually run. (It is red on main too: the wheel's
runtime libs - libnetcdff, scalapack, openblas - are not installed there, and
pytest 9's importorskip only skips ModuleNotFoundError, so a missing .so
is a hard failure rather than a skip.)

Fix: build VMEC2000 from upstream source with current f90wrap, which produces
numpy-2-compatible bindings. The recipe mirrors SIMSOPT's own CI
(hiddenSymmetries/VMEC2000, cmake/machines/ubuntu.json). No fork needed. An
explicit import vmec check in the install step surfaces any remaining problem
there rather than as a confusing test failure.

2. Benchmark workflow on fork PRs. The result-upload step needs a writable
GITHUB_TOKEN; on fork PRs the token is read-only, so it failed with
"Resource not accessible by integration". Gate that step to same-repo PRs; the
benchmark itself still runs.

Verification

Failing before (ubuntu-22.04, py3.10): import vmec chain broke on
libnetcdff -> libscalapack -> libopenblas, then on the f90wrap/numpy-2
rbc ValueError above.

Passing after: VMEC2000 builds from source, import vmec -> VMEC2000 import OK,
and the compatibility test runs. Benchmark workflow no longer errors on the
upload step for fork PRs.

@krystophny krystophny changed the title bazel: declare shared force-chain kernel headers in ideal_mhd_model ci: build + dependency fixes for the differentiable-VMEC++ series Jun 14, 2026
@krystophny krystophny force-pushed the ci-bazel-build-fixes branch from 31fbbde to 07e9fdb Compare June 14, 2026 15:55
@krystophny krystophny changed the title ci: build + dependency fixes for the differentiable-VMEC++ series ci: fix VMEC2000 import-test dependencies + fork-PR benchmark guard Jun 14, 2026
The 'Compare benchmark result' step uses github-action-benchmark with
comment-on-alert and the GITHUB_TOKEN, which is read-only for pull requests from
forks -> 'Resource not accessible by integration'. Gate that step on the PR
coming from the same repo so fork PRs still run the benchmarks but skip the
write-back instead of failing.
@krystophny krystophny force-pushed the ci-bazel-build-fixes branch from 07e9fdb to c9cb71f Compare June 14, 2026 16:12
@krystophny krystophny changed the title ci: fix VMEC2000 import-test dependencies + fork-PR benchmark guard ci: get the test + benchmark workflows green (VMEC2000-from-source, fork-PR benchmark guard) Jun 14, 2026
@krystophny

Copy link
Copy Markdown
Contributor Author

@jurasic-pf could you review this one first, independently of the differentiable-VMEC++ series?

It is CI-only and standalone (no source/build changes), and it gets the test + benchmark workflows green again on main:

  • VMEC2000 compat test: the pinned vmec-0.0.6 cp310 wheel is f90wrapped against numpy 1.x and no longer imports under numpy 2 (f90wrap_vmec_input__array__rbc: 0-th dimension must be fixed to 2 but got 4), so test_ensure_vmec2000_input_from_vmecpp_input could never run. This builds VMEC2000 from upstream source with current f90wrap (numpy-2 compatible), mirroring SIMSOPT's own CI recipe. No fork involved.
  • Benchmark workflow: skip the result-upload step on fork PRs, where GITHUB_TOKEN is read-only.

Merge order: this PR first. Once it lands on main, the stacked series #564-#582 will rebase onto main and inherit the green CI; I deliberately did not cherry-pick these CI changes into that stack to keep this reviewable on its own.

The pinned vmec-0.0.6 cp310 wheel was f90wrapped against numpy 1.x. Under
the numpy 2.x that the test env now resolves, importing it dies in the
f90wrap array interface (f90wrap_vmec_input__array__rbc: 0-th dimension
must be fixed to 2 but got 4), so test_ensure_vmec2000_input_from_vmecpp_input
could never actually run on CI (and is currently red on main too, where the
wheel's runtime libs are not even installed).

Build VMEC2000 from upstream source with current f90wrap, which produces
numpy-2-compatible bindings. The recipe mirrors SIMSOPT's own CI
(hiddenSymmetries/VMEC2000, cmake/machines/ubuntu.json). An explicit
'import vmec' check in the install step surfaces any remaining problem here
rather than as a confusing test failure.
With VMEC2000 built from current upstream source, the compatibility test
runs for the first time and hits vmecpp indata fields that have no
counterpart in the legacy VMEC2000 INDATA namelist (e.g.
free_boundary_method), which raised AttributeError. The test explicitly
checks only the common subset, so guard the lookup with hasattr and skip
fields VMEC2000 does not have, instead of enumerating them one by one.
Build the VMEC2000 wheel from the exact commit the vmec-0.0.6 wheel was built
from (hiddenSymmetries/VMEC2000 @ 728af8bd6c79, the 'works with numpy 2.0'
merge), and cache it keyed on that SHA. Same pinned, known-good source as the
old wheel, but f90wrapped against the current numpy so it imports under numpy 2;
only the first CI run pays the build cost, the rest restore the cached wheel.
Addresses the request to keep a pinned, fast VMEC2000 install.
Comment thread .github/workflows/tests.yaml Outdated
Comment thread .github/workflows/tests.yaml Outdated
# cache it, so only the first run pays the build cost. Pinned and
# known-good like the old wheel, just numpy-2-correct.
sudo apt-get install -y libopenmpi-dev libnetcdff-dev libscalapack-mpi-dev \
libhdf5-dev libhdf5-serial-dev libfftw3-dev libopenblas-dev ninja-build

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unclear what FFTW is needed for, I'd prefer to avoid GPL licensed code where possible

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

elminated. was just part of the "all you need for vmec2000 build" but actually not needed.

@jurasic-pf jurasic-pf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! This really went unnoticed for way too long!

krystophny and others added 2 commits June 15, 2026 06:46
Co-authored-by: Philipp Jurašić <166746189+jurasic-pf@users.noreply.github.com>
VMEC2000 at the pinned commit 728af8b references no FFTW anywhere; its
build needs only MPI, SCALAPACK, NETCDF (Fortran+C) and BLAS/LAPACK.
VMEC++ uses vendored FFTX codelets, not system fftw3. HDF5 arrives
transitively via libnetcdff-dev, so the explicit libhdf5 packages are
redundant too.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash, not the tag.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash for Clang >= 21.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash for Clang >= 21.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash for Clang >= 21.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash for Clang >= 21.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash for Clang >= 21.
krystophny added a commit to itpplasma/vmecpp that referenced this pull request Jun 15, 2026
…mit pin

Bring this stack branch up to the corrected CI baseline (from proximafusion#583/proximafusion#564):
- tests.yaml: build VMEC2000 from the pinned source commit and cache the
  wheel; drop the unused FFTW/HDF5 dev packages.
- benchmarks.yaml: skip the result upload on fork PRs (read-only token).
- test_simsopt_compat.py: skip vmecpp-only INDATA fields.
- CMakeLists: pin abseil to the 20260107.1 commit hash for Clang >= 21.
@krystophny

Copy link
Copy Markdown
Contributor Author

Closing in favor of #564, which now carries all of these CI fixes plus
the Clang >= 21 abseil pin:

  • build VMEC2000 from the pinned source commit 728af8b and cache the
    wheel (canonical version, with the FFTW/HDF5 trim from this PR),
  • skip the benchmark result upload on fork PRs,
  • skip vmecpp-only INDATA fields in the compat test.

The review threads here are addressed in #564. Consolidating into one PR
so the Clang/Enzyme stack has a single build+CI prerequisite to land
first.

@krystophny krystophny closed this Jun 15, 2026
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