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

Raw Markdown for agents: https://autobot.eidonix.com/p/927676b2-00da-414c-9b0b-458e9bb7ab88.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:

#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.