streaming: expose NB_WORKERS parameter setter on ZstdCompressStream/ZstdOutputStream#85
Merged
Conversation
ZstdCompressStream and ZstdOutputStream now expose the same parameter(ZstdCompressParameter, int) surface as ZstdCompressContext, so NB_WORKERS (plus JOB_SIZE/OVERLAP_LOG) is reachable from streaming compression - previously MT was one-shot-only, even though unbounded streaming input is where it pays off most. Set right after construction, before the first compress()/write() call. Also renames Mt* identifiers to MultiThread* for consistency with ZstdMultithreadTest (MtCompressBenchmark -> MultiThreadCompressBenchmark, Smoke.mtRoundTrip -> multiThreadRoundTrip, and the new/existing zstd-jni interop test names). Tests: unit round-trips for both streaming classes under NB_WORKERS, plus a new zstd-jni interop test proving a Java MT ZstdOutputStream frame decodes in zstd-jni (the reverse direction was already covered). ADR 0015 updated to record the follow-up as resolved. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 task
dfa1
added a commit
that referenced
this pull request
Jul 18, 2026
…ment (#86) docs/supported.md still said the streaming classes had no parameter setter and that the MemorySegment-buffer driver was "remaining" - both were stale: #82/PR #85 added parameter() to ZstdCompressStream/ ZstdOutputStream, and ZstdCompressStream/ZstdDecompressStream (the zero-copy MemorySegment driver) have existed since b80a1d6, just never got listed in the streaming rows or the bound-symbols table. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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
ZstdCompressStreamandZstdOutputStreamnow exposeparameter(ZstdCompressParameter, int), mirroringZstdCompressContext.parameter(...)— soNB_WORKERS(plusJOB_SIZE/OVERLAP_LOG) is reachable from streaming compression, closing the gap flagged in ADR 0015 (this is the case where MT pays off most: unbounded input, no 512 KiB one-shot pledge gate). Call it right after construction, before the firstcompress()/write().Mt*identifiers toMultiThread*for consistency with the existingZstdMultithreadTestnaming (MtCompressBenchmark→MultiThreadCompressBenchmark,Smoke.mtRoundTrip→multiThreadRoundTrip, interop test names).Closes #82
Test plan
ZstdMultithreadTest— new nested round-trip tests forZstdCompressStreamandZstdOutputStreamunderNB_WORKERSZstdJniInteropTest.Multithreaded— newjavaMultiThreadStreamCompressJniDecompresstest proving a Java MTZstdOutputStreamframe decodes in zstd-jni (the reverse direction was already covered)./mvnw -pl zstd validate(checkstyle) andjavadoc:javadoccleanbenchmarkandintegration-testsmodules compile after the renameDeliberately not attempted: a non-flaky assertion on
ZstdFrameProgression.activeWorkers()mid-stream — existingZstdSegmentStreamTest.Progressalready showsactiveWorkers()reads 0 once a compress step completes, so any mid-stream assertion would race the worker pool draining.