Defer tag writes past fixed-length neighbors#193
Draft
hhugo wants to merge 3 commits into
Draft
Conversation
Member
|
I am unlikely to be able to meaningfully review this, but I will happily do the merge if people tell me to. |
12a4f1f to
bf1abc9
Compare
bf1abc9 to
91cf66e
Compare
Collaborator
Author
|
rebased on top of #196 |
Member
|
@hhugo I added you to the writers for this repository, so you should be able to update such things when you believe it is appropriate. Please be careful about testing and correctness, especially with machine generated code. |
Delay tag writes as late as possible: when a fixed-length element needs only one tag, use the end tag instead of the start tag. This reduces redundant tag operations in loops (e.g., self-loop on 'a' no longer writes the tag on every iteration). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allocate boundary tags for fixed-length tuple elements that lack a
right-position anchor, so that as-binding tags fire as late as
possible in the automaton.
During the rights computation (right-to-left pass), when retreat
breaks at a variable-length element but the current element has a
fixed length, a boundary tag is allocated at the element's end.
This tag becomes a concrete anchor: elements further left can
compute their positions via Tag{tag; offset}. Dead boundary tags
(unreferenced by any as-binding) are eliminated by a new
Sedlex.optimize pass that strips unused tags and remaps live ones
to a dense range.
Inner tuples communicate boundary anchors to an enclosing alias
via the third element of aux's return triple: (start_anchor,
end_anchor). The alias picks whichever expression fires latest:
- Start_plus/End_minus always win (no tag needed).
- For the start boundary: inner anchor > outer left context.
- For the end boundary: outer right context > inner anchor.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simplify `prefer` to use a fixed ranking (Start_plus > End_minus > Tag) instead of a caller-chosen `~best` parameter. Start_plus positions require no runtime computation, making them strictly better than End_minus (which needs the token end). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
91cf66e to
245360b
Compare
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
Sedlex.optimize) strips unused boundary tags and remaps live ones to a dense rangeaux's return tripleTest plan
("0x", Plus hexa) as x)🤖 Generated with Claude Code