Skip to content

Fix long-jump table growth after compaction - #137

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

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

Conversation

@mcculls

@mcculls mcculls commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

What Does This Do

Ensure the long-jump table grows by at least one entry when a compacted trie is extended.

Motivation

After buildTrie() compacted the table to one entry, the 50% growth calculation kept its size at one. Allocating a second long jump then threw ArrayIndexOutOfBoundsException.

Additional Notes

Regression coverage exercises both continuing the existing builder and constructing a new builder from the compacted trie.

Stack (merge in order):

  1. Preserve trie mappings when long-jump capacity is exhausted
  2. Fix long-jump table growth after compaction (this PR)
  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 mcculls/trie-long-jump-capacity.

Contributor Checklist

  • 77 trie tests and the Java formatting check passed.

jpbempel
jpbempel previously approved these changes Oct 17, 2026
Base automatically changed from mcculls/trie-long-jump-capacity to main October 19, 2026 16:22
@mcculls
mcculls dismissed jpbempel’s stale review October 19, 2026 16:22

The base branch was changed.

Ensure the long-jump table grows by at least one entry when a compacted
trie is extended. A one-entry table previously retained its size under
the 50% growth calculation, causing an array bounds exception.

Cover both continuing the existing builder and constructing a new
builder from the compacted trie.
@mcculls
mcculls force-pushed the mcculls/trie-long-jump-growth branch from 3199436 to d024306 Compare October 19, 2026 16:35
@mcculls
mcculls merged commit aa23bf4 into main Oct 19, 2026
3 of 6 checks passed
@mcculls
mcculls deleted the mcculls/trie-long-jump-growth branch October 19, 2026 16:36
@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