Skip to content

Cross-platform CI with per-platform dispatch tuning#75

Merged
mmurshed merged 1 commit into
mainfrom
ci/platform-tuned-pipeline
May 31, 2026
Merged

Cross-platform CI with per-platform dispatch tuning#75
mmurshed merged 1 commit into
mainfrom
ci/platform-tuned-pipeline

Conversation

@mmurshed

Copy link
Copy Markdown
Owner

Build & test on Linux (gcc/clang), macOS (clang), Windows (MSYS2 + clang) plus a per-platform threshold-tuning loop that ports tuned values back into the repo. Windows uses MSYS2 + Clang (lib needs __int128/__builtin_*_overflow; MSVC can't compile it).

Per-platform tuning

  • PlatformConfig.h auto-selects include/biginteger/build/platform/<os>-<arch>-<compiler>.h via __has_include; absent profile -> DispatchThresholds.h defaults. Wired into Constants.h ahead of defaults; a profile only #defines what it tuned (each #ifndef-guarded).
  • dispatch_tuner --emit-header now emits a #pragma once profile (was reusing the BIGMATH_DISPATCH_THRESHOLDS guard, which would disable the defaults fallback).
  • New tune.yml (workflow_dispatch): runs the tuner across the matrix and opens one PR with regenerated profiles.
  • Docs: docs/PLATFORM_TUNING.md, platform/README.md.

CI runners are shared VMs with varying host CPUs + -march=native; CI-tuned values are a baseline, not canonical. Tune on real hardware for shipped values.

Drive-by fixes (pre-existing, broke clean-checkout CI)

  • CMakeLists.txt referenced uncommitted tests/performance/regression_bench.cpp -> config failed everywhere. Now if(EXISTS ...)-guarded.
  • .gitignore's broad build rule also hid include/biginteger/build/. Added negation.

Local macOS/clang: configure + full build + ctest = 100%.

Generated with Claude Code

Build & test on Linux (gcc/clang), macOS (clang) and Windows (MSYS2 +
clang). The library needs __int128/__builtin_*_overflow, so Windows uses
MSYS2 Clang, not MSVC. Each Release job carries a platform-specific
optimization baseline (x86-64-v3 / apple-m1) and picks up its committed
tuning profile automatically.

Per-platform tuning:
- New PlatformConfig.h auto-selects
  include/biginteger/build/platform/<os>-<arch>-<compiler>.h via
  __has_include, keyed on host OS/arch/compiler. Absent profile -> the
  generic DispatchThresholds.h defaults apply. Wired into Constants.h
  ahead of the defaults; a profile only #defines the macros it tuned
  (each #ifndef-guarded), so it overrides individual defaults without
  disabling the fallback.
- dispatch_tuner --emit-header now writes a #pragma-once profile (it used
  to reuse the BIGMATH_DISPATCH_THRESHOLDS include guard, which would have
  disabled the defaults fallback for any macro it didn't emit).
- New tune.yml (workflow_dispatch) runs the tuner across the matrix and
  opens one PR with the regenerated profiles. Documented caveat: shared
  CI runners with varying host CPUs + -march=native make CI values a
  baseline, not canonical.
- docs/PLATFORM_TUNING.md + platform/README.md.

Drive-by fixes to pre-existing blockers that broke a clean-checkout build:
- CMakeLists referenced tests/performance/regression_bench.cpp, an
  uncommitted scratch bench -> "No SOURCES given to target"; config
  failed on every clean checkout. Now guarded with if(EXISTS ...).
- .gitignore's broad 'build' rule also matched include/biginteger/build/,
  hiding PlatformConfig.h and future tuning profiles from git (and from
  the tune workflow's auto-PR). Added negation to track that dir.

Verified locally (macOS/clang): configure + full build + ctest = 100%.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mmurshed mmurshed merged commit edf9cf2 into main May 31, 2026
4 of 5 checks passed
@mmurshed mmurshed deleted the ci/platform-tuned-pipeline branch May 31, 2026 01:17
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