Skip to content

Fix block splitter partition bounds - #4918

Merged
terrelln merged 1 commit into
meta:devfrom
terrelln:2026-11-10-compress-sequences
Nov 11, 2026
Merged

terrelln merged 1 commit into
meta:devfrom
terrelln:2026-11-10-compress-sequences

Conversation

@terrelln

Copy link
Copy Markdown
Contributor

Valid external sequence streams can exhaust the recursive block
splitter's budget even within the 128 KiB block-size limit. The budget
was checked only on function entry, so a left-child recursion could
fill the partition array before its ancestors wrote their own split
positions. The terminating block boundary also had no dedicated slot.
These writes could silently overwrite adjacent compression-context
state.

Recheck the split budget after the left recursion, reserve one extra
partition entry for the terminating boundary, and assert the final
split count. Update the comment that incorrectly described the limit
as unreachable.

Add a deterministic regression using 38,400 valid external sequences
with sequence validation enabled. It verifies the 196-split limit,
the in-bounds terminator, and a successful round trip. The unmodified
baseline emitted 200 blocks; the fixed implementation emits 197.

@meta-cla meta-cla Bot added the CLA Signed label Nov 10, 2026
Valid external sequence streams can exhaust the recursive block
splitter's budget even within the 128 KiB block-size limit. The budget
was checked only on function entry, so a left-child recursion could
fill the partition array before its ancestors wrote their own split
positions. The terminating block boundary also had no dedicated slot.
These writes could silently overwrite adjacent compression-context
state.

Recheck the split budget after the left recursion, reserve one extra
partition entry for the terminating boundary, and assert the final
split count. Update the comment that incorrectly described the limit
as unreachable.

Add a deterministic regression using 38,400 valid external sequences
with sequence validation enabled. It verifies the 196-split limit,
the in-bounds terminator, and a successful round trip. The unmodified
baseline emitted 200 blocks; the fixed implementation emits 197.
@terrelln
terrelln force-pushed the 2026-11-10-compress-sequences branch from 1a62e25 to da806fd Compare November 10, 2026 23:10
@terrelln
terrelln merged commit 974238c into meta:dev Nov 11, 2026
105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants