Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions python/tests/test_mir_equivalence.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def live():


def test_a_live_mir_model_holds_far_less_than_upstreams_reservation():
"""Address space, not memory: 20 live MIR-JIT'd models of a two-species
"""Address space, not memory: 100 live MIR-JIT'd models of a two-species
network. With upstream's 128 MB reservation each held 128 MB; with the
default 32 MB, a little over 32. The bound catches a fall back to
upstream's size, not the exact setting: a build configured at 0 passes too."""
Expand All @@ -190,7 +190,7 @@ def test_a_live_mir_model_holds_far_less_than_upstreams_reservation():
net = os.path.join(DATA, "simple_decay.net")
env = {**os.environ, "BNGSIM_CODEGEN_JIT": "mir"}
done = subprocess.run(
[sys.executable, "-c", _RESERVE_PROBE, str(net), "20"],
[sys.executable, "-c", _RESERVE_PROBE, str(net), "100"],
capture_output=True,
text=True,
env=env,
Expand All @@ -200,9 +200,14 @@ def test_a_live_mir_model_holds_far_less_than_upstreams_reservation():
per_model_mb = float(done.stdout.strip().splitlines()[-1])
# Measured on macOS arm64: 32.1 MB a model at the default 32, 128.1 at
# upstream's 128 and 0.1 at 0, so a model's other mappings come to about
# 0.1 MB. 40 leaves 8 MB of that for an allocator that maps more, and
# upstream's 128 still fails it by a factor of three.
assert per_model_mb <= 40.0, per_model_mb
# 0.1 MB. The growth is the whole address space's, though, and that holds
# the heap too, about 1.1 MB a live model, which the macos-14 and -15
# runners map in regions of up to 128 MB, 128-512 MB for 300 MB of
# mallocs (#1402). Two taken among 20 models read as 45.65 MB a model
# against a bound of 40. Over 100, 512 MB is 5.1 MB a model, and 64,
# halfway to upstream's 128 by ratio, leaves room for it, while upstream's
# 128 still fails it by a factor of two.
assert per_model_mb <= 64.0, per_model_mb


# ── Issue #1215: running out is a RuntimeError, not the end of the process ───
Expand Down
Loading