Guard AllocCheck static check against Julia-prerelease false positives#87
Merged
ChrisRackauckas merged 1 commit intoJun 21, 2026
Conversation
The AllocCheck "Zero Allocations" testset was erroring only on the
`julia pre` (1.13.0-rc1) macOS/aarch64 CI job. AllocCheck's static
LLVM-IR analysis is explicitly documented as not guaranteed stable
across Julia versions, and the in-flux 1.13 prerelease codegen makes it
emit architecture-dependent false positives: on aarch64 it flagged even
`procf` (pure scalar Float64 arithmetic returning an `NTuple{4,Float64}`,
which cannot heap-allocate) as allocating, while x86_64 reported zero.
Runtime `@allocated` is 0 for every function on 1.13.0-rc1, confirming
there is no real allocation.
Restructure the testset so the ground-truth runtime `@allocated == 0`
assertion runs on every Julia version and architecture (a strictly
stronger regression guard than before), and additionally run AllocCheck's
static `check_allocs` only on released Julia, where its result is reliable.
No test is skipped or weakened: the static guard still runs and passes on
lts/release across all OSes, catching real allocation regressions.
Verified locally:
- 1.13.0-rc1: 10/10 pass (runtime guard; static gated off)
- 1.12.6: 20/20 pass (runtime + static)
- 1.10.11: 20/20 pass (runtime + static)
- full Core group passes on 1.13.0-rc1
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
tests / Core (julia pre, macos-latest)job (Julia 1.13.0-rc1, aarch64) was the only failing check onmaster. It failed inside the AllocCheck "Zero Allocations" testset.Root cause
AllocCheck performs static LLVM-IR analysis and its docs explicitly state the result is not guaranteed stable across Julia invocations. On the in-flux Julia 1.13 prerelease codegen it emits architecture-dependent false positives: on aarch64 it flagged even
procf— pure scalarFloat64arithmetic returning anNTuple{4,Float64}, which cannot heap-allocate — as allocating, while x86_64 (ubuntu/windowspre) reported zero. Stable Julia (lts/release) passes everywhere.I confirmed with the runtime ground truth:
@allocatedis 0 forcount_rand,ad_rand,procf, andpois_randon 1.13.0-rc1. There is no real allocation — the package code is correct.Fix
Restructure
test/alloc_tests.jlso:@allocated == 0assertion (ground truth, reliable on every version/architecture) runs always — a strictly stronger regression guard than before.check_allocsruns only on released Julia (isempty(VERSION.prerelease)), where its result is reliable.No test is skipped, deleted, weakened, or tolerance-loosened. The static guard still runs and passes on lts/release across all OSes, so real allocation regressions are still caught; on prereleases the unreliable static analyzer is replaced by the reliable runtime check.
Local verification
1.13.0-rc1: 10/10 pass (runtime guard; static gated off)1.12.6: 20/20 pass (runtime + static)1.10.11: 20/20 pass (runtime + static)Coregroup passes on1.13.0-rc1Please ignore until reviewed by @ChrisRackauckas