Skip to content

refactor(mux-h2): split finalize_write and flush_pending_control_frames at their flush points - #1512

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
refactor/h2-finalize-write-split
Sep 24, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
refactor/h2-finalize-write-split

Conversation

@FlorentinDUBOIS

@FlorentinDUBOIS FlorentinDUBOIS commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Step S4 of the H2 socket-boundary extraction (#1339, Q10), on top of #1507 (bdda063e). Originally branched from 68523ccd; rebased onto 84d979f8 (#1510) — see the rebase note at the end.

What moves

ConnectionH2::finalize_write and ConnectionH2::flush_pending_control_frames were the last two core functions that read ConnectionH2::tls_wants_write, acted on the answer, and read it again. Both now answer a step and let the shell that owns the socket perform it, on the poll_read_target / handle_read protocol this module already uses for the read half.

finalize_write gains a leading tls_wants_write: bool and returns H2FinalizeTarget: Done(MuxResult) for the RFC 9113 §6.8 graceful GOAWAY and the four readiness answers of LIFECYCLE §9 invariant 16, Flush / SkipFlush for the two that need the TLS step. write_streams — already the only site that touches the socket on the stream-write path — reads the query, performs flush_tls_records for Flush and not for SkipFlush, reads it again, and hands that second answer to the new finalize_write_after_flush. The two stay two variants rather than one boolean because h2_close::finalize_action already distinguishes them, and the post-flush read stays a second call rather than a reused binding because it asks a different question: not "does rustls hold records" but "did the step between them land" — socket_write(&[])'s (size, status) is discarded, so nothing else on this path can tell.

flush_pending_control_frames answers H2ControlFlushTarget instead of Option<MuxResult>. Proceed is the former None, Done(MuxResult) the former Some, and Stalled is new: the zero-buffer resume, the WINDOW_UPDATE drain and the RST_STREAM drain used to read tls_wants_write and call ensure_tls_flushed themselves, and now return Stalled for writable to do it once for all three. That query could not become an input — it has to be read after the flush_zero_to_socket whose stall produced it, because that write is what changes the answer. ensure_tls_flushed's production call sites fall from eight to six. flush_zero_to_socket stays inside: it is a byte mover on the control-frame path, not a TLS seam, and lifting it is a different step.

The name finalize_write is kept rather than renamed to poll_finalize_target, because its FinalizeAction::Quiesce arm carries a TO SEE THIS RED recipe that names it and every doc/ and LIFECYCLE.md anchor into it is by symbol; the rename would have invalidated all of them for no behaviour.

Behaviour-preserving

cargo test -p sozu-lib reads 1115 passed; 0 failed at 84d979f8 and 1115 passed; 0 failed here. Nothing on the wire, in a route, a metric, a configuration key or a CLI flag moves — the CHANGELOG entry says so explicitly and describes what moved instead.

One ordering detail is real and unobservable rather than absent: write_streams reads tls_wants_write before finalize_write runs the graceful-GOAWAY check that used to precede the query, so on that one path the query now happens and its value is discarded. SocketHandler::socket_wants_write is free of side effects and no fixture counts it — BackpressuredTlsSocket deliberately models the record state rather than scripting an answer sequence, and counts flushes only.

The count of self.socket reaches in h2.rs above mod tests is unchanged at eleven, which is the honest measure of this step: neither function ever held one. Both reached the socket only through the three named seams of #1499, and what moved is which layer calls them.

settings_ack_deadline_is_evaluated_against_the_connection_snapshot's two probes change from .is_none() / .is_some() to matches!(…, Proceed) / matches!(…, Done(_)). The second is strictly sharper than what it replaces — it now excludes Stalled, which is_some() would have accepted.

Six TO SEE THIS RED recipes repaired, each applied as written and the failure recorded

Four named self.socket.socket_wants_write() at sites #1499 and #1507 had already replaced, so they were unfollowable before this changeset touched anything: the WINDOW_UPDATE-drain and RST_STREAM-drain stages of flush_pending_control_frames, and the h2_close::error_close_action and h2_close::goaway_close_action call sites in writable. A fifth named self.socket.socket_write(&[]) in the H2State::GoAway arm's CloseAction::Flush body, which is self.flush_tls_records(). The sixth, on a_finalized_write_pass_flushes_once_and_re_arms_while_records_survive, this changeset itself made wrong by moving the Flush arm's action to write_streams and the ReArm arm to finalize_write_after_flush.

recipe measured
WINDOW_UPDATE tail → Done(Continue) 1114 passed; 1 failed, the stalled WINDOW_UPDATE drain must re-signal the WRITABLE event
RST_STREAM tail → Done(Continue) 1114 passed; 1 failed, the stalled RST_STREAM drain must re-signal the WRITABLE event
FinalizeAction::Flush arm answers SkipFlush 1114 passed; 1 failed, left: 1, right: 2
FinalizeAction::ReArm arm emptied 1114 passed; 1 failed, the WRITABLE event must be re-signalled
error_close_action(false) 1114 passed; 1 failed (stale text said 1097)
goaway_close_action post-flush false 1113 passed; 2 failed (stale text said 1096)
deferred return Continue after the GoAway flush 1113 passed; 2 failed

The WINDOW_UPDATE recipe's contrast clause — deleting the whole if self.flush_zero_to_socket() { .. } branch reddens the expect_write premise first, left: None, right: Some(Zero) — was re-measured too and still holds verbatim.

The three log_context! recipes that name self.socket deliberately were read and left alone: they ask a reader to put back a removed form, and the form they replace is still there.

Docs and citations

doc/h2_mux_internals.md's ensure_tls_flushed, flush_pending_control_frames(), write_streams() and finalize_write() sections, h2_close.rs's module header, and LIFECYCLE.md §9's fourth-site paragraph all move in the same changeset, plus LIFECYCLE.md's "Last revision date" line.

LIFECYCLE.md's h2.rs:3336 pin drops to a bare h2.rs — the sentence holding it already names finalize_write, which is #1509's form, so no line pin is reintroduced. The 35 remaining h2.rs line citations across LIFECYCLE.md, doc/h2_mux_internals.md and doc/testing.md are renumbered.

The renumbering was re-derived from 68523ccd after rustfmt and audited twice, because the drift gate exempts a re-anchored span from comparison and so cannot tell a correct move from a wrong one:

  • every one of the 38 citations (both ends of every range) lands on the byte-identical line text it named at 84d979f8 — 0 mismatches;
  • every one lands inside the same enclosing item it named at 84d979f8 — 0 mismatches. This second pass is what covers the generic anchors in the set (Position::Server => {, match error {, if tls_pending_after {, and a // RFC 9113 §6.5 comment that appears in two different functions), which text identity alone would pass.

The map was keyed on the resolved path, not the basename: this tree holds four files named h2.rs, and only lib/src/protocol/mux/LIFECYCLE.md cites one by bare name — which the checker resolves to its own sibling. Every doc/ citation is fully qualified.

Verification

Every exit code read directly, never through a pipe. cargo build is run before fmt --check, because on a fresh worktree rustfmt cannot resolve mod command until the build script has generated command/src/proto/command.rs.

command exit
cargo build --locked --no-default-features --features crypto-ring,opentelemetry,splice,simd 0
cargo +nightly fmt --all -- --check 0
cargo clippy --all-targets --locked <same flags> -- -D warnings 0
cargo test -p sozu-lib --locked <same flags> 0 — 1115 passed; 0 failed
cargo test -p sozu --locked <same flags> 0 — 113 passed; 0 failed
cargo test -p sozu-e2e --locked <same flags> -- --skip tests::fuzz_tests:: 0 — 447 passed; 0 failed
RUSTFLAGS="--cfg tokio_unstable" cargo test -p sozu-sim --locked 0
RUSTFLAGS="--cfg tokio_unstable" cargo clippy -p sozu-sim --all-targets --locked -- -D warnings 0
python3 .github/scripts/check_doc_citations.py --root . 0
python3 .github/scripts/check_doc_citations.py --base 84d979f8e75a6c999e04f3984f97a19ad58fe3f8 0
python3 .github/scripts/check_doc_citations.py --audit --root . 0 — no h2.rs citation flagged
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --locked 0
cargo bench -p sozu-lib --bench h2_stream_table -- --test 0

pgrep sozu_e2e | wc -l read 0 immediately before the e2e run, and the 1-minute loadavg was 4.05 before and 9.97 after — the rise is that run's own cost, and it finished green in 380s with no Connection refused.

Overlap with #1511

#1511 is still based on 68523ccd; the merge base of the two branches is 68523ccd. git merge-tree --write-tree against origin/pull/1511/head (ce8c718f) reports conflicts in five files: lib/src/protocol/mux/h2.rs (one hunk, write_streams, the collision surface this step accepted), doc/h2_mux_internals.md (12), lib/src/protocol/mux/LIFECYCLE.md (14), doc/testing.md (1) and CHANGELOG.md (1). All but the h2.rs hunk are the two branches renumbering the same h2.rs anchors and both inserting at the top of ### 🔄 Changed. Whoever merges second rebases and re-derives the citation numbers from the new merge base by content — a textual rebase of the doc files composes two shift maps and produces wrong numbers that both citation gates exit 0 on.

Rebase note (87ec6035 → c5c4681e)

main moved to 84d979f8 (#1510, docs(mux-h2): say that the advertised connection-level receive window is not enforced) and this PR went CONFLICTING. Rebased; CHANGELOG.md was the sole conflicted path, because both entries insert at the top of ### 🔄 Changed. Both are kept — they are independent facts about different changes and neither supersedes the other. Mine leads, which is this file's existing newest-first order (the top of ### ✨ Added is #1508, the newest commit on main at the time). #1510's entry keeps its position relative to everything below it.

No citation needed remapping. git diff --numstat 68523ccd 84d979f8 -- lib/src/protocol/mux/h2.rs reads 1 1 — #1510 replaced one line and added none — and the line it replaced (H2ConnectionConfig::h2_initial_connection_window's doc comment, h2.rs:302) is named by no citation in the tree. The two-key audit above was nevertheless re-run in full against 84d979f8: 38 citations, 56 span ends, of which the 51 that moved are exactly the 51 the gate reports as exempt, and 0 mismatch on either key.

The full e2e and sim battery was not re-run, deliberately. The .rs patch this commit introduces is byte-identical before and after the rebase: git diff 68523ccd 87ec6035 -- '*.rs' and git diff 84d979f8 c5c4681e -- '*.rs', compared with hunk headers stripped, are the same patch (diff exit 0). The only .rs delta between the two commits is #1510's own two edits — one h2.rs doc-comment line and 53 lines of h2_flow_control.rs module doc, no code — which are green on main at 28/28. Re-run after the rebase: cargo build 0, cargo +nightly fmt --all -- --check 0, cargo clippy --all-targets -D warnings 0, cargo test -p sozu-lib 0 (1115 passed; 0 failed, so every recipe count in the table above still holds), and all three citation gates 0 against 84d979f8.

…es at their flush points

`ConnectionH2::finalize_write` and `ConnectionH2::flush_pending_control_frames`
were the last two core functions that read `ConnectionH2::tls_wants_write`,
acted on the answer, and read it again. Both now answer a step and let the
shell that owns the socket perform it, on the `poll_read_target` /
`handle_read` protocol this module already uses for the read half. Issue #1339,
Q10.

`finalize_write` gains a leading `tls_wants_write: bool` and returns
`H2FinalizeTarget`: `Done(MuxResult)` for the RFC 9113 6.8 graceful GOAWAY and
the four readiness answers of LIFECYCLE 9 invariant 16, `Flush` / `SkipFlush`
for the two that need the TLS step. `write_streams` -- already the only site
that touches the socket on the stream-write path -- reads the query, performs
`flush_tls_records` for `Flush` and not for `SkipFlush`, reads it again, and
hands that second answer to the new `finalize_write_after_flush`. The two stay
two variants rather than one boolean because `h2_close::finalize_action`
already distinguishes them, and the post-flush read stays a second call rather
than a reused binding because it asks a different question: not "does rustls
hold records" but "did the step between them land" -- `socket_write(&[])`'s
`(size, status)` is discarded, so nothing else on this path can tell.

`flush_pending_control_frames` answers `H2ControlFlushTarget` instead of
`Option<MuxResult>`. `Proceed` is the former `None`, `Done(MuxResult)` the
former `Some`, and `Stalled` is new: the zero-buffer resume, the WINDOW_UPDATE
drain and the RST_STREAM drain used to read `tls_wants_write` and call
`ensure_tls_flushed` themselves, and now return `Stalled` for `writable` to do
it once for all three. That query could not become an input -- it has to be
read after the `flush_zero_to_socket` whose stall produced it, because that
write is what changes the answer. `ensure_tls_flushed`'s production call sites
fall from eight to six. `flush_zero_to_socket` stays inside the function: it is
a byte mover on the control-frame path, not a TLS seam.

Behaviour-preserving. `cargo test -p sozu-lib` reads `1115 passed; 0 failed` at
84d979f and `1115 passed; 0 failed` here; nothing on the wire, in a route, a
metric, a configuration key or a CLI flag moves. One ordering detail is real
and unobservable rather than absent: `write_streams` reads `tls_wants_write`
before `finalize_write` runs the graceful-GOAWAY check that used to precede the
query, so on that path the query now happens and its value is discarded.
`SocketHandler::socket_wants_write` is free of side effects and no fixture
counts it -- `BackpressuredTlsSocket` models the record state rather than
scripting an answer sequence, and counts flushes only. The count of
`self.socket` reaches above `mod tests` is unchanged at eleven, which is the
honest measure of this step: neither function ever held one, both reached the
socket only through the three named seams of #1499.

Six `TO SEE THIS RED` recipes repaired, each applied as written and the failure
recorded. Four named `self.socket.socket_wants_write()` at sites #1499 and
touched anything: the WINDOW_UPDATE-drain and RST_STREAM-drain stages, and the
`error_close_action` and `goaway_close_action` call sites in `writable`. A
fifth named `self.socket.socket_write(&[])` in the GoAway arm's
`CloseAction::Flush` body, which is `self.flush_tls_records()`. The sixth, on
`a_finalized_write_pass_flushes_once_and_re_arms_while_records_survive`, this
changeset itself made wrong. Measured: the two drain recipes and both halves of
the finalize recipe give `1114 passed; 1 failed` naming only their own test,
`error_close_action(false)` gives `1114 passed; 1 failed` (the stale text said
`1097`), and the `goaway_close_action` post-flush constant and the
deferred-GOAWAY-flush recipe each give `1113 passed; 2 failed` (the stale text
said `1096`), the second failure being
`a_flush_that_does_not_drain_keeps_the_connection_open`. The three
`log_context!` recipes that name `self.socket` deliberately were read and left
alone: they ask a reader to put back a removed form, and the form they replace
is still there.

Docs move in the same changeset: `doc/h2_mux_internals.md`'s
`ensure_tls_flushed`, `flush_pending_control_frames()`, `write_streams()` and
`finalize_write()` sections, `h2_close.rs`'s module header, and LIFECYCLE.md's
fourth-site paragraph. LIFECYCLE.md's `h2.rs:3336` pin drops to a bare `h2.rs`
because the sentence holding it already names `finalize_write` -- #1509's form,
and no line pin is reintroduced. The 35 remaining `h2.rs` line citations across
LIFECYCLE.md, `doc/h2_mux_internals.md` and `doc/testing.md` are renumbered,
and each one was checked twice: it lands on the byte-identical line text, and
inside the identically-named enclosing item, that it named at 84d979f. That
second key is what covers the generic anchors in the set -- `Position::Server
=> {`, `match error {`, and a `// RFC 9113 6.5` comment that exists in two
different functions -- which text identity alone would pass. The drift gate
exempts a re-anchored span from comparison, so it cannot tell a correct move
from a wrong one; this audit is what does.

The numbering was derived against 68523cc and holds unchanged at 84d979f:
#1510 replaced exactly one `h2.rs` line and added none, so `git diff --numstat`
over that range reads `1 1`, and the line it replaced
(`H2ConnectionConfig::h2_initial_connection_window`'s doc comment) is named by
no citation in the tree.

Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS force-pushed the refactor/h2-finalize-write-split branch from 87ec603 to c5c4681 Compare September 24, 2026 19:55
@FlorentinDUBOIS
FlorentinDUBOIS merged commit 836211f into main Sep 24, 2026
28 checks passed
@FlorentinDUBOIS
FlorentinDUBOIS deleted the refactor/h2-finalize-write-split branch September 24, 2026 20:47
FlorentinDUBOIS added a commit that referenced this pull request Sep 24, 2026
`ConnectionH2::readable` and `ConnectionH2::write_streams` -- the only
production code on the H2 stream read and write paths that touches
`self.socket` -- move into a dedicated
`impl<Front: SocketHandler> ConnectionH2<Front>` block, the last one in
`h2.rs` before `#[cfg(test)] mod tests`, holding those two functions and
nothing else. Both bodies move statement for statement: `readable` is
byte-identical to its pre-image, and `write_streams` differs only by the
`unsafe { ... }` described below. An inherent impl is order-independent,
so this is behaviour-preserving -- no condition, ordering, counter or
readiness decision changed. What moves is where two `self.socket`
expressions sit, so the socket coupling still owed on this path is
countable by reading one region instead of grepping the file.

The query / flush / query triple that #1512 moved out of `finalize_write`
travels into the shell block with `write_streams`, unchanged: the
`tls_wants_write` query, the `H2FinalizeTarget` match that performs
`flush_tls_records` for `Flush` and not for `SkipFlush`, the second query
and `finalize_write_after_flush`. That step is a socket touch too and
belongs on the same side of the split as the vectored write.
`H2FinalizeTarget` and `H2ControlFlushTarget` stay `pub(super)`: they
appear only in the signatures of private functions.

`poll_read_target`, `handle_read`, `poll_write_target` and `handle_write`
become `pub`. Four types follow because `private_interfaces` makes them
follow, not by choice: `H2ReadTarget`, `H2ReadOutcome`, `H2WriteTarget`
and `H2WritePass` appear in those signatures. All four are re-exported
from `protocol::mux` beside `H2StreamId`, because a `pub` method whose
argument type cannot be named out of crate is not callable out of crate
either.

`h2_transmit` is exported asymmetrically. `mod h2_transmit` becomes `pub
mod`, `gather` becomes a `pub unsafe fn` and `confirm` a plain `pub fn`.
`gather` could not be a plain `pub fn`: it pushes `IoSlice<'static>`
borrowed out of its `&Kawa<T>` argument, so three lines of safe
out-of-crate code -- call `gather`, drop the `Kawa`, read the first
descriptor -- would be undefined behaviour with no `unsafe` written
anywhere in them, and `kawa` is a published crate, so no Sozu internal is
needed to reach it. A `'static` in a safe signature does not merely fail
to state the obligation, it denies there is one. `unsafe` in the
signature puts that obligation on the caller, and a `# Safety` section
names both halves: `kawa` must not be dropped or mutated while a
descriptor is readable, and `io_slices` must be emptied before that first
mutation.

`confirm` is deliberately NOT `unsafe`. It produces no descriptor and
only destroys them, which is well defined even when they already dangle:
`Vec::clear` drops `IoSlice` values, and an `IoSlice` is a pointer and a
length with no `Drop` that dereferences. Everything after the clear is
`Kawa::consume`, a safe `kawa` API where too large a `size` is a
truncation bug rather than undefined behaviour. So it leaves its caller
no obligation, and `unsafe` on it would be decoration that blunts what
`unsafe` means at the one call site where it means "a lifetime is being
asserted here".

There are two `unsafe` blocks on this path. The inner one is unchanged:
`gather`'s `slice::from_raw_parts`, opening and closing inside that
function. The outer one is the `unsafe { ... }` the `pub unsafe fn`
forces into `write_streams`, and it wraps the `gather` call and nothing
else -- not the vectored write, not the `confirm`. It is the only
`unsafe` keyword in `h2.rs` production code. The window they guard is the
same one and did not widen: it opens at that `gather` call, closes at the
`confirm` three statements later where `io_slices.clear()` runs before
the consume that may relocate `kawa.storage`, and the only thing entered
in between is the `socket_write_vectored` that reborrows the descriptors
and cannot retain them. No `IoSlice<'static>` survives one loop
iteration. The bracket still does not span the poll/handle seam, which
matters more now that the seam is `pub`; `write_streams` stays private
for that reason.

Out-of-crate driving is still not possible and nothing here claims it is:
the buffers both protocols name are reached through the private
`read_space` / `write_buffer` over the private `ConnectionH2::zero`, and
`H2WritePass` has no reachable constructor. `sim/tests/h2_simulation.rs`
keeps driving `readable` / `writable` over its own in-memory
`SocketHandler` and names those two gaps.

Two doc comments claiming `poll_write_target` is `pub(super)` -- in
`h2_write_pass.rs`'s `H2WritePhase::Ended` and in the matching arm of
`poll_write_target` itself -- are corrected, since it no longer is.

Intra-doc links in newly-public documentation are demoted to plain
backticks, because `private_intra_doc_links` under
`RUSTDOCFLAGS="-D warnings"` rejects a link from public documentation to
a private item. Every one still names its symbol. Sixty-two line
citations in `doc/h2_mux_internals.md`, `doc/testing.md` and
`LIFECYCLE.md` are re-anchored onto the text they already named. All 88
re-anchored line ends were checked to name byte-identical text inside an
identically-named enclosing `fn` at `836211f4`.

Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Sep 24, 2026
`ConnectionH2::readable` and `ConnectionH2::write_streams` -- the only
production code on the H2 stream read and write paths that touches
`self.socket` -- move into a dedicated
`impl<Front: SocketHandler> ConnectionH2<Front>` block, the last one in
`h2.rs` before `#[cfg(test)] mod tests`, holding those two functions and
nothing else. Both bodies move statement for statement: `readable` is
byte-identical to its pre-image, and `write_streams` differs only by the
`unsafe { ... }` described below. An inherent impl is order-independent,
so this is behaviour-preserving -- no condition, ordering, counter or
readiness decision changed. What moves is where two `self.socket`
expressions sit, so the socket coupling still owed on this path is
countable by reading one region instead of grepping the file.

The query / flush / query triple that #1512 moved out of `finalize_write`
travels into the shell block with `write_streams`, unchanged: the
`tls_wants_write` query, the `H2FinalizeTarget` match that performs
`flush_tls_records` for `Flush` and not for `SkipFlush`, the second query
and `finalize_write_after_flush`. That step is a socket touch too and
belongs on the same side of the split as the vectored write.
`H2FinalizeTarget` and `H2ControlFlushTarget` stay `pub(super)`: they
appear only in the signatures of private functions.

`poll_read_target`, `handle_read`, `poll_write_target` and `handle_write`
become `pub`. Four types follow because `private_interfaces` makes them
follow, not by choice: `H2ReadTarget`, `H2ReadOutcome`, `H2WriteTarget`
and `H2WritePass` appear in those signatures. All four are re-exported
from `protocol::mux` beside `H2StreamId`, because a `pub` method whose
argument type cannot be named out of crate is not callable out of crate
either.

`h2_transmit` is exported asymmetrically. `mod h2_transmit` becomes `pub
mod`, `gather` becomes a `pub unsafe fn` and `confirm` a plain `pub fn`.
`gather` could not be a plain `pub fn`: it pushes `IoSlice<'static>`
borrowed out of its `&Kawa<T>` argument, so three lines of safe
out-of-crate code -- call `gather`, drop the `Kawa`, read the first
descriptor -- would be undefined behaviour with no `unsafe` written
anywhere in them, and `kawa` is a published crate, so no Sozu internal is
needed to reach it. A `'static` in a safe signature does not merely fail
to state the obligation, it denies there is one. `unsafe` in the
signature puts that obligation on the caller, and a `# Safety` section
names both halves: `kawa` must not be dropped or mutated while a
descriptor is readable, and `io_slices` must be emptied before that first
mutation.

`confirm` is deliberately NOT `unsafe`. It produces no descriptor and
only destroys them, which is well defined even when they already dangle:
`Vec::clear` drops `IoSlice` values, and an `IoSlice` is a pointer and a
length with no `Drop` that dereferences. Everything after the clear is
`Kawa::consume`, a safe `kawa` API where too large a `size` is a
truncation bug rather than undefined behaviour. So it leaves its caller
no obligation, and `unsafe` on it would be decoration that blunts what
`unsafe` means at the one call site where it means "a lifetime is being
asserted here".

There are two `unsafe` blocks on this path. The inner one is unchanged:
`gather`'s `slice::from_raw_parts`, opening and closing inside that
function. The outer one is the `unsafe { ... }` the `pub unsafe fn`
forces into `write_streams`, and it wraps the `gather` call and nothing
else -- not the vectored write, not the `confirm`. It is the only
`unsafe` keyword in `h2.rs` production code. The window they guard is the
same one and did not widen: it opens at that `gather` call, closes at the
`confirm` three statements later where `io_slices.clear()` runs before
the consume that may relocate `kawa.storage`, and the only thing entered
in between is the `socket_write_vectored` that reborrows the descriptors
and cannot retain them. No `IoSlice<'static>` survives one loop
iteration. The bracket still does not span the poll/handle seam, which
matters more now that the seam is `pub`; `write_streams` stays private
for that reason.

Out-of-crate driving is still not possible and nothing here claims it is:
the buffers both protocols name are reached through the private
`read_space` / `write_buffer` over the private `ConnectionH2::zero`, and
`H2WritePass` has no reachable constructor. `sim/tests/h2_simulation.rs`
keeps driving `readable` / `writable` over its own in-memory
`SocketHandler` and names those two gaps.

Two doc comments claiming `poll_write_target` is `pub(super)` -- in
`h2_write_pass.rs`'s `H2WritePhase::Ended` and in the matching arm of
`poll_write_target` itself -- are corrected, since it no longer is.

Intra-doc links in newly-public documentation are demoted to plain
backticks, because `private_intra_doc_links` under
`RUSTDOCFLAGS="-D warnings"` rejects a link from public documentation to
a private item. Every one still names its symbol. Sixty-one line
citations in `doc/h2_mux_internals.md`, `doc/testing.md` and
`LIFECYCLE.md` are re-anchored onto the text they already named: 30 into
`h2.rs`, which this lift shifts by 159 lines, and 31 into `mod.rs`,
which the two-line re-export shifts by two. #1513's own `h2.rs` change
moves none of them -- its insertion sits inside `mod tests`, and the
highest `h2.rs` line cited anywhere in the guarded prose is 6857 while
`mod tests` begins at 7013. All 87 re-anchored line ends were checked to
name byte-identical text inside an identically-named enclosing `fn` at
`d4f6d070`.

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

`ConnectionH2::readable` and `ConnectionH2::write_streams` -- the only
production code on the H2 stream read and write paths that touches
`self.socket` -- move into a dedicated
`impl<Front: SocketHandler> ConnectionH2<Front>` block, the last one in
`h2.rs` before `#[cfg(test)] mod tests`, holding those two functions and
nothing else. Both bodies move statement for statement: `readable` is
byte-identical to its pre-image, and `write_streams` differs only by the
`unsafe { ... }` described below. An inherent impl is order-independent,
so this is behaviour-preserving -- no condition, ordering, counter or
readiness decision changed. What moves is where two `self.socket`
expressions sit, so the socket coupling still owed on this path is
countable by reading one region instead of grepping the file.

The query / flush / query triple that #1512 moved out of `finalize_write`
travels into the shell block with `write_streams`, unchanged: the
`tls_wants_write` query, the `H2FinalizeTarget` match that performs
`flush_tls_records` for `Flush` and not for `SkipFlush`, the second query
and `finalize_write_after_flush`. That step is a socket touch too and
belongs on the same side of the split as the vectored write.
`H2FinalizeTarget` and `H2ControlFlushTarget` stay `pub(super)`: they
appear only in the signatures of private functions.

`poll_read_target`, `handle_read`, `poll_write_target` and `handle_write`
become `pub`. Four types follow because `private_interfaces` makes them
follow, not by choice: `H2ReadTarget`, `H2ReadOutcome`, `H2WriteTarget`
and `H2WritePass` appear in those signatures. All four are re-exported
from `protocol::mux` beside `H2StreamId`, because a `pub` method whose
argument type cannot be named out of crate is not callable out of crate
either.

`h2_transmit` is exported asymmetrically. `mod h2_transmit` becomes `pub
mod`, `gather` becomes a `pub unsafe fn` and `confirm` a plain `pub fn`.
`gather` could not be a plain `pub fn`: it pushes `IoSlice<'static>`
borrowed out of its `&Kawa<T>` argument, so three lines of safe
out-of-crate code -- call `gather`, drop the `Kawa`, read the first
descriptor -- would be undefined behaviour with no `unsafe` written
anywhere in them, and `kawa` is a published crate, so no Sozu internal is
needed to reach it. A `'static` in a safe signature does not merely fail
to state the obligation, it denies there is one. `unsafe` in the
signature puts that obligation on the caller, and a `# Safety` section
names both halves: `kawa` must not be dropped or mutated while a
descriptor is readable, and `io_slices` must be emptied before that first
mutation.

`confirm` is deliberately NOT `unsafe`. It produces no descriptor and
only destroys them, which is well defined even when they already dangle:
`Vec::clear` drops `IoSlice` values, and an `IoSlice` is a pointer and a
length with no `Drop` that dereferences. Everything after the clear is
`Kawa::consume`, a safe `kawa` API where too large a `size` is a
truncation bug rather than undefined behaviour. So it leaves its caller
no obligation, and `unsafe` on it would be decoration that blunts what
`unsafe` means at the one call site where it means "a lifetime is being
asserted here".

There are two `unsafe` blocks on this path. The inner one is unchanged:
`gather`'s `slice::from_raw_parts`, opening and closing inside that
function. The outer one is the `unsafe { ... }` the `pub unsafe fn`
forces into `write_streams`, and it wraps the `gather` call and nothing
else -- not the vectored write, not the `confirm`. It is the only
`unsafe` keyword in `h2.rs` production code. The window they guard is the
same one and did not widen: it opens at that `gather` call, closes at the
`confirm` three statements later where `io_slices.clear()` runs before
the consume that may relocate `kawa.storage`, and the only thing entered
in between is the `socket_write_vectored` that reborrows the descriptors
and cannot retain them. No `IoSlice<'static>` survives one loop
iteration. The bracket still does not span the poll/handle seam, which
matters more now that the seam is `pub`; `write_streams` stays private
for that reason.

Out-of-crate driving is still not possible and nothing here claims it is:
the buffers both protocols name are reached through the private
`read_space` / `write_buffer` over the private `ConnectionH2::zero`, and
`H2WritePass` has no reachable constructor. `sim/tests/h2_simulation.rs`
keeps driving `readable` / `writable` over its own in-memory
`SocketHandler` and names those two gaps.

Two doc comments claiming `poll_write_target` is `pub(super)` -- in
`h2_write_pass.rs`'s `H2WritePhase::Ended` and in the matching arm of
`poll_write_target` itself -- are corrected, since it no longer is.

Intra-doc links in newly-public documentation are demoted to plain
backticks, because `private_intra_doc_links` under
`RUSTDOCFLAGS="-D warnings"` rejects a link from public documentation to
a private item. Every one still names its symbol. Sixty-one line
citations in `doc/h2_mux_internals.md`, `doc/testing.md` and
`LIFECYCLE.md` are re-anchored onto the text they already named: 30 into
`h2.rs`, which this lift shifts by 159 lines, and 31 into `mod.rs`,
which the two-line re-export shifts by two. #1513's own `h2.rs` change
moves none of them -- its insertion sits inside `mod tests`, and the
highest `h2.rs` line cited anywhere in the guarded prose is 6857 while
`mod tests` begins at 7013. All 87 re-anchored line ends were checked to
name byte-identical text inside an identically-named enclosing `fn` at
`d4f6d070`.

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

`ConnectionH2::writable` held the last two query / flush / query triples inside
the H2 core: an unconditional preamble flush whose post-flush answer the
`(H2State::Error, Position::Server)` arm read, and a second, complete triple
inside the `H2State::GoAway` arm. Both now follow the protocol #1512 established
for `ConnectionH2::finalize_write` -- the core answers a step, the shell performs
it, and the core is told what the socket then said. Issue #1339, Q10.

`ConnectionH2::dispatch_writable_state(tls_wants_write: bool)` is `writable`'s
`(H2State, Position)` match, arm for arm, and it answers
`H2WritableStateTarget`: `Done(MuxResult)` for every arm that ends the pass,
`Flush` for the one flush the GOAWAY arm needs, `WriteStreams` for the four
proxying states. It takes no `Front`, no `Context` and no `Endpoint`, because no
other arm reads either. `ConnectionH2::dispatch_writable_state_after_flush` is
the GOAWAY arm's `TlsFlushPhase::AfterFlush` block with its
`CloseAction::Disconnect => {}` fall-through spelled as the `force_disconnect`
it fell through to.

The two fused questions are two parameters of two functions. The GOAWAY arm's
nested `if` asked "does rustls hold buffered records" and "did the kernel accept
the flush" off two calls to the same query, and its own comment calls conflating
them the primary truncation vector under HAProxy chaining: a proxy that closes a
TLS connection with records pending sends FIN, destroys them, and the peer reads
a truncated response it cannot distinguish from an attack. `Flush` therefore
carries no `bool`. The pre-flush answer is `dispatch_writable_state`'s
parameter, the post-flush answer is `dispatch_writable_state_after_flush`'s, and
in the shell each read is its own `let` -- the third shadows the second inside
the `Flush` arm alone. `H2FinalizeTarget` is not reused: its `SkipFlush` answers
a question no close arm asks, since nothing writes to the socket between the
dispatch and its flush, and sharing it would force a named-impossible arm into
the shell's match -- `h2_close`'s own argument against widening `CloseAction`.

`writable` moves into the shell impl block, which now holds `readable`,
`writable` and `write_streams`. It performs every TLS seam call its own body
used to make inline: the preamble flush and the two queries around it, the
stalled-drain re-arm query, and the GOAWAY arm's flush and post-flush query.
Two seam reads reached on the same pass stay outside it, and are named so the
claim is exact -- the one inside `flush_zero_to_socket`, which
`flush_pending_control_frames` still performs, and the one inside
`force_disconnect`, `h2_close`'s third close site.
`tls_wants_write`'s production call sites fall from 13 to 12, six of them in
that block; `flush_tls_records` stays at 4 and `ensure_tls_flushed` at 6.
`flush_pending_control_frames` keeps `flush_zero_to_socket`: a byte mover on the
control-frame path is not a TLS seam, and lifting it is a different step.

Behaviour-preserving. `cargo test -p sozu-lib` reads `1117 passed; 0 failed` at
c5c8090 and `1117 passed; 0 failed` here; `sozu` 113, `sozu-e2e` 447 and
`sozu-sim` 30 all pass, and nothing on the wire, in a route, a metric, a
configuration key or a CLI flag moves. One ordering detail is real and
unobservable rather than absent: the Error and GOAWAY arms used to read
`tls_wants_write` once each, and the shell now reads it once before the
dispatch, so the query happens for the arms that never consulted it and its
value is discarded there. `SocketHandler::socket_wants_write` is free of side
effects and no fixture counts it -- `BackpressuredTlsSocket` models the record
state rather than scripting an answer sequence, deliberately so that no
assertion pins the query count -- and the flush count per pass is unchanged,
which is what its two `flushes.get() >= 2` assertions read.

The net was run unchanged. The seven `FrontRustls` tests of #1454 and #1498,
five of which build a real `ConnectionH2<FrontRustls>`, pass without an edit.
Four `TO SEE THIS RED` recipes were repaired to name the functions the arms now
live in, then applied as written and re-measured: deleting `ensure_tls_flushed`
from `dispatch_writable_state_after_flush` gives `1116 passed; 1 failed`
(`a_flush_that_does_not_drain_keeps_the_connection_open`); returning `Continue`
after the `flush_tls_records()` in `writable`'s `H2WritableStateTarget::Flush`
arm gives `1115 passed; 2 failed`; `error_close_action(false)` gives
`1116 passed; 1 failed`
(`a_rustls_frontend_in_error_state_re_arms_until_its_records_drain`); pinning
`goaway_close_action(AfterFlush, false, ...)`'s third argument to `false` gives
`1115 passed; 2 failed`. Each failed on the assertion message its recipe names.
Their three stale `1113`/`1114` counts were measured against a 1115-test suite
and are corrected.

Docs move in the same changeset: `doc/h2_mux_internals.md`'s three-seams table,
its `writable() entry point` section and both shell-impl-block claims,
`h2_close.rs`'s module header and the docs on `goaway_close_action` and
`error_close_action`, and LIFECYCLE.md's invariant 27. The seams table said 15
call sites for `tls_wants_write`: right at #1499, and #1512 folded two away
without correcting the line. One comment in `h2.rs` called the Error arm's
post-flush query Uncovered; that was already wrong before this changeset renamed
what it points at, since #1454's rustls Error test drives it.

The 50 `h2.rs` spans this changeset shifted were remapped by CONTENT --
`difflib.SequenceMatcher(autojunk=False)` equal-opcodes from c5c8090, never a
global offset, never keyed on a basename -- and each was then audited on two
keys: byte-identical line text, and an identically-named enclosing item. Zero
mismatches over 74 compared endpoints. `doc/h2_mux_internals.md`'s `writable`
signature block is the one span content could not map, because a 3 348-line move
is a delete plus an insert and not an equal opcode; it was re-anchored by hand
and its five quoted lines verified byte for byte. LIFECYCLE.md's
`H2WritePhase::Resume` outbound-byte refresh dropped its number for the symbol
instead, because the insertions moved it onto a line number another span already
carried at the base revision, which the drift rule compares against whatever the
base put there (#1447).

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

`ConnectionH2::writable` held the last two query / flush / query triples inside
the H2 core: an unconditional preamble flush whose post-flush answer the
`(H2State::Error, Position::Server)` arm read, and a second, complete triple
inside the `H2State::GoAway` arm. Both now follow the protocol #1512 established
for `ConnectionH2::finalize_write` -- the core answers a step, the shell performs
it, and the core is told what the socket then said. Issue #1339, Q10.

`ConnectionH2::dispatch_writable_state(tls_wants_write: bool)` is `writable`'s
`(H2State, Position)` match, arm for arm, and it answers
`H2WritableStateTarget`: `Done(MuxResult)` for every arm that ends the pass,
`Flush` for the one flush the GOAWAY arm needs, `WriteStreams` for the four
proxying states. It takes no `Front`, no `Context` and no `Endpoint`, because no
other arm reads either. `ConnectionH2::dispatch_writable_state_after_flush` is
the GOAWAY arm's `TlsFlushPhase::AfterFlush` block with its
`CloseAction::Disconnect => {}` fall-through spelled as the `force_disconnect`
it fell through to.

The two fused questions are two parameters of two functions. The GOAWAY arm's
nested `if` asked "does rustls hold buffered records" and "did the kernel accept
the flush" off two calls to the same query, and its own comment calls conflating
them the primary truncation vector under HAProxy chaining: a proxy that closes a
TLS connection with records pending sends FIN, destroys them, and the peer reads
a truncated response it cannot distinguish from an attack. `Flush` therefore
carries no `bool`. The pre-flush answer is `dispatch_writable_state`'s
parameter, the post-flush answer is `dispatch_writable_state_after_flush`'s, and
in the shell each read is its own `let` -- the third shadows the second inside
the `Flush` arm alone. `H2FinalizeTarget` is not reused: its `SkipFlush` answers
a question no close arm asks, since nothing writes to the socket between the
dispatch and its flush, and sharing it would force a named-impossible arm into
the shell's match -- `h2_close`'s own argument against widening `CloseAction`.

`writable` moves into the shell impl block, which now holds `readable`,
`writable` and `write_streams`. It performs every TLS seam call its own body
used to make inline: the preamble flush and the two queries around it, the
stalled-drain re-arm query, and the GOAWAY arm's flush and post-flush query.
Two seam reads reached on the same pass stay outside it, and are named so the
claim is exact -- the one inside `flush_zero_to_socket`, which
`flush_pending_control_frames` still performs, and the one inside
`force_disconnect`, `h2_close`'s third close site.
`tls_wants_write`'s production call sites fall from 13 to 12, six of them in
that block; `flush_tls_records` stays at 4 and `ensure_tls_flushed` at 6.
`flush_pending_control_frames` keeps `flush_zero_to_socket`: a byte mover on the
control-frame path is not a TLS seam, and lifting it is a different step.

Behaviour-preserving. `cargo test -p sozu-lib` reads `1117 passed; 0 failed` at
c5c8090 and `1117 passed; 0 failed` here; `sozu` 113, `sozu-e2e` 447 and
`sozu-sim` 30 all pass, and nothing on the wire, in a route, a metric, a
configuration key or a CLI flag moves. One ordering detail is real and
unobservable rather than absent: the Error and GOAWAY arms used to read
`tls_wants_write` once each, and the shell now reads it once before the
dispatch, so the query happens for the arms that never consulted it and its
value is discarded there. `SocketHandler::socket_wants_write` is free of side
effects and no fixture counts it -- `BackpressuredTlsSocket` models the record
state rather than scripting an answer sequence, deliberately so that no
assertion pins the query count -- and the flush count per pass is unchanged,
which is what its two `flushes.get() >= 2` assertions read.

The net was run unchanged. The seven `FrontRustls` tests of #1454 and #1498,
five of which build a real `ConnectionH2<FrontRustls>`, pass without an edit.
Four `TO SEE THIS RED` recipes were repaired to name the functions the arms now
live in, then applied as written and re-measured: deleting `ensure_tls_flushed`
from `dispatch_writable_state_after_flush` gives `1116 passed; 1 failed`
(`a_flush_that_does_not_drain_keeps_the_connection_open`); returning `Continue`
after the `flush_tls_records()` in `writable`'s `H2WritableStateTarget::Flush`
arm gives `1115 passed; 2 failed`; `error_close_action(false)` gives
`1116 passed; 1 failed`
(`a_rustls_frontend_in_error_state_re_arms_until_its_records_drain`); pinning
`goaway_close_action(AfterFlush, false, ...)`'s third argument to `false` gives
`1115 passed; 2 failed`. Each failed on the assertion message its recipe names.
Their three stale `1113`/`1114` counts were measured against a 1115-test suite
and are corrected.

Docs move in the same changeset: `doc/h2_mux_internals.md`'s three-seams table,
its `writable() entry point` section and both shell-impl-block claims,
`h2_close.rs`'s module header and the docs on `goaway_close_action` and
`error_close_action`, and LIFECYCLE.md's invariant 27. The seams table said 15
call sites for `tls_wants_write`: right at #1499, and #1512 folded two away
without correcting the line. One comment in `h2.rs` called the Error arm's
post-flush query Uncovered; that was already wrong before this changeset renamed
what it points at, since #1454's rustls Error test drives it.

The 50 `h2.rs` spans this changeset shifted were remapped by CONTENT --
`difflib.SequenceMatcher(autojunk=False)` equal-opcodes from c5c8090, never a
global offset, never keyed on a basename -- and each was then audited on two
keys: byte-identical line text, and an identically-named enclosing item. Zero
mismatches over 74 compared endpoints. `doc/h2_mux_internals.md`'s `writable`
signature block is the one span content could not map, because a 3 348-line move
is a delete plus an insert and not an equal opcode; it was re-anchored by hand
and its five quoted lines verified byte for byte. LIFECYCLE.md's
`H2WritePhase::Resume` outbound-byte refresh dropped its number for the symbol
instead, because the insertions moved it onto a line number another span already
carried at the base revision, which the drift rule compares against whatever the
base put there (#1447).

Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Sep 25, 2026
…cket shell (#1514)

`ConnectionH2::writable` held the last two query / flush / query triples inside
the H2 core: an unconditional preamble flush whose post-flush answer the
`(H2State::Error, Position::Server)` arm read, and a second, complete triple
inside the `H2State::GoAway` arm. Both now follow the protocol #1512 established
for `ConnectionH2::finalize_write` -- the core answers a step, the shell performs
it, and the core is told what the socket then said. Issue #1339, Q10.

`ConnectionH2::dispatch_writable_state(tls_wants_write: bool)` is `writable`'s
`(H2State, Position)` match, arm for arm, and it answers
`H2WritableStateTarget`: `Done(MuxResult)` for every arm that ends the pass,
`Flush` for the one flush the GOAWAY arm needs, `WriteStreams` for the four
proxying states. It takes no `Front`, no `Context` and no `Endpoint`, because no
other arm reads either. `ConnectionH2::dispatch_writable_state_after_flush` is
the GOAWAY arm's `TlsFlushPhase::AfterFlush` block with its
`CloseAction::Disconnect => {}` fall-through spelled as the `force_disconnect`
it fell through to.

The two fused questions are two parameters of two functions. The GOAWAY arm's
nested `if` asked "does rustls hold buffered records" and "did the kernel accept
the flush" off two calls to the same query, and its own comment calls conflating
them the primary truncation vector under HAProxy chaining: a proxy that closes a
TLS connection with records pending sends FIN, destroys them, and the peer reads
a truncated response it cannot distinguish from an attack. `Flush` therefore
carries no `bool`. The pre-flush answer is `dispatch_writable_state`'s
parameter, the post-flush answer is `dispatch_writable_state_after_flush`'s, and
in the shell each read is its own `let` -- the third shadows the second inside
the `Flush` arm alone. `H2FinalizeTarget` is not reused: its `SkipFlush` answers
a question no close arm asks, since nothing writes to the socket between the
dispatch and its flush, and sharing it would force a named-impossible arm into
the shell's match -- `h2_close`'s own argument against widening `CloseAction`.

`writable` moves into the shell impl block, which now holds `readable`,
`writable` and `write_streams`. It performs every TLS seam call its own body
used to make inline: the preamble flush and the two queries around it, the
stalled-drain re-arm query, and the GOAWAY arm's flush and post-flush query.
Two seam reads reached on the same pass stay outside it, and are named so the
claim is exact -- the one inside `flush_zero_to_socket`, which
`flush_pending_control_frames` still performs, and the one inside
`force_disconnect`, `h2_close`'s third close site.
`tls_wants_write`'s production call sites fall from 13 to 12, six of them in
that block; `flush_tls_records` stays at 4 and `ensure_tls_flushed` at 6.
`flush_pending_control_frames` keeps `flush_zero_to_socket`: a byte mover on the
control-frame path is not a TLS seam, and lifting it is a different step.

Behaviour-preserving. `cargo test -p sozu-lib` reads `1117 passed; 0 failed` at
c5c8090 and `1117 passed; 0 failed` here; `sozu` 113, `sozu-e2e` 447 and
`sozu-sim` 30 all pass, and nothing on the wire, in a route, a metric, a
configuration key or a CLI flag moves. One ordering detail is real and
unobservable rather than absent: the Error and GOAWAY arms used to read
`tls_wants_write` once each, and the shell now reads it once before the
dispatch, so the query happens for the arms that never consulted it and its
value is discarded there. `SocketHandler::socket_wants_write` is free of side
effects and no fixture counts it -- `BackpressuredTlsSocket` models the record
state rather than scripting an answer sequence, deliberately so that no
assertion pins the query count -- and the flush count per pass is unchanged,
which is what its two `flushes.get() >= 2` assertions read.

The net was run unchanged. The seven `FrontRustls` tests of #1454 and #1498,
five of which build a real `ConnectionH2<FrontRustls>`, pass without an edit.
Four `TO SEE THIS RED` recipes were repaired to name the functions the arms now
live in, then applied as written and re-measured: deleting `ensure_tls_flushed`
from `dispatch_writable_state_after_flush` gives `1116 passed; 1 failed`
(`a_flush_that_does_not_drain_keeps_the_connection_open`); returning `Continue`
after the `flush_tls_records()` in `writable`'s `H2WritableStateTarget::Flush`
arm gives `1115 passed; 2 failed`; `error_close_action(false)` gives
`1116 passed; 1 failed`
(`a_rustls_frontend_in_error_state_re_arms_until_its_records_drain`); pinning
`goaway_close_action(AfterFlush, false, ...)`'s third argument to `false` gives
`1115 passed; 2 failed`. Each failed on the assertion message its recipe names.
Their three stale `1113`/`1114` counts were measured against a 1115-test suite
and are corrected.

Docs move in the same changeset: `doc/h2_mux_internals.md`'s three-seams table,
its `writable() entry point` section and both shell-impl-block claims,
`h2_close.rs`'s module header and the docs on `goaway_close_action` and
`error_close_action`, and LIFECYCLE.md's invariant 27. The seams table said 15
call sites for `tls_wants_write`: right at #1499, and #1512 folded two away
without correcting the line. One comment in `h2.rs` called the Error arm's
post-flush query Uncovered; that was already wrong before this changeset renamed
what it points at, since #1454's rustls Error test drives it.

The 50 `h2.rs` spans this changeset shifted were remapped by CONTENT --
`difflib.SequenceMatcher(autojunk=False)` equal-opcodes from c5c8090, never a
global offset, never keyed on a basename -- and each was then audited on two
keys: byte-identical line text, and an identically-named enclosing item. Zero
mismatches over 74 compared endpoints. `doc/h2_mux_internals.md`'s `writable`
signature block is the one span content could not map, because a 3 348-line move
is a delete plus an insert and not an equal opcode; it was re-anchored by hand
and its five quoted lines verified byte for byte. LIFECYCLE.md's
`H2WritePhase::Resume` outbound-byte refresh dropped its number for the symbol
instead, because the insertions moved it onto a line number another span already
carried at the base revision, which the drift rule compares against whatever the
base put there (#1447).

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