Repository navigation
tests: make the MIR reservation probe immune to arm64's heap regions - #1428
Merged
Merged
Conversation
test_a_live_mir_model_holds_far_less_than_upstreams_reservation failed on the macos-15 MIR leg of #1372 at 45.65 MB a model against 40, on a branch that does not touch MIR. It divides the growth of the whole address space over 20 live models by 20, and that growth includes their heap, about 1.1 MB a live model. macOS on arm64 maps a heap in regions of up to 128 MB, 128-512 MB for 300 MB of mallocs on the macos-14 and -15 runners (#1402), and two taken in the window read as (45.65 - 32.1) * 20 = 271 MB. #1402 made the sibling abandon probe immune to the same thing; this one was left. The probe now keeps 100 live models, which spreads a region over five times as many, and the bound is 64 MB a model, halfway between the default 32 and upstream's 128 by ratio: 512 MB of regions is 5.1 MB a model, and upstream's 128 still fails it by a factor of two. The probe takes about a second. Measured on macOS 26 arm64 (which does not grow the address space for heap, so this is the reservation alone): 32.00 MB a model at 20 and 32.05-32.09 at 100 over 15 runs each.
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.
test_a_live_mir_model_holds_far_less_than_upstreams_reservationfailed on the macos-15 MIR leg of #1372 at 45.65 MB a model against a bound of 40, on a branch that does not touch MIR. A rerun of that job on the same commit passed.Why
The probe divides the growth of the whole address space over 20 live MIR models by 20. That growth includes their heap, about 1.1 MB a live model. macOS on arm64 maps a heap in regions of up to 128 MB: on the macos-14 and macos-15 runners, 300 MB of mallocs moved the address space by 128-512 MB (#1402). Two regions taken in the window read as (45.65 − 32.1) × 20 = 271 MB. #1402 made the sibling abandon probe immune to the same thing; this one was left.
The fix
The probe keeps 100 live models instead of 20, which spreads a region over five times as many, and the bound is 64 MB a model, halfway between the default 32 and upstream's 128 by ratio. 512 MB of regions is 5.1 MB a model. Upstream's 128 still fails by a factor of two. The probe takes about a second.
Measured (macOS 26 arm64, a local MIR build)
BNGSIM_MIR_CODE_RESERVE_MB=128<= 64macOS 26 does not grow the address space for heap here (100 MB of extra 100 KB allocations in the window still read 32.0), so these numbers are the reservation alone; the runners' regions are what the wider spread is for.
changelog exempt: a test change only.