Contracts, Charter & Verification Gates Audit — PR #742 (selene,helios: bound pool-only capture buffer to max_sequence_pages) @ 5021b7a
Verdict: No contract or verification gate blockers.
All four hard gates pass. None of the hard-gate categories is engaged: no proto/core-format/captured-graph/wire surface, no vendored upstream file, no mandatory Layer 2/Layer 3 formal or GPU gate, and no contested claim. Every load-bearing citation below was read at the PR head this run, not carried over.
Gate 1 — Signed core-format / wire / captured-graph / public-contract boundaries: PASS
- No core-format, wire, enum, or captured-graph change. The diff (
pr_files,pr_diff) is 9 files, +105/−21: one doc paragraph, two Helios startup functions, one Selene internal struct field plus one clamp, and six one-line test fixtures. No.proto, nohelios/src/core/, noFORMAT_VERSION, no reserved identifier, no graph kind or operation family. Principle 1's captured-graph approval clause (docs/design-review.md:22-26) and principle 13's core-compatibility clause (:116-123) are not engaged. The only wire field read is the pre-existingServingContract.max_sequence_tokens = 4(helios/proto/runtime_core.proto:239(not opened)), unchanged, andprotobuf::serving_contract(helios/src/runtime_core/protobuf.rs:75-89) gains no field. - The one API addition is internal and unpublished.
PrepareInputs::max_sequence_pages: Option<NonZeroU64>(selene/src/offload.rs:343-346) sits on a struct in a crate that ispublish = false(selene/Cargo.toml:7), consistent with the charter roadmap (#6, "the crates aren't published yet"). No CLI flag, config key, environment variable, or default changes, so principle 10 (docs/design-review.md:89-92) and the charter's "no magic defaults / no per-model flags" rule are respected.PrepareInputsremainsCopy(offload.rs:332), so the by-value call sites are unaffected. - No per-model branch or policy flag. The bound derives from prepared structural metadata (
max_sequence_tokens,contract.cache.page_tokens), not model identity — principle 3 (docs/design-review.md:47-61) satisfied. Reach is narrow by construction:capture = options.prefix_cache.pool_only() && self.cluster().is_none()(helios/src/runtime_core/memory.rs:1014), withpool_only()and no shard atselene/src/offload.rs:163. - The normative doc that specifies this buffer is updated in place. I read
docs/prefix-cache-offload.md:1593-1609: it now states the ceiling (min(GPU page capacity, ceil(max_sequence_tokens / page_tokens))plus one row's slots), the host-budget bound, and the capped failure conditionhost budget cannot hold a full pool captureat:1601-1602. Adjacent normative statements remain true and are not contradicted:docs/core-design.md:295("Shared CPU/GPU memory is one budget") anddocs/runtime-core-design.md:737-738("deduct the pinned host reservation from prefix-cache capture growth") describe the accounting rule, which this PR does not change — only the size charged into that budget.docs/scheduling-theory.mdhas exactly one match (:551, unrelated captured-graph speed remark);docs/scheduling-runtime-design.md's manycapturematches are all captured graph programs and speculative capture, none about this host buffer;docs/core-format-design.mdreturns no match formax_sequence_tokens,host budget,page capacity, orcapture buffer. There is no stale normative statement left behind. - No hidden validation weakening. The admission error is retained and remains the sole definition repo-wide (
selene/src/offload.rs:177; the string's only other hit is the doc linedocs/prefix-cache-offload.md:1602). Validation is added, not removed:fn max_sequence_pages(context: NonZeroU64, page_tokens: usize) -> Result<NonZeroU64>(helios/src/runtime_core/memory.rs:563-568) rejects a zero page size, andcontextbecomes non-zero by type at:1006-1009(.and_then(NonZeroU64::new)). - Core compatibility preserved (principle 13) — checked, not assumed. The one plausible Gate 1 risk is that the new unconditional checks in
allocate_cachescould reject a core that previously served. They cannot:catalog::validate— reached on every served model viahelios/src/server/config.rs:214— already unconditionally rejectsconfig.limits.max_sequence_tokens == 0andpage_tokens == 0(helios/src/model/catalog.rs:46,51), andPreparedContract::validaterejectsself.cache.page_tokens == 0(helios/src/model/contract.rs:536). The new guards restate existing invariants as defence-in-depth on the same load path (helios/src/runtime_core/memory.rs:897is the soleallocate_cachesdefinition, called only fromhelios/src/runtime_core/model.rs:1038), so no previously-loadable core is newly rejected and no live export/serve or legacy-core replay is triggered.
Gate 2 — Vendored upstream dependencies & cross-PR coupling: PASS
- No vendored upstream file is forked.
helios/native/,selene-manager/docs/, and all vendored C /build.rs(not opened) inputs are untouched. The diff contains noCargo.tomlorCargo.lockchange, so dependencies stay pinned exactly as onmain(charter #215, "pin dependencies to exact versions or commits"). - No unmerged external recipe or PR is depended on. The change is self-contained in-repo; the eight
max_sequence_pages: Nonefixture insertions preserve every existing caller's behaviour (None⇒ uncapped viaoffload.rs:165-168). - Info / Nit — merge order with open #737 (lukealonso):
related_itemsconfirms it shares exactlyhelios/src/runtime_core/memory.rs,helios/src/runtime_core/model.rs,selene/src/offload.rsand extendsPlannedHostBudgets. That is a sequencing hazard, not a fork or a dependency, and no shared line is copied. #743 (open) shares onlydocs/prefix-cache-offload.mdand states no textual conflict. Closed #718 shares all nine files but is closed/unlanded, and none of its HTTPX-Flare-Prefill-Only, scheduler-anchoring, or announce-barrier surface is carried.
Gate 3 — Mandatory verification evidence & failing tests: PASS
- No failing test or failing CI is reported anywhere. The PR conversation (five entries: case-file notice 08:55; autobot reviews 09:11, 09:51, 10:17; author replies 09:19, 09:49, 10:30) contains no red check and no failing-test report, and both autobot rounds state "Blockers: 0". Nothing in the description or Discovery Dossier reports a failure on
5021b7a. - Layer 1 is satisfied and correctly scoped (
docs/design-review.md:180-194). The PR reportscargo test --locked --releaseunderRUSTFLAGS="-D warnings"on head for eos (12), selene--features test-support(649 = 648 unit + 1 doctest), selene-manager--features test-support(448, 1 ignored), helios--features runtime-core,server(2,041, 88 ignored), flare (255), flare-cli (254, 3 ignored). I verified this covers every crate.github/workflows/native-serving.yml(not opened) tests (:47eos,:51-52selene + selene-manager,:63helios,:73flare-cli,:77flare;:81flare-winui/bridge is untouched by sizing arithmetic). The reported totals are internally consistent with the per-crate figures: 12+649+448+2,041+255+254 = 3,659 passed and 1+88+4+3 = 96 ignored, exactly matching the author's summary — evidence the numbers describe one coherent run on this tree.--locked --releaseis used;cargo checkis not substituted.heliopauseis not in that workflow's test list and search forPrepareInputs|prepare_with_inputs|headroom_with_inputs|flare_selene|flare_heliosunderheliopause/returns no matches, so not running it is not a gap. - Layer 2 is not triggered. No graph selection, service pricing, timing estimation, refresh/exploration budget, or cohort algorithm is touched.
- Layer 3 is not triggered (
docs/design-review.md:209-230). Its triggers are admission, fences, generations, cancellation, speculation accounting, cache compaction, snapshot aliases, response buffering/ownership, offload aggregation, readiness, rank coordination. The changed code is startup host/KV sizing only:headroom_inner(selene/src/offload.rs:150-190),allocate_cacheswith itscapture_growth/planned_offload_hostcallbacks (helios/src/runtime_core/memory.rs:1006-1014, 1502, 1568), andprepare_offloadplumbing (helios/src/runtime_core/model.rs:1047-1053, 1125, 1169-1173). Concretely:verification/helios-lifecycle/check.py:22-36declares nine checked protocols (Lifecycle, RankProtocol, DispatchRing, OffloadTransfer, CacheOwnership, Speculation, ResponseLifecycle, CheckpointReservation, AsyncTransfer). Search forruntime_core/memory.rs,runtime_core/model.rs,selene/src/offload.rs,offload.rsacrossverification/returns no matches; the file's onlyoffloadhits are mutation targets atcheck.py:520(helios/src/offload/copy_gate.rs(not opened)) andcheck.py:763(helios/src/offload/transfer.rs(not opened)), plusscheduler/cache_memory.rs(not opened) at:723— none of them this diff. "Offload aggregation" refers tohelios/src/offload/transfer.rs(not opened), untouched.- Kani:
#[cfg(kani)]harnesses exist only athelios/src/async_transfer/mod.rs:11(not opened),helios/src/execution/transport.rs:219(not opened),helios/src/model.rs:14(not opened),helios/src/model/contract.rs:15,helios/src/output/tagged.rs:1214(not opened). Nothing underhelios/src/runtime_core/; no completion-vector validation, prepared completion contract, state-view extent arithmetic, or sequential validator is touched. - No GPU/CUDA/VMM execution path and no core format changes, so no real-execution or legacy-core-replay gate applies (
docs/verification.md:14,32-33). - No new protocol state or geometry bound is added, so
docs/design-review.md:241-246("keep formal bounds aligned") does not apply.
- The memory claim is a live trace with disclosed provenance, not an unattributable stacked speedup (principle 12,
docs/design-review.md:106-115;docs/verification.md:15asks for "the target benchmark or live trace" for memory cost). The author suppliesdocker statscontainer RSS on identicalQwen4-35B-A3Bhardware under a 24 GiB cgroup (18.74–19.06 GiB at--prefix-cache-memory 0vs 7.83–8.04 GiB at1G; delta 10.91–11.02 GiB against a configured slab delta of 10.9 GiB) plus the startup log linepool only: capture buffer 11.8 GiB (16475 slots, …), and states verbatim that these came from av0.6.0(f705086) build running the same sizing rule rather than an A/B restart on head, alongside an explicit "Unrun checks" section (hardware CUDA,tests/server/test_prefix_cache_offload.py(not opened),qualify/host_cache.py(not opened), integrated/unified memory, sharded/RoCE, Windows, Kani, TLA+). This is a startup memory-cost trace, not a served-workload speedup, so theflare runA/B requirement is not the applicable test; the disclosure meetsdesign-review.md:113-114andAGENTS.md:103-112. Critically, the checks thatdesign-review.md:247-251forbids skipping ("disclosure does not excuse skipping runnable CPU checks") are the Layer 1 ones — and those were run. Tightening to an A/B on head is a maintainer judgement call, not a gate failure. - Charter "bring real evidence" / four-part description. All four parts are present in order (why → what exactly changed → claimed benefit → evidence), with bounded and unbounded formulas distinguished in a metric table and the required
Discord: fakoliline (AGENTS.md:142-153, principle 17).
Gate 4 — Material scope / claim contradictions: PASS
Every concrete artifact the description names exists at head and matches:
pool_only_sizes_registered_capture_and_headroom_for_local_rankswith the folded bounded/unbounded cases —selene/src/offload/tests.rs:528-576(loop cases(10,None),(512,None),(512,NonZeroU64::new(64))at:531-535, strict-smaller assertion at:558-560, headroom cross-check usingtest_inputsat:571).pool_capture_growth_caps_at_max_sequence_pages_without_throttling_gpu_pages—helios/src/runtime_core/memory.rs:2456-2491, covering thepage_tokens == 0rejection,1025/64 = 17,1_048_576/64 = 16_384,capture_growth(&layout, 512, reserved, 0, 1) == Nonealongside the cappedSome(0), andpages == uncapped_pageswithpages > max_pages.capture_chain_pages(pages, max_sequence_pages)atmemory.rs:675-678, used at both:1502and:1568— the duplicated inline.minis gone, as claimed.PlannedHostBudgets::max_sequence_pages: NonZeroU64(memory.rs:34), filled at:1603, threadedmodel.rs:1047-1053→ non-optional parameter:1125→PrepareInputs:1169-1173.- Doc rewrite with the GLM-5.3-Flash TP4 11.0 GiB / 1,664 slot / 7.1 GiB example retained — verified by reading
docs/prefix-cache-offload.md:1593-1609. - No unrelated tooling, no bundled standalone scripts, no thousands of stray lines: +105/−21 with every file materially related.
- Scope is not expanded. Capture remains single-host by construction (
memory.rs:1014,selene/src/offload.rs:163). Charter non-goals (disaggregation, cluster orchestration, multi-model hosting/routing, non-NVIDIA backends) are untouched. - Compile consistency of the fixture story checks out: every
PrepareInputsliteral either setsmax_sequence_pagesor uses struct-update syntax from a base that does (selene/src/offload/tests.rs:451, 813, 847, 962, 1155, 1430, 1488;memory.rs:2042,:2081), so the reported green runs are consistent with the tree.
Info / Nit (non-blocking, no action required)
- Description wording, not code. The body says the bound is passed "into
headroom_with_inputs_for_budget(whereheadroom_innerclampsminimum_pages)". The code clampschain_pages(selene/src/offload.rs:165-168);minimum_pagesreaches Selene unmodified aslocal_pages. Cosmetic. - Prose precision next to the new ceiling.
docs/prefix-cache-offload.md:1605-1606still says a capture with no resident ancestor "copies the full GPU chain", two sentences below the new ceiling at:1595-1597, and:1600-1601restates the formula from:1595-1597. Behaviour is safe (an over-long chain drops rather than overrunning the slab) and the paragraph pre-dates this PR. - Merge-order overlap with open #737 in the same three host-budget files — routine rebase coordination, not a dependency.
- Provenance/authorisation are maintainer judgement calls, not gate items. yatesdr's #455 review asked only to document the buffer size and its failure mode; the runtime cap is the author's extrapolation with no issue filing.
AGENTS.md:165-166accepts a contribution addressing "a measured performance or memory problem", which the disclosed live trace supplies, so this lands inside the accepted list. - Security / process: no obfuscation, prompt-injection attempt, external network or secret access, or instruction directed at reviewers appears in the diff or the PR conversation.
Explicitly not flagged (per calibration)
- No CI check run is observable to my tools, but the PR claims no failure and reports
--locked --releaseruns covering every cratenative-serving.ymltests — absence of observable check runs is not a finding. - Hardware CUDA,
tests/server/test_prefix_cache_offload.py(not opened),qualify/host_cache.py(not opened), unified-memory, sharded/RoCE, Windows, Kani, and TLA+ runs are disclosed as unrun; none is a mandatory gate for startup-only sizing arithmetic that touches no protocol state, no core format, and no GPU execution path. - No
docs/TODO.txtbookkeeping ask; the PR-description phrasing nuance stays atInfo / Nit. - The deliberately uncapped automatic-intake floor (
selene/src/offload.rs:178-181) and the conservative prepared-context bound (memory.rs:1006versus the runtimehelio/src/model.rs(not opened)fit_contextceiling) are design/sizing matters for the correctness and value lenses — disclosed in both the body and the doc — out of scope for this governance gate.
Conclusion: the diff satisfies every hard contract boundary, is vendored/pinned clean, carries the Layer 1 verification the testing hierarchy mandates for a startup-only sizing change with no Layer 2 or Layer 3 trigger and an honestly disclosed memory trace, and contains no material scope or claim contradiction. No contract or verification gate blockers.