diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b82ef313..a4349083 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,23 @@ jobs: - name: Prove no library crate installs a process-global run: make check-no-globals + # Connector allocation counts + bench-gate: + name: Bench Gate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + submodules: recursive + + - name: Install Rust + uses: actions-rust-lang/setup-rust-toolchain@v2 + with: + rustflags: "" + + - name: Assert connector allocations per message + run: make bench-gate + # Embedded target testing embedded-targets: name: Embedded Cross-compilation @@ -149,7 +166,7 @@ jobs: comprehensive-check: name: Comprehensive Development Check runs-on: ubuntu-latest - needs: [format-and-lint, makefile-build, embedded-targets] + needs: [format-and-lint, makefile-build, embedded-targets, bench-gate] steps: - uses: actions/checkout@v7 with: diff --git a/Makefile b/Makefile index 8e01c98e..fe75335b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # AimDB Makefile # Simple automation for common development tasks -.PHONY: help build test clean clean-embedded fmt fmt-check clippy doc all check test-embedded test-wasm wasm wasm-test wasm-test-deps examples deny audit security publish publish-check readme-check codegen-drift check-no-sim check-no-globals check-toolchain-pin +.PHONY: help build test clean clean-embedded fmt fmt-check clippy doc all check test-embedded test-wasm wasm wasm-test wasm-test-deps examples deny audit security publish publish-check readme-check codegen-drift check-no-sim check-no-globals check-toolchain-pin bench-gate .DEFAULT_GOAL := help # Separate target dir for embedded checks so an interrupted example build @@ -56,6 +56,7 @@ help: @printf " test-wasm Test WASM cross-compilation compatibility\n" @printf " readme-check Verify the README quickstart matches its compiled example\n" @printf " codegen-drift Compile codegen output against the workspace API\n" + @printf " bench-gate Assert connector allocation counts (b0_alloc_connector)\n" @printf "\n" @printf " $(YELLOW)Security & Quality:$(NC)\n" @printf " deny Check dependencies (licenses, advisories, bans)\n" @@ -742,6 +743,14 @@ publish: @printf "$(GREEN)✓ All $(words $(PUBLISH_ORDER)) crates published successfully!$(NC)\n" @printf "$(BLUE)🎉 AimDB v$(shell grep '^version' Cargo.toml | head -1 | cut -d '"' -f 2) is now live on crates.io!$(NC)\n" +## Benchmark gates +# Runs the counting-allocator connector bench, which asserts its EXPECTED +# allocations per message and fails on any difference. +# Deterministic, so it gates CI without a quiet runner. +bench-gate: + @printf "$(GREEN)Checking connector allocation counts...$(NC)\n" + cargo bench --package aimdb-bench --bench b0_alloc_connector + ## Drift guards # The README quickstart is compiled as examples/readme-quickstart; this target # fails when the README code block and the example diverge, or when the