Skip to content

ci: probe the build across Ubuntu releases, clang and macOS - #46

Open
ondrik wants to merge 7 commits into
feat/f128-without-quadmathfrom
ci/platform-matrix
Open

ondrik wants to merge 7 commits into
feat/f128-without-quadmathfrom
ci/platform-matrix

Conversation

@ondrik

@ondrik ondrik commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #48 and #47, which hold the build fixes this probe found (the whole stack was rebased onto current devel on 28 Oct). This adds a CI workflow that checks whether MEDUSA builds and passes beyond the single image tests.yml runs on.

What it runs

.github/workflows/platforms.yml:

job compiler why
Ubuntu 22.04 GCC 11, CMake 3.22, GMP 6.2.1 oldest supported: MoToBuddy needs GCC 11+
Ubuntu 24.04 GCC 13, CMake 3.28, GMP 6.3.0 what tests.yml runs on: the reference
Ubuntu 26.04 GCC 15, CMake 4.2, GMP 6.3.0 newest LTS
Ubuntu 24.04 clang a second compiler
macOS 15, Apple Silicon Apple clang, Homebrew GMP ARM and the usual laptop setup

The Ubuntu jobs run in ubuntu:<release> containers on an x86_64 runner.

What each job checks

.github/scripts/platform-probe.sh goes through every leaf type (f32, f64, f80, f128, gmp). For each one it builds MEDUSA, then runs:

  • the unit suite;
  • the Grover matrix (amplitude-level checks, classic and --symbolic);
  • the circuit smoke test.

The job summary gets a pass/FAIL table, headed by the actual compiler, CMake and GMP versions. Logs are uploaded as artifacts. A failure listed in EXPECT_FAIL doesn't fail the job, and an expected failure that starts passing raises a warning.

When it runs

Weekly, on demand (workflow_dispatch), and on PRs that touch the Makefile, src/, tests/ or the probe itself.

Results (on top of #47)

All jobs pass. On top of #48, f128 no longer needs libquadmath, so it builds and passes under clang on Linux too. The only expected failure is f128 on macOS (EXPECT_FAIL), which has no 128-bit type at all; #49 explores SoftFloat for it.

The f80 row is labelled with what long double really is. It's x87 80-bit extended only on x86. On Apple Silicon it's a plain double, so the row duplicates f64, and on ARM Linux it's binary128. Where it isn't 80-bit, the table names the real type and a note says that 80-bit precision wasn't tested, instead of a bare "pass". This came from the automated review.

Without #47, the probe found these failures:

  • GMP failed to build on GCC 14+ and clang (include order; fixed on devel by 3755811);
  • nothing built on macOS (-ffat-lto-objects);
  • GMP failed to link on macOS (libquadmath).

Still open

  • flex and bison: MoToBuddy needed them to build its bddcalc example. Upstream has fixed this (VeriFIT/MoToBuddy@acc4c26 replaces the flex/bison parser with a hand-written one). MEDUSA picked that up with the pin bump in build: bump MoToBuddy to acc4c26 (no flex/bison needed) #50 (now 3f9b6b4 on devel), so the containers here no longer install flex or bison.
  • Ubuntu 20.04 was dropped: its GCC 9 can't compile MoToBuddy's declarations directly after case labels. That's still the case at acc4c26.

🤖 Generated with Claude Code

https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM

@ondrik
ondrik changed the base branch from devel to fix/portability-gmp-lto October 14, 2026 08:33
@ondrik
ondrik force-pushed the ci/platform-matrix branch from f9ce65a to 64f0bff Compare October 14, 2026 08:33
ondrik added a commit that referenced this pull request Oct 14, 2026
Apple clang accepts the flag alone and rejects it only alongside -flto,
so the check passed there and the build still failed (seen in #46).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
@ondrik
ondrik force-pushed the ci/platform-matrix branch from 64f0bff to 45896d6 Compare October 14, 2026 08:36
ondrik added a commit that referenced this pull request Oct 14, 2026
-lquadmath was added to every link whenever the default LEAF_FLOAT_TYPE
is f128, GMP builds included. macOS has no libquadmath, so buddy_gmp
failed to link there (seen in #46). GMP links now use CLIBS_GMP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
@ondrik
ondrik force-pushed the ci/platform-matrix branch from 45896d6 to d14e5fd Compare October 14, 2026 08:40
@ondrik
ondrik force-pushed the ci/platform-matrix branch from ee81929 to b1cde21 Compare October 14, 2026 13:53
@ondrik
ondrik changed the base branch from fix/portability-gmp-lto to feat/f128-without-quadmath October 14, 2026 13:53
ondrik added a commit that referenced this pull request Oct 14, 2026
glibc declares roundf128, sqrtf128, powf128 and strfromf128 only for
compilers it trusts with _Float128, which excludes clang, so f128 failed
under clang (seen in #46). libm and libc export them regardless, and
_Float128 and __float128 share one ABI on these targets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
@ondrik
ondrik force-pushed the ci/platform-matrix branch from b1cde21 to cfdcd16 Compare October 14, 2026 14:51
ondrik added a commit that referenced this pull request Oct 14, 2026
Found by the platform probe (#46):
- GMP builds fail on GCC 14+ and clang ('implicit declaration of
  mpz_out_str'): headers are force-included, so gmp.h was read before
  stdio.h, and gmp.h declares its FILE functions only after stdio.h.
  Every header that includes gmp.h now includes stdio.h first. GCC 13
  only warns, which is why tests.yml never noticed.
- Apple clang rejects -ffat-lto-objects, so no release build worked on
  macOS. The flag is now added only where the compiler accepts it.
- f128 without GCC's libquadmath (clang, arm64 macOS) failed on a bare
  'quadmath.h not found'; it now stops with a message naming the leaf
  type and how to build another.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
ondrik added a commit that referenced this pull request Oct 14, 2026
Apple clang accepts the flag alone and rejects it only alongside -flto,
so the check passed there and the build still failed (seen in #46).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
ondrik added a commit that referenced this pull request Oct 14, 2026
-lquadmath was added to every link whenever the default LEAF_FLOAT_TYPE
is f128, GMP builds included. macOS has no libquadmath, so buddy_gmp
failed to link there (seen in #46). GMP links now use CLIBS_GMP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
ondrik added a commit that referenced this pull request Oct 14, 2026
glibc declares roundf128, sqrtf128, powf128 and strfromf128 only for
compilers it trusts with _Float128, which excludes clang, so f128 failed
under clang (seen in #46). libm and libc export them regardless, and
_Float128 and __float128 share one ABI on these targets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
@ondrik
ondrik force-pushed the feat/f128-without-quadmath branch from c0659ce to 8a24537 Compare October 14, 2026 22:17
@ondrik
ondrik force-pushed the ci/platform-matrix branch from cfdcd16 to 5b60d09 Compare October 14, 2026 22:17
@ondrik
ondrik marked this pull request as ready for review October 18, 2026 21:26
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Claude Code review (CERIT, model coder) of 35adbc7

I read pr.md and pr.diff first (both changed files — .github/scripts/platform-probe.sh and .github/workflows/platforms.yml — are shown in full; no files are omitted from the diff), then cross-checked the probe's make invocations against the Makefile (targets buddy_doubles, test-grover-f32/f64/f80/f128, buddy_gmp, test-unit-gmp, test-grover-gmp, test_unit_api, output names MEDUSA_buddy_doubles_<sfx>/MEDUSA_buddy_gmp), the test scripts it drives (tests/test_circuits.sh, tests/test_summary.sh) and the leaf headers, since the PR is CI-only and all of its behaviour lives in those two new files.

  • .github/workflows/platforms.yml:51-56 (with claude-review-input/pr.md:30) - the Ubuntu clang job sets no EXPECT_FAIL, but the PR description says f128 fails under clang on Linux too and "that step is listed in EXPECT_FAIL". EXPECT_FAIL is only set in the macos job (line 97), for build-f128. The concrete failure: if build-f128 does fail under clang on Linux as the description claims was observed (the description attributes it to missing libquadmath), then on the Ubuntu 24.04, clang matrix leg the probe records build-f128 as an unexpected failure, unexpected=1, exit 1, and the job goes red — the description's "All jobs pass" and the workflow cannot both be true. Note the checkout's src/interface_implementations/leaf_primitives/leaf_primitive_double.h:90-96 instead says f128 uses glibc's *f128 functions and "Neither needs GCC's libquadmath, so clang works too", in which case the Linux clang leg builds fine and only the description is stale — I cannot build with clang here to tell which of the two is wrong, but one of them is: either add EXPECT_FAIL: build-f128 to the clang leg, or update the PR description's Results section.

I found no other issues: the probe's step naming (build-/unit-/grover-/circuits-<leaf>), the rm -f test_unit_api guard against the shared unit-binary name, the expected-fail matching (*" ${name} "* against " ${EXPECT_FAIL:-} "), the pass*-return convention used by the if step build-... guards, the summary table cell lookup, and the workflow's compiler selection (CC/CXX exported before make init, propagated to the probe's make via MAKE_ARGS and to the recursive $(MAKE) calls via MAKEFLAGS) all check out against the Makefile and test scripts.
Automated and advisory: it may be wrong, and it does not block merging. Run.

ondrik and others added 7 commits October 28, 2026 00:15
A new platforms workflow runs the build on Ubuntu 20.04, 22.04, 24.04 and
26.04 (each with its default GCC, CMake and GMP), on 24.04 with clang,
and on Apple Silicon macOS. Per leaf type it builds MEDUSA and runs the
unit suite, the Grover matrix and the circuit smoke test, and reports a
table in the job summary. Weekly, on demand, and on changes to itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
The first run stopped at the first obstacle everywhere:
- Ubuntu containers: MoToBuddy's CMake needs flex (FLEX_TARGET in its
  bddcalc example); the runner image has it, a plain system does not.
- macOS: Apple clang rejects -ffat-lto-objects.
Both are now worked around so the probe reaches what comes after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
…ailures under clang

On top of the portability fixes (#47): macOS builds with the default
flags again, and f128 is listed as an expected failure where there is
no libquadmath. Ubuntu 20.04 is dropped: its GCC 9 cannot compile
MoToBuddy, so 22.04 is the oldest supported release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
MoToBuddy acc4c26 configures without them, and installing them here
would hide a regression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
f80 builds long double, which is x87 80-bit extended only on x86: on
arm64 macOS it is a plain double (so the row duplicated f64) and on
aarch64 Linux it is binary128. The probe reads __LDBL_MANT_DIG__ and
labels the row accordingly, with a note when it does not test 80-bit
precision, instead of a bare 'pass'. From the automated review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
ondrik added a commit that referenced this pull request Oct 27, 2026
Found by the platform probe (#46):
- Apple clang rejects -ffat-lto-objects, so no release build worked on
  macOS. The flag is now added only where the compiler accepts it.
- f128 without GCC's libquadmath (clang, arm64 macOS) failed on a bare
  'quadmath.h not found'; it now stops with a message naming the leaf
  type and how to build another.

(The GMP include-order fix that was part of this commit landed on devel
separately as 3755811.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
ondrik added a commit that referenced this pull request Oct 27, 2026
Apple clang accepts the flag alone and rejects it only alongside -flto,
so the check passed there and the build still failed (seen in #46).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
ondrik added a commit that referenced this pull request Oct 27, 2026
-lquadmath was added to every link whenever the default LEAF_FLOAT_TYPE
is f128, GMP builds included. macOS has no libquadmath, so buddy_gmp
failed to link there (seen in #46). GMP links now use CLIBS_GMP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
ondrik added a commit that referenced this pull request Oct 27, 2026
glibc declares roundf128, sqrtf128, powf128 and strfromf128 only for
compilers it trusts with _Float128, which excludes clang, so f128 failed
under clang (seen in #46). libm and libc export them regardless, and
_Float128 and __float128 share one ABI on these targets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q87VyzNBV8gtH2ntMeKoM
@ondrik
ondrik force-pushed the feat/f128-without-quadmath branch from 8a24537 to 0aa09e3 Compare October 27, 2026 23:16
@ondrik
ondrik force-pushed the ci/platform-matrix branch from 5b60d09 to 35adbc7 Compare October 27, 2026 23:16

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant