docs(D-W6.5): function-store + cmop-bootstrap reproducers; drift narrowed#609
Open
docs(D-W6.5): function-store + cmop-bootstrap reproducers; drift narrowed#609
Conversation
Two more focused reproducers landed in
src/test/resources/unit/refcount/drift/:
- function_hash_store.t (18 tests) — five patterns of the
`sub setit { \$METAS{\$_[0]} = \$_[1] }` shape that
Class::MOP::store_metaclass_by_name uses.
- cmop_bootstrap.t (14 tests) — exact MOP shape: `our %METAS` global,
weakened-back-ref Attribute, MetaClass with DESTROY.
Both pass with the walker gate disabled. So the simple
function-internal hash store + weakened back-ref + DESTROY
combination is NOT the drift source either.
Cumulative across D-W6.1-D-W6.5: PerlOnJava's cooperative refcount
handles all of the following correctly with the gate disabled:
- Sub installation (5 patterns)
- Closure capture, up to 5-layer wrap
- Hash-slot tracking
- Weakened-hash + outer keepalive
- Function-internal hash store
- Weak attr back-ref + %METAS + DESTROY (cmop bootstrap shape)
The actual Class::MOP drift requires something MORE specific.
Likely candidates documented in moose_support.md:
1. Multi-level metaclass relationships (7+ ancestors).
2. Attribute->attach_to_class called from many scopes.
3. Method modifiers (add_around_method_modifier).
4. `use parent` / @isa setup at compile time.
Suggestion for next session: bisect the real Class::MOP source —
start from cmop_bootstrap.t and gradually add Class::MOP::Class.pm
features until something breaks. The smoking-gun feature is the
fix target.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two more focused reproducers + cumulative D-W6 findings.
What landed
src/test/resources/unit/refcount/drift/:function_hash_store.t(18 tests) — five patterns of thesub setit { $METAS{$_[0]} = $_[1] }shape thatClass::MOP::store_metaclass_by_nameuses.cmop_bootstrap.t(14 tests) — exact MOP shape:our %METASglobal + weakened-back-ref Attribute + MetaClass with DESTROY.
Both pass on master AND with the walker gate disabled.
Cumulative D-W6 findings (sessions 1–5)
PerlOnJava's cooperative refcount handles ALL of these correctly
with the gate disabled. None is the drift source.
sub_install.tclosure_capture.thash_slot.tweak_metaclass.tfunction_hash_store.t$_[N]andshiftcmop_bootstrap.t%METAS+ weak attr back-ref + DESTROYWhat this means
The actual
Class::MOPdrift is something more specific than anyof these clean shapes. Likely candidates left:
Class::MOP::Class has 7+ ancestors via
use parent.add_around_method_modifieretc.).use parent/@ISAcompile-time setup with mixin classes.Suggestion for next session (in design doc)
Stop writing reproducers from scratch. Bisect the real
Class::MOP source: take
cmop_bootstrap.tand gradually addfeatures from
Class::MOP::Class.pmuntil something breakswithout the gate.
The first feature to flip the test red is the smoking gun.
Test plan
make(build + unit tests) green.Generated with Devin
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>