Skip to content

docs(types): fix axiom/*.h typo causing -Wcomment #84

docs(types): fix axiom/*.h typo causing -Wcomment

docs(types): fix axiom/*.h typo causing -Wcomment #84

Workflow file for this run

name: CI (build + test)
on:
push:
branches: [main]
pull_request:
branches: [main]
# cancel in-progress runs on new pushes to the same branch
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
# build + test on x86-64 with ISA dispatch (avx512 + avx2 + scalar variants)
test-x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: show hardware
run: |
lscpu | head -20
free -h
- name: build with ISA dispatch
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DAX_CPU_ISA_DISPATCH=ON ..
cmake --build . -j$(nproc)
- name: verify ISA selection
run: cd build && ./test_compute 2>&1 | head -8
- name: run test suite
run: cd build && ctest -j$(nproc) --output-on-failure
# asan + ubsan build moved to a dedicated gating job (test-asan).
# the previous approach ran sanitizers inside this job with `|| true`
# so failures didn't block merges — defeats the point. keeping a
# quick smoke build here for local dev signal, gate via test-asan.
# build + test on ARM64 (NEON)
test-arm64:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: show hardware
run: |
lscpu | head -20
free -h
- name: install deps
run: sudo apt-get update -qq && sudo apt-get install -y -qq build-essential cmake libomp-dev
- name: build
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j$(nproc)
- name: run test suite
run: cd build && ctest -j$(nproc) --output-on-failure
- name: verify NEON micro-kernel
run: cd build && ./test_compute 2>&1 | head -5
- name: per-op micro-benchmarks (NEON baseline)
run: |
cd build
./bench_gemm_suite 2>&1 | head -40
./bench_ops_suite 2>&1 | head -40
# scalar-only build: no SIMD, no OpenMP — ensures scalar fallback paths compile
# and all tests pass without vector extensions. catches regressions where a
# new code path accidentally requires AVX/NEON without a scalar fallback.
test-scalar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build scalar-only (no AVX, no OMP)
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DAX_OPENMP=OFF \
-DCMAKE_C_FLAGS="-mno-avx2 -mno-avx -mno-fma -mno-sse4.1 -mno-sse4.2 -mno-avx512f" \
..
cmake --build . -j$(nproc)
- name: run test suite (scalar paths)
run: cd build && ctest -j$(nproc) --output-on-failure
- name: per-op micro-benchmarks (scalar baseline)
run: |
cd build
./bench_gemm_suite 2>&1 | head -40
./bench_ops_suite 2>&1 | head -40
# embedded/baremetal build: validates the AX_PROFILE=embedded-baremetal
# path. that profile turns on AX_OPENMP=OFF + AX_SINGLE_THREADED +
# AX_NO_STDIO + AX_NO_AUTOTUNE + AX_INFERENCE_ONLY by default and
# picks tiny GEMM tiles (24x32x64) sized for a 64 kB SRAM. compile-only;
# there's no execution environment for cortex-m here.
#
# post-build: scan the static archive for stdio symbol references. when
# AX_NO_STDIO is on, no public function should pull in printf / fprintf
# / fopen / fwrite — those would force the toolchain to link the
# ~20 kB stdio machinery into the final firmware image.
test-embedded:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build embedded-baremetal profile
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DAX_PROFILE=embedded-baremetal \
..
cmake --build . -j$(nproc) --target axiom_static
- name: check for stdio leaks in library object
run: |
nm build/libaxiom.a 2>/dev/null | grep -E ' U (printf|fprintf|fopen|fwrite)' \
&& echo "FAIL: stdio symbols found" && exit 1 \
|| echo "ok: no stdio symbols in embedded build"
# address-sanitizer + undefined-behavior-sanitizer build. catches the
# bug classes static analysis misses (use-after-free, heap-buffer-
# overflow, signed-overflow, mis-aligned aligned_alloc requests, etc.).
# gates merges — failures block the PR. previous version of this job
# ran inside test-x86 with `|| true` so failures were ignored;
# promoting to its own job + dropping the `|| true` makes asan
# findings actionable.
test-asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build with asan + ubsan
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DAX_SANITIZE=ON ..
cmake --build . -j$(nproc)
- name: run test suite under sanitizers
run: |
cd build
# detect_leaks=0: tests intentionally don't free every intermediate
# tensor in the autograd graph (that's the model api's job via
# ax_graph_cleanup). asan still catches use-after-free / overflow.
# halt_on_error=1: any sanitizer report aborts the test, ctest
# records it as failure rather than continuing past corruption.
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1 \
UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 \
ctest -j$(nproc) --output-on-failure --timeout 300
# static analysis / lint
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: cppcheck
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq cppcheck
cppcheck --enable=warning,portability --error-exitcode=0 \
--suppress=missingIncludeSystem \
-I include src/ 2>&1 | tail -30 || true