Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 87 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,10 @@ jobs:
ASan-Linux:
name: AddressSanitizer Linux

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-26.04-arm]
cc: [gcc, clang]
fail-fast: false
env:
Expand All @@ -421,24 +422,47 @@ jobs:
$CC --version
- name: Script
run: |
set -x
# Build NOSIMD under the sanitizer (see PR #71 discussion): testing the hand-tuned
# SIMD asm under ASan/UBSan adds little, and on macOS it fails to assemble under -Og
# ("invalid CFI advance_loc expression"). NOSIMD exercises the same C-level logic.
bash -e -o pipefail -- makemake.sh use_hwloc nosimd
(cd obj_nosimd; make clean)
set -x -o pipefail
# Build the runner's native SIMD mode under the sanitizers: AVX2 or AVX-512 on x86,
# depending on the runner, and ASIMD on ARM. This is the only job that builds the
# hand-tuned SIMD asm under a sanitizer. Issue #12, a SEGV in radix48_dit_pass1 during
# 'Mlucas -s m', was reported by ASan on an ARM runner. (The macOS ASan job stays on
# NOSIMD, see PR #71: there the SIMD asm fails to assemble under -Og, "invalid CFI
# advance_loc expression".)
bash -e -o pipefail -- makemake.sh use_hwloc
(cd obj; make clean)
# On ARM, config-fermat.sh runs from the NOSIMD build, as in the Linux job above: the ASIMD
# build's trial-factoring routines are stubs ("No TF support on ARMv8!" in twopmodq80.c).
if [[ $HOSTTYPE == aarch64 ]]; then
bash -e -o pipefail -- makemake.sh use_hwloc nosimd
(cd obj_nosimd; make clean)
fi
for word in '' {{1..4},n}word; do
echo -e "\nMfactor $word\n"
bash -e -o pipefail -- makemake.sh mfac $word nosimd
(cd obj_mfac${word:+_$word}_nosimd; make clean)
done
cd obj_nosimd
for s in tt t s m; do time ./Mlucas -s $s -cpu "0:$(( $(nproc --all) - 1 ))"; done
for s in tt t s; do time ./Mlucas -prp -s $s -cpu "0:$(( $(nproc --all) - 1 ))"; done
cd obj
for s in tt t s m; do time ./Mlucas -s $s -cpu "0:$(( $(nproc --all) - 1 ))" |& tee -a test.log; done
for s in tt t s; do time ./Mlucas -prp -s $s -cpu "0:$(( $(nproc --all) - 1 ))" |& tee -a test.log; done
if [[ $HOSTTYPE == aarch64 ]]; then
cd ../obj_nosimd
fi
bash -e -o pipefail -- ../config-fermat.sh -cpu "0:$(( $(nproc --all) - 1 ))"
for word in '' {{1..4},n}word; do
(cd "../obj_mfac${word:+_$word}_nosimd" && time "./Mfactor${word:+_$word}" -m 521 -bmax 20)
done
- uses: actions/upload-artifact@v7
if: always()
with:
name: ${{ matrix.os }}_${{ matrix.cc }}_asan_mlucas
path: |
obj*/build.log
obj*/test.log
obj*/mlucas.cfg
obj*/config-fermat.log
obj*/fermat.cfg
if-no-files-found: warn

TSan-Linux:
name: ThreadSanitizer Linux
Expand All @@ -464,11 +488,22 @@ jobs:
$CC --version
- name: Script
run: |
set -x
set -x -o pipefail
bash -e -o pipefail -- makemake.sh use_hwloc nosimd
cd obj_nosimd
make clean
time ./Mlucas -s tt -cpu "0:$(( $(nproc --all) - 1 ))"
time ./Mlucas -s tt -cpu "0:$(( $(nproc --all) - 1 ))" |& tee -a test.log
- uses: actions/upload-artifact@v7
if: always()
with:
name: linux_${{ matrix.cc }}_tsan_mlucas
path: |
obj*/build.log
obj*/test.log
obj*/mlucas.cfg
obj*/config-fermat.log
obj*/fermat.cfg
if-no-files-found: warn

GCC-analyzer:
name: GCC analyzer
Expand Down Expand Up @@ -685,7 +720,7 @@ jobs:
clang --version
- name: Script
run: |
set -x
set -x -o pipefail
# Build NOSIMD under the sanitizer (see PR #71 discussion): testing the hand-tuned
# SIMD asm under ASan/UBSan adds little, and on macOS it fails to assemble under -Og
# ("invalid CFI advance_loc expression"). NOSIMD exercises the same C-level logic.
Expand All @@ -697,12 +732,23 @@ jobs:
(cd obj_mfac${word:+_$word}_nosimd; make clean)
done
cd obj_nosimd
for s in tt t s m; do time ./Mlucas -s $s -cpu "0:$(( $(sysctl -n hw.ncpu) - 1 ))"; done
for s in tt t s; do time ./Mlucas -prp -s $s -cpu "0:$(( $(sysctl -n hw.ncpu) - 1 ))"; done
for s in tt t s m; do time ./Mlucas -s $s -cpu "0:$(( $(sysctl -n hw.ncpu) - 1 ))" 2>&1 | tee -a test.log; done
for s in tt t s; do time ./Mlucas -prp -s $s -cpu "0:$(( $(sysctl -n hw.ncpu) - 1 ))" 2>&1 | tee -a test.log; done
bash -e -o pipefail -- ../config-fermat.sh -cpu "0:$(( $(sysctl -n hw.ncpu) - 1 ))"
for word in '' {{1..4},n}word; do
(cd "../obj_mfac${word:+_$word}_nosimd" && time "./Mfactor${word:+_$word}" -m 521 -bmax 20)
done
- uses: actions/upload-artifact@v7
if: always()
with:
name: macos_asan_mlucas
path: |
obj*/build.log
obj*/test.log
obj*/mlucas.cfg
obj*/config-fermat.log
obj*/fermat.cfg
if-no-files-found: warn

TSan-macOS:
name: ThreadSanitizer macOS
Expand All @@ -719,14 +765,25 @@ jobs:
clang --version
- name: Script
run: |
set -x
set -x -o pipefail
bash -e -o pipefail -- makemake.sh use_hwloc nosimd
cd obj_nosimd
make clean
# Use the 'tt' (tiny) self-test rather than 'm': TSan's instrumentation is slow enough that the
# medium tier timed out (this job was previously if:false-gated "Too slow"), whereas tt still
# exercises the multithreaded carry/threadpool paths for data-race detection in a few seconds.
time ./Mlucas -s tt -cpu "0:$(( $(sysctl -n hw.ncpu) - 1 ))"
time ./Mlucas -s tt -cpu "0:$(( $(sysctl -n hw.ncpu) - 1 ))" 2>&1 | tee -a test.log
- uses: actions/upload-artifact@v7
if: always()
with:
name: macos_tsan_mlucas
path: |
obj*/build.log
obj*/test.log
obj*/mlucas.cfg
obj*/config-fermat.log
obj*/fermat.cfg
if-no-files-found: warn

FreeBSD:
name: Mlucas FreeBSD
Expand Down Expand Up @@ -945,9 +1002,20 @@ jobs:
(cd obj_mfac${word:+_$word}_nosimd; make clean)
done
cd obj_nosimd
for s in tt t s m; do time ./Mlucas -s $s -cpu "0:$(( NUMBER_OF_PROCESSORS - 1 ))"; done
for s in tt t s; do time ./Mlucas -prp -s $s -cpu "0:$(( NUMBER_OF_PROCESSORS - 1 ))"; done
for s in tt t s m; do time ./Mlucas -s $s -cpu "0:$(( NUMBER_OF_PROCESSORS - 1 ))" |& tee -a test.log; done
for s in tt t s; do time ./Mlucas -prp -s $s -cpu "0:$(( NUMBER_OF_PROCESSORS - 1 ))" |& tee -a test.log; done
bash -e -o pipefail -- ../config-fermat.sh -cpu "0:$(( NUMBER_OF_PROCESSORS - 1 ))"
for word in '' {{1..4},n}word; do
(cd "../obj_mfac${word:+_$word}_nosimd" && time "./Mfactor${word:+_$word}" -m 521 -bmax 20)
done
- uses: actions/upload-artifact@v7
if: always()
with:
name: windows_asan_mlucas
path: |
obj*/build.log
obj*/test.log
obj*/mlucas.cfg
obj*/config-fermat.log
obj*/fermat.cfg
if-no-files-found: warn
Loading