Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec update : require minimum nb of literals for 4-streams mode #3398

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

Cyan4973
Copy link
Contributor

@Cyan4973 Cyan4973 commented Dec 22, 2022

Reported by @shulib :
the specification for 4-streams mode
doesn't work when the amount of literals to compress is 5 bytes. Extending it, it also doesn't work for sizes 1 or 2.

This patch updates the specification and the implementation to require a minimum of 6 literals to trigger or accept the 4-streams mode.

The impact is expected to be none over the ecosystem :
the 4-streams mode is never triggered for such small quantity of literals anyway, since it would be wasteful (it costs ~7.3 bytes more than single-stream mode). An informal lower limit is set at ~256 bytes,
so the technical minimum is very far from this limit.
On the other side, the decoder was already protected against scenario, and would already fail cleanly if presented with such request.

This is just meant for completeness of the specification.

Fix #3316

Copy link
Contributor

@felixhandte felixhandte left a comment

Choose a reason for hiding this comment

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

LGTM.

Do we also want to submit an erratum to the RFC?

@Cyan4973
Copy link
Contributor Author

Do we also want to submit an erratum to the RFC?

Yes, that would be a good follow up.

@Cyan4973 Cyan4973 force-pushed the fix3316 branch 2 times, most recently from 3a606fd to b6bc930 Compare December 22, 2022 22:40
Reported by @shulib :
the specification for 4-streams mode
doesn't work when the amount of literals to compress is 5 bytes.
Extending it, it also doesn't work for sizes 1 or 2.

This patch updates the specification and the implementation
to require a minimum of 6 literals to trigger or accept the 4-streams mode.

The impact is expected to be a no-op :
the 4-streams mode is never triggered for such small quantity of literals anyway,
since it would be wasteful (it costs ~7.3 bytes more than single-stream mode).
An informal lower limit is set at ~256 bytes,
so the technical minimum is very far from this limit.

This is just meant for completeness of the specification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Protocol question
3 participants