Skip to content

Fix encoded offsets at power-of-two sequence lengths - #98

Merged
jermp merged 9 commits into
jermp:masterfrom
ratschlab:upstream/encoded-endpoint-width
Nov 27, 2026
Merged

jermp merged 9 commits into
jermp:masterfrom
ratschlab:upstream/encoded-endpoint-width

Conversation

@adamant-pwn

Copy link
Copy Markdown
Contributor

With encoded offsets, building AAAC with k=3 and m=1 stores the final endpoint as 0 instead of 4. The allocated width covers positions before the endpoint but cannot represent the endpoint itself when the total sequence length is a power of two.

Size the endpoint table to include that final value. This also affects large inputs: an endpoint of 2^32 needs 33 bits. The serialized layout is unchanged; only dictionaries already corrupted by this bug need rebuilding.

@jermp
jermp merged commit ff27161 into jermp:master Nov 27, 2026
16 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