Skip to content

docs(readme): credit zsync for internal matching-engine inspirations - #4597

Merged
oferchen merged 1 commit into
masterfrom
docs/acknowledgement-zsync
May 20, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/acknowledgement-zsync

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

Add an acknowledgement to Colin Phipps's zsync in the README. Several in-memory speedups in the matching engine and the receive-side parallel verify scaffolding are adapted from zsync's `librcksum`:

  • The bithash pre-filter (ZSO-1) - 1 bit per slot, 8x oversized, rejects ~7/8 of random rsums in O(1) before the bucket lookup
  • The sequential-match lookahead (ZSO-2) - `next_match` hint after a confirmed match
  • Hash-chain pruning (ZSO-3) - per-block eviction after `write_blocks` succeeds
  • Compact rolling-key encoding (ZSO-4) - `rsum_a_mask` narrows the in-memory key for small-block files

Plus the parallel-receive verify scaffolding in `ParallelDeltaApplier` (BR-3i / BR-3j) borrows zsync's chunked-dispatch pattern. None of these change anything on the wire - the rsync wire format stays untouched. Per the standing no-wire-protocol-extensions guidance, anything that would require a new capability string or extra wire bytes is out of scope.

Test plan

  • CI required checks pass (fmt+clippy, nextest stable, Windows, macOS, Linux musl, interop) - docs-only diff.
  • Manual GitHub PR preview confirms the Acknowledgements section renders correctly with the new paragraph.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 20, 2026
Several in-memory speedups in the matching engine and the receive-side
parallel verify scaffolding are adapted from Colin Phipps's zsync
librcksum: the bithash pre-filter, sequential-match lookahead,
hash-chain pruning, and compact rolling-key encoding. Track these
under the ZSO-1..7 and BR-3i / BR-3j series.

The rsync wire format is untouched - zsync's techniques apply only to
in-memory data structures and dispatch patterns. Per the standing
no-wire-protocol-extensions guidance, anything that would require
new capability strings or extra wire bytes stays out of scope.
@oferchen
oferchen force-pushed the docs/acknowledgement-zsync branch from 0572fdd to 20c2e0c Compare May 20, 2026 19:26
@oferchen
oferchen merged commit a9a3060 into master May 20, 2026
9 checks passed
@oferchen
oferchen deleted the docs/acknowledgement-zsync branch May 20, 2026 20:14
oferchen added a commit that referenced this pull request May 20, 2026
Adds the two ZSO-1 acceptance tests that complement the bithash
prefilter implementation already merged in PR #3737:

- bithash_rejects_at_least_seven_eighths_of_known_misses: builds a
  filter with N=1000 inserted rsums and probes with N=1000 disjoint
  known-miss rsums, asserting at least 87% reject at the bithash
  gate. Measured rate on this run: 97.2%.
- bithash_state_does_not_leak_between_independent_indexes: builds
  two DeltaSignatureIndex values from distinct basis bytes and
  confirms a probe for blocks indexed in one never matches in the
  other, pinning the per-NDX lifecycle relied on by the ZSO-7
  audit (docs/audits/zso-7-inc-recurse-per-segment-state-2026-05-21.md).

No production code changes. Wire-byte parity is unaffected; golden
tests stay green. Bithash design follows zsync 0.6.2 librcksum
(Colin Phipps, http://zsync.moria.org.uk/, README acknowledgement
added in PR #4597).
oferchen added a commit that referenced this pull request Aug 24, 2026
…4597)

Several in-memory speedups in the matching engine and the receive-side
parallel verify scaffolding are adapted from Colin Phipps's zsync
librcksum: the bithash pre-filter, sequential-match lookahead,
hash-chain pruning, and compact rolling-key encoding. Track these
under the ZSO-1..7 and BR-3i / BR-3j series.

The rsync wire format is untouched - zsync's techniques apply only to
in-memory data structures and dispatch patterns. Per the standing
no-wire-protocol-extensions guidance, anything that would require
new capability strings or extra wire bytes stays out of scope.
oferchen added a commit that referenced this pull request Aug 24, 2026
Adds the two ZSO-1 acceptance tests that complement the bithash
prefilter implementation already merged in PR #3737:

- bithash_rejects_at_least_seven_eighths_of_known_misses: builds a
  filter with N=1000 inserted rsums and probes with N=1000 disjoint
  known-miss rsums, asserting at least 87% reject at the bithash
  gate. Measured rate on this run: 97.2%.
- bithash_state_does_not_leak_between_independent_indexes: builds
  two DeltaSignatureIndex values from distinct basis bytes and
  confirms a probe for blocks indexed in one never matches in the
  other, pinning the per-NDX lifecycle relied on by the ZSO-7
  audit (docs/audits/zso-7-inc-recurse-per-segment-state-2026-05-21.md).

No production code changes. Wire-byte parity is unaffected; golden
tests stay green. Bithash design follows zsync 0.6.2 librcksum
(Colin Phipps, http://zsync.moria.org.uk/, README acknowledgement
added in PR #4597).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant