#1 [high] Research summary
Review of PR #574 (correctness lens)
I read the charter, AGENTS.md (PR/evidence rules, architecture, external-recipes policy), docs/design-review.md, both changed files in full, and every consumer of the changed predicate (ignition/preparation/aot.py:98-166, ignition/preparation/forward_metadata.py:39-45,172-303, ignition/preparation/rebuild_manifest.py:338-459, ignition/preparation/runtime_core.py:108-131,280-370), plus tests/preparation/test_core_boundary.py and tests/preparation/test_guard_code.py. No blocking defect: the change is a one-token widening of an allowlist, it does not alter guard-state format for existing ignition./b12x. objects, and I confirmed the new test is discriminating (without the new prefix, _RecipeKernelOwner falls through to GuardsStatePickler.reducer_override, whose default reduction pickles vars(obj) and hits _UnpicklableHandle.__reduce__, so the test fails on main). I also confirmed the boundary claim: test_core_boundary.py:28-47 inspects AST imports only, so the new string literal imports nothing.
Findings to carry forward, all recorded below in order of weight:
Should fix — the fix is keyed to one package name, not to the supported configuration. ignition/preparation/forward_metadata.py:42. AGENTS.md:379-384 states that external recipe repositories can pass their own Recipe tuples directly to ignition.cli.main(...), and ignition/preparation/source_identity.py:28-49 with ignition/cli/__init__.py:367 (not opened) (source_roots) confirms arbitrary external recipe roots are a first-class, supported configuration. Any of those packages producing non-nn.Module prepared objects still raises the reported PicklingError; the bug class is narrowed, not fixed. The repository's own convention for externally-owned types is an explicit per-type/per-declaration registration (declare_container_fields, weight_container, declare_module_buffers in rebuild_manifest.py:41-71), not a module-name prefix.
Should fix (contract assumption) — the widening imports an ignition-only assumption into externally owned classes. ignition/preparation/aot.py:157-165 now reconstructs any hyperflare_recipes.* instance via _guard_object (aot.py:98) with vars(obj) as state, bypassing the class's own __reduce__/__getstate__/__setstate__ and any __slots__ state; slot-stored guarded attributes would be silently dropped, and the reloaded object can differ from the live one for identity/sentinel comparisons. That contract holds for ignition./b12x. classes in this repo; it is not established for recipe classes outside it. Nothing in this repository demonstrates a break; only a recipe-side class using __slots__ or a custom reducer would show it.
Nit — the sibling allowlist was not updated. ignition/preparation/rebuild_manifest.py:365 still gates the legacy weight-view walk on ('b12x.', 'ignition.'), feeding rebuild_weights_metadata (rebuild_manifest.py:441-459, called at runtime_core.py:367-369). Tensors under a hyperflare_recipes.* owner are silently omitted from (or reported unavailable in) the core's rebuild catalog while now being guard-serializable. Either share the predicate or rely on the documented WeightDeclaration path.
Nits in the new test, tests/preparation/test_guard_code.py:252-299: (a) _RecipeKernelOwner.__module__ is reassigned at line 283 and only sys.modules is restored by monkeypatch, leaving process-global class state mutated after the test; use monkeypatch.setattr on the class. (b) The fixture raises TypeError from __reduce__ rather than reproducing the reported PicklingError on CompiledKernel. (c) Only the _GuardPickler path is covered; _ForwardPickler (forward_metadata.py:277-278) is the second consumer of the predicate, and because it also requires hasattr(type(value), '__getattr__'), the widened prefix changes nothing there for plain recipe objects — so the description's claim about clean serialization is established for guard states only; a dumps/loads round-trip would close the gap. (d) assert loaded.guard_check(forward) is True/False (lines 294-299) asserts bool identity where the rest of the file asserts truthiness; I could not confirm guard_check's exact return type from code alone.
One positive check worth stating: _guard_code_cache keys binaries by the hash of pickled (code_parts, closure_args) (aot.py:207-210), so changed pickled bytes for recipe objects cause a cache miss and a new file, not a stale-guard hit — no persisted-state hazard.
#2 [high] Overview: PR #574 scope, diff, and why it works
PR #574, "Strip unguarded attributes from hyperflare_recipes objects in AOT guard serialization", head 16ffc6f, base main, 2 files +54/-1, no reviews, no CI checks on head. Author fordbmorris (Discord woooflet), NONE association, 3 open PRs (#575, #576, #577).
Diff (pr_diff):
- ignition/preparation/forward_metadata.py:42 —
_uses_custom_object_stateprefix tuple becomes ('ignition.', 'b12x.', 'hyperflare_recipes.'). - tests/preparation/test_guard_code.py:252-299 — new synthetic test.
Predicate in full (forward_metadata.py:39-45): hasattr dict, module prefix, not a class, not in _NON_OBJECT_NEW_TYPES (line 33-36).
Consumers (verified by grep, 2 total):
- ignition/preparation/aot.py:155-165 — _GuardPickler.reducer_override; state = each var replaced by _Missing('unguarded attribute') unless id() in guard_tree_values, returned as (_guard_object, (type,), state). _guard_object = object.new at aot.py:98.
- ignition/preparation/forward_metadata.py:277-278 — _ForwardPickler.reducer_override, gated additionally on
hasattr(type(value), '__getattr__'), so the widened prefix changes nothing there for plain recipe objects. Important: claim in PR description about "serialize and deserialize AOT guard states" is established for guard states only; the forward-metadata path is not exercised.
Baseline behaviour unchanged: ignition./b12x. objects get identical treatment before and after; only hyperflare_recipes.* objects change path. No persisted-format change for existing cores.
Test is discriminating (verified by reading code): without the new prefix, _RecipeKernelOwner falls to GuardsStatePickler.reducer_override, whose default reduction pickles vars(obj), including _UnpicklableHandle whose reduce raises → test fails on main. So the test genuinely guards the fix.
Guard-code cache is safe: aot.py:207-210 keys the on-disk guard binaries by sha256 of pickled (code_parts, closure_args), so changed pickled bytes for recipe objects produce a cache miss and a new file (os.replace at aot.py:218) — no stale-guard hazard from persisted state.
Boundary claim verified: tests/preparation/test_core_boundary.py:28-47 only AST-walks imports, so a new string literal cannot violate it; test_ignition_never_imports_recipes_or_hyperflare_recipes (line 39) passes by construction. Core still never imports hyperflare_recipes (AGENTS.md:389-393).
Charter/AGENTS hooks used: AGENTS.md:379-384 (official recipes live in local-inference-lab/hyperflare-recipes; external recipe repos can pass their own Recipe tuples directly to ignition.cli.main); AGENTS.md:389-393 (core must never import hyperflare_recipes, reusable model execution mechanisms belong in hyperflare_recipes/components/); design-review.md principle 12/13 (validate real path, report evidence honestly). PR description has the required four parts (why / what changed / benefit / evidence) and honestly discloses the rebase caveat ("original unit-test run predated rebasing onto #509"); Discord line present.
#3 [high] Should fix: fix keyed to one package name, external recipe repos unsupported
SEVERITY: should fix (not blocking: no in-repo regression, and the reported failure is resolved for the official package).
File/line: ignition/preparation/forward_metadata.py:42.
What is wrong: the fix enumerates the single literal 'hyperflare_recipes.' prefix. The repository documents arbitrary external recipe repositories as a supported configuration:
- AGENTS.md:379-384 — "Official model recipes live in local-inference-lab/hyperflare-recipes ... and external recipe repositories can pass their own Recipe tuples directly to ignition.cli.main(...)."
- ignition/cli/init.py:367 —
def main(argv=None, *, recipes=(), prog="ignition", source_roots=())accepts arbitrary recipe tuples and extra source roots. - ignition/preparation/source_identity.py:28-49 and 107-108 —
source_roots(roots)/extra_rootsmixes any labeled external tree into the source identity; tests/preparation/test_source_identity.py:166-185 exercises an arbitraryhyperflare_recipesroot, showing external root support is deliberate.
Why it matters: for any external recipe package with a different module name, the exact defect in the PR's "Why" (PicklingError: Can't pickle CompiledKernel in aot_forward guard serialization) still reproduces. The bug class is narrowed to one package, not fixed. Review principle (design-review.md 15 / AGENTS.md "solve the right problem in the right place") favors a mechanism that does not require editing core Ignition per recipe repo.
Suggested fix (choose one):
(a) Register coverage at the boundary: let the recipe/CLI pass the set of external package prefixes or source_roots labels into the guard pickler (the same place ignition.cli.main(..., source_roots=...) already carries them, source_identity._EXTRA_ROOTS pattern at source_identity.py:12-25), and match on that instead of a hardcoded tuple; or
(b) Follow the repo's own convention for externally-owned types — explicit registration, as rebuild_manifest.py:41-71 does with declare_container_fields / weight_container / declare_module_buffers — rather than a module-name prefix.
Also note the tuple is duplicated knowledge vs. rebuild_manifest.py:365; a shared constant/predicate would keep the two in step (see the sibling-allowlist nit).
#5 [high] Should fix: widening bypasses external classes' getstate/setstate; guard path has no state_setter
Refined, verified form of the previous run's "contract assumption" finding (head 16ffc6f).
Facts from code:
- Predicate
_uses_custom_object_state(ignition/preparation/forward_metadata.py:39-45) requireshasattr(value, '__dict__'). Slots-only classes are never matched, so a recipe class holding a Triton handle in a slot still hits the default reducer and the reported PicklingError persists. The fix is therefore incomplete for slot-stored state. _GuardPickler.reducer_override(ignition/preparation/aot.py:155-166) returns a 3-tuple(_guard_object, (type(obj),), state)wherestateis avars(obj)dict with_Missing('unguarded attribute')placeholders. There is no state_setter. Pickle'sload_builddoessetstate = getattr(inst, "__setstate__", None); setstate(state)when the class defines__setstate__. So for ahyperflare_recipes.*class that defines__setstate__(expecting the shape its own__getstate__produced), guard-state deserialization now feeds it a plain dict containing_Missingplaceholders -> KeyError/TypeError at load time instead of a clean strip.- The same file's tensor path deliberately avoids exactly this: aot.py:148-151 returns a 6-tuple with the
_set_statestate_setter (forward_metadata.py:164-165,value.__dict__.update(state))._ForwardPicklerdoes the same at forward_metadata.py:213 and 278. The object branch in_GuardPickleris the only one without a setter. - reducer_override takes precedence over
__reduce_ex__, so a class's own__getstate__/__reduce__is skipped entirely. Consequence: anyhyperflare_recipes.*class that already implemented a__getstate__workaround (the class of workaround the PR description says it obviates) has that logic silently replaced byvars()stripping. - grep over ignition/ found no
__setstate__anywhere (onlyignition/declaration.py:130 __reduce__,forward_metadata.py:145 __reduce__), soignition./b12x.classes are unaffected - this is purely a new exposure created by extending the prefix to a package owned by another repository.
Fix: return (_guard_object, (type(obj),), state, None, None, _set_state) mirroring aot.py:151 so reconstruction never consults an external __setstate__, plus a docstring on _GuardPickler (aot.py:102-103) stating the state contract recipe classes must satisfy; ideally also cover slot state. Not demonstrable as a current break because no hyperflare_recipes code lives in this repo; a recipe-side class with __slots__ + __setstate__ would settle it.
#6 [high] Correction: _ForwardPickler IS affected for recipe classes that define getattr
Correction to note #2 (run 1) and its nit (c).
ignition/preparation/forward_metadata.py:277-278: if _uses_custom_object_state(value) and hasattr(type(value), 'getattr'): return _object, (type(value),), dict(vars(value)), None, None, _set_state
The extra gate is hasattr(type(value), '__getattr__') (class-level), not "only plain objects". Delegating/proxy wrappers - a common shape for prepared recipe components - define __getattr__ on the class. For those, before this PR _uses_custom_object_state was False (module prefix did not match) and their own __reduce__/__getstate__/__reduce_ex__ was honoured; after this PR they are reduced to object.__new__(cls) + vars() with _set_state (forward_metadata.py:160-165), i.e. their own state protocol is bypassed and __slots__/__getstate__-transformed state is dropped silently.
Why it matters: forward_metadata.dumps payloads are what get shipped to forward compiler workers - ignition/preparation/compile_pool.py:96-118 (_compile_forward -> loads(payload) -> aot_forward) and compile_pool.py:137-153 (submit -> dumps), plus cross-host lent jobs ignition/preparation/aot.py:986-1003 (pickled dumps(forward) job files) and aot.py:1137-1138 artifact sharing. Silent state loss changes worker-side compilation inputs instead of raising a clear error.
Also: ignition/preparation/aot.py:1181-1183 keys restored-forward paths on (type(forward).__module__, __qualname__, name, signature), so a class whose pickled state changed still maps to the same cached path - the cache does not protect against this.
Coverage gap: the new test only exercises _GuardPickler; there is no forward_metadata.dumps/loads round-trip for a hyperflare_recipes.* object, so hasattr(type(value), '__getattr__') being false for _RecipeKernelOwner (test_guard_code.py:257-265) hides that the forward path is now reachable for other recipe classes.
#7 [high] Should fix: guard path imposes ignition-internal state protocol on external recipe classes
Re-verification of run-1 finding #3 minus the redundant new test and with the evidence corrected.
Verification: grep for _uses_custom_object_state → only forward_metadata.py:39, aot.py:157, forward_metadata.py:277. Prefix tuple appears twice in the tree: forward_metadata.py:42 and rebuild_manifest.py:365. All confirmed at head 16ffc6f.
Facts for finding 1:
- reducer_override precedence:
pickle.Pickler.reducer_overrideis consulted for every object before__reduce_ex__, so a matched class's__getstate__/__reduce__is never used. - Default BUILD: for a state passed as a 3rd tuple element,
load_buildcallsinst.__setstate__(state)when the class defines it; otherwiseinst.__dict__.update(state). The guard path passes avars()-shaped dict containing_Missing('unguarded attribute')values (aot.py:158-165) with no state_setter, unlike the tensor branch (aot.py:148-151, setter_set_stateat forward_metadata.py:164-165) and unlike_ForwardPickler(forward_metadata.py:213, 278). _guard_object=object.__new__(cls)(aot.py:98-99). CPython raisesTypeError: object.__new__(X) is not safefor subclasses of C types whose tp_new is not object's (dict/list/set/bytearray/exceptions/...). Builtin subclasses are partially excluded via_NON_OBJECT_NEW_TYPES(forward_metadata.py:33-36), which covers Tensor/Module/Enum/int/float/str/bytes/dict/list/tuple/set/frozenset — but not e.g. bytearray, Exception, or afunctools.partialsubclass. So a matched external class of those shapes turns the strip into a hard TypeError at serialization.- Slots: predicate requires
hasattr(value, '__dict__')(forward_metadata.py:41); a slots-only recipe class holding a CompiledKernel still falls through to the default reducer → the reported PicklingError is not fixed for it, and a mixed dict+slots class (base with dict) silently loses slot state at reload. - Precedent: no
__setstate__exists anywhere in ignition/ (grep), so ignition./b12x. classes are consistent with the 3-tuple form; the contract is not established for external classes.
Severity: should fix. Fix: emit (_guard_object, (type(obj),), state, None, None, _set_state) like aot.py:151, and document the required state contract in _GuardPickler's docstring (aot.py:102-103); consider covering slot state.
What would settle it: a recipe-side test class with __slots__ and/or __setstate__ run through _guard_serialization() + serialize/deserialize.
#10 [high] Report of 2026-11-28 (run 2) — PR #574 final verdict
Head 16ffc6f, base main, 2 files (+54/−1). Correctness lens. No blocking defect found in the change itself; three should-fix items concern the incompleteness/contract of the widening, and five nits.
Verdict: should fix (no blocker).
Should fix:
- forward_metadata.py:42 — the fix names one literal package (
'hyperflare_recipes.'), but AGENTS.md:379-384 andignition/cli/__init__.py:367(main(..., source_roots=())) plussource_identity.py:12-49document arbitrary external recipe repositories as supported. Any other external recipe package still reproduces the reported PicklingError. Fix: bind the external package prefixes from the same roots the CLI already receives, or use explicit per-type registration as rebuild_manifest.py:41-71 does. - aot.py:157-165 — the guard pickler reduces every matched external object to
(_guard_object, (type,), vars-dict)with no state_setter. Consequences: the class's__getstate__/__reduce__is bypassed (reducer_override wins); a class defining__setstate__gets a_Missing-placeholder dict instead of its own state shape and can raise at load;__slots__-only classes are not matched at all (predicate requires__dict__, forward_metadata.py:41) so their handles still break;object.__new__(aot.py:98) raisesTypeError: not safefor subclasses of C types outside_NON_OBJECT_NEW_TYPES. Fix: return the 6-tuple with_set_statelike aot.py:151, document the contract on_GuardPickler(aot.py:102-103), and consider covering slot state. - forward_metadata.py:277-278 — the second consumer is genuinely reachable for recipe classes with a class-level
__getattr__(delegating proxies): those now lose their own state protocol and are rebuilt fromvars();dumpspayloads travel to compiler workers (compile_pool.py:96-140) and across hosts (aot.py:986-1003, 1137). Untested by the new test. Fix: add adumps/loadsround-trip assertion or gate the widening consistently.
Nits: rebuild_manifest.py:365 sibling allowlist; test_guard_code.py:283 global __module__ mutation; :253 TypeError instead of PicklingError; :298-302 bool identity; no __slots__ coverage.
Positives: baseline byte-identical for ignition./b12x. objects, so no persisted format or core-compatibility (principle 13) change; new test is discriminating; core boundary cannot be violated by a string literal (test_core_boundary.py:28-47); guard-code cache keys on pickled-parts sha256 (aot.py:206-210) so no stale guards; predicate has exactly two consumers.
Open validation item: no workflow in .github/workflows/ runs pytest (grep: none), the head has no CI checks, and the author's caveat says the pytest run predated the rebase onto #509; design-review.md:247-251 says disclosure does not excuse skipping runnable CPU checks, so pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.py should be recorded on 16ffc6f.
#11 [high] Research summary
Reviewed PR #574 (head 16ffc6f) through the correctness lens against the charter, AGENTS.md and docs/design-review.md, reading both changed files in full plus every consumer of _uses_custom_object_state (only two: aot.py:157 and forward_metadata.py:277) and the surrounding pickle/cache/rebuild machinery.
Verdict: should fix — no blocking defect. The one-token widening is safe for everything it touched (byte-identical reductions for ignition./b12x. objects, so no persisted guard/core format change; new test genuinely fails without the fix; core-boundary AST test cannot be violated by a string literal; guard-code cache keys on the sha256 of pickled parts so no stale guards).
Should fix:
ignition/preparation/forward_metadata.py:42— hardcoding the single prefix'hyperflare_recipes.'leaves other external recipe repositories (a documented, supported configuration: AGENTS.md:379-384,ignition/cli/main(..., source_roots=...),source_identity.py:12-49) with the exact reportedPicklingError.ignition/preparation/aot.py:157-165— the guard path now rebuilds any matched external object asobject.__new__+vars(), bypassing its__getstate__/__reduce__; a class with__setstate__receives a_Missing-placeholder dict it did not produce (no state_setter, unlike the tensor branch at aot.py:148-151);__slots__-only classes are not matched at all so their handles still break;object.__new__is unsafe for some C-subclass shapes.ignition/preparation/forward_metadata.py:277-278— the second consumer is genuinely reachable for recipe classes with a class-level__getattr__(delegating proxies), which now silently lose their own state protocol indumpspayloads that travel to compiler workers and across hosts; untested by the new test.
Nits: rebuild_manifest.py:365 sibling allowlist not widened (silent omission from rebuild_weights, mitigated by the WeightDeclaration path); test mutates process-global _RecipeKernelOwner.__module__ (line 283) instead of using monkeypatch.setattr; fixture raises TypeError rather than the reported PicklingError; guard_check(...) is True/False bool identity; no __slots__ coverage.
Open validation item: no workflow in .github/workflows/ runs pytest, the head has no CI checks, and the author's caveat says the pytest run predated the rebase onto #509 — design-review.md:247-251 says disclosure does not excuse skipping runnable CPU checks, so the two test files should be recorded as run on 16ffc6f.
Findings are in scratchpad notes #5–#10 (the earlier #1–#4 survey notes remain, with #6 correcting the first run's claim that the forward-metadata path was unaffected).
#12 [high] Report citation map: every finding, its file:line, evidence and fix (PR #574, run 2)
Consolidated citation map for the final report. All at head 16ffc6f, base main, 2 files, +54/−1. Correctness lens. Rules read: charter, AGENTS.md, docs/design-review.md. Endpoints: charter line 12 (keep runtime small/model-agnostic), AGENTS.md:194-199 (meaningful validation), AGENTS.md:294-307 (run pytest), AGENTS.md:379-393 (external recipes; core must never import hyperflare_recipes), design-review.md:42-46 (recipes may be external), :106-115 (validate the real path / disclose unrun checks), :116-123 (principle 13 core compatibility), :247-251 (disclosure does not excuse skipping runnable CPU checks).
CHANGE UNDER REVIEW
- forward_metadata.py:42 one prefix added to
_uses_custom_object_state(definition at :39-45; guards:hasattr(__dict__), module prefix, not a class, not in_NON_OBJECT_NEW_TYPESat :33-36). - tests/preparation/test_guard_code.py:252-303 new test.
- Exactly two consumers, from grep: aot.py:157 (
_GuardPickler.reducer_override) and forward_metadata.py:277 (_ForwardPickler.reducer_override).
FINDING 1 (should fix) — forward_metadata.py:42. Fix names one package; external recipe repos are supported and still break. Evidence: AGENTS.md:379-384 ("external recipe repositories can pass their own Recipe tuples directly to ignition.cli.main(...)"); ignition/cli/init.py:367 def main(argv=None, *, recipes=(), prog="ignition", source_roots=()) with binding at :368-373; ignition/preparation/source_identity.py:12-25 (_EXTRA_ROOTS contextvar), :18-25 (source_roots(roots)), :43 (combined_roots = (*_EXTRA_ROOTS.get(), *extra_roots)), :107-108 (each extra root mixed into the digest); tests/preparation/test_source_identity.py:166-185 exercises an arbitrary extra root. Repo convention for externally owned types is explicit registration (rebuild_manifest.py:41-71 declare_container_fields / weight_container / declare_module_buffers). Fix: drive the predicate from the roots the CLI already receives, or use explicit registration.
FINDING 2 (should fix) — aot.py:155-166 with _guard_object at aot.py:98-99, _set_state at forward_metadata.py:164-165. Guard path emits a 3-tuple (_guard_object, (type(obj),), state) with state = {k: v if id(v) in guard_tree_values else _Missing('unguarded attribute')}. reducer_override wins over __reduce_ex__, so an external class's __getstate__/__reduce__ is skipped; with no state_setter, pickle's BUILD calls the class's __setstate__ when defined, handing it a vars-shaped dict of _Missing placeholders it did not produce -> possible load-time failure. The tensor branch (:148-151) and _ForwardPickler (:213, :278) always pass _set_state, so the object branch is the outlier. Predicate requires hasattr(value, '__dict__'), so slots-only recipe classes are never matched and their Triton handle still raises. object.__new__ raises TypeError: not safe for subclasses of C types whose tp_new is not object's; _NON_OBJECT_NEW_TYPES covers Tensor/Module/Enum/int/float/str/bytes/dict/list/tuple/set/frozenset but not e.g. bytearray/Exception. grep: no __setstate__ anywhere in ignition/, so ignition./b12x. classes are consistent with the current form — this exposure is new only because the prefix now covers another repo's classes. Fix: return (_guard_object, (type(obj),), state, None, None, _set_state); document the contract on _GuardPickler's docstring (aot.py:102-103); consider slot state.
FINDING 3 (should fix) — forward_metadata.py:277-278. if _uses_custom_object_state(value) and hasattr(type(value), '__getattr__'): return _object, (type(value),), dict(vars(value)), None, None, _set_state. Before the PR, classes outside the prefix kept their own reducer even with a class-level __getattr__; now delegating proxies are flattened to vars() and lose __slots__/__getstate__-transformed state silently. Payload reach: compile_pool.py:96-118 (_compile_forward -> loads -> aot_forward), compile_pool.py:137-153 (submit -> dumps/submit_payload), cross-host lent jobs aot.py:986-1003, artifact sharing aot.py:1137-1138. Cache does not protect: aot.py:1181-1183 keys restored-forward paths on (type.__module__, __qualname__, name, signature). New test does not exercise this (its owner has no __getattr__, test_guard_code.py:257-265). Fix: add a dumps/loads round-trip assertion or gate consistently.
NIT A — rebuild_manifest.py:365 still ('b12x.', 'ignition.'). Chain: weight_views (:338-374) -> rebuild_weights_metadata (:441-459) -> runtime_core.py:130 and :367-369 -> heliopause/src/export/binding.rs:467-522 (validate_rebuild_weights at :540) -> BundleIndex.rebuild_weights (docs/runtime-core-design.md:423,454). Omission is silent (validate_weights, rebuild_manifest.py:462-491, only checks entries present). Mitigated by WeightDeclaration (weight_payload_request :418-422, _declared_metadata :425-438). PR description already discloses this site. Fix: share the tuple between the two sites, or state that WeightDeclaration is the supported path for recipe weights.
NITS B-E (tests/preparation/test_guard_code.py): B line 283 assigns _RecipeKernelOwner.__module__ process-globally while only sys.modules is restored (:285) — use monkeypatch.setattr; class-body __module__ at :258 is dead. C :253-254 raises TypeError, not the reported PicklingError from triton.compiler.compiler.CompiledKernel. D :298-302 assert is True/is False while the file elsewhere asserts truthiness (:50-51, :248-249); guard_check is torch's. E no coverage for __slots__, the exact shape the predicate excludes.
VERIFIED POSITIVES: baseline byte-identical for ignition./b12x. (only hyperflare_recipes.* changes path) -> no persisted-state or principle-13 change; test is discriminating (without the prefix _RecipeKernelOwner falls to GuardsStatePickler.reducer_override, whose default reduction pickles vars(obj) including _UnpicklableHandle); core boundary safe (test_core_boundary.py:28-47 AST-only, and :39-47 checks imports, :50-58 excludes this file from the tests-side rule); guard-code cache keys binaries on sha256 of pickle.dumps((tuple(code_parts), closure_args)) (aot.py:206-210) with atomic os.replace (:213-220), so changed pickled bytes mean a cache miss and a new file, never a stale guard.
VALIDATION GAP: grep for pytest under .github/ returns no matches; the only workflows are helios-lifecycle.yml, native-serving.yml (cargo only), release.yml. Head 16ffc6f has no checks. Author's caveat says the pytest run predated the rebase onto 167f22c8. design-review.md:247-251 makes this an acceptance item, not a code defect.
NOT VERIFIABLE HERE: no hyperflare_recipes code in the repo (test_core_boundary.py:40 asserts the directory is absent), so I could not confirm whether any real recipe class uses __slots__, a custom __getstate__/__setstate__, or object identity across a guard round trip — exactly what decides whether findings 2 and 3 are already-live. A recipe-side class with __slots__ and a __setstate__ run through _guard_serialization() would settle it. I did not run the tests.
CORRECTION TO CARRY: scratchpad note #2 (run 1) said the forward-metadata path was unaffected by the widening; note #6 corrects it — reachable for classes with a class-level __getattr__.
#8 [medium] Nits: new test hygiene (module mutation, TypeError vs PicklingError, forward-path gap, bool identity)
All at head 16ffc6f, tests/preparation/test_guard_code.py.
- Line 283
_RecipeKernelOwner.__module__ = module_nameis a plain assignment to process-global class state; onlysys.modulesis restored bymonkeypatch.setitemon line 285. After the test the class keepshyperflare_recipes.components._synthetic_guard_testwhile that module is gone. Usemonkeypatch.setattr(_RecipeKernelOwner, '__module__', module_name). Also the class-body__module__ = "hyperflare_recipes.components.synthetic"on line 258 is dead, overwritten on line 283. The neighbouring test (line 204-219) already uses monkeypatch correctly for its module. - Line 253-254
_UnpicklableHandle.__reduce__raisesTypeError; the field report isPicklingErrorfromtriton.compiler.compiler.CompiledKernel. Raisingpickle.PicklingErrorwould make the regression signature match. - No
forward_metadata.dumps/loadsround trip, so the second consumer (forward_metadata.py:277) is untested — see note on that path being genuinely reachable for classes with a class-level__getattr__. - Lines 298-302 assert
guard_check(...) is True/False; the rest of the file asserts truthiness (lines 50-51, 248-249).guard_checkis torch's, not verifiable here. - Coverage gap for the primary path: the test goes through a real
torch.compile(..., aot_compile)+serialize/deserialize, which AGENTS.md:194-199 wants; good. But nothing covers the__slots__case that the predicate'shasattr(value, '__dict__')(forward_metadata.py:41) excludes.
#9 [medium] Nit: rebuild_manifest.py:365 sibling allowlist + positives and CI verification
ignition/preparation/rebuild_manifest.py:365 still startswith(('b12x.', 'ignition.')). Verified:
weight_views(line 338-374) feedsrebuild_weights_metadata(line 441-459), reached fromruntime_core.py:130(RuntimeCore.write) andruntime_core.py:367-369(export_model), and the result lands in the native bundle (heliopause/src/export/binding.rs:467-522, validated byvalidate_rebuild_weights).docs/runtime-core-design.md:423,454documents it asBundleIndex.rebuild_weights.- After this PR a
hyperflare_recipes.*weight owner is guard-serializable but the walk still stops at it, so its tensors are silently omitted from the catalog.validate_weights(rebuild_manifest.py:462-491) only checks the entries present, so omission is silent, not an error. - There is a declared alternative:
WeightDeclaration(weight_payload_request, rebuild_manifest.py:418-422) and_declared_metadata(425-438), plusdeclare_container_fields/weight_container/declare_module_buffersat rebuild_manifest.py:41-71. So the omission matters only for recipes still on the legacy roots path; the fix is either to share the prefix tuple between the two sites or to state that onlyWeightDeclarationis supported for recipe-owned weights. Keep as nit because no in-repo code demonstrates a regression and the PR description already discloses this site at rebuild_manifest.py:365.
Positives verified this run (unchanged from run 1):
- Baseline byte-identical for ignition./b12x. objects; only hyperflare_recipes.* changes path.
- The new test is discriminating: without the prefix,
_RecipeKernelOwnerfalls toGuardsStatePickler.reducer_override, whose default reduction picklesvars(obj)including_UnpicklableHandle. - Core boundary intact: tests/preparation/test_core_boundary.py:28-47 walks AST imports only, so a string literal cannot violate it (verified reading the file).
- Guard-code cache cannot serve stale guards: aot.py:206-210 keys binaries on sha256 of
pickle.dumps((code_parts, closure_args)), atomic write via os.replace (213-220). - Predicate has exactly two consumers (grep): aot.py:157 and forward_metadata.py:277.
- CI:
.github/workflows/has no pytest step at all (grep forpytestin .github/ → no matches; native-serving.yml runs only cargo). So the changed Python test is unverified by repository CI, and AGENTS.md:294-307 tells contributors to run pytest themselves. Author's caveat says the run predated the rebase onto #509 (167f22c8) and the head has no checks — design-review.md:247-251 says disclosure does not excuse skipping runnable CPU checks, so this remains an open validation item rather than a code defect.