Skip to content

Fix macOS + Determinism check CI on master - #42

Merged
offdev merged 1 commit into
masterfrom
fix/ci-macos-detcheck-master
Sep 17, 2026
Merged

offdev merged 1 commit into
masterfrom
fix/ci-macos-detcheck-master

Conversation

@offdev

@offdev offdev commented Sep 17, 2026

Copy link
Copy Markdown
Owner

What was red on master

Run 35240883610 (CI merge, 2026-09-17) had three failed jobs, two distinct root causes:

Job Failure
macOS Intel + macOS arm64 (AppleClang) samples/hello/hello-baseline.cpp:179: error: no matching function for call to 'min'
Determinism check (ubuntu-24.04) src/laige-core/logging.cpp:500: error: ignoring return value of 'ssize_t write(...)' [-Werror=unused-result] — only in the job's Release g++ tree (build-det-release)

Root causes

macOS — std::min type deduction. std::min(emitted, baseline_.size()) mixes std::uint64_t with std::size_t. On macOS uint64_t is unsigned long long while size_t is unsigned long, so template deduction is a hard AppleClang error. On Linux/Windows the two types alias, which is why every other P0 job compiled the same source (and why this only surfaced on the first merge that runs the M1-DET-04 baseline machinery on macOS). Fix: cast the size_t operand to uint64_t so both arguments are one type on every platform.

Determinism check — warn_unused_result under fortification. glibc declares write() with warn_unused_result, and the attribute is attached only under fortification — i.e. optimized builds (that's the exact Debug-passes/Release-fails split: -g leaves __wur empty, -O3 enables it). A (void) cast does not suppress warn_unused_result, and the engine's -Werror makes it fatal. Clang/AppleClang/MSVC don't have this GCC diagnostic, so only the Release g++ tree failed. Fix: consume the result — the crash notice is best-effort, and there is no async-signal-safe fallback if the write fails (LOG-007).

Verification (local: g++ 16.2.1 / clang++ 22.1.8, x86-64 Linux)

Out of scope / follow-up

  • docs/benchmarks/determinism-matrix.md marks macOS/Windows float_pinned_32 as pending first merge run; those rows update from the first green merge (matrix policy: entries change only by matrix results).
  • If a pending platform's hello_baseline_fp32 desyncs, the documented policy is to mark it unsupported + skip — fixed_point_16_16 failures are never skipped.

…tion; crash-handler write() under Release -Werror

macOS (Intel + arm64) jobs:

samples/hello/hello-baseline.cpp:179 — std::min(emitted, baseline_.size()) mixes std::uint64_t with std::size_t. On macOS uint64_t is unsigned long long and size_t is unsigned long, so the template deduction is a hard AppleClang error. On Linux/Windows the two types alias, which is why every other P0 job compiled the same source. Fix: cast the size_t operand to uint64_t so both arguments are one type on every platform.

Determinism check job:

src/laige-core/logging.cpp:500 — (void)write(...) does not suppress glibc's warn_unused_result (the attribute is attached under fortification, i.e. optimized builds), and the engine's -Werror makes it fatal. That is why only the job's Release g++ tree (build-det-release) failed while Debug g++ and every clang tree compiled the same TU. Fix: consume the result — the crash notice is best-effort and there is no async-signal-safe fallback if the write fails (LOG-007).

Verification (local: g++ 16.2.1 / clang++ 22.1.8, x86-64 Linux):
- logging.cpp compiles clean under -Wall -Werror in Debug, Release, and Release+_FORTIFY_SOURCE=2 (the CI trigger); hello sample TUs clean under all four compiler/flag sets.
- Full ctest: 82/82 (incl. hello_baseline_fpx/fp32 + the mismatch/truncated/malformed/missing fixtures, replay and detcheck suites).
- The CI detcheck flow reproduced end to end: four targeted builds (g++ Debug, clang++ Debug, clang++ Debug+ASan, g++ Release), reference-baseline sanity on both backends, synthetic self-check, and pairs A (g++ Debug vs clang++ Debug) and B (ASan Debug vs Release) on both backends — all result=OK ticks=301.
- The macOS deduction error cannot be reproduced off-AppleClang (uint64_t == size_t on Linux/Windows); the P0 macOS jobs are the regression guard for it, as for the prior macOS CI fixes (#33, #35, #37, #39).
@offdev offdev added ci:macos and removed ci:macos labels Sep 17, 2026
@offdev
offdev merged commit a22c45d into master Sep 17, 2026
33 checks passed
offdev added a commit that referenced this pull request Sep 17, 2026
…0 platforms supported (#43)

Follow-up noted in PR #42: the report's macOS/Windows support-list rows were 'pending first merge run' and, per the report's own policy, convert from first merge-run results. The first green full-matrix merge run (master push of a22c45d, CI run 35246893883, 11/11 jobs green) is now recorded: macos-arm64, macos-intel and windows-msvc are supported (each P0 job reproduced both committed baselines per tick, 82/82 ctest); the merge detcheck job passed reference-baseline sanity (2/2 backends), the synthetic self-check, and all four cross-build pairs (result=OK ticks=301). The stale 'Open until the first merge' section is replaced by a 'First merge run (2026-09-17)' section that also records the red first merge (run 35240883610 at c8ce649, fixed by #42). Docs only; no baselines regenerated (no desync occurred).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant