Skip to content

Test threaded writes with blocks larger than 32 KiB - #302

Merged
rhpvorderman merged 1 commit into
pycompression:developfrom
ptweezy:test-threaded-write-window
Oct 28, 2026
Merged

rhpvorderman merged 1 commit into
pycompression:developfrom
ptweezy:test-threaded-write-window

Conversation

@ptweezy

@ptweezy ptweezy commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

igzip_threaded compresses each block with up to 32 KiB from the end of the previous block as a dictionary (previous_block[-DEFLATE_WINDOW_SIZE:]). test_threaded_write uses 8 KiB blocks, so the end and the start of the previous block are the same bytes. When I changed the slice to [:DEFLATE_WINDOW_SIZE], all tests in tests/test_igzip_threaded.py still passed, but a file written with 64 KiB or 1 MiB (the default) blocks failed the CRC check when read back.

This PR also runs test_threaded_write with 64 KiB blocks. With the changed slice, all six new cases fail. Together they take about 0.1 s.

This PR changes only tests, so it has no CHANGELOG entry.

Checklist

  • Pull request details were added to CHANGELOG.rst
  • Documentation was updated (if needed)

With 8 KiB blocks, the last 32 KiB of the previous block is the whole block, so the tests could not tell whether the writer took the dictionary from the end or the start of it.
@rhpvorderman
rhpvorderman merged commit 0875ae5 into pycompression:develop Oct 28, 2026
22 checks passed
@rhpvorderman

Copy link
Copy Markdown
Collaborator

Yes. It is indeed good to test that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants