Code review summary scratchpad · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/8c3b7b1a-6842-4e12-9de0-ebd8b7c8831d.md

#1 [high] PR #533 state, diff shape, and what is verified clean

PR #533 "Cap the per-request context target", author roobyz, head 1a006c6, +35/−15, 7 files, no reviews, no CI. Supersedes closed #454 (CHANGES_REQUESTED by yatesdr, 2026-11-23). Discord line present ("Discord: rzr2020"), so no Discord finding.

Load-bearing change: ignition/preparation/bootstrap.py:58 "context": plan.prepared_context (was plan.recipe.context) in common_preparation_kwargs (bootstrap.py:47-65) — the single funnel to BasePreparationConfig.context (bootstrap.py:33). Everything else (+34 lines) is plumbing to that datum.

Verified: cap reaches the core — helios/src/server/config.rs:131 reads max_sequence_tokens as prepared_sequence_tokens, :148 sets limits.max_sequence_tokens, enforced at helios/src/server/request.rs:350 and scheduler.rs:2289/:2358. Verified no-op when unset: planning.py:369-373 returns recipe.context; Plan.context untouched (planning.py:363-366). Other paths that do thread the flag: serve.py:289 (_prepare), serve.py:472 (debug_serve), bench.py:177; derive() at ignition/cli/preparation.py:56,68 → planning.plan(..., context=) :591,674 → fit(..., context=) :453 → Plan(context_target=context) :535. Plan is a frozen dataclass, context_target default None (planning.py:176) so all existing constructions still work. Positive-target check: planning.py:459-460 inside fit. Chunk check: planning.py:692-701 with effective_context = min(result.context, result.prepared_context). Reproduction/manifest paths with no cap: rebuild_manifest.py:231-318 (reproduction_arguments), :343-395 (from_plan), planning.py:389-442 (to_dict, "context" at :430). No test anywhere: grep of tests/ for request_context|prepared_context|context_target → no matches. Flag registration + help: ignition/cli/init.py:167-170, group "capacity and compression" (shared by export/bench/debug-serve). Docs: docs/cli-design.md:446 new row; also rewords :1443 and :1493.

#2 [high] Blocker 1: --request-context silently dropped on multi-host export

ignition/cli/serve.py:193-206 — _export_hosts calls planning.plan(...) with mixed_prefill/prompt_logprobs/expert_scale_compression/online_mxfp8/mla_compute_mode/row_shard_prefill and no context=; the last keyword is row_shard_prefill=args.row_shard_prefill (:206). Reached from export() at serve.py:153-156 when args.ranks > 1. Because plan() defaults context=None (planning.py:591), context_target stays None, prepared_context returns recipe.context (:371-372), so the core is prepared at the recipe maximum with no warning. Violates charter "Don't silently ignore API fields … Never accept it and quietly drop it (#417)"; multi-host export is a supported shape (AGENTS.md:157-163) and is where the pool is largest. Fix: add context=args.request_context to the call. Test that would pin it: a planning-level assertion that a 1-host and 2-host plan of the same recipe produce the same prepared_context, or a check that common_preparation_kwargs(plan)["context"] honours the flag.

#3 [high] Blockers 2-5: page alignment, unreported setting, bench check, conditional VRAM claim

BLOCKER 2 — the cap is never required to be page-aligned, so an exported core can fail to load. Producer: ignition/planning.py:369-373 min(recipe.context, context_target, tokens), consumed at bootstrap.py:58 → BasePreparationConfig.context → the core's server config max_sequence_tokens (helios/src/server/config.rs:131 prepared_sequence_tokens, :148 limits.max_sequence_tokens). Helios rejects a core unless BOTH values are exact multiples of the page size: helios/src/model/catalog.rs:50-57 (is_multiple_of(page_tokens.max(1)), is_multiple_of(page_tokens)), error at :70 "invalid prepared model configuration". Also model.rs:268 fit_context. Only validation today: positivity at planning.py:459-460, and the chunk check at :694-700. Nothing in ignition/ checks a multiple-of-page rule (grep for "% page_tokens"/is_multiple → only the prefill-chunk multiple-of-64 check at :621-623). Consequence: ignition export MODEL --request-context 200000 with a 128-token page = 1562.5 pages → prepare/tune/export succeed, flare run dies with "invalid prepared model configuration" naming neither the flag nor the page size. Fix (smallest, one home): validate/floor in Plan.__post_init__ (planning.py:212-289, where plan-field invariants already live) against self.page_tokens — either reject with the nearest lower multiple, or floor the way guaranteed_tokens floors (planning.py:378). This also absorbs the <=0 check at :459-460, so the two checks become one and cannot be bypassed by a direct Plan construction. Caveat: pages are 0 before fit's replace (:541), so validate context_target % self.page_tokens, not prepared_context % ....

BLOCKER 3 — the cap is absent from the plan report and the rebuild manifest.

BLOCKER 4 — benchmark validation still measures against the uncapped context. planning.py:248 if selection.required_context > self.context: — self.context is untouched by this PR (planning.py:363-366), so with a cap set the check compares the workload with a context larger than the core serves, and the real failure lands in ignition/bench/runner.py:388 ("benchmark case exceeds prepared capacities") after the whole GPU preparation, tuning and graph capture. Fix: compare self.prepared_context (works there because bench sets benchmark_selection via replace at bench.py:178, after pages exist), and mention the cap in the message; alternatively reject the flag in bench like --mixed-prefill (bench.py:115-116).

BLOCKER 5 — the claimed VRAM benefit is stated unconditionally in the description and docs/cli-design.md:446, but the mechanism and the measurement are the runtime --kv-cache-limit. page_ceiling (helios/src/runtime_core/memory.rs:284-331): KvCacheLimit::Memory returns Ok(None) — no ceiling; context gives one history, concurrency one history per active request. Default is memory (docs/cli-design.md:738, :828). The author's own table was produced with --kv-cache-limit concurrency. The pool in memory mode is filled from free memory and only bounded by the prepared virtual extent (memory.rs:403, :435 pages.iter().map(|s| s.maximum)), whose page maximum comes from recipe code outside this repo (AGENTS.md:379-381), so the unconditional claim cannot be verified from this tree. Fix: state the condition in the docs row and the description, or add one default-mode measurement row. AGENTS.md:134-137 forbids publishing a claim whose material limitations must be guessed.

#4 [high] Should fix, Nits, and open questions

SHOULD FIX S1 — justification argues from a charter non-goal. docs/cli-design.md:446 says "buys concurrency headroom in a memory-constrained multi-model deployment"; description says "leave no room for a second model" / "the headroom a co-run needs". AGENTS.md:171-175 lists multi-model hosting/routing as requiring an explicit maintainer decision; none is cited. Fix: give the single-model rationale (a lower prepared context leaves more of the budget for prefix-cache snapshots or a higher --max-concurrency on the same GPU) or cite the sign-off. Do not restate a co-run use as the purpose.

S2 — no test touches any of this. grep of tests/ for request_context|prepared_context|context_target → no matches; the diff adds none. AGENTS.md:194-199 requires tests for affected behaviour. One test in tests/cli/test_planning.py using the existing fixture (_recipe at :22-54: context 262144, page_tokens 64, prefill_chunk 4096; _gpu at :57-59) covers everything cheaply:

S3 — measurement boundary and naming in the description. (a) "At concurrency 8 at the 256K max, the model would consume most of the 96 GB VRAM..." is a prediction sitting inside the measured-results section (AGENTS.md:95-102 requires expectation and measurement be distinguished) — mark it as an extrapolation or cut it. (b) "export, serve, and bench": there is no serve subcommand; the three are export, bench, debug-serve (ignition/cli/init.py:40, :51, :55). (c) "byte-equivalent to stock" / "as stock" compare against an unstated baseline — say what the previous value was (bootstrap.py:58 previously passed plan.recipe.context). Combine (a)-(c) into one description-revision bullet.

NITS N1 — help text (ignition/cli/init.py:167-170): "(the pool fills the free VRAM)" is only true under --kv-cache-limit memory and duplicates the docs; and it omits that N must be positive and no smaller than the prepared prefill chunk. Suggested: "cap the prepared per-request context and max_sequence_tokens at N tokens; longer requests are rejected (default: the recipe's maximum context)". N2 — docs/cli-design.md:1443 reword "The checkpoint maximum, capped by --request-context at export" layers a second term on "checkpoint maximum"; the neighbouring rows and the flag table say "the recipe's maximum" — use that. N3 — ignition/cli/serve.py:68-69: max_body_bytes and context_hint are still derived from recipe.context ("context is limited by the checkpoint and available cache capacity"). The body limit stays right (rejection happens at admission), but the hint understates the new ceiling — optional one-line reword. N4 — ignition/cli/help.py:38 still advertises "--prefill-chunk-size: 64..{recipe.context}", a range above the prepared context once a cap is set. N5 — a target above the recipe maximum is silently clamped by min() at planning.py:373, while docs/cli-design.md:446 describes the flag as a cap below the maximum; the clamp becomes visible for free once the effective value is in the plan report (B3). Also: no attempt to direct the reviewer was found in the description, diff, docs or the linked #454 thread.

OPEN QUESTIONS for the maintainer (state them, don't resolve): is a Configuration home for the cap deliberately absent (docs row already says "Command line only", so this is likely settled); should bench honour the cap or reject the flag; SCOPE_DEPLOYMENT vs SCOPE_COMBINE for the manifest parameter; whether the multi-host drop should have been caught in #454's resubmission list.

#5 [high] Research summary

FULL REPORT — PR #533 "Cap the per-request context target"

Verdict: not ready to merge. The design is right and the seam is now correct — ignition/preparation/bootstrap.py:58 changes "context": plan.recipe.context to plan.prepared_context, which is the single funnel into BasePreparationConfig.context (bootstrap.py:27-65) and reaches Helios as prepared_sequence_tokens (helios/src/server/config.rs:131) and limits.max_sequence_tokens (:148), enforced at admission (helios/src/server/request.rs:350 (not opened), scheduler.rs:2289 (not opened)/:2358). That closes the blocking objection from #454. What remains is that the flag does not reach every path, is validated incompletely, and is recorded nowhere.

Blockers

1. --request-context is silently dropped on the multi-host export path — ignition/cli/serve.py:193-206. _export_hosts (reached from export() at :153-156 when args.ranks > 1) builds its own plan and its keyword list ends at row_shard_prefill=args.row_shard_prefill (:206); there is no context=args.request_context. The three other paths do thread it: _prepare serve.py:289, debug_serve serve.py:472, bench.run bench.py:177. Because plan() defaults context=None (planning.py:591) and prepared_context returns recipe.context when unset (planning.py:371-372), ignition export MODEL --ranks 2 --request-context 131072 parses, prints a plan, and prepares at the recipe maximum with no warning. Why: multi-host export is a supported shape (AGENTS.md:157-163) and the case where the pool hurts most; and silently accepting then dropping a flag is the one behaviour the charter names explicitly ("Don't silently ignore API fields … Never accept it and quietly drop it (#417)"). Change: add context=args.request_context to the planning.plan(...) call at serve.py:206 — one keyword.

2. The cap need not be page-aligned, so the exported core can fail to load — ignition/planning.py:369-373. prepared_context is min(recipe.context, context_target, tokens) with no alignment requirement. The only validations are positivity (:459-460) and the prefill-chunk check (:694-700). Helios rejects a core unless both the prepared length and limits.max_sequence_tokens are exact multiples of the page size (helios/src/model/catalog.rs:50-57, error at :70 "invalid prepared model configuration"). With a 128-token page, --request-context 200000 is 1562.5 pages: preparation, tuning and export all succeed, then flare run fails with an error that names neither the flag nor the page size. Why: stock is safe only because recipe.context is a declared page multiple; a user value is the first unaligned input on this path. Every alignment check lives after export. Change (smallest home): validate in Plan.__post_init__ (planning.py:212-289), where plan-field invariants already live — reject with the nearest lower multiple, or floor the way guaranteed_tokens floors (:378). Validate context_target % self.page_tokens (pages are still 0 before fit's replace at :541). This also absorbs the <= 0 check at :459-460 into the invariant that every Plan must satisfy, so a direct construction cannot bypass it.

3. The cap is absent from the plan report and the rebuild manifest — ignition/planning.py:389-442, ignition/preparation/rebuild_manifest.py:231-318 and :343-395. Plan.to_dict publishes "context": self.context, "checkpoint_context": self.recipe.context (:430) and no key for the target; because Plan.context is deliberately stock, a core exported with --request-context 131072 prints context: 262144 — the printed plan misreports what was prepared. That dict is printed at serve.py:215, serve.py:485 and bench.py:182, and bench republishes a hand-picked subset as details["configuration"]["preparation"] (bench.py:243-248). reproduction_arguments emits --max-concurrency (:257), --prefill-chunk-size (:263), --row-shard-prefill (:306) and never --request-context, so flare inspect prints an export command that rebuilds the uncapped core; from_plan records a SCOPE_DEPLOYMENT parameter for every sibling option (prefill_chunk :387, max_concurrency :380, row_shard_prefill :392) and none for the cap, so two cores differing only in prepared context are indistinguishable. Why: AGENTS.md:452-456 requires a new preparation setting to be "carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared". The core's own catalog is right, but the artifact that is supposed to describe and reproduce it is not. Change: add "prepared_context" (and the requested "context_target" when set) to to_dict; in reproduction_arguments add if plan.context_target is not None: args.extend(['--request-context', str(plan.context_target)]); in from_plan add add('request_context', SCOPE_DEPLOYMENT, plan.context_target) — add() already skips None (:348-350), so uncapped packages stay byte-compatible.

4. The headline VRAM claim is stated unconditionally; the measurement and the sizing both depend on a runtime flag it never names — description and docs/cli-design.md:446. The shipped docs row says shortening the context "buys concurrency headroom in a memory-constrained multi-model deployment, since the per-request cache allocation is sized from the prepared context", and the description reads "capping … shrinks the KV pool and frees VRAM". The pool ceiling that the cap controls comes from page_ceiling (helios/src/runtime_core/memory.rs:284-331), which returns Ok(None) — no ceiling — under the default KvCacheLimit::Memory; only context (one history) and concurrency (one per active request) apply it (docs/cli-design.md:738, :828-833). The table was produced with --kv-cache-limit concurrency, and the author's evidence line says so, but neither artifact states the condition. Under memory the pool is bounded by available memory and by the prepared virtual extent (memory.rs:403, :435), whose page maximum is set by recipe code living outside this repository (AGENTS.md:379-381), so the unconditional claim cannot be verified from this tree. Why: AGENTS.md:134-137 forbids publishing a claim whose material limitations must be guessed, and this one ships in main's docs. Change: state the condition in the docs row and the description ("with --kv-cache-limit context or concurrency; the default memory sizes the pool from free memory"), or add one memory-mode row to the table.

Should Fix

5. Benchmark validates against the uncapped context — ignition/planning.py:248. if selection.required_context > self.context still compares against min(recipe.context, tokens) (:363-366), which this PR deliberately leaves stock, so with a cap set a --contexts selection can exceed what the prepared core serves and pass planning; the failure then lands in ignition/bench/runner.py:388 (not opened) ("benchmark case exceeds prepared capacities") after the whole GPU preparation, tuning and graph capture. The PR already handles the analogous case for the chunk (:694-700), so this reads as an oversight. Change: compare self.prepared_context (one word; works there because bench attaches benchmark_selection via replace at bench.py:178, after pages exist) and name the cap in the message. Smaller than the alternative of rejecting the flag in bench.Settings.from_args the way --mixed-prefill is rejected (bench.py:115-116).

6. Nothing in the tree tests any of this — tests/ has no match for request_context, prepared_context, context_target. Given finding 1 (a forwarding bug) and finding 2 (an unvalidated input), AGENTS.md:194-199's requirement is not met. One test in tests/cli/test_planning.py using the existing fixture (_recipe :22-54 — context 262144, page_tokens 64, prefill_chunk 4096; _gpu :57-59) covers it: unset target → prepared_context == recipe.context; target 65536 → 65536; target above the pool → tokens; context=0 → UsageError; a non-page-multiple target → the new rejection; common_preparation_kwargs(plan, …)["context"] == prepared_context (the one line that carries the cap); and the to_dict/manifest/reproduction-arg assertions modelled on the existing row_shard_prefill loop at :92-106. Add one assertion that the multi-host path forwards the target.

7. Prose boundary and naming in the description (one bullet, mechanical): (a) "At concurrency 8 at the 256K max, the model would consume most of the 96 GB VRAM…" is a prediction inside the measured-results section — mark it an extrapolation or cut it (AGENTS.md:95-102); (b) there is no serve subcommand — the three are export, bench, debug-serve (ignition/cli/init.py:40, :51, :55); (c) "byte-equivalent to stock" and "as stock" compare against an unstated baseline — say that preparation previously passed plan.recipe.context (bootstrap.py:58).

8. The stated justification argues from a charter non-goal — description ("leave no room for a second model", "the headroom a co-run needs") and docs/cli-design.md:446 ("multi-model deployment"). AGENTS.md:171-175 makes multi-model hosting/routing require an explicit maintainer decision; none is cited. The flag itself is a preparation capacity and is in scope. Change: give the single-model rationale (a lower prepared context leaves more of the fixed budget for prefix-cache snapshots or a higher --max-concurrency on the same GPU), or cite the sign-off.

Subtract / Simplify

Could remove ~7 of +35 added lines, and roughly half of the new docs row, without losing behaviour:

  1. Collapse prepared_context onto context (planning.py:368-373, −2 lines). min(recipe.context, target, tokens) is exactly min(self.context, target); the five-line body becomes return self.recipe.context if self.context_target is None else min(self.context, self.context_target).
  2. Delete the dead min (planning.py:694, −1 line). effective_context = min(result.context, result.prepared_context) can never select context — prepared_context ≤ context always, in both branches. Use result.prepared_context in both arms and the reader no longer has to prove an invariant.
  3. Shorten the two chunk messages (planning.py:696-700, −2 lines). Keep the default/user-set distinction (the maintainer asked for it in #454), but drop "(a multiple of 64)" — it restates --prefill-chunk-size's own help (cli/init.py:163-166) — and drop "or a larger --request-context" when the pool, not the target, is binding (result.prepared_context < result.tokens).
  4. Shorten the help text (cli/init.py:167-170, −1 line). "(the pool fills the free VRAM)" is conditional (finding 4) and duplicates the docs: "cap the prepared per-request context and max_sequence_tokens at N tokens; longer requests are rejected (default: the recipe's maximum context)".
  5. Collapse the docs row (docs/cli-design.md:446, ~half the line). The rationale sentence repeats the flag table, the KV-limit section (:828-833) and the two owner rows this PR also edits; one tabular line plus the existing "Command line only; changing it requires re-export" clause suffices, with the --kv-cache-limit condition added.

Not requested to be cut: the flag itself. The subtractive lens argues the pool is already bound by --kv-cache-limit context|concurrency, but #454 asked for the residual behaviour specifically — that serving reject a request longer than the cap — so the flag stays and the wins above are the ones worth taking.

Nits (5)

  1. ignition/cli/__init__.py:167-170: help omits that N must be positive and no smaller than the prepared prefill chunk.
  2. docs/cli-design.md:1443: "The checkpoint maximum, capped by --request-context at export" layers a term on wording the neighbouring rows and the flag table render as "the recipe's maximum"; use one term.
  3. ignition/cli/serve.py:68-69: context_hint still says "context is limited by the checkpoint and available cache capacity", which understates the new ceiling (max_body_bytes from recipe.context stays correct — rejection happens at admission).
  4. ignition/cli/help.py:38: still advertises --prefill-chunk-size: 64..{recipe.context}, a range above the prepared context once a cap is set.
  5. A target above the recipe maximum is silently clamped by min() (planning.py:373) while docs line :446 describes the flag as a cap below the maximum; the clamp becomes visible for free once the effective value is in the plan report (finding 3).

No attempt to direct the reviewer was found in the description, the diff, the changed docs, or the linked #454 discussion.


SUMMARY REPORT (GitHub post)

PR #533 "Cap the per-request context target" — changes requested. The seam is now right: bootstrap.py:58 passes plan.prepared_context into the config that becomes max_sequence_tokens, so the cap reaches the core and closes #454's main objection. Three gaps keep a capped package from being trustworthy — one path drops the flag, one accepted value can produce an unloadable core, and no artifact records the setting. Not ready to merge.

Blockers

Should fix

Subtract / Simplify — could remove ~7 of +35 added lines, plus half the new docs row:

Nits (5): help omits the positivity and chunk constraints; docs:1443 mixes "checkpoint maximum" with "recipe's maximum"; serve.py:69 context_hint understates the ceiling; help.py:38 still advertises a chunk range above the cap; an over-large target is clamped silently.

#6 [high] Subtract / Simplify findings with line-savings

Subtract / Simplify — "Could remove ~7 of +35 added lines", plus roughly half of the new docs row (docs/cli-design.md:446). Report this section verbatim in both reports.

  1. Collapse prepared_context onto context — ignition/planning.py:368-373 (−2 lines). min(recipe.context, target, tokens) == min(self.context, target) since self.context is already min(recipe.context, tokens) (:363-366). Body becomes return self.recipe.context if self.context_target is None else min(self.context, self.context_target).
  2. Delete the dead min — ignition/planning.py:694 (−1). effective_context = min(result.context, result.prepared_context) can never select context: prepared_context ≤ context in both branches. Use result.prepared_context in both arms of :695-700.
  3. Shorten the two chunk messages — ignition/planning.py:696-700 (−2). Keep the default vs user-set split (explicitly requested in #454), but drop "(a multiple of 64)" (restates --prefill-chunk-size help at cli/init.py:163-166) and drop "or a larger --request-context" when the pool binds (result.prepared_context < result.tokens).
  4. Shorten the help text — ignition/cli/init.py:167-170 (−1). "(the pool fills the free VRAM)" is conditional (see blocker 4) and duplicates the docs. Suggested: "cap the prepared per-request context and max_sequence_tokens at N tokens; longer requests are rejected (default: the recipe's maximum context)".
  5. Collapse the docs row — docs/cli-design.md:446 (~half the line). The rationale sentence repeats the flag table, the KV-limit section (:828-833) and the two owner rows this PR also edits (:1443, :1493). One tabular line plus the existing "Command line only; changing it requires re-export" clause, with the --kv-cache-limit condition added.

Do NOT ask for the flag to be deleted: the subtractive lens argues --kv-cache-limit context|concurrency already bounds the pool (docs/cli-design.md:738, :828-833; memory.rs:284-331), but #454's maintainer asked for the residual behaviour — serving must reject a request longer than the cap. Keep the flag; take the line savings above. Also do not ask for expansion of anything on this list.

#9 [high] Adjudications: which lens findings I overruled (do not re-raise)

Head de1b5b5, 9 files +98/−18, no CI checks.

REJECTED 1 — Subtractive's "drop the flag, --kv-cache-limit already does it". --kv-cache-limit (helios/src/runtime_core/memory.rs:284-331, default memory = docs/cli-design.md:738, :828) sizes loaded KV at serve time; it cannot lower the exported max_sequence_tokens (helios/src/server/config.rs:131,147-148 from BasePreparationConfig.context, ignition/preparation/bootstrap.py:33,58). #454 asked for exactly the residual behaviour. Flag stays; subtract only the scaffolding listed in the Subtract section.

REJECTED 2 — Conventions #3 / Simplicity #1 / Subtractive #4: "collapse prepared_context to min(self.context, target) and delete effective_context = min(result.context, result.prepared_context) (planning.py:696)". FALSE: with context_target is None, prepared_context returns recipe.context (planning.py:373-374) which EXCEEDS pool-bound context = min(recipe.context, tokens) (:365-368) when pages are short. Folding to self.context would lower the declared max_sequence_tokens on a pool-constrained host with no flag → breaks the PR's headline no-op claim, and the PR's own test (tests/cli/test_planning.py:220 prepared_context == recipe.context) asserts the current semantic. So the min at :696 is load-bearing for the no-target case, and the property body must keep its early return. Both stay; do not ask for them.

REJECTED 3 — Subtractive #6: remove derive(context=...) (ignition/cli/preparation.py:56,68). derive is the single funnel all four entry points use (serve.py:206, :289, :472; bench.py:177); removing the keyword removes the capability. Conventions verified it matches the row_shard_prefill/online_mxfp8_scope threading style. Keep.

REJECTED 4 — Architecture's "drop the self.tokens term from prepared_context". Correctness verified the pool clamp as correct, and dropping it would make the new early bench check (planning.py:248) accept workloads the pool cannot serve. Keep the clamp; instead make it visible by reporting prepared_context (blocker-fix / should-fix S1) and by correcting the description's false "as stock" sentence.

ALREADY FIXED at this head, not re-raised: multi-host _export_hosts forwards the flag (serve.py:206); page-multiple validation exists (planning.py:289-290); to_dict/reproduction_arguments/from_plan record context_target (planning.py:432, rebuild_manifest.py:264-265, :390); bench compares against prepared_context (planning.py:248); description no longer argues multi-model co-run; docs row names --kv-cache-limit concurrency.

#10 [high] Report of 2026-11-26 run 2 — full report PR #533 (blockers, should fix, subtract, nits)

FULL REPORT — PR #533 "Cap the per-request context target" (head de1b5b5, base main, 9 files +98/−18, no CI checks, supersedes closed #454)

Verdict: Changes Requested. Design and seam are right: bootstrap.py:58 passes plan.prepared_context → BasePreparationConfig.context (bootstrap.py:33) → Helios prepared_sequence_tokens (helios/src/server/config.rs:131,147-148) → limits.max_sequence_tokens, bounded at load (helios/src/model.rs:268-272) and validated (helios/src/model/catalog.rs:43-70). Omission path is a true no-op (planning.py:373-374). What is left: the added test cannot pass, one validation checks the wrong quantity, and the cap is missing from the three surfaces the plan otherwise reports.

Blockers

B1. tests/cli/test_planning.py:229-232 cannot pass. planning.plan(..., context=500000) dies in the PR's own check planning.py:289-290: fixture page_tokens=64 (test:38; RankCosts at :43 leaves page_tokens None so Plan.page_tokens = recipe.page_tokens, planning.py:329-332) and 500000 % 64 == 32. __post_init__ runs via Plan(...) in fit (planning.py:528-537). No CI on the head, so it was never executed. Fix: see B2 (validating the resolved value makes this case pass as written and turns it into the proof of the documented clamp); else use 524288. B2. Validation targets the requested value, not the served one — planning.py:289-290. The core receives prepared_context = min(recipe.context, target, tokens) (:371-375), so a target above the recipe max resolves to an aligned value yet is rejected (500000 → 262144 is fine; 262145 is refused). Contradicts docs/cli-design.md:446 ("below the recipe's maximum", default "the recipe's maximum context") and the description's "a cap above the pool resolves to the pool capacity". Fix (1 expression): validate min(self.recipe.context, self.context_target) % self.page_tokens. 100 still rejected (100 % 64 = 36), so the existing match="multiple of the" case keeps working.

Should Fix

S1. The cap is absent from the plan's printed line and recorded measurements — AGENTS.md:452-456. Plan.to_dict (planning.py:432) has context_target but not prepared_context, so with a cap set the pool clamp is silent and context (pool-bound) reads as the served ceiling. Serve's "Select GPUs" f-string (serve.py:302-316) enumerates every sibling preparation choice (row-shard-prefill at :316) and omits this one. Bench's details["configuration"]["preparation"] whitelist (bench.py:243-248, 17 keys) omits both, so two runs at different caps record identical configurations. Fix: "prepared_context": self.prepared_context in to_dict; · request context {plan.prepared_context:,} guarded in the f-string; add "context_target", "prepared_context" to the bench tuple. Three one-liners following adjacency precedent; also makes the pool clamp visible, which is what Architecture's "silent under-delivery" asked for. S2. Description evidence: (a) the headline VRAM claim is unconditional but the pool only tracks the prepared context under --kv-cache-limit context|concurrency (memory.rs:290-302 returns no ceiling under memory, the default per docs:738, :828); the author's own commands use it and docs:446 says so — the description must too. (b) "a cap above the pool resolves to the pool capacity, as stock" is false: stock passed recipe.context unclipped (bootstrap.py:58 before this PR), so a cap above the pool can prepare a LOWER max_sequence_tokens than no flag; that is a material compatibility change (AGENTS.md:92-94, :103-109). S3. Description structure/mechanics (one bullet in the summary): the four required questions are out of order (AGENTS.md:74-80, docs/design-review.md:140-150) — evidence leads, the "why" appears only as a Workload line; "Verified … at main c36a6a02" reads as if capped numbers came from main (the flag exists only on this branch); "thirteen recipes" is an unverifiable count (recipes are external, AGENTS.md:9-13); there is no serve subcommand.

Subtract / Simplify

Could remove ~17 of the +98 added lines (≈9 of the +57 test hunk, ≈8 of the +41 code/docs), plus about half of the new docs row:

  1. Test duplicates: context=0 and context=-1 hit one branch (test:235-238, −2); assert d["context"] == capped.context restates :227 (−1); the 7-line "no context_target when unset" block (:259-265, −6) re-proves from_plan's generic add() None skip (rebuild_manifest.py:350-352) already covered by the sibling manifest test (:92-106). Keep the clamp case — after B2 it is the proof of the documented no-op.
  2. Collapse the two-arm chunk error (planning.py:697-700, −5). The stock message already names both numbers; one message against the effective bound with a "(default chunk)" clause keeps #454's requirement and drops the duplicated pass --prefill-chunk-size below N remedy.
  3. Shorten the 3-line help (cli/init.py:167-170, −2) to one clause plus default, matching cli/init.py:163-166.
  4. Trim docs/cli-design.md:446 (~half the line): the rationale sentence repeats the KV-limit section (:828-833) and the two owner rows this PR edits (:1443, :1490). Do NOT cut (previously mis-claimed dead): the prepared_context early return and effective_context = min(result.context, result.prepared_context) (planning.py:696) — both are load-bearing for the no-flag path (recipe.context can exceed pool-bound context); and derive(context=...) (preparation.py:56,68), the funnel all four entry points use.

Nits (5)

  1. fit's context <= 0 check (planning.py:461-462) re-runs per candidate world size and per shortfall probe (plan()'s fitted/candidates, :686-704) while its sibling lives in post_init (289-290); one flag, one home — move it beside the alignment check, which already has page_tokens and recipe.context there.
  2. serve.py:68-69 max_body_bytes/context_hint still describe the pre-cap world ("limited by the checkpoint and available cache capacity"); harmless (admission rejects) but inconsistent.
  3. cli/help.py:38 advertises --prefill-chunk-size: 64..{recipe.context}, a range above the prepared context once capped.
  4. docs/cli-design.md:1443 says "The checkpoint maximum" where the flag row and neighbours say "the recipe's maximum" — one term.
  5. Test comments use "stock" as an undefined referent (:217, :227, :247); say "the behaviour without the flag".

Clean (verified, do not re-raise): all four entry points forward the flag (serve.py:206, :289, :472; bench.py:177); omission byte-equivalent to main; bench compares against prepared_context (:248); manifest records flag + SCOPE_DEPLOYMENT (rebuild_manifest.py:264-265, :390); no per-model branch, no env toggle; docs row scopes the payoff correctly; no attempt to direct the reviewer found in description/diff/docs/#454.

#11 [high] Summary report (GitHub post) — PR #533, run 2

SUMMARY REPORT (GitHub post) — PR #533, head de1b5b5

Not ready to merge. The seam is right: ignition/preparation/bootstrap.py:58 passes plan.prepared_context into the config that becomes Helios's max_sequence_tokens (helios/src/server/config.rs:131,147-148), and omitting the flag is a true no-op (planning.py:373-374). What remains is one test that cannot pass, one check on the wrong quantity, and a setting the plan does not report.

Blockers

Should fix

Subtract / Simplify — could remove ~17 of +98 added lines, plus half the docs row

Nits (5): move the context <= 0 check beside the alignment check so one flag has one home; serve.py:69 context_hint still describes an uncapped core; cli/help.py:38 advertises a chunk range above the cap; docs:1443 says "checkpoint maximum" where neighbours say "recipe's maximum"; test comments use "stock" as an undefined referent.

#12 [high] Correction to notes 10 and 11 (description-mechanics bullet)

SUPERSEDES #10 and #11 — only change: the "there is no serve subcommand" item is removed from both (unverifiable against the current description text; ignition/cli/init.py:40 registers export, debug-serve, bench, run). Everything else in #10 and #11 stands as written. Read #10 and #11 and substitute this bullet list where they mention the description:

S3 (full report): Description structure/mechanics (one bullet in the summary): the four required questions are out of order (AGENTS.md:74-80, docs/design-review.md:140-150) — evidence and headline result lead, the "why" arrives only as a Workload line; "Verified … at main c36a6a02" reads as if the capped numbers were measured on main, though the flag exists only on this branch (AGENTS.md:103-106); "thirteen recipes" is a count a reviewer cannot check, since recipes live in the external repository (AGENTS.md:9-13).

Summary bullet: Description mechanics (one bullet): the four required questions are out of order (evidence leads, the why arrives last as a Workload line — AGENTS.md:74-80); "at main c36a6a02" reads as if the capped numbers were measured on main; "thirteen recipes" is uncheckable.

All other bullets, citations, ordering and the "do not cut" list are unchanged from #10 (full report) and #11 (summary).

#13 [high] Research summary

Reviewed all five lens outputs against the code at head de1b5b5 and prepared both reports: the full report is scratchpad note #10, the GitHub-post summary is note #11, and note #12 is a small correction that replaces the description-mechanics bullet in both (I dropped the "no serve subcommand" item because I could not verify it against the current description text; the registered subcommands are export, debug-serve, bench, run at ignition/cli/__init__.py:40).

Verdict: Changes Requested (not ready to merge). The seam is correct and the omission path is a true no-op, so the flag stays. Two blockers: the PR's own new test cannot pass (context=500000 with a 64-token page is rejected by the PR's own check at planning.py:289-290; no CI ran on the head), and that check validates the requested value rather than the served one, contradicting the docs and the "cap above the pool resolves to the pool capacity" claim — both are fixed by validating min(recipe.context, context_target) % page_tokens, which also makes the 500000 case pass as written. Should-fix items cover the cap being absent from to_dict/the serve plan line/the bench record (AGENTS.md:452-456), and two incorrect evidence claims (the VRAM result is conditional on a non-default --kv-cache-limit; "as stock" is false because stock passed the recipe maximum unclipped). Subtraction removes ~17 of the +98 added lines plus half the docs row, and keeps its own section in both reports.

Four cross-lens claims I overruled after checking the code, recorded in note #9 so they are not re-raised: (1) do not drop the flag as a duplicate of --kv-cache-limit — the runtime flag cannot lower the exported max_sequence_tokens, which is exactly what #454 asked for; (2) the prepared_context early return and effective_context = min(result.context, result.prepared_context) are not dead — with no target, prepared_context returns recipe.context, which exceeds pool-bound context on a short-pool host, and the PR's own test asserts that semantic, so collapsing it would break the headline no-op claim; (3) derive(context=...) is the funnel all four entry points use and cannot be removed; (4) do not drop the self.tokens clamp — keep it and make it visible in the plan report instead.

#14 [high] Verification ledger: what I confirmed in code vs what is inferred

Head de1b5b5 (PR #533), base main c36a6a02. No CI checks on the head. pytest was NOT executed in any round — every behavioural claim below is from reading code, and is either arithmetic over constants or a schema lookup.

CONFIRMED BY DIRECT READ (safe to state plainly):

UNVERIFIED / must stay qualified in the report:

#17 [high] Run 3 verdict: head 02023eba regressed the derive() funnel and lost the alignment check

Head reviewed: 02023eba (base f377dc85). PR #533, 9 files, +84/-18 (docs/cli-design.md +3/-2, cli/init.py +2, cli/bench.py +3/-1, cli/preparation.py +1/-1, cli/serve.py +5/-4, planning.py +19/-9, preparation/bootstrap.py +1/-1, preparation/rebuild_manifest.py +3, tests/cli/test_planning.py +47). No CI checks on head.

Delta vs previous review at de1b5b5 (important: do NOT re-raise fixed items):

B1 (blocker): cli/preparation.py:45-56 signature ends row_shard_prefill: bool = False, row_shard_attention: bool = False, force_moe_decode_a16: bool | None = None — no context; line 69 row_shard_attention=row_shard_attention, context=context). No module-level context exists (search on the file: only :69 and prose at :125-131). Callers with context=args.request_context: serve.py:207 (_export_hosts), :291 (_prepare), :476 (debug_serve), bench.py:177 → TypeError unexpected keyword. Callers without it (tests/cli/test_commands.py:88 derive call, :114 row-shard-attention test) → NameError. Every preparation entry point is dead, flag or no flag. Fix: add context: int | None = None to the signature before force_moe_decode_a16.

B2 (blocker): no page-alignment validation exists. Plan.post_init (planning.py:224-296) validates row-shard/hyperconnections/MXFP8/bench but not context_target; fit() only checks context <= 0 (planning.py:467-468). Test asserts it: tests/cli/test_planning.py:238-240 pytest.raises(UsageError, match="multiple of the") with context=100. Actual outcome: no alignment error; chunk 4096 > effective 100 → UsageError "--prefill-chunk-size 4,096 exceeds the 100-token context this plan allows" (planning.py:709-711) → pytest fails with DID NOT MATCH. Load-time consequence: Helios rejects non-page-multiple prepared_sequence_tokens / max_sequence_tokens ("invalid prepared model configuration", helios/src/model/catalog.rs:50-57); reachable with --request-context 1000 --prefill-chunk-size 64 (1000 % 64 = 40, chunk fits), so export succeeds and flare run fails. Fix: validate min(recipe.context, context_target) % page_tokens (Plan.page_tokens at planning.py:335-338 is world-size dependent) and keep the "multiple of the" wording.

B3 (blocker): tests/cli/test_planning.py:254 .value.int64_value → AttributeError; proto declares bool/int/uint/float/string/list_value only (helios/proto/runtime_core.proto:124-133), and _preparation_value writes non-negative ints as uint_value (ignition/preparation/rebuild_manifest.py:329-333). Fix: uint_value.

#18 [high] Run 3 report: full report text (PR #533 @ 02023eba)

Full report — PR #533 "Cap the per-request context target" (head 02023eba, base main, 9 files, +84/−18, no CI checks)

Key findings: the shape is right (one optional frozen Plan field planning.py:186, one accessor :377-381, one keyword through fit/plan, one consumer line preparation/bootstrap.py:58, one flag in the shared "capacity and compression" group cli/init.py:167-168); omission is a true no-op; the reporting gaps from the last round are fixed. Three defects stop it: the derive() funnel no longer accepts the keyword (B1), the advertised page-multiple validation is absent while the test asserts it (B2), and the new test reads a proto field that does not exist (B3). Nothing was executed; pytest tests/cli/test_planning.py tests/cli/test_commands.py settles all three.

Blockers B1 — derive() lost its context parameter. cli/preparation.py:45-56 vs :69. TypeError at all four CLI call sites (serve.py:207/291/476, bench.py:177); NameError for tests/cli/test_commands.py:88 and :114. Fix: add context: int | None = None. Cover it with one line in the existing test_derive_forwards_row_shard_prefill (pass context=131072, assert plan.context_target == 131072) — that line would have caught this twice-returning regression; no new test needed. B2 — page-multiple validation absent. See note 1. Fix: validate min(recipe.context, context_target) % self.page_tokens with a "multiple of the" message; page_tokens is world-size dependent (planning.py:335-338). B3 — .value.int64_value does not exist; use uint_value (proto :124-133, rebuild_manifest.py:329-333).

Should Fix S1 — prepared_context bakes export-host free memory: return min(self.recipe.context, self.context_target, self.tokens) (planning.py:381), where tokens = pages*page_tokens from free_bytes (planning.py:360-369, 550-556 for pages). The same recorded flags (--request-context N) then reproduce a different core on a host with different free VRAM, and reproduction_args record only N (rebuild_manifest.py:264-265). It is also redundant: Helios applies exactly this clamp at serve time (helios/src/model.rs:268-272 fit_context). Fix (deletes a term): return min(self.recipe.context, self.context_target) (None arm unchanged), which also makes the description's "a cap above the pool is a no-op, matching stock" true by construction and keeps the chunk check's min at :709 load-bearing. Consequences to update: test_planning.py:226 → min(recipe.context, 131072); :232 → recipe.context; and the docs/description stop needing the "can prepare lower than stock" caveat. S2 — description evidence: (a) the VRAM table holds only under --kv-cache-limit context|concurrency; page_ceiling returns Ok(None) for the default memory mode (helios/src/runtime_core/memory.rs:290-292; default docs/cli-design.md:738), and the author's own command line says so — attach the condition to the headline/Result, not just the command. (b) "a cap above the pool is a no-op, matching stock" is false at this head: stock passed recipe.context unclipped (bootstrap.py:58 before this PR) whereas the capped path returns min(recipe.context, target, tokens) → strictly lower max_sequence_tokens; either fix per S1 or state the compatibility change. (c) state the workload --kv-cache-limit/--max-concurrency cannot serve (a single request longer than N is now rejected at admission before it loads pages) — that is what #454 asked for. S3 — two stale bounds still describe the pre-cap world: serve.py:68 max_body_bytes from recipe.context and :69 context_hint "limited by the checkpoint and available cache capacity" (a body sized for the checkpoint max is accepted by HTTP then rejected at admission); cli/help.py:38 advertises --prefill-chunk-size: 64..{recipe.context}, an upper bound preparation rejects once capped (planning.py:709-711). Use prepared_context (serve) and say the range follows the prepared context (help). S4 — description mechanics (single bullet): the four questions are out of order (measurements lead, the "why" arrives last as a Workload line — AGENTS.md:74-80); "Verified … at main c36a6a02" reads as if the capped numbers were measured on main though the flag exists only here; "the thirteen recipes' prepare() read context=plan.prepared_context" names an uncheckable external count and misplaces the seam (bootstrap.py:58); docs/cli-design.md is missing from the changed-file list; and the description still advertises "a page-multiple validation" and a two-arm chunk error that the head does not have (reconcile after B2; the head has one message, planning.py:711).

Subtract / Simplify — could remove ~10 of the +84 added lines (~7 in the test hunk, ~3 in docs), plus half the new docs row

  1. tests/cli/test_planning.py: assert capped.context == min(recipe.context, capped.tokens) (:227) restates :221; d["context_target"] == 131072 (:242-244) restates :225; the 4-line proto round-trip (:250-253) re-proves from_plan's generic value/scope plumbing already covered by the sibling manifest test (:92-106) — keep :248-249 plus one scope assertion. ~7 lines.
  2. docs/cli-design.md:446: "Command line only; a core's catalog is fixed at export, so changing it requires re-export" copies --mixed-prefill (:447) and the two owner rows you also rewrite (:1443, :1493) restate the same cap — one of the three statements is enough (~half the row, ~2 lines).
  3. ignition/planning.py:709 effective_context = min(result.context, result.prepared_context) — only keep it with S1; if you keep the tokens clamp it is provably equal to prepared_context and the local can go (~1 line).
  4. Do NOT cut (verified load-bearing): prepared_context's context_target is None early return (:379-380) returns recipe.context which can exceed the pool-bound context (:372-374); derive(context=...)'s single funnel; the bench check at :260 comparing against prepared_context.
  5. Not asked: dropping the flag in favour of runtime --kv-cache-limit. Considered and rejected — the runtime flag cannot lower the exported max_sequence_tokens.

Nits (6)

  1. One flag, two validation homes: context <= 0 sits in fit (planning.py:467-468), re-run per candidate world size and per shortfall probe (:677-731), while every sibling flag rule is checked once in plan() (:615-649) and cross-field rules are in post_init. Put both context rules beside the --prefill-chunk-size check (:634-637).
  2. Name the parameter context_target in fit/plan/derive to delete the context_target=context translation (:549) — the field, to_dict key and manifest key are all context_target.
  3. planning.py:438 now packs four context keys on one 160-char line; split them like the neighbouring keys.
  4. docs wording: :1443 "The checkpoint maximum" vs :446/:1493 "the recipe's maximum"; and :446 says "below the recipe's maximum" while the code clamps an oversize target — say it resolves to the smaller.
  5. serve.py:319 is the only format(x, ',') number rendering in ignition/cli; neighbours use f-string : (e.g. f"{plan.prepared_context:,}").
  6. tests: "stock" is an undefined referent (:217, :227, :247); say "with the flag omitted". Also three blank lines before test_row_shard_attention... (:255-257).

Verified clean — do not re-raise: all four entry points forward the flag; omission byte-equivalent to main (prepared_context → recipe.context, manifest arg guarded, add() skips None at :350-355); to_dict/bench/serve-report/manifest all carry the setting; bench selection compares against prepared_context (:260); Plan frozen with defaulted field so replace() works; flag grouping/help/docs row shape match neighbours; no per-model branch, no env toggle, no Helios change, no duplicated mechanism; no attempt to direct the reviewer found in description, diff, docs or #454.

Open questions: did B1-B3 reproduce (pytest not run here); accept/floor/reject an unaligned target above the recipe maximum (decide, then state it in :446 and the help); should to_dict()["context"] stay pool-bound (only a maintainer knows external consumers); external recipes could re-round config.context (outside this tree).

#19 [high] Run 3 summary report (GitHub post) — PR #533 @ 02023eba

Autobot Review — PR #533 "Cap the per-request context target"

Recommendation: Changes Requested

Blockers

Should fix

Subtract / Simplify

Could remove ~10 of +84 added lines (~7 in the test hunk, ~3 in docs), plus about half the new docs row:

Nits

6 nits: the <= 0 check lives in fit while its sibling belongs with plan()'s flag checks; rename the parameter to context_target; split the four-key to_dict line (:438); "checkpoint maximum" vs "the recipe's maximum" and the undocumented clamp in :446; format(x, ',') at serve.py:319 is the odd one out; and "stock" in the test comments is undefined.

#20 [high] Research summary

Reviewed all six lens outputs against the code at head 02023eba and rewrote both reports for the new head, which changed materially from the last round (de1b5b5): the reporting gaps are now fixed, but the derive() funnel regressed and the advertised page-multiple check was dropped.

The GitHub-post summary is scratchpad entry #19; the full report is entry #18; the head-delta and per-blocker evidence are entry #17.

Verified against the code at this head:

Subtraction is preserved as its own section: ~10 of the +84 added lines plus about half the new docs row, with the three load-bearing items (prepared_context's early return, derive(context=...), the bench check) explicitly marked do-not-cut. Blockers are limited to correctness; the mechanical prose items are a single Should-fix bullet. Nothing was executed here and the head has no CI; pytest tests/cli/test_planning.py tests/cli/test_commands.py settles all three blockers.

#21 [high] Run 3 adjudications: lens claims dropped, kept, or rewritten (head 02023eba)

Reconciliation decisions for the run-3 report (notes 18/19), so the report never carries two contradictory asks:

#24 [high] Run 4 verification at head 9118add: what is fixed and what persists

Head 9118add, base main, 6 files +69/−5 (docs/cli-design.md +2/−1; cli/serve.py +2/−2; parameters.py +13/−0; planning.py +14/−1; preparation/bootstrap.py +1/−1; tests/cli/test_planning.py +37/−0). No CI checks. Nothing executed.

FIXED since 02023eba (do NOT re-raise):

VERIFIED BLOCKERS at this head: B1 clamp unreachable: context_target declares max_fn=_recipe_context_limit (parameters.py:1316; helper :1268-1269 returns context.recipe.context) + min_value=1. validate_fields max branch parameters.py:533-545 raises "--request-context for X must be 1 through 262,144". plan() validates at planning.py:540 before sizing; Plan.post_init validates again at :185. So target=500000 raises; tests/cli/test_planning.py:310-313 asserts it succeeds and clamps -> fails (also 500000 % 64 = 32 trips :187). docs/cli-design.md:468 ("resolves to the smaller of N and the recipe maximum"), accessor docstring (planning.py:359), and the PR description ("min(recipe.context, N)") all describe unreachable behaviour. Dead min at planning.py:363. B2 flag never in reproduction_args: RecipeParameters.reproduction_args (parameters.py:1469-1528) hand-emits only --max-concurrency (:1483) and --prefill-chunk-size (:1484), then skips every base field via base_field_names = {f.name for f in fields(RecipeParameters)} (:1491-1494). context_target is a base field (:1309) so it is skipped; repro_always=True (:1319) is dead metadata. tests/cli/test_planning.py:324-325 ("--request-context" in manifest["reproduction_args"]) fails. grep confirms no other emitter in ignition/. B3 chunk-vs-cap: planning.py:594-596 compares params.prefill_chunk > result.context (min(recipe.context, tokens)), not prepared_context; parameters.py:1458-1462 bounds the chunk only by recipe.context. So --request-context 2048 --prefill-chunk-size 4096 passes all export checks, bootstrap.py:132 writes context=2048 as max_sequence_tokens, and Helios rejects at load: helios/src/scheduler.rs:66-73 "prefill_chunk_size must be divisible by 64 and within 64..=context". Bench check at planning.py:212 already uses prepared_context, so :594 is the inconsistent sibling.

SHOULD FIX (verified):

SUBTRACTION (estimate ~14 of +69):

NITS: alignment check placed in post_init (re-runs per candidate in fit's loop; siblings' rules are in plan()); docs:468 duplicate clause; help text says "page token count" and never states the range; to_dict emits context + checkpoint_context (:395-396, checkpoint_context has no reader anywhere — delete it rather than add prepared_context); demand_pages still uses recipe.context (:321); unused monkeypatch arg in the new test (:295) although from_plan calls source_identity (rebuild_manifest.py:290,327 -> RuntimeError without FlashInfer, source_identity.py:36-41) and sibling tests patch it (:159, :223, :333).

No reviewer-directed instruction found in description, diff, docs, or discussion.

#25 [high] Run 4 adjudications: which lens claims I kept, merged, or dropped

Head 9118add. Decisions applied to notes #20 (new verification note) when writing the run-4 reports:

KEPT, verified in code: Architecture B1/B2, Conventions B1/B2, Simplicity B1, Correctness B1/B2, Prose B1/B2, Subtractive findings 2-5, Architecture S1-S4 (S4 = evidence condition), Conventions S2 (status_label), Conventions S3 (doc enumerations), Simplicity finding 2 (test proves accessor not seam), Subtractive nit 3 (spec lines).

MERGED to avoid double asks:

DROPPED (stale or wrong at this head):

CONFIDENCE: every blocker is a static read of cited lines; B1 is settled by pytest tests/cli/test_planning.py -k request_context (line 311), B2 by the same file (line 324), B3 by an assertion that plan(context_target=2048) raises on a 4096-chunk recipe. Nothing was executed.

#26 [high] Run 4 full report: PR #533 @ 9118add

Full report — PR #533 "Cap the per-request context target"

Head 9118add, base main, 6 files, +69/−5 (docs/cli-design.md +2/−1, ignition/cli/serve.py +2/−2, ignition/parameters.py +13/−0, ignition/planning.py +14/−1, ignition/preparation/bootstrap.py +1/−1, tests/cli/test_planning.py +37/−0). Open, ready for review, no reviews, no CI checks on the head. Supersedes the same author's closed #454.

Key findings

The shape of the change is right and should be kept — it is now stable across the last two heads and needs no rework. One optional field declared once on the universal RecipeParameters base (parameters.py:1309-1321), which the dynamic CLI, the manifest and reproduction-arg plumbing generate without per-model code; one Plan.prepared_context accessor (planning.py:357-363); one consumer line in common_preparation_kwargs (preparation/bootstrap.py:132); two serve-side bounds (serve.py:67). No Helios change, no per-model branch, no env toggle, and omitting the flag is byte-equivalent to main (prepared_context returns recipe.context). The size the PR set out to cut is now genuinely small.

Two behaviours are still wrong at this head, one is a load-time export defect, and they are all reachable with documented defaults. Nothing was executed: the head has no CI checks, so every claim below is a static read of the cited lines, and pytest tests/cli/test_planning.py settles all three blockers in one run.


Blockers

B1 — The declared upper bound makes the documented clamp unreachable; the PR's own test fails

Where: ignition/parameters.py:1309-1321 (declaration), :1268-1269 (_recipe_context_limit), :533-545 (enforcement); contradicted by ignition/planning.py:357-363, tests/cli/test_planning.py:310-313, docs/cli-design.md:468.

# ignition/parameters.py:1309-1321
context_target: int | None = param(
    None, flag="--request-context", group="capacity and compression", metavar="N",
    value_type=int, min_value=1,
    max_fn=_recipe_context_limit,       # :1268-1269 -> context.recipe.context
    manifest_key="context_target", scope=ParameterScope.DEPLOYMENT, repro_always=True,
    help="cap the prepared per-request context at N tokens; must be a multiple of the page token count")

validate_fields rejects a value above the resolved maximum with --request-context for <alias> must be 1 through 262,144 (parameters.py:536-540), and the bound is live on every path: plan() validates at planning.py:540 before sizing, fit validates again, and Plan.__post_init__ validates a third time (:185).

So the clamp at planning.py:363 can never fire, and the PR's only new behavioural test asserts exactly that unreachable branch:

# tests/cli/test_planning.py:310-313, fixture recipe context=262144, page_tokens=64 (:139-140)
oversized_params = replace(base_params, context_target=500000)
oversized = planning.plan(recipe, recipe.checkpoints[0], gpus, selected=(0, 1), parameters=oversized_params)
assert oversized.parameters.context_target == 500000
assert oversized.prepared_context == recipe.context

:311 raises UsageError ("1 through 262,144"), and even without the bound 500000 % 64 = 32 would trip the alignment check at :187.

Three public surfaces describe the behaviour the code forbids: docs/cli-design.md:468 ("resolves to the smaller of N and the recipe maximum"), the accessor docstring (planning.py:359), and the PR description ("min(recipe.context, N)"). A user who follows the docs and passes a large cap gets a hard usage error where the docs promise a reduction.

Requested change (one decision, then make all three agree): drop max_fn=_recipe_context_limit and keep min_value=1, so an oversize target clamps as documented and planning.py:363 becomes live; and run the alignment check on the served value (min(recipe.context, target)) rather than the raw target, so the check tests what reaches max_sequence_tokens. Keeping the rejection instead means deleting the test case, the min branch and the "smaller of" wording — a larger edit that contradicts the description's stated result. This is also a subtraction (see Subtract item 3).

B2 — --request-context never reaches reproduction_args, so a capped core is not reproducible

Where: ignition/parameters.py:1469-1528, especially :1483-1484, :1491, :1494.

RecipeParameters.reproduction_args overrides the generic loop, hand-emits --max-concurrency and --prefill-chunk-size (:1483-1484), and then skips every base-class field by name:

base_field_names = {f.name for f in fields(RecipeParameters)}                       # :1491
if dc_field.name in base_field_names or not spec.cli or not _is_enabled(...): continue  # :1494

context_target is declared on RecipeParameters itself (:1309), so it is skipped and no explicit line emits it; repro_always=True (:1319) is dead metadata because that flag is only read inside the loop that can never reach this field (:1519). A grep for request-context|context_target over ignition/ returns only the declaration, the three planning reads and the serve hint — no emitter. The flag never appears in the recorded command, so reproducing a capped core rebuilds at the full recipe context: a different artifact, which is precisely what a reproduce-from-metadata record exists to prevent. tests/cli/test_planning.py:324-325 asserts the opposite and fails.

Requested change: after :1484, following the guard style already used for --autotune-effort/--lock-gpu-clocks/--no-compile (:1522-1527):

if self.context_target is not None:
    args.extend(["--request-context", str(self.context_target)])

and delete the ineffective repro_always=True from the declaration.

B3 — A cap below the recipe's prefill chunk exports a core Helios refuses to load

Where: ignition/planning.py:594-596; ignition/parameters.py:1458-1462; ignition/preparation/bootstrap.py:132; helios/src/scheduler.rs:66-73.

if params.prefill_chunk > result.context:      # result.context == min(recipe.context, tokens)
    raise UsageError(f"--prefill-chunk-size {params.prefill_chunk:,} exceeds the {result.context:,}-token context"
                     " this plan allows")

Neither this check nor the chunk's parameter bound (64 <= prefill_chunk <= ctx.recipe.context, parameters.py:1458-1462) knows about the cap. But bootstrap.py:132 hands plan.prepared_context to every recipe as the context, which becomes the core's max_sequence_tokens, and Helios enforces prefill_chunk_size <= max_sequence_tokens at load ("prefill_chunk_size must be divisible by 64 and within 64..=context", helios/src/scheduler.rs:66-73).

So --request-context 2048 --prefill-chunk-size 4096 — the default chunk against a small cap, one flag away from the PR's headline scenario — passes every export-side check, exports successfully, and then fails at flare run. The failure surfaces after a full preparation run, on an artifact the user was told was prepared. The bench check in the same file already uses the right quantity (selection.required_context > self.prepared_context, planning.py:212), which makes :594 the inconsistent sibling and confirms the intended seam.

Requested change: compare against the served extent and name it in the message, e.g. effective = min(result.context, result.prepared_context) at planning.py:594 with --prefill-chunk-size 4,096 exceeds the 2,048-token context --request-context allows. One assertion beside tests/cli/test_planning.py:315-321 (pytest.raises for context_target=2048 on the 4096-chunk fixture) covers it.


Should Fix

S1 — The cap never appears in the printed plan report

context_target declares no status_label (parameters.py:1309-1321), and status_parts renders a part only for specs that declare one (parameters.py:694-707, and the base-class pass at :1554-1559), which is exactly what builds the Select GPUs. line (serve.py:269-272). Sibling base fields that change serving do supply one. The plan JSON and the bench record carry the cap; only the printed report does not — and it is the one place a user sees confirmation before a long preparation. Change: status_label=lambda v: f"request context {v:,} tokens" if v else None, so a stock export's line stays byte-identical.

S2 — Help and the context hint describe the uncapped world

S3 — The two closed enumerations of core universal fields were not updated

docs/cli-design.md:448-451 lists the universal RecipeParameters flags --max-concurrency, --prefill-chunk-size, --autotune-effort, --compile-workers, --lock-gpu-clocks, --no-compile, --roce-ring, --roce-chain; docs/preparation-development.md:17-19 lists the same set as field names. Neither includes context_target, so the PR leaves two statements contradicting the code it adds, and a reader of the preparation doc concludes the cap lives in an external recipe package. Change: add the field to both lists, or replace each list with a pointer to ignition/parameters.py so it cannot drift again (preferred: subtraction).

S4 — The VRAM evidence holds only under a non-default --kv-cache-limit

The measured table is real, but its condition is buried in the command line rather than the claim. helios/src/runtime_core/memory.rs:290-292 returns Ok(None) for KvCacheLimit::Memory, the documented default (docs/cli-design.md:740); only the context/concurrency modes derive a page ceiling from the prepared context. Change: state the condition on the headline claim, not only in the evidence command, and say what the default mode gains (fewer pages reserved per request insofar as fit_context clamps to the pool at load — helios/src/model.rs:268). One sentence each; no code.

S5 — PR description mechanics (one bullet, prose only)

Lead with the why before the measurements; "Verified … at main c36a6a02" reads as though the capped numbers came from main, where the flag does not exist; drop the uncheckable "thirteen recipes" count and name the in-repo seam (ignition/preparation/bootstrap.py:132); list docs/cli-design.md among the changed files; and fix the table labels ("256K/192k/128k" against 196608/131072, and whether "Total VRAM" is per GPU or per process). The two clauses describing a page-multiple validation and a distinguished default chunk should describe what the code does once B1/B3 land.


Subtract / Simplify

Could remove ~14 of the +69 added lines (~10 in the test hunk, 3 in the declaration, 1 in planning), plus about half of one docs row. Every item below deletes rather than adds.

  1. tests/cli/test_planning.py — ~10 of the +37 lines.
    • :310-313 (4 lines) encode a clamp the code rejects: delete, or keep only as a pytest.raises if B1 is settled in favour of rejection.
    • :301, :303, :307 (3 lines) restate the field default, the untouched Plan.context (planning.py:353-355) and the value the test itself set two lines above.
    • :326-328 (3 lines) rebuild a proto message with ParseDict/FromString only to read a scope that ParamSpec defaults to (scope=ParameterScope.DEPLOYMENT, parameters.py:89) and that the sibling manifest test already exercises. Keep :324-325 (both strings in reproduction_args — the genuinely new datum) and one scope assertion on the in-memory manifest instead.
    • Replace the five accessor assertions with two seam assertions that prove the cap reaches the artifact, which nothing currently does: BasePreparationConfig(**common_preparation_kwargs(capped, ...)).context == 131072 and the same call on the stock plan yielding recipe.context. The pattern already exists at tests/cli/test_commands.py:150-153. As written, reverting bootstrap.py:132 to plan.recipe.context leaves the new test green.
  2. ignition/parameters.py:1317-1319 — 3 lines that restate defaults. manifest_key="context_target" duplicates the fallback at :607-612 (the field name is used when no key and no prefix); scope=ParameterScope.DEPLOYMENT duplicates ParamSpec.scope's default (:89); repro_always=True is dead (B2). Caveat: the sibling prefill_chunk spells all three out, so removing them trades lines for local consistency — the author's call, but repro_always should go either way.
  3. ignition/planning.py:363 — the min is unreachable under the current rejection bound. One line, and deleting it is the alternative to B1's preferred fix. Either way, one of the two mechanisms (bound vs clamp) must go; keeping both is the "unnecessary special case" the charter warns about.
  4. docs/cli-design.md:468 — shorten the row. The trailing "a core's catalog is fixed at export, so changing it requires re-export" is copied verbatim from the --mixed-prefill row immediately below (:469); the "Command line only" phrasing already implies it. Saves no lines but keeps the table readable, and the "smaller of N and the recipe maximum" clause must change with B1.
  5. ignition/planning.py:396 — delete "checkpoint_context" rather than add to to_dict. to_dict already emits context_target and context; checkpoint_context is recipe.context again and has no reader anywhere in the tree (grep finds only this line). Removing it is the fix for "one quantity named three ways" — do not add a fourth key.
  6. Considered and rejected: dropping the flag entirely in favour of the runtime --kv-cache-limit. The runtime flag bounds loaded KV at serve time and cannot lower the exported max_sequence_tokens; that datum — a request longer than N is refused at admission instead of admitted and evicted — is what #454 asked for and what the PR provides. Keep the feature; take the ~14 lines above.
  7. Do not cut (verified load-bearing): the target is None -> recipe.context arm (planning.py:361-362), which is what makes the omitted flag a no-op; bootstrap.py:132; the bench check at planning.py:212; the alignment check at planning.py:186-190 (Helios refuses a misaligned max_sequence_tokens at load); serve.py:67; and min(recipe.context, target) itself, which B1 makes live.

Nits (7)

  1. The alignment check lives where it will run many times. Plan.__post_init__ (planning.py:186-190) is re-entered for every candidate world size and every shortfall probe inside fit, and on a failed fit it raises before the capacity message the function exists to produce. Every sibling flag rule is either in plan() beside the chunk check (planning.py:594-596) or in RecipeParameters.validate (parameters.py:1458-1462). Put it with them.
  2. docs/cli-design.md:468 — the duplicated re-export clause (see Subtract 4), and "the recipe maximum" vs "checkpoint maximum" used elsewhere in the same table.
  3. parameters.py:1320 help says "must be a multiple of the page token count" — an internal name with no antecedent in --help, and the sentence never states the range that B1 shows is enforced. Say "page size", or drop the clause and let validation speak.
  4. tests/cli/test_planning.py:295 takes monkeypatch and never uses it, although rebuild_manifest.from_plan at :323 calls source_identity() (rebuild_manifest.py:290, :327), which raises RuntimeError("the preparation environment requires FlashInfer") when FlashInfer is absent (ignition/preparation/source_identity.py:36-41). Every neighbouring test patches it (:159, :223, :333). Add the stub or drop the fixture — and prefer the stub, so this planning test does not depend on a GPU environment.
  5. planning.py:321 — demand_pages still sizes the reported demand from recipe.context, so the plan JSON's demand figure does not describe a capped core. One word: use prepared_context.
  6. parameters.py:1309 — the field is context_target, the flag is --request-context, and Plan.prepared_context is a third name for the same number. The flag name is good; the docstring at planning.py:359 could name the flag so a reader can join them.
  7. docs/cli-design.md:468 / :1436 — "Command line only" is right (the catalog is fixed at export), but the row never says what the user experiences: a request whose prompt plus output exceeds N is refused at admission. The neighbouring --prefill-chunk-size row states its consequence.

Verified clean — do not re-raise

Open questions

  1. Clamp or reject above the recipe maximum? Only the author can settle it (B1). The docs, the accessor and the PR description say clamp; the parameter spec says reject. The clamp is the smaller edit and the smaller concept count.
  2. Should the chunk bound follow the cap at resolve_parameters time so the pair is rejected before planning (B3), or only in plan()? Either fixes the defect; the earlier rejection gives the better message.
  3. Nothing was executed and the head has no CI checks. pytest tests/cli/test_planning.py settles B1 and B2 deterministically (lines 311 and 324); B3 needs the one added pytest.raises assertion; S4's default-mode number needs a measurement this environment cannot produce.

#27 [high] Run 4 summary report (GitHub post) — PR #533 @ 9118add

Autobot Review — PR #533 @ 9118add (6 files, +69/−5)

Recommendation: Changes Requested

Two of the three blockers from the last round are fixed (the derive() funnel, and prepared_context no longer baking the export host's free memory into the artifact) — the shape of the change is now right and should not be reworked. Three defects remain, all reachable with documented defaults.

Blockers:

Should fix:

Subtract / Simplify:

Could remove ~14 of +69 added lines (~10 test, 3 declaration, 1 planning), plus half of one docs row:

Nits:

7 nits: the alignment check runs inside __post_init__ (and per candidate fit) instead of beside the chunk check in plan(); the duplicated re-export clause and "recipe" vs "checkpoint" maximum in the docs row; the help's "page token count" with no antecedent and no stated range; the unused monkeypatch in the new test although from_plan calls source_identity() (needs FlashInfer) and every sibling test stubs it; demand_pages still sized from recipe.context (planning.py:321); three names for one number; and the docs row never says the user-visible consequence (requests above N are refused at admission).


Nothing was executed and head 9118add has no CI checks: every claim is a static read, and pytest tests/cli/test_planning.py settles the first two blockers (lines 311, 324) in one run. Keep the design: one optional field on the universal base, one accessor, one consumer line, no Helios change, no per-model branch, and omitting the flag is byte-equivalent to main.

#28 [high] Research summary

Reviewed all six lens outputs against the code at head 9118add (6 files, +69/−5) and produced both reports: the full report is scratchpad note #26, the GitHub-post summary is note #27 (verification ledger #24, adjudications #25).

Head 9118add is a materially better head than the last round: two of the three prior blockers are fixed (the derive() keyword funnel is intact at ignition/cli/preparation.py:62-79 and proven by tests/cli/test_commands.py:145-155; prepared_context no longer carries the export host's free-memory term, ignition/planning.py:357-363), plus the page-alignment check, max_body_bytes, the serve/bench/manifest reporting, and the proto assertion all landed. What remained is three verified blockers and a small subtraction budget.

Blockers (static reads; nothing executed, head has no CI): (1) context_target's max_fn=_recipe_context_limit (parameters.py:1316) rejects any oversize target before prepared_context is read, so the documented clamp is dead, docs/cli-design.md:468, the docstring and the description are false, and the PR's own tests/cli/test_planning.py:310-313 fails; (2) RecipeParameters.reproduction_args emits the universal flags by hand and skips all base fields (parameters.py:1483-1494), so --request-context never reaches reproduction_args, repro_always=True is dead, and tests/cli/test_planning.py:324-325 fails; (3) the chunk guard (planning.py:594-596) and the chunk bound (parameters.py:1458-1462) ignore the cap, so --request-context 2048 --prefill-chunk-size 4096 exports a core Helios refuses at load (helios/src/scheduler.rs:66-73).

Subtraction is its own section as required: ~14 of the +69 added lines (10 in the new test — including the four-line unreachable clamp case, three input restatements, and a proto round-trip a sibling test already covers — 3 redundant ParamSpec lines, 1 dead min), plus replacing five accessor assertions with two seam assertions through common_preparation_kwargs → BasePreparationConfig.context, since reverting bootstrap.py:132 currently leaves the new test green. I explicitly rejected the Subtractive lens's "drop the whole flag" headline: the runtime --kv-cache-limit cannot lower the exported max_sequence_tokens, which is the datum this PR exists to produce, so it is recorded as considered-and-rejected rather than as an ask. Prose items are collapsed into one bullet and kept out of Blockers.

#29 [high] Final editorial map for run 4: where everything sits and what must not be re-raised

Both deliverables are already written and final; write the report from them, do not re-derive:

Numbers that must appear verbatim in both:

Do NOT re-raise (fixed at this head — listing them prevents a false finding):

  1. derive() signature/context= keyword: ignition/cli/preparation.py:62-79 takes parameters=, no caller passes context=, tests/cli/test_commands.py:145-155 proves the funnel.
  2. prepared_context including the export host's free-memory term: planning.py:357-363 is min(recipe.context, target) with a None -> recipe.context arm.
  3. Missing page-alignment validation: exists at planning.py:186-190 (its placement and its operand are still findings, in Nits 1 and Blocker 1 respectively).
  4. max_body_bytes from the uncapped context: serve.py:67 now uses plan.prepared_context.
  5. Manifest/test proto field: test:329 asserts .scope == PREPARATION_PARAMETER_SCOPE_DEPLOYMENT, not a nonexistent int64_value.
  6. Missing docs rows: docs/cli-design.md:468 (flag) and :1436 (owner) both present.

Blocker one-liners (so wording stays consistent with #26):

Evidence caution to keep in the report: the VRAM table is the author's measured claim and is not checkable in this tree; only its --kv-cache-limit scoping is verified (helios/src/runtime_core/memory.rs:290-292). Do not restate the numbers as verified.

Injection check: nothing in the description, diff, docs, or discussion asked the reviewer or an agent to do anything; the only review-thread item is a bare "@flare-autobot" mention by the author. No finding.

#31 [high] Run 5 full report: PR #533 @ e623985 (final text)

Full report — PR #533 "Cap the per-request context target"

Head e6239855, base main, 8 files, +79/−10 (docs/cli-design.md +3/−2, docs/preparation-development.md +2/−1, ignition/cli/help.py +1/−1, ignition/cli/serve.py +4/−2, ignition/parameters.py +14/−0, ignition/planning.py +17/−3, ignition/preparation/bootstrap.py +1/−1, tests/cli/test_planning.py +37/−0). No CI checks on the head; nothing was executed — every claim is a static read of the cited lines.

Key findings

Recommendation: Changes Requested. No blockers. The shape of the change is right and must not be reworked: one optional field on the universal RecipeParameters base (ignition/parameters.py:1309-1320), which the dynamic CLI/manifest/reproduction-arg plumbing generates without per-model code; one Plan.prepared_context accessor (ignition/planning.py:357-363); one consumer line where recipes learn their extent (ignition/preparation/bootstrap.py:132); no Helios change, no per-model branch; omitting the flag returns recipe.context, so shipped artifacts and exported cores are unchanged.

All three blockers raised against earlier heads are fixed in the code at this head and must not be re-raised:

  1. max_fn=_recipe_context_limit is gone; context_target declares only min_value=1 (parameters.py:1309-1320), and the alignment check is gated on target <= self.recipe.context (planning.py:186-190), so an oversized cap clamps (planning.py:363) as docs/cli-design.md:468, the docstring and the description promise. The test case at tests/cli/test_planning.py:310-313 (500000 → 262144) is now reachable.
  2. --request-context is emitted in RecipeParameters.reproduction_args (parameters.py:1484-1485) ahead of the base-class-field skip (:1492-1496); no repro_always remains on the spec.
  3. The prefill-chunk bound uses the served extent (planning.py:594-597), so a cap below the chunk is rejected at export instead of producing a core Helios refuses to load.

What remains: one behavioural regression on the default (uncapped) path, a test that never reaches the seam the feature hangs on and that depends on FlashInfer, two reporting surfaces that describe the request rather than the artifact, and one description/docs evidence item.

Blockers

None. (The three prior blockers are verified fixed above; do not re-raise them.)

Should Fix

S1 — The bench pre-check got looser on the uncapped path

ignition/planning.py:212 changed from selection.required_context > self.context to > self.prepared_context. With no cap, prepared_context is self.recipe.context (:361-362) while context is min(recipe.context, tokens) (:353-355). So whenever the KV pool cannot hold the full recipe context — the memory-constrained case this PR targets — the check now admits a bench selection the prepared core cannot serve. Requested change: if selection.required_context > min(self.context, self.prepared_context): — the same shape the chunk check uses at :594. Why: it converts an early, cheap rejection into a failure after download, tuning and graph capture (ignition/bench/runner.py:388-389, "benchmark case exceeds prepared capacities"), or into a case the served pool cannot hold.

S2 — The new test neither reaches the seam nor stubs source_identity

tests/cli/test_planning.py:295-329. Revert ignition/preparation/bootstrap.py:132 to plan.recipe.context and every assertion still passes: the test asserts the accessor, the rejection paths and generic manifest plumbing, never the hand-off into PreparationConfig.context. AGENTS.md:194-199 requires tests to exercise the affected contract; that contract is exactly this line. Additionally :295 takes monkeypatch and never uses it, while :323 calls rebuild_manifest.from_plan, which calls source_identity() (ignition/preparation/rebuild_manifest.py:290,327), which imports flare_heliopause and raises RuntimeError("the preparation environment requires FlashInfer") when FlashInfer (or its data/include, data/csrc) is absent (ignition/preparation/source_identity.py:35-41,78-81). All three sibling tests stub it (tests/cli/test_planning.py:159,223,333; tests/cli/test_parameters.py:296). Requested change — replace the arithmetic assertions with the seam pair (pattern: tests/cli/test_commands.py:150-153) and add the stub:

monkeypatch.setattr("ignition.preparation.source_identity.source_identity", lambda: "test-source")
assert BasePreparationConfig(**common_preparation_kwargs(capped, compile_forwards=True, kernel_cache=None,
                                                         retain_graphs=False)).context == 131072
assert BasePreparationConfig(**common_preparation_kwargs(stock, compile_forwards=True, kernel_cache=None,
                                                         retain_graphs=False)).context == recipe.context

Keep the two pytest.raises cases (:315-321) and one --request-context/131072 reproduction-arg assertion (:324-325). This also shortens the test (see Subtract 1). Settling check: pytest tests/cli/test_planning.py -k request_context on a host without FlashInfer.

S3 — The printed plan reports the requested cap, not the served one

ignition/parameters.py:1318 declares status_label=lambda v: f"request context {v:,} tokens" if v else None, rendered from the raw field value (:1558) into the Select GPUs line (ignition/cli/serve.py:270-274). Plan.prepared_context clamps (planning.py:357-363), so --request-context 500000 on a 262,144-context recipe prints "request context 500,000 tokens" for a core prepared at 262,144. AGENTS.md:452-456: the plan and its printed report must describe what was prepared, and a core's catalog is fixed at export (docs/cli-design.md:468), so a user who believes the report re-exports to learn otherwise. Requested change (subtractive): delete the status_label from the spec and emit the clamped part where the ParameterContext — and therefore the recipe — is in scope, RecipeParameters.status_parts (parameters.py:1541-1563), e.g. before the compile workers part:

if self.context_target is not None and ctx.recipe is not None:
    parts.append(f"request context {min(ctx.recipe.context, self.context_target):,} tokens")

Why: one place prints a true number, the raw request stays visible in the manifest (context_target).

S4 — The plan record names no served extent, and carries a dead key

ignition/planning.py:395-396 emits "context": self.context (pool-bound) and "checkpoint_context": self.recipe.context; prepared_context — the value that becomes max_sequence_tokens through bootstrap.py:132 — appears only indirectly via context_target. The two sibling derived values still use the uncapped recipe maximum: demand_pages (:320-321) and guaranteed_tokens (:366-368), so a capped plan reports a guarantee the core cannot honour. checkpoint_context has no reader anywhere in the tree (only planning.py:396). Requested change: put "prepared_context": self.prepared_context in place of the dead checkpoint_context, and derive guaranteed_tokens/demand_pages from self.prepared_context instead of self.recipe.context. Why: one definition of the served ceiling; net line change zero.

S5 — Description and docs prose: order, evidence scope, one wrong mechanism sentence, one missing consequence

(a) The body runs What Changed → Result → Evidence; the only causal "why" survives as a Workload clause inside Evidence. AGENTS.md:74-80 requires why → what changed → claimed result → evidence, in that order (docs/design-review.md:137-152). Open with one or two sentences of why (the 256K default over-provisions the KV pool, so the desired concurrency does not fit). (b) The −16 GB result is stated unconditionally, but every row was measured with --kv-cache-limit concurrency; the default is memory (docs/cli-design.md:740), and page_ceiling returns Ok(None) for KvCacheLimit::Memory (helios/src/runtime_core/memory.rs:290-292). Export-side sizing does not follow the cap either (planning.py:435-480 fits pages from free memory; demand_pages at :320-321). Attach the condition to the Result sentence and to docs/cli-design.md:468, and say what the default mode gains (only the serve-time fit_context clamp, helios/src/model.rs:261-273). (c) "fit_context applies min(context, prepared_context)" names the wrong operands: it is prepared_sequence_tokens.min((pages − draft_pages) × page_tokens) (helios/src/model.rs:261-273) — the prepared extent against the physical page pool. Reword: the cap sets an export-time ceiling and never raises the runtime bound. (d) docs/cli-design.md:468 omits the consequence the description promises: a request whose prompt plus requested output exceeds N is rejected at admission (Helios prompt check helios/src/server/request.rs:349-355). The neighbouring --prefill-chunk-size row states its consequence; this one should too. (e) Table labels: "192k"/"128k" against 196608/131072, and "Total VRAM (GB)" neither says per-GPU/process-wide nor whether it is nvidia-smi total or allocator reserved — the table cannot be reproduced from the text as written.

Subtract / Simplify

Could remove ≈14 of the +79 added lines — 7 in the test hunk, 2 in the spec, 3 in the accessor, 1 in planning, 1 in serve — plus about a third of the new docs prose. Ranked by size:

  1. tests/cli/test_planning.py — ≈7 of the +37 lines. Delete :301 (restates the field default), :303 (restates untouched Plan.context, planning.py:353-355), :307 and :312 (restate the values passed to replace() two lines above), and collapse the four-line proto round trip :326-329 to one assertion that also checks the value, which :329 does not:
assert {(p.key, p.scope, p.value.uint_value) for p in decoded.parameters} >= {
    ("context_target", proto.PREPARATION_PARAMETER_SCOPE_DEPLOYMENT, 131072)}

Keep :302, :308, :310-313 (the target <= recipe.context gate's false branch), :315-321 (both rejections) and :324-325. 2. ignition/parameters.py:1316-1317 — 2 lines. manifest_key="context_target" duplicates the field-name fallback (:607-612, no manifest_prefix on RecipeParameters), and scope=ParameterScope.DEPLOYMENT is ParamSpec's default (:89). Caveat: the sibling prefill_chunk spells both out (:1303-1304); dropping them is consistency-neutral, not wrong either way. 3. ignition/planning.py:360-363 — 3 lines. Four body lines to one: return min(self.recipe.context, target or self.recipe.context). Safe because min_value=1 makes a resolved target never 0; keep the docstring and the no-op semantics. 4. ignition/cli/serve.py:68-70 — 1 line. Two branches spell out the same prefix:

"context_hint": ("context is limited by the checkpoint and cache capacity"
                 + (", and the --request-context cap" if plan.prepared_context < recipe.context else "")),
  1. ignition/planning.py:594 — 1 line. The effective local exists only to be compared once; inline min(result.context, result.prepared_context) into the message and the comparison (judgement call: the double min may read worse).
  2. docs/cli-design.md:468 — prose. Drop the trailing "a core's catalog is fixed at export, so changing it requires re-export", copied verbatim from the --mixed-prefill row immediately below (:469); "Command line only" already carries it.
  3. docs/cli-design.md:448-451 and docs/preparation-development.md:17-20 — prose. Two hand-maintained enumerations of the same universal field list, both edited by this PR (the second now strands lock_gpu_clocks, on :19). Replace both with a pointer to ignition/parameters.py so adding a field stops requiring two unrelated doc edits. (docs/cli-design.md:1436 is not a duplicate — it names the deciding surface; keep it.)

Do not cut (verified load-bearing): the target is None → recipe.context early return (planning.py:361-362) — it makes the omitted flag a no-op and preserves today's pool-bound path; bootstrap.py:132; the bench check (planning.py:212); the alignment check's two guards (planning.py:187) — a one-clause if self.prepared_context % self.page_tokens would reject stock plans on any recipe whose adjust_page_tokens (parameters.py:571-575) changes the page size, because recipe.context need not be a multiple of the adjusted size; serve.py:67 (max_body_bytes); and the min(recipe.context, target) clamp itself.

Considered and rejected: dropping the whole surface (Subtractive's ≈68 of 79 lines, leaving only the runtime --kv-cache-limit). The runtime flag bounds loaded KV at serve time and cannot lower the exported max_sequence_tokens; the surviving delta — a per-request ceiling independent of the pool, so an over-long request is refused at admission instead of admitted then evicted — is what #454 asked for. Keep the feature; take the ≈14 lines.

Nits (7)

  1. ignition/planning.py:186-190 — placement and message shape. The check runs in Plan.__post_init__, which is re-entered for every candidate world size and shortfall probe (planning.py:577,587,600), so on a failure it raises a flag-message before the capacity message plan() exists to produce; and unlike sibling rules it does not name the alias (parameters.py:1454,1459). Keep the guards (see Subtract, do-not-cut); consider moving it beside plan()'s chunk check (planning.py:594-597).
  2. ignition/parameters.py:1319 help says "a multiple of the page token count" — "page token count" has no antecedent in --help (the page size appears only in the epilog, ignition/cli/help.py:46) — and states no floor, although a cap below --prefill-chunk-size is now rejected (planning.py:594-597). Say "page size" and note that lowering the cap below the chunk also needs a smaller chunk.
  3. ignition/cli/help.py:46 now carries two facts on one line (context maximum plus page size plus a flag hint) where sibling lines carry one (:43-45,51-60), and states no floor.
  4. Naming. context_target (field), --request-context (flag) and prepared_context (accessor) are three names for one number; the docstring at planning.py:359 could name the flag so a reader can join them.
  5. docs/cli-design.md — three spellings of one ceiling: "the recipe maximum context" (:468, :1436), "the prepared context ceiling" (:1486). Pick one, "the recipe's maximum context".
  6. Description table units/metric: state once that 128k = 131,072 tokens, and define "Total VRAM" (per GPU or process-wide; nvidia-smi total or allocator reserved) — see S5(e).
  7. docs/preparation-development.md:19 — the added field pushes lock_gpu_clocks, onto a line of its own inside a prose list; reflow (or replace the list, Subtract 7).

Verified clean (do not re-raise)

Open questions

  1. Do the savings survive under the default --kv-cache-limit memory? Only the author's rig can answer; it is the number that would let the description drop the caveat (S5b).
  2. Does any real recipe's adjust_page_tokens (parameters.py:571-575) change the page size per world size? If so, the alignment check's placement (nit 1) matters more than it looks now.
  3. The commit message body (git log -1 --format=%B) was not available here, so its four-part compliance is unjudged.
  4. Nothing was executed; pytest tests/cli/test_planning.py settles S2 deterministically and would have caught the earlier flashcards. S1 needs a plan with tokens < recipe.context plus a selection between the two bounds.

#32 [high] Correction to S2 in note #31 + S3/S4 verifications

Correction — replaces the S2 text in note #31

S2 in note #31 overclaimed the FlashInfer failure. Verified facts:

So state it as: the fixture is unused and the stub its siblings use is missing, so the test depends on FlashInfer and its native data/ trees being present; on a host without them it raises before any assertion. Frame as "settle by running pytest tests/cli/test_planning.py -k request_context", not as "the test cannot pass".

The load-bearing half of S2 stands independently and is the stronger point: the test never touches ignition/preparation/bootstrap.py:132 — revert that line to plan.recipe.context and every assertion still passes — plus the arithmetic assertions restate inputs (:301, :303, :307, :312) and :329 checks only the scope, not value.uint_value == 131072. Fix per AGENTS.md:194-199 with the seam pair (tests/cli/test_commands.py:150-153 pattern: BasePreparationConfig(**common_preparation_kwargs(capped, compile_forwards=True, kernel_cache=None, retain_graphs=False)).context == 131072).

Also verified since note #31:

#33 [high] Run 5 summary report (GitHub post) — PR #533 @ e623985

Recommendation: Changes Requested

The design is right and needs no rework: one field on the universal RecipeParameters base, one Plan.prepared_context accessor, one seam (bootstrap.py:132), no Helios change, and a no-op when the flag is unset. The three earlier blockers are fixed at this head; what remains is reporting fidelity and the missing seam test, not architecture.

Blockers: 0 Should fix: 5 Subtractive suggestions: 7 (~14 of +79 added lines) Nits: 7

Counts check against note #31 (corrected S2 in note #32): Blockers 0, Should fix S1–S5 = 5, Subtract items 1–7 = 7, Nits 1–7 = 7.

#34 [high] Run 5 editorial map: structure, counts, summary placement

Final deliverable structure, after re-verifying every lens claim at head e623985 (nothing executed):

FULL REPORT (report field) sections + item counts:

SUMMARY: note #33 (Blockers 0, Should fix 5, Subtractive 7, Nits 7) — counts must match exactly. The finish tool has only status/report, so append the compact summary verbatim under a "Summary (GitHub post)" heading at the end of the report so it is not lost.

Editorial rules applied: subtraction preferred everywhere (S3's fix is a deletion, S4 is net-zero by replacing a dead key, S2 shortens the test); subtraction has its own section with the line estimate; prose items are combined into one S5 bullet and no prose item is a Blocker (0 blockers this round).

#35 [high] Run 5 verification: what changed vs main (S1 regression proof, pre-existing dead key)

Verified against main to distinguish new regressions from pre-existing state (head e623985):

#36 [high] Research summary

Full report — PR #533 "Cap the per-request context target"

Head e6239855, base main, 8 files, +79/−10 (docs/cli-design.md +3/−2, docs/preparation-development.md (not opened) +2/−1, ignition/cli/help.py (not opened) +1/−1, ignition/cli/serve.py +4/−2, ignition/parameters.py +14/−0, ignition/planning.py +17/−3, ignition/preparation/bootstrap.py +1/−1, tests/cli/test_planning.py +37/−0). No CI checks on the head; nothing was executed — every claim below is a static read of the cited lines.

Key findings

Recommendation: Changes Requested. No blockers. The design is right and must not be reworked: one optional field on the universal RecipeParameters base (ignition/parameters.py:1309-1320), which the dynamic CLI, manifest and reproduction-arg plumbing generate without per-model code; one Plan.prepared_context accessor (ignition/planning.py:357-363); one consumer line where recipes learn their extent (ignition/preparation/bootstrap.py:132); no Helios change, no per-model branch. Omitting the flag returns recipe.context, so shipped artifacts and exported cores are unchanged.

The three blockers from earlier rounds are fixed in the code at this head — do not re-raise them:

  1. max_fn=_recipe_context_limit is gone; context_target declares only min_value=1 (parameters.py:1309-1320) and the alignment check is gated on target <= self.recipe.context (planning.py:186-190), so an oversized cap clamps at planning.py:363 as docs/cli-design.md:468, the accessor docstring and the description all promise. The case at tests/cli/test_planning.py:310-313 is now reachable.
  2. --request-context is emitted in RecipeParameters.reproduction_args (parameters.py:1484-1485) ahead of the base-class-field skip (:1492-1496); no repro_always remains on the spec.
  3. The prefill-chunk bound uses the served extent (effective = min(result.context, result.prepared_context), planning.py:594-597), so a cap below the chunk is rejected at export instead of exporting a core Helios refuses to load (helios/src/model/catalog.rs:42,48-57).

What remains is one behavioural regression on the default (uncapped) path, a test that never reaches the seam the feature hangs on, two reporting surfaces that describe the request rather than the artifact, and the description/docs evidence prose.

Blockers

None.

Should Fix

S1 — The bench pre-check got looser on the uncapped path

Where: ignition/planning.py:212 (changed by this PR; main:207 read > self.context). What is wrong: with no cap, prepared_context returns self.recipe.context (planning.py:361-362) while context is min(recipe.context, tokens) (:353-355). So whenever the KV pool cannot hold the full recipe context — exactly the memory-constrained deployments this PR targets — the check now admits a bench selection the prepared core cannot serve. self.context is the correct operand: the served ceiling is fit_context-narrowed to min(prepared_sequence_tokens, pages × page_tokens) (helios/src/model.rs:261-273), which for an uncapped plan equals self.context, and that is the context ignition/direct/scheduler.py:110 reads and ignition/bench/runner.py:388-389 enforces. Requested change: if selection.required_context > min(self.context, self.prepared_context): — the same shape the chunk check already uses at :594. Why: it turns a cheap early rejection into a failure after model download, tuning and graph capture, or into a benchmark case the pool cannot hold.

S2 — The new test never reaches the seam, and drops the stub its siblings use

Where: tests/cli/test_planning.py:295-329. What is wrong: revert ignition/preparation/bootstrap.py:132 to plan.recipe.context and every assertion still passes. The test asserts the accessor, the rejection paths and generic manifest plumbing; it never asserts the hand-off into PreparationConfig.context, which is the one behavioural change the PR makes — and per AGENTS.md:194-199 a test must exercise the affected contract. In addition :295 accepts monkeypatch and never uses it, while :323 calls rebuild_manifest.from_plan, which calls source_identity() (ignition/preparation/rebuild_manifest.py:290,327); that imports flare_heliopause and raises RuntimeError("the preparation environment requires FlashInfer") when FlashInfer is absent (ignition/preparation/source_identity.py:35-41), or when its native data/include/data/csrc trees are missing (:76-81). All three sibling tests that reach from_plan stub it (tests/cli/test_planning.py:159,223,333; tests/cli/test_parameters.py:296); there is no conftest.py doing it globally. flashinfer-python[b12x] is a declared dependency (pyproject.toml:25), so in a synchronized environment the call may succeed — but the unused fixture is the tell that the stub was meant to be there, and without it the test silently depends on a GPU preparation environment. Requested change (also a net shortening — see Subtract 1):

monkeypatch.setattr("ignition.preparation.source_identity.source_identity", lambda: "test-source")
kw = dict(compile_forwards=True, kernel_cache=None, retain_graphs=False)
assert BasePreparationConfig(**common_preparation_kwargs(capped, **kw)).context == 131072
assert BasePreparationConfig(**common_preparation_kwargs(stock_plan, **kw)).context == recipe.context

(pattern: tests/cli/test_commands.py:150-153; common_preparation_kwargs requires kernel_cache and retain_graphs). Keep the two pytest.raises cases (:315-321) and one --request-context/131072 reproduction-arg assertion (:324-325). Why: that pair locks both the capped and the no-op path and would catch a regression in the single line the feature reduces to. Settled by pytest tests/cli/test_planning.py -k request_context.

S3 — The printed plan reports the requested cap, not the served one

Where: ignition/parameters.py:1318, rendered from the raw field value at :1558 into the Select GPUs line (ignition/cli/serve.py:270-274). What is wrong: status_label=lambda v: f"request context {v:,} tokens" if v else None receives the raw target; Plan.prepared_context clamps (planning.py:357-363). --request-context 500000 on a 262,144-context recipe prepares a core for 262,144 tokens but prints "request context 500,000 tokens". AGENTS.md:452-456 requires the plan, its printed report and its recorded measurements to describe what was prepared, and a core's catalog is fixed at export (docs/cli-design.md:468), so a user who trusts the report only learns otherwise by re-exporting. Requested change (subtractive): delete status_label from the spec and emit the clamped part where the recipe is in scope — RecipeParameters.status_parts (parameters.py:1541-1563, which already receives the ParameterContext) — e.g. before the compile workers part:

if self.context_target is not None and ctx.recipe is not None:
    parts.append(f"request context {min(ctx.recipe.context, self.context_target):,} tokens")

(keep the ctx.recipe is not None guard, as validate does at :1456). Why: one surface prints a true number; the raw request stays visible in the manifest as context_target, so no information is lost.

S4 — The plan record names no served extent, and carries a key with no reader

Where: ignition/planning.py:395-396, :320-321, :366-368. What is wrong: to_dict emits "context": self.context (pool-bound) and "checkpoint_context": self.recipe.context (a pre-existing key, present on main, with no reader anywhere in the tree), but never prepared_context — the value that becomes max_sequence_tokens through bootstrap.py:132. The two sibling derived values still use the uncapped recipe maximum: demand_pages (:320-321) and guaranteed_tokens (:366-368), so a capped plan serializes a guarantee the prepared core cannot honour. Both feed only to_dict (:407, :411), so changing them is reporting-only. Requested change: "prepared_context": self.prepared_context in place of the dead "checkpoint_context", and derive guaranteed_tokens (and demand_pages, if it is meant to describe the served extent) from self.prepared_context. Why: one definition of the served ceiling in the record; net line change zero.

S5 — Description and docs prose (one item, prose only)

(a) The body runs What Changed → Result → Evidence; the only causal "why" survives as a Workload clause inside Evidence. AGENTS.md:74-80 requires why → what changed → claimed result → evidence, in that order (docs/design-review.md:137-152 (not opened)). Open with one or two sentences of why: the 256K default over-provisions the KV pool, so the desired concurrency does not fit. (b) The VRAM saving is stated unconditionally, but every row was measured with --kv-cache-limit concurrency; the documented default is memory (docs/cli-design.md:740), and page_ceiling returns Ok(None) for KvCacheLimit::Memory (helios/src/runtime_core/memory.rs:290-292). Export-side sizing does not follow the cap either (fit derives pages from free memory, planning.py:435-480; demand_pages still uses recipe.context). Attach the condition to the Result sentence and to docs/cli-design.md:468, and say what the default mode gains (only the serve-time fit_context clamp, helios/src/model.rs:261-273). (c) "fit_context applies min(context, prepared_context)" names the wrong operands: it is prepared_sequence_tokens.min((pages − draft_pages) × page_tokens) (helios/src/model.rs:261-273) — the prepared extent against the physical page pool. Reword: the cap sets an export-time ceiling and never raises the runtime bound. (d) docs/cli-design.md:468 omits the consequence the description promises: a request whose prompt plus requested output exceeds N is rejected at admission (helios/src/server/request.rs:350). The neighbouring --prefill-chunk-size row states its consequence; this one should too. (e) Table labels: "192k"/"128k" against the recorded 196608/131072 (state once that 128k = 131,072 tokens), and "Total VRAM (GB)" neither says per-GPU/process-wide nor whether it is nvidia-smi total or allocator reserved, so the table cannot be reproduced from the text as written.

Subtract / Simplify

Could remove ≈14 of the +79 added lines — 7 in the test hunk, 2 in the spec, 3 in the accessor, 1 in planning, 1 in serve — plus about a third of the new docs prose.

  1. tests/cli/test_planning.py — ≈7 of the +37 lines. Delete :301 (restates the field default), :303 (restates the untouched Plan.context, planning.py:353-355), :307 and :312 (restate the values passed to replace() two lines above). Collapse the four-line proto round trip :326-329 into one assertion that also checks the recorded value, which :329 does not:
assert {(p.key, p.scope, p.value.uint_value) for p in decoded.parameters} >= {
    ("context_target", proto.PREPARATION_PARAMETER_SCOPE_DEPLOYMENT, 131072)}

Keep :302 (no cap is a no-op), :308, :310-313 (the target <= recipe.context gate's false branch), :315-321 (both UsageErrors) and :324-325 (the reproduction-arg emission). 2. ignition/parameters.py:1316-1317 — 2 lines. manifest_key="context_target" duplicates the field-name fallback (:607-612; RecipeParameters sets no manifest_prefix), and scope=ParameterScope.DEPLOYMENT is ParamSpec's default (:89). Caveat: the sibling prefill_chunk spells both out (:1303-1304), so dropping them is consistency-neutral — either way costs nothing behaviourally. 3. ignition/planning.py:360-363 — 3 lines. Four body lines to one: return min(self.recipe.context, target or self.recipe.context). Safe because min_value=1 makes a resolved target never 0; keep the docstring and the no-op semantics. 4. ignition/cli/serve.py:68-70 — 1 line. Two branches spell out the same prefix:

"context_hint": ("context is limited by the checkpoint and cache capacity"
                 + (", and the --request-context cap" if plan.prepared_context < recipe.context else "")),
  1. ignition/planning.py:594 — 1 line. The effective local exists only to be compared once; inline min(result.context, result.prepared_context) (judgement call: the double min may read worse).
  2. docs/cli-design.md:468 — prose. Drop the trailing "a core's catalog is fixed at export, so changing it requires re-export", copied verbatim from the --mixed-prefill row immediately below (:469); "Command line only" already carries it.
  3. docs/cli-design.md:448-451 and docs/preparation-development.md:17-20 (not opened) — prose. Two hand-maintained enumerations of the same universal field list, both edited by this PR (the second now strands lock_gpu_clocks, on :19). Replace both with a pointer to ignition/parameters.py so adding a field stops requiring two unrelated doc edits. (docs/cli-design.md:1436 is not a duplicate — it names the deciding surface; keep it.)

Do not cut (verified load-bearing): the target is None → recipe.context early return (planning.py:361-362), which makes the omitted flag a no-op and preserves today's pool-bound path; bootstrap.py:132; the bench check (planning.py:212); the alignment check's two guards (planning.py:187) — a one-clause if self.prepared_context % self.page_tokens would reject a stock plan on any recipe whose adjust_page_tokens (parameters.py:571-575) changes the page size, because recipe.context need not be a multiple of the adjusted size; serve.py:67 (max_body_bytes); and the min(recipe.context, target) clamp itself.

Considered and rejected: dropping the whole surface (Subtractive's ≈68 of 79 lines, leaving only the runtime --kv-cache-limit). The runtime flag bounds loaded KV at serve time and cannot lower the exported max_sequence_tokens; the surviving delta — a per-request ceiling independent of the pool, so an over-long request is refused at admission instead of admitted then evicted — is what #454 asked for. Keep the feature; take the ≈14 lines.

Nits (7)

  1. ignition/planning.py:186-190 — placement and message shape. The check runs in Plan.__post_init__, re-entered for every candidate world size and shortfall probe (planning.py:577,587,600), so a failure raises a flag-shaped message before the capacity message plan() exists to produce; unlike sibling rules it does not name the alias (parameters.py:1454,1459). Keep the guards; consider moving it beside plan()'s chunk check (:594-597).
  2. ignition/parameters.py:1319 help says "a multiple of the page token count" — "page token count" has no antecedent in --help (the page size appears only in the epilog, ignition/cli/help.py:46 (not opened)) — and states no floor, although a cap below --prefill-chunk-size is now rejected (planning.py:594-597). Say "page size" and note that lowering the cap below the chunk also needs a smaller chunk.
  3. ignition/cli/help.py:46 (not opened) now carries two facts on one line (context maximum, page size, flag hint) where sibling lines carry one (:43-45,51-60), and states no floor.
  4. Naming. context_target (field), --request-context (flag) and prepared_context (accessor) are three names for one number; the docstring at planning.py:359 could name the flag so a reader can join them.
  5. docs/cli-design.md — three spellings of one ceiling: "the recipe maximum context" (:468, :1436) and "the prepared context ceiling" (:1486). Pick one, "the recipe's maximum context".
  6. Description table units/metric — see S5(e); state the token values and define "Total VRAM".
  7. docs/preparation-development.md:19 (not opened) — the added field pushes lock_gpu_clocks, onto a line of its own inside a prose list; reflow (or replace the list, Subtract 7).

Verified clean (do not re-raise)

Open questions

  1. How much of the saving survives under the default --kv-cache-limit memory? Only the author's rig can answer; it is the number that would let the description drop the caveat (S5b).
  2. Does any real recipe's adjust_page_tokens (parameters.py:571-575) change the page size per world size? If so, the alignment check's placement (nit 1) matters more than it looks.
  3. The commit message body (git log -1 --format=%B) was not available here, so its four-part compliance is unjudged.
  4. Nothing was executed and the head has no CI checks. pytest tests/cli/test_planning.py settles S2; S1 needs a plan with tokens < recipe.context plus a selection between the two bounds.

Summary (GitHub post — compact)

Recommendation: Changes Requested

The design is right and needs no rework: one field on the universal RecipeParameters base, one Plan.prepared_context accessor, one seam (bootstrap.py:132), no Helios change, and a byte-identical no-op when the flag is unset. The three earlier blockers are fixed at this head; what remains is reporting fidelity and the missing seam test, not architecture.

Blockers: 0 Should fix: 5 Subtractive suggestions: 7 (~14 of +79 added lines) Nits: 7

#37 [high] Run 5 FINAL full report text (supersedes note #31; corrects its S2)

Full report — PR #533 "Cap the per-request context target"

Head e6239855, base main, 8 files, +79/−10 (docs/cli-design.md +3/−2, docs/preparation-development.md +2/−1, ignition/cli/help.py +1/−1, ignition/cli/serve.py +4/−2, ignition/parameters.py +14/−0, ignition/planning.py +17/−3, ignition/preparation/bootstrap.py +1/−1, tests/cli/test_planning.py +37/−0). No CI checks on the head; nothing was executed — every claim is a static read of the cited lines.

Key findings

Recommendation: Changes Requested. No blockers. The design is right and must not be reworked: one optional field on the universal RecipeParameters base (ignition/parameters.py:1309-1320), which the dynamic CLI, manifest and reproduction-arg plumbing generate without per-model code; one Plan.prepared_context accessor (ignition/planning.py:357-363); one consumer line where recipes learn their extent (ignition/preparation/bootstrap.py:132); no Helios change, no per-model branch. Omitting the flag returns recipe.context, so shipped artifacts and exported cores are unchanged.

The three blockers from earlier rounds are fixed in the code at this head — do not re-raise them:

  1. max_fn=_recipe_context_limit is gone; context_target declares only min_value=1 (parameters.py:1309-1320) and the alignment check is gated on target <= self.recipe.context (planning.py:186-190), so an oversized cap clamps at planning.py:363 as docs/cli-design.md:468, the accessor docstring and the description all promise. The case at tests/cli/test_planning.py:310-313 is now reachable.
  2. --request-context is emitted in RecipeParameters.reproduction_args (parameters.py:1484-1485) ahead of the base-class-field skip (:1492-1496); no repro_always remains on the spec.
  3. The prefill-chunk bound uses the served extent (effective = min(result.context, result.prepared_context), planning.py:594-597), so a cap below the chunk is rejected at export instead of exporting a core Helios refuses to load (helios/src/model/catalog.rs:42,48-57).

What remains is one behavioural regression on the default (uncapped) path, a test that never reaches the seam the feature hangs on, two reporting surfaces that describe the request rather than the artifact, and the description/docs evidence prose.

Blockers

None.

Should Fix

S1 — The bench pre-check got looser on the uncapped path

Where: ignition/planning.py:212 (changed by this PR; main:207 read > self.context). What is wrong: with no cap, prepared_context returns self.recipe.context (planning.py:361-362) while context is min(recipe.context, tokens) (:353-355). So whenever the KV pool cannot hold the full recipe context — exactly the memory-constrained deployments this PR targets — the check now admits a bench selection the prepared core cannot serve. self.context is the correct operand: the served ceiling is fit_context-narrowed to min(prepared_sequence_tokens, pages × page_tokens) (helios/src/model.rs:261-273), which for an uncapped plan equals self.context, and that is the context ignition/direct/scheduler.py:110 reads and ignition/bench/runner.py:388-389 enforces. Requested change: if selection.required_context > min(self.context, self.prepared_context): — the same shape the chunk check already uses at :594. Why: it turns a cheap early rejection into a failure after model download, tuning and graph capture, or into a benchmark case the pool cannot hold.

S2 — The new test never reaches the seam, and drops the stub its siblings use

Where: tests/cli/test_planning.py:295-329. What is wrong: revert ignition/preparation/bootstrap.py:132 to plan.recipe.context and every assertion still passes. The test asserts the accessor, the rejection paths and generic manifest plumbing; it never asserts the hand-off into PreparationConfig.context, which is the one behavioural change the PR makes — and per AGENTS.md:194-199 a test must exercise the affected contract. In addition :295 accepts monkeypatch and never uses it, while :323 calls rebuild_manifest.from_plan, which calls source_identity() (ignition/preparation/rebuild_manifest.py:290,327); that imports flare_heliopause and raises RuntimeError("the preparation environment requires FlashInfer") when FlashInfer is absent (ignition/preparation/source_identity.py:35-41), or when its native data/include/data/csrc trees are missing (:76-81). All three sibling tests that reach from_plan stub it (tests/cli/test_planning.py:159,223,333; tests/cli/test_parameters.py:296); there is no conftest.py doing it globally. flashinfer-python[b12x] is a declared dependency (pyproject.toml:25), so in a synchronized environment the call may succeed — but the unused fixture is the tell that the stub was meant to be there, and without it the test silently depends on a GPU preparation environment. Requested change (also a net shortening — see Subtract 1):

monkeypatch.setattr("ignition.preparation.source_identity.source_identity", lambda: "test-source")
kw = dict(compile_forwards=True, kernel_cache=None, retain_graphs=False)
assert BasePreparationConfig(**common_preparation_kwargs(capped, **kw)).context == 131072
assert BasePreparationConfig(**common_preparation_kwargs(stock_plan, **kw)).context == recipe.context

(pattern: tests/cli/test_commands.py:150-153; common_preparation_kwargs requires kernel_cache and retain_graphs). Keep the two pytest.raises cases (:315-321) and one --request-context/131072 reproduction-arg assertion (:324-325). Why: that pair locks both the capped and the no-op path and would catch a regression in the single line the feature reduces to. Settled by pytest tests/cli/test_planning.py -k request_context.

S3 — The printed plan reports the requested cap, not the served one

Where: ignition/parameters.py:1318, rendered from the raw field value at :1558 into the Select GPUs line (ignition/cli/serve.py:270-274). What is wrong: status_label=lambda v: f"request context {v:,} tokens" if v else None receives the raw target; Plan.prepared_context clamps (planning.py:357-363). --request-context 500000 on a 262,144-context recipe prepares a core for 262,144 tokens but prints "request context 500,000 tokens". AGENTS.md:452-456 requires the plan, its printed report and its recorded measurements to describe what was prepared, and a core's catalog is fixed at export (docs/cli-design.md:468), so a user who trusts the report only learns otherwise by re-exporting. Requested change (subtractive): delete status_label from the spec and emit the clamped part where the recipe is in scope — RecipeParameters.status_parts (parameters.py:1541-1563, which already receives the ParameterContext) — e.g. before the compile workers part:

if self.context_target is not None and ctx.recipe is not None:
    parts.append(f"request context {min(ctx.recipe.context, self.context_target):,} tokens")

(keep the ctx.recipe is not None guard, as validate does at :1456). Why: one surface prints a true number; the raw request stays visible in the manifest as context_target, so no information is lost.

S4 — The plan record names no served extent, and carries a key with no reader

Where: ignition/planning.py:395-396, :320-321, :366-368. What is wrong: to_dict emits "context": self.context (pool-bound) and "checkpoint_context": self.recipe.context (a pre-existing key, present on main, with no reader anywhere in the tree), but never prepared_context — the value that becomes max_sequence_tokens through bootstrap.py:132. The two sibling derived values still use the uncapped recipe maximum: demand_pages (:320-321) and guaranteed_tokens (:366-368), so a capped plan serializes a guarantee the prepared core cannot honour. Both feed only to_dict (:407, :411), so changing them is reporting-only. Requested change: "prepared_context": self.prepared_context in place of the dead "checkpoint_context", and derive guaranteed_tokens (and demand_pages, if it is meant to describe the served extent) from self.prepared_context. Why: one definition of the served ceiling in the record; net line change zero.

S5 — Description and docs prose (one item, prose only)

(a) The body runs What Changed → Result → Evidence; the only causal "why" survives as a Workload clause inside Evidence. AGENTS.md:74-80 requires why → what changed → claimed result → evidence, in that order (docs/design-review.md:137-152). Open with one or two sentences of why: the 256K default over-provisions the KV pool, so the desired concurrency does not fit. (b) The VRAM saving is stated unconditionally, but every row was measured with --kv-cache-limit concurrency; the documented default is memory (docs/cli-design.md:740), and page_ceiling returns Ok(None) for KvCacheLimit::Memory (helios/src/runtime_core/memory.rs:290-292). Export-side sizing does not follow the cap either (fit derives pages from free memory, planning.py:435-480; demand_pages still uses recipe.context). Attach the condition to the Result sentence and to docs/cli-design.md:468, and say what the default mode gains (only the serve-time fit_context clamp, helios/src/model.rs:261-273). (c) "fit_context applies min(context, prepared_context)" names the wrong operands: it is prepared_sequence_tokens.min((pages − draft_pages) × page_tokens) (helios/src/model.rs:261-273) — the prepared extent against the physical page pool. Reword: the cap sets an export-time ceiling and never raises the runtime bound. (d) docs/cli-design.md:468 omits the consequence the description promises: a request whose prompt plus requested output exceeds N is rejected at admission (helios/src/server/request.rs:350). The neighbouring --prefill-chunk-size row states its consequence; this one should too. (e) Table labels: "192k"/"128k" against the recorded 196608/131072 (state once that 128k = 131,072 tokens), and "Total VRAM (GB)" neither says per-GPU/process-wide nor whether it is nvidia-smi total or allocator reserved, so the table cannot be reproduced from the text as written.

Subtract / Simplify

Could remove ≈14 of the +79 added lines — 7 in the test hunk, 2 in the spec, 3 in the accessor, 1 in planning, 1 in serve — plus about a third of the new docs prose.

  1. tests/cli/test_planning.py — ≈7 of the +37 lines. Delete :301 (restates the field default), :303 (restates the untouched Plan.context, planning.py:353-355), :307 and :312 (restate the values passed to replace() two lines above). Collapse the four-line proto round trip :326-329 into one assertion that also checks the recorded value, which :329 does not:
assert {(p.key, p.scope, p.value.uint_value) for p in decoded.parameters} >= {
    ("context_target", proto.PREPARATION_PARAMETER_SCOPE_DEPLOYMENT, 131072)}

Keep :302 (no cap is a no-op), :308, :310-313 (the target <= recipe.context gate's false branch), :315-321 (both UsageErrors) and :324-325 (the reproduction-arg emission). 2. ignition/parameters.py:1316-1317 — 2 lines. manifest_key="context_target" duplicates the field-name fallback (:607-612; RecipeParameters sets no manifest_prefix), and scope=ParameterScope.DEPLOYMENT is ParamSpec's default (:89). Caveat: the sibling prefill_chunk spells both out (:1303-1304), so dropping them is consistency-neutral — either way costs nothing behaviourally. 3. ignition/planning.py:360-363 — 3 lines. Four body lines to one: return min(self.recipe.context, target or self.recipe.context). Safe because min_value=1 makes a resolved target never 0; keep the docstring and the no-op semantics. 4. ignition/cli/serve.py:68-70 — 1 line. Two branches spell out the same prefix:

"context_hint": ("context is limited by the checkpoint and cache capacity"
                 + (", and the --request-context cap" if plan.prepared_context < recipe.context else "")),
  1. ignition/planning.py:594 — 1 line. The effective local exists only to be compared once; inline min(result.context, result.prepared_context) (judgement call: the double min may read worse).
  2. docs/cli-design.md:468 — prose. Drop the trailing "a core's catalog is fixed at export, so changing it requires re-export", copied verbatim from the --mixed-prefill row immediately below (:469); "Command line only" already carries it.
  3. docs/cli-design.md:448-451 and docs/preparation-development.md:17-20 — prose. Two hand-maintained enumerations of the same universal field list, both edited by this PR (the second now strands lock_gpu_clocks, on :19). Replace both with a pointer to ignition/parameters.py so adding a field stops requiring two unrelated doc edits. (docs/cli-design.md:1436 is not a duplicate — it names the deciding surface; keep it.)

Do not cut (verified load-bearing): the target is None → recipe.context early return (planning.py:361-362), which makes the omitted flag a no-op and preserves today's pool-bound path; bootstrap.py:132; the bench check (planning.py:212); the alignment check's two guards (planning.py:187) — a one-clause if self.prepared_context % self.page_tokens would reject a stock plan on any recipe whose adjust_page_tokens (parameters.py:571-575) changes the page size, because recipe.context need not be a multiple of the adjusted size; serve.py:67 (max_body_bytes); and the min(recipe.context, target) clamp itself.

Considered and rejected: dropping the whole surface (Subtractive's ≈68 of 79 lines, leaving only the runtime --kv-cache-limit). The runtime flag bounds loaded KV at serve time and cannot lower the exported max_sequence_tokens; the surviving delta — a per-request ceiling independent of the pool, so an over-long request is refused at admission instead of admitted then evicted — is what #454 asked for. Keep the feature; take the ≈14 lines.

Nits (7)

  1. ignition/planning.py:186-190 — placement and message shape. The check runs in Plan.__post_init__, re-entered for every candidate world size and shortfall probe (planning.py:577,587,600), so a failure raises a flag-shaped message before the capacity message plan() exists to produce; unlike sibling rules it does not name the alias (parameters.py:1454,1459). Keep the guards; consider moving it beside plan()'s chunk check (:594-597).
  2. ignition/parameters.py:1319 help says "a multiple of the page token count" — "page token count" has no antecedent in --help (the page size appears only in the epilog, ignition/cli/help.py:46) — and states no floor, although a cap below --prefill-chunk-size is now rejected (planning.py:594-597). Say "page size" and note that lowering the cap below the chunk also needs a smaller chunk.
  3. ignition/cli/help.py:46 now carries two facts on one line (context maximum, page size, flag hint) where sibling lines carry one (:43-45,51-60), and states no floor.
  4. Naming. context_target (field), --request-context (flag) and prepared_context (accessor) are three names for one number; the docstring at planning.py:359 could name the flag so a reader can join them.
  5. docs/cli-design.md — three spellings of one ceiling: "the recipe maximum context" (:468, :1436) and "the prepared context ceiling" (:1486). Pick one, "the recipe's maximum context".
  6. Description table units/metric — see S5(e); state the token values and define "Total VRAM".
  7. docs/preparation-development.md:19 — the added field pushes lock_gpu_clocks, onto a line of its own inside a prose list; reflow (or replace the list, Subtract 7).

Verified clean (do not re-raise)

Open questions

  1. How much of the saving survives under the default --kv-cache-limit memory? Only the author's rig can answer; it is the number that would let the description drop the caveat (S5b).
  2. Does any real recipe's adjust_page_tokens (parameters.py:571-575) change the page size per world size? If so, the alignment check's placement (nit 1) matters more than it looks.
  3. The commit message body (git log -1 --format=%B) was not available here, so its four-part compliance is unjudged.
  4. Nothing was executed and the head has no CI checks. pytest tests/cli/test_planning.py settles S2; S1 needs a plan with tokens < recipe.context plus a selection between the two bounds.

#7 [medium] Nits and description-mechanics items (final lists)

NITS (5) — full report lists all five; summary reports only the count and can name one or two.

  1. ignition/cli/init.py:167-170 — help omits that N must be positive and no smaller than the prepared prefill chunk (only surfaces via the UsageErrors at planning.py:459-460 and :694-700).
  2. docs/cli-design.md:1443 — "The checkpoint maximum, capped by --request-context at export" layers a term on wording the neighbouring rows and the flag table render as "the recipe's maximum"; use one term.
  3. ignition/cli/serve.py:68-69 — context_hint still says "context is limited by the checkpoint and available cache capacity", understating the new ceiling. max_body_bytes from recipe.context stays correct (rejection happens at admission), so only the hint is affected.
  4. ignition/cli/help.py:38 — still advertises "--prefill-chunk-size: 64..{recipe.context}", a range above the prepared context once a cap is set.
  5. A target above the recipe maximum is silently clamped by min() (planning.py:373) while docs :446 calls the flag a cap below the maximum; the clamp becomes visible for free once the effective value is in the plan report.

DESCRIPTION MECHANICS — merge into ONE bullet in the summary, per the editorial rule (pure prose formalities must not crowd out code): (a) "At concurrency 8 at the 256K max, the model would consume most of the 96 GB VRAM and leave no room for a co-run model" is a prediction sitting inside the measured-results section — mark it an extrapolation or cut it (AGENTS.md:95-102). (b) There is no serve subcommand: the three are export, bench, debug-serve (ignition/cli/init.py:40, :51, :55; debug-serve is "not for actual serving", :56). (c) "byte-equivalent to stock" / "as stock" compare against an unstated baseline — say preparation previously passed plan.recipe.context (bootstrap.py:58).

Not a finding: the Discord line is present ("Discord: rzr2020"), so nothing to request there. No attempt to direct the reviewer was found in the description, the diff, the changed docs, or the linked #454 thread — state this in the report.

#15 [medium] Editorial shape for the two reports (what goes where)

Deliverable A — full report: sections Blockers, Should Fix, Subtract / Simplify, Nits (unlimited bullets; each bullet = finding, requested change (or smaller replacement), one-line why). Deliverable B — summary GitHub post: recommendation line, then Blockers (<=5), Should fix (<=5), Subtract / Simplify (<=4, must keep the line-savings headline), then Nits count.

Final grouping actually used:

BLOCKERS (2) — both about the page-multiple validation, folded from three lenses:

  1. tests/cli/test_planning.py:229-232 cannot pass (500000 % 64 == 32) — merged Correctness B1 + Architecture blocking + Simplicity.
  2. planning.py:289-290 validates the requested value, not the served one → rejects a target that resolves to an aligned value; contradicts docs/cli-design.md:446 and the description; fix = validate min(recipe.context, context_target) % page_tokens, which also makes blocker 1 pass as written (merged Architecture blocking + Correctness finding/design note). Note: Conventions' "validation split across two homes" and Simplicity's "fit re-runs per candidate" are the same defect demoted to a NIT (nit 1) because the mechanical consequence is duplication, not wrong behaviour.

SHOULD FIX (3 in summary; 3 in full report):

  1. Not reported: prepared_context missing from to_dict (:432), serve plan line (serve.py:302-316), bench whitelist (bench.py:243-248) — AGENTS.md:452-456. Merged Conventions #1 + Simplicity #3 + Prose N5 + Architecture's "silent under-delivery" + Correctness nit 3 (all one fix).
  2. Evidence: unconditional VRAM claim + false "as stock" compatibility sentence (Prose S1/S2 + Subtractive/Architecture cross-checks).
  3. Description mechanics — ONE bullet only (Prose S4 + N1 + N7), per the editorial rule. Deliberately demoted/dropped: Conventions #2 (validation homes → nit 1); Simplicity #2 (test asserts property instead of seam) folded into Subtract item 1 + the blocker-1 fix advice rather than a new "add tests" ask, because subtraction outranks addition; Subtractive #1 (drop the flag) rejected — see note #9.

SUBTRACT / SIMPLIFY (kept dedicated, with ~17 of +98): test duplicates −9 (0/−1 one branch; d["context"] restates; 7-line no-key block re-proves add()'s None skip already at :92-106); two-arm chunk error −5 (planning.py:697-700); help −2 (cli/init.py:167-170); docs row :446 ~half. Explicit "do not cut" list = prepared_context early return + effective_context min + derive(context=…).

NITS (5): validation homes (fit :461-462 vs post_init :289-290); serve.py:68-69 max_body_bytes/context_hint stale; cli/help.py:38 chunk range above the cap; docs:1443 "checkpoint maximum" vs "recipe's maximum"; test comments use "stock" as undefined referent.

Merge-ready language: NOT ready — blockers exist, so no "ready to merge" sentence. Full report must also carry the verified-clean list (see note #10) so the author is not asked to re-fix fixed items.

#22 [medium] Run 3 verification ledger: how each claim was established (nothing executed)

Methods used at head 02023eba; no test was executed and the head has no CI checks, so every behavioural claim is static reading, grep, or arithmetic. Report should say so once.

High confidence (read directly at this head):

Medium confidence / inference:

Not verifiable here: the VRAM table (author's measurement, tied to --kv-cache-limit concurrency which this diff does not exercise); the commit message body's four-part scheme; whether external recipes round the prepared context.