#1 [high] Should fix: project-package prefix allowlist duplicated in forward_metadata and rebuild_manifest, and only one copy extended
PR #574 changes _uses_custom_object_state (ignition/preparation/forward_metadata.py:39-45) from
type(value).__module__.startswith(('ignition.', 'b12x.')) to
... ('ignition.', 'b12x.', 'hyperflare_recipes.').
Closest precedent / duplicate: ignition/preparation/rebuild_manifest.py:365 in weight_views:
elif type(value).__module__.startswith(('b12x.', 'ignition.')) and hasattr(value, '__dict__'):
— same construct (hasattr dict + module-prefix allowlist) encoding the same "our packages" policy, and it was NOT updated. There is no shared helper or constant: grep for the prefixes returns exactly these two sites (startswith(('ignition. / "'b12x.")).
Why it matters: weight_views feeds rebuild_weights_metadata (rebuild_manifest.py:441-459) for the legacy (non-WeightDeclaration) roots path used by runtime_core.py:130 and :368. A hyperflare_recipes.* container holding tensors reached through plain __dict__ is still not traversed there, so its tensors are silently reported in unavailable — the same class of "core doesn't know external recipe objects" defect the PR fixes for guard pickling, left unfixed on the sibling path. (The declared declare_weights/WeightDeclaration path at rebuild_manifest.py:118-215 is unaffected, which is why it isn't blocking.)
Fix: one module-level constant/predicate, e.g. PROJECT_MODULE_PREFIXES = ('ignition.', 'b12x.', 'hyperflare_recipes.') plus def is_project_object(value), in one place (forward_metadata or a small shared module), consumed by both sites. Then a new external package prefix is added once, and a test can assert both paths agree (the new test only covers the guard pickler).
#2 [high] Should fix: hardcoded recipe-package name departs from the repo's registered-source-roots mechanism for external recipe packages
Established pattern for external recipe packages in core ignition is declarative registration, not a name allowlist:
- ignition/registry.py:24-41
_ACTIVE_RECIPESContextVar +active_recipes();current_recipes(). - ignition/preparation/source_identity.py:12-25
_EXTRA_ROOTSContextVar +source_roots(roots=()), explicit "so multi-host ranks verify identical recipe code" for any external recipe package. - ignition/cli/init.py:367-373
main(..., recipes=(), source_roots=())binds both. - AGENTS.md:379-393: "external recipe repositories can pass their own
Recipetuples directly toignition.cli.main(...)" and "Coreignitionmust never importhyperflare_recipesor introduce a plugin discovery framework."
PR #574 instead hardcodes the literal string 'hyperflare_recipes.' in core ignition (forward_metadata.py:42). Consequence: any other external recipe package — which the project explicitly supports via recipes=/source_roots= — hits the identical PicklingError: Can't pickle ... CompiledKernel that this PR fixes for hyperflare_recipes. The fix generalizes one package, not the mechanism, and there is no documented reason hyperflare_recipes is privileged over another registered package.
Fix options, cheapest first: (a) derive the treated-as-project module roots from the active recipes (e.g. the __module__ roots of current_recipes() / registered source_roots) instead of a literal, keeping the string check so core still imports nothing; (b) if a literal is kept, put it in one named constant with a docstring stating the rule and update docs/preparation-development.md. Either way, note that the new test hardcodes the same literal (tests/preparation/test_guard_code.py:281), so the test cannot notice a second external package.
#3 [medium] Nit: new test name and monkeypatch style diverge from the sibling test's precedent
Nit-level convention notes for PR #574, verified in code (the previous attempt to save this was rejected because only finish was then available):
-
Nit — new test name diverges from its closest precedent.
tests/preparation/test_guard_code.py:232hastest_guard_serialization_roundtrips_tensor_user_attributes, which uses_guard_serialization()+torch.compile(...).aot_compile+serialize/deserialize. The new test (test_guard_code.py:277) is namedtest_guard_pickler_strips_unguarded_attributes_from_recipe_objectsbut exercises exactly the same serialization pipeline, not the direct_GuardPicklerunit path used by_roundtrip_guard(test_guard_code.py:91-100, used by thetest_guard_pickler_*tests at 104/146/178/204). Fix: rename totest_guard_serialization_strips_unguarded_attributes_from_recipe_objects, or drive it through_roundtrip_guardif the pickler unit level is what is meant. -
Nit — the new test mutates a class attribute globally rather than through
monkeypatch. test_guard_code.py:283 does_RecipeKernelOwner.__module__ = module_nameand never restores it; the file's other tests usemonkeypatch.setitem(sys.modules, ...)(line 214) andmonkeypatch.setattrelsewhere in the suite (test_compile_pool.py:232), andmonkeypatch.setattr(_RecipeKernelOwner, '__module__', module_name)would auto-restore. Also note the class already carries a stale class-level default__module__ = "hyperflare_recipes.components.synthetic"(line 258) that is immediately overwritten by the test, so one of the two is redundant. -
Verified clean (no finding) in this lens:
- No new duplication of existing helpers: the PR adds no helper; it reuses
_GuardPickler(aot.py:102-166) and_uses_custom_object_state(forward_metadata.py:39), whose_Missingstripping at aot.py:157-165 is unchanged. - No import of
hyperflare_recipesis introduced, so tests/preparation/test_core_boundary.py:39-58 stays satisfied; only a string comparison changes (forward_metadata.py:42). Consistent with AGENTS.md:392-393 ("Coreignitionmust never importhyperflare_recipes"). - PR description follows AGENTS.md:72-153's four-part scheme and carries the required
Discord: wooofletline (AGENTS.md:142-153).
- No new duplication of existing helpers: the PR adds no helper; it reuses
Scratchpad entries: 1 (Should fix: prefix allowlist duplicated in forward_metadata.py:42 vs rebuild_manifest.py:365), 2 (Should fix: hardcoded hyperflare_recipes. literal vs the repo's registered recipes=/source_roots= mechanism), 3 (this nit note).