Skip to content

feat: wire zstd/lz4 per-token codecs into transfer layer - #3030

Merged
oferchen merged 7 commits into
masterfrom
feature/wire-zstd-lz4-transfer
Mar 28, 2026
Merged

oferchen merged 7 commits into
masterfrom
feature/wire-zstd-lz4-transfer

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Wire CompressedTokenDecoder::new_zstd()/new_lz4() into TokenReader::new() dispatch
  • Add create_token_encoder() helper in delta.rs for algorithm-aware encoder creation
  • Update supported_compressions() to advertise zstd/lz4 behind feature gates, matching upstream preference order (zstd > lz4 > zlibx > zlib > none)
  • Both whole-file and delta-stream compression paths now support all four algorithms

Test plan

  • new_returns_compressed_for_zstd / new_returns_compressed_for_lz4 token reader tests
  • supported_compressions_includes_zstd / supported_compressions_includes_lz4 preference order tests
  • negotiate_zstd_compression / negotiate_lz4_compression negotiation tests
  • Existing zlib/zlibx compression tests unaffected
  • All CI checks pass (fmt, clippy, nextest, Windows, macOS, Linux musl)

- TokenReader: dispatch Zstd/LZ4 to CompressedTokenDecoder::new_zstd/new_lz4
- Delta generation: use create_token_encoder() helper for algorithm-aware
  encoder construction in both whole-file and delta-stream paths
- Negotiation: advertise zstd/lz4 in supported_compressions() behind
  feature gates, matching upstream preference order (zstd > lz4 > zlibx)
- Add tests for token reader dispatch, negotiation, and preference order
@github-actions github-actions Bot added the enhancement New feature or request label Mar 28, 2026
Update capability_fallback_graceful_compression_degradation to expect
zstd/lz4 selection when features are enabled. Fix rustfmt in delta.rs.
…dated

Revert supported_compressions() to only advertise zlibx/zlib/none.
Zstd/lz4 per-token codecs are wired internally and usable via explicit
--compress=zstd/lz4, but must not be auto-negotiated until wire-level
interop with upstream rsync 3.4.1 is validated. Advertising them caused
all compress interop tests to fail.
track_return() called notify_all() without holding the backpressure
mutex, allowing notifications to fire between a waiter's
outstanding.load() check and their condvar.wait() call. This caused
the waiter to sleep indefinitely, hanging the
memory_cap_backpressure_multiple_waiters test on macOS/Windows CI.

Lock the mutex before notifying - the textbook condvar pattern that
guarantees waiters either see the updated state before entering wait()
or receive the notification after entering wait().
@oferchen
oferchen merged commit 48bdf41 into master Mar 28, 2026
34 checks passed
@oferchen
oferchen deleted the feature/wire-zstd-lz4-transfer branch March 28, 2026 12:56
oferchen added a commit that referenced this pull request May 1, 2026
* feat: wire zstd/lz4 per-token codecs into transfer layer

- TokenReader: dispatch Zstd/LZ4 to CompressedTokenDecoder::new_zstd/new_lz4
- Delta generation: use create_token_encoder() helper for algorithm-aware
  encoder construction in both whole-file and delta-stream paths
- Negotiation: advertise zstd/lz4 in supported_compressions() behind
  feature gates, matching upstream preference order (zstd > lz4 > zlibx)
- Add tests for token reader dispatch, negotiation, and preference order

* fix: update compression negotiation test for zstd/lz4 support

Update capability_fallback_graceful_compression_degradation to expect
zstd/lz4 selection when features are enabled. Fix rustfmt in delta.rs.

* fix: satisfy clippy vec-init-then-push lint

* fix: replace redundant closures with function references

* style: collapse method chains to single lines per rustfmt

* fix: do not advertise zstd/lz4 in auto-negotiation until interop-validated

Revert supported_compressions() to only advertise zlibx/zlib/none.
Zstd/lz4 per-token codecs are wired internally and usable via explicit
--compress=zstd/lz4, but must not be auto-negotiated until wire-level
interop with upstream rsync 3.4.1 is validated. Advertising them caused
all compress interop tests to fail.

* fix: prevent lost wakeups in BufferPool backpressure condvar

track_return() called notify_all() without holding the backpressure
mutex, allowing notifications to fire between a waiter's
outstanding.load() check and their condvar.wait() call. This caused
the waiter to sleep indefinitely, hanging the
memory_cap_backpressure_multiple_waiters test on macOS/Windows CI.

Lock the mutex before notifying - the textbook condvar pattern that
guarantees waiters either see the updated state before entering wait()
or receive the notification after entering wait().
oferchen added a commit that referenced this pull request May 5, 2026
* feat: wire zstd/lz4 per-token codecs into transfer layer

- TokenReader: dispatch Zstd/LZ4 to CompressedTokenDecoder::new_zstd/new_lz4
- Delta generation: use create_token_encoder() helper for algorithm-aware
  encoder construction in both whole-file and delta-stream paths
- Negotiation: advertise zstd/lz4 in supported_compressions() behind
  feature gates, matching upstream preference order (zstd > lz4 > zlibx)
- Add tests for token reader dispatch, negotiation, and preference order

* fix: update compression negotiation test for zstd/lz4 support

Update capability_fallback_graceful_compression_degradation to expect
zstd/lz4 selection when features are enabled. Fix rustfmt in delta.rs.

* fix: satisfy clippy vec-init-then-push lint

* fix: replace redundant closures with function references

* style: collapse method chains to single lines per rustfmt

* fix: do not advertise zstd/lz4 in auto-negotiation until interop-validated

Revert supported_compressions() to only advertise zlibx/zlib/none.
Zstd/lz4 per-token codecs are wired internally and usable via explicit
--compress=zstd/lz4, but must not be auto-negotiated until wire-level
interop with upstream rsync 3.4.1 is validated. Advertising them caused
all compress interop tests to fail.

* fix: prevent lost wakeups in BufferPool backpressure condvar

track_return() called notify_all() without holding the backpressure
mutex, allowing notifications to fire between a waiter's
outstanding.load() check and their condvar.wait() call. This caused
the waiter to sleep indefinitely, hanging the
memory_cap_backpressure_multiple_waiters test on macOS/Windows CI.

Lock the mutex before notifying - the textbook condvar pattern that
guarantees waiters either see the updated state before entering wait()
or receive the notification after entering wait().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant