Repository navigation
test: cover the metadata compression fallback decision - #97
Merged
Merged
Conversation
Factor the compressed-vs-raw metadata choice into PlanMetadataStorage() and unit-test the compressed, zero-compressed and no-shrink cases, including the header size/type recorded for the fallback path. Refs #96
blocksmith314
commented
Nov 23, 2026
blocksmith314
left a comment
Owner
Author
There was a problem hiding this comment.
Review
LGTM. PlanMetadataStorage() encodes the old decision exactly:
- compressed only when
compressed_size > 0 && compressed_size < raw_size - fallback stores the raw size and records
kNoneinmetadata_compressed_type stored_size/header_sizeare consistent for both pathscompressed_metalifetime still covers the synchronousRandomWrite
The production path now uses the plan for stored_metadata_size and the header fields, so behavior and archive bytes are unchanged.
Verified locally: Release ctest 178/178, ASan ctest 178/178, CI 5/5 green.
Minor suggestion, not blocking: the unit test covers the decision function, but not that PackPipeline writes the fallback header/bytes. An integration test that forces a no-shrink result and checks metadata_compressed_type == kNone / raw size would pin the production wiring too.
The reported pack +1.4% wall time is within the noted noise for a pure refactor, and the unpack path is untouched.
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
PlanMetadataStorage().compressed_metaormeta_buffer; behavior and archive bytes are unchanged.Tests
ctest: 178/178 passedctest: 178/178 passedPerformance
The touched code is pack-only. One comparison against
origin/mainmeasured pack +1.4% wall time / +0.8% peak RSS. The unpack path is untouched; a same-code A/A control (same commit for baseline and current) measured unpack time +0.1% but peak RSS +5.9%, showing the gate's memory delta is within this machine's noise.Closes #96