Repository navigation
Specialize path-dependent dynamic-reference sites per dynamic context - #32
Merged
Merged
Conversation
A `$dynamicRef`/`$recursiveRef` site whose target differs by path used to island with cause "dynamic" (ADR 0004's unstable case), which for the extensible recursive type — a base `tree` re-declared by each extension that `$ref`s it — put every nested node through the interpreter. The winner of such a site is the first resource on the path that declares the anchor, so the planner now splits the anchor: a unit's identity becomes (location, dynamic context), the units below each declaring resource are cloned per first declarer, and every clone's site resolves exactly and compiles as a static edge. Clones share one SchemaRef and report the same location, so errors, annotations, and traces are unchanged; the emitter is untouched. `max_dynamic_winners` (default 16) caps the declarers one anchor may bind; `0` is the previous planner, which keeps the trampoline fixtures and the island golden meaningful. Also fixes a stale-decision bug: a site resolved in an early round was never re-checked, so a later round that added a path with another winner left the decision standing and the compiled validator could disagree with the interpreter. Every met site is now re-derived each round. In-place cycle detection keys on location and islands the ancestor on the path, so a back-edge through a clone cannot hide a loop from a short-circuiting anyOf. Census: 2020-12 60 sites resolved, 1 anchor split, 0 islands (58/0/1 at cap 0); 2019-09 51/2/0 (47/0/2). phylohist's schema loads in 0.87 s instead of 1.85 s. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.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.
A
$dynamicRef/$recursiveRefsite whose target differs by path used to island with cause "dynamic" (ADR 0004's unstable case), which for the extensible recursive type — a basetreere-declared by each extension that$refs it — put every nested node through the interpreter. The winner of such a site is the first resource on the path that declares the anchor, so the planner now splits the anchor: a unit's identity becomes (location, dynamic context), the units below each declaring resource are cloned per first declarer, and every clone's site resolves exactly and compiles as a static edge. Clones share one SchemaRef and report the same location, so errors, annotations, and traces are unchanged; the emitter is untouched.max_dynamic_winners(default 16) caps the declarers one anchor may bind;0is the previous planner, which keeps the trampoline fixtures and the island golden meaningful.Also fixes a stale-decision bug: a site resolved in an early round was never re-checked, so a later round that added a path with another winner left the decision standing and the compiled validator could disagree with the interpreter. Every met site is now re-derived each round. In-place cycle detection keys on location and islands the ancestor on the path, so a back-edge through a clone cannot hide a loop from a short-circuiting anyOf.
Census: 2020-12 60 sites resolved, 1 anchor split, 0 islands (58/0/1 at cap 0); 2019-09 51/2/0 (47/0/2). phylohist's schema loads in 0.87 s instead of 1.85 s.