Repository navigation
fix(cctx): refines compression context sticky option behavior - #534
Conversation
Ensure that zero-valued options are correctly interpreted as defaults and that options are only cached upon successful compression calls. This prevents failed operations from polluting the sticky state and allows zeroed fields to properly trigger default behavior (such as using a pinned block size in static contexts). Signed-off-by: Bertrand Lebonnois <5901952+hellobertrand@users.noreply.github.com>
Clarify the behavior of `zxc_compress_opts_t` by ensuring that zero-valued `level` or `block_size` fields fall back to the context creation values rather than library-wide defaults. This change ensures that sticky options correctly persist across successful calls while maintaining consistent behavior for both standard and static compression contexts. Failed calls now correctly leave the sticky state unchanged. Signed-off-by: Bertrand Lebonnois <5901952+hellobertrand@users.noreply.github.com>
Ensure that zero-valued options in `zxc_compress_cctx` and block compression calls strictly revert to creation-time defaults rather than the last successful call's state. This change explicitly tracks `base_level` and `base_block_size` to decouple them from the sticky cache, preventing cross-call interference. Additionally, refine workspace re-carving logic to better handle block size and dictionary transitions, and ensure failed calls do not mutate the sticky context. Signed-off-by: Bertrand Lebonnois <5901952+hellobertrand@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@coderabbitai review |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Reusable compression contexts (zxc_cctx) mishandled their sticky options: a zero level or block_size in a non-NULL opts reused the last call's value instead of a default, and a call that failed (e.g. ZXC_ERROR_DST_TOO_SMALL) still updated the remembered options. Fixing both exposed related defects in the block API.
Option resolution
Block API
Behaviour changes
Fixes #532
Summary by CodeRabbit