Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
258 commits
Select commit Hold shift + click to select a range
9782646
Add SYCL support documentation and example
mborland Jul 9, 2026
0b8a5de
Merge pull request #419 from cppalliance/SYCL
mborland Jul 9, 2026
f97d158
Move macro literals into their own header
mborland Jul 15, 2026
94eafeb
Update module file
mborland Jul 15, 2026
4c69a59
Update module jamfile
mborland Jul 15, 2026
4173283
Tests that need internals
mborland Jul 15, 2026
ab94a4e
Add module path for testing
mborland Jul 15, 2026
eec4aa8
Add module testing CML
mborland Jul 15, 2026
d53a778
Add export macro for testing
mborland Jul 15, 2026
a6b237c
Update macros for module support
mborland Jul 15, 2026
ca48d61
Add module testing to CI
mborland Jul 15, 2026
49748a9
Merge pull request #421 from cppalliance/module
mborland Jul 15, 2026
907e6a1
Full reference list was moved into the docs
mborland Jul 15, 2026
0219557
Rename and use extern C++
mborland Jul 16, 2026
dbdf714
Update references to module
mborland Jul 16, 2026
451f3bc
And GCC and MSVC runners
mborland Jul 16, 2026
01f1422
Merge pull request #422 from cppalliance/module
mborland Jul 16, 2026
30e03f7
Update version
mborland Jul 21, 2026
f772437
Add xref to boost random
mborland Jul 21, 2026
f6fc6df
Add printer refs to nav
mborland Jul 21, 2026
3a09b42
Better explanation in nav
mborland Jul 21, 2026
ad28229
More nav enhancements
mborland Jul 21, 2026
f455566
Remove namespace the user won't use
mborland Jul 21, 2026
e348b1f
Minor wording change
mborland Jul 21, 2026
c75231e
Remove stale verbiage
mborland Jul 21, 2026
98b3848
Add <limits> support sections
mborland Jul 21, 2026
3ccd215
Fix consistency of const parameters in the docs
mborland Jul 22, 2026
e071315
Add reproducer test set
mborland Jul 22, 2026
1443cc1
Cast to unsigned to avoid UB
mborland Jul 22, 2026
7e544c1
Add constexpr boundary test
mborland Jul 22, 2026
858541b
Move note about wraparound higher
mborland Jul 22, 2026
e31d810
Merge pull request #426 from cppalliance/const
mborland Jul 22, 2026
92475bd
Add amalgamation python file
mborland Jul 22, 2026
63b65e0
Add amalgamation workflow
mborland Jul 22, 2026
e4876f2
Add reproducer test set
mborland Jul 22, 2026
1c18786
Add if constexpr path that allows stripping of digit separators
mborland Jul 22, 2026
ccb64bc
Update driver functions
mborland Jul 22, 2026
b43f924
Cover the string path too
mborland Jul 22, 2026
a83c93f
Ignore MSVC 14.1 warning
mborland Jul 22, 2026
7126131
Ignore MSVC warning
mborland Jul 22, 2026
ab36710
Merge pull request #431 from cppalliance/single_header
mborland Jul 22, 2026
700aa6d
Fix constant folding on old compilers
mborland Jul 22, 2026
aff381a
Ignore additional MSVC 14.1 warning
mborland Jul 22, 2026
a5d3abe
Merge pull request #425 from cppalliance/424
mborland Jul 22, 2026
c2cdc43
Regenerate amalgamated single header from a5d3abee247095622e0c9c23149…
github-actions[bot] Jul 22, 2026
4926998
Merge pull request #429 from cppalliance/ubsan
mborland Jul 22, 2026
9ac2f92
Regenerate amalgamated single header from 492699804a24447b857e7623919…
github-actions[bot] Jul 22, 2026
778566a
Add language standard note
mborland Jul 23, 2026
e91343d
Add hash_value overloads
mborland Jul 23, 2026
e94157a
Add container hash test
mborland Jul 23, 2026
9bfc6ad
Add container hash example
mborland Jul 23, 2026
d4e4391
Fix warnings
mborland Jul 23, 2026
5cf24b7
Update docs
mborland Jul 23, 2026
efa35fb
Ignore double promotion warnings from container hash
mborland Jul 23, 2026
f3aecea
Merge pull request #446 from cppalliance/436
mborland Jul 23, 2026
f905e22
Regenerate amalgamated single header from f3aecea4b0422ef98b31dfefb7c…
github-actions[bot] Jul 23, 2026
9374711
Add new parse literal function with compile error for out of range
mborland Jul 23, 2026
4de182d
Update literals to use new function
mborland Jul 23, 2026
59e51ad
Add new compile failure test
mborland Jul 23, 2026
5cd9958
Add testing of literal prefixes
mborland Jul 23, 2026
4a36d36
Add handling of literal prefix
mborland Jul 23, 2026
b529d17
Add new compile failure test for prefix
mborland Jul 23, 2026
6c6dcad
Document the literal prefixes and error handling
mborland Jul 23, 2026
d2a0bba
Improve rejection
mborland Jul 23, 2026
93721b9
Add test of invalid literal compilation failure
mborland Jul 23, 2026
b432e6c
Update example to not fail
mborland Jul 23, 2026
9ca1780
Use macro workaround for GCC 5 support
mborland Jul 23, 2026
f7b7123
Remove test from MSVC 14.1 that yields ICE
mborland Jul 23, 2026
c9537dd
Add comment about the absl libraries in the benchmarks
mborland Jul 23, 2026
c230259
Add documentation of abs specifically of abs(min)
mborland Jul 23, 2026
420dec9
Add in handling of UB cases to gcd and lcm docs
mborland Jul 23, 2026
03c1e3d
Remove more MSVC 14.1 ICE
mborland Jul 23, 2026
ccbb715
Update div and mod by zero to trap instead of returning 0
mborland Jul 23, 2026
95ed417
Update tests to reflect new behavior
mborland Jul 23, 2026
0f9e6a8
Update div by 0 docs
mborland Jul 23, 2026
b104725
Update cstdlib and div_sat docs
mborland Jul 23, 2026
33f98c0
Add to_wstring function
mborland Jul 23, 2026
8af7d52
Add to_wstring testing
mborland Jul 23, 2026
6363b40
Add to_wstring to docs
mborland Jul 23, 2026
3710143
Add to api_ref
mborland Jul 23, 2026
e85e8fb
Fix for 452.
MarekKnapek Jul 23, 2026
cabe32e
Fix for incorrect signed natvis.
MarekKnapek Jul 23, 2026
d78acb6
Merge pull request #454 from MarekKnapek/issues-452
mborland Jul 23, 2026
e92ec01
Merge pull request #456 from MarekKnapek/issues-455
mborland Jul 23, 2026
3b2e143
Merge pull request #445 from cppalliance/437
mborland Jul 23, 2026
598fe70
Regenerate amalgamated single header from 3b2e14382cf4ef0c29bbddec923…
github-actions[bot] Jul 23, 2026
cc94f56
Merge pull request #451 from cppalliance/449
mborland Jul 23, 2026
d256bf4
Regenerate amalgamated single header from cc94f562371eaa2d926409a1463…
github-actions[bot] Jul 23, 2026
c209877
Merge pull request #453 from cppalliance/444
mborland Jul 23, 2026
3682d04
Regenerate amalgamated single header from c209877a7cb3eb3f43d7c491323…
github-actions[bot] Jul 23, 2026
34d36a7
Rename functions from op_sat to saturating_op
mborland Jul 24, 2026
3382905
Merge pull request #457 from cppalliance/441
mborland Jul 24, 2026
d47108c
Regenerate amalgamated single header from 3382905c17e2d7ad55959b289e8…
github-actions[bot] Jul 24, 2026
0c4e00a
Replace integer constant with double constant
mborland Jul 24, 2026
e3a28c9
Add shared float conversion file
mborland Jul 24, 2026
f53535c
Use builtins when available or fallback to shared impl
mborland Jul 24, 2026
c50fa96
Add better test set
mborland Jul 24, 2026
216bdb7
Skip test on 32 bit ASAN
mborland Jul 24, 2026
dadea4f
Merge pull request #458 from cppalliance/432
mborland Jul 24, 2026
23e92a2
Add missing nav item
mborland Jul 24, 2026
a7e8618
Implement C++26 integer comparison functions
mborland Jul 24, 2026
fb1a466
Add test set
mborland Jul 24, 2026
7e779d8
Add compile fail test set
mborland Jul 24, 2026
7f7e64d
Add integer comparison functions to the docs
mborland Jul 24, 2026
42107fe
Out of range behavior should match builtins
mborland Jul 24, 2026
ad9f3fa
Update tests
mborland Jul 24, 2026
d762961
Update shifting docs with new behavior
mborland Jul 24, 2026
09024ce
Remove edge cases that are no longer true
mborland Jul 24, 2026
d0dd219
Fix functionality with MSVC _Signed128 and _Unsigned128
mborland Jul 24, 2026
da5239c
Improve performance of widening muls
mborland Jul 24, 2026
236cd29
Allow constexpr format with C++26
mborland Jul 24, 2026
81ede94
Add doc note
mborland Jul 24, 2026
53ad84c
Add test set for constexpr std::format
mborland Jul 24, 2026
acd7809
Merge pull request #459 from cppalliance/450
mborland Jul 24, 2026
91afe78
Regenerate amalgamated single header from acd7809437fd7ff36570377ec64…
github-actions[bot] Jul 24, 2026
f144445
Add comments about the availability of the single header lib
mborland Jul 24, 2026
9e875b0
Merge pull request #460 from cppalliance/int_cmp
mborland Jul 24, 2026
2e47f3f
Regenerate amalgamated single header from 9e875b0862b9bc8265d35a85261…
github-actions[bot] Jul 24, 2026
7a8667c
Merge pull request #461 from cppalliance/433
mborland Jul 24, 2026
784ca69
Regenerate amalgamated single header from 7a8667c769054d8d5892955d982…
github-actions[bot] Jul 24, 2026
b2de777
Merge pull request #462 from cppalliance/428
mborland Jul 24, 2026
641b4ae
Regenerate amalgamated single header from b2de7772af5c388642bc5be1485…
github-actions[bot] Jul 24, 2026
817504f
Debugger pretty printer for MSVC.
MarekKnapek Jul 26, 2026
874e551
Debugger pretty printer for MSVC.
MarekKnapek Jul 26, 2026
0a7509b
Merge pull request #464 from MarekKnapek/debugger-formatter
mborland Jul 27, 2026
26d7f71
Make the high word unsigned instead of signed for vectorization
mborland Jul 28, 2026
39d982a
Update basic ops for new high word type
mborland Jul 28, 2026
818424f
Remove useless cast
mborland Jul 28, 2026
2e59860
Use signed high helper function instead of direct access
mborland Jul 28, 2026
039c8aa
Update pretty printers for new high word
mborland Jul 28, 2026
761ce86
Use signed high helper function
mborland Jul 28, 2026
dd4a523
Update tests to reflect new high word type
mborland Jul 28, 2026
3ebdd92
Update docs and examples with new high word
mborland Jul 28, 2026
a9992b3
Add release notes page
mborland Jul 28, 2026
9b4b960
Update benchmark files
mborland Jul 28, 2026
a0d5399
Add new render benchmarks
mborland Jul 28, 2026
f72f2d8
Add benchmarks workflow
mborland Jul 28, 2026
1f0ae3b
Refactor doc file root
mborland Jul 28, 2026
4b89ef2
Add regression tracking to PRs
mborland Jul 28, 2026
ebd2c77
Fix deprecation warnings
mborland Jul 28, 2026
5601d00
Update artifact generation
mborland Jul 28, 2026
d2a9813
Update benchmarks from run data
mborland Jul 28, 2026
479339f
Merge pull request #469 from cppalliance/465v2
mborland Jul 28, 2026
5aa7c7f
Regenerate amalgamated single header from 479339facef6d9e6b8633625ccc…
github-actions[bot] Jul 28, 2026
8fa0b4f
Add Additional GPU examples
mborland Jul 29, 2026
8f0e442
Merge pull request #470 from cppalliance/466
mborland Jul 29, 2026
5b5753d
Update overview wording
mborland Jul 29, 2026
d55dfd1
Add trivial getting started example
mborland Jul 29, 2026
ace2855
Add description of examples
mborland Jul 29, 2026
a2117a3
Add links to other supported libs
mborland Jul 29, 2026
9c22c7d
Re-arrange the nav
mborland Jul 29, 2026
8d29bf8
More links in the file structure
mborland Jul 29, 2026
9cd4063
Add better description of macros
mborland Jul 29, 2026
80a45d2
Merge pull request #471 from cppalliance/468
mborland Jul 29, 2026
0954863
Implment p3724 integer division functions
mborland Jul 29, 2026
1f07d42
Add testing of new integer division functions
mborland Jul 29, 2026
857caa5
Add example for integer division functions
mborland Jul 29, 2026
de328ec
Add documentation of integer division functions
mborland Jul 29, 2026
3bb2690
Ignore msvc 14.1 warnings
mborland Jul 29, 2026
de49eae
More MSVC 14.1 warning suppression
mborland Jul 29, 2026
712d110
Even more MSVC 14.1 errors to ignore
mborland Jul 29, 2026
96d042c
Merge pull request #472 from cppalliance/423
mborland Jul 29, 2026
fb446d4
Regenerate amalgamated single header from 96d042cd15f1e618c94ec7ce99a…
github-actions[bot] Jul 29, 2026
f6c3b8b
Improve countl_zero and has_single_bit impls
mborland Jul 29, 2026
4978362
Add note about currently missing intrinsics
mborland Jul 29, 2026
a4acb3d
Improve countr_zero impl
mborland Jul 29, 2026
81d5bc7
Improve popcount impl
mborland Jul 29, 2026
b113de3
Improve byteswap impl
mborland Jul 29, 2026
5e967eb
Fix detection macro
mborland Jul 29, 2026
e8613c6
Fix potential UB
mborland Jul 29, 2026
4f8e32a
Use __builtin_bswap64 x2 as the generic/128-bit versions are worse
mborland Jul 29, 2026
54ce128
Ignore MSVC 14.1 warnings
mborland Jul 30, 2026
55f5484
Merge pull request #474 from cppalliance/473
mborland Jul 30, 2026
9c047e2
Regenerate amalgamated single header from 55f548486f70130c297ac0d3118…
github-actions[bot] Jul 30, 2026
b356b21
Drop the _t from the type names
mborland Jul 30, 2026
a4a022c
Fix broken rename issues
mborland Jul 30, 2026
b9ec9bb
Fix fuzzing typenames
mborland Jul 30, 2026
36cb3c4
Add help and feedback section to README
mborland Jul 30, 2026
bbe0ecb
Update images with new name
mborland Jul 30, 2026
f2f43ed
Merge pull request #475 from cppalliance/434
mborland Jul 30, 2026
a84e8df
Regenerate amalgamated single header from f2f43ed7006c9071ddc774023da…
github-actions[bot] Jul 30, 2026
2321d0c
Add breaking change of rename to the release notes
mborland Jul 30, 2026
19d4770
Add reproducer
mborland Jul 31, 2026
9ae5b26
Add bool path in UnsignedInteger coversion
mborland Jul 31, 2026
3ae5829
Fix unpopped warning suppression
mborland Jul 31, 2026
b185758
Add reproducer test set
mborland Jul 31, 2026
157075b
Ignore warning
mborland Jul 31, 2026
d2093ef
Use ckd_mul for better saturating mul behavior
mborland Jul 31, 2026
6e7208c
Add reproducer test set
mborland Jul 31, 2026
659e24c
Fix user disabled usage of builtin 128-bit ints
mborland Jul 31, 2026
3efa66f
Update doc on automatic config
mborland Jul 31, 2026
ce0091f
Fix boost::random type trait overload
mborland Jul 31, 2026
0ed656f
Add spaceship operator testing
mborland Jul 31, 2026
10a95e2
Add missing cross type spaceship operator
mborland Jul 31, 2026
6a11e40
div should trap on division by 0
mborland Jul 31, 2026
9a30662
Remove leftover BOOST_DECIMAL macro from port
mborland Jul 31, 2026
90e34fd
Ignore new MSVC complaints
mborland Jul 31, 2026
3ce1e88
Fix MINGW failure
mborland Jul 31, 2026
f4f5a00
Fix bad macro exclusions
mborland Jul 31, 2026
9be96dc
Rename for MSVC
mborland Jul 31, 2026
26255c7
Fix macro redefinition
mborland Jul 31, 2026
d798be8
Add compiler explorer links
mborland Jul 31, 2026
d0668e3
Merge pull request #488 from cppalliance/476
mborland Jul 31, 2026
ad8faf9
Add Floating point trait
mborland Jul 31, 2026
41a3972
Add floating point operators
mborland Jul 31, 2026
34c746a
Add testing for the floating point operators
mborland Jul 31, 2026
7930b0f
Add an example for mixed float arithmetic
mborland Jul 31, 2026
9ac63b6
Add documentation of the floating point operators
mborland Jul 31, 2026
0fee78f
Improve float conversion
mborland Jul 31, 2026
bc42817
Test improved float conversion
mborland Jul 31, 2026
0a5f699
Update docs
mborland Jul 31, 2026
84a1fb4
Add mixed integer ops
mborland Jul 31, 2026
2d6be1e
Add testing of mixed integer ops
mborland Jul 31, 2026
8a70c68
Expand mixed type ops example
mborland Jul 31, 2026
d3539b0
Add documentation of mixed type ops
mborland Jul 31, 2026
80ec567
Fix return type to match builtins
mborland Jul 31, 2026
d77856f
Regenerate amalgamated single header from d0668e3b1b7326270d3f966bab8…
github-actions[bot] Jul 31, 2026
c33fc5c
Ignore MSVC warnings
mborland Jul 31, 2026
9b074dd
Ignore win-clang warning
mborland Jul 31, 2026
dbc779c
Fix Clang7 failure
mborland Jul 31, 2026
486ba76
Ignore MSVC 14.1 warning
mborland Jul 31, 2026
9401620
Merge pull request #490 from cppalliance/486
mborland Aug 1, 2026
f6d7e99
Regenerate amalgamated single header from 940162008789ef1a53c281cecaa…
github-actions[bot] Aug 1, 2026
5813659
Separate {fmt} and <format> examples
mborland Aug 3, 2026
22729a2
Merge pull request #494 from cppalliance/491
mborland Aug 3, 2026
e9101a7
Regenerate amalgamated single header from 22729a27097d6c7d565c1e206af…
github-actions[bot] Aug 3, 2026
b4403d6
Add byte conversion functions
mborland Aug 3, 2026
159db0e
Add testing
mborland Aug 3, 2026
6ac3845
Add testing with the module
mborland Aug 3, 2026
e7bd7fb
Add an example
mborland Aug 3, 2026
043c74b
Update documentation
mborland Aug 3, 2026
6fff0d4
Merge pull request #495 from cppalliance/492
mborland Aug 3, 2026
542fa2d
Regenerate amalgamated single header from 6fff0d42f3079a8db9122884cdd…
github-actions[bot] Aug 3, 2026
801f4eb
Ignore debug printing lines
mborland Aug 4, 2026
4fa06f2
Update coverage options
mborland Aug 4, 2026
c6a94f5
Fix unintended macro change
mborland Aug 4, 2026
33af044
More coverage changes
mborland Aug 4, 2026
11fcc9c
Regenerate amalgamated single header from 33af0449e20c26d7996e1121ccd…
github-actions[bot] Aug 4, 2026
d83ee00
Fix link to reference
mborland Aug 4, 2026
beae119
Update category to match other libs
mborland Aug 5, 2026
1487bb1
Fix benchmark cpp detection for MSVC
mborland Aug 6, 2026
9980eea
Add benchmarking of Abseil on windows platforms
mborland Aug 6, 2026
9fccb1f
Run on windows ARM too
mborland Aug 6, 2026
a1b8856
Update MSVC run data
mborland Aug 6, 2026
5ca1f7c
Update charts
mborland Aug 6, 2026
7a75dc4
Update benchmark documentation pages
mborland Aug 6, 2026
edbff3b
Merge pull request #497 from cppalliance/absl
mborland Aug 6, 2026
f437657
Ignore coverage of function that's only needed on ppc64
mborland Aug 6, 2026
ea4a193
Rename examples to example
mborland Aug 7, 2026
90d1604
Merge pull request #498 from cppalliance/example
mborland Aug 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extra/single_include/** linguist-generated=true
22 changes: 22 additions & 0 deletions .github/scripts/compare_benchmarks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Copyright 2026 Matt Borland
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
#
# Reports the data sets in $1 against the numbers committed under
# doc/modules/ROOT/data and appends the report to the job summary. Run it from
# the root of the library checkout.
#
# This is informational only: shared runners drift by a few percent from run to
# run, so a slower number is a prompt to look, not a build failure.

set -e

RESULTS=${1:-bench-results}

PYTHON=python3
if ! command -v python3 > /dev/null 2>&1; then
PYTHON=python
fi

"$PYTHON" doc/render_benchmarks.py --compare "$RESULTS" --summary "${GITHUB_STEP_SUMMARY:-/dev/null}"
98 changes: 98 additions & 0 deletions .github/scripts/run_benchmarks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/bin/bash
# Copyright 2026 Matt Borland
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
#
# Builds both benchmark drivers in release mode and runs them, leaving u128.json
# and i128.json in the --out directory. Those two files are exactly what
# doc/render_benchmarks.py consumes.
#
# Run it from the root of a Boost tree that has this library in libs/int128; the
# include path is every libs/*/include in that tree, so no b2 headers step is
# needed. The drivers always exit non-zero (the Jamfile declares them run-fail),
# so success is judged on the data set actually being written.
#
# --sources names extra translation units to build alongside the driver, which is
# how the platforms with no packaged Abseil get one: point --cxxflags at a source
# checkout and --sources at absl/numeric/int128.cc, the only file of it that
# absl::uint128 and absl::int128 need.
#
# .github/scripts/run_benchmarks.sh --compiler g++-14 --out /tmp/results
# .github/scripts/run_benchmarks.sh --msvc --elements 5000000 --out C:/results

set -e

COMPILER=""
EXTRA_CXXFLAGS=""
EXTRA_LDFLAGS=""
EXTRA_SOURCES=""
ELEMENTS=20000000
REPETITIONS=5
OUT=""
MSVC=0

while [ $# -gt 0 ]; do
case "$1" in
--compiler) COMPILER="$2"; shift 2 ;;
--cxxflags) EXTRA_CXXFLAGS="$2"; shift 2 ;;
--ldflags) EXTRA_LDFLAGS="$2"; shift 2 ;;
--sources) EXTRA_SOURCES="$2"; shift 2 ;;
--elements) ELEMENTS="$2"; shift 2 ;;
--repetitions) REPETITIONS="$2"; shift 2 ;;
--out) OUT="$2"; shift 2 ;;
--msvc) MSVC=1; shift ;;
*) echo "unknown argument: $1" >&2; exit 2 ;;
esac
done

if [ -z "$OUT" ]; then
echo "error: --out is required" >&2
exit 2
fi

if [ ! -d libs/int128/test ]; then
echo "error: run this from the root of a Boost tree holding libs/int128" >&2
exit 2
fi

mkdir -p "$OUT"

# Every dependency is header only from the benchmarks' point of view, so the
# include path is simply all of the libraries checked out in this tree.
INCLUDES=""
for dir in libs/*/include libs/*/*/include; do
if [ -d "$dir" ]; then
INCLUDES="$INCLUDES -I$dir"
fi
done

for sign in u128 i128; do
source_file="libs/int128/test/benchmark_$sign.cpp"

if [ "$MSVC" = 1 ]; then
# LARGEADDRESSAWARE lets the 32-bit build address more than 2GB, which
# the widest vectors need.
executable="./benchmark_$sign.exe"
# shellcheck disable=SC2086
cl -nologo -std:c++20 -O2 -EHsc -DNDEBUG $EXTRA_CXXFLAGS $INCLUDES \
"$source_file" $EXTRA_SOURCES \
-Fe:"benchmark_$sign.exe" -link -LARGEADDRESSAWARE $EXTRA_LDFLAGS
else
executable="./benchmark_$sign"
# shellcheck disable=SC2086
$COMPILER -std=c++20 -O2 -DNDEBUG $EXTRA_CXXFLAGS $INCLUDES \
"$source_file" $EXTRA_SOURCES \
-o "benchmark_$sign" $EXTRA_LDFLAGS
fi

echo "==================== benchmark_$sign ===================="
"$executable" --elements "$ELEMENTS" --repetitions "$REPETITIONS" --json "$OUT/$sign.json" || true

if [ ! -s "$OUT/$sign.json" ]; then
echo "error: benchmark_$sign did not write $OUT/$sign.json" >&2
exit 1
fi
done

echo "==================== data sets ===================="
ls -l "$OUT"
42 changes: 42 additions & 0 deletions .github/scripts/setup_benchmarks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
# Copyright 2026 Matt Borland
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
#
# Clones a Boost tree next to the checkout, drops this library into it, and
# installs the dependencies the benchmarks need. Exports BOOST_ROOT for the
# steps that follow. Only used by .github/workflows/benchmarks.yml.

set -e

LIBRARY=${GITHUB_REPOSITORY#*/}
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}

BOOST_BRANCH=develop
if [ "$REF" = "master" ]; then
BOOST_BRANCH=master
fi

PYTHON=python3
if ! command -v python3 > /dev/null 2>&1; then
PYTHON=python
fi

cd ..
git clone -b "$BOOST_BRANCH" --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
mkdir -p "libs/$LIBRARY"

# Everything except doc/: it carries an Antora examples symlink that git-bash on
# Windows cannot recreate, plus a node_modules tree that nothing here needs.
for entry in "$GITHUB_WORKSPACE"/*; do
if [ "$(basename "$entry")" != doc ]; then
cp -r "$entry" "libs/$LIBRARY/"
fi
done

git submodule update --init tools/boostdep
"$PYTHON" tools/boostdep/depinst/depinst.py --git_args "--jobs ${GIT_FETCH_JOBS:-4}" "$LIBRARY"

echo "BOOST_ROOT=$(pwd)" >> "$GITHUB_ENV"
105 changes: 105 additions & 0 deletions .github/workflows/amalgamate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Copyright 2025 Matt Borland
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
#
# Regenerates the amalgamated single header in extra/single_include/ whenever
# the real headers change on develop, and commits the result back.
# The paths filter below does not include extra/single_include/, and the bot
# commit carries [skip ci], so the push-back cannot retrigger this workflow
# or the main CI.

name: amalgamate

on:
workflow_dispatch:
push:
branches:
- develop
paths:
- 'include/**'
- 'extra/amalgamate.py'
- '.github/workflows/amalgamate.yml'

concurrency:
group: ${{format('{0}:amalgamate', github.repository)}}
cancel-in-progress: false

permissions:
contents: write

jobs:
regenerate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Regenerate the single header
run: python3 extra/amalgamate.py

- name: Smoke test the single header
run: |
cat > "${RUNNER_TEMP}/smoke.cpp" << 'EOF'
// Smoke test for the amalgamated single header. Verifies the header is
// self-contained and core operations work end to end.

#include <boost/int128.hpp>
#include <iostream>
#include <limits>
#include <sstream>

int main()
{
using namespace boost::int128;
using namespace boost::int128::literals;

const auto a {BOOST_INT128_UINT128_C(340282366920938463463374607431768211455)};
const auto b {18446744073709551615_u128};
const auto c {-1234567890123456789_i128};

if (a / b != 18446744073709551617_u128)
{
return 1;
}

if (popcount(a) != 128)
{
return 2;
}

if (saturating_add(a, b) != (std::numeric_limits<uint128>::max)())
{
return 3;
}

if (c + c != -2469135780246913578_i128)
{
return 4;
}

std::ostringstream os {};
os << a;
if (os.str() != "340282366920938463463374607431768211455")
{
return 5;
}

std::cout << "Single header smoke test passed" << std::endl;
return 0;
}
EOF
for std in c++14 c++20; do
g++ -std=${std} -Wall -Wextra -I extra/single_include "${RUNNER_TEMP}/smoke.cpp" -o "${RUNNER_TEMP}/smoke"
"${RUNNER_TEMP}/smoke"
done

- name: Commit and push if changed
run: |
git add extra/single_include
if git diff --cached --quiet; then
echo 'Single header is already up to date'
else
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -m "Regenerate amalgamated single header from ${GITHUB_SHA} [skip ci]"
git push origin "HEAD:${GITHUB_REF_NAME}"
fi
Loading
Loading