refactor(compiler): unify boundary quantifier lowering#605
Merged
Conversation
zharinov
marked this pull request as ready for review
July 19, 2026 00:56
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.
Boundary-aware quantifiers had two independent implementations of the same route topology: one for no-value flow and one for value-producing flow. Both computed reachable and productive boundary states, allocated loop labels, stitched repeat routes, and applied greediness. The copies could drift when boundary or navigation logic changed.
Quantifier lowering now owns that topology once. Each admitted iteration selects only its result handling:
NoValueOrdinaryCaptureTypeBoundaryOptionalOutputkeeps a?iteration's output mode together with the effects for its empty branch. No-value sequence lowering delegates to the shared kernel, so it no longer owns a quantifier loop or a separate boundary-port adapter.A focused bytecode snapshot covers the previously unexercised no-value boundary routes for both
?and*. A two-entrypoint probe produced byte-for-byte identical artifacts before and after:a523b89f1412ce84b92753efce1ddfd3c6d927a6e9812581350034bc4348b79f8f74aa341891ed4eaca096c0941f65d9c7cf1a069e98dc964d8111c0dc8ff32fBoth entrypoints remain in one emitted artifact and can still be selected independently.