Skip to content

Preserve trie mappings when long-jump capacity is exhausted - #136

Merged
mcculls merged 1 commit into
mainfrom
mcculls/trie-long-jump-capacity
Oct 19, 2026
Merged

mcculls merged 1 commit into
mainfrom
mcculls/trie-long-jump-capacity

Conversation

@mcculls

@mcculls mcculls commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

What Does This Do

Check local long-jump allocations and ancestor conversions before modifying the trie. Use the actual insertion size so insertions that need no additional table entries remain valid at capacity. Skip the ancestor scan when enough slots remain for every possible conversion.

Motivation

An insertion could move data or update markers before discovering that the long-jump table was full. Catching the rejection then left previously registered mappings corrupted.

Additional Notes

Adds regression tests for rejected and valid insertions at capacity, plus builder benchmarks for exclusion rules, class names, and long jumps.

Stack (merge in order):

  1. Preserve trie mappings when long-jump capacity is exhausted (this PR)
  2. Fix long-jump table growth after compaction
  3. Preserve built tries when builders are modified
  4. Preserve Unicode segments when extending trie leaves
  5. Generate a zero-branch root for empty tries
  6. Branch-count limit

This PR targets main.

Contributor Checklist

  • 75 trie tests and the Java formatting check passed. Builder benchmarks also compile.

An insertion could modify trie data before discovering that the
long-jump table was full, leaving existing mappings corrupted after
rejection.

Check local allocations and ancestor jump conversions before modifying
the trie. Use the actual insertion size so valid insertions still work
when the table is full. Skip the ancestor scan when enough slots remain
for every possible conversion.

Add regression tests for rejected and valid insertions at capacity, plus
builder benchmarks for exclusion rules, class names, and long jumps.
@mcculls
mcculls merged commit 7ec741b into main Oct 19, 2026
8 checks passed
@mcculls
mcculls deleted the mcculls/trie-long-jump-capacity branch October 19, 2026 16:22
@github-actions github-actions Bot added this to the 0.1.0 milestone Oct 19, 2026
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