Recommendation: Changes Requested
The 1-line production fix in ignition/preparation/forward_metadata.py:42 is minimal, sound across spawned CompilePool workers, and restores pre-split guard-pickling parity for classes extracted into hyperflare_recipes without importing the package or violating tests/preparation/test_core_boundary.py. However, the single blocker from the previous review rounds remains unresolved on head acbab08: the latest rebase comment recorded only python3 -m py_compile (syntax check only), and neither a local pytest run nor an approved .github/workflows/python-cpu.yml (not opened) CI run has been recorded on acbab08. Once pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.py is confirmed green on acbab08 (locally or via maintainer-approved CI), this PR is ready to merge.
Merge Risk
Level: Low
- Preparation-only, zero serving hot-path impact:
_uses_custom_object_state(ignition/preparation/forward_metadata.py:39-45) is a pure string-prefix predicate used only during AOT guard serialization (ignition/preparation/aot.py:157) and compiler-worker metadata pickling (ignition/preparation/forward_metadata.py:282); Helios serving, CUDA graphs, and model core wire formats are untouched. - Restores pre-split parity without new concurrency or subprocess hazards: Prior to the
hyperflare_recipesextraction (da037284,4d957175), these classes lived underignition.*and already matched this predicate; using a static prefix tuple ensures identical behavior in both the parent process andSubprocKind.SPAWNCompilePoolworkers (ignition/preparation/compile_pool.py:154-156) with no new locking or contention. - Explicitly deferred pre-existing twin allowlist:
ignition/preparation/rebuild_manifest.py:365still matches only('b12x.', 'ignition.')for legacyweight_viewswalks (bypassed byWeightDeclarationat:445-446); this is pre-existing onmainand explicitly disclosed by the author for maintainer preference.
Walkthrough
ignition/preparation/forward_metadata.py:39-45: Extends_uses_custom_object_state's module-prefix tuple from('ignition.', 'b12x.')to('ignition.', 'b12x.', 'hyperflare_recipes.')via a string check only (no import ofhyperflare_recipes). This governs both_GuardPickler.reducer_override(ignition/preparation/aot.py:157-166) and_ForwardPickler.reducer_override(ignition/preparation/forward_metadata.py:282-284, for objects with__getattr__).tests/preparation/test_guard_code.py:252-302: Adds synthetic_UnpicklableHandle,_RecipeKernelOwner,_RecipeForward, andtest_guard_pickler_strips_unguarded_attributes_from_recipe_objects, registering a synthetichyperflare_recipes.components.*module insys.modulesviamonkeypatch.setitemand verifying end-to-endtorch.compile(...).aot_compile(...)serialization, deserialization, output equality, andguard_checkinvalidation (True → False → True).
Pre-merge Checks
- [PASS] Security / malicious screen: Pure string-prefix addition and CPU unit test; no prompt injection, unsafe execution, or boundary escape.
- [PASS] Charter & value fit: Minimal 1-line root-cause fix in preparation orchestration; literal string check complies with
AGENTS.md:395-396andtests/preparation/test_core_boundary.py:39-58; AI-tool trailer (Antigravity (Gemini-4-Neon)) is inside the permitted set (AGENTS.md:474-486,docs/design-review.md:124-134). - [PASS] Related / duplicate / conflict check: Rebased cleanly onto
571a4471across#509(b0d35934) and#648(555db719);#608added.github/workflows/python-cpu.yml(not opened) and noted#574as a separate merge action after review. - [WARN] Tests & verification evidence: Only
python3 -m py_compilehas been run on headacbab08; nopytestoutput or approved.github/workflows/python-cpu.yml(not opened) CI run is recorded onacbab08.
Blockers
- No
pytestverification recorded on headacbab08(tests/preparation/test_guard_code.py:277-302,tests/preparation/test_core_boundary.py:39-58,docs/design-review.md:106-115).- Verified state: The PR description's Caveats note that the original
pytestrun predated the rebase onto#509, and the 2026-12-02 update onacbab08ran onlypython3 -m py_compile, which checks syntax without importingforward_metadata.pyor executing the new test. Merged#608has since added.github/workflows/python-cpu.yml:30-33(not opened) (CUDA_VISIBLE_DEVICES="" .venv/bin/python -m pytest tests/ -q), but first-time-contributor workflows require maintainer approval and no run is recorded onacbab08. - Concrete fix: Either run
CUDA_VISIBLE_DEVICES="" pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.pyonacbab08and post the passing output in the PR description (removing the stale Caveats block), or have a maintainer approve.github/workflows/python-cpu.yml(not opened) onacbab08and confirm green before merging.
- Verified state: The PR description's Caveats note that the original
Should Fix
None.
Subtract / Simplify
- Remove the redundant
__module__reassignment that leaks class state (tests/preparation/test_guard_code.py:258,281-285).- Line 258 sets
__module__ = "hyperflare_recipes.components.synthetic", then line 283 overwrites_RecipeKernelOwner.__module__ = "hyperflare_recipes.components._synthetic_guard_test"outsidemonkeypatch, leaving the class pointing at a modulemonkeypatchremoves on teardown. Following the existing_IgnitionIntpattern attests/preparation/test_guard_code.py:139-140,212-214, setmodule_name = _RecipeKernelOwner.__module__and delete line 283 (_RecipeKernelOwner.__module__ = module_name).
- Line 258 sets
Nits
- Incorrect commit SHA in PR description Caveats:
167f22c8is#570(ci: upgrade setup-java to v5 and Java 21 in helios-lifecycle);#509's extraction of_uses_custom_object_statelanded inb0d35934. Update or remove when clearing the stale Caveats block. - PR description completeness: Optionally mention that
_uses_custom_object_stateis also consumed by_ForwardPickler.reducer_override(ignition/preparation/forward_metadata.py:282), restoring pre-split parity forhyperflare_recipes.*objects with__getattr__as well as AOT guard serialization.
Dropped on verification
- Correctness F1 (Major: "
_GuardPicklerbypasses__slots__,__setstate__, and__reduce__, producing half-constructed objects"): Dropped as factually inaccurate and misaligned with the design._uses_custom_object_statecheckshasattr(value, '__dict__')(forward_metadata.py:41), which excludes pure__slots__classes;aot.py:165returns a 3-tuple(_guard_object, (type(obj),), state)without_set_state, so Python's pickleBUILDopcode still invokes__setstate__when defined; andhyperflare_recipes.*classes lived underignition.*beforeda037284/4d957175, where this exact stripping behavior was already active. - Correctness F2 ("Two consumers of
_uses_custom_object_statehave mismatched gates; align them"): Dropped. The gate difference is intentional:_GuardPickler(aot.py:157) strips unguarded attributes from all prepared objects, whereas_ForwardPickler(forward_metadata.py:282) preserves fullvars()and only needs_object+_set_stateto bypass custom__getattr__during pickle special-method probing. - Correctness F4 & Subtraction S1 ("
rebuild_manifest.py:365silently drops weight views; hoist a shared constant to widen it"): Dropped from Blockers/Should Fix. The omission is pre-existing onmain, bypassed by modernWeightDeclarationrecipes (rebuild_manifest.py:445-446), and explicitly disclosed and deferred in the PR description for maintainer decision; hoisting a shared constant to widen:365would expand behavioral scope on Round 3. - Correctness F5 & Subtraction S2 ("Replace
'hyperflare_recipes.'with aContextVarbound alongsidesource_roots"): Dropped.CompilePoolspawns fresh workers viaSubprocKind.SPAWN(ignition/preparation/compile_pool.py:154-156) where parentContextVarbindings are not inherited, so a naiveContextVarwould silently break worker-side_GuardPicklerunless threaded throughCompilePooland cross-rank lending RPCs; the string literal complies withAGENTS.md:395-396andtests/preparation/test_core_boundary.py:39-47. - Subtraction S3 ("Replace the end-to-end
aot_compiletest with a 4-line_roundtrip_guardcall"): Dropped. Testing through realtorch.compile(...).aot_compile(...)+_guard_serialization()exercises Dynamo's actualguard_tree_valuespopulation and liveguard_checkinvalidation rather than a hand-built dict, matching the neighbouring test attests/preparation/test_guard_code.py:232-249. - Value Prop / prior Autobot premise ("repository CI does not run
pytest"): Dropped as stale. Merged#608added.github/workflows/python-cpu.yml(not opened) (:30-33); the blocker is updated to reflect that first-time-contributor runs require maintainer approval and no run is recorded onacbab08. - Correctness F6 ("Add
_ForwardPickler, negative unlisted-package, andrebuild_weightstests"): Dropped as Round 3 scope expansion beyond prior review rounds. - Discovery A6 ("
.githooks/commit-msgchecks onlyDesign-Signed-Off-By, notSigned-off-by"): Verified true (.githooks/commit-msg:50-63), dropped as low-signal comment phrasing that does not affect the PR diff or mergeability.