Skip to content

docs(engine,daemon,core,protocol): retarget citations at rsync 3.5.0 - #7603

Merged
oferchen merged 1 commit into
masterfrom
docs/retarget-citations-350
Sep 1, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/retarget-citations-350

Conversation

@oferchen

@oferchen oferchen commented Sep 1, 2026

Copy link
Copy Markdown
Owner

The pinned upstream oracle is rsync 3.5.0, but citations across
crates/{engine,daemon,core,protocol} still carried 3.4.1- and 3.4.4-era line
numbers. These are not cosmetically-stale paths: the numbers point at the wrong
code.

Comment-only. No behaviour change.

Before / after: what the old number actually says at 3.5.0

citation claim in the comment 3.4.1/3.4.4 line what that line is at 3.5.0 retargeted to
delete.c:130-225 (6 files) delete_item enum delret delete_item(...) * delete recursively. — a comment fragment delete.c:191-288
generator.c:272-347 (5 files) delete_in_dir static void delete_in_dir(...) lseek(deldelay_fd, 0, 0); inside flush_delete_delay() generator.c:285-360
clientserver.c:752 (2 files) the @ERROR: max connections (%d) reached reply that io_printf line int ret, pre_exec_arg_fd = -1, ... — a variable declaration clientserver.c:799
flist.c:3217-3343 f_name_cmp int f_name_cmp(...) return ndx; inside flist_find_ignore_dirness() flist.c:3554-3671
main.c:1267-1384 (2 files) client_run() int client_run(...) rprintf(FERROR, "Your options have been rejected...") main.c:1323-1440
hlink.c:186-208 match_hard_links void match_hard_links(...) if (inc_recurse && CVAL(node->data, 0) == 0) { hlink.c:200-222

Method

Every site was resolved by locating the named construct in
target/interop/upstream-src/rsync-3.5.0, never by arithmetic, and both ends
of every START-END range were re-derived independently. Ranges that repeat
across files (delete.c:130-225, generator.c:272-347, …) were resolved once
and applied consistently.

Findings that are not retargets

del.c does not exist — in any version. crates/engine/src/delete/reorder_buffer.rs:65
cited rsync-3.4.1/del.c for NDX_DEL_STATS semantics. There is no del.c at
3.4.1 or 3.5.0. The described construct (one frame, five varints) is
main.c:write_del_stats() / read_del_stats(); the citation now names those
functions at main.c:229-251.

Two pre-existing over-spans, corrected rather than shifted.
delete.c:82-225 (delete_item) in delete/mod.rs and
delete_determinism_property.rs: at 3.4.1, line 82 is inside
delete_dir_contents (/* We do our own recursion... */), not delete_item
(130). flist.c:3217-3343 (f_name_cmp) in delete/mod.rs: f_name_cmp ends at
3334 at 3.4.1; 3343 is inside f_name_has_prefix. Both were narrowed to the
labelled function's true 3.5.0 bounds. socket.c:402-499 (open_socket_in) at
3.4.4 likewise stopped one line short of the function (500).

Claims whose named helpers no longer exist upstream — prose left alone.
emitter/mod.rs says delete_item uses "do_rmdir for directories and
robust_unlink for everything else"; cohort_index.rs says "the dispatch is
unconditional do_unlink". At 3.5.0 the directory arm is
del_held_dfd() + do_unlink_atfd(dfd, leaf, AT_REMOVEDIR) (falling back to
do_rmdir_at), and the file arm is del_unlink(). The policy is unchanged
(rmdir for dirs, unconditional unlink otherwise), so the ranges were retargeted
and the prose left as-is rather than rewritten to match 3.5.0. Flagging it here
so a reviewer can decide.

Separately, emitter/mod.rs's delete_item bullet says "ENOTEMPTY recurses".
It does not, at either version: the recursion happens in delete_dir_contents
before the rmdir, and delete_item's ENOTEMPTY arm only sets
DR_NOT_EMPTY. Pre-existing, not version drift; left untouched.

One quoted C excerpt had to move with its range.
zlib_codec_proto_lt_31.rs quotes (elided) send_deflated_token. 3.5.0
restructured that loop: the deflate() call now sits inside a nested drain loop
(bundled-zlib Z_INSERT_ONLY vs system-zlib Z_SYNC_FLUSH fallback, upstream
#951). The protocol_version >= 31 offset advance the test actually pins is
byte-identical. The elision was updated so the quote is faithful to the lines it
now cites (475-511). The send_file_entry flag prelude quoted in
flist_wire_flags_rp28g.rs is byte-identical at 3.5.0 — path and range only.

One citation coincides across versions. hlink.c:59-65 (init_hard_links)
is at the same lines in both trees; only the path changed. Being in the stale set
did not mean it had moved.

cleanup.rs carried three eras side by side. 3.4.1-era, 3.4.4-era, and
already-3.5.0 citations in the same file. Verified-correct-at-3.5.0 and therefore
left untouched: delete.c:217, generator.c:351, flist.c:1490, and the whole
sender.c block (145, 176-177, 395, 426-428, 429-430, 433-440,
434-439, 442, 442-451, 453, 454, 456-457, 457-458).

Deliberately not touched

crates/core/tests/common/mod.rs:428 names rsync-3.4.4/rsync — an interop
binary path
this repo builds, not a source citation. Same shape at
.github/workflows/_interop.yml:87.

Stale citations found outside this PR's scope

Reported, not changed here:

  • crates/daemon/src/daemon/sections/server_runtime/{accept_loop.rs:199, listener.rs:370, listener.rs:463, tests.rs:1234, tests.rs:1490} — all cite
    socket.c::open_socket_in at 3.4.1 428-498 / 3.4.4 432-498 /
    socket.c:463-465. This PR moved runtime_options/types.rs to
    rsync-3.5.0/socket.c:552-650 for the same function
    , so those five sites are
    now the odd ones out. They sit in an area under active change, hence the split.
  • crates/core/src/client/remote/output_option.rs:3 — options.c at
    rsync-3.4.4:354
  • crates/core/tests/exit_code_comprehensive.rs:1139 — rsync-3.4.1/errcode.h
  • crates/protocol/tests/iconv_golden_bytes.rs:7 — rsync-3.4.1/flist.c

Gates

gate result
python3 tools/ci/check_rustfmt_all.py 3369 tracked .rs files checked at edition 2024 — clean
cargo xtask citations 8668 names / 8668 line ranges across 5035 files — pass

python3 tools/ci/citation_drift_audit.py engine daemon core protocol:

crate before (anchored / drift / unresolved) after
engine 39 / 0 / 35 41 / 0 / 35
daemon 88 / 2 / 43 90 / 2 / 42
core 60 / 0 / 61 60 / 0 / 61
protocol 60 / 0 / 27 60 / 0 / 27

unresolved does not rise anywhere; string-anchored rises by 2 in engine and
daemon and daemon's unresolved drops by 1 — retargeted anchors that now resolve
against the 3.5.0 tree. The 2 daemon drift rows are pre-existing and untouched.

Verified comment-only: every added and removed line in the diff begins with
//, ///, or //!.

The pinned upstream oracle is rsync 3.5.0, but 3.4.x-era citations in
crates/{engine,daemon,core,protocol} still carried 3.4.1/3.4.4 line
numbers. Neither gate can catch this: 'xtask citations' only checks the
number is within the 3.5.0 file's length, and the drift audit only
inspects citations carrying a quoted C-string anchor.

Every site was resolved by locating the named construct in
target/interop/upstream-src/rsync-3.5.0, not by arithmetic. Both ends of
each range were re-derived. Comment-only; no behaviour change.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 1, 2026
@oferchen
oferchen merged commit 17c1793 into master Sep 1, 2026
72 checks passed
@oferchen
oferchen deleted the docs/retarget-citations-350 branch September 1, 2026 19:00
oferchen added a commit that referenced this pull request Sep 1, 2026
…ng them

`resolve_upstream_path` returns `ForeignUpstream` for any cited path carrying a
`/` that is not a manifest key, on the rule that a directory rsync does not ship
names a different project. A citation written as
`target/interop/upstream-src/rsync-3.5.0/delete.c:191` matches that rule, so the
gate skips it - and the skip `continue`s above `tally.names_checked`, so it
leaves no trace in a report whose stated job is telling "clean" apart from
"examined nothing".

Measured on master at 92e50ab: 8718 names and 8718 ranges checked, and 379
citations skipped. 113 of those 379 name the PINNED release - 34 spelling the
full unpack prefix, 79 spelling the bare `rsync-3.5.0/` directory - so their
line numbers have never been checked by anything. That set includes the
citations #7601, #7603 and #7605 have just rewritten: the retarget sweep landed
its new line numbers into the one shape the gate does not read.

Three changes:

- A leading `[target/interop/upstream-src/]rsync-<VER>/` is split off before
  resolution, so a prefixed citation of the pinned release resolves to a
  manifest key and is range-checked exactly as the bare form is. A `rsync-`
  directory that is not a version number is not stripped.
- A citation naming any other release becomes `Violation::UnpinnedRelease`, a
  hard failure. It names rsync at a version this tree no longer builds against,
  which is a stale citation, not an out-of-scope one.
- Under a pinned prefix, a tail that resolves nowhere is `Missing` rather than
  `ForeignUpstream`: the prefix asserts the release outright, so it cannot be
  another project.
- The skip is counted before the `continue`, and `execute` prints the skipped
  and permitted totals, so a population that grows again grows in the open.

After: 8831 names and 8831 ranges checked, 10 skipped - all of them zsync's
genuinely foreign `librcksum/`.

Two exemptions from the unpinned-release arm, both scoped, neither covering the
phantom-file or out-of-range arms. `CONTRIBUTING.md` and
`xtask/src/commands/citations.rs` document this gate and have to be able to
spell a rejected citation to show what it rejects. `docs/` mixes live reference
with historical record, and a note describing upstream at 3.4.1 is accurate
because it names the old release; 253 citations across 70 files there name a
non-pinned release, and sorting record from reference needs a reader per file.

Non-vacuity, both arms, end to end. A probe file citing
`rsync-3.4.1/flist.c:999999`, `rsync-3.5.0/flist.c:999999` and the bare
`rsync-3.5.0/` spelling of the same - a line no rsync release has - was added to
the tree. Against master's gate: exit 0, tally `8718 name(s) and 8718 line
range(s)`, byte for byte the tally without the probe, so the probe was invisible
rather than tolerated. Against this gate: exit 1, the 3.4.1 line reported as
unpinned and both 3.5.0 spellings reported as out of range, and those three are
the only violations in the tree. The probe was removed before commit.

Also sweeps nine citations of `checksum.c:285`, which claims the `schar *buf`
cast. At the pin that cast is line 307; 285 is now `case CSUM_SHA256:` inside a
digest switch. #7601 corrected three instances of this string and left nine,
which is the failure mode the gate's own docs name: a finder only surfaces what
its heuristic matched, so working a finding list is not a sweep. All nine are in
range and were green under both gates.
oferchen added a commit that referenced this pull request Sep 2, 2026
…ng them (#7607)

`resolve_upstream_path` returns `ForeignUpstream` for any cited path carrying a
`/` that is not a manifest key, on the rule that a directory rsync does not ship
names a different project. A citation written as
`target/interop/upstream-src/rsync-3.5.0/delete.c:191` matches that rule, so the
gate skips it - and the skip `continue`s above `tally.names_checked`, so it
leaves no trace in a report whose stated job is telling "clean" apart from
"examined nothing".

Measured on master at 92e50ab: 8718 names and 8718 ranges checked, and 379
citations skipped. 113 of those 379 name the PINNED release - 34 spelling the
full unpack prefix, 79 spelling the bare `rsync-3.5.0/` directory - so their
line numbers have never been checked by anything. That set includes the
citations #7601, #7603 and #7605 have just rewritten: the retarget sweep landed
its new line numbers into the one shape the gate does not read.

Three changes:

- A leading `[target/interop/upstream-src/]rsync-<VER>/` is split off before
  resolution, so a prefixed citation of the pinned release resolves to a
  manifest key and is range-checked exactly as the bare form is. A `rsync-`
  directory that is not a version number is not stripped.
- A citation naming any other release becomes `Violation::UnpinnedRelease`, a
  hard failure. It names rsync at a version this tree no longer builds against,
  which is a stale citation, not an out-of-scope one.
- Under a pinned prefix, a tail that resolves nowhere is `Missing` rather than
  `ForeignUpstream`: the prefix asserts the release outright, so it cannot be
  another project.
- The skip is counted before the `continue`, and `execute` prints the skipped
  and permitted totals, so a population that grows again grows in the open.

After: 8831 names and 8831 ranges checked, 10 skipped - all of them zsync's
genuinely foreign `librcksum/`.

Two exemptions from the unpinned-release arm, both scoped, neither covering the
phantom-file or out-of-range arms. `CONTRIBUTING.md` and
`xtask/src/commands/citations.rs` document this gate and have to be able to
spell a rejected citation to show what it rejects. `docs/` mixes live reference
with historical record, and a note describing upstream at 3.4.1 is accurate
because it names the old release; 253 citations across 70 files there name a
non-pinned release, and sorting record from reference needs a reader per file.

Non-vacuity, both arms, end to end. A probe file citing
`rsync-3.4.1/flist.c:999999`, `rsync-3.5.0/flist.c:999999` and the bare
`rsync-3.5.0/` spelling of the same - a line no rsync release has - was added to
the tree. Against master's gate: exit 0, tally `8718 name(s) and 8718 line
range(s)`, byte for byte the tally without the probe, so the probe was invisible
rather than tolerated. Against this gate: exit 1, the 3.4.1 line reported as
unpinned and both 3.5.0 spellings reported as out of range, and those three are
the only violations in the tree. The probe was removed before commit.

Also sweeps nine citations of `checksum.c:285`, which claims the `schar *buf`
cast. At the pin that cast is line 307; 285 is now `case CSUM_SHA256:` inside a
digest switch. #7601 corrected three instances of this string and left nine,
which is the failure mode the gate's own docs name: a finder only surfaces what
its heuristic matched, so working a finding list is not a sweep. All nine are in
range and were green under both gates.
oferchen added a commit that referenced this pull request Sep 2, 2026
`## [Unreleased]` last covered the #7304-#7522 era. Measured against the 60
most recently merged pull requests, 44 were absent; of the most recent 45,
43 were absent. Nothing from #7574 onward was recorded at all.

Each entry is derived from what the pull request actually landed - the merge
commit and the body - not from its title. Three cases where those differ:

  * #7616 ships far more than the doc-alias correction its body describes:
    the `upstream_version` pin moves to 3.5.0 and `--version` starts naming
    `quic`, `sd-notify`, `vmsplice` and `send_zc`.
  * #7618 also adds the pull-request rustdoc-link job its body says was
    filed separately, which is what closes the master-only-gate recurrence.
  * #7602's squash carries the closed #7597 as its first commit, so the
    directory-obstacle half is recorded under #7602.

#7587 is deliberately not recorded. Its merge commit is empty: the change
had already landed as #7563, which the section already names.

Entries extend the existing Keep a Changelog groups and the bold
sub-groupings. Clusters that are one story carry one entry with several
references: the FERROR_XFER routing and its two-phase drain (#7576, #7581),
the connection-FSM close edge and the accept loop that outlives a session
error (#7579, #7590), the three detaching daemon suites (#7578, #7588,
#7592), the io_uring and SEND_ZC work (#7593, #7600, #7610), the citation
retargets (#7601, #7603, #7604), and the accept-loop pin flake (#7615,
#7620).

Only `## [Unreleased]` is touched; every released section, including the
3.4.4 statements that were correct when written, is byte-identical.
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