Repository navigation
Conversation
imlvts
commented
Nov 30, 2026
Collaborator
- Merges from a focus inside the prefix read the source's root node.
- get_focus_at / try_borrow_focus / trie_ref_at_path ignore the prefix.
- descend_until runs past the seam.
- Sibling moves one byte off the prefix return None.
- val_count off the prefix returns the source's whole count instead of 0.
- make_map off the prefix returns the whole source, and over an empty source it drops the dangling stem.
A location on the prefix holds "the rest of the prefix, then the source", with the source's root value at the end of the prefix; a location off the prefix holds nothing. The subtrie methods ignored both: * get_focus / get_focus_at / try_borrow_focus forwarded to the source zipper, which sits at its own root while the focus is on the prefix, so graft, join_into, meet_into, subtract_into, restrict, graft_src_at and graft_masked_branches from the prefix read the source's root node, and from off the prefix the whole source. * trie_ref_at_path handed the path to the source without stripping the rest of the prefix, and read the source off the prefix. * make_map / try_make_map returned the whole source off the prefix, and over an empty source lost the prefix chain that path_exists and child_count report (it is a dangling path). The source's root value was dropped unless graft_root_vals is on. The prefix part is now built as an owned trie over the source's nodes (stem_map), as get_trie_ref already did; try_borrow_focus answers None on the prefix, since no stored node backs it. A location on the prefix can't be expressed with the source's TrieRefT, so PrefixZipper's TrieRefT becomes TrieRef.
* descend_until (and descend_until_max_bytes) consumed the rest of the prefix and kept descending into the source even when the source's root has a value or branches; it now stops there. * to_next_sibling_byte / to_prev_sibling_byte returned None one byte off the prefix, where the next prefix byte is a sibling, so to_next_step and to_prev_step from there stopped instead of moving to the next existing path. * to_next_k_path from off the prefix gave up, although the prefix may sort after the focus and hold the next location at that depth. * val_count off the prefix reported the source's whole count instead of 0.
imlvts
marked this pull request as ready for review
November 30, 2026 20:38
* Build prefix subtrie nodes directly with wrap_stem_node (LineListNode / DenseByteNode) instead of allocating a temporary PathMap + WriteZipper, grafting, double-cloning root values under graft_root_vals, and calling create_path. Short-circuit on !source.path_exists() before touching get_focus / trie_ref / val, use get_focus directly for ZipperInfallibleSubtries, and propagate None from source.trie_ref() in ZipperSubtries::trie_ref. * Implement descend_until_max_bytes_observed natively on PrefixZipper to avoid default TruncatingObserver overshoot-and-ascend and forward directly to source when in PrefixPos::Source. * Clean up prefix/source dispatch in consume_prefix, descend_until_observed, descend_first_k_path_observed, to_next_k_path_observed, to_next_val_observed, to_sibling_byte, val_count, try_borrow_focus, get_focus_at, and trie_ref_at_path.
imlvts
force-pushed
the
fix/prefix-zipper-view
branch
from
December 1, 2026 20:15
f925353 to
f78a8f5
Compare
Owner
|
The latest commit did fix the performance regression for make_map, but not try_make_map and trie_ref_at_path? |
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.