Subtractive scratchpad · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/a40c93a0-96e2-4742-9621-d63eb18e93f8.md

#1 [high] Blocking: the flag re-implements runtime --kv-cache-limit, and the stated memory payoff comes from the runtime flag

PR 533 adds --request-context N on export/debug-serve/bench, threaded derive()→plan()→fit()→Plan.context_target, plus Plan.prepared_context, used only by ignition/preparation/bootstrap.py:58.

What already exists:

Only delta the flag adds over --kv-cache-limit: it lowers the exported max_sequence_tokens so a single request longer than N is rejected. That is one datum (ignition/preparation/bootstrap.py:58 "context": plan.prepared_context → BasePreparationConfig.context, bootstrap.py:33) and is the entire payload of the PR.

Cost of the present shape (diff +35/−15):

Charter/AGENTS hooks: AGENTS.md:165-169 "Every contribution must address ... a demonstrated defect, a measured performance or memory problem"; charter "Look for the smallest footprint in shared code, or a way to solve it without new code at all."

#2 [high] Should fix: prepared_context duplicates Plan.context; smaller version is one line

ignition/planning.py:368-373 (new):

@property
def prepared_context(self) -> int:
    """The context the prepared core serves per request; the recipe max when no target is set."""
    if self.context_target is None:
        return self.recipe.context
    return min(self.recipe.context, self.context_target, self.tokens)

Plan.context (planning.py:363-366) is min(self.recipe.context, self.tokens). So min(recipe.context, N, tokens) == min(self.context, N) exactly. Smaller version (2 lines saved):

@property
def prepared_context(self) -> int:
    """The context the prepared core serves per request."""
    return self.context if self.context_target is None else min(self.context, self.context_target)

And the call site at planning.py:694 effective_context = min(result.context, result.prepared_context) is then redundant: with no target it is result.context, with a target it is already ≤ result.context. It can read effective_context = result.prepared_context if result.context_target is not None else result.context (same length, so no direct saving) — but with the shortened property the whole second property could be dropped and the two users (bootstrap.py:58 and planning.py:694) could read min(result.context, result.context_target or result.context); net ~4 lines.

#6 [high] Research summary

Reviewed PR #533 ("Cap the per-request context target", +35/−15 across 7 files) through the subtraction lens, against AGENTS.md, docs/design-review.md, the charter, and the maintainer's earlier review of the same change in closed PR #454.

Findings, ranked by lines saved:

  1. Blocking (~15 of the 35 added lines, plus the doc prose). The flag is a re-implementation of a runtime setting the PR's own evidence is measured with. flare run --kv-cache-limit concurrency|context|memory (docs/cli-design.md:738, :828-833; docs/model-preparation.md:396-402; page_ceiling, helios/src/runtime_core/memory.rs:284-331) already bounds the shared KV pool to one prepared context per active request, at core load, without re-export. The description's table is explicitly produced with --kv-cache-limit concurrency, so the measured pool = concurrency × prepared-context VRAM scaling is the pre-existing flag's documented behaviour. The one genuine delta is a lower exported max_sequence_tokens, i.e. one datum reaching one consumer (ignition/preparation/bootstrap.py:58). Maintainer yatesdr asked in #454 for "a concrete workload that --max-concurrency and --kv-cache-limit cannot serve"; this resubmission keeps the same shape and the same memory argument.

  2. Should fix (~6 lines). ignition/planning.py:692-701 turns the stock 3-line --prefill-chunk-size check into a 9-line branch with two messages; the generic message already names both numbers, so one message carrying the effective context replaces it. No test asserts either new string.

  3. Should fix (~4 lines). Plan.prepared_context (planning.py:368-373) duplicates Plan.context: min(recipe.context, N, tokens) is exactly min(self.context, N), so the five-line body collapses to two, and the extra min(...) at planning.py:694 disappears.

  4. Should fix (~2 doc lines + half of one row). docs/cli-design.md:446 repeats what the PR's own other two doc edits (:1443, :1493) already state, and repeats the runtime KV-limit semantics; it also advertises a "memory-constrained multi-model deployment", which AGENTS.md:171-175 lists as unapproved scope.

  5. Nit (~2 lines). derive()'s new context parameter (ignition/cli/preparation.py:56, :68) is a pure pass-through — all three callers pass the flag or nothing. Separately, Plan.to_dict() never records the new setting, so the printed plan and bench configuration cannot show what was prepared (AGENTS.md:452-456), and no test covers any of the new behaviour.

Smallest version: a single Plan field, one plan()/fit() keyword, one line in bootstrap.py and one docs row — roughly 15 of the 35 added lines removable, and the VM point that the flag's memory argument is already served by --kv-cache-limit.

#9 [high] Should fix: the new test block repeats its own assertions and the manifest helper's generic behaviour (~13 of +57 lines)

tests/cli/test_planning.py:211-265 is the new test (57 added lines, the largest single hunk in the PR: pr_files shows tests/cli/test_planning.py +57/-0). Candidates that prove nothing new:

  1. Clamp case duplicates the valid case. :224-227 asserts capped.prepared_context == min(recipe.context, 131072, capped.tokens); :230-232 asserts the same expression for 500000. With the property collapsed to min(self.context, self.context_target) there is no separate branch, so one case suffices. ~4 lines.

  2. context=0 and context=-1 hit one branch. planning.py:461-462 validates context <= 0 in a single check; two pytest.raises blocks (:235-238) exercise the same line. ~2 lines.

  3. d["context"] == capped.context (:247) restates :227. ~1 line.

  4. The "no context_target when unset" block (:259-265, 7 lines) re-proves from_plan's generic skip. rebuild_manifest.py:350-352 add() returns early on value is None for every parameter; the generic behaviour is already covered by the sibling tests' decode loop (tests/cli/test_planning.py:92-106). Also reproduction_arguments gating is the same is not None pattern used by every other flag (:266-319). ~6 lines.

  5. Wrong field asserted. :257 asserts by_key["context_target"].value.int64_value == 131072, but _preparation_value (rebuild_manifest.py:332-333) emits {'uint_value': value} for any non-negative int, so the oneof sets uint_value and int64_value reads 0. As written the assertion fails; the sibling pattern to copy is tests/preparation/test_native_publication.py:78 (uint_value=1). One line, wrong direction (a fix, not a deletion) — but it shows this block was not run.

Net: ~13 of the 57 added test lines carry no distinct behaviour. The test's own header comment (:212) and section comments (:217, :223, :229, :234, :240, :244, :249, :259) restate the assertions below them — another ~8 lines if the blocks are merged.

#11 [high] Report (updated, run at head de1b5b5) — verdict: make it smaller first; ~45 of 98 added lines removable

PR 533, head de1b5b5, base main: 9 files, +98/−18 (pr_files). That splits as +41/−18 in code and docs and +57/−0 in tests — superseding the "+35/−15 across 7 files" figure of entry #8.

Ranked findings (all previously recorded, plus the new test finding #9):

  1. Blocking (~28 lines) — the flag re-implements runtime --kv-cache-limit. Drop --request-context, Plan.context_target, the context= keyword on plan()/fit()/derive(), the <= 0 check, prepared_context and the chunk-branch rewrite; only ignition/preparation/bootstrap.py:58 survives as a no-op change. Evidence: the PR's own table is measured with --kv-cache-limit concurrency (docs/cli-design.md:738, :828-833; page_ceiling helios/src/runtime_core/memory.rs:284-331), and #454's maintainer asked for "a concrete workload that --max-concurrency and --kv-cache-limit cannot serve". (entry #1, wiring inventory in #10)
  2. Should fix (~13 lines) — tests/cli/test_planning.py:211-265 (+57) repeats itself: duplicate clamp case, duplicate 0/-1 rejections, a re-proved generic add()-skips-None path, plus one assertion on int64_value that cannot pass. (entry #9)
  3. Should fix (~6 lines) — planning.py:692-701 turns the stock 3-line chunk check into a 9-line two-message branch. (entry #3)
  4. Should fix (~4 lines) — prepared_context duplicates Plan.context: min(recipe.context, N, tokens) == min(self.context, N), and the extra min at :696 goes. (entry #2)
  5. Should fix (~3 doc lines) — docs/cli-design.md:446 repeats :1443 and :1493 (this PR's own other edits) and the KV-limit section; the removed prose also cites the multi-model hosting scope AGENTS.md:171-174 rejects. (entry #4)
  6. Nit (~2 lines) — derive()'s context parameter is a pure pass-through; to_dict() records context_target but not the effective prepared_context the boot config actually uses (planning.py:432 vs bootstrap.py:58). (entry #5)

Total removable: ~30 code lines of the 41, ~13 of the 57 test lines, ~2-3 of the 5 doc lines — roughly 45 of the 98 added lines, 70 of them if the flag goes entirely with the runtime argument.

Left behind: ignition/cli/serve.py:68-69 (max_body_bytes from recipe.context, context_hint still "limited by the checkpoint"), ignition/cli/help.py:38 (--prefill-chunk-size: 64..{recipe.context}), ignition/bench/runner.py:388 (validates against layout.context, i.e. the pool-bound value, while the new bench path caps preparation).

File-by-file: entry #7 (unchanged; bootstrap.py:58 is the sole load-bearing hunk).

#12 [high] Research summary

Reviewed PR #533 at head de1b5b5 through the subtraction lens, against AGENTS.md, docs/design-review.md (not opened), the charter, and the maintainer's earlier review of the same change in closed PR #454.

The head moved since my last pass, so counts are corrected: 9 files, +98/−18 — +41/−18 in code and docs, +57/−0 in tests (not the "+35/−15 across 7 files" I reported before).

Findings, ranked by lines saved (all in the scratchpad, entries #1-#5, #9-#11):

  1. Blocking, ~28 lines — the flag re-implements runtime --kv-cache-limit. The PR's own VRAM table is measured with --kv-cache-limit concurrency (an existing runtime flag applied at core load, docs/cli-design.md:738, :828-833; page_ceiling in helios/src/runtime_core/memory.rs:284-331), and #454's maintainer asked for a workload that flag cannot serve. The only genuine delta is one integer reaching ignition/preparation/bootstrap.py:58.
  2. Should fix, ~13 of the 57 test lines (new this pass) — tests/cli/test_planning.py:211-265 repeats itself: the clamp case re-asserts the same min() as the valid case, 0 and -1 hit one <= 0 branch, and the seven-line "no context_target when unset" block re-proves from_plan's generic add()-skips-None rule. Also, :257 asserts value.int64_value while _preparation_value (rebuild_manifest.py:332-333) emits uint_value for a non-negative int — that assertion cannot pass.
  3. Should fix, ~6 lines — planning.py:692-701 turns the stock three-line prefill-chunk error into a nine-line two-message branch; one message naming the effective context suffices.
  4. Should fix, ~4 lines — prepared_context (planning.py:370-375) duplicates Plan.context: min(recipe.context, N, tokens) is min(self.context, N), which also makes the extra min at :696 dead.
  5. Should fix, ~3 doc lines — docs/cli-design.md:446 states what the PR's own other two edits (:1443, :1493) already state, and its prose advertises the multi-model hosting scope AGENTS.md:171-174 rejects.
  6. Nit, ~2 lines — derive()'s context keyword is a pure pass-through, and to_dict() records context_target but not the effective prepared_context the boot config actually uses.

Total removable: roughly 45 of the 98 added lines (about 30 of the 41 code lines, 13 of the 57 test lines, 2-3 of the 5 doc lines) — about 70 if the flag is dropped altogether and the runtime --kv-cache-limit carries the argument. Left behind: ignition/cli/serve.py:68-69 (max_body_bytes and context_hint still sized/worded from the recipe max), ignition/cli/help.py:38, and ignition/bench/runner.py:388.

#13 [high] Correction: earlier notes #5/#8 said "no test covers the new behaviour" — false at head de1b5b5

Stale claims that the final report must not repeat (the head moved from the commit I reviewed to de1b5b5):

  1. "No test asserts any of the new behaviour" (entry #5, item 4; entry #6; entry #8 "Open questions"). False at de1b5b5: tests/cli/test_planning.py:211-265 adds test_request_context_target_prepared_context_and_manifest (+57 lines) covering the no-op path, the clamp, both validations, to_dict() and the manifest keys. grep -n "prepared_context\|context_target\|request_context" tests/ now returns tests/cli/test_planning.py:211-265 only. The test's own problem is the opposite one — it repeats itself (entry #9) — and :257 asserts int64_value where _preparation_value (rebuild_manifest.py:332-333) emits uint_value, so that line cannot pass.

  2. "+35/−15 across 7 files" (entries #1, #6, #7, #8). Actual at de1b5b5 (pr_files): 9 files, +98/−18 — docs/cli-design.md +3/−2, ignition/cli/init.py +4/−0, ignition/cli/bench.py +2/−1, ignition/cli/preparation.py +2/−2, ignition/cli/serve.py +3/−3, ignition/planning.py +23/−9, ignition/preparation/bootstrap.py +1/−1, ignition/preparation/rebuild_manifest.py +3/−0, tests/cli/test_planning.py +57/−0. Code+docs = +41/−18; tests = +57/−0.

  3. Unchanged and still true: ignition export M --ranks 2 --request-context N does now forward the flag (cli/serve.py:206), so the autobot blocker "multi-host never passes context" is fixed at this head; Plan.__post_init__ does now validate the page multiple (planning.py:289-290, reflecting Helios' catalog.rs:50-57 requirement); to_dict()/reproduction_arguments/from_plan all record the setting (planning.py:432, rebuild_manifest.py:264-265, :390). So the "left behind" list shrinks to serve.py:68-69, cli/help.py:38 and bench/runner.py:388.

#15 [high] Report of 2026-11-26, run at head 02023eba — verdict: make it smaller first; ~36 of 84 added lines removable

PR #533 "Cap the per-request context target", head 02023eba, base main. pr_files: 9 files, +84/−18 — docs/cli-design.md +3/−2, ignition/cli/init.py +2, bench.py +3/−1, preparation.py +1/−1, serve.py +5/−4, ignition/planning.py +19/−9, preparation/bootstrap.py +1/−1, rebuild_manifest.py +3, tests/cli/test_planning.py +47. Code+docs = +37/−18; tests = +47.

VERDICT: make it smaller first. ~36 of 84 added lines removable without losing behaviour; ~75 if the flag is dropped and the runtime --kv-cache-limit carries the argument.

RANKED FINDINGS (all verified by reading the code at pr/533):

  1. BLOCKING (~20 code + 47 test + 3 doc lines) — the whole --request-context surface re-implements the existing runtime flag. Surface: cli/init.py:167-168 (flag + help), cli/preparation.py:55 (keyword), :69 (forward), cli/bench.py:177, cli/serve.py:207/291/476, cli/serve.py:319 (plan line), planning.py:186 (field), :260 (bench check), :377-381 (property), :438 (to_dict), :467-468 (<=0 check), :461/:549/:602/:689 (keywords+forward), :709-711 (chunk check), bootstrap.py:58, rebuild_manifest.py:264-265, :389, docs/cli-design.md:446/1443/1493. The PR's own evidence table is measured with --kv-cache-limit concurrency (existing runtime flag: docs/cli-design.md:738 default memory, :828-833 semantics; page_ceiling helios/src/runtime_core/memory.rs:284-331). The only datum this PR adds is a lower exported max_sequence_tokens, which flows through exactly one load-bearing line: bootstrap.py:58 "context": plan.prepared_context -> BasePreparationConfig.context (bootstrap.py:33) -> helios/src/server/config.rs:131 -> limits.max_sequence_tokens (:148), narrowed to the pool at helios/src/model.rs:268-272 and validated at helios/src/model/catalog.rs:48-57. Smaller version: drop --request-context from all four entry points, drop Plan.context_target and prepared_context; optionally one BasePreparationConfig.context integer if a cap is wanted. Nothing the runtime flag does is lost; the only lost datum is a lower request ceiling. Cite: AGENTS.md:165-169 (need must be a demonstrated defect or measured problem), :188-193 (no configuration switches without concrete requirement), charter "smallest footprint in shared code, or a way to solve it without new code at all"; #454 maintainer review asked for "a concrete workload that --max-concurrency and --kv-cache-limit cannot serve" and the resubmission does not answer it.

  2. BLOCKING-ish (~2 test lines, and a description claim with no code) — two assertions in the new test cannot pass because the code they test is not in the diff. tests/cli/test_planning.py:238-240 pytest.raises(UsageError, match="multiple of the") for context=100: there is NO page-multiple validation at this head. grep "multiple of" ignition/planning.py finds only the pre-existing prefill-chunk check at :636-637, which context=100 does not trip (default chunk 4096 is a multiple of 64 and ≤ recipe.context). So planning.plan(...) returns normally and the assertion fails. tests/cli/test_planning.py:254 by_key["context_target"].value.int64_value == 131072: _preparation_value (rebuild_manifest.py:330-333) emits uint_value for a non-negative int, so int64_value reads 0. The description's "a page-multiple validation" and "distinguishes the default chunk from an explicit one" are therefore accurate about a different (earlier) head, not this one; the chunk branch at planning.py:709-711 is already the single stock-style message. Fix: delete :238-241 and either delete :254 or assert uint_value. ~4 lines.

  3. SHOULD FIX (~13 of the +47 test lines) — the new test block repeats itself and re-proves generic helper behaviour. tests/cli/test_planning.py:229-232 clamp case duplicates :223-227 with a larger N (~4); :242-244 to_dict() restates the field already asserted at :225 (~1 could stay, but the d temp is one line); the int64_value line above (~1); the manifest round-trip at :247-253 duplicates the sibling manifest test at :92-106 which already asserts scope+value through from_plan (~4). Keep: the no-op case, one capped case, one rejection, one manifest key check.

  4. SHOULD FIX (~6 lines) — the <= 0 validation sits in fit (planning.py:467-468), which plan() re-enters once per candidate world size and per shortfall probe (:689, :693-705); it costs a re-check on every attempt and is the only validation of a flag outside Plan.__post_init__. Since Plan already validates every other flag there (:266-296), and the test drives everything through planning.plan(...), it can move or go with finding 1.

  5. NIT (~1-2 lines) — prepared_context's three-line body. planning.py:377-381 if self.context_target is None: return self.recipe.context / return min(self.recipe.context, self.context_target, self.tokens) equals return self.recipe.context if self.context_target is None else min(self.context, self.context_target). NOTE: the context_target is None early return is LOAD-BEARING (it must return recipe.context, which can exceed the pool-bound self.context, or the no-op claim breaks) — do not fold it away. The min(result.context, result.prepared_context) at :709 is also load-bearing for the no-target case.

  6. NIT (~2 doc lines) — docs/cli-design.md:446 states the cap three times across the PR's own rows: :446 (flag table), :1443 ("capped by --request-context at export"), :1493 ("capped by --request-context"). Keep the flag row; the two owner-table rewords restate it. Also the row's "Command line only; a core's catalog is fixed at export, so changing it requires re-export" repeats the identical clause --mixed-prefill carries at :447.

LEFTOVER (code this change supersedes but does not update; small, and moot if finding 1 is taken):

VERIFIED CLEAN (do not re-raise): the seam is right — bootstrap.py:58 is the whole mechanism; omitting the flag is byte-equivalent to main; all four entry points forward the flag (serve.py:207/291/476, bench.py:177); reproduction args and the manifest record it (rebuild_manifest.py:264-265, :389); bench's required_context check now uses prepared_context (planning.py:260); Plan is frozen with a defaulted field so existing constructions work.

NOT VERIFIED HERE: nothing was executed (no CI checks on the head). Claims 2's failures are arithmetic + schema reads. docs/design-review.md was not opened.

#16 [high] Research summary

Reviewed PR #533 at head 02023eba (+84/−18 across 9 files: +37/−18 code+docs, +47 tests) through the subtraction lens, against the charter, AGENTS.md:72-112/:165-199 and the maintainer's earlier review of closed #454. Findings are in scratchpad entry #15, ranked by lines saved.

Verdict: make it smaller first — about 36 of the 84 added lines can go without losing behaviour, ~75 if the flag is dropped.

Biggest items: (1) the whole --request-context surface (planning.py field/property/checks/forwards, four CLI entry points, manifest entries, docs rows, the test) re-implements the existing runtime --kv-cache-limit, and the PR's own VRAM table is measured with that runtime flag; the sole load-bearing line is bootstrap.py:58 passing plan.prepared_context into BasePreparationConfig.context, which reaches Helios max_sequence_tokens via helios/src/server/config.rs:131 (not opened),148. (2) Two assertions in the new test cannot pass at this head: context=100 is rejected by no code (planning.py has no page-multiple check — only the pre-existing prefill-chunk one at :636), and :254 asserts int64_value where _preparation_value emits uint_value. (3) The test block repeats its own cases and re-proves generic add()-skips-None behaviour already covered by the sibling manifest test. (4) fit's <= 0 check runs on every candidate re-entry instead of in __post_init__ beside the other flag validations. Left behind: serve.py:68-69, cli/help.py:38, bench/runner.py:388 still describe the recipe maximum as the served context. I also confirmed what is load-bearing and must not be cut: the context_target is None early return and the min(result.context, result.prepared_context) at :709.

Nothing was executed (no CI checks on the head); the failing-assertion claims are arithmetic and schema reads.

#17 [high] Line-savings tally and count provenance for the final report (head 02023eba)

Counts (provenance: pr_files at head 02023eba):

Savings tally, ranked (each verified in the code at pr/533, details in entry #15):

  1. Drop the whole --request-context surface: ~20 code lines (cli/init.py:167-168; cli/preparation.py:55,69; cli/bench.py:177; cli/serve.py:207,291,319,476; planning.py:186,260,377-381,438,467-468 plus the context= keywords at :461,:549,:602,:689 and the :709-711 rewrite; rebuild_manifest.py:264-265,389) + all +47 test lines + 3 doc lines (cli-design.md:446,1443,1493). Total ≈70 of 84. This is the ceiling if the argument holds; entry #15 states the one surviving line if a cap is still wanted (bootstrap.py:58 with one BasePreparationConfig.context integer ≈ 12-15 lines total).
  2. Remove the two unfounded test assertions (test_planning.py:238-241 page-multiple block, :254 int64_value) → ~5 lines.
  3. Trim the repeated test cases (test_planning.py:229-232 clamp duplicate, :242-244 to_dict restatement, :247-253 manifest round-trip duplicating tests at :92-106) → ~9-10 lines.
  4. Move/merge the <= 0 check out of fit (planning.py:467-468) into post_init beside :266-296, or delete with finding 1 → ~2 lines.
  5. Collapse prepared_context body (planning.py:377-381) → ~1-2 lines; keep the None early return and keep the min at :709.
  6. Trim docs duplication (cli-design.md:446 vs the PR's own :1443 and :1493, plus the re-export clause copied from :447) → ~2-3 lines.

Sum without dropping the flag ≈ 36 of 84; with the flag dropped ≈ 70-75.

Do-not-cut list (verified, previously mis-claimed as dead in earlier rounds): planning.py:377-380 context_target is None -> recipe.context; planning.py:709 effective_context = min(result.context, result.prepared_context); the context= keyword on derive()/plan()/fit() as the single funnel for the four entry points.

Not executed: no CI checks on this head; every behavioural claim in the report is arithmetic or schema reading. docs/design-review.md was not opened.

#19 [high] Should fix: the new test's clamp case cannot pass — the max bound rejects targets above the recipe max — and the oversized block plus three restatements are ~11 of +37 test lines

Head 9118add, diff +69/−5 across 6 files (code+docs +32/−5, tests +37/−0).

The flag declares max_fn=_recipe_context_limit (ignition/parameters.py:1316; _recipe_context_limit at :1268 returns context.recipe.context). RecipeParameters.validate (:1440) ends in super().validate(ctx) → validate_fields (:505) which, with min_value=1 and that max, raises --request-context for <alias> must be 1 through 262,144 for any target above the recipe max (:533-545). plan() validates before sizing (ignition/planning.py:540) and fit() validates again (:456).

Consequence: tests/cli/test_planning.py:310-313

oversized_params = replace(base_params, context_target=500000)
oversized = planning.plan(..., parameters=oversized_params)
assert oversized.parameters.context_target == 500000
assert oversized.prepared_context == recipe.context

raises UsageError before the asserts (fixture: context=262144, page_tokens=64, tests/cli/test_planning.py:139-140). 4 lines dead, and they encode a clamp the code does not have.

Other removable test lines (11 total, of the +37):

#20 [high] Nit: three of the 13 added ParamSpec lines restate defaults, and prepared_context's clamp is unreachable — ~4 code lines

ignition/parameters.py:1309-1321 (+13) declares the field. Three lines restate ParamSpec defaults declared at ignition/parameters.py:86-91:

ignition/planning.py:357-363 (+4):

target = self.parameters.context_target
if target is None:
    return self.recipe.context
return min(self.recipe.context, target)

Because max_fn already rejects target > recipe.context (see the test note), the min can never clamp. Smaller, 3 lines:

target = self.parameters.context_target
return self.recipe.context if target is None else target

(1 line saved; the None branch stays — it is what makes the omitted flag a no-op.)

#21 [high] Should fix: the recipe-max clamp is implemented twice (parameters.py max_fn and planning.py min) and the docs describe the dead one

Head 9118add. The clamp exists twice and only one copy is live:

So docs/cli-design.md:468 ("resolves to the smaller of N and the recipe maximum") and the PR description's "min(recipe.context, N)" describe behaviour the code rejects. Pick one and delete the other:

Either way one of the two statements goes; 1 line.

Doc duplication: the flag row's trailing "a core's catalog is fixed at export, so changing it requires re-export" repeats the identical clause in the --mixed-prefill row immediately below (docs/cli-design.md:469). Drop it from the new row; 0 lines saved but it shortens the row.

docs/cli-design.md:1436 (the owner-table "Context limit" row) is the one owner row the flag now changes — it is not a duplicate of :468 (the flag table lists flags; the owner table says which surface decides). Keep.

Left behind / not updated in the same change:

#22 [high] Report of 2026-11-26 (head 9118add) — verdict: near-minimal; ~16 of 69 added lines removable with the flag, ~68 without

Head 9118add, pr_files: 6 files, +69 / −5. Per file: 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. Code+docs = +32/−5; tests = +37/−0.

(The orientation packet says 6 files +69/−5; an earlier note in my scratchpad quoted +84/−18 from a superseded head — use +69/−5.)

Removable, ranked:

  1. Drop the flag's whole surface if the maintainer holds that the memory argument is the runtime --kv-cache-limit's: ≈68 of 69 lines (parameters.py:1309-1321 = 13, planning.py:186-190 + 357-363 + 212 = ~14, serve.py:67-68 = 2, bootstrap.py:132 = 1 with the −1 restored, docs 2, tests 37). The one thing lost is a lower exported max_sequence_tokens, i.e. serving rejecting a request longer than N — the datum #454 asked to see justified.
  2. Tests: 11 of the 37 (4 of them cannot pass — entry #19).
  3. parameters.py spec: ~3 lines that restate ParamSpec defaults (entry #20).
  4. planning.py:363: 1 line once the max_fn/min duplication is settled (entry #21).
  5. docs: 1 clause + the row's re-export sentence (entry #21).

Total with the flag kept: about 16 of 69. With the flag dropped: about 68 of 69. Verified load-bearing (do not propose cutting): bootstrap.py:132 ("context": plan.prepared_context) is the entire mechanism; planning.py:364-362's target is None → recipe.context branch is what makes the omitted flag a no-op; planning.py:212 (bench compares prepared_context); the page-multiple check at planning.py:186-190 (Helios rejects a misaligned max_sequence_tokens at load, helios/src/model/catalog.rs:48-57, and ignition has no other page-alignment guard on this value); serve.py:67-68 (the two user-visible bounds — this closes the previous round's "left behind" finding).

#23 [high] Report of 2026-11-26, run at head 9118add — the change is near-minimal; 16 of 69 lines removable

Head 9118add. PR 533, +69/−5 across 6 files (code+docs +32/−5, tests +37/−0). Verdict: near-minimal; the shape is right (one optional param field, one accessor, one seam line, one serve-side bound pair) and I would not ask for rework — the remaining cuts are ~16 of 69 lines, or ~68 if a maintainer holds that the memory argument belongs to the runtime --kv-cache-limit.

Findings, ranked by lines saved:

  1. ~68 of 69 (blocking-if-the-argument-fails, otherwise out of my lens to decide): the flag's whole surface. The PR's own VRAM table is measured under --kv-cache-limit concurrency (docs/cli-design.md:740, flare-cli/src/cli.rs:890-903), a runtime flag that already bounds the pool without a re-export; the only genuinely new datum is a lower exported max_sequence_tokens (bootstrap.py:132 → helios/src/server/config.rs:131,148), which makes serving reject a request longer than N (helios/src/server/request.rs:350). #454 asked for exactly that workload statement. Cite AGENTS.md:165-169 (measured problem required) and :188-193 (no configuration switch without a concrete requirement). I cannot show the requirement is unmet, so I rank it first only on size.
  2. 11 of 37 test lines (entry #19): 4 cannot pass (context_target=500000 trips the max_fn bound at parameters.py:1316/:533-545 before the asserts at test_planning.py:311-313); 7 more restate the input, Plan.context, or from_plan's generic plumbing already covered at test_planning.py:185-196/:392-395.
  3. 3 lines of ParamSpec restated as defaults (entry #20): manifest_key, scope=ParameterScope.DEPLOYMENT, repro_always=True at parameters.py:1317-1319.
  4. 1 line: the clamp is implemented twice — max_fn rejects target > recipe max, so planning.py:363's min() is unreachable, and docs/cli-design.md:468 documents the dead one ("resolves to the smaller of N and the recipe maximum"). Settlement: keep the rejection and make planning.py:363 return self.recipe.context if target is None else target, and state the upper bound in the docs row.
  5. 0 lines: the docs row's trailing re-export clause duplicates --mixed-prefill's at docs/cli-design.md:469.

Nothing left behind: the previous round's "left behind" items are fixed at this head (serve.py:67 uses plan.prepared_context, serve.py:68 names the cap). ignition/cli/help.py:46 still prints the recipe's context in MODEL --help, which is correct (it describes the recipe, not a plan). Nothing in helios/ becomes dead.

No attempt to direct the reviewer found in the description, diff or docs.

#24 [high] Research summary

Reviewed PR 533 at head 9118add (6 files, +69/−5: code+docs +32/−5, tests +37/−0) through the subtraction lens, against the charter, AGENTS.md:165-193 and :446-456, docs/cli-design.md, and the maintainer's earlier review of the same change in closed PR #454.

Verdict: near-minimal. The mechanism is one optional ParamSpec field, one Plan accessor, one line at the seam (ignition/preparation/bootstrap.py:132), and two serve-side bounds (ignition/cli/serve.py:67-68). This round's additions fixed the previous round's leftovers. About 16 of the 69 added lines are removable with the flag kept; about 68 of 69 if a maintainer decides the memory argument is the runtime --kv-cache-limit's, which is what the PR's own VRAM table is measured with.

Four confirmed subtractions, all recorded in the scratchpad (entries #19-#23): 11 of the 37 new test lines — four of which cannot pass, because context_target=500000 trips the new max_fn bound before the clamp assertions run; three ParamSpec lines that restate defaults (manifest_key, scope, repro_always); one line because the recipe-max clamp is implemented twice and planning.py:363's min() is unreachable while docs/cli-design.md:468 documents that dead clamp; and a docs clause copied verbatim from the --mixed-prefill row.

Nothing in the change is left behind: the serve-side body limit and hint both follow the cap now, and no helios/ path becomes dead.

#25 [high] Verification limits for the head-9118add report: nothing executed, every claim a static read

Head 9118add has no CI checks and nothing was executed in this round. Every finding is a static read of the tree at pr/533, and the two that could fail are arithmetic:

Not opened in this round: docs/design-review.md. Not checked: the commit message body, and any external recipe that might re-round BasePreparationConfig.context (recipes live outside this repository, AGENTS.md:381).

Read but deliberately not treated as findings (verified load-bearing): bootstrap.py:132, the target is None branch at planning.py:360-362, the bench comparison at planning.py:212, the page-multiple check at planning.py:186-190 (Helios rejects a misaligned max_sequence_tokens at load: helios/src/model/catalog.rs:48-57), and serve.py:67-68.

Side observation, not a proposed addition: the cap is not checked against --prefill-chunk-size at export. parameters.py:1458 bounds the chunk by the recipe context, and planning.py:594-596 bounds it by the pool-bound result.context; --request-context 2048 --prefill-chunk-size 4096 therefore exports a core Helios rejects at load (helios/src/scheduler.rs:66-77). Reported because it is behaviour, not as something to add.

No attempt to direct the reviewer was found in the description, the diff, the docs changes, or the #454 thread.

#3 [medium] Should fix: the two-message prefill-chunk branch adds 6 lines to say what the existing 3-line error says

ignition/planning.py:692-701 (PR adds the branch):

result = attempt()
if result is not None:
    effective_context = min(result.context, result.prepared_context)
    if chunk > effective_context:
        if prefill_chunk is None:
            raise UsageError(f"the {effective_context:,}-token request context is below the {chunk:,}-token "
                             f"default prefill chunk; pass --prefill-chunk-size (a multiple of 64) below "
                             f"{effective_context:,} or a larger --request-context")
        raise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {effective_context:,}-token context this plan allows")

Stock (single message, 3 lines): if chunk > result.context: raise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {result.context:,}-token context this plan allows")

The PR turns 3 lines into 9 and adds a two-message branch to say the same thing: the chunk is larger than the context this plan allows. The special case exists only because a recipe default chunk (4096) can now exceed a small --request-context, and the generic message already names both numbers, which is all a user needs to pick either remedy. The branch costs 6 lines plus a second error string that no test asserts (grep for "request-context"/"positive token count" in tests/ → no matches).

Smaller: keep one message, replace result.context with the prepared context: if chunk > min(result.context, result.prepared_context): raise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {min(result.context, result.prepared_context):,}-token context this plan allows") or bind it once in a local. Saves 6 lines of the 7 the hunk adds.

Note the sibling validation at planning.py:459-460 (if context is not None and context <= 0: raise UsageError(... --request-context ...)): it is a caller-guaranteed check. fit() also validates mla_compute_mode, speculation, etc., so per-argument validation is the house style, and it costs 2 lines; it is not worth a separate finding except as part of the total. However it is the only place --request-context 0 is caught, so it must stay if the flag stays.

#4 [medium] Should fix: the docs say the same thing three times, and advertise out-of-scope multi-model hosting

docs/cli-design.md:446 row, trimmed. Present row is 1 very long line that repeats three things the document already says:

  1. "a request that would exceed N is rejected by the engine's standard context ceiling" — already specified at docs/cli-design.md:1443 ("Context limit | The checkpoint maximum, capped by --request-context at export") and :1493 ("Context limit | The smaller of the prepared context ceiling, capped by --request-context, ..."). Those two table rows are the PR's other two doc edits (:1443, :1493) and say the same thing a third time.
  2. "since the per-request cache allocation is sized from the prepared context" — already true for every core and documented at :828-833.
  3. "Command line only; a core's catalog is fixed at export, so changing it requires re-export" — the same trailing sentence is already carried by --mixed-prefill (:447) and by --kv-cache-limit's note that the runtime flags need no re-export (:874-876).

Smaller, one row:

| --request-context N | Cap the prepared per-request context and max_sequence_tokens at N tokens; shorter contexts need less KV per active request. Command line only; changing it requires re-export. | The recipe's maximum context |

and drop the :1443 and :1493 edits (the flag then appears once, in the flag table). ~2 doc lines + roughly half the 446 row's prose. Note the prose also contradicts the change's own rationale: it advertises "a memory-constrained multi-model deployment", which AGENTS.md:171-175 lists as unapproved scope ("multi-model hosting and routing ... require an explicit maintainer decision").

#5 [medium] Nit: the new setting is invisible in the plan report, and derive()'s new parameter is a pure pass-through

  1. Plan.to_dict() (ignition/planning.py:389-442) does not include prepared_context or context_target, although every other plan setting is recorded there (context, checkpoint_context, prefill_chunk, mixed_prefill, ...). AGENTS.md:452-456 requires the plan, its printed report, and recorded measurements to describe what was prepared; the flag changes max_sequence_tokens yet the printed plan and the bench details["configuration"] = plan.to_dict() (ignition/cli/bench.py:237) cannot show it. Fixing this is an addition, so as a subtraction: if the flag is kept, drop the field and derive the value at the single consumer.

  2. Dead/one-sided flag surface: --request-context is added to _preparation_arguments (ignition/cli/init.py:136-170), which serves export, bench and debug-serve — but NOT flare run (docstring of _server_options at ignition/cli/serve.py:60-72 comments "Derive native server settings independently of preparation's physical KV backing", max_body_bytes still uses recipe.context, not the prepared context). So the docs' claim that a request beyond N "is rejected by the engine's standard context ceiling" holds only because the value reaches BasePreparationConfig.context; nothing in ignition's own debug-serve path re-reads it, and the benchmark's --contexts check at planning.py:248 (selection.required_context > self.context) still compares against the recipe max, not the prepared context. That is a behavioural gap, but for the subtraction lens: the flag is worth nothing without the reject path, so the smaller shape is one value on the plan plus the two consumers, not a new flag family threaded through bench.

  3. ignition/cli/preparation.py:56 adds context: int | None = None to derive() and forwards it at :68 — a pure pass-through parameter of the kind the file otherwise avoids only when one command differs (it does not here: all three callers pass args.request_context or nothing). If the flag goes, this parameter goes entirely (2 lines).

  4. No test asserts any of the new behaviour: grep of tests/ for request_context/prepared_context/context_target/--context → no matches (tests/cli/test_commands.py:80's old --context usage-error assertion the maintainer flagged in #454 is gone from main too). The historical #454 review asked for tests that fail without the change; the diff adds none, so as a subtraction there is nothing to trim here, but it means none of the new branches (the positive check, the two-message chunk branch) is protected.

#7 [medium] Per-file examination record: what each changed file contributes and where nothing can be cut

Diff is +35/−15 over 7 files (pr_files). Hunk inventory:

Net: 34 of 35 added lines exist to carry one integer to one consumer; ~15 can go without losing the behaviour the PR claims.

#10 [medium] Blast-radius note: prepared_context is read by only four places, so a field+two-line property is the whole mechanism

Verified consumer set for the PR's one datum (context_target / prepared_context), from a grep of prepared_context|context_target|request_context at the head commit:

So 4 of the 9 changed files (bench.py, preparation.py, serve.py, rebuild_manifest.py — 10 added lines) plus the two planning.py forwards exist only to carry one integer to bootstrap.py:58; the property that does the min() is a two-line replacement for the five-line body.

Also unchanged since the earlier pass: helios is untouched by this PR, so no runtime code becomes dead; docs/cli-design.md:69 (context_hint) and ignition/cli/serve.py:68-69 (max_body_bytes from recipe.context, hint text "limited by the checkpoint") still describe the pre-cap world, and ignition/cli/help.py:38 still advertises --prefill-chunk-size: 64..{recipe.context}.