Skip to content

refactor(mux-h2): render the peer address where Debug named the socket - #1501

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
refactor/h2-socket-ref-seams
Sep 24, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
refactor/h2-socket-ref-seams

Conversation

@FlorentinDUBOIS

@FlorentinDUBOIS FlorentinDUBOIS commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Step 2 of the #1339 socket-boundary extraction (Q10/Q11). It removes the Debug impl's reach through socket_ref() and records a correction to a claim that landed on main with #1484.

What changes

ConnectionH2's Debug impl rendered .field("socket", &self.socket.socket_ref()). It now renders .field("peer_address", &self.peer_address). In h2.rs's production range this takes socket_ref() code reaches from 2 to 1 — the survivor is snapshot_rtts, which step 2b was to have addressed and does not (see below). socket_mut() stays at 0.

This is a rendered-Debug change, so no behaviour test applies; the evidence is the grep plus every battery count unmoved.

It also collapses ensure_tls_flushed's two open-coded drain sites into the method. That is a pure de-duplication rather than a refactor: with tls_wants_write on main from #1499, the method body and both sites are byte-identical strings once dedented. Real call sites go 5 → 7.

The collapse was seen red. Deleting both new calls gives 1111 passed; 2 failed, one test per collapsed site — a_stalled_window_update_drain_re_signals_the_writable_event and a_stalled_rst_stream_drain_re_signals_the_writable_event. Restoring gives 1113 passed; 0 failed.

A correction to #1484's CHANGELOG entry, already on main

That entry states the two uncovered lines in shared::drain_tls_close_notify "are uncovered because nothing calls that function at all". That is wrong. The function has two production callers:

  • lib/src/protocol/mux/h2.rs:5761 — ConnectionH2::close
  • lib/src/protocol/mux/h1.rs:960 — ConnectionH1::close

each handing &mut self.socket whole. What #1484 actually measured is that its own six-test fixture does not reach it. Two consequences: LIFECYCLE.md's close-path prose is correct, not stale, and this hand-off is a ninth self.socket occurrence that step 1's "26 → 8" count missed (re-measured as 27 → 9 by the same rule). It asks the socket no question, so it does not fit the three-seam table, and it has to move at step 7. The commit records the hand-off in doc/h2_mux_internals.md rather than restating a count that was wrong.

Step 2b is refused on its measurement, not deferred

Injecting client_rtt per pass was to be step 2b. A rule was written down before the first run: ship it only if the worker-CPU-per-request delta sits inside the base binary's own A/A band at both regimes. It does not.

Release sozu (jemallocator,crypto-ring), TLS H2 frontend to H1 backend, bombardier --http2, worker pinned to 2 cores and generator to 8, metric utime+stime from /proc/<worker>/stat per request, runs interleaved:

1 stream/conn ~100 multiplexed
getsockopt(TCP_INFO)/req today 1.46 0.94
under injection 11.42 9.16
multiplier 7.8x 9.7x
base CPU/req 61.43 us (n=4, sd 1.48, A/A band 3.33) 111.36 us (n=5, sd 2.96, A/A band 7.20)
candidate CPU/req 65.43 us (n=4, sd 1.50) 117.25 us (n=5, sd 2.67)
delta +4.00 us, +6.5%, sets disjoint, t=3.80 +5.89 us, +5.3%, t=3.31

One getsockopt(TCP_INFO) costs 458-486 ns pinned idle, so the net +9.96 / +8.22 calls predict +4.6 / +3.8 us — the same order from an independent direction.

Two corrections to the plan's own estimate: the rate increase is 7.8-9.7x, not the 2-5x recorded, and multiplexing does not rescue it — passes per request stays around 9 at 100 concurrent streams, so the multiplier rises rather than falls.

A third shape is recorded and deliberately not adopted here: sample once per Mux::ready sweep. tcpi_rtt is already the kernel's smoothed estimator so one sweep of staleness sits inside its own noise, but it changes what the access log means, which is a product question rather than a performance one.

Verification

Base 58c20711. Never --all-features except for cargo doc.

fmt                exit 0
build              exit 0
clippy             exit 0   -D warnings
test -p sozu-lib   1113 passed; 0 failed   (baseline measured at 58c20711: 1113, unmoved)
test -p sozu       113 passed; 0 failed
test -p sozu-e2e   447 passed; 0 failed; 4 filtered out
test -p sozu-sim   h2_simulation 11, metrics_lease 6, tcp_preread 6, udp 6   (tokio_unstable)
clippy -p sozu-sim exit 0   -D warnings
cite --root .      exit 0
cite --base 58c20711   exit 0
cite --audit       7 of 107   (base worktree at 58c20711: 7 of 107, same set)
rustdoc            exit 0

Exempt spans: 64, all audited by hand. --base exits 0 while exempting re-anchored spans from comparison, so its pass alone proves nothing about them. Inverting the exact diff line map (+14 / +11 / +8 across two replaced regions) and comparing each cited line against its pre-image gives 64/64 byte-identical, 0 differ, 0 unmappable. 46 citations re-anchored (11 h2_mux_internals, 1 testing, 34 LIFECYCLE); 4 below the insertion point unchanged.

#1484's six rustls tests were checked for shape drift: 0 diff hits each, each passing by name. Nothing here goes near the close-notify path, so #1498 is untouched.

Known and not fixed here

sim/tests/h2_simulation.rs:517-519 justifies SimSocket's Debug by a route that never existed — the core's Debug reached the placeholder mio::net::TcpStream's Debug through socket_ref(), never SimSocket's own. Pre-existing, and outside a Debug-field change, so named rather than silently corrected.

Refs #1339

@FlorentinDUBOIS
FlorentinDUBOIS force-pushed the refactor/h2-socket-ref-seams branch 2 times, most recently from 450dbe1 to 28d13c5 Compare September 24, 2026 09:49
`ConnectionH2`'s `Debug` impl reached `SocketHandler::socket_ref` to hand
`mio::net::TcpStream`'s own `Debug` a `socket` field: a local address, a peer
address and a file descriptor. It now renders `peer_address`, the address the
connection snapshots once at construction and that every `log_context!` line
already carries. That value has no descriptor in it, it survives the peer's
reset where a live `getpeername(2)` answers `ENOTCONN` — which is exactly when
an operator reads the line — and it is a value a byte-in / byte-out core can
produce at all, where `socket_ref` returns a concrete OS type no in-memory
transport can synthesise. The H2 simulator's in-memory `SocketHandler` carries
a connected loopback stream for that signature alone and answers a fixed
`peer_addr`, so no ephemeral port reaches a trace through this impl any more.

`socket_ref()` reaches in the production range of `h2.rs` go 2 to 1 and
`socket_mut()` stays at 0. The survivor is `ConnectionH2::snapshot_rtts`, and
Q11's local half is deliberately NOT taken here: injecting `client_rtt` means
refreshing it once per pass, where today it costs one `getsockopt(TCP_INFO)`
per stream recycle, and `Endpoint` cannot supply it lazily because it is the
other side of the connection. That trade gets measured, not reasoned about,
and it belongs to its own changeset.

Two verbatim copies of `ConnectionH2::ensure_tls_flushed`'s body — the stalled
WINDOW_UPDATE and RST_STREAM drain tails of `flush_pending_control_frames` —
become calls to it. The previous step gave that body a name; a
character-identical copy of a named method is the same fact written twice,
and both copies matched the method body exactly once indentation is removed.

Seen red first: deleting both calls gives 1111 passed; 2 failed, one test per
collapsed site — `a_stalled_window_update_drain_re_signals_the_writable_event`
and `a_stalled_rst_stream_drain_re_signals_the_writable_event` — and restoring
them returns the suite to 1113. No other count moves: `sozu` 113, `sozu-e2e`
447, the four simulators 11/6/6/6.

#1484's six `ConnectionH2<FrontRustls>` tests, which cover the
`size > 0 && WouldBlock` truncation vector, take 0 diff hits and stay green
with their shape unchanged. The TLS `close_notify` path is untouched and stays
uncovered (#1498).

`doc/h2_mux_internals.md` gains the `Debug` contract, names
`ensure_tls_flushed` as the one composite the file builds on the TLS query, and
records one reach that counting `self.socket` misses what it implies:
`ConnectionH2::close` hands `&mut self.socket` whole to
`shared::drain_tls_close_notify`, which runs its own socket_close /
socket_wants_write / socket_write_vectored drain loop on the far side. It adds
no trait method — those are the three seams' own underlying calls plus the
vectored write — but it is a place the socket crosses a function boundary
rather than being asked a question, and it is shared byte-for-byte with
`ConnectionH1::close`. 46 line citations across it, `doc/testing.md` and `LIFECYCLE.md` are re-anchored
for the line shift. The drifted-citation gate exempts 64 re-anchored spans from
its comparison, and all 64 were audited against the base blob as
byte-identical.

Refs #1339

Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS force-pushed the refactor/h2-socket-ref-seams branch from 28d13c5 to 059d1e7 Compare September 24, 2026 11:27
@FlorentinDUBOIS
FlorentinDUBOIS merged commit d192407 into main Sep 24, 2026
28 checks passed
@FlorentinDUBOIS
FlorentinDUBOIS deleted the refactor/h2-socket-ref-seams branch September 24, 2026 12:16
FlorentinDUBOIS added a commit that referenced this pull request Sep 24, 2026
lib/src/protocol/mux/LIFECYCLE.md carried three `path:NNN` citations that
resolved to real, non-blank, unrelated lines, which is all any rule in
check_doc_citations.py asks of them:

- §4.2 put the `Context.streams` push at `mod.rs:648-649`. Those are
  `listener.get_sticky_name().to_string()` and
  `listener.get_sozu_id_header().to_string()`, arguments of the
  `HttpContext::new(...)` call that opens `Context::create_stream`. The push is
  `self.streams.push(stream)` at `mod.rs:708`.
- §3.1's `Unlinked` bullet read `h1.rs:995-1052`. `995` is a format string in
  `ConnectionH1::end_stream`'s wrong-stream `error!` guard and `1052` is a
  `debug_assert!` argument; the four `StreamState::Unlinked` assignments the
  range is meant to bracket are `h1.rs:1042-1099`. It was exact at fbc83ed
  (`h1.rs:737-772` against assignments at 737, 745, 767 and 772) and successive
  renumberings walked it off them.
- §7.5's arm-site list read `h2.rs:5384`, which is `log_context!(self)` inside
  an `error!` for an out-of-bounds header block fragment. The HEADERS liveness
  refresh is `self.stream_table.touch_activity(stream_id, self.now)` at
  `h2.rs:5418`. #1501 renumbered that one from `h2.rs:5376` in the commit
  directly below this one, faithfully and still onto the wrong statement: a
  re-anchor preserves the pointer, not the claim.

CHANGELOG.md's #1484 entry said `shared::drain_tls_close_notify`'s two
uncovered lines were uncovered "because nothing calls that function at all". It
has two production callers, the `Position::Server` arms of `ConnectionH1::close`
and `ConnectionH2::close`. What #1484 measured is that its own six-test fixture
never reaches them. Only that causal clause changed; every count and probe tally
in that historical entry was true as measured and is left as written.

All three sat in the drift rule's exemption: it keys on the citation tuple as it
stood in the base revision of the citing document, so a renumbered span is
counted exempt and never compared. Measured at 42ed6ba over the window they
were renumbered in, --base f2082b6 --show reported 133 exempt cited ends across
91 doc sites; 11 are fenced blocks the pinned-quote rule already compares
verbatim, and reading the remaining 80 against the code they name found 77
correct and these three wrong. --base 42ed6ba --show on this tree exempts 67
more, the spans #1501's renumbering re-anchored: 15 pinned fences, the 4 repaired
here, and 48 that anchor on byte-identical text before and after it. --audit
reports 7 findings on this tree, all 7 the heuristic pairing a prose symbol with
a line eight or more away from it.

Documentation only: no production code, no test, no dependency and no
Cargo.lock entry changes.

Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Sep 24, 2026
…e code

lib/src/protocol/mux/LIFECYCLE.md carried three `path:NNN` citations that
resolved to real, non-blank, unrelated lines, which is all any rule in
check_doc_citations.py asks of them:

- §4.2 put the `Context.streams` push at `mod.rs:648-649`. Those are
  `listener.get_sticky_name().to_string()` and
  `listener.get_sozu_id_header().to_string()`, arguments of the
  `HttpContext::new(...)` call that opens `Context::create_stream`. The push is
  `self.streams.push(stream)` at `mod.rs:708`.
- §3.1's `Unlinked` bullet read `h1.rs:995-1052`. `995` is a format string in
  `ConnectionH1::end_stream`'s wrong-stream `error!` guard and `1052` is a
  `debug_assert!` argument; the four `StreamState::Unlinked` assignments the
  range is meant to bracket are `h1.rs:1042-1099`. It was exact at fbc83ed
  (`h1.rs:737-772` against assignments at 737, 745, 767 and 772) and successive
  renumberings walked it off them.
- §7.5's arm-site list read `h2.rs:5384`, which is `log_context!(self)` inside
  an `error!` for an out-of-bounds header block fragment. The HEADERS liveness
  refresh is `self.stream_table.touch_activity(stream_id, self.now)` at
  `h2.rs:5418`. #1501 renumbered that one from `h2.rs:5376` in the commit
  directly below this one, faithfully and still onto the wrong statement: a
  re-anchor preserves the pointer, not the claim.

§7.2 described all three per-stream reap caches as `ConnectionH2` fields
holding a `HashMap`. Both halves are wrong and have been since #1415's
stream-slot-bookkeeping extraction: `stream_last_activity_at`,
`stream_fc_stalled_since` and `stream_fc_stalled_progress` are private
`BTreeMap` fields of `H2StreamTable`, built by `BTreeMap::new()` in
`H2StreamTable::new`, and `ConnectionH2` declares no field of any of those
names. #1415 converted them for the determinism reason its own CHANGELOG entry
records and updated §4.1's wire-map bullet, but left §7.2 on the pre-extraction
shape, so the section now inverts the ordering guarantee the code provides.
Cited by symbol rather than line: that module is being edited under #1338.

CHANGELOG.md's #1484 entry said `shared::drain_tls_close_notify`'s two
uncovered lines were uncovered "because nothing calls that function at all". It
has two production callers, the `Position::Server` arms of `ConnectionH1::close`
and `ConnectionH2::close`. What #1484 measured is that its own six-test fixture
never reaches them. Only that causal clause changed; every count and probe tally
in that historical entry was true as measured and is left as written.

The three citations sat in the drift rule's exemption: it keys on the citation
tuple as it stood in the base revision of the citing document, so a renumbered
span is counted exempt and never compared. Measured at 42ed6ba over the window
they were renumbered in, --base f2082b6 --show reported 133 exempt cited ends
across 91 doc sites; 11 are fenced blocks the pinned-quote rule already compares
verbatim, and reading the remaining 80 against the code they name found 77
correct and these three wrong. --base 42ed6ba --show on this tree exempts 67
more, the spans #1501's renumbering re-anchored: 15 pinned fences, the 4 repaired
here, and 48 that anchor on byte-identical text before and after it. --audit
reports 7 findings on this tree, all 7 the heuristic pairing a prose symbol with
a line eight or more away from it. The three §7.2 declarations were in no rule's
surface at all: every rule resolves a `path:NNN` or a fenced quote, and a
sentence naming a type and a container carries neither. Sweeping LIFECYCLE.md
for the same shape leaves only the three `ConnectionH2.streams` references that
#1338 already owns.

Documentation only: no production code, no test, no dependency and no
Cargo.lock entry changes.

Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Sep 24, 2026
…e code

lib/src/protocol/mux/LIFECYCLE.md carried three `path:NNN` citations that
resolved to real, non-blank, unrelated lines, which is all any rule in
check_doc_citations.py asks of them:

- §4.2 put the `Context.streams` push at `mod.rs:713-714`. Those are
  `listener.get_sticky_name().to_string()` and
  `listener.get_sozu_id_header().to_string()`, arguments of the
  `HttpContext::new(...)` call that opens `Context::create_stream`. The push is
  `self.streams.push(stream)` at `mod.rs:773`.
- §3.1's `Unlinked` bullet read `h1.rs:995-1052`. `995` is a format string in
  `ConnectionH1::end_stream`'s wrong-stream `error!` guard and `1052` is a
  `debug_assert!` argument; the four `StreamState::Unlinked` assignments the
  range is meant to bracket are `h1.rs:1042-1099`. It was exact at fbc83ed
  (`h1.rs:737-772` against assignments at 737, 745, 767 and 772) and successive
  renumberings walked it off them.
- §7.5's arm-site list read `h2.rs:5387`, which is `log_context!(self)` inside
  an `error!` for an out-of-bounds header block fragment. The HEADERS liveness
  refresh is `self.stream_table.touch_activity(stream_id, self.now)` at
  `h2.rs:5421`. The two commits directly below this one each renumbered that
  citation and neither noticed: #1501 moved it from `h2.rs:5376` to
  `h2.rs:5384`, and #1497 from `h2.rs:5384` to `h2.rs:5387`. Both moves were
  faithful and both landed on `log_context!(self)`: a re-anchor preserves the
  pointer, not the claim.

§7.2 described all three per-stream reap caches as `ConnectionH2` fields
holding a `HashMap`. Both halves are wrong and have been since #1415's
stream-slot-bookkeeping extraction: `stream_last_activity_at`,
`stream_fc_stalled_since` and `stream_fc_stalled_progress` are private
`BTreeMap` fields of `H2StreamTable`, built by `BTreeMap::new()` in
`H2StreamTable::new`, and `ConnectionH2` declares no field of any of those
names. #1415 converted them for the determinism reason its own CHANGELOG entry
records and updated §4.1's wire-map bullet, but left §7.2 on the pre-extraction
shape, so the section now inverts the ordering guarantee the code provides.
Cited by symbol rather than line: that module is being edited under #1338.

CHANGELOG.md's #1484 entry said `shared::drain_tls_close_notify`'s two
uncovered lines were uncovered "because nothing calls that function at all". It
has two production callers, the `Position::Server` arms of `ConnectionH1::close`
and `ConnectionH2::close`. What #1484 measured is that its own six-test fixture
never reaches them. Only that causal clause changed; every count and probe tally
in that historical entry was true as measured and is left as written.

The three citations sat in the drift rule's exemption: it keys on the citation
tuple as it stood in the base revision of the citing document, so a renumbered
span is counted exempt and never compared. Measured at 42ed6ba over the window
they were renumbered in, --base f2082b6 --show reported 133 exempt cited ends
across 91 doc sites; 11 are fenced blocks the pinned-quote rule already compares
verbatim, and reading the remaining 80 against the code they name found 77
correct and these three wrong. --base 42ed6ba --show on this tree exempts 109
more, the spans #1501's and #1497's renumberings re-anchored: 15 pinned fences,
the 4 repaired here, and 90 that anchor on byte-identical text before and after
them. --audit
reports 7 findings on this tree, all 7 the heuristic pairing a prose symbol with
a line eight or more away from it. The three §7.2 declarations were in no rule's
surface at all: every rule resolves a `path:NNN` or a fenced quote, and a
sentence naming a type and a container carries neither. Sweeping LIFECYCLE.md
for the same shape leaves only the three `ConnectionH2.streams` references that

Documentation only: no production code, no test, no dependency and no
Cargo.lock entry changes.

Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Sep 24, 2026
Checklist invariant 8 pinned the drain short-circuits of
ConnectionH2::create_stream and ConnectionH2::start_stream to
h2.rs:4882-4889 and h2.rs:6710-6717. Both ranges were correct at 342397d,
and both were still the wrong form: doc/README.md's first citation form
covers prose that names an item, this prose names two methods, and
invariant 7 immediately above already declares itself symbol-cited on
purpose. Invariant 8 contradicted its own neighbour.

Measured rather than argued. A 21-line insertion into
ConnectionH2::initiate_close_notify, the shape #1498's
H1-mirroring debug_assert!s take, moves both ranges onto
self.flush_tls_records() and a bare context argument, and both still
resolve: check_doc_citations.py --root . flags neither. What does catch them
is the drifted-citation rule, which ci.yml supplies a --base for on every
pull request, and what it asks for is a re-anchor: the cost, not the cure.
Re-anchoring this file's HEADERS citation is what #1501 and #1497 each did
faithfully and each landed on the wrong statement. After the conversion the
same insertion leaves LIFECYCLE.md with zero resolver failures instead of
one, and its drifted-citation entries fall 42 to 32.

Ten further anchors convert on the same test, each one where the prose
already names the item and the item resolves to a single site: the six
remove_dead_stream call sites in section 5.4 whose method holds exactly one
such call, H2ConnectionConfig::stream_shrink_ratio, ConnectionH2.now, and
invariant 20's #[cfg(test)] mod tests boundary. Four anchors deliberately
keep a line, because there the prose means one branch inside a method that
calls remove_dead_stream more than once, or one block inside close, which
does several unrelated things: poll_write_target's H2WritePhase::Resume and
H2WritePhase::End arms, handle_window_update_frame's zero-increment path,
and close's backend-stream teardown. Converting those would trade a rotting
pointer for a vague one.

The invariant-8 site and the section 5.4 list now carry a "do not convert it
back" note in invariant 7's style. Document only: no behaviour, no public
API, no test expectation, h2.rs is byte-identical to 342397d, and
doc/h2_mux_internals.md's pinned code blocks are untouched, being fenced
verbatim quotes compared by content.

Verified: python3 .github/scripts/check_doc_citations.py --root . -> exit 0
Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Sep 24, 2026
…e code (#1504)

lib/src/protocol/mux/LIFECYCLE.md carried three `path:NNN` citations that
resolved to real, non-blank, unrelated lines, which is all any rule in
check_doc_citations.py asks of them:

- §4.2 put the `Context.streams` push at `mod.rs:713-714`. Those are
  `listener.get_sticky_name().to_string()` and
  `listener.get_sozu_id_header().to_string()`, arguments of the
  `HttpContext::new(...)` call that opens `Context::create_stream`. The push is
  `self.streams.push(stream)` at `mod.rs:773`.
- §3.1's `Unlinked` bullet read `h1.rs:995-1052`. `995` is a format string in
  `ConnectionH1::end_stream`'s wrong-stream `error!` guard and `1052` is a
  `debug_assert!` argument; the four `StreamState::Unlinked` assignments the
  range is meant to bracket are `h1.rs:1042-1099`. It was exact at fbc83ed
  (`h1.rs:737-772` against assignments at 737, 745, 767 and 772) and successive
  renumberings walked it off them.
- §7.5's arm-site list read `h2.rs:5387`, which is `log_context!(self)` inside
  an `error!` for an out-of-bounds header block fragment. The HEADERS liveness
  refresh is `self.stream_table.touch_activity(stream_id, self.now)` at
  `h2.rs:5421`. The two commits directly below this one each renumbered that
  citation and neither noticed: #1501 moved it from `h2.rs:5376` to
  `h2.rs:5384`, and #1497 from `h2.rs:5384` to `h2.rs:5387`. Both moves were
  faithful and both landed on `log_context!(self)`: a re-anchor preserves the
  pointer, not the claim.

§7.2 described all three per-stream reap caches as `ConnectionH2` fields
holding a `HashMap`. Both halves are wrong and have been since #1415's
stream-slot-bookkeeping extraction: `stream_last_activity_at`,
`stream_fc_stalled_since` and `stream_fc_stalled_progress` are private
`BTreeMap` fields of `H2StreamTable`, built by `BTreeMap::new()` in
`H2StreamTable::new`, and `ConnectionH2` declares no field of any of those
names. #1415 converted them for the determinism reason its own CHANGELOG entry
records and updated §4.1's wire-map bullet, but left §7.2 on the pre-extraction
shape, so the section now inverts the ordering guarantee the code provides.
Cited by symbol rather than line: that module is being edited under #1338.

CHANGELOG.md's #1484 entry said `shared::drain_tls_close_notify`'s two
uncovered lines were uncovered "because nothing calls that function at all". It
has two production callers, the `Position::Server` arms of `ConnectionH1::close`
and `ConnectionH2::close`. What #1484 measured is that its own six-test fixture
never reaches them. Only that causal clause changed; every count and probe tally
in that historical entry was true as measured and is left as written.

The three citations sat in the drift rule's exemption: it keys on the citation
tuple as it stood in the base revision of the citing document, so a renumbered
span is counted exempt and never compared. Measured at 42ed6ba over the window
they were renumbered in, --base f2082b6 --show reported 133 exempt cited ends
across 91 doc sites; 11 are fenced blocks the pinned-quote rule already compares
verbatim, and reading the remaining 80 against the code they name found 77
correct and these three wrong. --base 42ed6ba --show on this tree exempts 109
more, the spans #1501's and #1497's renumberings re-anchored: 15 pinned fences,
the 4 repaired here, and 90 that anchor on byte-identical text before and after
them. --audit
reports 7 findings on this tree, all 7 the heuristic pairing a prose symbol with
a line eight or more away from it. The three §7.2 declarations were in no rule's
surface at all: every rule resolves a `path:NNN` or a fenced quote, and a
sentence naming a type and a container carries neither. Sweeping LIFECYCLE.md
for the same shape leaves only the three `ConnectionH2.streams` references that

Documentation only: no production code, no test, no dependency and no
Cargo.lock entry changes.

Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Sep 24, 2026
#1509)

Checklist invariant 8 pinned the drain short-circuits of
ConnectionH2::create_stream and ConnectionH2::start_stream to
h2.rs:4882-4889 and h2.rs:6710-6717. Both ranges were correct at 342397d,
and both were still the wrong form: doc/README.md's first citation form
covers prose that names an item, this prose names two methods, and
invariant 7 immediately above already declares itself symbol-cited on
purpose. Invariant 8 contradicted its own neighbour.

Measured rather than argued. A 21-line insertion into
ConnectionH2::initiate_close_notify, the shape #1498's
H1-mirroring debug_assert!s take, moves both ranges onto
self.flush_tls_records() and a bare context argument, and both still
resolve: check_doc_citations.py --root . flags neither. What does catch them
is the drifted-citation rule, which ci.yml supplies a --base for on every
pull request, and what it asks for is a re-anchor: the cost, not the cure.
Re-anchoring this file's HEADERS citation is what #1501 and #1497 each did
faithfully and each landed on the wrong statement. After the conversion the
same insertion leaves LIFECYCLE.md with zero resolver failures instead of
one, and its drifted-citation entries fall 42 to 32.

Ten further anchors convert on the same test, each one where the prose
already names the item and the item resolves to a single site: the six
remove_dead_stream call sites in section 5.4 whose method holds exactly one
such call, H2ConnectionConfig::stream_shrink_ratio, ConnectionH2.now, and
invariant 20's #[cfg(test)] mod tests boundary. Four anchors deliberately
keep a line, because there the prose means one branch inside a method that
calls remove_dead_stream more than once, or one block inside close, which
does several unrelated things: poll_write_target's H2WritePhase::Resume and
H2WritePhase::End arms, handle_window_update_frame's zero-increment path,
and close's backend-stream teardown. Converting those would trade a rotting
pointer for a vague one.

The invariant-8 site and the section 5.4 list now carry a "do not convert it
back" note in invariant 7's style. Document only: no behaviour, no public
API, no test expectation, h2.rs is byte-identical to 342397d, and
doc/h2_mux_internals.md's pinned code blocks are untouched, being fenced
verbatim quotes compared by content.

Verified: python3 .github/scripts/check_doc_citations.py --root . -> exit 0

Signed-off-by: Florentin Dubois <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant