Skip to content

Conversation

@SGSSGene
Copy link
Collaborator

the EPR dictionaries compute an effective alphabet size, but did not use it to map characters of the text to the narrowed range. This lead to a bugs, if enough characters where missing, such that less bits where used for storage than required.

This fixes the issues, by removing the effective alphabet size, and fixing it to the requested alphabet size via template argument.

We added a test case, which triggers the error. We added a fix that fixes the error.
Additionally, I made a little fix, to one of the other unittest, testing the full range (no reason to leave out the zero).

@SGSSGene SGSSGene requested a review from eseiler March 31, 2025 14:56
@SGSSGene SGSSGene force-pushed the fix/EPR-dictionaries branch from d0b053c to aeaef71 Compare March 31, 2025 14:57
for (uint32_t i = 0; i < result.size(); ++i)
{
result[i] = (std::rand() % 3) + 1; // no 0s allowed. produces 1, 2 or 3.
result[i] = std::rand() % 4;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 is now allowed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was always allowed. I have no clue why that wasn't tested

Co-authored-by: Enrico Seiler <[email protected]>
@SGSSGene SGSSGene requested a review from eseiler March 31, 2025 20:02
@eseiler eseiler merged commit 2de73c1 into xxsds:master Apr 1, 2025
24 of 36 checks passed
@SGSSGene SGSSGene deleted the fix/EPR-dictionaries branch April 1, 2025 05:34
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