Subtractive report · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/871f64c7-2d9f-4ee2-931e-b52b78e14f7e.md

Key findings

Verdict: make it smaller first — but only modestly. PR #533 (head 448f70a, 8 files, +91/−28) is no longer a case for wholesale removal: issue/PR #454's review asked for exactly this capability ("A resubmission should … carry the cap into the core, so that serving rejects longer requests"), and ignition/preparation/bootstrap.py:132 + Helios admission satisfy AGENTS.md:165-166 ("must address an explicit maintainer request"). What remains is ~17 lines of redundancy, mostly in the new test and in three places that restate defaults the parameter system already derives.

Counts (from pr_files, head 448f70a)

File +/−
docs/cli-design.md +5/−14
docs/preparation-development.md +3/−5
ignition/cli/help.py +1/−1
ignition/cli/serve.py +4/−2
ignition/parameters.py +15/−0
ignition/planning.py +19/−5
ignition/preparation/bootstrap.py +1/−1
tests/cli/test_planning.py +43/−0
Total +91/−28 (code+docs +48/−28 across 7 files; tests +43/−0)

Confirmed subtractions, ranked by lines saved

1. Should fix — 7 lines, tests/cli/test_planning.py (of +43)

Four assertions restate what the line above them or an untouched property already fixes, and the manifest block re-proves generic plumbing already covered at tests/cli/test_planning.py:185-196:

assert {p["key"]: p["scope"] for p in manifest["parameters"]}["context_target"] == "PREPARATION_PARAMETER_SCOPE_DEPLOYMENT"

KEEP: :301-303 (no-target is a no-op), :307/:309 (capping), :312/:314 (above-recipe clamp — the only case exercising the false branch of the target <= self.recipe.context gate at planning.py:187), :316-318 (the bootstrap seam), :321-327 (both UsageError cases), :329-331 (reproduction_args, the only coverage of the override at ignition/parameters.py:1483-1485).

Not a saving: inlining capped_params/oversized_params — the inlined call exceeds the file's line width.

2. Should fix — 3 lines, ignition/planning.py:357-363

Body 4 lines → 1; the None branch and the min are one expression:

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

Safe: min_value=1 (ignition/parameters.py:1315) and Plan.__post_init__ calls self.parameters.validate(context) (planning.py:185) before any read, so a resolved target is never 0. Same behaviour, same None semantics.

Do not fold this into Plan.context (planning.py:352-355): Plan.context is min(recipe.context, self.tokens) and includes the pool; prepared_context deliberately does not, and the prefill-chunk check at :594-597 relies on the difference.

3. Should fix — 2 lines, ignition/cli/serve.py:68-70

Two-message conditional → one string:

"context_hint": "context is limited by the checkpoint, cache capacity, and --request-context cap",

context_hint is appended to context admission errors (helios/src/server/http.rs:59 (not opened)); its neighbour capacity_hint (serve.py:71) is already a fixed string. Cost: the unset case mentions a flag that was not passed. serve.py:67 (max_body_bytes from prepared_context) MUST stay — the body limit has to follow the cap.

4. Nit — 2 lines, ignition/parameters.py:1316-1317

Delete manifest_key="context_target" and scope=ParameterScope.DEPLOYMENT. manifest_parameters falls back to dc_field.name (parameters.py:607-612) because RecipeParameters.manifest_prefix is None (:334), so the key stays "context_target", and DEPLOYMENT is the ParamSpec default (parameters.py:89). Caveat: the sibling prefill_chunk spells both out (:1303-1304), so the two neighbours become inconsistent; behaviour is identical either way, and the manifest-scope assertion in finding 1 catches a mistake.

5. Nit — 2 lines, one of two homes

The served extent is now reported three times: the plan JSON "prepared_context" key (planning.py:396), the startup status line request context N tokens (parameters.py:1560-1561 via serve.py:270-274), and context_hint (serve.py:68-70). Keep one prose home. Preferred: delete the JSON key at planning.py:396 (−1) — to_dict already emits context_target automatically (parameters.py:675-684; dict_section is None so the None-skip at :681 does not apply) and guaranteed_tokens (planning.py:368) carries the effect. Alternative: delete the bespoke status_parts branch (parameters.py:1560-1561, −2). Do not cut both — AGENTS.md:454-456 requires the plan, its printed report and recorded measurements to describe what was prepared, which is what status_parts satisfies.

6. Nit — 1 line, ignition/planning.py:186-190

target % self.page_tokens already rejects 0 (and min_value=1 forbids it), so drop != 0, and the single-line message needs no wrapper — 5 lines → 4:

if target is not None and target <= self.recipe.context and target % self.page_tokens:
    raise UsageError(f"--request-context {target:,} is not a multiple of the {self.page_tokens:,}-token page size")

7. Docs — 0 lines, ~20 words, docs/cli-design.md:458

Drop "Command line only; a core's catalog is fixed at export, so changing it requires re-export" — verbatim from the --mixed-prefill row immediately below (:459); and "the prepared per-request context and max_sequence_tokens" names one thing twice. :1426 (owner table) and :448-451 are not duplicates — keep.

Total: ~17 lines clear-cut (~18 with finding 5), ~20 words of prose, out of +91/−28.

Already subtracted by this change (worth saying in review)

Do not cut (verified load-bearing)

bootstrap.py:132 (the single seam all recipes consume — this is what carries the cap into the core); planning.py:186-190 page-multiple gate (Helios rejects a misaligned extent: helios/src/model/catalog.rs:50-57); :212 bench vs served extent (pool-aware: an uncapped plan with a small pool still rejects); :368 guaranteed_tokens; :394/396 region; :594 prefill chunk vs served extent; parameters.py:1309-1319 core (flag, group, metavar, value_type=int — needed because a None default resolves to str at parameters.py:205-216 — min_value); :1483-1485 reproduction_args override (base-class loop skips base-class fields at :1491-1495); help.py:46; serve.py:67; both docs rows.

Left behind

None. checkpoint_context has no reader anywhere; prepared_context readers are serve.py:67/69, planning.py:212/368/396/594, bootstrap.py:132 and the test; no helios/ path becomes dead; --kv-cache-limit is untouched; tests/cli/test_commands.py:80 guards --context, a different spelling.

Open questions / limits