Skip to content

docs: retarget upstream citations at the pinned 3.5.0 - #7601

Merged
oferchen merged 1 commit into
masterfrom
docs/retarget-citations-3-5-0-scope-a
Sep 1, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/retarget-citations-3-5-0-scope-a

Conversation

@oferchen

@oferchen oferchen commented Sep 1, 2026

Copy link
Copy Markdown
Owner

A citation naming a file that has never existed in the tree it points into

crates/matching/tests/sparse_match_fixture.rs and
crates/matching/src/index/sparse_match_tests.rs both carried:

//! - `target/interop/upstream-src/rsync-3.4.1/rsum.c:362-366` - zsync's
//!   bithash probe expression that this fixture pins.

The comment says "zsync's" and then points into the rsync tarball. rsum.c is
zsync's librcksum/rsum.c; rsync has never shipped a file of that name, at any
release. So the path is wrong in both halves - wrong project, and a version the
repo does not pin. Both files already cite the same source correctly a few lines
away (zsync librcksum/rsum.c:362-366, and crates/matching/src/index/mod.rs,
bithash.rs, compact_lookup.rs all use that form). These two sites now match it.

This is the clearest statement of why a line-count gate is not sufficient.
xtask citations passed this line for as long as it existed: it resolves a path
with a directory component that the 3.5.0 manifest lacks to ForeignUpstream and
declines to range-check it - by design, so that genuine librcksum/ citations are
not false positives. citation_drift_audit.py never looked at it either; it only
inspects citations carrying a quoted C-string anchor (572 lines of 13k+). Neither
gate can tell a deliberate foreign-upstream citation from a fabricated path.

Retargeting the rest

The other eleven sites named rsync-3.4.1/ or rsync-3.4.4/ paths while the pin
is 3.5.0, and the line numbers were 3.4.1-era, not merely the paths. Each was
re-derived by locating the cited construct in
target/interop/upstream-src/rsync-3.5.0/, both ends of every range, and each
mapping confirmed by comparing the line text across the two trees:

construct 3.4.1 3.5.0
checksum.c get_checksum1() body 285-300 303-318
checksum.c schar *buf = (schar *)buf1 (cited 285) 307
match.c hash_search() whole 140-345 163-378
match.c hash_search() two-stage gate 200-345 224-378
match.c post-match forward jump 265-310 297-343
io.c safe_read() 239 292
io.c safe_write() 312 369
io.c safe_read EOF break 276 333

batch.c, token.c and the whole-tree reference in crates/fast_io/src/iocp/pump.rs
carry no line number and only move to 3.5.0.

checksum.c:285 was already wrong at 3.4.1

Three sites cite checksum.c:285 for the schar * cast. At 3.4.1 line 285 is the
uint32 get_checksum1(char *buf1, int32 len) signature; the cast is 289. They now
name 307, which is the cast at 3.5.0.

The atimes/crtimes fixtures moved shape, not just line

3.5.0 replaced the shell testsuite/*.test suite with Python *_test.py.
testsuite/atimes.test and testsuite/crtimes.test do not exist at the pin;
atimes_test.py and crtimes_test.py do, and each declares itself a "Python
rewrite of testsuite/atimes.test". crates/metadata/tests/atimes_crtimes_roundtrip.rs
now names the Python files and says why the name changed. The prose claim (stamp
known timestamps, assert preservation) still holds against the rewrites.

Left untouched, deliberately

  • xtask/src/commands/citations.rs:174 and :562. The rsync-3.4.1/flist.c:713
    string is the worked example of the ForeignUpstream rule that gate implements -
    "a release this gate does not pin". :562 is the test asserting that resolution.
    Retargeting either destroys the example, and :562 is not a comment line.
  • tools/ci/run_upstream_test_with_upstream_binary.sh:15. The comment documents
    the script's own default, and that default is a non-comment line still reading
    upstream_version="${UPSTREAM_VERSION:-3.4.4}" while run_upstream_testsuite.sh
    defaults to 3.5.0. Editing only the comment would make it false. Flagged for a
    separate change that moves the default.
  • simd-checksum-x86_64.cpp:113-313 in crates/checksums/src/rolling/checksum/neon.rs.
    Measured: that byte range is identical between 3.4.1 and 3.5.0 (get_checksum1_ssse3_32
    starts at 113 in both). Correct by coincidence, so it stays.

Claims that changed meaning at 3.5.0 - reported, not rewritten

Neither invalidates the comment, but both are worth recording rather than quietly
absorbing:

  • hash_search() gained a MAX_CHAIN_LEN (1024) per-offset chain cap at 3.5.0
    (upstream issue Document legacy negotiation prefix replay in protocol docs #217). The "two-stage gate (rolling sum then strong sum)" the two
    sparse-match fixtures describe is still there; it is now additionally bounded.
  • The want_i adjacent-block hint gained && l == s->sums[want_i].len. The claim
    in shifted_insertion_fixture.rs that aligned shifted inserts must satisfy the
    hint still holds, under a tighter condition.

Gates

  • python3 tools/ci/check_rustfmt_all.py - 3369 tracked files, clean.
  • cargo xtask citations - 8668 names and 8668 line ranges across 5035 files, pass.
  • cargo check -p matching -p checksums -p metadata -p compress -p batch --all-targets - clean.
  • python3 tools/ci/citation_drift_audit.py matching checksums fast_io metadata compress batch -
    unchanged before and after, no rise in unresolved:
crate before after
matching 4/0/1 4/0/1
checksums 2/0/0 2/0/0
fast_io 3/0/0 3/0/0
metadata 34/0/11 34/0/11
compress 1/0/2 1/0/2
batch 8/0/4 8/0/4

Comment-only: git diff -U0 contains no changed line that is not a comment.

Scope excludes crates/transfer, crates/engine, crates/daemon, crates/core
and crates/protocol, which are being retargeted separately.

Two citations in `crates/matching` named
`.../rsync-3.4.1/rsum.c:362-366`. `rsum.c` is zsync's
`librcksum/rsum.c`; no file of that name has ever existed anywhere in
the rsync source tree, so the path was fabricated in both halves - wrong
project and a version the repo does not pin. Both sites already cite the
same source correctly elsewhere as `zsync librcksum/rsum.c:362-366`;
they now match that local form.

The remaining eleven sites named `rsync-3.4.1` / `rsync-3.4.4` paths
while the pin is 3.5.0, and the line numbers were 3.4.1-era. Each was
re-derived by locating the cited construct in the 3.5.0 tree, both ends
of every range:

- checksum.c get_checksum1: 285-300 -> 303-318; the `schar *` cast is
  307 (285 was the function signature, not the cast).
- match.c hash_search: 140-345 -> 163-378, 200-345 -> 224-378,
  265-310 -> 297-343.
- io.c safe_read/safe_write: 239 -> 292, 312 -> 369, 276 -> 333.
- testsuite/atimes.test and crtimes.test -> atimes_test.py and
  crtimes_test.py; 3.5.0 replaced the shell suite with Python rewrites.
- batch.c, token.c and the whole-tree reference in iocp/pump.rs are
  path-only and just move to 3.5.0.

Neither existing gate detects this class: `xtask citations` only checks
that a line number is within the file's 3.5.0 length, and
`citation_drift_audit.py` only inspects citations carrying a quoted C
anchor. A citation can therefore name a file that does not exist in the
tree it points into and still pass both.

`simd-checksum-x86_64.cpp:113-313` is unchanged between 3.4.1 and 3.5.0
and is left alone. The `rsync-3.4.1/flist.c:713` strings in
`xtask/src/commands/citations.rs` are the deliberate worked example of
the out-of-scope-path rule that gate implements, and stay as they are.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 1, 2026
@oferchen
oferchen merged commit c2160ae into master Sep 1, 2026
74 checks passed
@oferchen
oferchen deleted the docs/retarget-citations-3-5-0-scope-a 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