fix: patch AllocCheck to allow jl_get_pgcstack_static on Apple Silicon#1092
Merged
Conversation
Contributor
|
Mooncake.jl documentation for PR #1092 is available at: |
Contributor
|
Performance Ratio: |
AllocCheck's fn_may_allocate allowlist includes "get_pgcstack" but not "get_pgcstack_static", the arm64-specific variant of that call used on Apple Silicon. This causes a spurious "1 allocation" report for any function that touches the GC stack on that platform, including trivial @foldable functions like fdata_type. Closes #982 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3afb7e6 to
ffc2fc3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Member
Author
|
It's better to fix AllocChecks rather than merge this PR. |
Collaborator
lkdvos
reviewed
Mar 23, 2026
Collaborator
There was a problem hiding this comment.
I'm not sure if I am qualified to really review this, but from a far this looks reasonable and if it fixes the issues I'm happy with this.
[EDIT] only now saw the comments, indeed would be better to not have to go into the internals of alloccheck from here.
yebai
commented
Mar 24, 2026
Co-authored-by: Hong Ge <3279477+yebai@users.noreply.github.com> Signed-off-by: Hong Ge <3279477+yebai@users.noreply.github.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.
Closes #982
AllocCheck.fn_may_allocateallowlists"get_pgcstack"but not"get_pgcstack_static", the arm64-specific variant used on Apple Silicon@check_allocs-decorated function on macOS/arm64, making allcheck_allocs-based tests fail with false positivesfn_may_allocateinMooncakeAllocCheckExt.__init__to intercept"get_pgcstack_static"before the upstream classifier sees it🤖 Generated with Claude Code
CI Summary — GitHub Actions
Documentation Preview
Mooncake.jl documentation for PR #1092 is available at:
https://chalk-lab.github.io/Mooncake.jl/previews/PR1092/
Performance
Performance Ratio:
Ratio of time to compute gradient and time to compute function.
Warning: results are very approximate! See here for more context.