+ implement greedy and exhaustive byte-pair compression - #102
Merged
Conversation
Hawkynt
force-pushed
the
feat/bpe-building-block
branch
from
August 28, 2026 16:29
d8d00b1 to
8e1d0b5
Compare
Replaces the 16-bit demonstrator with Gage-style byte-pair encoding: pairs are substituted with byte values absent from the block, so symbols stay byte-sized. The default stays deterministic greedy over 65,535-byte blocks; Exhaustive memoizes every profitable merge sequence within 64-byte blocks and keeps the smallest grammar. Both write the same wire format and can read each other, and a block that did not get smaller is stored raw. Malformed framing, duplicate codes, forward and cyclic grammar references, length mismatches and trailing data are all rejected. BPE is filed as a dictionary/grammar compressor, not an entropy coder.
Hawkynt
force-pushed
the
feat/bpe-building-block
branch
from
August 28, 2026 18:23
8e1d0b5 to
382f62d
Compare
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.
What changed
BpeConstructionStrategy.Exhaustive, which memoizes every profitable merge sequence within 64-byte exact-search blocks and chooses the smallest serialized grammarVerification
Added NUnit coverage for:
The previous head completed the Ubuntu and Windows build/core/interop/OS/polyglot/performance jobs successfully. The local execution environment does not have the .NET SDK installed, so the new exhaustive-strategy commit is compiled and tested by repository CI.