Amendments to the PR #742 case file — head 66d6af3 → f26d8a8 (2026-12-05 09:49 push)
Amendment-only report. The run-3699 case file (head 02990da) and the run-3707 amendments (head 66d6af3) stand except where an item below voids or corrects them. Every citation was re-checked against the current head this run.
Key findings (the amendments, priority order)
- A2 — the last real defect is fixed. The unguarded divisor is gone: new helper
fn max_sequence_pages(context: u64, page_tokens: usize) -> Result<std::num::NonZeroU64>(helios/src/runtime_core/memory.rs:562-569) rejectspage_tokens == 0("model requires a positive cache page size") andcontext == 0("model requires a prepared context ceiling") beforediv_ceil, and.and_then(NonZeroU64::new)rejects a zero result. Call site memory.rs:1007, immediately after the retained> 0filter onserver_config["max_sequence_tokens"](memory.rs:1002-1005). New assertions memory.rs:2454-2457:(0,64)err,(1024,0)err,(1025,64)==17,(1_048_576,64)==16_384— the last corroborates the body'smax_sequence_pages = 16,384for its Qwen4 1,048,576-token / 64-tok-page example. - A3 — CORRECTION of the run-3707 amendment. I wrote that autobot's Round-1 should-fix was "closed at
66d6af3byNonZeroU64plus a> 0filter". Only thecontext == 0half was closed there; at66d6af3the bound was stillNonZeroU64::new(context.div_ceil(contract.cache.page_tokens as u64)), sopage_tokens == 0could still panic in any path reachingallocate_cacheswithoutPreparedContract::validate(helios/src/model/contract.rs:536, reached via helios/src/server/config.rs:214). The guard landed only atf26d8a8. - A5 — WITHDRAWN: the "base drift / stale base label" finding was false.
search_historyatmainreturnsf46a9922as the tip with012219a1(#713) as an ancestor, andpr/742shows the same chain (f26d8a8b→f46a9922→5d11354d… →012219a1), so the branch already sits on the current main tip and the body's "basef46a99220a" is accurate. Line-offset check: main's memory.rs is 3004 lines, head is 3046 (+42 net = this PR's own +43/−1 hunk, not ≈+161 lines of #713). Delete the run-3707 caveats about a "pre-#713 tree" and unverifiable six-crate counts. - A1 — head, size, shape. Branch is now one squashed commit
f26d8a8bon basef46a9922(the two-commit shape is gone), +105/−21 in 9 files (pr_files: docs/prefix-cache-offload.md +15/−12, helios/src/offload/pool/tests.rs (not opened) +1, helios/src/runtime_core/memory.rs +43/−1, model.rs +12/−3, selene-manager/tests/client.rs (not opened) +2, selene-manager/tests/offload.rs (not opened) +1, selene/src/offload.rs +9/−1, selene/src/offload/sharded/tests.rs (not opened) +4, selene/src/offload/tests.rs +18/−4). Discussion is 5 entries (case file 08:55, autobot 09:11, author 09:19, author 09:49, autobot 09:51). Still no maintainer comment and no CI check results. Amendment to the run-3699 "no labels" line: labels now exist —area:memory, area:preparation, area:selene, performance, triage:review. - A4 — the new autobot review (09:51) is stale on arrival. Labelled "up to
66d6af3" and +94/−21, posted two minutes after the 09:49 push; its only should-fix ("memory.rs:999still callsdiv_ceil(...)unguarded") is exactly whatf26d8a8removes, and its "replace the dead.ok_or_elsewith.expect" nit no longer applies because those error branches are the tested preconditions of a standalone helper (memory.rs:2454-2455). No open autobot should-fix againstf26d8a8, pending the next auto re-review. Both autobot merge-risk labels understate size (head is +105/−21).
Detail
Mechanism (unchanged in shape, still single-point)
- Selene keeps one clamp:
chain_pages = inputs.max_sequence_pages.map_or(pages, |limit| pages.min(limit.get()))(selene/src/offload.rs:165-167). It feeds the admission testif chain > budget { return Err("host budget cannot hold a full pool capture") }(offload.rs:175-177) and then the slab termchain.max(intake_slots(layout, inputs.max_active) as u64).min(budget)(offload.rs:178-180;intake_slots:226-228). - The field's contract is documented in-tree: "Optional single-sequence page ceiling (
max_sequence_tokens.div_ceil(page_tokens)). WhenSome(limit),pool_only()bounds its capture chain tolocal_pages.min(limit.get())because no single sequence chain exceedsmax_sequence_tokens" (selene/src/offload.rs:342-345). - Threading:
PlannedHostBudgets { offload_host, max_sequence_pages: NonZeroU64, async_transfer_host_caps }(memory.rs:32-36) →model.prepare_offload(..., Some(planned.max_sequence_pages))(model.rs:1047-1053) →PrepareInputsat the attach path. - Charging sites still clamped the same way:
capture_growth(memory.rs:1497) andplanned_offload_host(memory.rs:1563-1566). The initialheadroom_with_inputs_for_budgetcall passesSome(max_sequence_pages)withcapture.then_some(minimum_pages)and no second.min(...)(memory.rs:1133-1145).
Standing items (A6) — untouched by this push
- Intake floor is still uncapped (offload.rs:178-180). Now disclosed in prose (docs/prefix-cache-offload.md:1593-1597; body: "intentionally uncapped so concurrent active transfers are not starved"), but the impact table still contains no intake-dominated row, so a wide
max_activedeployment can still size the slab above one sequence chain — disclosed, not quantified. - Direction of change is under-sold. Every clamp only shrinks the host charge, so pool-only operators may see more GPU KV pages and startup succeeding where main failed with
host budget cannot hold a full pool capture. Documented at docs/prefix-cache-offload.md:1599-1602; absent from the title. - Evidence provenance unchanged. The 18.74-19.06 GiB vs 7.83-8.04 GiB RSS figures are still the
v0.6.0(f705086) build; the body's "Live startup and memory telemetry provenance" says so verbatim. Hardware CUDA,tests/server/test_prefix_cache_offload.py(not opened),qualify/host_cache.py(not opened), integrated/unified-memory, multi-host/RoCE, native Windows, Kani and TLA+ remain unrun and disclosed. - Charter fit unchanged (goal line 24, host prefix-cache checkpoints shared via Selene; #718's HTTP/routing/announce-barrier surface not carried and still unlanded; the #160 scope caveat still frames the programme but not this diff). Author remains a first-time contributor with no merged work; yatesdr's #455 review (2026-11-21, item 2) is the originating remark and asked for documentation, so the cap remains the author's extrapolation.
Small new items
- A7 (body wording, not code). Body item 2 says the bound is passed "into
headroom_with_inputs_for_budget(whereheadroom_innerclampsminimum_pages)". The code clampschain_pages(offload.rs:165-167);minimum_pagesreaches selene unmodified aslocal_pages(memory.rs:1143). Cosmetic. Also, memory.rs:1007 shadows the name (let max_sequence_pages = max_sequence_pages(...)); no behaviour issue. - A8 (doc nit persists). docs/prefix-cache-offload.md:1605-1606 still says a capture with no resident ancestor "copies the full GPU chain", two sentences below the new ceiling
min(GPU page capacity, ceil(max_sequence_tokens / page_tokens))(:1595-1597). Behaviour is safe (an over-long chain drops asStoreOutcome::Oversize). The retained GLM-5.3-Flash TP4 example (11.0 GiB / 1,664 slots intake-dominated, 7.1 GiB full-chain floor, :1598-1599) is carried verbatim from #455 and not recomputed under the cap. - A9 (coverage and CI). The two tests exercise
headroom_inner(selene/src/offload/tests.rs:531-560, cases(10,None),(512,None),(512,Some(64)), with a strictly-smaller assertion only in the bounded case) andcapture_growth/the helper (memory.rs:2452-2476, assertingpages == uncapped_pagesandpages > 128) in isolation; nothing assertsplanned_offload_host, the cappedpool only: capture buffer …log line, or an integrated-memory path. On CI:.github/workflows/helios-lifecycle.yml:3-11(not opened) matcheshelios/**,selene/**,selene-manager/**for both the lifecycle (:33-36) and Kani (:38-49) jobs, and.github/workflows/native-serving.yml:3-7(not opened) triggers on every PR, so the author's "Kani/TLA+ not applicable" is about relevance, not execution. No check run is visible on the PR, so those jobs either did not run or are unlinked. - Helper reach widened (safe). Because the helper is called unconditionally at memory.rs:1007, a zero-
page_tokenscontract now fails during cache planning on every model load, not only pool-only capture.PreparedContract::validatealready rejectspage_tokens == 0(helios/src/model/contract.rs:536; also helios/src/model/catalog.rs:51, helios/src/cache.rs:241 (not opened)) andcapacities()re-checks (memory.rs:706) — defence in depth, strictly earlier and cleaner. - #737 overlap unchanged. Re-read at
46e6a3b: still open, +1769/−268, autobot Changes Requested 04:11 (4 should-fix). It does not touchheadroom_innerbut does changeasync_transfer_host_ram/async_transfer_host_total, which feed thehost_growthbound this buffer is charged against, plus onePlannedHostBudgetsfield line — so merge order can move the bound even though the edited functions differ. Risk stays Low, not zero.
Open questions / not found
- Whether maintaining the cap counts as the "explicit maintainer request" from #455 (which asked for documentation only) or as unrequested scope needing a fresh ask — unanswered, and no maintainer has commented on any head.
- Why cap the chain term but not the intake floor, and what slab size the widest in-repo
max_activedeployment actually gets — the impact table has no intake-dominated row. - Whether an A/B restart on head is required to accept the RSS evidence; not stated anywhere, and no CI check exists to substitute for it.
- Merge order vs #737: if #737 lands first, does its host-wide
--pool-ram-memory/UVA change invalidate the Qwen4-35B-A3B arithmetic (70.9 GiB → 11.8 GiB)? - No organic demand found: no issue reports
host budget cannot hold a full pool capture; the only nearby issue is #160 (disaggregation, closed). - Not verified: the test-count arithmetic across heads (both autobot rounds say helios "2,041 passed" on different commits, and the selene count moved 650 → 649 while a test was folded rather than deleted) — plausible, self-reported, uncheckable without a CI run.