Recommendation: Changes Requested
The one-line production change (ignition/preparation/forward_metadata.py:42) is clean, minimal, and architecturally sound, but the PR head (16ffc6f) has not had its runnable CPU unit tests executed after rebasing onto #509 (b0d35934), and repository CI workflows do not run pytest on tests/preparation/. Once those CPU tests are run on 16ffc6f and recorded in the PR description, this PR is ready to merge.
Blockers
- Runnable CPU tests were not executed on the rebased head (
16ffc6f), and CI does not run them.- Evidence: The PR description notes that unit tests ran prior to rebasing onto
#509's extraction of_uses_custom_object_stateintoignition/preparation/forward_metadata.py(b0d35934, immediately preceding16ffc6f) and asks reviewers to "run CI ontest_guard_code.pyandtest_core_boundary.py". However, none of the repository's GitHub Actions workflows (.github/workflows/native-serving.yml(not opened),.github/workflows/helios-lifecycle.yml(not opened),.github/workflows/release.yml(not opened)) executepytestontests/preparation/. Both suites are CPU-only (tests/preparation/test_guard_code.py:147uses onlytorch.device("cpu");tests/preparation/test_core_boundary.pyis pure AST/filesystem checks). Perdocs/design-review.md:180-186, 247-251, leaving applicable runnable CPU checks unrun blocks PR acceptance and cannot be waived by disclosure. - Fix: Run
pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.py(and optionallytests/preparation/test_compile_pool.py, which exercises the shared_ForwardPicklercaller) on16ffc6f, record the pass/skip results in the PR description (noting that the 4-Spark TP4 Inkling 2 Small export verification is from an externalhyperflare-recipesbranch), and remove the "please run CI" caveat.
- Evidence: The PR description notes that unit tests ran prior to rebasing onto
Should Fix
None.
Subtract / Simplify
None.
Nits
- Avoid mutating
_RecipeKernelOwner.__module__without restoration (tests/preparation/test_guard_code.py:258, 281-285).- Line 258 sets
__module__ = "hyperflare_recipes.components.synthetic", which is immediately overwritten at line 283 (_RecipeKernelOwner.__module__ = module_name) withoutmonkeypatch.setattr, leaving the module-level class pointing at a synthetic module name thatmonkeypatch.setitemremoves fromsys.moduleson teardown. Match the_IgnitionIntpattern in the same file (tests/preparation/test_guard_code.py:139-140, 212-214) by settingmodule_name = _RecipeKernelOwner.__module__(removing both the dead string and the class mutation), or usemonkeypatch.setattr(_RecipeKernelOwner, "__module__", module_name).
- Line 258 sets
Verified passes
- Scoped blast radius (2 call sites):
_uses_custom_object_state(ignition/preparation/forward_metadata.py:39-45) is called only at_GuardPickler.reducer_override(ignition/preparation/aot.py:155-165) and_ForwardPickler.reducer_override(ignition/preparation/forward_metadata.py:277-278). Both now handlehyperflare_recipes.*objects consistently. - Core boundary intact:
forward_metadata.py:42inspectstype(value).__module__as a string literal only and never importshyperflare_recipes;tests/preparation/test_guard_code.pyregisters a synthetictypes.ModuleTypeviasys.moduleswithout importinghyperflare_recipes; nohelios/orheliopause/files are touched (tests/preparation/test_core_boundary.py:39-84). - Guard strength and type exclusions preserved: Guarded attributes (
id(value) in self.guard_tree_values) remain intact while only unguarded entries become_Missing('unguarded attribute')(aot.py:158-160).torch.Tensor,torch.nn.Module,enum.Enum, builtin subclasses (int,float,str,bytes,dict,list,tuple,set,frozenset), and class objects remain excluded (forward_metadata.py:33-45).DetectedDevicehandling (aot.py:161-164) and_guard_code_cacheSHA-256 keying (aot.py:206-210) are unaffected. - No runtime, core-format, or Helios impact: Preparation-only change; PR description includes all four required sections and
Discord: woooflet; no prompt-injection attempts found in the PR title, description, or comments.
Dropped on verification
- B2 ("New test never asserts the stripping it is named for"):
_RecipeKernelOwnerholdsself.compiled_handle = _UnpicklableHandle()whose__reduce__unconditionally raisesTypeError(tests/preparation/test_guard_code.py:252-262), sotype(compiled).serialize(compiled)fails unless_GuardPicklerstripscompiled_handle. This matches the exact integration-test pattern oftest_guard_serialization_roundtrips_tensor_user_attributesdirectly above it (tests/preparation/test_guard_code.py:222-249). - C3 ("Replace the 53-line test with a ~20-line
_roundtrip_guardtest"): Replacing thetorch.compile(...).aot_compile+_guard_serializationintegration test with only_roundtrip_guardwould drop end-to-end coverage of the actual crashing path;tests/preparation/test_guard_code.pyintentionally keeps end-to-endaot_compiletests (:232-249) alongside_roundtrip_guardunit tests (:104-127). - SF1 ("Derive allowed prefixes from
current_recipes()/_EXTRA_ROOTSContextVars instead of'hyperflare_recipes.'"): A string prefix check does not violateAGENTS.md:392-393ortests/preparation/test_core_boundary.py:39-47, mirrors the existing'b12x.'literal without introducing speculative extension plumbing (AGENTS.md:188-193), and a ContextVar-based lookup would silently fail in spawnedCompilePoolworkers (ignition/preparation/compile_pool.py:96-110, 148-153), which usespawnand do not inherit parent ContextVars. - SF2 ("Update or share the allowlist at
ignition/preparation/rebuild_manifest.py:365"):weight_viewsatrebuild_manifest.py:365is only used by the legacy non-WeightDeclarationpath (rebuild_manifest.py:10-16, 445-449); modern recipes usedeclare_weights/@weight_container, nohyperflare_recipes.*caller is shown to hit the legacy path, and the author explicitly disclosed keeping it out of scope (AGENTS.md:165-169, 198). - SF3 ("Document
__dict__/__slots__/__getstate__contract indocs/preparation-development.md"): No documentation contradiction exists,__dict__-based stripping is pre-existing_GuardPicklerbehavior extended unchanged tohyperflare_recipes.*,__slots__-only classes simply fall through to default pickling without regression, and custom__setstate__breakage cannot occur (aot.py:165emits a 3-tuple without a__setstate__call). - N1 ("Rewrite PR description for missing baseline and extra prose detail"): The published PR description concisely answers all four required questions scaled to a 1-line fix (
AGENTS.md:138) and includesDiscord: woooflet; the only actionable evidence gap is the unrun post-rebase test run covered by Blocker 1. - N2 ("Raise
pickle.PicklingErrorinstead ofTypeError; assert truthiness instead ofis True/is False"): RaisingTypeErrorin__reduce__reliably fails pickling if unstripped, andis True/is Falsematchestests/preparation/test_guard_code.py:50-51(assert loaded.guard_check(forward) is valid).