Cross-platform CI with per-platform dispatch tuning#75
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.hauto-selectsinclude/biginteger/build/platform/<os>-<arch>-<compiler>.hvia__has_include; absent profile ->DispatchThresholds.hdefaults. Wired intoConstants.hahead of defaults; a profile only#defines what it tuned (each#ifndef-guarded).dispatch_tuner --emit-headernow emits a#pragma onceprofile (was reusing theBIGMATH_DISPATCH_THRESHOLDSguard, which would disable the defaults fallback).tune.yml(workflow_dispatch): runs the tuner across the matrix and opens one PR with regenerated profiles.docs/PLATFORM_TUNING.md,platform/README.md.Drive-by fixes (pre-existing, broke clean-checkout CI)
CMakeLists.txtreferenced uncommittedtests/performance/regression_bench.cpp-> config failed everywhere. Nowif(EXISTS ...)-guarded..gitignore's broadbuildrule also hidinclude/biginteger/build/. Added negation.Local macOS/clang: configure + full build + ctest = 100%.
Generated with Claude Code