Fix raw SetProperty on builtin-shaped hosts landing in an invisible dictionary#2591
Merged
Merged
Conversation
…ictionary SetProperty(Key, ...) deopted hidden-class ShapeMode objects before storing a raw descriptor, but not BuiltinShapeMode hosts: the write created a side _properties dictionary that the shape-mode read paths never consult, so the property silently did not exist. Reachable through the public FastSetProperty API on any shaped built-in (Math, JSON, prototypes, ...) since the shapes migration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lahma
force-pushed
the
fix-setproperty-shaped-host
branch
from
July 6, 2026 19:00
f002ba9 to
755b6ca
Compare
Collaborator
Author
|
Note for reviewers: while writing the regression test I found a related but distinct pre-existing edge — a raw \SetProperty/\FastSetProperty\ issued before a generated host's lazy \Initialize\ has run gets wiped when initialization later replaces the property bag (\SetProperties), and that affects dictionary-path hosts too, not just shaped ones. This PR intentionally fixes only the post-initialization shaped-host case (the write landing in a dictionary the shape reads never consult); the pre-init store is left as a separate issue since it predates the shapes work. |
lahma
enabled auto-merge (squash)
July 6, 2026 19:25
lahma
added a commit
that referenced
this pull request
Jul 9, 2026
…2601) A raw SetProperty/FastSetProperty on a lazily-initialized host landed in _properties (or _symbols) without triggering initialization; the first read then ran Initialize(), whose generated CreateProperties_Generated/ CreateSymbols_Generated replaced the bag wholesale via SetProperties/ SetSymbols and silently dropped the earlier write. Documented as a known edge in #2591's review; affects dictionary hosts and shaped hosts alike. SetProperty(Key) and the symbol arm of SetPropertyUnlikely now run EnsureInitialized() first, so raw stores always apply on top of the initialized state - dictionary hosts append to the installed bag and builtin-shaped hosts route through the hybrid side-dictionary arm. EngineConstruction A/B: allocation byte-identical (6.63 KB BuildEngine, 7.24 KB EvaluateSimple), time within noise - nothing in engine or realm construction hits the new initialization path. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 13, 2026
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.
`SetProperty(Key, ...)` deopted hidden-class \ShapeMode\ objects before storing a raw descriptor, but not \BuiltinShapeMode\ hosts: the write created a side _properties\ dictionary that the shape-mode read paths never consult, so the property silently did not exist. Reachable through the public \FastSetProperty\ API on any shaped built-in (\Math, \JSON, prototypes, ...) since the shapes migration.
Regression test included (raw store on shaped \Math: value visible, enumerable via \getOwnPropertyNames, existing shape members still functional after the deopt).
Verification
🤖 Generated with Claude Code