Repository navigation
fix: order local -vv notices and names as upstream prints them - #8324
Merged
Merged
Conversation
oferchen
force-pushed
the
feat/local-progress-order
branch
from
November 3, 2026 22:23
4fde45e to
5723eac
Compare
A local copy now prints its "is uptodate" and skip notices interleaved with the transferred names the way rsync 3.5.1 does, with and without --progress. The generator prints a notice as it checks the entry, while the names it itemizes to the sender wait until it reaches a list the sender has not sent yet (generator.c:2830-2841, sender.c:515-547). core::client::listing_order models that walk once: lists depth-first, each directory itemized at the start of its own list, and the lookahead driven through protocol's new SubListLookahead, which SubListPlan::lookahead_schedule now uses too. The post-hoc listing and the --progress forwarder both take their order from it; the forwarder releases the dry-run preview's notices ahead of the first name upstream prints after them.
oferchen
force-pushed
the
feat/local-progress-order
branch
from
November 4, 2026 01:01
5723eac to
572c22a
Compare
This was referenced Nov 4, 2026
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
A local
-vvcopy now prints itsis uptodateand skip notices interleaved with the transferred names the way rsync 3.5.1 does. That holds with and without--progress.Before this change:
--progress, oc printed each line as the copy walked:aaacame beforebbb is uptodate.--progress, oc put every notice before every name.Upstream does neither. It runs a generator and a sender:
wait_for_receiver()), and at the end.So on a large tree the notices and names come out window by window.
How
core::client::listing_order(events, inc_recurse).SubListPlan::lookahead_schedulenow runs on a new incrementalSubListLookahead, which the ordering function also drives one request at a time.-v/-vvrender, viaClientSummary::listing_order(). It replaces the bucket sort inemit_verbose.--progressforwarder. It already runs a dry-run preview of the copy. It now takes the preview's notices in upstream order, releases them just before the first name upstream prints after them, and drops the live duplicates. The live renderer writes held-back entry lines before a notice, so the forwarder's order reaches the terminal unchanged.ClientEvent(is_generator_notice,is_deferred_hardlink,is_hardlinked_symlink), so the core function and the CLI share them.ClientConfig::local_inc_recurse()replaces the inline expression that the summary banner used, and the ordering uses the same call.Remote transfers are unchanged: their summary keeps the single-list order.
Evidence
Order signatures (names verbatim, runs of notices as
[nU]) against the tarball 3.5.1 build,-r -t -vv, both with and without--progress:[2U] aaa(10/10)aaa [2U]under --progress[2U] aaa[4U] d/ccc(10/10)[3U] d/ccc [1U]under --progress[4U] d/ccc[996U] x/f001 x/f075 y/f001 y/f075 [498U] z/f001 z/f075(15/15)[1494U] ...[1396U] a.. b.. [1396U] c.. d..[2792U] ...[1036U] d01..d06 ...(15/15)[1480U] ...[1499U] f0002 f1499 sub/s2(15/15)Tests:
crates/cli/tests/local_listing_order.rs--progress. Both fail on master.-vv,-vv --progressand-v --progress. Rate and ETA are masked. It drops three kinds of line that differ for other reasons: progress lines (task 579), thesent/total sizetrailer (task 158), and the sender'sexpand file_list pointer arraydebug lines (task 580).coreunit tests forlisting_order: the flat case, the 3x500 windows, the single-list case, depth-first directory placement, and deletions.clilive-progress test: a notice must not overtake a held-back entry line.Deviations, for a decision
[2U] aaa.txt [1U] d/ddd.txt20/20 at load 12. An earlier run on a quieter host mostly gave the other order,[3U] aaa.txt d/ddd.txt. oc always takes the second: a list the lookahead has sent counts as arrived. The oracle cells use trees whose order does not depend on this race.--no-inc-recursivelarge lists. Here upstream interleaves on output-buffer fill, e.g.[198U] x/f001 [398U] .... oc prints every notice first. Modelling the buffer means modelling upstream's byte counts per request, which this change does not do.Mutations
Each mutation was applied to the branch and the targeted tests run (core
listing_order, clilocal_listing_orderwith the 3.5.1 oracle on, cli live-progress, protocol sub-list):sent < listsent < list,file_total(sum of sent lists) is belowfile_old_total(sum through the request's list), so the 1000-entry clause already holds. The clause is the original planner's and stays as documentation of upstream's wait.Overlaps
push-overlap.sh HEAD a2d8c5d17reports two file-only overlaps:cli/src/frontend/execution/drive/summary.rs(its hunk isemit_error_report; this branch replaces the banner's INC_RECURSE expression);feat/live-diag-sink, in the same file.Performance
Symbolized release builds (
debug = 1, unstripped) of master (a2d8c5d) and this branch. Local copy of 10k small files, half up to date.RAYON_NUM_THREADS=1so idle-worker spinning does not count. 11 interleaved rounds per binary;perf stat -e instructions:u. Median delta, branch vs master, with an A/A run of the same pair as the noise floor:-vv-v --progress-vv --progressNo
-v/--progresscosts nothing: the ordering pass runs only when names print. What is left, fromperf recordself samples:-vv: the ordering pass, about 190 instructions per entry (one parent-key hash with a last-parent cache, the depth-first rank, the lookahead window).--progress: the ordering pass plus the forwarder's two preview maps (notice count before each entry, previewed notices). That is oneOsStringkey allocation and one byte-key hash per entry, about 730 instructions per entry in all.Profiling found and removed two costs. The ordering pass used
Path::parentand component-wisePathequality and hashing; it now slices the path's encoded bytes at the last separator (+2.38% to +0.43% on-vv). The forwarder's maps werePathBuf-keyed, grew from empty and recorded entries with no notice queued; they are now byte-keyed, sized up front, and skip those entries (+3.04% to +1.08% on-v --progress).Conventional commit prefix
fix: