Isolate program memory tests as async: false - #182
Merged
ausimian merged 1 commit intoJun 6, 2026
Conversation
The two Emily.ProgramTest "memory" leak-detection tests assert tiny deltas (64 KB / 4 MB) on the process-global MLX active-memory metric (Native.get_active_memory/0), measured across two points. Under async: true they can run concurrently with model-loading tests (the :conformance / *_full lanes), which inflate the global reading mid-measurement and blow the deltas up — a false positive surfaced only by a full `mix test --include ...` run (the default suite excludes those heavy lanes, so it never hit this). Split them into Emily.ProgramMemoryTest (async: false) so they get an exclusive run with no concurrent allocations; the rest of Emily.ProgramTest stays async: true. add_chain_ir is duplicated into the new module (small, self-contained); the shared helpers it uses (worker/f32/to_f32_list) already live in Emily.TensorHelpers. A full all-tags run is now 745 tests, 0 failures (was 2).
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 two
Emily.ProgramTest"memory" leak-detection tests assert tinydeltas (64 KB / 4 MB) on the process-global MLX active-memory metric
(
Native.get_active_memory/0). Underasync: truethey can runconcurrently with model-loading tests (the
:conformance/*_fulllanes), which inflate the global reading mid-measurement and blow the
deltas up — a false positive that only surfaces in a full
mix test --include ...run (the default suite excludes those heavylanes, so it never hit this; PR CI runs the default suite, so it was
green too).
Fix: split the two tests into a new
Emily.ProgramMemoryTest(
async: false) so they get an exclusive run with no concurrentallocations. The rest of
Emily.ProgramTeststaysasync: true.add_chain_iris duplicated into the new module (small, self-contained);the shared helpers it uses (
worker/f32/to_f32_list) already live inEmily.TensorHelpers.Verification
A full all-tags local run (
--include conformance native native_compiled vit_full whisper_full distilbert_full training_full fast_kernels_full)is now 745 tests, 0 failures (was 2). No production code touched —
test isolation only.