Skip to content

feat[compressor]: require schemes to declare their produced encodings#8944

Merged
joseph-isaacs merged 1 commit into
developfrom
ji/scheme-produced-encodings
Jul 24, 2026
Merged

feat[compressor]: require schemes to declare their produced encodings#8944
joseph-isaacs merged 1 commit into
developfrom
ji/scheme-produced-encodings

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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 by compress belong here; canonical arrays the scheme merely rearranges do not need to be declared.

BtrBlocksCompressorBuilder::retain_allowed_encodings uses 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.

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>
@joseph-isaacs
joseph-isaacs merged commit 1bda2e9 into develop Jul 24, 2026
80 of 81 checks passed
@joseph-isaacs
joseph-isaacs deleted the ji/scheme-produced-encodings branch July 24, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants