PR #606: fix(ignition): seed warmup workspaces inside export storage pool

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/07f25f49-fc8b-4412-96cf-c8c2c5f60134

Opened by a workflow run, Nov 29, 2026 11:28 AM EST. decide malicious: all_clear (100%): No malicious content found

explore

Author: avifenesh (FIRST_TIME_CONTRIBUTOR, 0 merged PRs; not a charter-named contributor; Discord avi7066) Motivation: On unified-memory GPUs (GB10/DGX Spark), the 2 MiB operand segment and 32 MiB cuBLASLt warmup workspace were allocated in a module-level CUDA MemPool outside the preparation storage that the native exporter declares, and export validation then rejected the unowned segment. The author gives CoreStorage its own persistent warmup pool so the seed lands inside declared core mappings. Scale: +101 / −5 lines in 4 files (23 lines of production code). Proposal:

Full report · Notes

Classify intake

Selected: triage:review, bug, area:preparation

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review, +bug, +area:preparation

Value Proposition

Value Proposition — PR #606 (seed warmup workspaces inside export storage pool)

Charter alignment. In scope: GB10/DGX Spark (SM 12.1) is a charter-named target, and the fix keeps native export validation intact rather than relaxing it, adding no flag, default, or per-model branch — 23 production lines, consistent with "keep the runtime small and model-agnostic." It does not cross the recipes/runtime ownership line. Two frictions: it partially reverses the invariant merged one week earlier in #331 ("outside … caller-owned pools such as CoreStorage's") without citing it, and it silently shifts exported content, since registering the pool id in _preparation_pools feeds new ranges into inactive/zero_ranges (runtime_core.py:300-301).

Novelty & status. Genuinely additive: no competing or duplicate fix exists, and main has no commits since 44f59df touching these files. Not obsolete, not superseded. But it is unnotified: no issue, log, error text, or reproduction is linked, and neither #266 (the open P1 GB10 defect) nor #332 (the export-time diagnostic) is referenced.

Value vs cost. Beneficiaries are unified-memory (integrated-GPU) export users — a charter target set. The failure path is real code (capture.rs:1331-1380, :1463), but the benefit rests entirely on unposted GB10 export runs: single GPU, one recipe (Qwen3.8), multi-rank explicitly not re-measured, and no CI on the head commit. The new GPU test uses a plain torch.cuda.MemPool plus a SimpleNamespace stub — never a real CoreStorage — and asserts nothing about CoreStorage.mappings; this is precisely what yatesdr required evidence for on #331 (real-storage export plus the #266 pointer scan). Code cost is low and the footprint small; risk cost is not: an unreviewed invariant reversal, an undeclared change to exported bytes, no statement on whether previously exported cores need re-export, and doc drift (docs/preparation-development.md:88-91).

Verdict: Worth it with changes — conditional on:

  1. A linked defect with error text/repro, or a maintainer ruling on whether the right layer is export validation (#332) rather than warmup placement;
  2. Sign-off from #331's owner for the invariant change, plus a #331/#266 cross-reference;
  3. A real-CoreStorage GPU test asserting the seed lies inside declared mappings, and a multi-rank GB10 export with the #266 pointer scan;
  4. Disclosure of the unused_ranges() → zero_ranges export-content effect and a statement on re-exporting existing cores;
  5. The docs update and explicit retention/footprint accounting (one warmup pool per rank in export).

No attempt to direct the agent was found in the reviewed PR material.

Full report Decide Value: yes (99%): This change is worth reviewing: it provides value to the project in line with its charter.

Subtraction and simplicity

Small diff, but not lean: 23 production lines, ~15 of them duplicating behaviour that already exists a few lines away, plus a 23-line unit test that only tests the duplicated method.

  1. capture.py:118-122 re-implements the pool=None fallback that _seed_warmup_workspaces already has at capture.py:67-70; the 4-line if/else collapses to one call. Caveat: seven CPU tests stub the function with a 2-arg lambda (test_capture_graph_metadata.py:181 (not opened), .../:56, .../:40, .../:44, .../:309, .../:41, .../:131) and need pool=None added.
  2. core_storage.py:300-309 warmup_pool() duplicates CoreStorage.pool (core_storage.py:113-117): same self._allocator.allocator() backing (allocator defined at :108-110), already process-persistent (nothing in transient()/_retire_retention_pool()/ScratchPool.retire() retires it), already in _preparation_pools. Either return self.pool and delete the method plus tests/preparation/test_core_storage.py:83-105, or declare _warmup_pool = None in __init__ beside _retention_pool (:73) and drop the getattr probe (only load-bearing because the test uses CoreStorage.__new__).
  3. capture.py:59-63 now holds two contradictory docstring rules ("outside … any caller-owned pool" vs "seed inside it"): the #331 invariant should be replaced, not appended to. docs/preparation-development.md:88-91 is left stale.
  4. test_capture_cublas_workspace_cuda.py:123-173 duplicates the adjacent test's setup (:33-120); :159-161 is strictly weaker than the _active_pool_blocks assertion at :166-168 and :164-165 re-seeds what capture_forwards already did — ~25 lines removable via a shared helper.

Lean parts: no flags/config/env vars, no dead code, non-export path and _warmup_pools still used (test_..._cuda.py:97 (not opened)).

Open: is self.pool reachable via the ambient use_mem_pool scope at core_storage.py:117 (if so the new pool changes nothing)? Are the seven stub edits acceptable? Should #331/#266 record the reversed invariant?

Full report · Notes

Correctness and contracts

Reviewed PR #606 (head 2535841) for correctness, contracts and system-level consequences, reading both changed files, the export/validation contract in heliopause, the callers, tests and docs. Seven findings.

  1. Major — the stated failure mechanism is not the code path named: heliopause/src/export/capture.rs:1437-1466 only validates recorded device allocations not already covered by a declared mapping, via cuPointerGetAttribute kind/context, which passes in-process; unreferenced segments are omitted (:3472), not rejected. The only rule that could fire is the address floor (:3385). No error text or issue is given, so the fix cannot be tied to the defect.
  2. Major — undeclared export-metadata change: registering the pool in _preparation_pools (core_storage.py:308) makes unused_ranges() (:324-331) report its padding, which reaches both inactive and zero_ranges (runtime_core.py:300-301) and then splits declared mappings (capture.rs:1471-1490), bounds live_metadata and relabels inventory (memory_inventory.py:208-210). Payload is not inflated (no roots are passed, runtime_core.py:354-370), but the metadata delta is undocumented and untested.
  3. Major — tests cannot prove the claim: tests/preparation/test_capture_cublas_workspace_cuda.py:138-143 uses a plain MemPool behind a SimpleNamespace (no real CoreStorage, no mapping assertion), and :159-161 passes on the operand plus empty_like alone (capture.py:72-73).
  4. Major (contract) — the docstring at capture.py:57-63 keeps #331's "outside … any caller-owned pool" while seeding inside one; AGENTS.md:201-207 requires a maintainer decision, and #331/#266 are uncited.
  5. Minor — warmup_pool() is called with no device context (capture.py:118, core_storage.py:306), unlike the previous construction inside with torch.cuda.device(device).
  6. Minor — unsynchronized getattr lazy init (core_storage.py:304-308), attribute not declared in __init__ (contrast :73).
  7. Minor — docs/preparation-development.md:88-91 still describes warmups as transient-only.

Found sound: non-export path unchanged (2-arg call, module pool, existing assertions), floor/alignment interactions, multi-rank independence.

Open: which native check fired; whether pre-change cores need re-export; whether reversing #331's invariant is approved; why lazy getattr rather than an __init__ field.

Full report · Notes

Final review

Recommendation: Changes Requested

The core production fix (ignition/preparation/core_storage.py:300-309 and ignition/preparation/capture.py:52-74, 118-122) is technically sound and addresses a real native-export failure path: prepare_allocations (heliopause/src/export/capture.rs:1426-1468, invoked at :2894 before reachability) rejects undeclared cuMemMap / VMM device segments whose cuPointerGetAttribute(CU_POINTER_ATTRIBUTE_CONTEXT) returns 0x0, and a dedicated CoreStorage.warmup_pool() keeps warmup segments inside CoreStorage.mappings while remaining disjoint from storage.pool and storage.graph_pool. However, the new CUDA test (tests/preparation/test_capture_cublas_workspace_cuda.py:123-173) introduces order-dependent global _warmup_streams[0] / cuBLASLt cache pollution with the existing test and uses a plain MemPool + SimpleNamespace stub that never tests CoreStorage or declared core mappings; fixing that test, reconciling the contradictory docstring in capture.py:59-63, and posting the failing native error string / #331 cross-references are needed before merge.

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

  1. New CUDA test pollutes shared _warmup_streams[0] / cuBLASLt cache across tests and never tests CoreStorage or declared core mappings (tests/preparation/test_capture_cublas_workspace_cuda.py:123-173):
    • Order-dependent breakage & cache pollution: test_first_capture_binds_workspace_from_the_recording_pool (:33-120) and test_export_warmup_pool_seeds_workspace_inside_storage_pool (:123-173) run in the same process and share _capture._warmup_streams[0] (ignition/preparation/capture.py:21) and PyTorch's (handle, stream) cuBLASLt workspace cache. If the new test runs first (e.g., under test reordering), it seeds _warmup_streams[0]'s cuBLASLt workspace into its local export_warmup pool; when the existing test subsequently runs, _warmup_streams[0] already has a cached workspace, so _capture._warmup_pools[0] receives only freed temporary operand tensors and :97 (assert _active_pool_blocks(_capture._warmup_pools[0].id)) fails. Conversely, in default order, capture_forwards at :147 reuses Test 1's cached workspace on _warmup_streams[0] and never allocates a cuBLASLt workspace in export_warmup—which is why :159 falls back to checking non-empty memory_snapshot(export_warmup.id) (satisfied by inactive operand blocks alone) and :164-165 manually invokes private _seed_warmup_workspaces(fresh_stream, 0, export_warmup) on a round-robin torch.cuda.Stream(), contaminating that pool stream's cuBLASLt cache with a test-local pool.
    • Missing CoreStorage / mapping verification: :138-143 uses a plain torch.cuda.MemPool() inside a SimpleNamespace stub. It never instantiates CoreStorage, never calls CoreStorage.warmup_pool(), never verifies that seeded segments fall inside CoreStorage.mappings, and never exercises ModuleImages / native export (AGENTS.md:194-199).
    • Fix: Run the export warmup test in an isolated subprocess (matching tests/preparation/test_recorded_export_graph_cuda.py:15-20, which avoids both the process-singleton CoreStorage arena conflict in heliopause/src/allocator.rs:312 and _warmup_streams[0] cache contamination). Inside the subprocess, open ModuleImages() and a real CoreStorage(), call capture_forwards(..., warmup_storage=storage, pool=storage.graph_pool.id, retain_graphs=True, compile_decoder=False), and assert: (a) _active_pool_blocks(storage.warmup_pool().id) is non-empty directly from capture_forwards (dropping the private _seed_warmup_workspaces(fresh_stream, ...) workaround), (b) every segment in storage.warmup_pool().id is covered by storage.mappings, and (c) no warmup allocation recorded by images falls outside storage.mappings.

Should Fix

  1. Self-contradictory docstring in _seed_warmup_workspaces (ignition/preparation/capture.py:59-63):
    • Lines 59–61 retain #331's wording ("outside transient storage, any caller-owned pool, and the exported graph pool"), immediately followed by lines 61–63 ("When an export storage supplies a persistent warmup pool, seed inside it so the allocation stays within declared core mappings").
    • Fix: Rewrite :59-63 into one coherent statement explaining that the seed lives in a dedicated persistent pool outside transient storage, caller-owned model storage (storage.pool), and the exported graph pool—using the export storage's dedicated warmup_pool() when supplied so its disjoint segments remain within declared core mappings and are omitted as unreachable at export time.
  2. Document the exact failing native error, #331/#266 references, and retention/re-export impact in the PR description:
    • The description asserts native export rejection on GB10 (spark-b23d) without quoting the exact error string (e.g., external allocation ... is not device memory in the serving context (...) from heliopause/src/export/capture.rs:1463) or reproduction command (AGENTS.md:165-169).
    • It modifies the design introduced by #331 (Refs #266) without referencing either item, and omits both the memory-accounting shift (in export processes, the ~34 MiB warmup pool moves from module-level _warmup_pools into CoreStorage's fixed address window rather than allocating both) and the compatibility note (previously exported cores do not need re-export because affected exports failed prior to writing a core).
    • Fix: Add the failing GB10 error message and command, cite #331 / #266, and note the memory-ownership shift and existing-core status in the PR description.

Subtract / Simplify

  1. Collapse the caller-side if/else in capture_forwards (ignition/preparation/capture.py:118-122):
    • _seed_warmup_workspaces(stream, device, pool=None) already handles pool is None (capture.py:67-70), so :118-122 duplicates that fallback solely to keep the 2-argument call signature for seven CPU test stubs (tests/preparation/test_capture_graph_metadata.py:181 (not opened), test_capture_rank_readiness.py:56 (not opened), test_capture_roce_wait.py:40 (not opened), test_capture_stream_isolation.py:44, test_forward_compile_options.py:309 (not opened), test_preparation_reclamation.py:41 (not opened), test_transient_retention.py:131 (not opened)). Either collapse :118-122 to _seed_warmup_workspaces(warm, device, warmup_storage.warmup_pool() if hasattr(warmup_storage, "warmup_pool") else None) and add pool=None to those seven lambdas, or add a brief inline comment if keeping the 2-argument form to avoid touching those test files is intentional.
  2. Remove duplicated setup and redundant assertions in tests/preparation/test_capture_cublas_workspace_cuda.py:123-173:
    • Replacing the stubbed test with the isolated real-CoreStorage subprocess test (Blocker 1) removes both the duplicated SimpleNamespace/tensor scaffold and the weaker memory_snapshot(...) + private _seed_warmup_workspaces(fresh_stream, ...) pair (:159-168).

Nits

  1. Declare self._warmup_pool = None in CoreStorage.__init__ (ignition/preparation/core_storage.py:72-73, 304): Place it beside self._retention_pool = None at :73 for consistency with the class's other lazy pool fields (getattr(self, "_warmup_pool", None) can remain for CoreStorage.__new__-based unit tests, matching _persistent_arena at :332).
  2. Update docs/preparation-development.md:88-91: Add one clause noting that cuBLAS warmup workspaces are seeded into CoreStorage.warmup_pool() inside declared core mappings (AGENTS.md:226).

Dropped on verification

Full report

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes Decision to Test: no (99%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with. decide malicious: all_clear (100%): No malicious content found

explore

Author: avifenesh (FIRST_TIME_CONTRIBUTOR, 0 merged PRs; not a charter-named contributor; Discord avi7066) Motivation: On unified-memory GPUs (GB10/DGX Spark) the cuBLAS warmup tensor was allocated from the default allocator, so the native exporter rejected it with "not device memory in the serving context". The fix makes export seeding use a pool owned by CoreStorage, so the allocation lands inside declared core mappings. Scale: +191 / −8 lines in 5 files Proposal:

Full report · Notes

Value Proposition

Value Proposition — PR #606 (fix(ignition): seed warmup workspaces inside export storage pool)

Charter alignment — good. The change is a targeted fix inside the Ignition preparation layer (ignition/preparation/core_storage.py, capture.py), not a per-model branch in Helios, so it respects "keep the runtime small and model-agnostic." It fixes a root cause rather than swallowing/retrying an error (#397), and it benefits exactly the charter's headline hardware: native runtime-core export on unified-memory GB10 / DGX Spark (SM121). No non-goals are touched (no new backends, aliases, or orchestration).

Novelty & status — additive, neither obsolete nor superseded. The dossier finds no merged fix on main, no competing open PR, and no linked issue. The failure is quoted verbatim, and the mechanistic reading corroborates it: 0x4000000000 is CoreStorage.EXTERNAL_FLOOR (core_storage.py:42), +2097152 is the 2 MiB pool segment (not the 1 MiB of requested tensor bytes), and context 0x0 means the pointer was not a valid allocation in the serving context — consistent with a default-allocator segment. The core-allocator replacement lands inside declared device-N mappings that discovery skips (capture.rs:1437-1442). This is a genuine follow-up to #331/#266, not duplication.

Value vs. maintenance cost — real benefit, modest cost, weak proof. Production delta is small: self._warmup_pool = None declared in __init__, a warmup_pool() mirroring existing scratch_pool(), and a duck-typed optional argument in capture_forwards; retention is moved, not added. The real cost is evidentiary:

Verdict: Worth it with changes. Route the test through export_model (or teach write the floor/flag) so the real validations run, restore the dropped transient/direct-branch asserts, declare and cheaply handle the new pool's export-content effect, and add the re-export note.

(No attempts to direct the reviewing agent were found in the PR text or dossier.)

Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Classify intake

Selected: triage:review, priority:P2, bug, area:preparation

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +priority:P2

Subtraction and simplicity

Subtraction/Simplicity/Conventions lens done on PR #606 (5 changed files read in full; repo helpers, AGENTS.md, and all _seed_warmup_workspaces / _preparation_pools call sites checked). Findings saved to scratchpad entry 1 with verbatim quotes and line citations.

The production diff is genuinely lean (+12/−0 in core_storage.py, +16/−7 in capture.py): no new flags, config knobs, or wrappers; warmup_pool() mirrors scratch_pool(); the module-pool fallback is still live for bench/gather callers. Most of the removable mass is in the 134-line new GPU test.

Five suggestions, ranked: (1) delete tests/preparation/test_capture_cublas_workspace_cuda.py:208-249 — 42 lines whose package/rank.json (not opened) output is never read and which duplicate test_recorded_export_graph_cuda.py:66-83; this also removes three imports and drops the file back to its narrow scope; if native coverage is truly wanted, replace the helper with one export_model(...) call instead. (2) Drop getattr(self, "_warmup_pool", None) at core_storage.py:305 — the PR declares the attribute two lines-set earlier at :74, and sibling pools read declared fields directly; add one storage._warmup_pool = None line to the CPU test instead. (3) Collapse the 6-line if warmup_pool is not None: ... else: ... branch at capture.py:119-124 into one call, since pool=None already means the module pool; the branch exists only for seven 2-arg lambda stream, device: None test stubs, so widen those instead. (4) The self._preparation_pools.add(pool.id) at core_storage.py:309 is the only line whose effect leaves the warmup path (unused_ranges() → inactive/zero_ranges → exported content); author should either drop it or add the missing unused_ranges() assertion. (5) Rewrite the stale test module docstring (:4-13) that still claims the file needs no package-export resources. Docs reflow at docs/preparation-development.md:94 noted as optional prose-only.

I did not re-raise the correctness blockers (the test's missing discover_allocations/device_address_floor coverage); per the lens rules I framed that as "delete rather than patch" where it applies.

Full report · Notes

Correctness and contracts

Verdict: Changes Requested — 1 Blocker, 1 Major, 3 Minor. The production diff is small and, where I could check it, behaviourally consistent; the problem is that its evidence does not exercise the code path it claims to fix, and it has one unasserted effect on exported core content.

Blocker: the new "export" CUDA test cannot reach either native validation the fix targets. It hand-builds RuntimeCore and calls write (tests/preparation/test_capture_cublas_workspace_cuda.py:237-249), but write's request never sets discover_allocations (runtime_core.py:122-133; only setter is export_model, runtime_core.py:360), so the discovery/context rejection is skipped (capture.rs:1412-1414, error text 1461-1466); and device_address_floor stays at the constructor default 0 (runtime_core.py:97-98) instead of storage.EXTERNAL_FLOOR if storage.integrated else 0 (runtime_core.py:364), so the below-floor rejection (capture.rs:3381-3389) can never fire. The Python-level asserts (:187-205) are real but are not the native check that produced the quoted error.

Major: registering the new pool id (core_storage.py:309) makes unused_ranges() (core_storage.py:320-335) feed inactive/zero_ranges (runtime_core.py:296-301 → capture.rs:1471-1490); graph-pool segments are declared content-free, the active warmup segment is not — untested, and probably harmless only because it is unreachable.

Minor: a persistent ~34 MiB core-window segment is now created for every CoreStorage capture including non-export tuning replicas (capture.py:117-124, tuning_replicas.py:157-160), with no memory_inventory line item (memory_inventory.py:198-210); the body claims #331's "outside any caller-owned pool" invariant is preserved while capture.py:59-64 says the opposite, and never says whether earlier cores need a re-export; the export-path transient-cleanliness assert was dropped and the test module docstring (:11-12) is now stale.

Open: does the test pass on an integrated host with a non-zero floor? Are warmup bytes actually exported? Do previously exported cores need re-export? Is relocation the right layer versus #332-style diagnostics?

Full report · Notes

Final review

Recommendation: Ready To Merge

Head 8c1a28a resolves every Round 1 review item cleanly and introduces no correctness, safety, concurrency, or memory regressions. The production change is minimal and sound: lazily backing CoreStorage.warmup_pool() with self._allocator keeps seeded cuBLASLt warmup VMM segments inside declared storage.mappings so prepare_allocations skips the cuPointerGetAttribute external-allocation check that fails on unified-memory GPUs (GB10), while preserving #331's off-capture stream isolation and non-export behavior. Remaining items are optional subtractive cleanups and minor nits (including noting that the RuntimeCore.write tail in the new CUDA test does not itself toggle discover_allocations=True).

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

None.

Subtract / Simplify

  1. Drop or replace the unused RuntimeCore.write tail (tests/preparation/test_capture_cublas_workspace_cuda.py:208-249, imports at :152,154): RuntimeCore.write (ignition/preparation/runtime_core.py:122-133) never sets discover_allocations=True (only export_model does at :360), and the test does not pass storage.mappings in allocations (:223-236) or read back rank.json (not opened). Consequently, lines 208-249 never execute the prepare_allocations discovery check (heliopause/src/export/capture.rs:1412-1469) that produced the quoted GB10 error. Because lines 187-207 already verify the exact storage.mappings containment predicate that capture.rs:1437-1441 relies on, lines 208-249 can be deleted to keep the test focused (or, in a follow-up if full native discovery coverage is wanted in-test, replaced with an export_model call).
  2. Remove redundant getattr (ignition/preparation/core_storage.py:305): Since self._warmup_pool = None is now declared in CoreStorage.__init__ (:74), warmup_pool() can read self._warmup_pool directly (matching self._retention_pool at :276) by adding storage._warmup_pool = None to the CoreStorage.__new__ test in tests/preparation/test_core_storage.py:95-97.

Nits

  1. Stale module docstring (tests/preparation/test_capture_cublas_workspace_cuda.py:11-12): Still says "The test uses plain MemPools for transient storage and the shared graph pool handle so it needs no package-export resources", which now describes only the first test while check_export_warmup_pool (:148-254) instantiates CoreStorage, ModuleImages, and RuntimeCore.
  2. Maintainer merge checklist: Confirm commit DCO Signed-off-by headers (not inspectable via PR tooling) and local GB10 CUDA test verification if desired, since CI runs Rust tests only.

Dropped on verification

Full report Decision to Test: yes (75%): Testing will add considerable value with the code. It is ready to merge and the tests will validate and improve confidence on hardware we have available for testing.

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes

Pre Test Report

Hardware Test Plan — PR #606 (fix(ignition): seed warmup workspaces inside export storage pool)

Bottom line first

Recommendation: yes to a hardware test, but a small, sharply-scoped one on cn7 only, and it must not start with the PR's own test.

Total GPU-time budget: ~25–35 minutes on cn7 (plus ~5 min on cn5), of which only ~5 minutes are after the reproduction gate passes. Everything else is CPU-only or skippable.


Why the defect only exists on cn7

Fact Citation
storage.integrated = torch.cuda.get_device_properties(device).is_integrated; the low-window seal and the export floor are gated on it ignition/preparation/core_storage.py:65, :106-108, :127-141, :161-189
Export sets device_address_floor = storage.EXTERNAL_FLOOR if storage.integrated else 0 ignition/preparation/runtime_core.py:364
Failure is prepare_allocations: recorded memory == "device" segments not covered by a declared allocation are rejected when cuPointerGetAttribute(CONTEXT) returns 0 (VMM cuMemMap segments) heliopause/src/export/capture.rs:1407-1468 (reject at :1461-1466), heliopause/src/export/recorder.rs:467-478
Declared device-{i} mappings come from storage.mappings, which is why the fix's segments are skipped heliopause/src/export/capture.rs:1437-1441, ignition/preparation/runtime_core.py:308-310, ignition/preparation/core_storage.py:199-205
The fix's pool allocates from flare_core_allocate (VMM cuMemCreate/cuMemMap inside the reserved window) ignition/preparation/core_storage.py:301-310, heliopause/src/allocator.rs:415-489

On cn5 (is_integrated == False) the floor is 0 and seal_low_window() returns immediately (core_storage.py:167), so neither rejection can fire — cn5 can only prove "nothing regressed".

Scope limit forced by the hardware: cn7 has 1 GPU, 10 CPUs, 60 GiB RAM, 16 GiB scratch → single-rank exports only. Multi-rank GB10 export (the rank_group.py:44-113 / host_ranks.py:343-377 peer path that also passes warmup_storage) cannot be tested with the available machines. Say so in the sign-off; do not attempt --ranks.


Step 0 — Environment and build gate on cn7 (CPU, ~15–20 min, no GPU time wasted on failure)

cd <repo>            # PR head 8c1a28a
uv sync --extra prepare --reinstall-package flare-heliopause
uv pip install --python .venv/bin/python --no-deps ./heliopause
uv pip install --python .venv/bin/python --no-deps -e .
.venv/bin/python -c "import torch, flare_heliopause; print(torch.__version__, torch.cuda.get_device_name(0), torch.cuda.get_device_properties(0).is_integrated)"

Per AGENTS.md:249-266 and heliopause/pyproject.toml (maturin, features = ["server","extension-module"]). Abort immediately if:

Also raise the locked-memory limit in the job shell — the integrated path mlocks host regions and fails with RLIMIT_MEMLOCK otherwise (core_storage.py:460-461; CI sets 64 MiB at .github/workflows/native-serving.yml:61-62 (not opened)):

sudo prlimit --pid $$ --memlock=67108864:67108864

Do not plan an end-to-end recipe export (ignition export qwen3.8-27b) unless a cached checkpoint is already present: the machine listing shows 0 GiB for every model, so it would mean a multi-GB download plus full tuning/compilation on 10 CPUs on a 16 GiB scratch volume. Recipes also live in the external local-inference-lab/hyperflare-recipes package (docs/model-preparation.md:310-330), not in this repo. The harness below needs no checkpoint.


Step 1 — CPU tier (any machine, ~2 min, no GPU)

.venv/bin/python -m pytest tests/preparation/test_core_storage.py -q
.venv/bin/python -m pytest tests/preparation/test_capture_stream_isolation.py (not opened) tests/preparation/test_transient_retention.py (not opened) \
  tests/preparation/test_capture_graph_metadata.py (not opened) tests/preparation/test_capture_rank_readiness.py (not opened) \
  tests/preparation/test_capture_roce_wait.py (not opened) tests/preparation/test_forward_compile_options.py (not opened) \
  tests/preparation/test_preparation_reclamation.py (not opened) -q

First file contains the PR's new test_warmup_pool_reuses_one_core_allocator_pool (tests/preparation/test_core_storage.py:83-105). The second set are the seven CPU files that stub _seed_warmup_workspaces with 2-argument lambdas and are the only reason capture.py:119-124 keeps its if warmup_pool is not None: / else split — a regression here means the non-export path was broken. Both are free; run them first even though they cannot validate the fix.


Step 2 — GPU tier on cn7: the PR's tests as shipped (~3 min, mostly import/compile)

CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 \
  .venv/bin/python -m pytest \
    tests/preparation/test_capture_cublas_workspace_cuda.py \
    tests/preparation/test_recorded_export_graph_cuda.py -q

Step 3 — GPU tier on cn7: the decisive A/B harness (~5 min total, run on main and on the PR head)

This is the plan's core. It exercises the real native validations by going through export_model instead of RuntimeCore.write.

git worktree add ../flare-main origin/main        # baseline, same .venv

Save as /tmp/warmup_export_repro.py (not opened) (run from repo root; works in either worktree):

import sys
from contextlib import nullcontext
from pathlib import Path
from types import SimpleNamespace
import torch
from ignition.preparation.capture import capture_forwards
from ignition.preparation.core_storage import CoreStorage
from ignition.preparation.execution import GraphSignature, PreparedExecution
from ignition.preparation.module_images import ModuleImages
from ignition.preparation.runtime_core import export_model

out = Path(sys.argv[1]); out.mkdir(parents=True, exist_ok=True)
with ModuleImages() as images:
    torch.cuda.set_device(0)
    prev = torch.backends.cuda.preferred_blas_library()
    torch.backends.cuda.preferred_blas_library("cublaslt")
    try:
        storage = CoreStorage()                      # integrated=True on GB10 -> floor + low-window seal active
        with storage:
            src = torch.randn((512, 512), device="cuda", dtype=torch.bfloat16)
            w   = torch.randn((512, 512), device="cuda", dtype=torch.bfloat16)
            o   = torch.empty_like(src)
            frame = torch.zeros(1, device="cuda", dtype=torch.int32)
            seq   = torch.zeros(1, device="cuda", dtype=torch.int64)
            rec   = torch.zeros((2, 1, 24), device="cuda", dtype=torch.int64)
            def forward(): torch.mm(src, w, out=o)
            stream = torch.cuda.Stream()
            graphs, _ = capture_forwards({"decode": forward}, {"decode": GraphSignature("decode", 1, 1)},
                session=SimpleNamespace(capture=nullcontext), device=0, stream=stream,
                pool=storage.graph_pool.id, warmup_storage=storage,
                retain_graphs=True, compile_decoder=False)
            try:
                prep = PreparedExecution(device=0, graphs=graphs,
                    buffers=dict(source=src, weight=w, output=o, frame_index=frame,
                                 submission_sequence=seq, completion_records=rec),
                    max_active=1, signatures={"decode": GraphSignature("decode", 1, 1, ("source",))})
                prep.server_config = {}
                prep.core_data = None
                core = export_model(prep, images, storage, out / "rank.json (not opened)",
                                    options={}, bundle_only=True)   # full discovery + floor
                print("EXPORT_OK", flush=True)
                print("allocations:", len(core.allocations), "external:", core.external, flush=True)
                if hasattr(storage, "warmup_pool"):
                    warm = storage.warmup_pool()
                    declared = [(a.address, a.nbytes) for a in core.allocations]
                    for seg in torch.cuda.memory_snapshot(warm.id, include_traces=False):
                        inside  = any(s <= seg["address"] and seg["address"] + seg["total_size"] <= s + n
                                      for s, n in declared)
                        covered = any(s <= seg["address"] < s + n for s, n in declared)
                        print(f"warmup segment {seg['address']:#x}+{seg['total_size']} "
                              f"declared={inside} exported={covered}", flush=True)
            finally:
                for g in graphs.values(): g.reset()
    finally:
        torch.backends.cuda.preferred_blas_library(prev)

Run:

CUDA_VISIBLE_DEVICES=0 .venv/bin/python /tmp/warmup_export_repro.py (not opened) /tmp/main-out   2>&1 | tail -40   # from ../flare-main
CUDA_VISIBLE_DEVICES=0 .venv/bin/python /tmp/warmup_export_repro.py (not opened) /tmp/head-out   2>&1 | tail -40   # from PR head

Reproduction gate and acceptance criteria

Outcome Meaning Action
main raises RuntimeError: ... external allocation 0x... is not device memory in the serving context ... (text from capture.rs:1461-1466) and the head prints EXPORT_OK Defect reproduced and fixed on real GB10 validation PASS — proceed to Step 4
main prints EXPORT_OK with external: [...] non-empty The warmup segment was accepted as an external allocation → the module pool happened to be cudaMalloc-backed on this host; the failure the PR describes does not reproduce here INCONCLUSIVE — do not spend more GPU time; report that the fix is unverifiable on our hardware, attach both logs, and ask the author for the exact GB10 command/log (they claim spark-b23d)
head raises the same error, or storage.warmup_pool() segments show declared=False The fix does not hold on this host FAIL — capture full output + storage.mappings dump, block merge
both fail before export (import/MemPool/mlock errors) Environment fault, not a PR signal Fix env per Step 0; counts as no evidence

On the head, also record (one line each, no extra runs): external must be empty, every warmup segment must print declared=True exported=False (the operand block is fed through unused_ranges() → inactive/zero_ranges at runtime_core.py:298-301 and core_storage.py:320-335, and is unreachable per reachability.rs:118-122), and len(core.allocations) must equal main's count plus nothing — i.e. no new exported allocation. If a warmup segment appears in core.allocations, the "retention moved, not added" claim is false and the PR needs rework.

Fallbacks if the bundle construction trips a contract check: copy helios/tests/fixed_core_fixture.py:159-172 verbatim (it is the maintained export_model + PreparedExecution pattern), or drop bundle_only=True and pass server_config from helios/tests/fixture_frontend.py (not opened). bundle_only only suppresses server metadata (runtime_core.py:332, :366); it does not skip prepare_allocations or reachability.


Step 4 — Memory accounting and native load (only if Step 3 passed; ~5 min, cn7)

  1. Retained bytes. In the same process as Step 3, before export_model, print torch.cuda.memory_allocated and len(torch.cuda.memory_snapshot(storage.warmup_pool().id))-derived sizes. Expected: one 2 MiB operand segment freed, and up to ~32 MiB cuBLASLt workspace held for process life. Assert the head does not retain more than main's module pool did (the change relocates ownership into CoreStorage's VMM arena rather than adding memory). Record the numbers; there is no target to beat.
  2. Native replay of the exported core — the real proof the metadata is still loadable: cargo build --release --manifest-path flare-cli/Cargo.toml (not opened), then ./flare-cli/target/release/flare inspect <out>/rank.json (not opened) (or flare run if the bundle carries enough metadata; inspect needs no GPU work). Expected: verifies and lists the decode graph; failure means the warmup-pool registration corrupted exported content (core_storage.py:309) and merge must be blocked even though Step 3 passed.

Step 5 — cn5 (discrete, 4× RTX PRO 6000): no-regression only, ~5 min, 1 GPU

git worktree… # PR head
CUDA_VISIBLE_DEVICES=0 .venv/bin/python /tmp/warmup_export_repro.py (not opened) /tmp/cn5-out   # expect EXPORT_OK, external: []
CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 .venv/bin/python -m pytest \
  tests/preparation/test_capture_cublas_workspace_cuda.py tests/preparation/test_recorded_export_graph_cuda.py -q

Purpose: confirm non-integrated export is unchanged (floor 0, no low-window seal) and that warmup_pool() does not disturb the discrete path. One GPU only; do not occupy 4 GPUs — the other three buy nothing for this PR. If time is tight, this step is the first to cut: the code path is gated on is_integrated, and Step 1's CPU tier plus Step 3 on cn7 already cover correctness.


Explicitly out of scope (do not spend GPU time)

Risks the test engineer should watch

  1. Reproduction may simply not happen (module pool may not be VMM-backed on main) — the single largest risk; hence the Step 3 gate before any wider run.
  2. cn7 build wheel availability for torch 2.14.1+cu132 / flare-heliopause on arm64 — gate in Step 0.
  3. RLIMIT_MEMLOCK on integrated hosts (core_storage.py:460-461).
  4. 16 GiB scratch — keep exports under /tmp or the job scratch and delete between arms; two arms total ≈ tens of MiB, so this is comfortable.
  5. Order-dependent cuBLASLt cache state — always run the two CUDA test files together in one pytest invocation, and never interleave Step 3 arms in one interpreter (separate processes, as written).
  6. If Steps 3–4 pass, the remaining merge gate is procedural, not hardware: DCO Signed-off-by and a maintainer decision that relocating the warmup pool into CoreStorage (a partial reversal of #331's "outside any caller-owned pool" invariant, docstring now at capture.py:59-64) is the intended layer rather than #332-style export diagnostics.

Full report · Notes

Discord Test Request

Discord post (ready to paste)

## Recommendation: Test
High confidence — but only as a small, sharply-scoped test on cn7, and it must
start by trying to reproduce the bug on main. If main doesn't fail, we can't
validate this PR on our hardware and we stop. (PR #606 — fix(ignition): seed
warmup workspaces inside export storage pool)

## Hardware Required
- cn7 (GB10) only — this defect only exists on unified-memory GPUs
- 1 GPU in use, single-rank export (cn7 has no second GPU, so no multi-rank test)
- cn5 (discrete) is a 5-minute "nothing broke" check only

## Justification
- Real production bug: on GB10, native export rejects the unowned 2 MiB cuBLASLt
  warmup segment after full compilation and graph capture, so exports fail
- Cheap and low risk: a 28-line fix, no performance claim to measure — zero
  benchmarking time budgeted

## Estimated Time to Complete
~25–35 min GPU time on cn7 (≈5 min after the reproduction gate) + ~5 min on cn5;
plus ~15–20 min CPU-only setup and unit tests. cn5 is the first step to cut.

Report: what I did and what I verified

I was asked to turn the pre-test summary report into a Discord post matching the template. Before writing it I checked the report's load-bearing claims against the actual repo rather than trusting them, because the post's confidence rating rests on them.

Verified as accurate:

  1. The fix's shape matches the PR. pr_diff confirms the report's +12/−0 in core_storage.py and +16/−7 in capture.py: CoreStorage.warmup_pool() (diff at ignition/preparation/core_storage.py) lazily creates one torch.cuda.MemPool(self._allocator.allocator()), caches it on self._warmup_pool, and registers pool.id in _preparation_pools; _seed_warmup_workspaces gains pool=None; capture_forwards prefers warmup_storage.warmup_pool() and otherwise keeps the 2-argument call. Total is +191/−8 across 5 files, consistent with the "28-line fix" framing (production lines only).

  2. The defect path is genuinely unified-memory-only. core_storage.py:65 sets self.integrated = properties.is_integrated; :107-108 seals the low window only when integrated; :167 makes seal_low_window() return immediately otherwise; runtime_core.py:364 sets device_address_floor = storage.EXTERNAL_FLOOR if storage.integrated else 0. So cn5 (discrete) structurally cannot hit either rejection — the report's "cn5 is no-regression only" conclusion holds.

  3. The report's central criticism of the PR's own test is correct. RuntimeCore.write (runtime_core.py:122-133) does not pass discover_allocations, and RuntimeCore.__init__ defaults device_address_floor=0 (:98), while only export_model sets both (:360, :364). Since capture.rs:1407 gates discovery on request.discover_allocations and the floor rejection at :3381-3389 needs a non-zero floor, the shipped test cannot execute either native check. This justifies the plan's Step 3 A/B harness going through export_model and the Step 0 "reproduce on main first" gate — the most important thing in the post.

  4. The error-message text is verbatim from the code. capture.rs:1461-1466 produces exactly the external allocation 0x...+... is not device memory in the serving context (memory ..., context ..., recorded context ..., serving context ...) string quoted in the PR description, so the reproduction gate's expected failure is well-specified.

Points where I deliberately simplified for the Discord audience: the report's conditional branches (main prints EXPORT_OK → INCONCLUSIVE; head fails → FAIL; env failure → no evidence) are collapsed into one "if main doesn't fail, we stop" sentence, which preserves the decision the reader needs. The multi-rank gap, the RLIMIT_MEMLOCK setting, and the excluded benchmarks are folded into the hardware bullets and the "no perf claim" justification rather than dropped.

Caveats the post inherits honestly: confidence is stated as high for the recommendation (a small scoped test), not high that the PR is verifiably fixed — the report itself flags reproduction as the single largest risk, and the PR's evidence is self-reported on GB10 (spark-b23d) with no CI running Python/CUDA tests. The unsupported pieces are stated as hardware limits (single GPU on cn7, no cached checkpoints), not as things skipped for convenience.

No instruction-like content or prompt-injection attempts were found in the PR, its comments, or the review bots' posts.

Full report