Case file — PR #742 selene,helios: bound pool-only capture buffer to max_sequence_pages
Author: fakoli (FIRST_TIME_CONTRIBUTOR, Discord fakoli) · open, ready for review · head 02990da on base main @ f46a9922 · 9 files, +115/−10 · 1 commit · no labels, no comments, no reviews, no CI checks.
Key findings
- This is a carve-out of a rejected PR, not a standalone fix. #742 carries only the
pool_only()capture-buffer bound from #718, which the author closed on 2026-12-05 (~08:52) after flare-autobot stopped its review with "It is low value or does not align with the project charter". #718's HTTPX-Flare-Prefill-Onlysurface, scheduler checkpoint anchoring and Seleneannounce_barrierprimitives are not carried and remain unlanded. The author frames #742 as "the charter-aligned #455pool_only()capture-buffer bound" in a same-day reply on closed issue #160. - Scope of the underlying programme is still an open maintainer question. In #160, yatesdr (2026-11-18) ruled prefill/decode disaggregation "outside Flare's design" and required a scope decision from project owner Luke Alonso to reopen. fakoli reopened that request on 2026-12-05 with 1P1D measurements and three options. #742 itself contains no routing/API surface, so it does not expand scope — it is the piece the maintainer's option 3 ("keep upstream selene contributions scoped to pool sizing and shared prefix caching") would allow.
- The defect is real and old, but was dispositioned as documentation the first time. yatesdr's #455 review (2026-11-21, item 2): "Pool-only now reserves host memory, and can now fail to start … it is about the size of the GPU KV cache in registered host memory", and asked to state the size and the failure case — #455 did that in docs only. #742 goes further and changes the runtime behaviour; the cap itself is the author's proposal, not the maintainer's request.
- Undeclared-in-the-headline effects (verified in code). (a) The automatic-intake floor is not capped: the slab is
chain.max(intake_slots(layout, max_active)).min(budget), so with highmax_activethe buffer can still exceed one sequence chain (docs now say this; the PR table does not). (b) The clamps atmemory.rs:1132/:1486can only relax host-driven KV throttling — operators may see more GPU KV pages, and startup succeeding where main failed withhost budget cannot hold a full pool capture. That is a user-visible behaviour change beyond "smaller buffer". - An asymmetry between the two helios call sites.
memory.rs:992-996hard-errors whenmax_sequence_tokensis absent and always passesSome(..);model.rs:1155-1159uses.as_u64().map(..)and would passNone(uncapped) on the attach path. Benign in practice (sameserver_config, helios/src/server/config.rs:131-148 (not opened)) but nowhere stated. - Evidence gaps the PR itself discloses: the 18.7 GiB vs 7.8 GiB RSS comparison was not an A/B on the head commit ("observed on a
v0.6.0(f705086) build carrying this exact patch"), no CI checks exist on02990da, hardware CUDA /tests/server/test_prefix_cache_offload.py(not opened) /qualify/host_cache.py(not opened) / multi-host sharded / native Windows / Kani / TLA+ were not run, and no test exercises the newmodel.rswiring — the two new tests exerciseheadroom_innerandcapture_growthin isolation. - Merge-order risk with open #737 (lukealonso, +1769/−268, opened 2026-12-05 03:33), which rewrites
host_pool_budget_and_total*inselene/src/offload.rsand the host-RAM/UVA accounting in the samememory.rs/model.rs— i.e. it changes what "host budget" means for this very buffer.
The change
Plain terms. In pool-only mode (a single process with --prefix-cache-pool, --prefix-cache-memory 0, no local disk tier → PrefixCacheOffload::pool_only(), selene/src/offload.rs:116-118) Selene registers a CPU-readable capture buffer big enough to export a checkpoint to selene-manager. That buffer was sized to the largest GPU page capacity in the process plus one row, so on a GPU holding several full-context sequences it could be ~the whole GPU KV cache. #742 lets Helios pass ceil(max_sequence_tokens / page_tokens) and caps the chain term there.
File map (verified against the diff).
| File | Δ | Role |
|---|---|---|
selene/src/offload.rs |
+10/−1 | Only enforcement point. max_sequence_pages: Option<u64> on PrepareInputs (:340-347); chain_pages = match { Some(limit) if limit > 0 => pages.min(limit), _ => pages } in headroom_inner (:165-171); field bound as max_sequence_pages: _ in prepare_with_inputs_budget_with_progress (:628) — i.e. it reaches sizing only via effective.headroom_inner(..., local_pages, host_budget) (:703-710), which both sizes the slab bytes (:711-714) and performs the host budget cannot hold a full pool capture check (:176-178). |
selene/src/offload/tests.rs |
+53 | New pool_only_caps_capture_buffer_to_max_sequence_pages (:566-621): two ranks, page_capacity 512, Some(64) → intake_slots(layout,4).max(64+row_slots), headroom (2*STORE_DEVICE_MARGIN_BYTES + capped_bytes.div_ceil(512), capped_bytes); Some(0) and None both give the uncapped 512+row_slots. Plus fixtures (:14, :51). |
helios/src/runtime_core/memory.rs |
+~30/−4 | max_sequence_pages = context.div_ceil(contract.cache.page_tokens) (:996, context from server_config["max_sequence_tokens"], hard error if absent); passed Some(...) (:1130); capture.then_some(minimum_pages.min(max_sequence_pages)) (:1132); capture_growth(layout, pages.min(max_sequence_pages), …) (:1486); planned_offload_host chain bytes .min(max_sequence_pages) (:1552-1555); new test (:2440-2457); fixture (:2031). |
helios/src/runtime_core/model.rs |
+5 | Same value via .as_u64().map(..) (:1155-1159) then passed into prepare_with_inputs_budget_with_progress (:1168). |
helios/src/offload/pool/tests.rs, selene/src/offload/sharded/tests.rs (×4), selene-manager/tests/{client,offload}.rs |
+8 | max_sequence_pages: None fixtures (11 insertion points). Note sharded = multi-host, where capture never applies. |
docs/prefix-cache-offload.md |
+9/−7 | Section 2.15 (:1593-1608), see below. |
Doc before → after (verified in diff): slot count was "the larger of automatic intake and the largest GPU page capacity plus one row's slots, bounded by the host budget"; now "the larger of automatic intake and one full single-sequence capture chain (min(GPU page capacity, ceil(max_sequence_tokens / page_tokens)) plus one row's slots)", and "Helios limits GPU page capacity so one sequence chain plus one row fits the host budget. If even the capped minimum page capacity plus one row does not fit, startup fails with host budget cannot hold a full pool capture." The GLM-5.3-Flash NVFP4 TP4 example (11.0 GiB / 1,664 slots, 7.1 GiB full-chain floor) is retained verbatim from #455.
Description vs diff. The description is unusually accurate: test inventory matches exactly (1 selene test, 1 helios test, 8 fixtures), file list matches, Some(0)/None uncapped semantics are stated. It understates or omits: (i) that Some(0)/None callers keep the old unbounded behaviour — a silent, permanently-uncapped default for any in-repo caller that forgets the field (all 8 fixtures are None, but they are test-only); (ii) that the minimum_pages.min(max_sequence_pages) argument is the local_pages the pool-capture branch treats as GPU page capacity, so it moves both the slab size and the startup-failure threshold, not just "the check"; (iii) the memory.rs vs model.rs Option asymmetry; (iv) the intake floor; (v) the "unchanged GPU pages" claim is one-directional reasoning plus a pages > max_sequence_pages assertion — no equality check anywhere.
The why
- Mechanism:
headroom_inner's capture branch addslayout.row_slots()to the chain page count and reserves that in registered host memory; Helios charges it throughcapture_growthincapacities()(memory.rs:749-760, 1483-1486) and either throttles GPU KV pages or fails admission withhost budget cannot hold a full pool capture(offload.rs:176-178). - Chronology: #455 merged 2026-11-22 (yatesdr) created the buffer and its doc paragraph; its review on 2026-11-21 named the cost. Author measured ~33 GiB capture on an RTX PRO 6000 96 GiB at 1M context (#718 body), and 70.7 GiB vs 11.8 GiB on Qwen4-35B-A3B / 96 GiB SM120 / 24 GiB container (#742 body). So the problem has been visible ~2 weeks.
- Demand signal: none organic. No issue in the repo reports this failure (searches for
host budget cannot hold a full pool capture, "pool only capture", "capture slab oversized" return only PRs #455, #497, #718, #737, #742). The only nearby issue is #160, which is about disaggregation. One author, one prior closed attempt, one maintainer remark. - Why now: host RAM is contested — #711/#721/#737 moved host-budget and host-wide
--pool-ram-memory/UVA accounting into the same functions; a slab sized to whole-GPU KV competes with those pools on the SM120/SM121/DGX-Spark targets the charter names.
Related work
- #718 (closed 2026-12-05, never merged, +1134/−57 / 32 files, same author) — superseded by #742 for the sizing part only. Not carried and now unlanded: helios
X-Flare-Prefill-Onlyheader on all four completion endpoints +docs/api.md(not opened) (+39); schedulerprefill_only,checkpoint_anchor()/checkpoint_key(),pending_prefill_finishes,Finishedreasonprefill; seleneHostStore::announce_gpu,announce_barrier/AnnounceTicket(ANNOUNCE_BARRIER_TIMEOUT=5s), wire-lookup empty-boundary sentinel; selene-manager pool lookup changes. #718's doc edit was about selene-manager--stagingpower-of-two sizes — a different edit from #742's. #718 reported 33 GiB → 9.1 GiB / 8,293 slots on Inkling-2-Mini-FLARE 1M ctx on RTX PRO 6000; #742 reports 11.8 GiB / 16,475 slots on Qwen4-35B-A3B — different model/hardware, same patch, so the two bodies quote non-comparable numbers for what they call the same change. - #455 (merged 2026-11-22, yatesdr) — origin: created
capture.then_some(minimum_pages)and the pool-only branch; #742 edits exactly those lines. Its review is the requirement source. - #497 (merged, PCCessna) — pool-only capture retaining the pre-planned
planned_offload_hostbudget; #742 also editsplanned_offload_host(memory.rs:1550-1556) but only by adding.min(...), so additive. - #737 (open, lukealonso) — same two files, same host-budget concept (
host_pool_budget_and_total_with_reserve,async_transfer_host_ram, peer-UVA accounting). Highest conflict/merge-order risk; it could redefine the budget that bounds this buffer. - #711 / #721 / #727 (merged, lukealonso) — AsyncTransfer, device pools,
planned_host_future/host_future coordination: the plumbing that computes this budget (memory.rs:1266, 1339-1370). #625 (merged) —PrepareTimingsslab_populate/cuda_register, the timings in the PR's quoted log line. #705 (merged 2026-12-05) —Retry(Slabs)CPU storm; a too-tight capture buffer surfaces exactly there (selene/src/memory.rs:857-860,composite.rs:2027 (not opened),2053). #694, #674, #589, #612 — adjacent selene offload/budget work. - Nothing is undone or reverted by #742, and no other PR proposes the same cap.
Recent activity
selene/srclast 60 days: #705 (Joshua Cartu, 2026-12-05), #723 (Luke Alonso, 2026-12-04), #694 and #674 (yatesdr), #625 (autobot a4720050), #646 (Luke Alonso), #612.helios/src: Luke Alonso 249 commits/180d, Martin Vit 52, yatesdr 52.docs/: Luke Alonso 404 commits, Martin Vit 55, yatesdr 52 —docs/prefix-cache-offload.mdis yatesdr/Luke Alonso territory, and the edited section was authored in #455.- #742 is a single commit on
f46a9922(2026-12-04) with no rebase churn. Main has moved since (5d11354d, cfb72093, 6efbd126, be4092d7, 624c6e43) but none touched the exact hunks, so a rebase should be mechanical. #621 (Joshua Cartu) now validates scheduler admission against core parameter declarations, which tightens themax_sequence_tokensvalue the derivation relies on — complementary, not conflicting.
People
- fakoli — first-time contributor: 0 merged, 0 closed, 1 open (#742) in 180 days, plus closed #718 and the #160 reply; no commits on main in
selene/src,helios/srcordocs. Both PRs are theirs; the #455 follow-up idea is theirs. - yatesdr — wrote #455 (the buffer), #497, #674, the pool itself (#92); the origin of the concern; owns
selene/src(38 commits/180d). The natural first reviewer. - Luke Alonso — project owner (named as such by yatesdr in #160); owns
helios/srcand the host-budget/AsyncTransfer work (#711/#721/#727/#737); the person the disaggregation scope decision is addressed to. - No engagement on #742 yet: zero comments, reviews, reactions, labels; no autobot case-file comment (unlike #718 and #737). Age <1 day, so this is expected rather than a signal.
Community
- #160 (JCTaz9, opened 2026-10-31, closed 2026-11-18 by yatesdr): disaggregation ruled outside the design per
docs/core-design.md(not opened):347-348; request routing is "cluster orchestration" reserved for an explicit maintainer decision; reopen only with a benchmark and a scope request to Luke Alonso. - fakoli replied on 2026-12-05 (same day #742 opened) with 1P1D measurements, three options, and the explicit note "I closed #718 and split out the charter-aligned #455 pool_only() capture-buffer bound by itself into …/pull/742." Option 3 ("keep upstream selene contributions scoped to pool sizing and shared prefix caching") describes exactly #742.
- #718's only discussion was two flare-autobot comments, the second stopping review for charter fit. That is the strongest available precedent about how this PR will be triaged.
Project fit
- Lines up: charter line 24 goal ("Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene"); "what gets merged" includes measured memory problems and bad docs; the change is model-agnostic, adds no per-model branches, no flags, no new defaults or CLI/config surface (
PrepareInputsis internal Rust API), and stays single-host by construction — capture requiresself.cluster().is_none()(memory.rs:998) andshard.is_none()(offload.rs:700), consistent with docs/prefix-cache-offload.md:1608 ("With separate rank processes, a pool without a local disk tier only restores"). - Where it does not fully line up: AGENTS.md:165-169 requires an explicit maintainer request / demonstrated defect / measured memory problem. The maintainer's #455 remark asked for documentation, which #455 delivered; the cap is the author's own extrapolation, and there is no issue filing or maintainer request asking for a cap. AGENTS.md:171-175 forbids unapproved scope expansion — not triggered by this diff, but the surrounding programme still awaits the @lukealonso decision requested in #160. AGENTS.md:95-112 (claimed benefit + evidence, "never invent evidence") is respected in that the PR openly discloses the non-A/B provenance and the unrun checks, per docs/design-review.md:153-155.
- No stale doc statements found that #742 leaves contradicting.
Claims and evidence
| Claim | Backing | Gap |
|---|---|---|
Host capture memory ~one max_sequence_tokens chain |
True for the chain term only; chain.max(intake_slots(layout,max_active)).min(budget) (offload.rs:179-181, intake_slots :227-229) is an uncapped floor, as the new doc text says |
Headline table shows no intake-dominated case |
| GPU KV capacity unchanged at 99,008 pages | Clamps in capacities()/planned_offload_host can only relax the host term |
Test asserts only pages > max_sequence_pages; no equality/regression assertion |
| Startup succeeds under a 24 GiB container limit | Consistent with the code path; host budget cannot hold a full pool capture now applies to the capped chain |
No CI, no hardware run on head; container behaviour inferred from the cited log line |
| 18.74–19.06 GiB vs 7.83–8.04 GiB RSS, delta 10.91–11.02 GiB ≈ slab delta 10.9 GiB | Plausible and internally consistent | Not measured A/B on 02990da — PR says it was a v0.6.0 (f705086) build carrying the patch; peer worker differs in slab size only |
| Six-crate release test counts (12 / 650 / 448 / 2041 / 255 / 254) | Stated as run on head in rust:1.94.1-slim-trixie; eos re-run single-threaded after a THP-compaction timing flake (disclosed) |
No CI checks on 02990da; helios run needed FLARE_TEST_TEMPLATE_DIR for 7 model aliases |
Unrun: CUDA hardware, test_prefix_cache_offload.py (not opened), qualify/host_cache.py (not opened), unified-memory, sharded/RoCE, Windows, Kani/TLA+ |
Disclosed; Kani/TLA+ non-applicability argued from the diff (no scheduler/cache_memory or lifecycle changes) |
.github/workflows/helios-lifecycle.yml (not opened) paths include helios/**, selene/**, selene-manager/**, so that workflow should run once CI triggers |
Failure mode if the "one sequence ≤ max_sequence_tokens" assumption ever breaks: not a crash — PooledStore::store returns StoreOutcome::Oversize and the capture is silently dropped (selene/src/memory.rs:4183-4190, bumping store_skipped/dropped[1]); refills go Retry(Slabs) (:857-860). The assumption itself is enforced upstream: helios/src/core/cache.rs:130-131 (not opened), helios/src/model.rs:268 (not opened), request clamping in helios/src/scheduler.rs:1594 (not opened) and policy.rs (not opened).
Reach
- Who: single-process deployments with
--prefix-cache-pool --prefix-cache-memory 0and no disk tier — i.e. compact/workstation and DGX-Spark-style hosts serving long-context cores. With a pool plus any memory or disk tier nothing changes (headroom_inner'sdiskbranch untouched, offload.rs:182-196). - KV capacity direction: strictly relaxing — operators can see a larger
per GPU: … KV pagesnumber, and startup can succeed where main failed. Both are behaviour changes not named in the title. - Observability: the affected path logs
pool only: capture buffer N GiB (… slots, populate …, register …)(offload.rs:450-461); the PR's evidence quote is that line. - Compatibility:
PrepareInputsgains a public field; selene is not published (charter roadmap #6), and all 8 in-repo fixtures + 2 production sites are updated. Out-of-tree constructors without..Default::default()would break at compile time. No dependency, CLI, config or default changes. - Edge case: a runtime
--max-sequence-tokenssmaller than the core's shrinks the buffer proportionally, since the value comes from the prepared ceiling inserver_config.
Process
Open, marked ready for review (not draft), opened and last updated 2026-12-05, one commit, base f46a9922. No labels, no reviewers, no comments, no CI checks on the head commit; no autobot case-file comment yet. Contributed by a first-time contributor responding to a two-week-old maintainer review remark, in the wake of autobot stopping #718 for charter fit — the review culture in this area is itemized and evidence-sensitive (cf. yatesdr's four-item #455 review, #737's Should-Fix list).
Open questions / could not determine
- Will maintainers treat the cap as "the explicit maintainer request" from #455 (which asked for documentation), or as unrequested scope that needs a fresh ask?
- Does the pending disaggregation scope decision on #160 gate #742 in reviewers' minds, even though #742 carries no HTTP/routing surface?
- Merge order vs open #737 — which lands first, and does #737's redefined host budget invalidate the Qwen4-35B-A3B arithmetic in the PR body?
- Why cap the chain term but not the automatic-intake floor? For high
max_activethe buffer can still be large; is that intentional (intake is load-driven) or an incomplete fix? - Why are all 8 fixture call sites
Nonerather than deriving a bound? Nothing in-repo proves a caller other than Helios will passSome. - No maintainer has acknowledged the RSS numbers as valid evidence given they were not re-measured on
02990da. Whether an A/B restart is required was not stated anywhere I could find. - Whether CI is merely pending or was never triggered for
02990da— the orientation packet says "no checks"; I could not see a workflow run.