feat[compressor]: require schemes to declare their produced encodings#8944
Merged
Conversation
Adds a required `Scheme::produced_encodings` method returning the array encodings a scheme may itself introduce into its compressed output. Cascaded children are compressed by other schemes, which declare their own encodings, so only encodings constructed directly by `compress` belong here. `BtrBlocksCompressorBuilder::retain_allowed_encodings` uses the declarations to drop any scheme that could produce an encoding outside a permitted set, so an encoding policy can be enforced before compression rather than rejected after it. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
0ax1
approved these changes
Jul 24, 2026
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.
Summary
Adds a required
Scheme::produced_encodings() -> Vec<ArrayId>method returning the array encodings a scheme may itself introduce into its compressed output. Cascaded children are compressed by other schemes, which declare their own encodings, so only encodings constructed directly bycompressbelong here; canonical arrays the scheme merely rearranges do not need to be declared.BtrBlocksCompressorBuilder::retain_allowed_encodingsuses these declarations to drop any scheme that could produce an encoding outside a permitted set, so an encoding policy can be enforced before compression rather than being rejected after the fact.