Skip to content

Make OverlayZipper's ascend_until and descend_until stop where the overlay does - #208

Merged
Adam-Vandervorst merged 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/overlay-zipper-until-moves
Dec 1, 2026
Merged

Adam-Vandervorst merged 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/overlay-zipper-until-moves

Conversation

@imlvts

@imlvts imlvts commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

ascend_until and ascend_until_branch let each source ascend to its own nearest value or branch, and took the nearer stop. descend_until took the sources' stops the same way. But the overlay's trie is the union, with values from the mapping:

  • A branch formed by the union (one child in each source, a different byte) is a branch of the overlay. ascend_until climbed past it.
  • A source value the mapping filters out is not a value of the overlay. ascend_until and descend_until stopped at it.

ascend_until / ascend_until_branch now climb a byte at a time and stop where the overlay branches or has a value. descend_until keeps the source-driven descent, which already stops at union branches, and carries on from a stop where the overlay has one child and no value. descend_until_max_bytes follows. This is the same reasoning as the descend_to_val fix in 7eed493.

…erlay does

ascend_until and ascend_until_branch let each source ascend to its own nearest
value or branch, and took the nearer stop.  descend_until took the sources'
stops the same way.  But the overlay's trie is the union, with values from the
mapping:

- A branch formed by the union (one child in each source, a different byte)
  is a branch of the overlay.  ascend_until climbed past it.
- A source value the mapping filters out is not a value of the overlay.
  ascend_until and descend_until stopped at it.

ascend_until / ascend_until_branch now climb a byte at a time and stop where
the overlay branches or has a value.  descend_until keeps the source-driven
descent, which already stops at union branches, and carries on from a stop
where the overlay has one child and no value.  descend_until_max_bytes follows.
This is the same reasoning as the descend_to_val fix in 7eed493.
@imlvts
imlvts marked this pull request as ready for review November 30, 2026 09:22
@Adam-Vandervorst
Adam-Vandervorst merged commit 02c89a4 into Adam-Vandervorst:master Dec 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants