Skip to content

Refactor filter rule parsing into smaller modules - #2060

Merged
oferchen merged 1 commit into
masterfrom
decompose-source-files-over-500-lines
Nov 8, 2025
Merged

oferchen merged 1 commit into
masterfrom
decompose-source-files-over-500-lines

Conversation

@oferchen

@oferchen oferchen commented Nov 8, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • replace the monolithic filter rule parser with a parsing module split across helpers, modifiers, merge, and shorthand components
  • preserve existing parsing behaviour while improving readability and maintainability of the CLI filter handling code

Testing

  • cargo test -p oc-rsync-cli parse_filter_directive

[Codex Task](

@oferchen
oferchen merged commit e8df91c into master Nov 8, 2025
@oferchen
oferchen deleted the decompose-source-files-over-500-lines branch November 8, 2025 11:15
oferchen added a commit that referenced this pull request May 5, 2026
Translate zsync librcksum's bithash mechanism into oc-rsync without
touching the wire. Establish the bit-array shape and the
BITHASHBITS=3 sizing rationale, name the exact insertion points in
the existing index, fix the bit-mixing function on the 32-bit packed
rolling sum, restate the no-missed-match property invariant, and
list every layer the change must keep byte-identical to upstream
3.0.9 / 3.1.3 / 3.4.1.

Bench scaffolding is cfg-gated and never reaches a CLI flag.
Implementation is tracked in #2060/#2061; tests in #2062; bench in
#2063.
oferchen added a commit that referenced this pull request May 6, 2026
* feat(match): add zsync-inspired bithash prefilter to MatchIndex

Translate zsync's librcksum bithash gate into oc-rsync's existing
DeltaSignatureIndex. The bithash is an oversized one-sided bit array
sized to roughly 8x the rsum-bucket count and probed after the
1 KB tag_table check but before the FxHashMap walk. At the design
saturation density (1/8) it rejects ~7/8 of post-tag misses for
purely receiver-side CPU savings.

The prefilter is in-memory only: no signature payload, NDX framing,
capability negotiation, multiplex frame, golden-byte fixture, or
interop matrix is touched. Sizing follows docs/design/zsync-bithash.md
sections 1 and 2; insertion and probe sites match section 3 exactly.

Wires into populate_index alongside tag_table and lookup, and into
DeltaSignatureIndex::rebuild via clear() to recycle across the
INC_RECURSE per-segment rebuild path. The probe goes into both
find_match_bytes and find_match_slices; check_block_match_slices is
intentionally not gated since it bypasses the hash table.

Property tests pin the no-false-negative contract end-to-end (every
inserted basis block is still found) and at the BitHash level
(contains is true for every previously inserted rsum, including
across clear/reinsert cycles).

Closes #2060
Closes #2061
Closes #2062

* fix(deps): regenerate Cargo.lock for proptest dev-dep
oferchen added a commit that referenced this pull request May 18, 2026
Translate zsync librcksum's bithash mechanism into oc-rsync without
touching the wire. Establish the bit-array shape and the
BITHASHBITS=3 sizing rationale, name the exact insertion points in
the existing index, fix the bit-mixing function on the 32-bit packed
rolling sum, restate the no-missed-match property invariant, and
list every layer the change must keep byte-identical to upstream
3.0.9 / 3.1.3 / 3.4.1.

Bench scaffolding is cfg-gated and never reaches a CLI flag.
Implementation is tracked in #2060/#2061; tests in #2062; bench in
#2063.
oferchen added a commit that referenced this pull request May 18, 2026
* feat(match): add zsync-inspired bithash prefilter to MatchIndex

Translate zsync's librcksum bithash gate into oc-rsync's existing
DeltaSignatureIndex. The bithash is an oversized one-sided bit array
sized to roughly 8x the rsum-bucket count and probed after the
1 KB tag_table check but before the FxHashMap walk. At the design
saturation density (1/8) it rejects ~7/8 of post-tag misses for
purely receiver-side CPU savings.

The prefilter is in-memory only: no signature payload, NDX framing,
capability negotiation, multiplex frame, golden-byte fixture, or
interop matrix is touched. Sizing follows docs/design/zsync-bithash.md
sections 1 and 2; insertion and probe sites match section 3 exactly.

Wires into populate_index alongside tag_table and lookup, and into
DeltaSignatureIndex::rebuild via clear() to recycle across the
INC_RECURSE per-segment rebuild path. The probe goes into both
find_match_bytes and find_match_slices; check_block_match_slices is
intentionally not gated since it bypasses the hash table.

Property tests pin the no-false-negative contract end-to-end (every
inserted basis block is still found) and at the BitHash level
(contains is true for every previously inserted rsum, including
across clear/reinsert cycles).

Closes #2060
Closes #2061
Closes #2062

* fix(deps): regenerate Cargo.lock for proptest dev-dep
oferchen added a commit that referenced this pull request Aug 24, 2026
Translate zsync librcksum's bithash mechanism into oc-rsync without
touching the wire. Establish the bit-array shape and the
BITHASHBITS=3 sizing rationale, name the exact insertion points in
the existing index, fix the bit-mixing function on the 32-bit packed
rolling sum, restate the no-missed-match property invariant, and
list every layer the change must keep byte-identical to upstream
3.0.9 / 3.1.3 / 3.4.1.

Bench scaffolding is cfg-gated and never reaches a CLI flag.
Implementation is tracked in #2060/#2061; tests in #2062; bench in
#2063.
oferchen added a commit that referenced this pull request Aug 24, 2026
* feat(match): add zsync-inspired bithash prefilter to MatchIndex

Translate zsync's librcksum bithash gate into oc-rsync's existing
DeltaSignatureIndex. The bithash is an oversized one-sided bit array
sized to roughly 8x the rsum-bucket count and probed after the
1 KB tag_table check but before the FxHashMap walk. At the design
saturation density (1/8) it rejects ~7/8 of post-tag misses for
purely receiver-side CPU savings.

The prefilter is in-memory only: no signature payload, NDX framing,
capability negotiation, multiplex frame, golden-byte fixture, or
interop matrix is touched. Sizing follows docs/design/zsync-bithash.md
sections 1 and 2; insertion and probe sites match section 3 exactly.

Wires into populate_index alongside tag_table and lookup, and into
DeltaSignatureIndex::rebuild via clear() to recycle across the
INC_RECURSE per-segment rebuild path. The probe goes into both
find_match_bytes and find_match_slices; check_block_match_slices is
intentionally not gated since it bypasses the hash table.

Property tests pin the no-false-negative contract end-to-end (every
inserted basis block is still found) and at the BitHash level
(contains is true for every previously inserted rsum, including
across clear/reinsert cycles).

Closes #2060
Closes #2061
Closes #2062

* fix(deps): regenerate Cargo.lock for proptest dev-dep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant