Repository navigation
fix: inflate indexed members of a one-thread compressed read across cores - #153
Merged
Merged
Conversation
…ores. A one-thread compressed read inflates indexed gzip and zstd members in parallel again. An unset decode budget caps inflate workers at the available cores for a one-thread read, for Rust stream_frames, and for C reads. On a one-thread compressed read, decode_threads of 1 uses one streaming decoder on the calling thread. When decode_threads is set and at least 2, and n_threads is set, the parse count is the maximum of the two. Kitline-Change: omzkzokzrvmswywzxxslypvkypylmkut
A one-thread compressed read leaves the decode budget at its thread-local default of 0, which is the only path that reaches the core cap in worker_limit_from_budget. No test held that default to available_parallelism or confirmed it still decodes a many-member gzip or zstd file to the exact serial plain text. Add unset_decode_budget_caps_inflate_workers_at_available_cores, which checks the budget stays at 0 on entry, that worker_limit_from_budget never exceeds the core count, and that inflate_gzip and inflate_zstd reproduce the serial plain text on a file with more members than cores. Kitline-Change: nglopplfhhytoxxhjyguvihjmbrhwwav
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.
A one-thread parse of an indexed gzip or zstd file now inflates its members across cores again. The old code forced the indexed inflate onto one thread whenever a one-thread read left
decode_threadsunset. The parse thread count says nothing about how many cores can decompress.With the decode budget unset, the inflate worker count also had no bound and could start one thread per member. It now stops at the available cores, matching the encoder side. Setting
decode_threads=1still keeps a one-thread read on one streaming decoder on the calling thread.A new test pins the unset budget to the core count. It also checks that gzip and zstd files with more members than cores inflate to the same bytes as the serial path. A changelog fragment covers the fix.
Note
Medium Risk
Changes default decompression behavior and threading for one-thread compressed reads, affecting performance and memory; explicit
decode_threads=1preserves the old serial semantics.Overview
Restores parallel inflation of indexed gzip/zstd members on one-thread CON reads when
decode_threadsis omitted. Serial decode on the caller is now explicitdecode_threads=1only; the old path treated a one-thread parse as serial wheneverdecode_threadswas unset.With decode budget
0(unset), indexed inflate workers are capped atavailable_parallelism()instead of one thread per member, aligning with deflate defaults and reducing allocator oversubscription on wide files. Workers still take spans of members; output matches the serial path.Python
read_condocs/comments reflect the new budget and parse/decode threading rules (max(n_threads, decode_threads)when both are set and decode ≥ 2). A regression test pins the core cap and round-trips gzip/zstd under the default budget.Reviewed by Cursor Bugbot for commit 4144b98. Bugbot is set up for automated code reviews on this repo. Configure here.