Repository navigation
refactor(mux-h2): split finalize_write and flush_pending_control_frames at their flush points - #1512
Merged
Merged
Conversation
FlorentinDUBOIS
requested review from
Wonshtrum and
llenotre
as code owners
September 24, 2026 18:54
…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
force-pushed
the
refactor/h2-finalize-write-split
branch
from
September 24, 2026 19:55
87ec603 to
c5c4681
Compare
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step S4 of the H2 socket-boundary extraction (#1339, Q10), on top of #1507 (
bdda063e). Originally branched from68523ccd; rebased onto84d979f8(#1510) — see the rebase note at the end.What moves
ConnectionH2::finalize_writeandConnectionH2::flush_pending_control_frameswere the last two core functions that readConnectionH2::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 thepoll_read_target/handle_readprotocol this module already uses for the read half.finalize_writegains a leadingtls_wants_write: booland returnsH2FinalizeTarget:Done(MuxResult)for the RFC 9113 §6.8 graceful GOAWAY and the four readiness answers of LIFECYCLE §9 invariant 16,Flush/SkipFlushfor 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, performsflush_tls_recordsforFlushand not forSkipFlush, reads it again, and hands that second answer to the newfinalize_write_after_flush. The two stay two variants rather than one boolean becauseh2_close::finalize_actionalready 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_framesanswersH2ControlFlushTargetinstead ofOption<MuxResult>.Proceedis the formerNone,Done(MuxResult)the formerSome, andStalledis new: the zero-buffer resume, the WINDOW_UPDATE drain and the RST_STREAM drain used to readtls_wants_writeand callensure_tls_flushedthemselves, and now returnStalledforwritableto do it once for all three. That query could not become an input — it has to be read after theflush_zero_to_socketwhose 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_socketstays 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_writeis kept rather than renamed topoll_finalize_target, because itsFinalizeAction::Quiescearm carries aTO SEE THIS REDrecipe that names it and everydoc/andLIFECYCLE.mdanchor into it is by symbol; the rename would have invalidated all of them for no behaviour.Behaviour-preserving
cargo test -p sozu-libreads1115 passed; 0 failedat84d979f8and1115 passed; 0 failedhere. 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_streamsreadstls_wants_writebeforefinalize_writeruns 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_writeis free of side effects and no fixture counts it —BackpressuredTlsSocketdeliberately models the record state rather than scripting an answer sequence, and counts flushes only.The count of
self.socketreaches inh2.rsabovemod testsis 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()tomatches!(…, Proceed)/matches!(…, Done(_)). The second is strictly sharper than what it replaces — it now excludesStalled, whichis_some()would have accepted.Six
TO SEE THIS REDrecipes repaired, each applied as written and the failure recordedFour 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 offlush_pending_control_frames, and theh2_close::error_close_actionandh2_close::goaway_close_actioncall sites inwritable. A fifth namedself.socket.socket_write(&[])in theH2State::GoAwayarm'sCloseAction::Flushbody, which isself.flush_tls_records(). The sixth, ona_finalized_write_pass_flushes_once_and_re_arms_while_records_survive, this changeset itself made wrong by moving theFlusharm's action towrite_streamsand theReArmarm tofinalize_write_after_flush.Done(Continue)1114 passed; 1 failed,the stalled WINDOW_UPDATE drain must re-signal the WRITABLE eventDone(Continue)1114 passed; 1 failed,the stalled RST_STREAM drain must re-signal the WRITABLE eventFinalizeAction::Flusharm answersSkipFlush1114 passed; 1 failed,left: 1, right: 2FinalizeAction::ReArmarm emptied1114 passed; 1 failed,the WRITABLE event must be re-signallederror_close_action(false)1114 passed; 1 failed(stale text said1097)goaway_close_actionpost-flushfalse1113 passed; 2 failed(stale text said1096)return Continueafter the GoAway flush1113 passed; 2 failedThe WINDOW_UPDATE recipe's contrast clause — deleting the whole
if self.flush_zero_to_socket() { .. }branch reddens theexpect_writepremise first,left: None, right: Some(Zero)— was re-measured too and still holds verbatim.The three
log_context!recipes that nameself.socketdeliberately 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'sensure_tls_flushed,flush_pending_control_frames(),write_streams()andfinalize_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:3336pin drops to a bareh2.rs— the sentence holding it already namesfinalize_write, which is #1509's form, so no line pin is reintroduced. The 35 remainingh2.rsline citations across LIFECYCLE.md,doc/h2_mux_internals.mdanddoc/testing.mdare renumbered.The renumbering was re-derived from
68523ccdafterrustfmtand audited twice, because the drift gate exempts a re-anchored span from comparison and so cannot tell a correct move from a wrong one:84d979f8— 0 mismatches;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.5comment 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 onlylib/src/protocol/mux/LIFECYCLE.mdcites one by bare name — which the checker resolves to its own sibling. Everydoc/citation is fully qualified.Verification
Every exit code read directly, never through a pipe.
cargo buildis run beforefmt --check, because on a fresh worktree rustfmt cannot resolvemod commanduntil the build script has generatedcommand/src/proto/command.rs.cargo build --locked --no-default-features --features crypto-ring,opentelemetry,splice,simdcargo +nightly fmt --all -- --checkcargo clippy --all-targets --locked <same flags> -- -D warningscargo test -p sozu-lib --locked <same flags>1115 passed; 0 failedcargo test -p sozu --locked <same flags>113 passed; 0 failedcargo test -p sozu-e2e --locked <same flags> -- --skip tests::fuzz_tests::447 passed; 0 failedRUSTFLAGS="--cfg tokio_unstable" cargo test -p sozu-sim --lockedRUSTFLAGS="--cfg tokio_unstable" cargo clippy -p sozu-sim --all-targets --locked -- -D warningspython3 .github/scripts/check_doc_citations.py --root .python3 .github/scripts/check_doc_citations.py --base 84d979f8e75a6c999e04f3984f97a19ad58fe3f8python3 .github/scripts/check_doc_citations.py --audit --root .h2.rscitation flaggedRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --lockedcargo bench -p sozu-lib --bench h2_stream_table -- --testpgrep sozu_e2e | wc -lread0immediately before the e2e run, and the 1-minute loadavg was4.05before and9.97after — the rise is that run's own cost, and it finished green in 380s with noConnection refused.Overlap with #1511
#1511 is still based on
68523ccd; the merge base of the two branches is68523ccd.git merge-tree --write-treeagainstorigin/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) andCHANGELOG.md(1). All but theh2.rshunk are the two branches renumbering the sameh2.rsanchors 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)mainmoved to84d979f8(#1510,docs(mux-h2): say that the advertised connection-level receive window is not enforced) and this PR wentCONFLICTING. Rebased;CHANGELOG.mdwas 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### ✨ Addedis #1508, the newest commit onmainat 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.rsreads1 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 against84d979f8: 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
.rspatch this commit introduces is byte-identical before and after the rebase:git diff 68523ccd 87ec6035 -- '*.rs'andgit diff 84d979f8 c5c4681e -- '*.rs', compared with hunk headers stripped, are the same patch (diffexit 0). The only.rsdelta between the two commits is #1510's own two edits — oneh2.rsdoc-comment line and 53 lines ofh2_flow_control.rsmodule doc, no code — which are green onmainat 28/28. Re-run after the rebase:cargo build0,cargo +nightly fmt --all -- --check0,cargo clippy --all-targets -D warnings0,cargo test -p sozu-lib0 (1115 passed; 0 failed, so every recipe count in the table above still holds), and all three citation gates 0 against84d979f8.