Recommendation: Changes Requested
The one-line fix in ignition/preparation/forward_metadata.py:42 is minimal, correct, and preserves the core boundary, but the runnable CPU tests have not been executed on the rebased head (16ffc6f) and repository CI does not run pytest. Run pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.py on 16ffc6f, record the results in the PR description (removing the stale Caveats / "please run CI" request), and this PR is ready to merge.
Blockers
- Runnable CPU tests were not executed on the rebased head (
16ffc6f), and repository CI cannot run them —tests/preparation/test_guard_code.py:277-302,tests/preparation/test_core_boundary.py,.github/workflows/native-serving.yml(not opened),.github/workflows/helios-lifecycle.yml(not opened),.github/workflows/release.yml(not opened),docs/design-review.md:180-186,247-251.- Verified evidence: The PR's Caveats state that the unit tests ran prior to rebasing onto
#509's extraction of_uses_custom_object_stateand ask CI to runtest_guard_code.pyandtest_core_boundary.py. None of the workflows under.github/workflows/invokepytest(native-serving.ymlruns Cargo tests plusprepare_templates.py(not opened),helios-lifecycle.ymlruns TLA+/Kani, andrelease.ymlbuilds/packages the native CLI). Both tests are CPU-only (test_guard_code.pyuses CPU tensors andtest_core_boundary.pyis pure AST/text scanning). - Rule:
docs/design-review.md:180-186makespyteston affectedtests/preparationsuites a mandatory layer-1 check, and:247-251states: "Disclosure does not excuse skipping runnable CPU checks. … Leaving an applicable crate test … unrun blocks commit and PR acceptance; noting it as a limitation does not make the omission acceptable." - Note on Caveats SHA: The Caveats also cite
167f22c8as#509's extraction of_uses_custom_object_state, but167f22c8isci: upgrade setup-java to v5 and Java 21 in helios-lifecycle (#570);#509's extraction commit onignition/preparation/forward_metadata.pyisb0d35934. - Fix: Run
pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.pyon16ffc6f, record the pass/skip counts in the PR description, and remove the stale Caveats / "please run CI" note (or fix the#509SHA tob0d35934if keeping the rebase note).
- Verified evidence: The PR's Caveats state that the unit tests ran prior to rebasing onto
Should Fix
None.
Subtract / Simplify
None.
Nits
- Unreverted
__module__mutation and dead class attribute in the new test —tests/preparation/test_guard_code.py:258,281-285.- Line 258 sets
_RecipeKernelOwner.__module__ = "hyperflare_recipes.components.synthetic", which line 283 immediately overwrites via plain assignment (_RecipeKernelOwner.__module__ = module_name) withoutmonkeypatch.setattr. Aftermonkeypatchremovesmodule_namefromsys.moduleson teardown,_RecipeKernelOwner.__module__still points to the removed module name. - Suggested cleanup: Set
module_name = _RecipeKernelOwner.__module__(matching_IgnitionIntattest_guard_code.py:139-140,212-214) or usemonkeypatch.setattr(_RecipeKernelOwner, "__module__", module_name). Optionally add a direct_roundtrip_guardassertion (assert isinstance(restored.compiled_handle, _Missing), mirroring:118-124) alongside the end-to-endaot_compilecheck.
- Line 258 sets
- PR description omits the second
_uses_custom_object_stateconsumer —ignition/preparation/forward_metadata.py:277-278._uses_custom_object_stateis shared between_GuardPickler.reducer_override(ignition/preparation/aot.py:157-165) and_ForwardPickler.reducer_override(ignition/preparation/forward_metadata.py:277-278, gated onhasattr(type(value), '__getattr__')). Adding'hyperflare_recipes.'restores pre-extraction parity for__getattr__-defining recipe objects across compiler-worker IPC as well; a one-sentence mention in the PR description (and optionally a shortforward_metadata.dumps/loadscheck) would document both call sites.
Verified passes
- Production logic & safety (
ignition/preparation/forward_metadata.py:33-45,ignition/preparation/aot.py:118-166):_uses_custom_object_statecheckshasattr(value, '__dict__'),type(value).__module__.startswith(('ignition.', 'b12x.', 'hyperflare_recipes.')),not inspect.isclass(value), andnot isinstance(value, _NON_OBJECT_NEW_TYPES)(Tensor,nn.Module,Enum, and Python builtins)._GuardPicklerstill delegatesempty_valuesandmissing_valuesfirst (aot.py:122-123), preserves guarded attributes, and strips unguarded attributes to_Missing('unguarded attribute'). Existingignition.*andb12x.*behavior is unchanged; Helios serving and core formats are untouched. - Core boundary compliance (
tests/preparation/test_core_boundary.py:28-84):test_ignition_never_imports_recipes_or_hyperflare_recipesandtest_core_tests_do_not_import_extracted_recipes_or_qualifyinspectast.Import/ast.ImportFromonly, andtest_rust_core_and_heliopause_do_not_reference_recipe_pathsscans onlyhelios/src,helios/tests,heliopause/src, andheliopause/{Cargo,pyproject}.toml. Neither the string prefix check inforward_metadata.py:42nor the synthetictypes.ModuleTypeintest_guard_code.py:282-285importshyperflare_recipes. - New test discriminates the fix (
tests/preparation/test_guard_code.py:252-302): Without'hyperflare_recipes.'in_uses_custom_object_state,_GuardPickler.reducer_overridefalls through tosuper().reducer_override(obj)(aot.py:166), which tries to pickleowner.compiled_handleand triggers_UnpicklableHandle.__reduce__(test_guard_code.py:253-254). With the fix, serialization succeeds andloaded.guard_check(forward)validatesscaletransitions (3 → 5 → 3). - No prompt-injection attempts found in the PR description, diff, or comments.
Dropped on verification
- S1 (replace literal with declared
source_roots/_EXTRA_ROOTS): Refuted byignition/preparation/compile_pool.py:97-118,142-153andignition/preparation/source_identity.py:12-25—_EXTRA_ROOTSis a parent-processContextVarcarrying arbitrary hash labels and is never passed into spawnedCompilePoolworkers (SubprocPool(..., SubprocKind.SPAWN)) whereaot_forwardactually executes_GuardPickler. Deriving the prefix from_EXTRA_ROOTSwould break inside compiler workers, and introducing a new cross-process registry/abstraction for one package violatesAGENTS.md:188-193,392-393. - S2 (update or share constant with
ignition/preparation/rebuild_manifest.py:365): Pre-existing in the legacy non-WeightDeclarationfallback (rebuild_manifest.py:419,445-446;RebuildManifestwas deprecated in27716185), unaffected by this PR, and explicitly disclosed by the author; coupling a pickle predicate with a legacy weight-view walker is unrelated scope churn. - S3 subtractive rewrite (delete the
aot_compiletest and replace with a 16-line_roundtrip_guardunit test): Rejected — the end-to-end_guard_serialization()+torch.compile(...).aot_compile(...)+serialize/deserialize+guard_checktest exercises the real Dynamo serialization entry point (docs/design-review.md:187-188) and mirrorstest_guard_code.py:232-249; only the unpatched:283mutation / dead:258attribute and optional_Missingassertion are kept as Nit 1. - S4 (
docs/preparation-development.md:372-388doc edit and__slots__/protocol expansion):docs/preparation-development.md:372-388covers high-level capture/guard lifecycle and never documented internal pickler module allowlists (ignition./b12x.), so omitting'hyperflare_recipes.'there is not a doc contradiction;_ForwardPicklerparity is kept as Nit 2. - S5(b)-(e) (require explicit negative-control rerun log,
aot_forwardvsaot_compilewording, "per-class__getstate__workarounds" wording, Inkling 2 export command): Pedantic / inconsistent with repo precedent (#509reports commit +pytestpass/skip counts without revert logs;ignition/preparation/aot.py:509-515showsaot_forwarddirectly wrapsaot_compilein_guard_serialization(), so the Why description is accurate; S5(a)'s wrong SHA167f22c8vsb0d35934is folded into Blocker 1). - N1 (
_UnpicklableHandle.__reduce__raisesTypeErrorinstead ofpickle.PicklingError): RaisingTypeErrorfrom__reduce__is standard Python for unpicklable handles (e.g.,threading.Lock) and equally fails unstripped pickling; noise.