From 5515df3cba783266bbc758024c2e99f965e944da Mon Sep 17 00:00:00 2001 From: Chris Fields Date: Wed, 14 Oct 2026 22:28:36 -0500 Subject: [PATCH] CI: also run the tests in a debug build Release builds wrap on integer overflow and skip debug_assert!s, which is how HPCBio/wfa2lib-rs#41 (a usize underflow) went unnoticed. A new `test-debug` job runs `cargo test` in a debug build on Linux and macOS, in parallel with the release test jobs. Co-Authored-By: Claude Opus 5.5 --- .claude/PROGRESS.md | 3 ++- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ README.md | 10 ++++++---- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.claude/PROGRESS.md b/.claude/PROGRESS.md index 5ec0392..bb4dcbd 100644 --- a/.claude/PROGRESS.md +++ b/.claude/PROGRESS.md @@ -152,4 +152,5 @@ reports, inbound C ports) is tracked in HPCBio/wfa2lib-rs#19. Null steps no longer end a corrected search while a candidate is pending (FIXED_BUGS 14c, with `BandedStatic`). Also HPCBio/wfa2lib-rs#41: empty pattern + text no longer panics in debug - (FIXED_BUGS 15). + (FIXED_BUGS 15). CI now also runs the tests in a debug build (Linux and + macOS), so overflows like it fail CI. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f190e41..11b7f4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,29 @@ jobs: - name: Stock C unit tests run: bash tests/wfa_utest.sh + # Debug build: overflow checks and debug_assert!s are on, catching what + # release builds silently wrap past (HPCBio/wfa2lib-rs#41). A separate job + # so it runs alongside the release tests; both architectures, since the + # x86 and ARM SIMD paths differ. + test-debug: + name: Test debug (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Fetch C WFA2-lib + run: | + git clone --quiet https://github.com/smarco/WFA2-lib WFA2-lib + git -C WFA2-lib checkout --quiet "$(cat tests/differential/C_COMMIT)" + - name: Tests (debug) + run: cargo test + # Suites run as parallel jobs; span is the longest (~15 min on Linux). # Linux runs Rust's x86 AVX2 kernels, macOS (arm64) its NEON ones, so # together they check that Rust gives the same output on both. macOS diff --git a/README.md b/README.md index e5d0713..5e11727 100644 --- a/README.md +++ b/README.md @@ -82,13 +82,15 @@ For broader parity checks, `tests/differential/run.sh` builds C's 1300 configurations (metrics, spans, heuristics, memory modes); see [`tests/differential/README.md`](tests/differential/README.md). -CI (`.github/workflows/ci.yml`) runs clippy, the tests, a library-only build, +CI (`.github/workflows/ci.yml`) runs clippy, the tests (release, and debug +with overflow checks and debug assertions), a library-only build, `wfa_utest.sh` and the differential harness on Linux (x86-64) and macOS (arm64) for every pull request and push to `main`. Running the harness on both checks that Rust's x86 and ARM SIMD paths give the same output. Linux also -runs everything with `RUSTFLAGS="-C target-cpu=x86-64-v3"`, so the AVX2 -kernels are tested both when selected at run time and when enabled at compile -time (as in `target-cpu=native` builds). +runs the release tests and the harness with +`RUSTFLAGS="-C target-cpu=x86-64-v3"`, so the AVX2 kernels are tested both +when selected at run time and when enabled at compile time (as in +`target-cpu=native` builds). ## Usage