Repository navigation
feat: sender-side INC_RECURSE with optimized partitioning and lazy segment scheduling - #3038
Merged
Merged
Conversation
oferchen
force-pushed
the
feature/sender-inc-recurse
branch
2 times, most recently
from
March 28, 2026 20:59
5c361cd to
7f8e5a2
Compare
Enable incremental recursion when our client is the sender (push mode), both for SSH and daemon transfer paths. Fix two bugs in the generator's file list partitioner that caused upstream receiver dirname validation to reject entries: 1. The "." entry was not counted when assigning wire dir_ndx values, causing all subsequent indices to be off by one vs the receiver's dir_flist growth order. 2. Nested directory dir_ndx values were assigned in sorted file-list order rather than depth-first reception order, mismatching the receiver's dir_flist append sequence. The fix uses a two-phase wire dir_ndx assignment that mirrors upstream's dir_flist construction: Phase 1 assigns indices to initial list dirs (including "."), Phase 2 assigns indices to nested dirs in depth-first traversal order as sub-lists are processed. upstream: flist.c:recv_file_list() line 2643 - dir_flist append order upstream: flist.c:send_extra_file_list() - sub-list framing protocol
oferchen
force-pushed
the
feature/sender-inc-recurse
branch
from
March 28, 2026 21:10
7f8e5a2 to
8174742
Compare
Extract the monolithic send_extra_file_lists() into three focused components following the architecture design: - SegmentScheduler: cursor-based iterator with MIN_FILECNT_LOOKAHEAD throttling, matching upstream sender.c:227,261 cadence - encode_and_send_segment(): single-segment wire encoding extracted from the god method (SRP compliance) - Transfer loop integration: sub-list sending moved from step 6 (before loop) into the loop body for lazy interleaving Additional fixes: - wire_to_flat_ndx() now uses partition_point (O(log n)) matching flat_to_wire_ndx(), replacing the linear reverse scan - Removed dead send_flist_eof_if_inc_recurse() method - Cleaned up stale doc references to send_extra_file_lists()
3 tasks
oferchen
added a commit
that referenced
this pull request
May 1, 2026
…gment scheduling (#3038) * feat: enable sender-side INC_RECURSE for push transfers Enable incremental recursion when our client is the sender (push mode), both for SSH and daemon transfer paths. Fix two bugs in the generator's file list partitioner that caused upstream receiver dirname validation to reject entries: 1. The "." entry was not counted when assigning wire dir_ndx values, causing all subsequent indices to be off by one vs the receiver's dir_flist growth order. 2. Nested directory dir_ndx values were assigned in sorted file-list order rather than depth-first reception order, mismatching the receiver's dir_flist append sequence. The fix uses a two-phase wire dir_ndx assignment that mirrors upstream's dir_flist construction: Phase 1 assigns indices to initial list dirs (including "."), Phase 2 assigns indices to nested dirs in depth-first traversal order as sub-lists are processed. upstream: flist.c:recv_file_list() line 2643 - dir_flist append order upstream: flist.c:send_extra_file_list() - sub-list framing protocol * refactor: decompose INC_RECURSE sending into scheduler + encoder Extract the monolithic send_extra_file_lists() into three focused components following the architecture design: - SegmentScheduler: cursor-based iterator with MIN_FILECNT_LOOKAHEAD throttling, matching upstream sender.c:227,261 cadence - encode_and_send_segment(): single-segment wire encoding extracted from the god method (SRP compliance) - Transfer loop integration: sub-list sending moved from step 6 (before loop) into the loop body for lazy interleaving Additional fixes: - wire_to_flat_ndx() now uses partition_point (O(log n)) matching flat_to_wire_ndx(), replacing the linear reverse scan - Removed dead send_flist_eof_if_inc_recurse() method - Cleaned up stale doc references to send_extra_file_lists() * style: remove trailing blank line in SegmentScheduler impl
oferchen
added a commit
that referenced
this pull request
May 5, 2026
…gment scheduling (#3038) * feat: enable sender-side INC_RECURSE for push transfers Enable incremental recursion when our client is the sender (push mode), both for SSH and daemon transfer paths. Fix two bugs in the generator's file list partitioner that caused upstream receiver dirname validation to reject entries: 1. The "." entry was not counted when assigning wire dir_ndx values, causing all subsequent indices to be off by one vs the receiver's dir_flist growth order. 2. Nested directory dir_ndx values were assigned in sorted file-list order rather than depth-first reception order, mismatching the receiver's dir_flist append sequence. The fix uses a two-phase wire dir_ndx assignment that mirrors upstream's dir_flist construction: Phase 1 assigns indices to initial list dirs (including "."), Phase 2 assigns indices to nested dirs in depth-first traversal order as sub-lists are processed. upstream: flist.c:recv_file_list() line 2643 - dir_flist append order upstream: flist.c:send_extra_file_list() - sub-list framing protocol * refactor: decompose INC_RECURSE sending into scheduler + encoder Extract the monolithic send_extra_file_lists() into three focused components following the architecture design: - SegmentScheduler: cursor-based iterator with MIN_FILECNT_LOOKAHEAD throttling, matching upstream sender.c:227,261 cadence - encode_and_send_segment(): single-segment wire encoding extracted from the god method (SRP compliance) - Transfer loop integration: sub-list sending moved from step 6 (before loop) into the loop body for lazy interleaving Additional fixes: - wire_to_flat_ndx() now uses partition_point (O(log n)) matching flat_to_wire_ndx(), replacing the linear reverse scan - Removed dead send_flist_eof_if_inc_recurse() method - Cleaned up stale doc references to send_extra_file_lists() * style: remove trailing blank line in SegmentScheduler impl
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
Implements sender-side INC_RECURSE with a clean 3-component architecture:
inc_recurse.rs): Classifies and reorders the file list for incremental recursion. Optimized with 1 HashMap + 2 dense Vecs (down from 4 HashMaps), TaggedIndex for O(1) node_id propagation, and move semantics viaOption<T>::take()instead of clone.mod.rs): Cursor-based iterator over pending segments withMIN_FILECNT_LOOKAHEADthrottling, matching upstreamsender.c:227,261cadence.protocol_io.rs): Single-segment wire encoding extracted from the previous 80-line god method for SRP compliance.Key changes
wire_to_flat_ndx()fixed to usepartition_point(O(log n)) matchingflat_to_wire_ndx()allow_inc_recurse=true(safe - daemon mode disables INC_RECURSE via compat negotiation per upstreamcompat.c:163-178)allow_inc_recurse=false(hardlink interop not validated)Wire compatibility
dir_flistgrowth order exactlyTest plan