Repository navigation
Project Tracker
The single place where known work on WebTransport is recorded: what is being
worked on, what has been fixed, and what is known but not yet scheduled. Update
this page whenever a change lands on main or a new defect or task is identified.
Last updated: 13 September 2026, at release 1.3.7. Records two bodies of
work: the XAIOS-side C99 port of the TLS/QUIC layer (WT-44 to WT-53, on
XAIOS main as of 471349d) and the portable C99 implementation in this
repository under C99/ (WT-54 to WT-67, Phases 0 to 2 complete on main at
53a86ec). WT-84 records the Swift runtime defect fixed on main at
d94f9f8 (issue #23).
This is the only project tracker for the repository. If a second list of tasks ever appears elsewhere, this page wins and the other one should be folded into it.
Current release: 1.3.7, published 13 September 2026 from commit 3df28f2. It is a defect-fix release for issue #23: maxConcurrentConnections was handed to NetworkListener.newConnectionLimit, which caps a listener's whole life rather than its concurrency, so a server stopped accepting permanently once it had served that many sessions in total (WT-84). Nothing in this list is a blocker for it; the open items below are future work.
- A row leaves Open work when the change is merged to
mainand the documentation is updated, and moves to Resolved. -
Numbering. Every item has a stable reference that never changes once
assigned, so a commit message, an issue, or a review comment can point at one row
and stay correct.
-
#N— a GitHub issue number, where one exists. -
WT-N— a tracker-local item with no issue yet. Work discovered while doing something else is recorded here first and filed as an issue later if it warrants one; theWT-Nreference stays valid either way. - Numbers are never reused and never renumbered. An answered question moves to Resolved like anything else rather than being deleted, so the numbering stays contiguous and the answer is still findable later.
-
- Unknown problems belong here too. Anything noted but not understood — a suspicion that could not be reproduced, a behaviour that looks wrong but has no trigger yet — gets a row and a number, marked unverified in its Notes. A suspicion recorded is cheap; a suspicion forgotten is re-discovered later at full cost.
- Severity follows the repository label scheme: P0 blocks a release or breaks core functionality or creates a security risk, P1 is required for MVP or release readiness, P2 is important but not blocking, P3 is polish or hardening.
| Ref | Severity | Area | Item | Notes |
|---|---|---|---|---|
| WT-1 | P2 | transport | The Retry Integrity Tag is never computed or verified, so a caller that treats decode as validation will accept a forged Retry packet. RFC 9001 section 5.8 requires the tag to be checked, and the packet type does not retain the original Destination Connection ID it would need as associated data. |
Needs an API decision: verifying the tag requires the original DCID, so the type or its decode signature has to carry it. Not a small change, and the shipped runtime uses Network.framework's QUIC rather than this codec. |
| WT-2 | P3 | api | Several fixed codecs and the transport-parameter validator are not on the shipped path, which uses Network.framework's QUIC rather than this package's QUIC/HTTP-3 stack. The fixes are real but exercise only where an embedder constructs those types directly. | Recorded so the coverage boundary is not mistaken later. Not a defect; a scope statement. |
| WT-3 | P2 | c99, crypto | The C99 plan's OpenSSL 3.x dependency cannot be used on the target: XAIOS vendors BearSSL for its TLS 1.2 client and has no OpenSSL. The good news is that BearSSL is compiled in full by scripts/build-bearssl.sh — every src/**/*.c, with -std=c99 -ffreestanding -fno-builtin -Os -Wall -Wextra -Werror — so all 294 sources are available, not only the objects xapt reaches. |
Verified by reading the XAIOS tree. BearSSL supplies the primitives a TLS 1.3 implementation needs: AES-GCM (br_gcm_*), ChaCha20-Poly1305, HKDF (br_hkdf_*), SHA-256/384/512, X25519 (br_ec_c25519_*, curve 29), ECDSA verify on P-256/384/521 and RSA-PSS verify. The plan should name BearSSL instead of OpenSSL. |
| WT-4 | P1 | c99, transport | The entire QUIC transport currently comes from NetworkListener<QUIC> and NetworkConnection<QUIC>. Nothing equivalent exists on the target platform, so this is new code written from the RFCs, not a port. |
Verified by measurement: 19 references across 2 files, one of which is 2,228 lines; the two files total roughly 3,340 lines of the 17,126-line source tree. This is the largest single workstream. |
| WT-5 | P1 | c99, crypto | Apple-only crypto and key handling must be replaced with C99 implementations: 9 source files import Security or CryptoKit. |
Verified by grep over Swift/Sources. Covers AES-GCM, ChaCha20-Poly1305, HKDF, SHA-256, X25519 and ECDSA/Ed25519 verification. |
| WT-6 | P0 | c99, security |
BearSSL has no TLS 1.3, and QUIC requires TLS 1.3. The vendored copy is explicitly "for the xapt TLS 1.2 client". |
Answered on the XAIOS side, on main as of 787622c. userspace/wt/ now implements the whole client handshake in C99 over BearSSL's primitives: the key schedule (RFC 8446 section 7.1) in its two phases, QUIC traffic keys, Initial secrets, the Retry integrity tag and packet protection (RFC 9001 sections 5 and 6), handshake framing and the transcript, a ClientHello builder, ServerHello, EncryptedExtensions, CertificateRequest, Certificate and CertificateVerify parsers, x25519, Finished compute and verify, the CertificateVerify signature check, the pinned-key trust policy, and the state machine that sequences them. 1214 host checks against RFC 8446, 8448, 9001, 7301 and 7748 run in XAIOS CI and under AddressSanitizer and UndefinedBehaviorSanitizer, with the vectors extracted from the RFC text and two Python oracles recomputing them. The handshake completes end to end against a server flight built by an independent Python implementation (tests/security/generate_wt_quic_flight.py), which is what makes the client's own Finished a check rather than a tautology. What is not implemented: 0-RTT and the session tickets it needs, so there is no early-data encryption level; HelloRetryRequest, which is refused by name rather than handled; and client certificates, where the client answers a CertificateRequest with an empty Certificate (RFC 8446 section 4.4.2) and never a CertificateVerify. Recording B-79 in the XAIOS tracker, which stays open for those three. Five adversarial audits and the sanitizer runs found and closed a remote stack overflow in the Retry tag, a resumption secret derived from the wrong transcript, a packet number encoder using the wrong range, a decrypt path that failed on every packet, a CertificateVerify digest buffer sized for SHA-256 while offering SHA-512, a public key that pointed into a dead decoder frame, and an ALPN extension read in a format RFC 7301 does not define. |
| WT-9 | P2 | c99, tests | The test suite that gives this port its correctness evidence cannot run on a freestanding target. The protocol stack needs a host build with libc and a test crypto backend, where the RFC vectors and the existing Swift suite act as an oracle. | Verified by the plan's own completion criteria, which require RFC vectors, malformed-input corpora and interop runs. The target having a full libc makes this easier than expected: a host build is now a build-flag difference rather than a portability project. |
| WT-10 | P2 | c99 | Size estimate for the C99 port: roughly 15,000 to 25,000 lines, in the nature of a multi-month effort. | Partly verified, partly inferred. The Swift side is measured at 17,126 lines across 49 files. The QUIC-runtime-from-scratch and crypto/X.509 portions have no Swift counterpart to size against, so the range carries real uncertainty and should not be treated as a committed estimate. |
| WT-12 | P1 | c99, security | The trust model is now largely answered. XAIOS already pins an operator-set RSA public key for xapt runtime identity verification rather than doing general path building, and BearSSL provides the X.509 parser and ECDSA/RSA-PSS verifiers regardless. |
Answered by reading XAIOS. The remaining question is narrower: does the WebTransport port adopt the same operator-pinned model, or validate chains against a configured trust set? Pinning removes general path building from scope and is consistent with how XAIOS already does TLS identity. |
| WT-13 | P2 | c99, docs | The port's real dependency surface is ISO C99 plus POSIX.1-2008, not ISO C99 alone. Sockets (SOCK_DGRAM, sendto/recvmsg), poll, clock_gettime and close are POSIX, not C99; only printf/memcpy/int64_t and friends are ISO C99. |
Verified by compiling a probe, and now realised: src/runtime/udp.c is the one POSIX translation unit (with src/core/time.c), it uses sendto, recvmsg, poll, getsockname and close, and the build sets _POSIX_C_SOURCE=200809L for the library on Unix-but-not-Apple only. "100% C99 libc" in practice means C99 plus Unix, which is exactly what the port needs. |
| WT-14 | P2 | c99, config | Feature-test-macro discipline is a real portability hazard, and it bit the probe. Defining _POSIX_C_SOURCE=200809L on this host removed INADDR_LOOPBACK, so the same source that compiles bare fails with the macro set. A different libc will have different defaults. |
Verified on the development host and answered by the policy now in the build: _POSIX_C_SOURCE=200809L is set for the library on Unix-but-not-Apple (documented in cmake/WTCompilerWarnings.cmake), and the source uses no BSD-only name -- the loopback addresses are written out as bytes rather than taken from INADDR_LOOPBACK. The rule the port follows: only names POSIX 2008 guarantees, so the macro can be set anywhere. |
| WT-15 | P2 | c99, transport | The UDP socket surface had to be specified rather than assumed: datagram receive must report truncation, and IPv6 must work. | Closed into WT-16 and WT-17, which record what XAIOS actually exposes now that its source has been read. |
| WT-36 | P2 | c99, transport | Datagram receive must report truncation. QUIC needs to know when a datagram exceeded its buffer rather than silently parsing a short one. |
Implemented at d3eaacd: wt_udp_receive uses recvmsg and reports WT_ERR_TRUNCATED from MSG_TRUNC with the length zeroed, so a caller cannot parse the prefix of a packet; the sender's address is still reported. The documented alternative is sizing the buffer at WT_UDP_MAX_DATAGRAM (65507), which cannot truncate. An earlier row part follows: Answered on the XAIOS side, and the answer is narrower than the row assumed. A datagram that does not fit SOCKET_BUFFER_SIZE (16384) is dropped whole at the frame and counted, never queued in part, and that check runs against the same bound the read is clamped to. So a caller passing a buffer of SOCKET_BUFFER_SIZE cannot be truncated, and that is the whole maximum-datagram-size policy the row concluded would be needed. A caller passing less than that can still be truncated with nothing said: the syscall request structure has no flags field, and adding one is a syscall change rather than a stack one. Recorded in network_stack.c beside the check. The port should therefore size its receive buffer at the maximum rather than at the QUIC default. |
| WT-37 | P3 | c99, config | XAIOS builds freestanding: -ffreestanding -fno-builtin -fno-pic -fno-pie, --target=aarch64-none-elf, with its own linker script and crt0.S, and picolibc is currently an empty placeholder directory built on demand by scripts/build-libc.sh. |
Verified. The port must build the same way, which means no dynamic loading, no errno-driven libc behaviour to rely on, and its own allocator strategy. This is a build-system constraint rather than a blocker, but every #include must come from the sysroot. |
| WT-38 | P3 | c99, transport | XAIOS's network stack exists in kernel (kernel/net/: ipv4.c, ipv6.c, arp.c, ndp.c, routing.c, socket_buffer.c, net_device.h, plus e1000e, virtio_net, vmxnet3 drivers) with IPv6 dual-stack addressing through xaios_ip_addr_t. |
Verified. Recording it so the C99 plan's "platform runtime" section names the real backend instead of a generic BSD socket layer. Note the target's socket surface is a capability-checked syscall API (XAIOS_CAP_NET_SOCKET per process), not raw POSIX. |
| WT-39 | P2 | c99, transport |
NETWORK_MAX_LISTENERS is 16 and one row serves both TCP and UDP, so sixteen concurrent endpoints of either kind exhausts it. WT-35 made every datagram socket register one, which is what makes this reachable without anything asking for it. |
New, found while implementing WT-35 on the XAIOS side (webtransport branch, commit 4ddd7d8). The registration path logs network: UDP listener registry full and returns void, so a socket that is refused a row is left with no reply path and no error to the caller. QUIC's own connection counts are bounded well below sixteen in the current design, so nothing here reaches it; it is recorded because the limit is now on a path that did not ask for it. |
| WT-68 | P2 | c99, config | The two C99 bodies of work now meet at an interface and do not share an implementation. The XAIOS side runs on vendored BearSSL; the portable C99/ tree links OpenSSL 3 (WT-3). C99/include/webtransport/crypto/crypto.h is deliberately the whole boundary -- one header, one file behind it -- but a BearSSL backend does not exist, and neither does the socket layer the portable tree would need on a target with no POSIX sockets. |
New, found by completing WT-55. Recorded rather than solved: the portable tree is the one the plan describes, and the XAIOS tree is already merged and tested on its own primitives, so nothing is blocked. The decision to make is whether C99/src/quic/ is ever built for XAIOS, which would mean a crypto_ bearssl.c behind this header plus a datagram layer over the capability-checked syscall API. Exit criterion: either a documented "the two trees stay separate" decision, or a BearSSL backend that passes the same RFC 9001 vectors as the OpenSSL one. |
| WT-69 | P2 | c99, transport |
WT-55 completed the key update derivation (wt_quic_packet_keys_update, checked against RFC 9001 A.5's quic ku) and the header documents that the lifecycle is not here: when to initiate an update, the key phase bit, and holding the previous keys so a reordered packet under the old phase still decrypts (RFC 9001 sections 6.1 to 6.4). |
New, found by completing WT-55, and it is a deliberate deferral rather than an oversight: the phase table's task list names the lifecycle, and the phase's completion criteria are the round trip and tamper rejection, both met. The state belongs to the Phase 4 connection runtime. Exit criterion: a key update is initiated and confirmed, a packet under the new phase decrypts, a reordered packet under the previous phase still decrypts within the RFC's limits, and an update that is refused for a missing confirmation is refused by name. |
| WT-71 | P3 | c99, tls | The resumption master secret is derived and tested against RFC 8448, and nothing consumes it: there is no NewSessionTicket handling, so the C99 tree cannot resume a session and has no 0-RTT to offer (RFC 8446 sections 4.6.1 and 7.1). |
New, found by completing the key schedule. Recorded rather than solved: nothing in draft-16 requires resumption, so this is scope rather than a gap in the protocol -- but the derivation exists without a consumer, and the tracker is where that is visible. Exit criterion: either the server issues a ticket and the client resends a PSK with a binder (which needs the res binder and c e traffic labels this schedule deliberately omits), or an explicit decision that resumption is out of scope for the C99 tree. |
| WT-73 | P1 | c99, security, docs |
wt_quic_unprotect_frames returned WT_ERR_PROTOCOL when an AEAD tag did not verify, while status.h defines WT_ERR_AUTHENTICATION for exactly that case and says it is deliberately not WT_ERR_PROTOCOL, because the packet is well formed and simply was not produced by the holder of the key. Two documented contracts disagreed, and the connection runtime is where that bites: a caller cannot choose between discarding a datagram and closing a connection when both arrive as the same error. |
Fixed on main at 261c4e2. The function returns WT_ERR_AUTHENTICATION, its header says the choice of remedy is the caller's (RFC 9001 section 5.3 discards), and wt_quic_packet_read passes it through. The five Phase 2 expectations that pinned the old value were wrong and were the reason the defect survived: a test can hold a defect in place. |
| WT-79 | P2 | c99, transport | RFC 9000 section 14.1's datagram-size rule is not implemented, in either half. A CLIENT must expand the payload of every UDP datagram carrying an Initial packet to at least 1200 bytes, and a SERVER must discard an Initial packet carried in a datagram smaller than that. The runtime does neither: its Initial packets are only as large as the frames in them (the handshake test's ClientHello datagram is 207 bytes), and a server reads an Initial packet out of any datagram that holds one. The two halves have to land together, because enforcing the server's discard without the client's padding would refuse the runtime's own handshake. |
New, found while looking for the next Phase 4 rule to enforce (ef89b92). It matters beyond tidiness: the 1200-byte floor is what makes the handshake's anti-amplification budget meaningful, since a server's response is bounded by three times what it received. Exit criterion: a client pads its Initial datagrams to at least 1200 bytes through the existing padding path (WT-72's helper is the same idea at a smaller scale), a server discards an Initial packet in a smaller datagram and counts it, the handshake test still completes with padded datagrams, and a test sends an undersized Initial to a server and requires the discard. A first attempt (ef89b92 working tree, reverted) wrote both halves and compiled, but the test binary then took more than 60 seconds where it had taken under one: THE FLOOR MAKES EVERY HAND-BUILT INITIAL PACKET IN THE EXISTING TESTS SUBJECT TO IT. test_discards sends Initial packets to a SERVER on purpose -- to have them refused for the address or the connection ID -- and the floor now refuses them first, so each following wt_udp_wait expires its full two-second timeout instead of returning immediately. The next attempt must give those packets the floor too (they are meant to test a different refusal) and re-check the loss tests, where 1200-byte Initial packets are ten to the initial congestion window. A SECOND ATTEMPT MEASURED THE TWO HALVES SEPARATELY, and the finding changed the shape of the task: with the CLIENT PADDING ALONE -- no server discard, so nothing can be refused for its size -- test_quic_connection still fails 76 of 401 checks ("processing nothing more: want 1, got 0" and "processing two datagrams in all: want 2, got 1" among them), while test_quic_handshake passes unchanged. So the entanglement is not only the server-side discard: the existing connection tests' expectations depend on the sizes the client sends, and WHERE has to be measured rather than reasoned about (run the test binary with a progress line per function, or bisect by returning the padding to one space at a time). The next attempt should instrument first, and treat "which existing expectations depend on packet size" as the real question. PARKED after a fourth attempt (829d300 working tree, reverted). The fourth attempt fixed the cause the third one exposed -- the padding was aimed at the floor by arithmetic, so the rebuilt packet came out two bytes above the path's maximum and every Initial packet a client sent was refused, which is also what made the earlier attempts look like hangs: nothing arrived, so every wait in the suite expired its full timeout. With the padding measured instead (pad, rebuild, adjust until the packet is between the floor and the ceiling), test_quic_handshake still passes its 240 checks and test_quic_connection still does not finish, so a fifth unknown remains in the connection tests. Decision: park this row. It is an anti-amplification hardening rule, not a prerequisite -- the handshake completes and interoperates without it, and no other task depends on it -- and four sessions' remaining budgets have now gone into it. The next session should spend its budget on WT-78 (the stream layer), which the phase and everything after it actually needs, and return to this row only with a session that can instrument the connection tests properly (per-test progress output, or bisecting the suite). |
| WT-80 | P1 | c99, transport | Landing the receive-side rule that a first frame CREATES a stream (RFC 9000 section 3.2) exposed a SENDER bug: stream_id_allowed allowed this endpoint to send on a stream the peer had opened UNIDIRECTIONALLY, and a unidirectional stream carries data one way -- the peer's (section 2.1). test_quic_handshake.c had been sending on stream 3, the server's own unidirectional stream, as if it were the client's. A third finding: inserting stream-count grants into the handshake test moves a later MAX_STREAMS block's expectations, because the counts have to be granted BEFORE the STREAM frame that needs them. |
Closed on main at 0d927c7 (the twenty-fourth part re-landed): stream_id_allowed returns whether a peer's stream is bidirectional, the handshake test asserts the refusal instead of sending on stream 3, and its grants moved ahead of the frame that needs them. 38/38 suites pass, 75,820 checks. Committed from a fresh clone because this working copy's git object store became unreadable (pack read timeouts, 99% disk) -- the tree was recovered into a clean checkout, rebuilt and pushed from there. |
WT-81 (P1, c99, transport) -- CLOSED on main at eece125 (the twenty-sixth part): the connection now keeps
connection-level flow control and charges every STREAM frame's data against both limits, choosing the RFC's error code
by asking each limit in turn. The diagnosis below is what made it possible; it is kept because the reason the status
cannot be trusted is worth remembering.
wt_quic_stream_on_data returns WT_ERR_PROTOCOL when the PER-STREAM limit is exceeded and when a
final size contradicts what arrived, and it returns wt_quic_flow_on_received's limit status when the
CONNECTION limit is exceeded. A caller therefore cannot map the status to a transport error code by
itself. The connection must decide: compute end = offset + length (guarding the overflow) and report
FLOW_CONTROL_ERROR when end > stream->max_stream_data or the status is a limit, and
FINAL_SIZE_ERROR otherwise.
The attempt in round 53 was written, compiled and reverted after two checks failed: the receiver
closed on a first 3-byte frame with FINAL_SIZE_ERROR (6) because the test's config.local_max_stream_data
seed never applied, leaving the stream's limit at zero -- which the module was right to refuse, and which
the wrong mapping then mislabelled. Next attempt: seed local_max_stream_data in both test config
builders (open_pair in test_quic_connection.c and connection_config in test_quic_handshake.c,
verifying each with a grep rather than assuming the edit landed), seed set_max_data on the receiver, and
use the two-part mapping above. Exit criterion: a frame beyond either limit closes with
FLOW_CONTROL_ERROR, a frame beyond a final size closes with FINAL_SIZE_ERROR, an ordinary frame is
accepted and advances the connection's received total, and the suite is 38/38.
Also outstanding from round 52: the phase-4 row in this file still does not name the twenty-fifth part (RESET_STREAM and STOP_SENDING reaching their state machines); the Implementation Status page does.
-
Part 25 (
31619f4): RESET_STREAM and STOP_SENDING reach their state machines as they arrive, with FINAL_SIZE_ERROR (RFC 9000 section 4.5) and STREAM_STATE_ERROR (section 19.5) for the states the RFC makes errors. The connection applies them before the caller's handler sees the frame: the handler observes the data, the state machine owns the lifecycle. -
Part 26 (
eece125, closesWT-81): received STREAM data is accounted against BOTH the stream's limit and the connection's, and the RFC's error code is chosen by asking each limit in turn. -
Outstanding in the tracker file itself: the phase-4 row above does not name parts 25 and 26 (this addendum does), because two anchor-based edits to that row failed and appending is what works here.
-
Part 27 (
d5ea4c0): the receive limits are raised as the data arrives -- MAX_DATA and MAX_STREAM_DATA for the next window -- which is RFC 9000 section 4.1's rule applied where arrival is consumption, because this runtime hands each frame's bytes to the caller's handler immediately. The test is end to end: the peer sends exactly what was granted, and reads the grant the connection sent by itself. -
Part 28: a sender can cancel a stream --
wt_quic_connection_reset_streamsends RESET_STREAM with the final size computed from what was sent, and refuses a stream that is not this endpoint's to send on or one already finished. With the receive side handling an arriving reset, the phase's "cancellation" item has both directions. -
Part 29 (
847cedc): a lost stream packet names what to send again -- a STREAM send carries a retransmission descriptor (the stream, the offset, the length) which the connection hands to the owner when loss detection declares its packet lost. The same shape the CRYPTO stream uses. The test also records two rules worth keeping: an ACK must be in the SAME packet number space as the packets it acknowledges, and a burst of losses reports several packets in send order. -
Part 30: STOP_SENDING, the other half of cancellation -- the receiver asks the peer to stop, once and only on a stream it receives on, with a frame that could not be sent leaving the stream unchanged.
-
Part 31: the Retry integrity tag (RFC 9001 section 5.8), with a property test. New task (WT-82, P2, c99, vectors): RFC 9001 appendix A.4's Retry packet is not extracted yet, so the tag's value is unchecked against the RFC; the extractor should derive the pseudo-packet, the tag and the ODCID from the RFC text the way the other vectors are, and the test should then assert the value.
-
Part 32: issuing connection IDs -- NEW_CONNECTION_ID with the issuer's own bound and the peer's
active_connection_id_limitless the handshake's ID (RFC 9000 section 5.1.1), and the stateless reset token taken from the caller because section 10.3 requires it to be unguessable. Still open fromWT-70: handling a RECEIVED NEW_CONNECTION_ID and RETIRE_CONNECTION_ID, and using a newly issued ID when the connection migrates. -
Part 33: the peer's connection IDs are stored (NEW_CONNECTION_ID with FRAME_ENCODING_ERROR, PROTOCOL_VIOLATION and CONNECTION_ID_LIMIT_ERROR for the cases RFC 9000 section 19.15 and 5.1.1 name). Still open from
WT-70: RETIRE_CONNECTION_ID, and actually USING an issued ID when the connection migrates. -
WT-83 (P3, c99, transport): the decoder's refusal of a NEW_CONNECTION_ID whose
retire_prior_tois above its sequence (RFC 9000 section 19.15's FRAME_ENCODING_ERROR) is NOT covered by a test, because the frame ENCODER refuses to produce such a frame -- this library refuses to encode what it would refuse to decode -- so the packet has to be written by hand, as the malformed-input corpus does for other frames. Exit criterion: a hand-built NEW_CONNECTION_ID withretire_prior_to > sequencecloses the connection with FRAME_ENCODING_ERROR, alongside the same case in the malformed corpus.Also recorded: the commit for part 33 was pushed while one suite failed, because the shell gate matched "tests passed", which prints even when tests fail; the gate now checks for zero failures.
WT-84 (P1, swift, runtime) -- CLOSED on main at d94f9f8 and released as 1.3.7
from commit 3df28f2 (issue #23): a listener stopped accepting for the rest of its life once it
had served maxConcurrentConnections sessions in total.
The runtime passed the policy's ceiling to NetworkListener.newConnectionLimit. Measured
on macOS 26.6.2 with a minimal listener, that limit is a budget for the listener's whole
life and not a concurrency cap: a listener built with a limit of 2 hands exactly two
connections to its handler and never a third, even after both have ended and been
cancelled, and an ended connection does not return its slot. The default ceiling of 16 is
low enough to reach in normal operation — a desktop app that reconnects on each launch
reaches it in a handful of runs — and the failure was silent: the process stayed healthy,
every other transport it served kept working, and only new WebTransport sessions timed
out. The issue was reported after that symptom was chased as a client-side problem; with
the ceiling raised to 4096 the same loop got 90/90, which is what identified the limit as
a lifetime budget.
The fix: the listener runs without a framework limit and the runtime counts in-flight
connections itself (InteroperableQUICConnectionBudget). A connection is admitted only
while fewer than the ceiling are being served, and its slot is returned exactly once —
when the session is closed, when the peer closes it, when a session is released without
being closed, or when an accept fails — through a one-shot lease
(InteroperableQUICConnectionLease). Connections over the ceiling are still refused before
their handshake is driven, which is unchanged in effect from before.
Recorded alongside it, because it constrains any future teardown work: a started
NetworkConnection cannot be cancelled. The Swift Network API exposes no cancel()
on NetworkConnection (it does on the legacy NWConnection), and the new API ties a
connection's life to its NetworkListener.run handler instead. This runtime takes the
connection out of that handler after start(), which is what lets a session outlive the
accept, so the framework keeps the QUIC connection until the peer closes it or it idles
out. That is why the framework slot is not something this code can give back explicitly,
and why maxConcurrentConnections is now the runtime's own accounting rather than the
framework's. WT-85 records the consequence that remains open.
WT-85 (P3, swift, runtime): a session that ends cleanly leaves its QUIC connection to
the framework instead of closing it, so both peers keep a connection until the peer closes
it or QUIC's idle timeout expires. Nothing in the runtime can cancel it (WT-84), and the
WebTransport session close it does send — CLOSE_WEBTRANSPORT_SESSION plus a FIN on the
CONNECT stream — is a session-level ending that the transport does not treat as a reason
to stop. The observable cost is bounded resource use, not incorrect behaviour, and the
listener no longer depends on those connections ending. Exit criterion: either a supported
way to end the underlying connection promptly is found and used in session teardown, or
the idle timeout the server advertises is measured and documented as the bound.
WT-86 (P2, swift, runtime) -- FIXED on main at 354480f, in the unreleased section: a peer that
ends an inbound stream before writing to it was reported as
QUICCodecError.truncated(needed: 1, available: 0).
Issue #24 asked whether a client that connects and then waits can lose its session to an empty stream read.
Measured against the real framework on macOS 26.6.2, with a plain NetworkListener<QUIC> and a raw
NetworkConnection<QUIC> client: receive(atMost:) waits for a byte, because atLeast defaults to 1, and
a stream the peer opens without writing to is not even delivered to the inbound-stream handler until its
first byte arrives. The interleaving the report feared therefore does not exist, and the consumer's "speak
first" workaround can be deleted with its note corrected.
An empty read does happen in one case -- the peer FINs a stream with nothing on it -- and the runtime
discarded the endOfStream flag that says so, so the empty buffer reached the codecs and a peer protocol
violation was reported as an internal truncation. InteroperableQUICHelpers.decideFirstChunk now
classifies a chunk as bytes, a wait, or a peer ending; an empty chunk on a stream that has not ended is
waited out; and WebTransportNetworkRuntimeError.peerClosedStreamWithoutData(streamID:) is raised on the
four reads whose protocol requires data: the extended CONNECT request stream, an inbound WebTransport
stream, the peer's HTTP/3 control stream, and the CONNECT response. Three tests cover it, 300 package tests
pass, and the strict build, strict test run and formatting lint are clean.
WT-79 (P2, c99, transport) -- CLOSED on main at 6496ad6 (the thirty-sixth part): RFC 9000
section 14.1's datagram-size rule is now implemented on both sides. A client expands every UDP datagram
carrying an Initial packet to at least 1200 bytes with PADDING frames, and a server discards an Initial
packet whose datagram is smaller before the frame walk. The item had recorded four failed attempts; what
they missed is that the long header's Length field is a varint whose width grows with the value it carries,
so a size computed from the unpadded payload lands a byte short and adding the shortfall lands a byte over,
which the caller's max_datagram_size then refused as a limit. The send path now rebuilds and measures
instead of computing: each pass adds the shortfall the previous packet reported, and trims padding when a
pass overshoots, so the datagram lands on the minimum rather than above the path's limit. Two tests cover
it, and the frame-permission test -- which hand-built a short Initial to exercise RFC 9000 section 12.4 --
now expands its packet first, because the discard rule correctly applies before the rule under test.
Part 34 (c99, transport): a short packet is padded until it can be sampled. RFC 9001 section 5.4.2 takes the header protection sample from sixteen bytes four bytes into the packet number, so a packet too short to hold one cannot be protected -- and could not be sent at all. Found while adding the RETIRE_CONNECTION_ID handling below, whose frame is two bytes: the builder returned a truncation error and the frame never left the process, which applies equally to PING and to a small acknowledgement. The shortfall is at most three bytes and is filled with PADDING frames; the header's own length cancels out of the requirement, which is why no caller has to know the rule.
Part 35 (c99, transport): RETIRE_CONNECTION_ID retires an issued connection ID. RFC 9000 section 19.16
makes two sequences a PROTOCOL_VIOLATION -- one never issued, and the one the carrying packet was
addressed to -- and the frame was previously only handed to the caller, leaving the ID counted against the
peer's limit forever. Retiring now frees the slot and the peer's active_connection_id_limit budget, a
repeat of an already-retired sequence is tolerated because the frame is retransmitted when lost, and
replacing a retired ID stays with the caller because only it can produce a fresh ID and stateless reset
token. Writing that test exposed a second defect: the first ID this endpoint announced was numbered 0,
colliding with the handshake's own connection ID from section 5.1.1. Sequences now start at 1.
CI: the C99 job is green on all three legs as of
run 34730959272 (macOS clang, Ubuntu
gcc, Ubuntu clang). Two findings from the run before it are recorded because they were not what they looked
like. gcc's -Wmaybe-uninitialized failed the Release build on the Retry integrity tag's one-byte buffer
for a zero-length plaintext: a real uninitialized read if any backend ever touched it, fixed by zeroing the
buffer rather than by silencing the warning. The Ubuntu clang "Package consumer" failure, by contrast, did
not reproduce in the next run and no functional change was made to that script in between -- so it was a
runner-side flake, and the useful outcome is that check-package.sh now prints the failing step's output
and checks for the installed config file explicitly. Before that change the failure reached the CI log as
exit code 1 and nothing else, which is the opposite of what a check whose whole job is to diagnose the
install tree should do.
WT-82 (P3, c99, crypto, tests) -- CLOSED on main at 10471a3 (the thirty-seventh part): RFC 9001
appendix A.4's Retry packet and the integrity tag printed with it are extracted by
tests/vectors/extract_rfc9001_retry.py and asserted in test_quic_protection.c. The tag existed and was
computed, but nothing checked the value against the document: the test that existed proved it was computed
consistently -- the same answer twice, a different answer for another original connection ID -- which a
wrong key or nonce satisfies just as well. For a value whose only job is to let a client tell a Retry the
server sent from one an attacker injected, "self-consistent" is not the property that matters.
The extractor refuses to write a block that does not parse as a version-1 Retry with a zero-length
Destination Connection ID, a Source Connection ID of 1..20 bytes, a non-empty token and exactly sixteen
bytes of tag, and it checks that the original destination connection ID A.4 names in prose is the one A.2's
client Initial packet carries -- read from that packet's own hex, not from the sentence, so a typo in
either place fails the extraction. check-vectors.sh now runs its --check with the other four
extractors, so a hand-edited header fails CI rather than quietly changing what a test proves.
WT-83 (P3, c99, transport, tests) -- CLOSED on main at 369c163 (the thirty-eighth part), and it
turned out to be more than a test gap. The task was to cover the decoder's refusal of a NEW_CONNECTION_ID
whose retire_prior_to is above its sequence (RFC 9000 section 19.15), which the encoder cannot produce
because this library refuses to write what it would refuse to read -- so the frame had to be written by
hand into a packet. Writing it found that the refusal never reached the peer: the decoder reported the
code, but the connection returned the error status to its caller instead of closing, so a peer that sent an
undecodable frame was left uninformed and the connection stayed open, with the failure visible only to a
caller that noticed the status. RFC 9000 section 12.4 makes such a frame a connection error, so
process_packet now closes with the code the frame's own rule named, or with FRAME_ENCODING_ERROR when the
failure came back from the cursor helpers as a truncation -- which section 12.4 defines the same way. A
status raised by the frame visitor is left alone, because those paths have already closed with the code
they chose.
Worth recording as a pattern: both of these were recorded as test tasks and both found behaviour the tests could not have been written around honestly -- one a value never checked against its document, the other a protocol error never sent. The lesson is not that test gaps are cheap; it is that a test written against the specification rather than against the implementation is a review of the implementation.
Phase 4, the QUIC connection runtime, is complete on main at f07b592, and Phase 5 (the HTTP/3
core) is next. The plan's three completion criteria are met and stated in C99/README.md: IPv4 and IPv6
loopback carries a whole TLS 1.3 handshake and protected, acknowledged packets on macOS and Linux in CI;
the loss, probe-timeout and close-path suites pass; and every suite runs again under AddressSanitizer and
UndefinedBehaviorSanitizer. The C99 CI job was green on all three legs as of
run 34730959272 for the commit that
carried parts 36 to 38.
The tail of the phase, after the runtime itself was in place, was four parts and four recorded findings, and the pattern is worth keeping: three of the four were found by writing a test that asserted what the specification requires rather than what the code does.
-
Part 36,
WT-79: RFC 9000 section 14.1's 1200-byte Initial rule, on both sides -- the client expands, the server discards. Four earlier attempts had failed on the long header's Length varint, whose width grows with the value it carries; the send path now measures from the packet it just built and trims when a pass overshoots. -
Part 37,
WT-82: RFC 9001 appendix A.4's Retry packet and its integrity tag, extracted from the document bytests/vectors/extract_rfc9001_retry.pyand asserted in the test. The tag had existed and been computed consistently; nothing had checked it against the RFC, which a wrong key satisfies just as well. -
Part 38,
WT-83: the decoder's refusal of a NEW_CONNECTION_ID whoseretire_prior_tois above its sequence, written by hand because the encoder refuses to produce it. Writing it found that the refusal never reached the peer: the connection returned the error status instead of closing, so a peer that sent an undecodable frame was left uninformed. RFC 9000 section 12.4 makes it a connection error; it now closes with the code the frame's rule names. -
Part 39: packets addressed to a connection ID this endpoint issued are accepted, which is what makes
issuing them worth anything -- before this, a peer that used one had its packets discarded as somebody
else's. Section 19.16's "cannot retire the ID the packet was addressed to" now uses the sequence the
packet actually used. Writing the test also found that
wt_quic_connection_issue_connection_idaccepted an ID of a length this endpoint could never receive, because a short header carries no connection ID length; it is refused at the call now.
Phase 5, the HTTP/3 core, has its first part on main at 565b9d6. include/webtransport/http3/frame.h
is RFC 9114's frame codec: a varint type, a varint length and that many bytes of payload, with the
registered frame types of section 11.2.1, the error codes of section 8.1, the stream types of section
6.2.1, and the section 7.2.8 predicate for the frame types HTTP/2 reserved (0x1f * N + 0x21). Six tests
cover the round trips, the truncated cases, the encode refusals and the stream type prefix; the suite count
is 39 and the check count 76,388.
Three decisions in it are the ones later parts will lean on, and they are recorded here because they are the kind that get undone by accident:
- The codec interprets nothing. What a SETTINGS identifier means, what a GOAWAY identifier permits, and whether a frame may appear on the stream it arrived on are the stream layer's rules. One place decides whether a frame is well formed, another decides whether it is allowed.
-
A frame whose declared length is not in the buffer is a frame error, not a request to wait. HTTP/3 has
no partial frame: the stream layer assembles a frame's bytes before handing them over, so a short buffer
means the peer's frame was malformed. A length that does not fit
size_tis refused rather than narrowed. - A failed decode leaves the cursor where it was, so a caller can report which frame failed rather than only that one did, and an unknown frame type decodes like any other -- a codec that refused one would refuse whatever a later revision defines.
Phase 5's second part is on main at 2b85b35: include/webtransport/http3/settings.h parses and
encodes RFC 9114 section 7.2.4's identifier and value pairs. The suite count is 40, the check count 76,448.
Three of the section's rules decided the shape, and one of them decided the data structure rather than the code:
- A reserved HTTP/2 identifier (
0x02to0x05, section 11.2.2) is H3_SETTINGS_ERROR, and so is a value above one forENABLE_CONNECT_PROTOCOL, which RFC 9220 section 3 makes a boolean. - A duplicate identifier is a MAY in the section ("MAY treat the presence of duplicate setting identifiers as a connection error of type H3_SETTINGS_ERROR") and this build takes the option: a peer that names the same setting twice is disagreeing with itself, and there is no reading of the frame that is not a guess. The same MAY is available to be reversed later, which is why it is recorded here.
- An unknown identifier MUST be ignored, and the
0x1f * N + 0x21identifiers exist solely to exercise that rule. The table therefore stores identifiers as well as values: a duplicate of a setting this build does not understand is an error, while the setting itself is ignored. Refusing the exercise identifiers would break the one rule they exist to test.
The table is fixed at sixteen entries, so more settings than that is H3_EXCESSIVE_LOAD rather than a peer-authored memory bound, and a payload ending between an identifier and its value is H3_SETTINGS_ERROR rather than a short read -- HTTP/3 has no partial frame, the same rule the frame codec follows.
Recorded because it is the kind of thing a test is supposed to catch: the first version of the encoder's
ordering loop emitted entries twice and skipped others. The round trip would have reported only "the
payload does not parse", with PROTOCOL as the cause; the test that asserts the exact wire bytes by hand
named the real fault. check-vectors.sh-style exact-bytes assertions are cheap and this is why they earn
their place.
Phase 5's third part is on main at edb67be: include/webtransport/http3/control.h is RFC 9114
section 6.2.1's state machine for the peer's control stream. The suite count is 41 and the check count
76,525.
All four of the section's rules are connection errors, and the interesting one is the set of frames it refuses after SETTINGS. DATA, HEADERS and PUSH_PROMISE describe requests and have nothing to describe on a control stream; a second SETTINGS is forbidden by section 7.2.4's "MUST NOT be sent subsequently"; and the frame types section 7.2.8 reserved for HTTP/2 are checked before those, so a reserved type is reported as reserved rather than as whatever it resembles. CANCEL_PUSH, GOAWAY, MAX_PUSH_ID and unknown extension frames are allowed -- the half an over-eager implementation breaks -- so the tests cover the allowed set as carefully as the refused one.
Two design points recorded because later parts inherit them. The machine decides permission and nothing
else: it takes a frame TYPE rather than a frame, so what a SETTINGS, GOAWAY or MAX_PUSH_ID says stays with
the part that owns that frame. And a frame arriving before the stream was opened, or after it closed, is the
caller's own ordering: it returns WT_ERR_STATE and names H3_NO_ERROR, because there is no error to send
the peer -- a distinction the first version of the test got wrong by expecting a bare zero, which is why
the check reads the code rather than the status alone.
Phase 5's fourth part is on main at 54549ae: include/webtransport/http3/goaway.h carries RFC 9114
section 7.2.6 with section 5.2's shutdown rules, and http3/role.h is new alongside it because several
HTTP/3 rules are one-directional. The suite count is 42 and the check count 76,596.
The payload is one varint, so the work is in what it means. A server's identifier is a client-initiated bidirectional stream ID -- section 7.2.6 makes any other stream type H3_ID_ERROR, and RFC 9000 section 2.1's two low bits are zero exactly for that type -- while a client's is a push ID. That asymmetry is why the state carries the sender's role rather than just the identifier.
Three rules are worth recording because they are easy to get subtly wrong:
- The identifier may not grow. A larger one later is H3_ID_ERROR, and the reason is not tidiness: a client may already have retried the requests it was told were not processed, so a server that raised the number would be contradicting a decision the client has acted on. An equal or lower identifier is fine.
-
Rejected means
>=, not>. Section 5.2: "Requests or pushes with the indicated identifier or greater are rejected". Zero is therefore the "nothing was processed" case that rejects every request, which the tests pin. - A payload that is not exactly one varint is a frame error, for the same reason the frame codec gives: reading the first field and ignoring the rest would accept a frame this implementation cannot interpret.
http3/role.h was added rather than folded into the frame header: a role is not a frame property, and the
request-stream constraints, the push frames and the WebTransport session layer all need it.
Phase 5's fifth part is on main at 25f3940: include/webtransport/http3/streams.h is RFC 9114
section 7.2's "which frame belongs on which stream" table in one place. The suite count is 43 and the check
count 76,674.
The reason it is one function rather than eight checks is that each of the section's eight frame subsections
ends with the same sentence in its own words -- a frame on a stream it has no business on is
H3_FRAME_UNEXPECTED -- and a rule stated eight times is a rule with seven places to forget it. Two of the
rules turned out to be about the receiving endpoint's role rather than the stream, which is why
wt_http3_role_t (added with GOAWAY last part) is a parameter here: section 7.2.7 makes MAX_PUSH_ID a
client's frame and section 7.2.5 makes PUSH_PROMISE a server's, so receiving your own frame is the error in
each case. A QPACK stream is refused before the table is consulted at all, because section 4.2 says those
streams carry instructions rather than frames.
Recorded because it is the second time this happened in two parts, and in the same direction: the first version of the MAX_PUSH_ID test asserted that a client may receive the frame, when section 7.2.7 says the opposite. The failing check was in the test, not the code -- which is the direction that costs nothing. It is worth noting that the two role-dependent rules are exactly the two the test got wrong, so the table would have been written correctly by reading the sections in order and incorrectly by pattern-matching from the other six.
Phase 5's sixth part is on main at 9bbe679: include/webtransport/http3/request.h is RFC 9114
section 4.1's shape for the request direction -- HEADERS, DATA*, HEADERS? -- with the section's own sentence
enforced: anything that is not the next frame in that shape, and anything after the trailing HEADERS, is
H3_FRAME_UNEXPECTED. The suite count is 44 and the check count 76,731.
Two decisions are recorded because both are cases where the obvious implementation is the wrong one.
-
The response direction is deliberately absent. A server may send zero or more informational (1xx)
responses before the final one, and whether a HEADERS frame is informational can only be known from its
decoded
:status-- which needs QPACK. A machine that guessed from frame order would report a legal pair of responses as a duplicate, so the response half lands with QPACK, where it can be right. - An end before the request's HEADERS is not a malformed sequence. Section 4.1 has the server abort its own RESPONSE stream with H3_REQUEST_INCOMPLETE, which is a STREAM error; the machine reports it as one, because a caller that closed the connection over it would be turning its own decision into the peer's fault. The distinction between the two kinds of error is the thing this part exists to keep straight.
The request direction is the half that needs no QPACK, which is why it could be done now: a client never sends 1xx, so nothing about its stream depends on a decoded field.
Phase 6, QPACK, has its first part on main at 1e30aa3: include/webtransport/http3/qpack.h
exposes RFC 9204 appendix A's 99 entries with the exact-pair and by-name lookups a field line needs, plus the
section 8 error codes. The suite count is 45 and the check count 76,759, and check-vectors.sh now verifies
six vector sets, the static table being the sixth.
The table is generated from the RFC's own ASCII table rather than typed into C. That is not ceremony: an encoder that indexes entry 17 as one field and a decoder that reads it as another produce two different header sections, and nothing in the exchange would say so -- there is no checksum on a field section and no error to observe, just two peers disagreeing quietly. The extractor refuses to write unless the indices are 0..98 with no gap or repeat and every row parses, which is why the whole table can be regenerated and compared in CI.
Two findings are recorded because both are the kind that recur:
- The extractor first found the appendix heading in the RFC's table of contents instead of the body, so it read an empty section. The Retry extractor (part 37) made exactly the same mistake, and the fix in both is to match headings as whole lines. Any future extractor should start that way.
- The test first expected
:methodat index 44, which is HPACK's numbering. QPACK orders its static table by frequency -- CONNECT, DELETE, GET, HEAD, OPTIONS, POST, PUT at 15 to 21 -- not by pseudo-header as HPACK does. The code was right and the test was wrong. A table that exists in two specifications under the same name is exactly where an assumption like that gets made, so both numbers are now asserted with the reason written beside them.
Phase 6's second part is on main at ea870b8: RFC 9204 section 4.1's two primitives -- an integer
behind an N-bit prefix and a string whose length is one behind a seven-bit prefix with the H bit above it --
are in include/webtransport/http3/qpack.h and src/http3/qpack_primitives.c. The suite count is 46 and the
check count 77,321.
Two decisions are recorded because both are places where the convenient implementation loses information that cannot be recovered later.
- The H bit is returned, not dropped. This build does not decode Huffman yet. A codec that read the bytes and ignored the flag would hand field content that is actually Huffman-coded to the layer above, which would build a header section the peer cannot parse -- and nothing in the exchange would report it. The flag travels with the bytes so the caller has to decide.
-
The encoder's flags are the bits above the prefix, and only those. A flag inside the prefix is refused
rather than masked: a caller that set one meant something else, and silently dropping it would change the
representation it asked for. The first version of this check tested the wrong bits -- it required the flags
to fit in the top
8 - prefix_bitsbits, which refuses the entirely legal0x80above a seven-bit prefix, i.e. the indexed-field-line pattern this module exists to serve. The boundary tests caught it before anything used it.
The pattern across the last three parts is worth noting for the phases ahead: each one has had exactly one
wrong-first-version, and in every case the failing check was in the test rather than the code (MAX_PUSH_ID's
direction, :method's index, and now the flag mask). Test-first boundary cases are the cheapest review this
project has.
Phase 6's third part is on main at df89604: RFC 7541 appendix B's Huffman code, which RFC 9204
section 4.1.2 adopts, is generated into src/http3/qpack_huffman_table.h and decoded by
src/http3/qpack_huffman.c. The suite count is 47, the check count 77,331, and check-vectors.sh now
verifies seven vector sets.
Two decisions of substance:
- The decode index is derived, not assumed. The appendix prints the table in symbol order, so walking the rows to build a canonical (first code, offset, count) index per length does not work; the extractor sorts by (length, code) and then checks the canonical property against every entry before writing it. The decoder walks that index, which is O(1) per bit rather than a 257-entry scan.
-
The example is a test vector, not implementation data. Appendix C.4.1's Huffman-coded
:authorityvalue is written totests/vectors/, where the other RFC vectors live; only the table itself goes into the source tree. That split is worth keeping: the table is code, the example is evidence.
Three extractor findings, each a way a table parser goes wrong, and all three found by the extractor's own validation rather than by a failing test:
- The appendix prefixes printable symbols with their ASCII form, including
'|'for symbol 124 -- the one row a pattern that excludes pipes silently loses (the first version read 256 rows, not 257). - The table is in symbol order, not canonical order, which invalidated the first index derivation.
- C.4.1 prints two hex blocks -- the encoded header block and a per-representation decoding walk -- so the extractor has to take the first and stop at the blank line, or it splices the block together with its own explanation (the first version read 28 bytes for a 12-byte string).
Phase 6's fourth part is on main at a0316f7: wt_qpack_huffman_encode writes the same generated
table the decoder reads and pads the final byte with one-bits (the EOS prefix, RFC 7541 section 5.2).
wt_qpack_huffman_encoded_size exists because the code is not a fixed width, so a caller that guessed
would either overflow its buffer or refuse a string that fits. The suite count is 48 and the check count
78,373.
The point worth recording is the one the test makes: a round trip is not evidence here. An encoder and a
decoder that share a wrong table round-trip perfectly, and this project has already had one table bug that a
self-consistent test would have missed (the static table extraction, part 45's :method index). So the
verification is the RFC's own appendix C.4.1 plaintext encoding to exactly the twelve bytes the RFC prints,
which neither side can satisfy by agreeing with the other, followed by an exhaustive pass over all 256
symbols to cover the five-bit codes, the thirty-bit ones and the bit packing across byte boundaries.
That is the general shape for the remaining QPACK work: every table, every representation and every dynamic state change needs a check that comes from outside this implementation, because QPACK's whole failure mode is two peers disagreeing quietly.
Phase 6's fifth part is on main at 5a547bd: src/http3/qpack_field.c reads and writes all seven of
RFC 9204 section 4.5's forms. The suite count is 49 and the check count 78,410.
The decision that shaped the API is that the type says which table a line needs -- static, dynamic or
post-base -- instead of the decoder assuming. Resolving a dynamic index against the static table is the
mistake that silently produces a different header section, and it is invisible in any exchange because both
sides believe they are right. So the two static forms resolve to a name through
wt_qpack_field_line_static_name, while the dynamic and post-base forms return WT_ERR_STATE until the
dynamic table part consumes them deliberately.
Two smaller decisions, both about not taking a decision that belongs to a later layer: the decoder PEEKS the first byte rather than reading it, because each form's index (and the literal form's name length) is an integer whose prefix lives in that byte and the integer primitive is what reads it; and the N bit and the H bits travel in the parsed line rather than being acted on, exactly as the string primitive reports Huffman coding rather than decoding it.
Two mistakes of mine in this part, recorded because both are cheap to repeat: a test decoded from an
uninitialised buffer (the encoder's output lived in the helper's own array, so the helper's assertion passed
while the decode read garbage), and a hand-written "truncated value" vector began with 0xc1, which is the
INDEXED prefix rather than the name-reference prefix it was meant to exercise. The first was caught by the
test's own assertions, the second by the assertion failing in the direction the vector's name did not predict.
Phase 6's sixth part is on main at 0fa51ea: src/http3/qpack_dynamic.c is RFC 9204 section 3.2's
FIFO -- entries sized as name plus value plus 32, evicted from the oldest end, absolute indices that never
change meaning. The suite count is 50 and the check count 78,478.
Three decisions worth recording:
-
An evicted index is reported, not resolved.
WT_ERR_CLOSEDfor an index below the oldest live entry, because the alternative -- answering with whatever now occupies that position -- is how a decoder produces a header section the encoder never wrote while both sides believe they agree. - The table is bounded like every other piece of peer-driven state here: 32 entries and a 4 KiB arena, with refusals rather than growth, and an entry larger than the capacity refused outright because section 3.2.1 says the encoder must not insert one.
- Eviction compacts the arena, which is what keeps a long-lived table from running out of bytes after capacity's worth of traffic.
The bug this part found is the most instructive one in Phase 6 so far, and it was found by the test that inserts three entries into a two-entry table: the eviction moved the surviving entries' BYTES down but left their recorded OFFSETS behind, so the second entry's name pointed into what had been the first entry's value. That is a wrong name read out of a well-formed table -- the quietest possible QPACK defect, and one that every round-trip test written against this code alone would have passed. It is the second finding in a row that a test written against the structure (rather than against the implementation's own output) caught, and it argues for the remaining QPACK parts -- the encoder and decoder stream instructions, and the header block codec -- being tested the same way.
Phase 6's seventh part is on main at e5663b2: src/http3/qpack_encoder_stream.c applies RFC 9204
section 4.3's four instructions to the dynamic table and writes each of them from this implementation's own
side, so the writers and the reader are checked against each other on the wire. The suite count is 51 and the
check count 78,533.
Two errors are only visible at this layer, and both are the kind that must be errors rather than adjustments:
- A capacity above the SETTINGS limit this endpoint advertised (section 4.3.1) is QPACK_ENCODER_STREAM_ERROR, not a clamp to the limit. Clamping would accept a peer's instruction while doing something else, which is the disagreement QPACK has no way to detect later.
-
An index naming an evicted entry is an error for the same reason the dynamic table reports
WT_ERR_CLOSED: resolving it to whatever now occupies that position is precisely the quiet corruption the previous part's offset bug produced.
The Huffman-coded insertion is refused explicitly (WT_ERR_STATE) rather than decoded here: the encoder
stream stores DECODED bytes, so a coded name or value needs a decoder buffer that belongs with the part that
owns the insertion path end to end. That is recorded as remaining work rather than papered over.
One C detail worth keeping: an enum member may not share a name with a macro. The error codes were
already #defined, so the first version of the error enum was macro-replaced before the compiler saw it and
the header failed to parse in every translation unit that included it -- a whole-tree build failure from one
line, caught immediately but worth remembering as a layout rule for this header.
Phase 6's eighth part is on main at 5ea48dd: src/http3/qpack_decoder_stream.c applies RFC 9204
section 4.4's section acknowledgement, stream cancellation and insert count increment, and writes them. The
suite count is 52 and the check count 78,566.
The section's two error rules are both about instructions that would otherwise be no-ops: an increment of zero says nothing (QPACK_DECODER_STREAM_ERROR), and an increment that would take the acknowledged count past the number of insertions cannot describe a decoder that processed them.
The correction this part produced matters more than the instruction parsing, and it changed a part that
was already committed. A truncated instruction was being reported as QPACK_*_STREAM_ERROR in both stream
modules. But an instruction whose bytes have not all arrived is INCOMPLETE, not malformed -- RFC 9204 section
2.2 delivers instructions on a stream, in pieces, and waiting for the rest is the correct response. Only a
malformed instruction is the peer's fault; the caller that sees the stream END with an instruction half-read
is what reports the error. Both modules now return WT_ERR_TRUNCATED with no error code for that case, and
both tests assert the distinction.
That is worth recording as a general rule for the parts left: a parser that reports "malformed" for "not yet" turns an ordinary network split into a connection error, and the stream-shaped protocols here (QPACK instructions, HTTP/3 frames, the WebTransport session layer) all deliver their units in pieces. The packet-shaped layer is the one place where "not all here" really is malformed, because a packet is a datagram.
A smaller note: the first version of the truncation test used 0x80 as its vector, which is a COMPLETE
section acknowledgement of section zero -- the seven-bit prefix holds the whole value. 0x7f is the
instruction whose prefix is full and whose continuation is missing.
Phase 6's ninth part is on main at 980cc77: src/http3/qpack_header_prefix.c is RFC 9204 section
4.5.1's Required Insert Count and Base, with both of the section's error exits and wt_qpack_max_entries to
derive the window from the capacity. The suite count is 53 and the check count 78,616.
The finding is the kind only an exact-byte check catches, and it is worth recording as a reading rule for the
rest of RFC 9204: the S bit is the MOST significant bit of the Base byte, not the bit below it. The RFC's
figures number their bits left to right from the top, so | S | Delta Base (7+) | means S = 0x80 and the
prefix = 0x7F. Reading it as 0x40 puts the sign inside the seven-bit prefix, which this module's own flag
check then rejected -- so the encoder refused every prefix whose Base was below its required count, and the
tests that failed were the ones asserting a valid prefix encodes, not the ones asserting it round-trips.
That is the third time in Phase 6 that the failure was caught by a check written against the specification rather than against the implementation's own output, and the second time the bit-level reading of a figure was the issue (the earlier one was the flag mask in the integer primitive). The rule those two share: RFC 9204's bit figures are drawn MSB-first, and anything that reads a figure's bit positions has to say so out loud in a comment, because both readings look plausible in code.
Phase 6's tenth part is on main at a1afa89: src/http3/qpack_field_section.c resolves one field line
at a time against the static table, the dynamic table and the section's prefix. The suite count is 54 and the
check count 78,668.
Four points worth recording:
-
The index arithmetic is the part that needs adversarial tests.
Base - Index - 1for a dynamic reference andBase + Indexfor a post-base one are the only two places the directions live, and a sign error resolves to a DIFFERENT but perfectly valid entry -- a wrong header field, not a parse failure, and nothing later in the exchange can detect it. The tests assert both directions with neighbouring indices at the same Base (0 and 1) rather than one index that would pass either way, plus an index AT the Base and an entry the table never held. -
Two failures are kept apart. A reference the tables cannot resolve is
QPACK_DECOMPRESSION_FAILED; a scratch buffer the caller did not make large enough is
WT_ERR_LIMITwith no error code, because it says nothing about the peer. Conflating them would make this endpoint close a connection over its own buffer size. - A resolved field must be plain bytes, and this is the layer that knows it: an inline Huffman name or value is decoded into the caller's scratch here rather than handed up coded.
-
A gap is now explicit rather than implied.
wt_qpack_string_encodewrites only plain strings, so this build cannot yet WRITE a Huffman-coded string into a field line. The test builds that line by hand from section 4.5.3's figure, because a test that used the encoder would be testing a line the encoder cannot produce. The encoder-side Huffman string is remaining work, recorded rather than hidden.
That last point is the pattern for what is left in Phase 6: the decoder side is now complete enough to read a section, and the encoder side -- Huffman strings on the way out, the section encoder, the reference tracking that decides what may be evicted -- is what the remaining parts have to build.
Phase 6's eleventh part is on main at 265d25d: wt_qpack_string_encode_coded writes a string with
the H bit set, and wt_qpack_field_line_encode_coded does the same for a line's inline name and value, which
closes the gap the previous part recorded. The suite count is 54 and the check count 78,673.
Two decisions:
- The scratch buffer is the caller's, and it is not optional. The coded length has to be known before the length byte that precedes it, so the string must be built somewhere before it is written; a field line goes into a buffer whose size the caller chose, so the buffer comes from the caller too.
-
The plain field-line encoder now REFUSES a line whose flags ask for coding (
WT_ERR_STATE) rather than writing it plainly. This corrects the compromise of the previous part: the H bits are part of the representation, so a plain string with the H bit clear is a different line, and an encoder that silently wrote one would produce bytes the decoder reads as something else -- quietly, with both sides believing they agree. That is the same class of defect as the dynamic table's stale offsets, and it is now impossible to write through this API.
The test keeps both halves deliberately: the coded line written by this build's encoder says the two sides agree on the wire format, and the hand-built line from the previous part says the reader is not merely reading its own writer's dialect. For a codec whose failures are silent, both checks are needed.
Phase 6's twelfth part is on main at 2367314: src/http3/qpack_field_section_codec.c writes a
section -- the prefix, then one line per field -- and reads one back through a small stack state, which is the
shape the HTTP/3 header codec will use. The suite count is 55 and the check count 78,700.
Two decisions, both about where a responsibility belongs:
-
A section that is early is not a section that is broken. RFC 9204 section 2.1.2 lets a decoder wait for
the encoder stream when a section's Required Insert Count is above the insertions received, so
wt_qpack_field_section_beginreturnsWT_ERR_AGAINwith no error code, and only a caller that gives up turns that into a connection error. This is the third time the distinction has had to be made -- the stream instruction parsers were corrected for it, the frame codec makes it for packets, and now the section codec does too. It is recorded as a standing rule for the HTTP/3 and WebTransport layers, which will meet the same shape of problem with header blocks and stream data. - The reference tracking is the encoder's, not the codec's. Deciding the Required Insert Count, the Base, and which entries a section referenced so they cannot be evicted depends on what this endpoint has sent and what the peer has acknowledged -- not on the bytes. The codec takes the prefix as an argument and writes what it is given, which keeps the state that cannot be recomputed out of the byte-level layer.
Phase 6's byte-level work is now complete: a section can be written and read end to end. What is left for the phase is the encoder's own bookkeeping -- the section-level reference tracking and the eviction decision it feeds -- which is the piece that turns "this build can read QPACK" into "this build can use QPACK".
Phase 6's thirteenth part is on main at 5613ba8: src/http3/qpack_encoder_state.c remembers what each
outstanding field section was written with, because RFC 9204 section 2.1.1 forbids evicting an entry an
unacknowledged section might reference. The suite count is 56 and the check count 78,763.
The arithmetic is one line -- evictable_below is the SMALLEST required insert count among the outstanding
sections -- and that is exactly why it needs a test with more than one section. An implementation that took
the largest, the first, or the last would pass a single-section test and fail this one, and what it would
break is silent: an entry a section in flight still points at gets evicted and reused, and the peer decodes a
different header field with both sides believing they agree. This is the fourth time in Phase 6 that the
failure mode has been "two peers disagreeing quietly" rather than a parse error.
Three smaller decisions are recorded in the code: a section that references nothing is not recorded at all (its prefix is zero and it cannot hold anything back); a second section on the same stream replaces the first (a stream carries one field section at a time); and an acknowledgement for a stream with no outstanding section is refused while a cancellation for one is accepted, because the first is this endpoint's own records disagreeing and the second is a peer exercising a right it has.
QPACK is now usable in both directions at the byte level and the bookkeeping level. What remains for the phase is to wire it to the HTTP/3 header codec -- which is Phase 5's remaining work -- and that is the next part.
Phase 5's seventh part is on main at 937b04f: include/webtransport/http3/headers.h validates a
decoded QPACK field section as a request or a response, which closes the loop between the two phases. The
suite count is 57 and the check count 78,815.
QPACK's job ends at the fields; what makes them an HTTP/3 message is sections 4.1 to 4.4, and every one of
those rules is about order or type rather than content -- a pseudo-header after a regular field, one twice,
one the message type does not define, a request missing :method/:scheme/:path, CONNECT missing :authority, an
uppercase name, a connection-specific field, or te with anything but trailers. The validator therefore
consumes fields one at a time and has a finish for what the section did not carry, because an absent
pseudo-header cannot be noticed until the last field has gone by.
The rule worth recording is CONNECT's exception: it is the one method whose required set changes shape, and a validator that enforced :scheme and :path unconditionally would reject every extended CONNECT -- which is precisely the request a WebTransport session begins with (draft-ietf-webtrans-http3 section 3.1). That is why this part belongs to HTTP/3's side of the line, and it is the first place the draft's requirements have reached into the HTTP/3 layer.
Two wiring omissions of mine are recorded because they are the same class and both were caught by the build rather than by review: the new test was added to the source list but not the test list (so the suite count stayed at 56 and no binary existed), and the public header was added to the sources but not the installed header list. A file that compiles but is not part of what ships or runs is invisible unless something counts -- which is what the README's suite and check counts are for.
Phase 5's eighth part is on main at f095e23: include/webtransport/http3/message.h joins the two
phases -- a QPACK field section in, a validated request or response out, with the method, scheme, path,
authority and status kept where a caller can read them. The suite count is 58 and the check count 78,848.
Two rules belong at this layer rather than in either neighbour, and both are about content where the layers
around them check structure: a :status has to be three digits from 100 to 599 (RFC 9114 section 4.3.2), and
a value that must be PRESENT must also be non-empty -- an empty :path arrives as a perfectly well-formed
field and is still a message error.
Two interface points are recorded because both were mistakes first:
-
A blocked section stays
WT_ERR_AGAINall the way up, as the QPACK layer reports it, and the caller that gives up is the one that turns it into an error. Third part in a row for that distinction. - The two error enums do not share a zero value. QPACK's success is 0 and HTTP/3's is 0x0100, so passing a QPACK error out-parameter through as an HTTP/3 one handed a caller a "no error" that was not its type's no-error. The non-zero codes needed no mapping -- RFC 9204 section 8 makes them HTTP/3 application errors -- which is exactly why the zero slipped through: the values that agreed hid the one that did not. The test that caught it asserted the code as well as the status, which is the habit worth keeping for every cross-layer call in the remaining phases.
The tests also build their sections with QPACK's own encoder and static table rather than by hand, so they exercise the whole path and cannot hide a disagreement between the layers.
Phase 7, the draft-16 session layer, has begun on main at 0fe2ede:
include/webtransport/webtransport/session_request.h decides what a decoded request is -- an ordinary request,
a plain CONNECT, an extended CONNECT for another protocol, or a WebTransport session request that this server
accepts or refuses with a status. The suite count is 59 and the check count 78,870.
The outcome is a decision rather than an error: "not mine" and "mine, but refused" are ordinary answers with status codes, and a malformed request is already the message error the HTTP/3 layer raised. A layer that turned "not mine" into an error would close connections over requests that belong to someone else.
The gap this part found is the more useful half of it. :protocol was not a recognised pseudo-header, so
RFC 9220's extended CONNECT -- the request a WebTransport session actually begins with -- was refused as an
unknown pseudo-header and therefore H3_MESSAGE_ERROR. The HTTP/3 message layer now recognises it for requests
(and refuses it on a response) and keeps its value. The HTTP/3 layer turned out to be complete for RFC 9114
and incomplete for RFC 9220, which RFC 9114 itself references; that is the kind of gap a port finds only when
the layer above starts asking for something, and it is worth expecting more of them as Phase 7 proceeds.
Two rules are tested in both directions because each is easy to get backwards:
- The CONNECT exception does not excuse a WebTransport request from carrying :scheme and :path. RFC 9114 section 4.1's exception covers the PLAIN CONNECT; a layer that inherited it would accept a session request it cannot route.
-
A server that never advertised
WT_ENABLEDrefuses with 501 rather than serving a session the client could not have known about -- which is what makes the setting mean anything.
Phase 7's second part is on main at 9fe87b1: include/webtransport/webtransport/capsule.h reads and
writes the CONNECT stream's control messages as RFC 9297 capsules, with the draft-16 registry -- the
flow-control capsules, DRAIN_WEBTRANSPORT_SESSION (no value) and CLOSE_WEBTRANSPORT_SESSION (a four-byte
error code and a reason of at most 1024 bytes). The suite count is 60 and the check count 78,904.
Both ends enforce their own side of the close capsule: the writer refuses a reason longer than the draft's 1024 bytes, so this build cannot send a close its own reader would refuse, and the parser refuses a value too short to hold the mandatory four-byte code, which is a malformed capsule rather than one with nothing to say.
Three rules are now on their fourth, fifth and sixth appearance in this tree, and they are recorded as the project's standing rules rather than as each part's local choice:
-
Incomplete is not malformed. A stream delivers in pieces;
WT_ERR_TRUNCATEDwith no error code, and the caller that sees the stream end mid-unit reports the error. Applies to QPACK instructions, header sections and now capsules. - Unknown is handed on, not refused. RFC 9297 has a receiver ignore a capsule it does not understand, and HTTP/3 grows by extension frames; a codec that refused what it does not know would refuse the future.
-
A bound is this endpoint's. A value longer than the caller will buffer is
H3_EXCESSIVE_LOAD(orWT_ERR_LIMIT), never a peer error -- the peer has not broken a rule by sending something large.
The packet layer is the deliberate exception to the first rule, because a datagram IS the unit; everywhere a stream carries the unit, "not yet" and "broken" have to stay apart.
Phase 7's third part is on main at 5c26e4e: include/webtransport/webtransport/session.h is the
draft's three rules about what a session may do, as opposed to what its bytes say. The suite count is 61 and
the check count 78,939.
The rules: after a drain in either direction no new stream may start (existing ones may finish); after a close nothing at all; and the FIRST close's code is the one the session reports, however many more arrive. The last is the one with a test of its own -- a session closed with 0x1234 that then receives 0x99 still reports 0x1234, because an implementation that let the latest close win would hand a caller an application error code that never ended anything.
Two details are recorded because each is a place where a state machine usually grows a special case:
- A stream that simply ends has no application code, which is not the same as a close whose code is zero. The flag that keeps them apart is why a caller can tell "the peer closed with an error code of 0" from "the peer went away".
- Every transition after the close is refused, and a drain or close before the response went out is a caller error rather than a transition. Inventing a state for a session that does not exist yet would let a caller half-open one, which is the kind of state a protocol layer should never be able to reach.
With the request decision, the capsules and the lifecycle, the draft-16 session layer has its skeleton. What it still needs is the per-session accounting the draft requires -- the streams and datagrams a session carries, and the flow-control capsules that bound them -- and then Phase 8's public C API can expose it.
Phase 7's fourth part is on main at d9ff982: the draft's flow-control capsules -- MAX_DATA,
MAX_STREAM_DATA, MAX_STREAMS in both directions and the blocked signals -- are in the capsule module, with the
connection-level limits allowed only to grow. The suite count is 62 and the check count 78,989.
The rule worth the part is the monotonic one: a limit below one already granted would invalidate data sent
against the old limit, so it is WT_FLOW_CONTROL_ERROR (the draft's own code) rather than a new limit. An
implementation that simply stored it would accept a peer rewriting a promise this endpoint has already relied
on, which is the flow-control equivalent of evicting a referenced QPACK entry -- and it belongs on the same
list of "silent disagreement" failures this phase keeps producing.
The bug is the more useful record. The writer emitted a constant one-byte length for every one-varint capsule, so a limit of 100000 -- a four-byte varint -- was described as one byte long and decoded as its first byte (8). Every small test value passed; the case that caught it used a limit large enough to need more than one byte. This is the second time in Phase 7 that a small-number case hid a size bug (the QPACK header prefix's constant flags were the first), and the pattern is worth stating plainly: anywhere this tree writes a length, the length must be measured, never assumed -- and the tests must include values that cross every varint boundary, not just convenient small ones.
Phase 7's fifth part is on main at 6f5a156: include/webtransport/webtransport/framing.h is the
draft's stream prefix (type 0x41 or 0x54, then the session ID) and its datagram frame (a quarter stream ID,
then the data). The suite count is 63 and the check count 79,032.
Two things are worth recording. First, the identifier is checked for shape rather than value: a session ID is the CONNECT stream's, so it is client-initiated and bidirectional, and a prefix naming anything else describes a session that cannot exist rather than one this endpoint has not heard of -- a distinction that matters because the first is the peer's error and the second is not.
Second, the two halves sit on opposite sides of the standing rule about incomplete input, deliberately: an
incomplete stream prefix is WT_ERR_TRUNCATED, because a stream delivers in pieces, while a datagram that does
not hold its quarter ID is malformed, because a datagram IS the unit. Writing that down as a table rather than
per part is what keeps the next layer from picking the wrong side.
The test-vector mistake is the third varint-boundary incident in this phase and is recorded as a rule: the stream type 0x41 is above 63, so its varint is TWO bytes and the first byte is not the type. My test compared the first byte with the value, and the hand-built prefix in the same test was a byte short for the same reason. Both QPACK's prefix flags and the flow-control capsule length were the earlier two. Tests for anything varint-shaped should be written across the 63, 16383 and 1073741823 boundaries first, because those are where this tree keeps finding things.
Phase 8, the public C API, has begun on main at 86a36ba (docs at 2110193):
include/webtransport/webtransport.h is the one header a consumer includes. The suite count is 64 and the check
count 79,046.
It is the place where the three rules that hold across every layer are written down, which is why it is worth more than an include list:
- Nothing is allocated for a peer. Every table, buffer and queue has a bound this endpoint chose, and the code for exceeding one says the bound was reached rather than blaming the peer. A caller that conflates the two will close connections over its own limits.
- Incomplete is not malformed on a stream, with a datagram as the deliberate exception because a datagram IS the unit. This is the rule that has now been restated in six parts; having it in one public place is the point of writing it here.
- A refusal keeps the peer's code. RFC 9000's transport codes, RFC 9114's H3_* codes and RFC 9204's QPACK codes all travel as QUIC application error codes; rewriting one would hide what the peer said.
The header also fixes the ownership rule every module follows -- a producer writes into a caller's buffer, a reader returns views into the caller's bytes, nothing owns memory, no view outlives its buffer -- and names the layers in wire order, so a consumer can find the one it wants.
The test is deliberately a compile-time one: it includes ONLY the umbrella header and uses a piece of every layer. A module missing from the umbrella, a header that fails to include what it uses, or a declaration that moved fails to build in this test rather than in a consumer's project -- which is the cheapest possible place for that failure to surface.
One process note, recorded because it cost a commit: the docs edit and the code commit were scripted together
and the docs half aborted on an anchor that did not exist, so 86a36ba claims the documentation in its message
while containing only code. The follow-up 2110193 has the documentation. The lesson is the one this session
has already learned twice: verify an anchor before a scripted edit writes anything, and commit docs
separately from code when a script does both.
WT-87 (P3, c99, api, tests) -- CLOSED on main at 4230e65 (the fortieth part): the public session
handle. include/webtransport/api/session.h is the first header a consumer of the C99 library builds
against, and it is worth recording which of its choices are contracts rather than code, because each is the
expensive-to-change kind.
wt_session_t is opaque, so the layout can move between releases without breaking anyone. Construction and
destruction are paired and BOTH take the allocator: an object made from a pool must return to that pool, and a
destroy that guessed would either leak or corrupt. The error surface is sanitized by construction and not by
discipline -- wt_session_error_t is a status plus a uint64_t code with no room for a string, so a peer's
text cannot reach a log even by accident, while the peer's application code does reach the caller, because the
rule that a refusal keeps the peer's code holds at this layer too.
The consumer's state enum is mapped from the internal machine with a full switch rather than a cast. The cast
would have worked today; it would also have renumbered the published contract the day the internal enum
changed, and nothing would have failed to build. With -Wswitch-enum the omission is a compile error, and the
test asserts the mapping.
Both bounds in this part belong to this endpoint, and both are refusals rather than adjustments: an authority
or path too long for the handle's copy is WT_ERR_LIMIT instead of being truncated (a truncated authority
names a DIFFERENT session), and a capsule value over max_capsule_bytes is refused with the H3 excessive-load
code, which is a statement about this endpoint's buffer rather than about the peer's encoding. The test's own
first draft got the varint spelling wrong twice: it wrote the VALUE 64 where a prefix byte belonged, and it
wrote 63 as a value where 63 was already the prefix. Lengths are measured, not transcribed, which is the same
MSB-first lesson this tracker has recorded before and the reason the malformed-input corpus rather than a
hand-written list is the real coverage.
65 suites, 79,083 checks, green in debug, release and ASan/UBSan; check-vectors.sh and check-package.sh
clean.
WT-88 (P3, c99, api, tests) -- CLOSED on main at d57c881 (the forty-first part): the callback
table and the feed functions that report through it. The design is mostly about what the seam refuses to do,
which is the part worth recording.
It owns no thread and no queue, so a callback runs inside the call the application made and a caller needs no
synchronization it did not already have. It never re-enters itself, so the sequence a recording callback sees
is the wire's sequence. It never turns "nobody subscribed to this" into a connection error: a datagram this
endpoint did not ask for is accepted and discarded, because blaming the peer for this endpoint's configuration
is the failure mode that makes such an API unusable from a program that only wants streams. The one thing it
refuses is a bound this endpoint published -- a stream table sized by max_streams, a datagram payload over
max_datagram_bytes -- and both are refused with the H3 excessive-load code, never grown for a peer.
Two structural choices came out of it. Peer streams live in a FIXED table of WT_SESSION_STREAM_MAX slots,
because a table that grows with a peer is a heap exhaustion path with the peer's name on it; and a stream or
datagram naming a DIFFERENT session is refused with HTTP/3's identifier error rather than delivered to the
wrong session or dropped silently, since a silent drop here is indistinguishable from a lost packet.
Adding session_id, max_datagram_bytes and max_streams to the configuration exposed the classic C struct
hazard immediately: the existing tests had set three fields of what was now a six-field struct, and the
uninitialized bounds were stack garbage that the new WT_ERR_LIMIT checks rejected -- nineteen failing checks
in test_api_session, which is the bound doing its job on its first day. wt_session_config_default()
returns a fully initialized value so a caller overwrites rather than completes, and bounds the handle cannot
honour are refused at create rather than clamped.
66 suites, 79,144 checks, green in debug, release and ASan/UBSan.
WT-89 (P2, c99, webtransport, tests) -- FIXED on main at 874e0d7 (the forty-second part):
wt_webtransport_flow_on_max_data and wt_webtransport_flow_on_max_streams accepted a limit EQUAL to the one
already granted, on the reading that section 5.1 only forbids a limit that shrinks. The Swift reference and
the draft require the limits to strictly increase, and the difference matters: a repeat is what a peer sends
when it has lost track of what it granted, so the lenient reading hides exactly the confusion the rule exists
to surface. Both now refuse a repeat with WT_WEBTRANSPORT_FLOW_CONTROL_ERROR. The same helper had no ceiling
on a stream-count limit; a value above the draft's 2^60 describes a stream ID space that does not exist and
is now the same error. test_webtransport_flow asserts the stricter reading, which is the second time a Phase
7 leniency has been found by porting the layer above it -- the pattern is worth expecting: a lower layer's
tolerance is only visible once something depends on it.
WT-90 (P3, c99, api, tests) -- CLOSED on main at 874e0d7: the session's send-side flow control as a
public surface. api/flow.h exposes the peer's grants, this endpoint's usage, and the allowances that answer
"may I send this" before a refusal rather than after it. The rules are the draft's and the Swift reference's:
flow control is off until SETTINGS say otherwise and a capsule arriving while it is off is IGNORED rather than
refused, because the draft conditions the whole mechanism on SETTINGS; the initial limits come from the peer's
SETTINGS, so a setting the peer omitted is a ZERO limit and not an unlimited one, which is what the absence
means on the wire; and the three initial-limit setting identifiers (0x2b61, 0x2b64, 0x2b65) now sit beside
WT_ENABLED in the session-request header. The umbrella header also gained the api/ headers, and
test_public_api creates a session through the umbrella alone, so a declaration that moves out of it fails in
that test rather than in a consumer's project.
67 suites, 79,222 checks, green in debug, release and ASan/UBSan.
WT-91 (P4, c99, build, tests) -- FIXED on main at 38b8f36 (the forty-third part): an add_test
called from the apps directory while enable_testing() had not yet run in the tree is silently DROPPED. CTest
then reported a clean run of one fewer test -- 100% tests passed out of 67 for a tree that had registered
68 -- which is the failure mode that looks exactly like success. The tree now enables testing before its
subdirectories. The same change guarded the registration on the project's own switch
(WEBTRANSPORT_C99_BUILD_TESTS) instead of CTest's BUILD_TESTING, which this project never defines: a guard
on a variable nothing sets is indistinguishable from a guard that works. Recorded because it is the second time
this session has been caught by a count that quietly disagreed with the wiring, and counting is what caught it
both times.
WT-92 (P3, c99, api, docs, tests) -- CLOSED on main at 38b8f36: the plan's Phase 8 completion
criteria, first half. apps/wt-api-sample/main.c includes ONLY webtransport/webtransport.h, uses only the
public functions, and walks a whole session -- establishment, a peer stream, a peer datagram, a flow-control
capsule that raises the data limit, backpressure asked for and then refused one byte past the grant, drain,
close, destroy -- and is registered with CTest, so "the public sample app compiles on all target platforms" is
checked rather than compiled. docs/PUBLIC-API.md is the contract it exercises, and it names what is not
there yet (a trust surface, the blocking helpers, the send side) as plainly as what is, because a documented
absence is a decision and an undocumented one is a bug report.
Second half still open: the trust surface and the endpoint/connection configuration, then the blocking helpers that go with the CLI tools.
68 CTest tests (67 unit suites, 79,222 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-93 (P3, c99, api, docs, tests) -- CLOSED on main at 9304a5b (the forty-fourth part): the
endpoint and trust surface, which was the last of the plan's Phase 8 documentation requirements. A program now
says which side it is (WT_ENDPOINT_ROLE_CLIENT or SERVER), the name it is reached at, the port, the
authority and path its CONNECT request carries, and how the peer's chain is judged; check refuses a
misconfiguration before a packet is sent, and wt_endpoint_session_config produces the session configuration
from it, so the authority a request carries comes from one place instead of from whichever string was nearest.
Two decisions are worth keeping. The development bypass is tied to a loopback name, and the check in the new
API layer calls the TRUST LAYER's function -- now exported as wt_tls_trust_host_is_loopback and used by the
handshake as well -- rather than reimplementing the rule. A security rule with two implementations is a rule
that will eventually disagree with itself, and the disagreement would be found by an attacker rather than by a
test. And a SERVER must leave the trust policy unset: draft-16 has no client authentication, so a server has no
peer certificate to judge, and accepting a policy would be a promise the library cannot keep. Ignoring the
field instead would be worse than refusing it, because a caller would come to believe their clients are
authenticated.
Small compiler lesson of the part: a case label for a value outside an enum does not compile under -Wswitch,
which is the compiler stating what the code was trying to say -- an unknown mode falls through to "not a
policy" rather than being named.
With this, the Phase 8 documentation requirement is met: trust, endpoints, sessions, streams, datagrams,
backpressure, close, drain and ownership are all covered in C99/docs/PUBLIC-API.md. What remains in the phase
is the optional blocking helpers, which belong with the CLI tools.
69 CTest tests (68 unit suites, 79,263 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-94 (P3, c99, http3, tests) -- CLOSED on main at c93f2c2 (the forty-fifth part): the
per-connection HTTP/3 state that Phase 5 deliberately left unowned. Phase 5 wrote one state machine per
concern (control stream, frame rules, QPACK, request order); something has to hold them for a connection, and
http3/endpoint.h is that something. It marks our control stream (0x00) and QPACK streams (0x02/0x03) as
sent once each, classifies the peer's unidirectional streams by type prefix, forwards control frames to the
control machine, and applies the RFC's rules.
Those rules are asymmetric, and the asymmetry is the design. An UNKNOWN stream type is NOT an error: section
6.2.1 leaves unknown types for future revisions, so the endpoint reports it and the caller stops reading.
A SECOND control stream, a SECOND QPACK stream (QPACK section 4.2) and a PUSH stream this build never asked
for each commit the connection to the error the RFC names -- and push is refused deterministically rather than
ignored, because ignoring it leaves the peer believing a response is on its way. A client and a server are
told different codes for it (H3_ID_ERROR versus H3_STREAM_CREATION_ERROR), which is what the RFC says and
what a test asserts.
The reason this layer exists rather than a plain call to wt_http3_stream_kind_for_type is the draft's
WebTransport stream type (0x54). To the HTTP/3 core it IS an unknown type, and the core would correctly tell
the caller to ignore the stream -- so a session's streams would disappear one at a time, silently, with every
layer behaving exactly as specified. The endpoint claims 0x54 for the session layer instead.
The peer-stream table is fixed at WT_HTTP3_ENDPOINT_STREAMS_MAX, and running into it reports WT_ERR_LIMIT
with NO error code: it is this endpoint's table, and manufacturing a peer-facing code for it would blame the
peer for this implementation's bound. The test fills the table to prove exactly that.
70 CTest tests (69 unit suites, 79,350 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-95 (P3, c99, http3, tests) -- CLOSED on main at d8cbeda (the forty-sixth part): a WebTransport
session IS a request stream, so the endpoint now owns them -- one wt_http3_request_stream_t per live request,
every frame forwarded to the ordering machine, and that machine's rules kept in ONE place instead of
re-implemented as HEADERS-first and H3_REQUEST_INCOMPLETE at this layer.
The role rules are the RFC's and asymmetric, which is the interesting part. Only a CLIENT opens a request
stream: HTTP/3 has no server-initiated request, so a server that opens one is building a stream the peer is
required to treat as a connection error. And section 6.1 makes a client that RECEIVES a server-initiated
bidirectional stream a connection error of type H3_STREAM_CREATION_ERROR. Both directions are refused loudly
rather than silently tracked: tracking either would turn a role mix-up inside this process into something
indistinguishable from a peer protocol error, which is the worst possible shape for that bug.
The request table is bounded at WT_HTTP3_ENDPOINT_REQUESTS_MAX, which is therefore the number of concurrent
sessions one connection can carry, and running into it is WT_ERR_LIMIT with no error code -- the same rule as
the peer-stream table. A duplicate stream is detected BEFORE the bound, and the test asserts that ordering
explicitly, because "a caller's mistake reported as a peer-scale limit" is the kind of inversion that costs an
hour of debugging later.
70 CTest tests (69 unit suites, 79,391 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-96 (P3, c99, http3, qpack, tests) -- CLOSED on main at 0950c98 (the forty-seventh part): the
chain from a HEADERS frame to a decoded request. wt_http3_endpoint_on_request_headers applies the
request-ordering rule, decodes the field section against decoder state the ENDPOINT owns (the dynamic table the
peer's encoder stream fills, plus the insertion count), and hands back a wt_http3_message_t. Whether the
decoded pseudo-headers are a WebTransport request stays wt_webtransport_session_request_validate's judgement,
which is why the endpoint needs to know nothing about :protocol -- the separation the test exercises by
driving the decision through the draft-16 layer from the decoded message.
Two rules here are the RFC's rather than conveniences. A field section's MaxEntries prefix is ENCODED AGAINST
what this endpoint advertised, so the decoder capacity is set explicitly rather than assumed; a capacity below
32 makes MaxEntries zero, and a section referencing a dynamic table that was never advertised is refused
rather than read against the wrong indices. And a TRAILER may not carry pseudo-header fields (section 4.1): the
message decoder has one request shape and one response shape and cannot tell a trailer from a request, so the
endpoint -- the only layer that knows the first HEADERS from the second -- refuses them itself.
The test also pinned a boundary the other way round, which is worth recording because the first draft got it wrong: a FIRST section carrying only regular fields has no request line, and the message layer refuses it with H3_MESSAGE_ERROR. The test now asserts that refusal instead of the hand-built section passing, which is the same lesson as WT-89 in a different layer -- a lower layer's judgement is only visible once something asks it a question the test did not think to ask.
70 CTest tests (69 unit suites, 79,411 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-97 (P3, c99, http3, qpack, tests) -- CLOSED on main at 1f3d18a (the forty-eighth part): the
encode side of the field-section path. wt_http3_message_encode writes a request's or a response's
pseudo-headers as a QPACK field section and wt_http3_endpoint_write_headers puts the HEADERS frame around it.
The section is encoded into the caller's scratch BEFORE the frame, because a frame's length prefix is a varint
whose width depends on the length: the frame can only be written once the section has been measured, which is
the rule this library follows at every length it writes and the reason the API takes a scratch buffer at all.
The lines are LITERAL rather than static-table indexed. Always valid, never needing a dynamic table on either side, usable before either endpoint has one -- and larger on the wire than an indexed reference would be. That is a compression decision with a correct simple answer and a clear upgrade path, and the header says so instead of implying the encoder is as small as it could be.
One design point came out of a FAILING CHECK rather than from reasoning ahead of time: the first draft attached H3_MESSAGE_ERROR to ANY encoder failure, and the test -- which asserts exact codes -- caught it on the scratch-too-small case. A message with no method or no status IS a wire-shaped mistake and keeps that code, but a section that does not fit the CALLER's scratch is a local buffer, and giving it a peer-facing code tells the peer's story about this endpoint's mistake. That is now a documented distinction in the code.
The test is a round trip rather than hand-written bytes: the client's extended CONNECT is written, framed,
decoded by a server endpoint, and handed to wt_webtransport_session_request_validate. The two directions
cannot drift apart without a test failing, which is the property a codec pair needs and hand-written vectors
do not provide.
70 CTest tests (69 unit suites, 79,435 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-98 (P3, c99, http3, tests) -- CLOSED on main at 7f5c03b (the forty-ninth part): http3/driver.h,
the seam between a connection and the endpoint. It exists for one fact -- a stream's type prefix is a QUIC
varint and a varint can be SPLIT across frames -- and the reason it matters is narrow and sharp: deciding a
stream's type from half a varint is how an implementation ends up decoding someone else's stream. The driver
holds at most the first eight bytes of each opening stream (the longest a varint can be) in a FIXED table,
classifies when they add up, and hands back the rest of the completing frame as a VIEW into the caller's
buffer, so nothing is copied.
The error taxonomy is this session's usual division: a prefix that does not start at offset zero, or a stream
resumed at an offset that does not continue what was held, is the CALLER's accounting and is WT_ERR_STATE;
a stream that ends before its prefix is complete is dropped without ever becoming a stream of any type; and the
pending table is the endpoint's own bound, so running into it is WT_ERR_LIMIT with no error code. The test
checks that the table bounds CONCURRENCY rather than a lifetime total by ending a waiting stream and watching
its slot come free.
The varint lesson, recorded for the third time in three phases, and this time it bit a TEST rather than the
implementation: WT_WEBTRANSPORT_STREAM_UNI is 0x54, and 0x54 as a varint has its top two bits set, so
the WebTransport stream type is a TWO-byte prefix on the wire (0x40 0x54). A test that wrote 0x54 as a
single byte was not testing the WebTransport stream type at all; the driver read the real two-byte value and
classified it as unknown, which is correct behaviour and a wrong test. Prefixes and lengths are MEASURED on
this wire, never transcribed -- and the fact that the same mistake keeps reappearing in each new layer is now
itself the observation: it arrives whenever someone writes wire bytes by hand instead of encoding them.
71 CTest tests (70 unit suites, 79,485 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-99 (P3, c99, http3, tests) -- CLOSED on main at 323052f (the fiftieth part): a connection is only
usable once the endpoint has opened the streams HTTP/3 requires, so the driver now starts them. The control
stream's 0x00 prefix and its SETTINGS frame are written by one call, and the QPACK 0x02/0x03 prefixes by
another. The SETTINGS payload is measured into the caller's scratch before the frame is written around it,
which is the same rule every length on this wire follows: a frame's length is a varint whose width depends on
its value, so a length computed from a guess lands one byte out and the peer then reads a short frame or refuses
the stream. That mistake has already cost this project once, in the 1200-byte Initial rule (WT-79), and the
measure-then-write shape is what prevents it.
Two ordering decisions are worth keeping. The once-per-connection rules are applied BEFORE any bytes go out, so a caller that starts a second control stream finds out from a return value rather than from a peer's connection error -- and the test asserts that nothing was written in that case. The one failure that DOES leave bytes behind is a SETTINGS payload that does not fit the caller's scratch, and the test asserts the prefix is already out when that happens, because a caller that cannot tell "nothing happened" from "half of it happened" cannot recover from it.
71 CTest tests (70 unit suites, 79,505 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-100 (P3, c99, http3, tests) -- CLOSED on main at 8f6f4c2 (the fifty-first part): the driver
reassembles a stream's HTTP/3 FRAME boundaries, per stream, in sixteen bytes of state each -- a frame's own
type and length varints can be split across the STREAM frames a connection hands over, exactly as a stream's
type prefix can (WT-98).
It deliberately does NOT buffer the payload. It reports the payload to a sink in the pieces that arrive, with
last on the final one, and that division is the design rather than a shortcut: framing needs sixteen bytes per
stream, while the PAYLOAD is policy -- how much of a HEADERS section this endpoint will hold is a bound, and a
bound belongs to whoever owns the memory. A driver that buffered frames would be carrying that policy silently,
at a size nobody chose. The one number the driver does bound is the frame's DECLARED length, because that number
is the peer's to choose: over the caller's max_frame_bytes it is H3_EXCESSIVE_LOAD, refused before the sink is
asked for anything.
Writing the test found the case a naive reassembler misses, and it is worth recording because it is a whole class of bug rather than a typo: a stream that ends part way through a frame HEADER is exactly as incomplete as one that ends part way through a payload. The first version of the code checked only the payload case, so a peer that sent one byte of a two-varint header and then FIN would have been left waiting forever instead of being refused. The check now covers both, and the test asserts the refusal with the frame error code.
71 CTest tests (70 unit suites, 79,540 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-101 (P2, swift, release, ci) -- OPEN: the publish-and-confirm steps for 1.3.8, which are the parts a tag alone does not do.
Done on the tagged commit 13d29fd (13 September 2026): the changelog and README carry 1.3.8, both package
entry points build with the CI job's own flags (-warnings-as-errors -strict-concurrency=complete -require-explicit-sendable), swift test passes 300 tests (up from 297: the three regression tests for the
issue #24 fix), Swift/check-api-compatibility.sh is clean, and Swift/build-release-apple-silicon.sh produced
byte-identical artifacts across two independent clean arm64 builds --
WebTransportClient 9b2c2848…, WebTransportServer d8abe2c3….
Still open, and listed here rather than only on the release page so it cannot be lost:
-
Confirm the queued CI run for
13d29fd(the Swift CI job is on GitHub's runner backlog, the same backlog that starved the issue #24 commit's run). The release page states the local verification exactly and must be updated with the run's result once it exists -- a release note that implies a green run it does not have is the kind of claim this project exists to avoid. -
Upload the release assets (
WebTransportClient,WebTransportServer,SHA256SUMS) to the GitHub release for the tag. -
Verify the published assets against
SHA256SUMSand rerun both 40-scenario conformance suites against the downloaded binaries, then update the release page's wording from "to be included" to verified. - The containerized interop matrix has not been rerun for 1.3.8; 1.3.8 changes no wire encoding, so the 1.3.5 evidence stands for the encoding, but the release page should say which revision the evidence belongs to rather than implying it is per-release.
WT-102 (P3, c99, http3, quic, tests) -- CLOSED on main at efec542 (the fifty-second part):
wt_http3_driver_on_quic_frame has the shape wt_quic_connection_set_handlers wants, so the driver is
installable directly and a caller stops writing routing code. It routes four things, and each has to be at this
layer rather than in the connection: a STREAM frame on a peer-initiated unidirectional stream (reassemble the
type prefix, then send the bytes either to the frame sink or to the session, depending on a type only the
HTTP/3 layer knows), a STREAM frame on a peer-initiated bidirectional stream (a request stream), a DATAGRAM's
payload handed over uninterpreted, and NOTHING for a frame on a stream this endpoint opened -- the peer's answer
on a stream we started belongs to the connection's own stream state, and routing it here would put two layers
on one answer.
The routing is decided by the peer's stream ID bits rather than a flag the caller passes, because RFC 9000 section 2.1 already encodes both answers there. The test found that from the other direction and is worth recording: its first draft called stream 3 a "client-initiated" stream, and 3 has the low bit SET, so it is server-initiated -- the driver correctly treated it as its own and refused to route it. Reading the identifier instead of trusting a comment is what made the mistake visible.
One build-level note for the next person: a switch was the natural shape for this router and
-Wswitch-enum refused it, because the warning wants every enumerator named and the handler acts on two of
twenty-odd frame kinds. The if-chain that replaced it carries the reason in the code -- naming twenty-one no-op
cases would make the two that matter harder to find, which is the opposite of what the warning is for.
71 CTest tests (70 unit suites, 79,558 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-103 (P3, c99, http3, tests) -- CLOSED on main at a0b56a9 (the fifty-third part): the driver can
open and start an endpoint's own streams, send a request, a response or a trailer as a HEADERS frame, and send a
datagram -- and it does none of it by naming a QUIC connection. The transport is a table of three calls
(open_stream, send_stream, send_datagram). That keeps the HTTP/3 layer independent of the connection
implementation, and it makes the outbound half testable against a RECORDING transport: what this layer produces
is the thing under test, and a recorder reads it more exactly than a live handshake would.
The ordering bug the test found is worth recording, because it is a protocol-shaped bug rather than a typo. The first implementation opened the stream and THEN built the bytes, so a second call to start the endpoint's streams -- which the once-per-connection rule refuses -- had already opened a fourth stream before the refusal. An orphaned stream is one the peer sees and this endpoint cannot explain, which is exactly the state a "refuse, never half-succeed" rule exists to prevent. Both are built before they are opened now, and the test asserts the stream count does not move on a refused call. This is the same family as WT-99's "a caller that cannot tell 'nothing happened' from 'half of it happened' cannot recover".
Two smaller decisions: the frame and its payload share the driver's scratch at fixed halves, so they cannot
overlap while a payload stays under half the buffer, a bound the SETTINGS encoder's own limit enforces; and a
transport that cannot open a stream right now (congestion, WT_ERR_AGAIN) passes its refusal straight through,
because that is a connection condition and not an HTTP/3 one.
71 CTest tests (70 unit suites, 79,581 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-104 (P3, c99, http3, quic, tests) -- CLOSED on main at aa8badc (the fifty-fourth part):
wt_http3_driver_quic_transport fills the three-call transport table with adapters onto
wt_quic_connection_open_stream, wt_quic_connection_send_stream and wt_quic_connection_send_datagram, so
the transport seam is closed end to end: the HTTP/3 layer produces bytes, the connection moves them, and
neither has to know the other's internals.
The design decision worth keeping is where the SEND OFFSET comes from. The adapter reads it from the
connection's own stream state (stream->send_offset) rather than counting for itself. An adapter with its own
counter would be a second opinion about a number the connection already owns, and the two would disagree the
first time a send was retried after a loss -- which on this transport is not an exceptional event but the
normal one. This is the same class as WT-103's orphaned stream and WT-99's half-sent control stream: one
number, one owner.
A stream the connection does not know is refused by this layer as the caller's error, because only the connection's own open call can bring one into existence. A datagram has no stream state and goes straight through, which is why QUIC's DATAGRAM frame has no retransmission either.
The test checks the adapter by FORWARDING rather than by a session: a freshly initialised connection has no keys and no room, so it refuses, and the assertion is that the adapter returns exactly what the connection returns rather than inventing a status. That is the only part of a thin layer that can be wrong without a handshake, and therefore the only part worth a unit test.
71 CTest tests (70 unit suites, 79,589 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-105 (P3, c99, cli, tests) -- CLOSED on main at f35bff5 (the fifty-fifth part): cli/options.h
parses exactly the flags the plan names, and the three tools share one implementation, because a flag that
means one thing in one tool and another in the next is worse than a flag that is missing. It is a library
function rather than argv walking inside each main, and that choice is what turns every rule into a failing
check: the missing value, the unsupported mode, the timeout that is digits only, the positional address, and
the JSON text a script reads.
Two rules are the ones worth keeping. An unsupported mode is not an unknown one: --transport packet is
what this build has, and --transport quic is refused BY NAME with exit code 2 -- likewise --trust anything-goes, --exchange both and --scenario one. A tool that silently ignores a mode it cannot honour
writes reports nobody can trust, which is the failure this project's honesty rule exists to prevent. And a
flag that takes a value never takes the NEXT FLAG as that value: --timeout-ms --connect is a missing value
rather than a timeout of the string "--connect", so a script's typo cannot become a connection attempt. A
single dash, by contrast, is a VALUE and not a flag, because refusing -host:1 as an address would be this
parser inventing a rule about host names it has no business having. Both of those were settled by tests that
first asserted the wrong behaviour -- the ordering of "refuse" and "accept" is exactly what a first draft gets
backwards.
wt_cli_options_check is the single place that says a connect needs an address and that the development bypass
is refused outside loopback, so the three tools cannot disagree about what a usable command line is. The JSON
report's field names are asserted as TEXT, because a field that moves changes a machine's input.
72 CTest tests (71 unit suites, 79,653 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-106 (P3, c99, cli, tests) -- CLOSED on main at 1fe2dcf (the fifty-sixth part): the conformance
tool's machine-readable product. cli/report.h holds the scenarios this build can genuinely verify and the ones
it cannot, and its three rules are all about not lying. A scenario that did not run is unsupported with a
reason -- never a pass, never a failure -- because a report whose green line cannot be told from "not attempted"
is worth nothing. The report is ordered and named by the tool rather than by the run, so two runs compare
without sorting. And the exit status carries the same information rather than replacing it: 0 when everything
passed, 1 when anything failed, 3 when nothing failed but something was not attempted -- the status this project
already uses for a build that cannot do what was asked.
wt-conformance-c99 --scenario all [--json] runs the three in-process scenarios this build can truly verify
(QUIC varints across every form and the boundaries between them, a WebTransport close capsule's round trip with
the peer's code, and the draft-16 decision on a decoded extended CONNECT) and reports the two local
session-over-IP scenarios as unsupported with the reason. That is deliberate: the report GROWS into a full
conformance suite when the packet-session wiring lands, and no unsupported entry is ever quietly deleted.
The tool found a bug in itself on its first run, and that is the most useful thing recorded here. The varint
scenario compared each decoded value against a stale loop index left over from an earlier version of the loop
and reported failed -- while every library test passed. A conformance report that can be wrong about its own
subject is worse than no report at all. Two fixes came out of it: the scenario now names the failing VALUE in
its detail instead of saying "a value did not survive its own encoding", which is both better output and what
made the cause visible in a single run; and the same run showed the draft-16 scenario was missing the :scheme
an extended CONNECT requires, so that assertion was wrong too. Both were the tool's fault and not the library's,
which is exactly the distinction a conformance report has to be able to make.
73 CTest tests (72 unit suites, 79,751 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-107 (P3, c99, cli, runtime, tests) -- CLOSED on main at 5cfa4c8 (the fifty-seventh part), with its
documentation at acb0b72: the socket half of the plan's "run local IPv4 and IPv6 packet sessions".
cli/endpoint.h turns a host:port into a bound or targeted UDP endpoint; a listener binds and reports the port
it ACTUALLY got, a client parses without binding (two clients on one machine must be able to reach one server),
and both tools report the endpoint in their --json output. The family comes from the ADDRESS rather than a
flag, because the runtime sets IPV6_V6ONLY explicitly -- the platform default differs between Linux and the
BSDs -- so an IPv4 address on an IPv6 socket is not reachable and a tool that guessed would work on one machine
and fail on the next.
Two smaller rules, both of the same family as earlier parts. A wildcard is spelled 0.0.0.0:4433, not
:4433: a host with no family is a guess about which family was meant, and the runtime refuses to make it --
the test's first draft expected :4433 to work and was corrected to assert the refusal, the same shape as the
trailer rule in WT-96 and the limiter ordering in WT-89. And a refused bind is passed through as the system's
own status rather than translated, for the reason WT-104 gives: a layer that renames a system refusal hides the
reason for it. The test asserts IPv4 unconditionally and treats IPv6 as available-or-skipped, because a test
that fails on a machine without an IPv6 loopback is a test about the machine.
Process note, recorded because it happened twice today. The part's first commit (5cfa4c8) contains the
code and the message's documentation claims but NOT the documentation: a scripted edit asserted an anchor that
belongs to the plan file while editing the README, aborted before writing either file, and the && chain that
should have stopped did not, because the docs script and the git commands were separate statements rather than
one chain. The follow-up acb0b72 has the documentation. The rule this tracker already carries -- verify each
anchor separately, and commit docs on their own when a script touches two files -- now has a second data point.
74 CTest tests (73 unit suites, 79,779 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-108 (P3, c99, runtime, tls, quic, tests) -- CLOSED on main at 4f3509a (the fifty-eighth part):
runtime/session.h is the one place where the socket, the QUIC connection and the TLS handshake meet. Each
already existed and none knew about the others: the connection needs somewhere to send, the handshake needs a
connection carrying Initial keys, and the socket needs a caller to pump it.
Three of its rules are the ones that are invisible when they are wrong, and they are worth keeping in writing:
-
The Initial keys come from the DESTINATION CONNECTION ID, in both directions, with the
from_serverflag OPPOSITE for the receive direction. Backwards, the connection encrypts and decrypts nothing, and the symptom is a peer that never answers -- not a key-schedule error. This is RFC 9001 section 5.2's rule and the single most misleading failure mode in the whole handshake path. - The handshake's frame handler is CHAINED, not replaced. That is exactly why the handshake driver returns WT_OK for frames that are not its business; a session that installed its own handler instead would stop the frame walk before the layer behind it saw anything -- and the HTTP/3 driver IS the layer behind it.
-
A pump never waits. It reads what is there, flushes what is owed and returns. A tool that waited inside
a library call could not honour its own
--timeout-msor be interrupted; the caller owns the clock and passesnow. One packet per call, deliberately, because a pump that drained the socket would starve the other endpoint in a two-session test.
The test covers the session's own contract rather than the handshake's (which has its own suite with the trust fixtures): arming an endpoint, a bounded pump with an empty socket -- the ORDINARY case in a two-endpoint loop, so it must not be an error -- an unstarted session refusing to pump, clearing twice because an error path that unwinds would otherwise double free, and a server with NO CERTIFICATE refused at START rather than at the first ClientHello, where the reason is far harder to see. That last one is the library's own rule, found by trying to arm a server with a zeroed TLS configuration: the refusal is correct and the test now asserts it.
What remains for the plan's "run local IPv4 and IPv6 packet sessions": the two-endpoint handshake over loopback, which needs the repository's trust fixtures, and then the HTTP/3 driver installed behind the handshake so a session can be established and used. That is the next part, and it is the last one before the tools can claim the criterion.
75 CTest tests (74 unit suites, 79,805 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-109 (P2, c99, runtime, tls, quic, tests) -- CLOSED on main at de2c59b (the fifty-ninth part): the
runtime session driver is proven end to end. test_runtime_session_pair stands up two loopback UDP sockets and
two sessions, arms one as a client and one as a server, and pumps both until the TLS 1.3 handshake inside QUIC
Initial and Handshake packets is confirmed on both sides with application keys installed. It uses the
repository's trust fixtures -- a real leaf, a real CA and a real signature -- so the client VALIDATES the server
rather than trusting it, which is the difference between testing a handshake and testing a bypass. This is the
plan's "run local IPv4 and IPv6 packet sessions" at the library level; the tools' own session loop is what
remains before the CLI can claim it.
Two details in the test are what make it a test rather than a hang, and both are worth copying. The socket is
waited on before each pump, because a non-blocking receive finds nothing until the packet has actually
arrived and a loop spinning faster than the loopback interface would finish before the first Initial packet did.
And both the round count and the wait are bounded, so a driver that never completes FAILS rather than
hanging the suite -- the first draft of the loop had a break at round zero that skipped the handshake
entirely, and the assertions after the loop reported it immediately instead of the suite sitting there.
One thing this part makes explicit rather than implicit: the same connection ID is used at BOTH ends, because that is what makes the Initial keys -- derived from it -- the same on both sides. A real deployment replaces the peer's ID with the one the server chooses, so connection ID management during the handshake is still missing, and it is the next transport gap after the HTTP/3 wiring. It is recorded here so it is found by reading the tracker rather than by reading a packet capture.
76 CTest tests (75 unit suites, 79,833 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-110 (P2, c99, http3, runtime) -- OPEN: the HTTP/3 layer is never asked about a frame on a live
connection. Measured in test_runtime_session_pair: the client's extended CONNECT goes out, the server reads
packets, and a counter incremented at the top of the chained HTTP/3 handler stays at zero. The diagnosis has been refined twice since it was written, and the refinement is the useful part. The first
reading was that the connection CONSUMES STREAM frames into its own stream state and never hands them to the
handler. Reading connection.c showed that is wrong: STREAM frames DO reach deliver_to_handler, after
ensure_peer_stream has created the stream, so a handler-driven design is the right one after all.
The sharper measurement (a0bd4e6) is that on the SERVER,
wt_quic_connection_stream(&server.connection, request_stream_id) is NULL: the server never created the
stream, so the frame never reached its frame walk. That moves the question to the CLIENT's half -- whether
wt_quic_connection_send_stream queued a frame that the flush then sent, and whether the resulting packet was
sent at all. Next step: instrument the client (a frame-descriptor count after send_stream, and the packets
sent by flush) rather than the server. Until it is answered, Phase 9's "CLI tools run local packet sessions"
criterion cannot be met, and the test asserts only the outbound half.
A third measurement (0d03c91) answered the client's half, and the answer moves the item into the library
rather than the HTTP/3 layer:
-
wt_quic_connection_send_streamon the client accepts an 8-byte send on the request stream and returnsWT_OK, but not one byte arrives and the client'sstream->send_offsetstays ZERO.send_offsetis what the stream advances when data is handed to the send path, so the call accepted the data and neither recorded nor sent it. - The control stream's own send DID create a stream on the server (stream 2 exists), so packets flow and the fault is specific to STREAM data on a stream this endpoint opened AFTER the handshake.
Fourth measurement (6ae4c72), on the WIRE, and it settles which half is at fault. Across the pump rounds
after the CONNECT, the client's connection.packets_sent does NOT move -- it stays at 9 -- while the frame
was accepted and the stream recorded it, and the packets the server reads in that time are the SERVER's own
retransmissions. So the CONNECT is written, recorded, and never leaves the host:
wt_quic_connection_flush is where that is decided, and neither the HTTP/3 layer nor the receive walk is
involved.
Fifth measurement (0e1700a) CORRECTED the fourth, and the correction matters more than the number.
packets_sent was 9 BEFORE the measurement window and 9 after it; the previous round read that as "the packet
never leaves", but the counter had already been incremented BY THE SEND ITSELF -- the CONNECT packet WAS sent.
The window was wrong, not the path. This is the second time in this item that a correct measurement was given a
wrong reading, and the pattern is now explicit: the reading belongs beside the number, and a window that
starts after the event can only ever see the aftermath.
What the measurements establish now: both sides read packets, neither refuses any (the pump counts receives
that are neither success nor "nothing there": zero on both sides), both flushes report OK, application keys
are installed in both directions -- and still no stream is created on the server and no frame reaches its
handler. And the pump no longer swallows the statuses at all: last_flush, last_receive and the refusal
count are permanent fields, and the test ASSERTS on them.
Next step, now the only unmeasured place: a counter inside the connection's FRAME WALK -- ensure_peer_stream
and deliver_to_handler -- to see whether the server's receive path reaches the STREAM branch at all. Everything
outside it has been measured and is behaving.
Sixth measurement (2a19e73), and it found the root cause in one run. Three permanent diagnostics on the
connection -- frames_walked, stream_frames_seen, frames_delivered -- showed that the server's walk does
see the client's STREAM frames (stream_frames_seen 4, frames_walked 2138) and that both connections are
CLOSED with transport error code 3, STREAM_LIMIT_ERROR, long before the CONNECT matters.
ensure_peer_stream decided the client had opened more streams than this endpoint granted and closed the
connection; every later frame is then ignored BY DESIGN, which is exactly why no stream was created for the
request and no frame reached the HTTP/3 handler.
Three rounds of inference looked everywhere except at whether the connection was still alive. That is the lesson worth keeping from this item: when a peer "ignores" everything, the first question is not which layer dropped the frame but whether the connection is still open -- a counter and a close code would have answered it in round 57 instead of round 62.
Seventh measurement (0bcbeda): the suspect is ELIMINATED, and the question moves again. Two facts, both
measured on the very connections that closed:
- The grants the admission check reads are 8 in both classes on both sides -- so the setter, the getter and the admission field agree, and the previous round's "the accounting believed one stream was granted" reading was wrong.
- Instrumenting
ensure_peer_streamitself showed it runs exactly ONCE on the server (stream 2,bidir=0,index=0,granted=8) and admits it. It never refuses anything, soSTREAM_LIMIT_ERRORdoes not come from the admission check at all.
What is left is a sharper and different question: the server's walk saw four STREAM frames, all for stream
2; the client's data for streams 6, 10 and 0 never appears in it, although wt_http3_driver_start_own_streams
and send_message both returned OK and the frames were recorded against their streams. The server originated the
close with code 3 and the client closed in response.
RESOLVED (30f99ac), and the resolution is the milestone Phase 9 was built for. The server's HTTP/3
handler IS reached on a live connection now: test_runtime_session_pair shows the control stream's SETTINGS
arriving, the CONNECT's QPACK field section assembled from the pieces the driver reports, decoded off the wire,
and accepted by the draft-16 validator with the request state advanced past the request line. Two sessions
complete a TLS 1.3 handshake inside QUIC, HTTP/3's own streams open, and an extended CONNECT crosses a real
connection.
The root cause, and the two wrong readings that delayed it. The server closed the connection with transport
error code 3, which this session read as STREAM_LIMIT_ERROR -- and that sent two rounds at the stream-count
accounting, where measurement (an instrumented ensure_peer_stream, granted=8, admitted) found nothing wrong.
Code 3 is FLOW_CONTROL_ERROR; 0x04 is the stream limit. The close came from the STREAM branch's own
mapping after wt_quic_stream_on_data refused the frame, and it refused because the connection-level receive
account started at zero: nothing pairs the initial_max_data an endpoint ADVERTISES in its transport
parameters with the local grant that enforces it (wt_quic_connection_set_max_data). The advertised number is a
promise, the grant is the enforcement, and until they agree the first peer stream frame is refused and the
connection closes -- presenting as a peer that says nothing rather than as a missing grant.
runtime/session.h now states the rule beside the driver's other invariants, and pairing them automatically is
WT-113 below. Two lessons join this tracker's list: read the error SPACE before reasoning about an error code
(0x03 is flow control, not stream limit -- the table is worth opening), and an endpoint that grants nothing
receives nothing, the receive-side twin of "one number, one owner" (WT-108, WT-112).
WT-118 (P2, c99, http3, quic, tests) -- CLOSED on main at e5277f3 (the sixty-fourth part): the
exchange is complete. test_runtime_session_pair is now two self-contained tests -- one for the TLS 1.3
handshake inside QUIC, one for the exchange -- and the exchange runs end to end over loopback: the client's
extended CONNECT, the server's decode of it off the wire, the draft-16 validator's acceptance, the server's
response, and the client's decode of that with :status 200. 99 checks in the suite, all green.
The last library fix, and it is the one that mattered. The driver returned early for ANY stream "we opened", on the reasoning that such a stream carries only the peer's answer "which the connection's own stream state owns" -- and that early return was exactly where the response died: the connection delivered the frame, the chain called this layer, and it said there was nothing to route. A UNIDIRECTIONAL stream this endpoint opened is the case where nothing can come back; a BIDIRECTIONAL one carries the other direction of the same exchange, with its own HEADERS frames (RFC 9114 section 4.1). Three fixes together close the response path: WT-110's receive grants (an endpoint that grants nothing receives nothing), WT-116's tracked-stream routing (a duplicate request-stream registration aborted the routing), and this one (a locally-opened bidirectional stream's inbound frames).
And WT-117 is closed by the same commit: the test file is rewritten WHOLE as two readable tests rather than patched further. The rule it earned stays in the phase and here: it had been edited by scripted find-and-replace seven times and two of those edits landed blocks in the wrong place -- one cost a round of library diagnosis, one cost the file's integrity. A test whose ORDER is its subject is edited by hand or rewritten, never nibbled by anchors.
With this, Phase 9's library side is done: a session can be established, a CONNECT accepted, and a response
delivered over a real connection. What remains for the phase's completion criteria is the TOOLS' loop --
--listen/--connect driving wt_runtime_session_* and wt_http3_driver_start_session, the
--exchange stream|datagram message exchange, and the scenario output that turns the conformance tool's two
unsupported session entries into real ones.
77 CTest tests (75 unit suites, 79,904 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-116 (P2, c99, http3, tests) -- FIXED on main at 757ae71 (the sixty-third part): a real library
bug in the response path. Routing a bidirectional stream's frames went through
wt_http3_endpoint_on_request_stream unconditionally. For a stream this endpoint OPENED that is a duplicate and
is correctly refused -- and the refusal ABORTED the frame routing, so the peer's RESPONSE was never handed to the
caller at all. The driver now asks whether the endpoint already tracks the stream: if it does, this endpoint
opened it and what arrives is the response, the other direction of the same exchange (RFC 9114 section 4.1 gives
each direction its own HEADERS frames); if it does not, the peer initiated it and it becomes a request stream.
One exchange has two directions, and treating them as one case was the bug.
WT-115's two open questions are now answered by measurement, post-pump:
- the server's connection does hold the request stream after the pumps -- so "no stream to answer on" was block placement inside the test, not the library, and the same class of mistake as the round before it;
- the server does accept and send the response on it (
wt_http3_driver_send_responsereturns OK, and the frame is written).
What remains is the response's ARRIVAL at the client's sink. The next probe is written down: the client's own
stream_frames_seen and frames_delivered after the response pumps, and whether its connection stayed open.
WT-117 (P3, c99, tests) -- OPEN, process: tests/unit/test_runtime_session_pair.c has been edited by
scripted find-and-replace seven times, and the last round's edits landed blocks in the wrong place TWICE -- the
response block before the pumps that deliver the CONNECT (which cost a round of library diagnosis), and then a
deletion that cut into the milestone assertions (reverted with git checkout). The rule is now in the plan and
belongs here too: a test whose structure matters is edited by hand or rewritten whole, never nibbled by
anchors -- and when an edit removes a region, the boundaries and the replacement belong in one verified edit.
The file deserves a rewrite into two small, self-contained tests (handshake, then exchange) rather than a
further patch.
Update (0f91a54): attempted and REVERTED, with the design and the edit list recorded. WT-113's design is
settled and small -- one wt_runtime_session_limits_t passed to wt_runtime_session_start_client/_server,
applied by the driver (apply_advertised), and the callers stop calling wt_quic_connection_set_max_data and
wt_quic_connection_set_max_streams by hand -- and the pairing it creates is exactly what WT-110's root cause
needs: an endpoint that advertises a limit and grants nothing closes its own connection on the first stream
frame, presenting as a peer that says nothing.
It was implemented and then reverted, because a public-signature change reaches FOUR call sites --
tests/unit/test_runtime_session_pair.c, tests/unit/test_runtime_session.c,
apps/wt-conformance-c99/scenario_session.c and apps/support/session_loop.c -- and scripted edits to those
call sites began passing arguments in the wrong positions. The compiler caught every one; chasing them one at a
time at the end of a long session is how a working tree becomes a half-changed one. The tree is back to the last
verified state (80 CTest tests, green in debug, release and ASan+UBSan) and nothing half-changed was committed.
The rule this phase has now earned three times, in three shapes (the release segfault of WT-120, the test
file nibbled by anchors of WT-117, and this): a change that reaches several call sites is made in ONE focused
pass, with the exact edit list written down first and all three build configurations in the loop -- not bolted
onto the end of another round. The edit list for the next attempt is the four files above plus the header and
src/runtime/session.c.
The manual grants also remain, and they are correct for now: grant_receive_room in the pair test and
grant_receive_room in the conformance scenario apply what those callers advertise, by hand, and both are
asserted. That is the state WT-113 exists to remove.
CLOSED (afbf491), in one focused pass as the previous attempt's rule required.
wt_runtime_session_advertise(session, initial_max_data, initial_max_stream_data, initial_max_streams_bidi, initial_max_streams_uni) puts what an endpoint ADVERTISED in its transport parameters into force: the
session-level data limit, the per-stream limit and the stream counts. Deliberately a SEPARATE call rather than
four more parameters on start_client/start_server -- a call that already takes seven numbers does not need
four more, and a caller's arguments cannot drift when they are not there. It is idempotent (the limits are
monotonic), and a caller that advertises nothing does not call it.
Every caller that advertises now uses it -- the session pair test, the conformance tool's IPv4/IPv6 scenarios,
and both CLI session loops -- and the manual grant_receive_room helpers those call sites needed are GONE.
That is the point: the pairing lives in the driver, once, instead of in every caller's memory. The pair test
asserts the RESULT (the grants in force before any stream is sent) rather than the mechanism.
The failure this closes is the one that cost several rounds of measurement in WT-110: an endpoint that advertises a limit, grants nothing, and closes its own connection on the FIRST stream frame as FLOW_CONTROL_ERROR -- which presents as a peer that says nothing rather than as a missing grant. The three-attempt history of this item (failed, reverted, then done in one pass) is itself the evidence for the rule the phase now carries: a change that reaches several call sites is made in one focused pass, with the edit list written down and all three configurations in the loop.
Pair the advertised transport parameters with the local grants. The session driver cannot see the
initial_max_data / initial_max_streams_* / initial_max_stream_data_* values its caller advertises, so the
test (and any caller) must call wt_quic_connection_set_max_data, wt_quic_connection_set_max_streams and set
local_max_stream_data to matching values by hand. Three options, in the order they should be considered: take
the advertised parameters as a session parameter (they are built by the caller anyway); or have the session
build them (then it owns both halves and cannot disagree); or keep the manual pairing and assert it in one
place. The failure mode of getting it wrong is silent and misleading -- a closed connection that looks like a
silent peer -- which is why it is written down rather than left to the header comment.
-- accepted, recorded, walked by nobody. That is the fourth distinct hypothesis this item has produced, and all three previous ones were ELIMINATED by measurement rather than argued away -- which is the right shape for this item even though it has taken several rounds.
Superseded (kept because it is what the evidence first suggested): the admission check reads
local_max_streams[bidirectional ? 0 : 1], and the test sets BOTH classes to 8 before any stream is opened, so
the ACCOUNTING -- not the test -- is what believed a single unidirectional stream was granted. A focused unit
test (set 8, open peer streams, read the grant, watch for the close) will say whether set_max_streams, the
admission check, or the handshake's peer-parameter application is writing that slot.
And the previous round's own instrumentation bug, kept because it was real: it SWALLOWS WT_ERR_AGAIN from the connection
flush, so a refusal has been invisible for three rounds. That is the same class of mistake as a conformance
report that cannot tell "passed" from "not attempted" (WT-106) -- a pump that cannot tell "nothing to send" from
"refused to send". Next round's first change is therefore to stop swallowing it: keep the status, report it,
and assert on it, before looking at the flush gating itself (keys per space, owed acks, congestion window, and
whether the application space is open for sending at all once the handshake is confirmed).
Previous next step (superseded but kept, because it is what led here): a minimal reproduction against the handshake suite's own pair, which DOES
exchange stream data -- its g_stream_* records prove it -- plus an assertion on send_offset. The difference
between that setup and the session's is the answer, and one of the two candidates is worth checking first: in the
handshake suite local_max_stream_data is set immediately after wt_quic_connection_init, while in the session
test it is set after the handshake, and a stream created in between would carry a ZERO window.
This item is now recorded as a three-step refinement rather than one wrong answer, because the cost of a wrong
diagnosis is a wasted round: the first reading blamed the HTTP/3 driver (already right), the second blamed the
frame walk (already right), and the third is the first one backed by a measurement that cannot be explained
away -- send_offset == 0 after an accepted send.
WT-111 (P3, c99, runtime, tls, tests) -- FIXED on main at d4f892e (the sixtieth part): three real
defects found by wiring HTTP/3 to a live session.
- The peer's transport parameters were never applied to the connection. The handshake carries them and nothing turned them into limits, so the connection refused the unidirectional streams HTTP/3 must open before it can send anything -- and the refusal arrived as a STATE error from an open call rather than as a missing step. The session pump applies them once now, the moment the handshake has them. This is the kind of gap only an integration test can find: both halves were correct and tested in isolation.
-
Opening a request stream was two calls in two machines. The connection owns the stream ID and its flow
control; the endpoint owns the request ordering. A caller that did one without the other got a refusal at the
first send.
wt_http3_driver_open_requestdoes both and says why in its comment. - A server identity on a returning stack frame. The handshake KEEPS the pointer it is given, so the first version of the test's helper left the server signing with freed memory; the test aborted with no output at all, which is a failure mode worth recognising. The identity lives in the pair structure now. Same class as WT-108's "one number, one owner": a borrow whose owner is a stack frame is a borrow that expires.
Also recorded: the pair test now grants stream limits on BOTH halves (its own local_max_stream_data for
receiving and the peer's parameters for sending), because an endpoint that grants nothing receives nothing and
that looks like a lost packet rather than a missing grant.
76 CTest tests (75 unit suites, 79,872 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-112 (P2, c99, http3, quic, tests) -- FIXED on main at 3fb8aed (the sixty-first part): reading
wt_quic_connection_send_stream showed it returns WT_OK only when it has written a frame, and that it
leaves the stream's send_offset and final size to the CALLER -- wt_quic_stream_on_data_sent says so in its own
comment ("the caller has already had the frame written, so this records it"). The HTTP/3 transport adapter was
recording neither, so the stream never learned it had data and every later send would have gone at the SAME
offset, which is a protocol error rather than a slow stream. The adapter records the send and the FIN now, and
the pair test asserts send_offset > 0 after the CONNECT goes out.
This also refutes WT-110's second inference, which is worth keeping in the record. The previous round's
"send_stream accepts the data and sends none of it, because send_offset stayed zero" was evidence of THIS
bug, not of frames being dropped. The lesson is the one this tracker has now recorded in several forms: a
measurement can be correct and its interpretation wrong, so the interpretation belongs in the entry next to the
measurement -- and a call that returns OK while doing nothing is more often a missing caller obligation than a
lying API.
WT-110 remains OPEN, with the measurement moved one layer out: after the fix the server's HTTP/3 handler counter STILL stays at zero, so the next question is on the WIRE rather than in either layer -- does the client's packet actually leave? That is a counter the connection can expose (packets sent, or descriptors in the loss list), and it is the next experiment. Everything else in the outbound path is now verified: the CONNECT is written, sent, recorded against the stream, and the client tracks its request stream.
77 CTest tests (76 unit suites, 79,874 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-114 (P3, c99, http3, tests) -- CLOSED on main at 8983bd7 (the sixty-second part):
wt_http3_driver_start_session does what every WebTransport client does, in the order the protocol fixes --
start this endpoint's own streams (control and both QPACK streams), open a request stream, and send the extended
CONNECT for a given authority and path. The pair test uses it now and still reaches the milestone (the section
crosses a real connection, assembles, decodes and is accepted by the draft-16 validator), so the one-call version
is PROVEN against a live connection rather than merely written.
The argument for the helper is the history of this phase: doing that sequence by hand is where THREE separate bugs were found. A grant that did not match the value the endpoint advertised (WT-110's root cause); a stream opened on one machine and not the other (WT-111); and a send whose offset was never recorded, so every later send would have repeated the same offset (WT-112). Each was a step in a sequence whose order and pairing the protocol fixes -- which is exactly the argument for one call that cannot get them out of step.
This is also the shape the CLI tools need: wt-client-c99 becomes "open a session on this endpoint, start it
with this authority and path, pump", and the conformance tool's two unsupported session scenarios have a
function to call rather than a paragraph to implement.
77 CTest tests (76 unit suites, 79,894 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-115 (P2, c99, http3, quic, tests) -- OPEN: the response cannot be sent over a live connection, and the measurement is exact.
Correction (7821f37): the "contradiction" was MY OWN INSTRUMENTATION. The diagnostic that reported
stream_frames_seen = 0, an empty stream table and a live connection was printed BEFORE the pumps that
carry the CONNECT, so it described a connection that had not yet seen a packet. That reading was then treated as
the post-pump state and became a library hypothesis, and it cost a round. The test now tells its sinks which
stream carries the exchange the moment the stream exists -- where that assignment belongs -- and the item
records the rule: a diagnostic belongs AFTER the traffic it describes; a counter read at the wrong point is a
coincidence, not a measurement.
This is the THIRD time this item has turned on WHERE a number was read rather than what it said: the
packets_sent window in round 61 (read after the send it meant to measure), the transport error SPACE in round
64 (0x03 read as stream limit when it is flow control), and now the pump phase. The pattern is the entry, not
the three incidents: every measurement in this tracker should say WHERE in the sequence it was taken, and
the two that did not were both read as evidence of a library bug.
What is open is unchanged and one reading away: whether the server's connection holds the request stream AFTER the pumps, which decides whether a response can be sent on it (and hence whether Phase 9's "tools run a local session" criterion can be met).
Superseded update (1345703), kept because it is what the misplaced print produced: the probe produced a
contradiction the TEST has to explain about itself first. After the
milestone assertions pass -- the CONNECT assembled and decoded on the server side -- the server's CONNECTION
reports is_closed = 0, close code 0, stream_frames_seen = 0, and no streams in its table at all. A
connection that walked zero STREAM frames cannot have delivered one to the HTTP/3 driver, and a table with no
streams cannot answer on any of them. So either the counters belong to a different object than the handler is
bound to, or the chained handler runs on a session whose connection is not the one being inspected.
The next probe is therefore ONE print: the CONNECTION pointer inside the chained handler beside the side pointer
(side_on_frame is bound to &server and the session to &pair.server, both visibly). A test-shaped hypothesis
is recorded FIRST because the evidence points that way: every library suite passes, and
test_runtime_session_pair is the only place in this tree where the two sides are wired by hand. If the objects
turn out to be the same, the library is where to look -- and either answer removes a round of guessing, which is
what the last five rounds of this item have cost.
What works now. wt_http3_endpoint_on_response_headers decodes a response with the RESPONSE pseudo-header
rules and a once-per-stream rule, and wt_http3_driver_send_response sends a status. They are separate from the
request path on purpose: RFC 9114 section 4.1 gives the two DIRECTIONS of one exchange their own HEADERS frames
on the same stream, so a response is neither the request line nor a trailer. Decoding it with the request rules
-- which is what this endpoint did before the call existed -- refuses a perfectly good :status as a
pseudo-header in a trailer, and that is the specific bug the new call removes.
What does not work. The client's CONNECT arrives and decodes (the milestone assertions pass), but
wt_quic_connection_stream(&server.connection, request_stream_id) == NULL
-- the server has no QUIC stream to answer on, while the frame walk demonstrably delivered that stream's
STREAM frame to this layer (frames_seen 4, the CONNECT's section assembled from it, and the stream admitted
with granted=8 in WT-110's instrumentation). A frame walked for a stream the connection does not have is
self-contradictory, and the next step is to find out which of the two is lying:
- print, inside the STREAM branch, the stream's pointer both immediately after
ensure_peer_streamand at the end of the frame's handling, plus the connection's table size -- to see whether the stream is created and then removed (a close or a retire path), or never created at all; - check
wt_quic_connection_is_closedand the close code at that moment: WT-110's root cause was a close, and a second one (a flow-control overrun on a later frame, or a MAX_DATA contradiction) would explain a table that no longer answers; - if the stream is genuinely absent,
wt_quic_connection_streamis the wrong accessor for a peer stream that the walk created, and the fix is a create-or-find call the send path can use.
This is the last thing between Phase 9 and a session a caller can use: a response needs a stream to go back on,
and the client's sink is already told which stream carries the exchange, so the moment the server can answer,
test_runtime_session_pair asserts the whole exchange without being rewritten.
77 CTest tests (76 unit suites, 79,896 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-119 (P3, c99, tls, tests) -- CLOSED on main at 128baf3 (the sixty-fifth part): tls/self_signed.h
generates in memory what a local development server needs -- an ECDSA P-256 key and a certificate for the
loopback names, both DER, plus the SHA-256 fingerprint that makes the certificate useful. The fingerprint is the
design rather than a convenience: a self-signed certificate is trusted by NOTHING by definition, so a client can
only reach it by PINNING that value (WT_TLS_TRUST_PINNED_CERTIFICATE) or through the development bypass, which
the trust layer already restricts to loopback names. One call therefore produces both halves of a local setup,
which is what --listen --trust local-development needs and what the conformance tool's session scenarios need
without borrowing the repository's test fixtures.
Two details are the ones to keep. The identity and the certificate handed to the handshake and to the trust
check are built by SEPARATE calls that point into the generated buffers, so no structure ever contains a pointer
to itself -- a self-referential struct is one memcpy away from pointing at somebody else's stack, which is the
same class as WT-111's server identity on a returning frame. And the generator compiles against OpenSSL
unconditionally, like the trust layer beside it: a stub generator next to a real trust layer would be a promise
the build cannot keep. (The first draft DID guard on a feature macro that this build never defines, and the test
reported WT_ERR_UNSUPPORTED -- a useful five minutes: the guard was a fiction.)
The test is a CLOSED LOOP rather than a self-comparison, which is the only kind worth having for a certificate: it generates, pins what the generator returned, has the trust layer accept it, checks that a different pin is refused, that no pin at all is refused, and that two generations differ. A generator tested against its own output proves nothing about whether anything can trust it.
77 CTest tests (76 unit suites, 79,922 checks, plus the sample), green in debug, release and ASan/UBSan.
Step 1 done (548fb6f): the classifier is isolated and proven. wt_http3_driver_classify_bidi_start decides
whether a peer's opening bytes on a bidirectional stream are an HTTP/3 request (a QPACK field-section prefix) or
a WebTransport bidirectional stream (the draft's 0x41 type and the session ID). It is a PURE function -- it
reads, it does not route, and the caller decides -- and that separation is exactly the rule this item earned:
the ROUTING is where the first attempt's release-build crash lived, so the classifier is proven in debug,
release AND ASan+UBSan before anything is routed by it.
Its contract is the streaming layer's rather than a buffer parser's: a prefix that has not fully arrived is
WT_ERR_TRUNCATED, which on a stream is a WAIT and not a refusal (a peer may open a stream and send its first
bytes in the next packet); a stream with no bytes at all is a request stream until proven otherwise; and the
number reported as consumed is the PREFIX's length rather than the body's -- which the test asserted wrongly at
first, expecting two bytes where the type 0x41 needs a two-byte varint of its own (the MSB-first lesson, for
perhaps the sixth time in this project).
Step 2, next: route by it -- in the driver's bidirectional branch, when the stream is not already tracked,
ask the classifier and hand a WebTransport stream's bytes after the prefix to the session sink, with the session
check (a stream naming another session is refused). That is the change that crashed in release, so it lands on
its own, with test_http3_driver in the release configuration from the first build and the frame path's three
configurations checked before the commit. If it crashes again, the crash is now reproducible against a proven
classifier, which narrows it to the routing alone.
WT-120 (P2, c99, http3, tests) -- CLOSED on main at 2d80ca0: the --exchange stream classification for WebTransport
BIDIRECTIONAL streams, with its implementation withdrawn.
What the piece needs. A WebTransport bidirectional stream is a peer-initiated bidirectional stream whose
first bytes are the draft's 0x41 prefix followed by the session ID -- the bidi twin of the 0x54 the
unidirectional path already classifies. The driver's bidirectional branch therefore has to tell it apart from a
request stream's QPACK prefix BEFORE routing it, and a WebTransport stream must name the session this endpoint
serves, or it is refused rather than delivered to the wrong one.
What happened. That classification was implemented (wt_http3_driver_set_session_id beside it, a
unit test feeding both shapes through one entry point) and it SEGFAULTED in the RELEASE build while the debug
and sanitizer builds passed. The change was REVERTED rather than debugged to a deadline: a crash that appears in
one configuration is exactly what the four-configuration loop exists to catch, and a segfault in a frame path is
the worst place to be unsure about. The tree is back to the last verified state -- 77 CTest tests, green in debug,
release and ASan+UBSan -- and no part of this round was committed as working.
The rule it earned, now in the plan and here: a frame path is changed with ALL THREE build configurations in the loop BEFORE anything is committed. The sanitizers catch memory errors in code that RUNS; a path reached only by a release-mode test may not run the same way at all, and "the sanitizer run was clean" is not evidence about a configuration that was never built. This is the same shape as the measurement lessons already in this tracker (WT-110, WT-115): the question is not only WHAT was measured but WHERE, and now also WHICH BUILD.
Next attempt, with that rule applied: implement the classification again, in smaller steps -- first the
prefix parse and the session check alone with its unit test (all three modes), then the routing change -- and
keep test_http3_driver in the release configuration every time. The design note is above; what failed was the
implementation, not the design.
WT-121 (P3, c99, http3, tests) -- CLOSED on main at the sixty-sixth part: --exchange stream works
end to end. After the exchange's response, the client opens a unidirectional WebTransport stream -- the draft's
0x54 type AND the session ID, then the session's own bytes -- and the server's session sink receives exactly
the message, on the stream it was sent on. It uses the classification the unidirectional path already had, so no
new routing was needed (which is why WT-120's problematic bidirectional case is not on this path).
The one detail it needed, and the quiet failure it produced. The type classifier reads only the TYPE, so the
SESSION ID was passed along as the first byte of session data: the server received EIGHT bytes where the client
sent seven -- a leading byte nobody could explain. The session ID is part of the draft's prefix and is consumed
before the session sees anything; a frame that stops after the type is WT_ERR_TRUNCATED rather than a stream
whose payload begins with its own session ID, and out_prefix_consumed reports the WHOLE prefix (type and
session ID) because that is the number the caller continues with.
WT-120's rule paid for itself here. The change was small, and it was checked in debug, release AND ASan+UBSan BEFORE it was committed -- which is what caught the two unit expectations that had to change with it (the fixture now includes a session ID in the prefix, and the consumed count covers both parts). A byte-count mistake in a prefix is exactly the kind of thing that a single-configuration check reads as "one byte of somebody's session ID" instead of a failure.
77 CTest tests (76 unit suites, 79,928 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-122 (P3, c99, http3, quic, tests) -- CLOSED on main at the sixty-seventh part: --exchange datagram
works end to end, and it needed NO library change -- the driver's DATAGRAM branch already handed the payload
over uninterpreted. The test frames the message the way the draft does (a quarter stream ID and the payload),
sends it in a QUIC DATAGRAM frame, and parses what arrives with the session layer's own parser, which yields this
session's quarter stream ID and exactly the payload.
Two properties are worth keeping because a datagram cannot negotiate them: support is ADVERTISED
(max_datagram_frame_size) -- the same match-the-advertisement rule as the flow-control grants, so a peer may
only send a DATAGRAM when this endpoint's parameters said it would accept one -- and a datagram IS the unit, so
there is no reassembly, no ordering and no partial delivery. That is why the receive path is a single hand-over
rather than the piece-wise reporting the stream paths need, and why a datagram whose framing does not parse is
malformed rather than truncated.
With this, BOTH exchange modes the plan names have a proven path at the library level (stream: WT-121;
datagram: this part), and both were checked in debug, release and ASan+UBSan before being committed. What remains
for Phase 9's completion criteria is the TOOLS' loop: --listen/--connect calling these pieces, the
--message exchange on the chosen mode, and the scenario output that turns the conformance tool's two
unsupported session entries into real ones.
77 CTest tests (76 unit suites, 79,937 checks, plus the sample), green in debug, release and ASan/UBSan.
WT-123 (P1, c99, cli, runtime, tls, http3, tests) -- CLOSED on main at bb68f94 (the sixty-eighth part):
the plan's Phase 9 completion criteria are met. wt-conformance-c99 --scenario all stands up two endpoints in
ONE process over loopback -- a GENERATED and PINNED identity (no test fixtures), a real TLS 1.3 handshake inside
QUIC, an extended CONNECT accepted by the draft-16 layer, the response, an 11-byte message on a WebTransport
stream and a message as a datagram -- on IPv4 and IPv6, and reports:
{"summary":{"total":5,"passed":5,"failed":0,"unsupported":0}} exit 0
The two session scenarios that were unsupported from Phase 8's report onwards are now genuinely run. IPv6
reports unsupported WITH ITS REASON on a machine that has no IPv6 loopback -- a fact about the machine rather
than a failure of the code, which is the distinction the report's design was built around (WT-106).
Three things make this a criterion rather than a demonstration, and they are the ones to keep: the tool is run
by CTest (wt_conformance_scenarios, 78 tests now), so the claim is checked on every build; the identity is
generated and pinned rather than borrowed from the repository's test data, so the scenario runs where the tool
does; and the exchange is the WHOLE one -- handshake, CONNECT accepted, response, stream message, datagram --
the same path the library's pair test proves, now reachable from a command line.
Phase 9 remains open only for the client and server tools' own loops (--listen/--connect, --message,
--timeout-ms, --json), which reuse exactly the pieces this scenario is built from: the runtime session, the
HTTP/3 driver, the self-signed identity generator and the report. The conformance criterion -- "CLI tools run
local IPv4 and IPv6 packet sessions" and "stable machine-readable scenario output" -- is met today.
78 CTest tests (76 unit suites, the API sample and the conformance scenarios), green in debug, release and ASan/UBSan.
WT-124 (P2, c99, runtime, cli) -- OPEN: the client and server tools drive a real one-sided session loop
now -- a shared apps/support/session_loop.c -- and report machine-readable JSON
({"role":"client","status":"...","established":...,"connectAccepted":...,"responseStatus":...}), so their
behaviour is a value a script reads rather than prose it greps. Run against each other, though, the exchange does
not complete: the client reports {"status":"timeout","established":false}.
Why, measured: the server has to know its peer's address before it can arm a session, and the first implementation discovered it by RECEIVING the client's first Initial and DROPPING it -- which costs a retransmission round and discards the packet that names the peer. The fix is structural rather than a tweak:
- preferred: a LISTEN mode on the runtime session that reads the first datagram, holds it, arms the connection for the address it came from, and then PROCESSES that datagram -- no packet lost, no retransmission needed;
- alternatively a peek on the UDP layer that leaves the packet for the connection to read;
- and either way the tool needs a real timeout that reports the bound rather than a silent wait.
A silent-failure lesson worth keeping (WT-125, P3, c99, build): a target_include_directories call placed
BEFORE add_executable fails CMake configure, and a failed configure leaves the PREVIOUS binaries in place. The
tools therefore kept their old behaviour for a round while the build looked clean, and the only reason it was
caught is that the tool's output did not match the code. The rule: a build that reports no compile errors has
not necessarily rebuilt anything -- check a timestamp or a marker string when a behaviour does not change.
Not affected: the conformance tool's IPv4/IPv6 scenarios (WT-123) run real sessions in one process and remain the phase's evidence for its stated criteria; all three build configurations are green (78 CTest tests).
WT-124 (P2, c99, runtime, cli) -- CLOSED on main at 69e2a51 (the sixty-ninth part): wt-client-c99
and wt-server-c99 exchange a WebTransport session over a real socket, in two processes, each with its own
command line and its own machine-readable report:
client: {"role":"client","status":"ok","established":true,"connectAccepted":true,
"responseStatus":200,"receivedBytes":4}
server: {"role":"server","status":"ok","boundPort":4461,"established":true,
"connectAccepted":true,"receivedBytes":4,"pin":"1b2a79..."}
The piece that made it work is wt_udp_peek (WT-126, P3, c99, runtime/udp): a listener learns its peer's
address by looking at the first datagram and LEAVING IT IN THE QUEUE. The previous version received that
datagram and dropped it, on the reasoning that an Initial cannot be processed before the connection exists --
the reasoning was right and the implementation was wrong, because the packet that NAMES the peer is the packet
the connection then needs. A listener that consumes it waits for a retransmission, and a peer that has already
given up never sends one: the client's own report was {"status":"timeout","established":false} for exactly that
reason. The peek reports the datagram's true length even when the caller's buffer is too small (a datagram is
still a unit, and a peek that cannot see the whole thing does not guess at the part it can), and a caller that
only wants the sender passes a zero-capacity buffer.
scripts/check-cli-session.sh runs the two tools against each other and asserts the JSON contract -- both ok,
both established, CONNECT accepted, response 200, four bytes received on each side -- and is registered with
CTest as wt_cli_session. That makes 79 CTest tests, and it is the SECOND entry whose result is a real
session rather than a codec (the first being the conformance tool's IPv4/IPv6 scenarios, WT-123).
Note for whoever writes the next one of these: the script uses a FIXED port because the server's report is written when it finishes and the client cannot learn a chosen port from it in time. One such test is not a race; a suite with several would need the port passed through a file.
79 CTest tests, green in debug, release and ASan/UBSan.
WT-127 (P3, c99, http3, qpack, webtransport, tests) -- CLOSED on main at ceafe68 (the seventieth part):
Phase 10's first mirrored test group. The QUIC parsers have had a fuzz-style corpus since Phase 1 -- a
deterministic pseudo-random byte stream, with the assertion that a refusal is a STATUS and never a crash -- and
the layers above them were owed the same treatment. test_http3_malformed feeds 4,000 generated inputs to the
HTTP/3 frame decoder, the SETTINGS parser, the WebTransport capsule decoder AND the value parsers for the
capsules it decodes, the datagram parser, the QPACK field-section decoder with no dynamic table (the
strictest configuration, where a section referencing a table this endpoint does not have must be refused rather
than read against indices that do not exist), the draft-16 request validator on whatever decoded, and the HTTP/3
driver's stream classifier and frame-boundary reassembler.
Under AddressSanitizer and UndefinedBehaviorSanitizer this is the test that matters: a read past a buffer there is a failure rather than a plausible value, which is why the corpus -- rather than a hand-written list of cases -- is how this project covers the case nobody thought of.
Two findings from writing it, and both are the lesson this tracker keeps recording. The corpus asserts that it refuses AND accepts, because a generator change that made every input valid would silently turn the suite into a no-op -- but the proportions are asserted as they ARE rather than as guessed: a capsule decoder ACCEPTS most of the corpus (an unknown capsule type with a length that fits is a VALID capsule: RFC 9297 tells a receiver to ignore what it does not understand), and the stream classifier ACCEPTS an unknown stream TYPE for the same reason (section 6.2.1). The first version asserted "refused > accepted" in both places and failed, which is the fourth time in this project that an expectation about a parser's behaviour was wrong while the parser was right. And where the corpus IS a refusal corpus by construction (a random field section against an empty dynamic table), the test now says so instead of pretending to be balanced.
79 CTest tests (77 unit suites, 79,946 checks, plus the API sample and the CLI session), green in debug, release and ASan/UBSan.
WT-128 (P3, c99, http3, webtransport, tests) -- CLOSED on main at 06369b9 (the seventy-first part):
Phase 10's resource-exhaustion group. test_http3_limits drives every FIXED table in HTTP/3 and the session
layer to its bound -- the endpoint's peer-stream table, the endpoint's request table, the driver's pending-prefix
table and its frame-boundary table -- and asserts three things about what happens then:
- the refusal is
WT_ERR_LIMIT; - it carries no error code, because the bound is this endpoint's and a peer-facing code would tell the peer's story about a local limit (the rule WT-99 and WT-102 established, now asserted in one place);
- the table does not move: a refused stream consumes no slot, and a stream that ends GIVES ITS SLOT BACK, since these are bounds on CONCURRENCY rather than lifetime totals.
The count assertions are the ones that matter and the reason is worth keeping: a table that quietly dropped the entry past its bound would show a short, clean run, and "the peer opened one more stream than we allow" is exactly the case where a silent drop and a refusal look identical from the outside.
Two behaviours the suite pinned down while being written: a DUPLICATE request stream is a WT_ERR_STATE (the
caller's mistake) even when the table is FULL, because a caller must never be told "the table is full" when the
stream is simply already there; and a stream that ends frees its slot in both the endpoint's and the driver's
tables, so their bounds are concurrency rather than history.
81 CTest tests (78 unit suites, 80,011 checks, plus the API sample and the CLI session), green in debug, release and ASan/UBSan.
WT-129 (P3, c99, cli, tests) -- CLOSED on main at 955508d (the seventy-second part): the CLI session
test ran --exchange stream only, which left the plan's --exchange stream|datagram half covered at the TOOL
level -- the library's pair test and the conformance tool's scenarios cover both, but the tools are the phase's
deliverable. There are now two CTest entries on different ports:
-
wt_cli_session_stream(port 45417); -
wt_cli_session_datagram(port 45419);
and the script asserts the MODE in BOTH tools' reports -- "receivedDatagram":true for one and false for the
other. They are different code paths in both tools, and a report that claimed the same thing for both modes
would be worth nothing.
That closes the last gap in what the tools' own test proves: a two-process session, a CONNECT accepted, a 200 response and a message exchanged in each mode, checked on every build. 82 CTest tests now, of which four are end-to-end rather than codec-level: the conformance tool's IPv4 and IPv6 scenarios, and the two CLI session modes.
A note for whoever adds the third one: the script uses a FIXED port per mode because the server's report is written when it finishes and the client cannot learn a chosen port from it in time. Two tests on two ports is fine; a suite with several would need the port passed through a file.
82 CTest tests, green in debug, release and ASan/UBSan.
WT-130 (P3, c99, http3, tests) -- OPEN: the narrow edge WT-120 left open -- a WebTransport bidirectional prefix that arrives in PIECES -- was attempted and is REVERTED.
The design is sound and is kept in writing, because it is the part worth having: hold the first bytes in the same pending table the unidirectional path uses, re-run the proven classifier when more arrive, and then either deliver what follows the prefix to the session or REPLAY the held bytes into the HTTP/3 request path -- which must see a stream's first bytes, not the middle of them. The prefix bound also has to rise from eight bytes to sixteen, because a draft-16 prefix is the TYPE plus the session ID and each may be a varint of up to eight bytes; a table sized for the type alone would refuse a legal prefix.
The measurement is the useful part of the round: the SECOND frame of a split prefix came back as
WT_ERR_LIMIT with nothing delivered, while the existing 174 checks stayed green. That says the assembly refused
before it could decide -- but the round had no budget left to find where, and a frame path is not a place to
guess. The tree is back to the last verified state: 82 CTest tests, green in debug, release and ASan+UBSan,
and nothing half-working was committed (the revert is a488039).
Next attempt starts from the measurement rather than the design: put a counter at each refusal in the
assembly path -- the pending-table bound, the classifier's status, and on_stream_bytes's frame table -- and
read which one fires on the second frame. This is the third time this phase has recorded the same rule in a new
shape, and it is perhaps the most reliable thing this project has learned: a frame path is changed with a
counter in it, not with a theory about it.
WT-130 (P3, c99, http3, tests) -- CLOSED on main at 8765fcf: WT-120's last open edge is done, and the
method is the part worth keeping.
The prescribed next step was "a counter at each refusal, read on the second frame", and the first instrumented run said everything at once:
DIAGBIDI id=0 have=0 copied=1 classified=8 kind=0 consumed=0 <- first frame: TRUNCATED, so it is held
DIAGBIDI second=9 stream_bytes=0 <- second frame: refused, and NO assembly line
No assembly line for the second frame meant the assembly never ran, and the reason is the design's blind spot:
a CONTINUATION frame has a non-zero offset, and the assembly's condition was "offset zero". The very frame
that would have completed the prefix fell through to the HTTP/3 request path, where its middle bytes were read as
a stream's first and refused with WT_ERR_LIMIT. The held-bytes lookup now comes first, so a stream with held
bytes is assembled whatever the frame's offset says.
The test covers both outcomes of the assembly: a WebTransport prefix split across frames delivers exactly its payload once and releases the pending entry, and a REQUEST split the same way replays the held bytes so the request path sees the stream's first bytes rather than the middle of them. All three build configurations are green.
The rule, in its final form. Two of the three configurations were green through EVERY wrong version of this change, which is why the lesson is about counters rather than about configurations alone: the configurations say whether a change is SAFE; the counter says whether it is RIGHT. This item took three attempts across four rounds (crash, revert, revert, counter) and the counter was the only one that produced a fact instead of a theory.
82 CTest tests (78 unit suites, 80,044 checks, plus the API sample and both CLI session modes), green in debug, release and ASan/UBSan.
WT-131 (P3, c99, cli, tests) -- CLOSED on main at 8484cc3 (the seventy-third part): Phase 10's "CLI
process behavior" group, in the part scripts actually depend on. scripts/check-cli-contract.sh checks the
contract without a peer, which is what makes it fast enough to run on every build: an unsupported mode exits
2 and names what it refused, no mode exits 2, --help exits 0 and prints usage, and a client that cannot
reach anybody exits non-zero while reporting "established":false and never "status":"ok".
It found a real bug on its first run -- and it is the kind only a contract test finds. --help was rejected
as an UNKNOWN FLAG by the options parser, because the tools handled --help in a loop that ran after
parsing had already failed. The parser now owns --help, -h and --version, and the tools answer them BEFORE
the mode and address are checked: asking what a tool does is not asking it to do anything. The parser's unit
suite covers the three flags, including that --help alone parses with no mode at all.
The lesson generalises past this item: a unit test can be green for every function in a program while the program is unusable, because the thing a person types is not a function call. That is Phase 10's malformed-input spirit aimed at the tools rather than the wire -- feed the program the command lines a person actually types, and check what the PROCESS does.
83 CTest tests (78 unit suites, 80,056 checks, plus the API sample, both CLI session modes and the contract), green in debug, release and ASan/UBSan.
An audit, not an aspiration. The plan's nine completion criteria were assessed against what exists, each with
its evidence, and the gaps are now tracker items rather than prose. The audit itself lives in
C99/IMPLEMENTATION_PLAN.md (section "Definition of Done audit") and the README carries the summary.
Met (4). The CLIs run local IPv4 and IPv6 sessions -- wt_conformance_scenarios covers both families and
wt_cli_session_stream/_datagram cover the two tools over IPv4 in two processes; sanitizers and static checks
are clean (every round runs debug, release and ASan+UBSan, and the build is warnings-as-errors with conversion,
sign-conversion, cast-qual, switch-enum, pedantic and shadow among them); the public API is documented and
compiled against by wt-api-sample and test_public_api; and no placeholder, facade or test-only runtime is
exposed as production.
Partial (3).
-
Full draft-16 spec matrix (
WT-132): every layer is written and tested and the session layer runs end to end, but this tree has no COMPLIANCE MATRIX -- the Swift side maps draft-16 requirements to code and tests, and without the equivalent document there is nothing to measure "full spec matrix" against. -
Swift-equivalent conformance tests (
WT-133): the unit suites mirror the Swift suites layer by layer (78 suites, 80,052 checks) and the malformed corpora exist for QUIC and for HTTP/3/QPACK/session, but the conformance TOOL has five scenarios where the Swift tools have two 40-scenario suites. The tools have also not been driven over IPv6 themselves; the conformance tool has. -
CI on macOS, Debian, FreeBSD and Windows (
WT-134):c99-ci.ymlcovers macOS and Debian with sanitizers, the package consumer and a CLI smoke, and its last completed run was green. FreeBSD and Windows are absent, and a job for them is NOT a YAML edit: Windows needs a sockets/poll adaptation (WSAPoll,ws2_32) and a toolchain decision first, or the job would simply be red.
Not met (2).
-
The five-implementation VPS interop matrix (
WT-135): the C99 tree has no interop runner and no host is reachable from this work. The Swift side hasrun-docker-interop.shand a VPS matrix; the C99 side needs its own runner and a machine to run it on. This is the one criterion that cannot be satisfied by work in this repository alone. -
README status updated from
0%to the measured score (WT-136): the C99 README carries counts and a feature list but no score, deliberately -- the score is what the matrix produces, and writing a number before the matrix would be a guess dressed as a measurement.
No defect blocks any of this. The remaining work is a matrix to write, scenario breadth, two CI legs that need portability work first, an interop runner plus a host, and a score that follows the matrix.
WT-132 (P2, c99, docs, tests) -- CLOSED on main at 99e9282: docs/COMPLIANCE-MATRIX.md is the
document the Definition of Done's first criterion needed -- "full draft-16 spec matrix is implemented" had nothing
to be measured against. It maps every requirement the draft places on an endpoint to the function that implements
it and the test that exercises it: the extended CONNECT and its refusals, the response, the session-as-a-request-
stream rules (including the pseudo-header prohibition in trailers), WebTransport streams and their prefixes
(including a prefix that arrives in pieces and the REPLAY for a request), datagrams and their advertisement,
capsules with the strict-increase and 2^60 flow-control rules, drain, close, and the CONNECT stream ending --
plus rows for the QUIC, HTTP/3 and TLS layers the session runs on.
The matrix is CHECKED, not trusted, which is the part worth keeping: scripts/check-matrix.sh greps every
symbol the document names for a C declaration or a registered CTest name, and fails if one is missing. A
matrix that drifts away from the code is then a red build rather than a document that reads like evidence. CI runs
it beside the vector and package checks. Its first run caught two names that were test names rather than symbols
-- which is why it searches CMakeLists.txt and scripts/ as well as headers and sources, and why writing a
checker for a document is worth the ten minutes: the document's own first draft was already wrong in two places.
Two rows are deliberately not "tested", and are stated rather than hidden:
-
server push -- refused deterministically (
H3_ID_ERRORfor a client,H3_STREAM_CREATION_ERRORfor a server) because the draft does not use it. A refusal, not a missing feature. - a peer that changes its connection ID during the handshake -- the tests use the SAME connection ID at both ends, which is what makes the Initial keys identical on both sides. A peer that replaced its ID mid-handshake would not be tracked, and that is the recorded transport gap rather than a claimed feature.
With this, the Definition of Done audit's first "partial" is closed: the criteria now stand at five met, two
partial, two not met (scenario breadth WT-133, CI legs WT-134; interop WT-135, README score WT-136).
83 CTest tests, green in debug, release and ASan/UBSan; all four check scripts pass (check-matrix,
check-vectors, check-package, and the CLI contract test).
WT-133 (P2, c99, cli, tests) -- first half CLOSED on main at efd80d0; the scenario-breadth half remains
open. The Definition of Done's third criterion is "the C99 client/server CLI passes local IPv4 and IPv6", and
while the CONFORMANCE tool covered both families (WT-123), the two TOOLS themselves had only ever been driven over
IPv4.
check-cli-session.sh is parameterised by host now, and wt_cli_session_ipv6 runs the same two-process session
over [::1] -- handshake, CONNECT accepted, 200 response, and a message each way. The machine-dependent part
is handled the way the conformance tool already handles it: when the host is an IPv6 literal the script first asks
the conformance tool whether its own IPv6 scenario passes, and returns CTest's skip code (77) with the reason
when it does not. One probe, reused, rather than a second implementation of "does this machine have an IPv6
loopback" -- and a skip that says WHY rather than a failure that says nothing.
Still open in WT-133: the conformance tool has five scenarios where the Swift tools have two 40-scenario suites. The five are real end-to-end scenarios rather than codec checks, so the gap is breadth rather than depth: the Swift suites' scenario list is the specification to mirror, and each mirrored scenario should assert what the Swift one asserts rather than merely existing.
84 CTest tests, green in debug, release and ASan/UBSan; all four check scripts pass.
WT-136 (P2, c99, docs, tests) -- CLOSED on main at 07b890e: the Definition of Done's last criterion is
that the README's status goes "from 0% to the measured final score", and a number nobody can reproduce is a guess.
scripts/score-matrix.sh counts docs/COMPLIANCE-MATRIX.md's rows by status -- separating the rows that are
DRAFT-16 requirements from the rows describing the QUIC, HTTP/3 and TLS layers the session runs on -- and prints
the nine criteria as they stand. Its answer today:
24 of 24 draft-16 requirements exercised by a test in this tree
0 partial, 5 rows describing lower layers
5 of 9 Definition-of-Done criteria met, 2 partial, 2 not met
The README carries exactly that, with the distinction stated where a reader cannot miss it: 100% of the matrix is not 100% done. The criteria that are not met are outside the matrix and outside this repository's reach -- the five-implementation interop matrix needs a host (WT-135), and the FreeBSD and Windows CI legs need portability work before a job for them would be anything but red (WT-134). The partial ones are those legs and conformance scenario breadth (WT-133).
Writing one number and letting it mean everything is the failure the criterion's own wording guards against -- "measured final score" presumes a single measurement, and there are two different measurements here (the matrix's coverage and the nine criteria) -- so the status is reported as three quantities that a script can reproduce rather than as a percentage someone chose.
Definition of Done, now: 7 of 9 criteria met (the conformance-coverage audit joined the six, and the already met), 2 partial (WT-133 breadth, WT-134 CI legs), 1 not met (WT-135 interop, which needs a host).
84 CTest tests, green in debug, release and ASan/UBSan; all five check scripts pass (check-matrix,
score-matrix, check-vectors, check-package, and the CLI contract test).
WT-133 (P2, c99, cli, tests) -- CLOSED on main at 17efa77: both halves are done. The first half was
the tools over IPv6 (WF-133a, efd80d0); this is the breadth. The Swift conformance suites are half NEGATIVE --
a request for the wrong path, a CONNECT for another protocol, a capsule over the bound, a stream for another
session -- and the C99 tool had only the positive side. It now reports twelve scenarios, seven of them new,
and every new one asserts the CODE the peer would be sent rather than merely that something failed:
- a path this server does not serve is a 404, compared exactly (a prefix match would let one host's request be served as another's);
- an extended CONNECT for another protocol is NOT_WEBTRANSPORT, and the caller answers it as an ordinary request;
- a server that never advertised WT_ENABLED refuses a session it could not have been expected to serve;
- a capsule value over the bound is WT_ERR_LIMIT with H3_EXCESSIVE_LOAD;
- a peer stream past the endpoint's bound is WT_ERR_LIMIT with NO error code, because the bound is this endpoint's rather than the peer's mistake (the rule WT-99/WT-102 established);
- an empty datagram is WT_ERR_PROTOCOL with H3_MESSAGE_ERROR, because a datagram IS the unit and has no "incomplete";
- and the positive edge this project earned the hard way: half a prefix decides NOTHING, and the whole one classifies the stream (WT-130).
They need no sockets -- a refusal is a decision rather than a session -- so they are cheap enough to run inside the report on every build, and the CLI contract test now asserts the twelve-scenario summary with zero failures.
That is breadth in the direction the suites actually differ: the C99 tool already had the two hard end-to-end sessions (WT-123), and what it lacked was the long tail of negative cases a conformance suite exists to enumerate. The Swift suites have forty scenarios each; twelve is not forty, and the remaining difference is now a NUMBER rather than a gap in kind -- the list to mirror is the Swift suites' own scenario names.
Definition of Done: 7 of 9 met, 1 partial (WT-134 CI legs), 1 not met (WT-135 interop, needs a host).
84 CTest tests, green in debug, release and ASan/UBSan; all five check scripts pass.
WT-134 (P2, c99, build, docs) -- first step CLOSED on main at 68ec6cf; the adaptation and the CI legs
remain open. FreeBSD and Windows legs are the Definition of Done's CI criterion, and the honest first step is an
inventory rather than a YAML job: a job that cannot pass is worse than an absent one, because it teaches everyone
to ignore CI.
docs/PORTABILITY.md lists every place this code assumes POSIX and the adaptation each needs: socket headers;
WSAStartup (which has no home in this library yet, since the UDP layer is the only place it touches the
operating system -- a reference count there is the natural one); ws2_32; the SOCKET type and
INVALID_SOCKET; closesocket; ioctlsocket for non-blocking mode; WSAPoll; WSAGetLastError and its
DIFFERENT error set; WSABUF with WSARecvFrom/WSASendTo; and the one behavioural difference that matters:
On Windows a
MSG_PEEKcannot see a datagram's full length, so a listener must HOLD the datagram it looked at rather than leaving it in the queue. That is exactly the shape the runtime session's pending table already has -- so the Windows port's hardest piece has a design in this tree already, written for another reason (WT-130's prefix assembly).
FreeBSD, by contrast, is close to Debian: the same POSIX calls, and the difference is the toolchain and the OpenSSL package rather than the code.
The inventory is checked, not trusted, the same pattern as the compliance matrix and for the same reason: an
inventory that reads like a plan but has gone out of date is worse than none. scripts/check-portability.sh
greps the library for the POSIX-only names a port must replace and fails if one is used without being named in
the document -- it caught sendto and recvfrom missing on its first run -- and CI runs it.
The order for the rest of WT-134 is written down: the private platform header (udp_platform.h naming the
socket type, close, non-blocking mode, readiness and the error mapping), WSAStartup ownership, the peek
difference, then the CMake branch and the job. Nothing lands unverified: the POSIX path must stay green in all
three configurations at every step, and the Windows path will be verified on a Windows runner or not claimed.
84 CTest tests, green in debug, release and ASan/UBSan; all six check scripts pass.
WT-134 (P2, c99, build, docs) -- second step CLOSED on main at 911e46a; the datagram calls and the CI
legs remain open. The inventory's first item was a private header naming the platform differences so that udp.c
stops spelling POSIX in a dozen places, and it is in: src/runtime/udp_platform.h defines the handle type and
four operations --
wt_udp_platform_closewt_udp_platform_set_nonblockingwt_udp_platform_wait_readablewt_udp_platform_last_error
-- with a POSIX branch that is what this project builds and a _WIN32 branch written from the inventory
(closesocket, ioctlsocket(FIONBIO), WSAPoll, WSAGetLastError). The Windows branch is NOT verified, and
the header says so in its first paragraph: nothing in this repository builds it, and a port that claims to be
finished before it has been compiled once is exactly the failure this project refuses.
The POSIX path is unchanged in behaviour and green in debug, release and ASan+UBSan -- the only claim a change like this can make from a machine that is not Windows. Two things are deliberately left unabstracted and are named in the inventory:
-
the datagram calls (
recvmsg/sendmsgwithstruct iovec; the Windows form isWSABUFwithWSARecvFrom/WSASendTo), which is the largest remaining piece; and -
the public
int fdfield, which a Windows port must widen toSOCKET-- a PUBLIC change, and therefore one to make deliberately rather than in passing.
84 CTest tests, green in debug, release and ASan/UBSan; all six check scripts pass.
WT-137 (P2, c99, http3, tests) -- OPEN, with the measurement and the fix's shape recorded. Four more conformance scenarios were added this round -- a repeated SETTINGS identifier, a reserved one, a QPACK section that needs a dynamic table this endpoint never advertised, and two session-state rules (the first close's code wins; a drain stops new streams). Three pass. The fourth found a real bug:
RFC 9114 section 7.2.4.1 makes the RESERVED settings identifiers (
0x1f * N + 0x21) a connection error of typeH3_SETTINGS_ERROR. This parser ACCEPTS one -- measured: status 0, code 256. The predicate that knows the rule (wt_http3_setting_is_exerciser) is called from NOWHERE in the parse path, and its own comment said the reserved identifiers were "reserved to exercise the rule that unknown identifiers are ignored", which is the opposite of what the section says.
That is what a conformance suite is for, and the provenance is worth noting: the tool's own --settings-validation
flag names this rule, and this scenario is the first thing in the project that has ever checked it.
The fix is reverted for now and the scenario reports unsupported WITH THE MEASUREMENT rather than failed,
because the report's contract distinguishes "the code is wrong" from "this was not attempted" and the tool's exit
status carries the same distinction (3). The fix is one focused pass over three places that must move
together:
- the parser (
wt_http3_settings_parsemust refusewt_http3_setting_is_exerciseridentifiers withH3_SETTINGS_ERROR); -
test_http3_settings, whose round-trip fixture uses a reserved identifier as its example of a legal unknown setting -- which is exactly why the suite failed the moment the parser was corrected, and why a test's fixture can encode a bug; - this scenario, which flips from
unsupportedtopassed.
That is the rule this phase has learned three times, now with a fourth data point: a change that reaches several
call sites is made in one pass. The CTest registration learned the report's distinction too --
wt_conformance_scenarios carries SKIP_RETURN_CODE 3, and the CLI contract script accepts exit 0 or 3 while
still refusing a run with a failed scenario.
Definition of Done: unchanged at 6 met, 2 partial, 1 not met -- but the tree's draft-16 matrix now has a known false row ("settings are refused per the draft's rules") until WT-137 is fixed, which the matrix should say rather than not.
84 CTest tests, green in debug, release and ASan/UBSan; all six check scripts pass.
WT-137 (P2, c99, http3, tests) -- CLOSED on main at 72aa08a: the bug the previous round's conformance
scenario found is fixed, in the single pass its own note prescribed, over the four places that had to move
together:
-
the parser (
wt_http3_settings_parse) refuses a reserved identifier (wt_http3_setting_is_exerciser,0x1f * N + 0x21) withH3_SETTINGS_ERROR, which is what RFC 9114 section 7.2.4.1 requires; -
the setter refuses it too (
WT_ERR_INVALID_ARGUMENT), for the reason the HTTP/2 identifier set is already refused there: refusing at the setter keeps the encoder from producing a frame the parser would refuse; - the predicate's comment no longer claims the opposite of the section ("reserved to exercise the rule that unknown identifiers are ignored");
-
the fixtures -- and this is the part worth remembering. TWO test fixtures used a reserved identifier as
their example of a legal unknown setting:
test_http3_settings's round-trip payload, andtest_http3_driver's oversized-settings payload, which built its size from0x21 + i * 0x1f, the reserved family itself. The header now namesWT_HTTP3_SETTING_UNKNOWN(0x22) as "an identifier this version does not know and that is NOT reserved -- the shape a future setting has", and both fixtures use it.
A fixture that uses a reserved value as its example of a legal one is a bug that hides a bug -- which is exactly why the settings suite failed the instant the parser was corrected, and why the round before this one had to be reverted rather than patched.
The conformance report is now 17 scenarios, 0 failed, 0 unsupported, and the CLI contract script's "unsupported must carry a reason" check became conditional: it failed the moment the last unsupported entry disappeared, which is the healthy case. A check that assumes a known gap exists breaks when the gap closes.
Sequence worth keeping: a scenario found the bug (round 96) -> the fix reached four call sites, so it was
reverted and the scenario reported unsupported with the measurement -> the fix landed in one focused pass with
all three configurations in the loop (this round). That is the phase's rule working as intended, end to end.
84 CTest tests, green in debug, release and ASan/UBSan; all six check scripts pass.
WT-134 (P2, c99, build, docs) -- third step OPEN, scoped: the platform header now names four of the five
operating-system differences and is verified on POSIX, where behaviour is unchanged (911e46a). The fifth is the
datagram call itself.
An attempt to carry it into the header (wt_udp_platform_send_message / wt_udp_platform_receive_message over a
single wt_udp_platform_message_t) was reverted in this round, and the reason is the useful part: the wrappers
land in the header before their callers are converted, and -Werror refuses a static function nothing calls. So
the conversion has to reach all three call sites -- wt_udp_send, wt_udp_receive, wt_udp_peek -- in one
focused pass, exactly like the settings rule (WT-137). A half-converted build is not a checkpoint, it is a
broken tree.
docs/PORTABILITY.md now says so where the plan is read, next to the call-site count, so the next attempt starts
from the inventory rather than from the discovery. The remaining WT-134 work is unchanged: WSAStartup
ownership, the Windows peek shape (a listener must hold the datagram it looked at), a CMake branch linking
ws2_32, and the FreeBSD/Windows CI legs -- no job until one can pass.
Tree clean and green at 01d7634: 84 CTest tests, debug, release and ASan/UBSan, all six check scripts.
WT-133 (P2, c99, tests, docs) -- still OPEN: thirty scenarios here against the Swift suite's
forty. The Swift groups that still have no counterpart are its interop matrices, its release checks and
its multi-session isolation. Where the two suites do overlap, the C99 layer is now asked the same question. Thirteen scenarios
landed on main at 0fbe1d2, all in process and without sockets, because the value of a control
scenario is the CODE the peer would be sent and a code is a value the report can carry:
-
GOAWAY -- an identifier that increases is
H3_ID_ERROR(RFC 9114 section 5.2), an identifier that is not a client-initiated bidirectional stream id is the same error and leaves no GOAWAY in force (section 7.2.6), the reject-at-or-above boundary (8 rejects 8 and 12, allows 4), and no new request once one has arrived. -
The control stream -- one per connection (
H3_STREAM_CREATION_ERROR), SETTINGS first (H3_MISSING_SETTINGS), a request frame never (H3_FRAME_UNEXPECTED), and a closure isH3_CLOSED_CRITICAL_STREAMwhether or not SETTINGS arrived. - QPACK and framing -- the static table's exact bound (99 resolves, 99 is past the end), a dynamic capacity of zero admitting nothing, the session-stream predicate, and the datagram's quarter-id round trip that a receiver routes on.
The report goes from seventeen scenarios to thirty, 0 failed, 0 unsupported; the Swift suite has 40, so the remaining gap is its interop-matrix, release and multi-session groups.
The failure this round is worth keeping. check-cli-contract.sh asserted "total":17, so it went red
the instant the thirteenth scenario compiled -- the same rot as the unconditional unsupported grep that
WT-137 replaced. It now checks the summary as an invariant: the counts agree with each other and
with the scenarios the report lists, nothing fails, and the total may GROW. A check that breaks when the
work advances teaches people to edit the check rather than to trust it.
The documentation was three documents disagreeing about one number. The DoD audit still said four
criteria were met and that the matrix (WT-132) and the README score (WT-136) were missing, both long
closed; the README carried three conformance bullets with three different counts, one of them still
calling the reserved-SETTINGS scenario unsupported; and the unit-test count was 75/80,056 in the README,
76/80,056 in this wiki and 78/80,052 in the plan. Everything is now measured in the round it is written:
six of nine criteria met, two partial, one not met, thirty scenarios, 78 test files and 80,055 checks.
4266cdf and 66dec46 on main.
WT-133 (P2, c99, tests, docs) -- still OPEN: thirty-five scenarios here against the Swift suite's
forty. Five landed on main at 0d33c3e, mirroring its "Headers and QPACK" group, which the C99 report
had only ever asked in the negative direction:
-
headers-connect-round-trip-- an extended CONNECT's pseudo-headers and its:protocoltoken survive QPACK encoding and decoding. The token is the whole negotiation, so it is asserted byte for byte alongside:method,:scheme,:authorityand:path. -
headers-response-round-trip-- a 200 comes back as a status the decoder accepted, not merely as three digits that parse. -
qpack-static-reference--:path /is static entry 1, and the lookup and the entry agree about it. -
qpack-literal-name-round-trip-- a literal name and value, with the whole representation consumed. -
qpack-huffman-round-trip-- the coded line is shorter than the plain one and the H bits survive.
The failed assertion is the part worth keeping. The Huffman scenario failed on its first run because
it compared the decoded line's bytes with the originals. wt_qpack_field_line_decode REPORTS the H bits
and hands back the string still Huffman-coded -- inflating it is wt_qpack_huffman_decode's job --
so the scenario as first written asserted that one layer does two layers' work. It now decodes each
string with the primitive and checks the lengths, which also means a future failure says which of the two
layers is wrong. check-vectors.sh covers the same table from the RFC side, so the two meet in the
middle.
The scenario list is now 35, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan in every configuration, and all six check scripts pass. The gap to the Swift suite is its interop matrices, its release checks and its multi-session isolation.
WT-133 (P2, c99, tests, docs) -- still OPEN: thirty-seven scenarios against the Swift suite's
forty. Two landed on main at fb49e6d, and they are the first here that ask a question about MORE than one
session -- every scenario before them was one session, so "does one session's state move another's" could not
be asked at all:
-
multi-session-isolation-- sessions 0 and 4 (quarter stream ids 0 and 1) in one connection. A datagram for each reaches its own session and leaves the other untouched; a close on the first moves the first toCLOSEDwith its own code and refuses it new streams, while the second staysESTABLISHEDwith no close code and still allows new streams. -
datagram-unknown-session-- quarter 2 is session 8, which this endpoint does not have. The datagram is dropped, and both live sessions are exactly as they were: dropping is not delivering to a neighbour.
Where the boundary is was written down rather than glossed. The library owns the framing and the naming:
wt_webtransport_datagram_parse returns the quarter stream id and
wt_webtransport_session_id_from_quarter turns it into the session id -- but which session OBJECT that id
names is the receiver's own table, as it is for a CONNECT. The scenario therefore writes the table out in the
open and asserts library values (the mapping, the per-session state) rather than routing through a helper that
would have been testing itself.
37 scenarios, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass. The remaining gap to the Swift suite is its five interop matrices and its release checks, both of which need tooling this tree does not have yet.
WT-133 (P2, c99, tests, docs) -- still OPEN: thirty-eight scenarios against the Swift suite's
forty. The Swift "Interop Matrices" group is not a remote test -- it is a fixed table run in process -- and
0ba8d41 brings the first of the five across: interop-stream-matrix, eleven cases in one table, 11 of 11
holding.
The cases: a bidirectional and a unidirectional prefix round-tripping; a session that cannot exist refused on the writer's side and, for a peer's bytes, with H3_ID_ERROR; another stream type as H3_FRAME_UNEXPECTED; half a prefix as a wait rather than a refusal; the classifier on encoder-produced bytes, asserting the session it names and the length it consumed; a request start classified as a request; the type byte alone deciding nothing; a session id one byte short; and the predicate the four directions rest on. The report carries ONE entry with the count and names every failing row in the detail, so a red run says which row broke.
Two cases failed on the first run, and both were the test's mistake -- the recurring varint one.
{0x41, 0x02} is not "type 0x41, session 2": 0x41 is the FIRST BYTE of a two-byte varint, so that input is
the single value 258, and the library correctly answered H3_FRAME_UNEXPECTED. The same error made
{0x41, 0x40} look like a split session id when it is a complete varint. Both cases now start from bytes the
encoder wrote and change one byte, or take a real prefix one byte short, so the table cannot transcribe a
varint wrongly again -- and the file records why. This is the same lesson as the 0x41/0x54 stream prefixes
recorded in WT-137's round: lengths and encodings are measured, never written out by hand.
38 scenarios, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass. Four Swift interop matrices remain (connect, datagram, goaway/close/drain, malformed flow) plus its two release checks.
WT-133 (P2, c99, tests, docs) -- still OPEN: thirty-nine scenarios against the Swift suite's
forty, and the second of its five interop matrices is mirrored. 8b5da6c adds interop-datagram-matrix,
eight cases, 8 of 8 holding:
- a client datagram and a server datagram, each carrying its own quarter id and payload -- the framing is symmetric, so both directions are rows rather than one being assumed from the other;
- a quarter id and a session id naming each other, which is the mapping a receiver routes with;
-
an empty datagram, and a quarter id that did not all arrive, are both malformed: a datagram is a WHOLE
unit, so the answer is
MESSAGE_ERRORand not the wait the same bytes would be on a stream; - a datagram naming a session this endpoint does not have: the framing is fine and the owner is nobody, so it is dropped rather than handed to a neighbour;
- the send-side bound -- nothing fits a peer that accepts no datagrams, or a packet with no room -- and the
payload that IS returned is the largest that fits both the frame and the packet, asserted by
re-deriving the definition with
wt_quic_varint_sizerather than restating the arithmetic it lives in.
The matrix reporter now takes its noun, so a red run reads "2 of 8 datagram interop cases failed" instead of borrowing the stream wording.
39 scenarios, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass. Three Swift interop matrices remain (connect, goaway/close/drain, malformed flow) plus its two release checks.
WT-133 (P2, c99, tests, docs) -- still OPEN, and the round where the C99 tool's scenario count reaches
the Swift suite's: forty against forty. The third interop matrix landed at c6e5520,
interop-goaway-close-drain-matrix, ten cases, 10 of 10 holding:
- a GOAWAY gates the streams at or above its identifier -- 0 passes, 4 and 8 do not, and no new request is started;
- a drain, received or sent, stops new streams, which is what makes it a drain rather than a close, and a repeated drain is accepted without ending the session, so its close capsule can still be written;
- a close ends the session with its own code, the first close's code is the one kept, and a capsule after the end is refused;
- the close capsule round-trips its code and its reason, and the drain capsule carries no value at all, both asserted through the capsule codec rather than by reading the bytes by hand.
The count matching is not the coverage matching, and the docs now say so in both places. Two of the Swift suite's five interop matrices (connect, malformed flow) and its two release checks have no counterpart here yet, while this report carries refusal and control cases the Swift suite folds into other groups. "Forty of forty" is a coincidence of totals, not a claim of equivalence -- which is exactly the kind of number this project's own rules say must be read from what was measured rather than from the shape of it.
40 scenarios, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass. Remaining for WT-133: the connect and malformed-flow matrices, and the two release checks.
WT-133 (P2, c99, tests, docs) -- still OPEN: forty-one scenarios, and four of the Swift suite's
five interop matrices now have a counterpart. d6d2c6f adds interop-connect-matrix, nine cases, 9 of
9 holding -- four of the server's policy asked one field at a time, five of the request-stream ordering
machine that carries the answer:
- its own authority and path accepted; another path a 404 compared exactly; another protocol token; and a
server that never advertised
WT_ENABLED; -
DATAbeforeHEADERSisH3_FRAME_UNEXPECTED;HEADERSthenDATAleaves the request in its body; ending a request before itsHEADERSisH3_REQUEST_INCOMPLETE; a frame on a stream the endpoint never tracked is refused; and a client receiving a request stream isH3_STREAM_CREATION_ERROR.
One case failed on the first run and the distinction it exposed is worth keeping. A CONNECT naming another
protocol is NOT_WEBTRANSPORT, not REJECT with a 404: the C99 layer separates "not a WebTransport request
at all" from "a WebTransport request this server refuses", and the two are answered differently -- the first
like any other request, the second with the draft's own refusal. The first version of the matrix flattened
that into one outcome; it now asserts the difference.
41 scenarios, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass. Remaining for WT-133: the malformed-flow interop matrix and the two release checks.
WT-133 (P2, c99, tests, docs) -- still OPEN, and close: forty-two scenarios, and all five of
the Swift suite's interop matrices now have a counterpart. 73d202a adds
interop-malformed-flow-matrix, nine cases, 9 of 9 holding -- and the first scenario family here to drive
the public API session handle rather than a codec:
- a capsule over the caller's bound is
WT_ERR_LIMIT, and a capsule that has not arrived is a wait -- the one malformed case that is not a refusal, because a stream delivers in pieces; - a second control stream is
H3_STREAM_CREATION_ERROR, andHEADERSorDATAon it isH3_FRAME_UNEXPECTED; - a field section needing a table nobody advertised is refused rather than read as empty;
- a session limit of four bytes accepts four and refuses the fifth, and the refusal carries
WT_WEBTRANSPORT_FLOW_CONTROL_ERROR-- the draft's own code, not a shrug; - one bidirectional stream against a limit of one, and a second refused;
- a session that agreed no flow control sends a million bytes and reports an unlimited allowance, which is what keeps a limit from being read as a wall.
What is left of WT-133 is not a scenario. The Swift suite's two remaining entries (release-products,
release-script-stale-spikes) assert packaging files: that the manifest exposes production products and
no spike binaries, and that the release script cleans its output, rejects a stale spike binary, checks
reproducibility and emits SHA256SUMS. Those are statements about an install tree and a release script, so
the C99 counterpart belongs in scripts/check-package.sh -- which already installs the tree and builds a
consumer against it -- rather than in a conformance tool that produces a report about protocol behaviour.
Recording that is the honest answer; inventing a scenario to match a number would not be.
42 scenarios, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass.
WT-133 (P2, c99, tests, docs, package) -- the last two Swift scenarios are mirrored and the round found a
defect that only a packaging assertion could find. ed8c834:
-
release-productsasks that a package expose its production CLI products and not its spikes. The C99 mirror is the install tree, because that is what a release artifact is here:CMakeLists.txtnow installswt-client-c99,wt-server-c99andwt-conformance-c99, naming the three targets rather than installing abin/directory wholesale.wt-api-sampleexists to keep the documented public API compiling and is not a tool; no test binary is a product at all. -
release-script-stale-spikesasks that a release not carry stale spike binaries. The C99 mirror is the same install tree:scripts/check-package.shfails if anything matchingtest_*,*spike*or*sample*is in it, and names what it found.
The gap: the install rules installed the libraries and the headers and NOT the tools. The three CLIs were
products of the BUILD and not of the PACKAGE, so an installed release had no runnable program in it. No
protocol scenario could have seen that -- every one of the forty-two passes either way -- and the check that
found it is three lines of find. That is the argument for mirroring a suite by what it ASKS rather than by
what it is named.
The check is also exact about its own claim: it configures with the tests ON and builds only the tool and library targets, so "no test binary is installed" is a statement about the install rules rather than about a build that never had any. Its first run failed on the static archive not being built and printed the exact target rather than installing short.
42 scenarios, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan; all six check
scripts pass, check-package.sh reporting both its consumer and its product-list claim.
WT-133 (P2, c99, tests, docs): d4f8efe mirrors the Swift suite's Flow Control group, whose three
rules were not in this report at all -- seven cases, 7 of 7 holding:
- the first
MAX_DATAcapsule establishes the limit; there is no default; - a repeated
MAX_DATAis refused asWT_FLOW_CONTROL_ERROR, and so is a decrease -- a repeat is what a peer sends when it is confused about what it already granted, and accepting it would hide the confusion; an increase is accepted, and neither refusal moves the limit; - stream limits follow the same rule with each direction counted separately;
- an explicit zero is a limit rather than an absence: the allowance is zero and a one-byte send is refused, so a session that read zero as "unlimited" would be caught here;
- one session's disabled flow control does not loosen another's limit.
One case failed on its first run, and the assertion was the thing that was wrong, not the library: it expected the allowance to be zero after a refused record. A refused record spends nothing, so the allowance it was measured against is still there -- that is what makes a refusal a refusal rather than a partial send. The row now asserts exactly that and then that a record of the remaining two bytes succeeds and takes the allowance to zero, which is a sharper statement than the one that failed.
43 scenarios, 0 failed, 0 unsupported; 84 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass. What is left for this criterion is an honest MAPPING rather than more scenarios: several Swift entries (its 0-RTT settings case, its QPACK post-Base case, its stream buffering and reset cases, its error mapping, and its library smoke matrix) have behaviour covered by the unit suites here without a scenario-level counterpart, and the next round audits that one by one instead of assuming either way.
WT-133's mapping audit -- the plan's criterion says "all Swift-equivalent conformance tests pass in C99", and the honest way to answer it is to walk the Swift suite scenario by scenario rather than to compare totals. That walk found one real feature gap:
| Swift scenario | Where the C99 coverage is |
|---|---|
qpack-dynamic-base-postbase |
tests/unit/test_qpack_field_section.c -- the two directions of a relative index are tested hard there, which is where a sign error would resolve to a different valid entry |
stream-reset-stop-sending, stream-buffering
|
the QUIC layer's reset/stop-sending frames and the split-prefix scenario; "incomplete is not malformed" is asserted on a stream |
error-mapping, flow-receive-violation-close
|
flow-control-matrix and interop-malformed-flow-matrix: the draft's own codes, including WT_WEBTRANSPORT_FLOW_CONTROL_ERROR
|
library-smoke-matrix, demo
|
multi-session-isolation, the close/drain matrix, and the two-process CLI session tests (scripts, not scenarios) |
session-invalid-id |
the prefix and GOAWAY H3_ID_ERROR rows, plus the framing suites |
protocol-structured-fields |
NOTHING. include/, src/ and tests/ did not mention a selected protocol anywhere. |
WT-138 (P2, c99, protocol, tests) -- OPEN, codec half CLOSED at bef1300. Draft-16 section 3.2
negotiates a sub-protocol through the wt-protocol field: a Structured Fields list in the request and a
single string item in the response. src/webtransport/protocol.c now carries that codec with
test_webtransport_protocol (61 checks), asserting exactly the places two implementations could disagree: the
token's excluded bytes (quote, backslash, comma -- each one would decide a different protocol on the other
side), a repeat refused rather than deduplicated, a list past the fixed table refused as WT_ERR_LIMIT from
either direction, and the selection rule -- the first token the client offered that the server supports,
so both ends compute the same answer instead of the server scanning its own list. An escape sequence is
refused rather than decoded, because it could only decode to a byte the token rules reject.
What is still open, stated plainly: the request policy does not consult the codec yet, so the Swift
scenario is mirrored at the field-section level and not at the session level, and the compliance matrix has
no row for it -- a matrix row is a claim about what is exercised end to end, and this is not yet. The next
step is the wiring: wt-protocol in the request policy, the selected token in the response, and a scenario
that negotiates one.
85 CTest tests, 79 unit suites, 80,116 checks, green in debug, release and ASan/UBSan; all six check scripts pass.
WT-138 (P2, c99, protocol, tests) -- still OPEN, codec and decision closed at bbd6082. Last
round's codec had nothing calling it; this round is the decision it exists for:
-
wt_webtransport_protocol_list_from_strings-- a server's configuration is NUL-terminated strings and the wire is token views, and the bridge is where a MISCONFIGURED endpoint finds out, rather than by sending a field its peer refuses. A configuration longer than the fixed table isWT_ERR_LIMITand not truncated: a truncated list is a different configuration. -
wt_webtransport_session_request_negotiate-- the draft's decision, the first token offered that is supported, so client and server compute the same choice from the same two lists. A request already refused for its path is not negotiated with, because changing it there would hand the caller two different answers to send. With nothing selectable and selection required, the decision becomesWT_WEBTRANSPORT_REJECT_PROTOCOL_REQUIRED(400, the draft's requirements-not-met) rather than a session that quietly speaks no sub-protocol while the client believes one was chosen. -
wt_webtransport_session_response_selected_protocol-- the client's side: a response naming a token this client never offered isWT_ERR_PROTOCOL, because accepting it leaves the two ends speaking different protocols. The output is cleared on refusal, so a stale token cannot be read as a selection. -
wt_webtransport_protocol_write_field-- the whole field LINE (name plus the quoted value), for a caller appending it to a section it already wrote.
Both lists are validated inside the negotiation: a caller that decoded a field section and forgot to
check it cannot negotiate with nonsense. test_webtransport_protocol is 101 checks, up from 61.
What is left, stated plainly: the APPEND path. wt_http3_message_encode writes the pseudo-headers of a
request or a response and nothing else, so no caller can yet put wt-protocol into a section it sends. That
append path, plus a conformance scenario that negotiates a sub-protocol end to end, is the next step -- and
the compliance matrix row lands with it, because a matrix row is a claim about what is exercised end to end,
not about what is compiled.
85 CTest tests, 79 unit suites, 80,156 checks, green in debug, release and ASan/UBSan; all six check scripts pass.
WT-138 (P2, c99, protocol, tests, docs) -- CLOSED at 553d4a5. The sub-protocol negotiation is now
exercised end to end, and the compliance matrix carries the row it earns: 25 of 25 draft-16 requirements
tested, 44 named symbols checked.
The append path turned out to need no new API. Last round recorded that wt_http3_message_encode writes
the pseudo-headers only, so nothing could put wt-protocol into a section. Re-reading it, the encoder writes
the section PREFIX and the pseudo-headers -- so appending the field line afterwards is exactly the order a
QPACK field section needs, and wt_webtransport_protocol_write_field was already the call for it. The
"missing API" was a missing look at the order the encoder writes in.
scenario_protocol.c drives the conversation in process, and it reads the response the way a peer would
rather than the way a struct would:
- the client offers
[chat.v1, chat.v2], the server supports[chat.v3, chat.v2], and the decision selects chat.v2 -- the first token the CLIENT offered that the server supports; - the server writes the 200 and appends the
wt-protocolfield, and the client finds it by walking the field section with the QPACK decoder, because a field section is not a structure; - the client accepts the answer only because it offered that token;
- a required sub-protocol that cannot be selected is a 400 with no token, not a session that quietly speaks nothing while the client believes one was chosen;
- a response naming a token the client never offered is refused.
Three report entries (protocol-negotiation, -required-refusal, -unoffered-selection), 46 scenarios in
all, 0 failed, 0 unsupported. 85 CTest tests, 79 unit suites, green in debug, release and ASan/UBSan; all six
check scripts pass.
Sequence worth keeping: the audit found the gap (WT-133's mapping walk), the codec landed without a caller, the decision landed without an append path, and the end-to-end exercise closed it -- with the matrix row arriving only with the exercise, because a matrix row is a claim about what is exercised end to end, not about what is compiled.
WT-134 (P2, c99, build, docs) -- step 1 CLOSED at 12da440. src/runtime/udp_platform.h now names
all five platform differences, and the socket is one header: closing, non-blocking mode, waiting for
readability, the error number, and the datagram calls themselves through wt_udp_platform_message_t with
wt_udp_platform_send_message and wt_udp_platform_receive_message. All three call sites went over in one
pass, because a partial conversion does not compile: -Werror rejects a wrapper nothing calls.
The flags are the differences, named rather than implied:
-
PEEK-- leave the datagram in the queue (POSIXMSG_PEEK); -
FULL_LENGTH-- report the datagram's own length rather than the copied one (POSIXMSG_TRUNCas an input flag). The Windows branch cannot honour it, because a peek there cannot see past the buffer, and the header says so in the structure's comment instead of leaving it to be discovered -- which is exactly whatPORTABILITY.mdstep 3 is about; -
TRUNCATED-- reported: the datagram was longer than the buffer, which is what keeps a caller from parsing the prefix of a packet (WT-36).
Two mistakes earlier rounds made are recorded in the file, because each cost a round and neither is a fact
about Windows: the message structure must be defined after the handle type it names (the first attempt
compiled to unknown type name wt_udp_handle_t), and the two calls cannot carry a non-static prototype above
a static definition (static declaration follows non-static declaration). Both are facts about C, and both
would have been found in one build if the pass had been done in one go -- which is why the two earlier attempts
were reverted rather than patched.
What is left of WT-134 is narrower now: the public int fd field a Windows port must widen to SOCKET,
WSAStartup ownership, the CMake branch that links ws2_32, and the FreeBSD and Windows CI legs -- and still
no job until one can pass.
85 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass, check-portability.sh
reporting that every POSIX-only name the library uses is in the inventory.
WT-133 (P2, c99, tests, docs) -- CLOSED at a44a0e8. The Definition of Done's "all Swift-equivalent
conformance tests pass in C99" is now met, and the evidence is the audit rather than a total: the Swift
suite walked scenario by scenario, with each entry mapped to the C99 thing that covers it.
- the five interop matrices, case for case: stream (11), datagram (8), GOAWAY/close/drain (10), CONNECT (9), malformed/flow (9);
- the two release checks, mirrored where packaging belongs --
check-package.shinstalls the tree and asserts the product list is the three tools and nothing that tests them; - QPACK post-Base ->
test_qpack_field_section; stream reset and stop-sending ->test_quic_stream; error mapping -> the flow matrices andtest_api_session; buffering -> the split-prefix scenario; the smoke matrix ->multi-session-isolationplus the two-process CLI tests; - the one real gap the walk found,
protocol-structured-fields, implemented and exercised end to end (WT-138).
Checked rather than remembered, because the claim rests on it: the Swift zero-rtt-settings rule is the one
entry with nothing to apply to. The early_data and pre_shared_key extensions are not implemented and not
exported -- tls/extension.h has said so since the TLS phase, they need the ticket machinery this tree does
not have -- so there are no remembered settings to reduce and no way to 0-RTT into a session. That is a
deliberate absence rather than a gap in an implemented feature, and the compliance matrix now records it as a
-- row beside server push, which is the same kind of statement.
Where a Swift assertion lives in its session MANAGER and here in the session OBJECT, the layer differs and the behaviour does not. The audit row says so rather than letting the difference read as coverage -- which is the distinction between counting a suite and mirroring one.
Score now: 7 of 9 criteria met, 1 partial (FreeBSD and Windows CI legs, WT-134), 1 not met (the five-implementation interop matrix, WT-135, which needs a host). The matrix is 25 of 25 draft-16 requirements exercised and 6 rows describing the lower layers. 85 CTest tests green in debug, release and ASan/UBSan; all six check scripts pass.
WT-134 (P2, c99, build, docs) -- the CI criterion is still partial, but the Windows leg stopped being a
document and became something a compiler checks. 00c6e56:
-
scripts/check-windows-platform.shcompilestests/windows/platform_probe.c-- a translation unit that names all six of the_WIN32branch's operations and the datagram structure -- with mingw-w64 and the same warnings-as-errors the POSIX build uses. No cross-compiler meansunsupportedwith that reason, like the IPv6 scenario, rather than a red check on a machine that could not have run it. CI installs one on both legs (macOSbrew, Debiangcc-mingw-w64-x86-64) and runs it. -
It found a real defect on its first run.
FIONBIOdoes not fit a signedlongon Windows (0x8004667Eis aboveLONG_MAX), so passing it toioctlsocketis a sign-conversion error; the cast the platform's own headers expect is now there. That is the difference between an inventory and a compiler, and it is the whole argument for checking a branch rather than describing it. -
The socket LIFETIME owns
WSAStartup:wt_udp_platform_acquireis called before the socket is made and released inwt_udp_close, counted by open sockets, so the last close releases Winsock and a failed open releases it too. POSIX has the same two calls as no-ops, soudp.cnames one lifetime instead of carrying an#if. -
The public handle is
intptr_t, withWT_UDP_INVALID_FDas(intptr_t)-1-- POSIX's-1and Windows'INVALID_SOCKETboth -- because aSOCKETis pointer-sized and anintfield would truncate it silently.CMakelinksws2_32, guarded byTARGETso either library may be built alone.
A correction to the previous round, recorded because the document said otherwise: "the socket is ONE
header" was too strong. The operations are there; the address layer is not. struct sockaddr_storage,
socklen_t, inet_pton, ntohs and the AF_INET* constants are about forty uses still spelled POSIX in
udp.c, and udp.c does not even compile for Windows yet (<arpa/inet.h>). The cross-compile is what made
that visible, and the address layer is the next step. The CI leg comes after it rather than before, because
a job that cannot pass teaches people to ignore CI.
85 CTest tests green in debug, release and ASan/UBSan; check-portability, check-matrix, check-vectors,
check-package and the new check-windows-platform all pass.
WT-134 (P2, c99, build, docs) -- the platform layer is now one header in fact rather than in intention, and
udp.c compiles for Windows under mingw-w64 with the same warnings-as-errors the POSIX build uses
(18e98df). The CI criterion is still partial -- there is no Windows runner -- but the difference between "a
Windows port is described" and "a Windows port compiles" is exactly this round.
What moved behind the header (all in src/runtime/udp_platform.h, one implementation per branch):
-
wt_udp_platform_address_to_storage/..._from_storage-- the two directions of the address conversion; -
wt_udp_platform_family_domain,..._parse_address,..._format_address--AF_INET/AF_INET6,inet_pton,inet_ntop; -
wt_udp_platform_set_v6_only-- the option whose value pointer differs (const void *againstconst char *); -
wt_udp_platform_status_of_error-- the error classification, not just the number.
udp.c now includes no socket header at all: struct sockaddr_in, socklen_t, htons, ntohs, inet_pton
and inet_ntop are the header's business, and udp.c speaks this library's own address type.
Four differences the inventory had NOT named, every one found by the compiler rather than by reading:
-
EHOSTDOWNdoes not exist on Windows at all, so the error classification has to be per platform -- one mapping with#ifs inside it could not compile; -
inet_ntoptakes asize_tthere and asocklen_there, so the capacity needed a platform name; -
setsockoptwantsconst char *for its option value there andconst void *here; - a
SOCKETis unsigned and pointer-sized, so storing it in theintptr_tfield takes an explicit cast.
And one mistake of this round's own, kept because it is the shape of the trap: the platform probe named only
the six operations, so as soon as the seven new helpers existed the cross-compile failed the whole header with
-Werror=unused-function. The probe now names every function the branch defines, which is what keeps the
next helper from being discovered by the next person to add one.
scripts/check-windows-platform.sh compiles the probe and udp.c, and reports "compiled, not run" -- the exact
claim. The Windows runner is still absent and deliberately so: a job that cannot pass teaches people to
ignore CI, and what it would need is a linked build (OpenSSL for Windows) plus a way to run the tests there.
The cross-compile is what makes that plausible rather than hopeful.
85 CTest tests green in debug, release and ASan/UBSan; check-portability, check-matrix, check-vectors,
check-package and check-windows-platform all pass.
WT-134 (P2, c99, build, docs) -- a4462a3. The cross-compile started as a check on the platform layer; it now
sweeps every source in the tree -- 72 in src/, 92 in tests/ and apps/ -- with the same
warnings-as-errors the POSIX build uses, and they all compile for Windows. That is the claim a Windows runner
needs before it is worth adding, and it is now measured rather than hoped for.
Two more real defects, both invisible to clang and found by GCC:
-
src/webtransport/capsule.chad four assignments to a localwt_webtransport_capsule_tthat nothing read, left over from a version that built one. clang's-Wunused-but-set-variabledoes not diagnose it; GCC's does, and the mingw compiler is a GCC. -
tests/unit/test_runtime_udp.ccompared the socket's handle field with-1-- right for a POSIX descriptor, a narrowing conversion for a pointer-sizedSOCKET. It assertsWT_UDP_INVALID_FDnow, the sentinel that is both.
And a lesson about ad-hoc loops: the first sweep reported eight "failures" that were nothing of the kind --
three main.c files missing -Iapps/support, the platform probe missing -Isrc/runtime, four test files
missing the WT_TRUST_FIXTURE_DIR define CMake supplies. The script passes all of them now, so a failure in it
is a real failure. A measurement that does not reproduce the build's own configuration measures the loop.
What a Windows runner still needs is narrow and named: a linked build (OpenSSL for Windows) and a way to run the tests there. The part that could be verified from this machine -- that the tree compiles for the platform -- is verified, and it is the part that would otherwise have been discovered by a red CI job.
85 CTest tests green in debug, release and ASan/UBSan; all seven check scripts pass.
WT-134 (P2, c99, build, docs) -- e130d53. The cross-compile proved the tree compiles for Windows; this
round proves it links. With a mingw toolchain and a Windows OpenSSL the whole tree configures and builds into
84 PE32+ executables and libwebtransport.dll. Not run -- that needs Windows or Wine -- but linked, which is
the step a Windows runner needs before it is worth adding.
-
cmake/toolchains/mingw-w64.cmake-- the cross toolchain file, with the threeONLYmodes that keep CMake from finding the HOST's OpenSSL and linking a Mach-O library into a PE image; -
scripts/check-windows-build.sh-- finds the compiler and a Windows OpenSSL (WT_WINDOWS_OPENSSL), configures, builds, and reports what it linked. No compiler or no Windows OpenSSL meansunsupportedwith the one command that would provide it, not a failure; -
CI runs it on the legs it already has: the MSYS2 OpenSSL package is a plain tarball
(
curl+zstd+tar), so verifying a Windows build needs no Windows runner and no MSYS2 installation.
The link found a defect the compile could not, and it is the kind only an optimiser sees. In a Release build
GCC could not prove that the loop writing compression_methods[i] from the peer's compression-methods length
stayed inside compression_methods[4], and said so with -Wstringop-overflow. An explicit bound check did not
satisfy it, because the index came from a struct member -- and the right answer was to stop describing generality
the message does not have: a TLS 1.3 ClientHello's vector is one byte, so src/tls/handshake.c now writes
compression_methods[0] by index, which is both inside the table and what RFC 8446 section 4.1.2 says. clang's
optimiser had never complained, in any configuration.
One process note. The first version of that commit message lost three identifiers to shell backtick
substitution. It was repaired with a --force-with-lease amend seconds after the push rather than left garbled:
a project whose discipline is accurate records cannot keep a message that says "the loop writing" and then
nothing. --force-with-lease (not --force) is what makes that safe when the push is one's own and one push
old.
85 CTest tests green in debug, release and ASan/UBSan on the host; the Windows compile and link checks pass.
Addendum: --help told the truth about a tool that no longer existed, and the interop path opened (WT-139, WT-135)
WT-139 (P2, c99, cli, docs) -- CLOSED at d816f2d. All three tools printed this for several phases after
they started driving real sessions:
"the tool does not yet drive a session over a socket: that wiring is the rest of Phase 9. It exits 3 rather than 0 so a script cannot read this as a successful run."
while wt_cli_session_stream and wt_cli_session_datagram passed twice a minute. A user reading --help was
told the tool could not do the thing it does. Each tool now says what it does -- connect and exchange, listen and
serve, or run the scenario suites with their exit codes -- in its own words.
scripts/check-cli-contract.sh asserts the phrase rather than the wording: every tool's --help must exit 0
and must not contain "does not yet", so a future tool cannot reintroduce the claim that it is unimplemented. That
is the check that would have caught this one, and it is now the check that keeps it caught.
WT-135 (P1/P2, c99, interop) -- the path to evidence opened this round, and the first attempt is
recorded rather than claimed. Docker is available on the development machine, and the Swift tree already
carries the containerized peers the VPS matrix normally uses (Swift/interop-docker/{pywebtransport,quinn,quiche}).
So the five-implementation matrix's "needs a host" is not the whole story: three of its peers can be built and run
locally, which is what run-docker-interop.sh exists for on the Swift side.
What was done: built wt-interop-pywebtransport (python:3.12-slim + pywebtransport==0.1.2 + aioquic==1.3.0)
and ran it on 54001. It starts, generates a self-signed certificate and listens.
What happened when the C99 client was pointed at it:
wt-client-c99 --connect 127.0.0.1:54001 --trust local-development --exchange stream --json
{"role":"client","status":"timeout","established":false,"connectAccepted":false,...}
The client reached the socket, waited its five seconds, and reported timeout -- and the server logged
nothing at all, not even a rejected handshake. So this is a first measurement, not an interop claim: either
the Initial is being dropped (ALPN, QUIC version, transport parameters) or the client's datagrams are not
leaving. The next step is the one this project always takes with a silent peer: capture what the client sends,
compare it against what the local C99 server accepts (where the same client works), and let the difference name
the cause -- a containerized peer is a faster loop than a VPS, and that is the point of having done this.
Nothing about WT-135 is claimed as met. What changed is that "needs a host" is now "needs a diagnosis".
85 CTest tests green in debug, release and ASan/UBSan; all check scripts pass; the container was stopped after the measurement.
Addendum: interop found a real protocol bug -- the missing initial_source_connection_id (WT-141, WT-140, WT-135)
WT-135 (P1, c99, interop) -- the first third-party handshake ran, and the peer named the defect. Two harness mistakes had to be fixed before anything could be measured, and both are worth writing down because they looked like a silent peer:
-
docker run -p 54001:54001publishes TCP. A UDP peer needs-p 54001:54001/udp. Without it the container'sUdp: InDatagramscounter stayed at 0 while the client waited -- so the first "the server logs nothing" measurement was the harness, not the implementation. With/udpthe counter moves. - The C99 client's own timeout was four times the flag (below), which made a five-second wait look like a hang.
And then the actual finding, from pywebtransport/aioquic's log:
Connection close sent (code 0x8, reason initial_source_connection_id does not match)
0x8 is TRANSPORT_PARAMETER_ERROR. RFC 9000 section 7.3 requires a client to send the
initial_source_connection_id transport parameter set to the Source Connection ID it used in its Initial
packets, and src/quic/transport_parameters.c knows the parameter's ID and its NAME -- 0x0f is defined, the
decoder has a string for it -- but nothing in the endpoint sends it. A missing parameter is a mismatch to a
strict peer, which is what aioquic is.
This is what the interop criterion is for. The C99 client and the C99 server agree with each other because
they share the omission: wt_cli_session_stream, wt_cli_session_datagram and the two session scenarios all
pass. Only an implementation this project shares no code with could name it, and it did so on the first
handshake that reached one.
WT-140 (P2, c99, cli, tests) -- CLOSED at e330136. The CLI's deadline was arithmetic dressed as a
timeout: deadline_rounds = timeout_ms * 2U + 100U rounds, where each round waits 2000 microseconds -- so "two
rounds per millisecond" is four times the timeout asked for, and the server's peer-discovery loop (5000 rounds
at ten times the interval) was a hundred seconds whatever --timeout-ms said. The rounds are now derived
from the interval they are counted in (WT_LOOP_ROUNDS_FOR, WT_LOOP_PEEK_ROUNDS_FOR), measured after the
change at six seconds for --timeout-ms 5000, with the three CLI session tests still green.
WT-141 (P1, c99, quic, interop) -- OPEN, and the next task: send initial_source_connection_id in the
endpoint's transport parameters (the client's own Source Connection ID; a server's is its own plus the
original_destination_connection_id it received), with a unit test that the parameter is present and equal to
the SCID in the Initial, and then re-run the containerized handshake. The Swift side is the reference for what a
strict peer expects.
85 CTest tests green in debug, release and ASan/UBSan; all check scripts pass; the container was stopped after the measurement.
Addendum: WT-141 closed -- the peer stopped refusing, and the next difference is TLS (WT-141, WT-135)
WT-141 (P1, c99, quic, interop) -- CLOSED at 7fbc72e. The parameter a third-party peer named is sent now,
and the peer's own log is the evidence:
before: Connection close sent (code 0x8, reason initial_source_connection_id does not match)
after: Negotiated protocol version 0x00000001 (VERSION_1)
Accepting incoming connection
New connection accepted: conn_15785690-06c5-42d0-96d8-1a4d9197b03a
The fix is one owner rather than two patches. wt_quic_transport_parameters_build(params, is_server, scid, len, odcid, len) adds what RFC 9000 section 7.3 requires -- a client's own Source Connection ID; a server's own
plus the Destination Connection ID the client's first Initial carried -- and the limits this library
advertises, so the two callers cannot drift about those either. is_server is explicit rather than inferred from
a NULL, and a server that cannot say which connection ID it was addressed by is refused here rather than sending
a list a peer would close over.
-
session_loop.candscenario_session.ccall it; the scenario keeps two lists, because the two sides do not send the same parameters. One buffer for both was the shape that made the omission invisible. -
test_quic_transport_parametersasserts the parameter is present and equal to the SCID, that a server's original destination is the client's ID and not its own, and that both refusals hold: 144 checks, up from 128.
This is the first defect in the protocol layers that only a foreign implementation could find. Every test in this tree passed with the parameter missing -- 80,000 checks, the conformance tool's 46 scenarios, two real sessions over IPv4 and IPv6 -- because the peer on the other end was this same code and shared the omission. The interop criterion's whole justification is that sentence.
WT-135 (P1, c99, interop) -- still OPEN, and now diagnosable rather than blocked. The client still
reports timeout against the container, so the handshake does not complete, and the difference is now inside
TLS rather than in a connection the peer refuses before TLS begins. The loop that produced this result is worth
keeping: -p <port>:<port>/udp (not TCP), --timeout-ms meaning what it says (WT-140), the peer's own log as
the oracle, and one difference at a time.
85 CTest tests, 79 unit suites, 80,172 checks, green in debug, release and ASan/UBSan; the Windows compile and link checks still pass; the container was stopped after the measurement.
Addendum: the interop handshake exchanges packets on both sides, and the client still does not complete it (WT-135)
WT-135 (P1, c99, interop) -- the measurement after 7fbc72e, taken with the container's own UDP counters
rather than by inference:
container udp in: 0 -> 6 ; out: 0 -> 6
client: timeout, response 0, received 0 byte(s) on a stream
Six datagrams in and six out. So this is no longer "the peer refuses our connection" (WT-141, closed) and no
longer "our packets never arrive" (the /udp harness mistake): the QUIC layer on both sides is exchanging, the
peer accepted the connection and negotiated version 1, and the client still reports timeout with nothing
received "on a stream". The difference is inside the handshake -- TLS, or our handling of the server's coalesced
Initial+Handshake datagrams -- and the peer's log says nothing at INFO level, because aioquic logs handshake
progress at DEBUG.
The next task is therefore an ORACLE, not a guess. The library already keeps the state a diagnosis needs --
wt_runtime_session has receive_errors and first_receive_error, and the API layer has
wt_session_last_error -- and none of it reaches the CLI's output, which reports only status, established
and the exchange counters. A client that can say "the handshake failed with WT_ERR_PROTOCOL from the TLS layer"
turns a silent timeout into a named difference, and that is the next change: report the first error in the CLI's
result (and its JSON), then re-run this handshake.
Worth keeping about the loop: three rounds of interop work have produced three findings, and each was invisible to every test in this tree -- a missing transport parameter (a peer refused the connection), a timeout four times the flag (the harness looked broken), and now a handshake that exchanges packets without completing (it looked like a hang). The oracle is what turns the fourth into a cause.
The oracle landed (a9c631a) and its first reading changes the diagnosis: the client records ZERO receive
errors against the peer. So the server's six answers are not being REFUSED by a sink -- the handshake is
STALLING, not failing, which is a different class of cause (a packet this endpoint silently ignores, a coalesced
Initial+Handshake datagram, or a state machine waiting for something it should already have consumed). The CLI
now carries first_receive_error and receive_errors out of the runtime session into both outputs, because a
tool whose only failure word is "timeout" cannot tell "the peer never answered" from "the peer answered with
something this endpoint refused" from "the peer answered and this endpoint did not consume it".
The container was stopped after the measurement. 85 CTest tests, 80,172 checks, green in all three configurations.
WT-135 (P1, c99, interop) -- a978d1c adds two fields to the CLI's oracle (packets_seen, last_receive)
and the stall has an answer, in the tool's own words:
client: timeout, response 0, received 0 byte(s) on a stream
client: the connection saw 0 packet(s); its last receive said ok
Zero packets, while the container's own counter reported six datagrams out. So the client's socket never received the peer's answers at all: the receive path is not stalling, it is never given anything -- and the same client against the C99 server receives fine. The loss is the reply path from the container back to a host socket on an ephemeral port: Docker Desktop's UDP publishing forwards inbound datagrams, and the container's answers do not return to a host-initiated flow. That is a harness limitation, not a defect in this tree.
An oracle is what kept this from being misread. Two rounds ago the same silence meant "the peer refuses our
connection" (WT-141, real bug, fixed); one round ago it meant "the handshake stalls" (a different class); now it
means "nothing arrived, and the harness is why". Without packets_seen and the receive error surface, all three
would have looked like the same timeout -- and the last one would have been chased in the QUIC parser for a
round or two.
The next step is the harness, and it is small: put the client where the server is -- a C99 client container on the same Docker network, connecting to the peer by service name -- so no NAT is involved in either direction. That is also how a Linux CI job would run interop, and the C99 tree already builds on Debian, so the image is a Dockerfile and one script rather than a port.
85 CTest tests green in debug, release and ASan/UBSan; the container was stopped after the measurement.
WT-135 (P1, c99, interop) -- OPEN, with the harness solved and the difference now down to the protocol.
4d4cf75 adds the second half of the interop loop:
-
C99/tests/interop/client/Dockerfile-- the C99 tools built ondebian:stable-slim. The tree already builds there, so interop on Linux is a Dockerfile rather than a port, and a CI job could run the same thing. -
C99/scripts/run-container-interop.sh-- builds a peer from the Swift tree'sinterop-dockercontexts, starts it on a private network, runs the client against it, and prints both sides' logs. One command per peer.
The first run found a policy doing its job. --trust local-development refused to bypass certificate
verification for a non-loopback address -- "the development bypass is refused for a non-loopback address" -- which
is exactly right for a flag whose name says local. So the client joins the peer's network namespace rather
than sitting beside it: the peer becomes 127.0.0.1, no NAT is involved in either direction, and the address on
the command line is the loopback one a developer would use anyway.
With the harness out of the way the symptom is precise, and it is not a NAT artefact:
client: timeout, response 0, received 0 byte(s) on a stream
client: the connection saw 0 packet(s); its last receive said ok
peer: Negotiated protocol version 0x00000001 (VERSION_1)
Accepting incoming connection
New connection accepted: conn_221d5883-...
The peer processes the client's Initial; the client's socket sees nothing, and last receive said ok means
the receive call found the socket empty rather than failing. So the next question is a measurement, not a guess:
does the peer actually send in that namespace (its own OutDatagrams counter answers it), and if it does,
where between its socket and ours the datagram goes. The loop for that is one command now.
Nothing about the interop criterion is claimed as met. What changed is that the difference is protocol-shaped rather than harness-shaped, which is the state a diagnosis needs.
WT-135 (P1, c99, interop) -- cfe36c7 corrects the previous round and changes the diagnosis back. Both were
found by measurement, not by reading, and the correction is the more useful half.
What the capture says. tcpdump -i any inside the peer's network namespace, while the client ran:
lo In IP 127.0.0.1.51890 > 127.0.0.1.54001: UDP, length 1200 client Initial
lo In IP 127.0.0.1.54001 > 127.0.0.1.51890: UDP, length 1200 peer Initial
lo In IP 127.0.0.1.54001 > 127.0.0.1.51890: UDP, length 341 peer Handshake
lo In IP 127.0.0.1.51890 > 127.0.0.1.54001: UDP, length 1200 client again
... the peer retransmitting 1200 + 198, five times ...
peer: "Duplicate CRYPTO data received for epoch Epoch.INITIAL"
So the datagrams arrive in both directions and the peer keeps retransmitting because it never gets what it expects. The previous round's "the connection saw 0 packets" could not have been about the network -- and it was not:
The oracle's fields were set in the SERVER's failure paths only. A client run printed zeroes that were defaults, and a conclusion ("the handshake stalls, nothing was refused") was drawn from them. With the client's own failure paths instrumented, the same handshake says:
{"status":"timeout","firstReceiveError":"protocol","receiveErrors":11,"packetsSeen":4,"lastReceive":"again"}WT_ERR_PROTOCOL, eleven times, over four packets. The client IS refusing what the peer sends, at the
protocol layer -- a different starting point from the one the wrong reading gave, and one that fits the peer's
"Duplicate CRYPTO data received for epoch Epoch.INITIAL": our CRYPTO frames and acknowledgements are not doing
what aioquic expects.
The lesson, in the form this project keeps meeting it: a counter that is never written reads exactly like a counter that measured zero. The oracle is only an oracle once it is on the path that runs -- and the way that was caught was a packet capture, which is external to every belief the code holds.
Next: name the protocol rule the client rejects in the peer's Initial/Handshake. The candidates are the ones
wt_quic_transport_parameters_check refuses (it has four WT_ERR_PROTOCOL paths) and the packet-level checks in
the receive loop; the CRYPTO-duplicate line points at the Initial epoch, so the parameter list is where to look
first -- with the peer's bytes in hand, from the capture, and the oracle on the right path to say which rule
fired.
85 CTest tests green in debug, release and ASan/UBSan; all check scripts pass; containers cleaned up.
WT-135 (P1, c99, interop) -- 973d3c5-era work (this round) extended the oracle with the four fields that
would let a refusal name its rule: close_code, close_frame_type, close_code_set, peer_error_code,
peer_closed, taken from the connection that records them. The interop run is informative exactly because they
stay EMPTY:
- the client's
WT_ERR_PROTOCOLis a parse-level refusal that never sets a close code; - the peer never sends
CONNECTION_CLOSEeither.
So there is no rule number to read: the refusal happens before the layer that names rules. That rules out (for
now) the four WT_ERR_PROTOCOL paths in wt_quic_transport_parameters_check as the primary suspect and points
at the packet/CRYPTO parse path in the receive loop.
And the symptom is nondeterministic, shown by three consecutive runs against the same peer:
run 1: first=protocol errors=11 packets=3
run 2: first=ok errors=0 packets=0
run 3: first=ok errors=0 packets=0
When the client receives anything it refuses it with a parse error; when it receives nothing, its receive call finds the socket empty while the peer is answering. Two modes from one handshake is a timing shape rather than two bugs -- and it is the shape a receiver shows when it processes a packet before the state that packet depends on is ready, or when a parse failure is swallowed for one packet and reported for the next.
Next: capture the peer's bytes to a pcap and feed them to the client's parse path one packet at a time, which
turns a timing-dependent refusal into a deterministic one, and read the check that returns WT_ERR_PROTOCOL.
The capture harness from last round is one command.
85 CTest tests green in debug, release and ASan/UBSan; containers cleaned up after the measurement.
Addendum: the client discards most of what it sees, which is a key problem and not a parser one (WT-135)
WT-135 (P1, c99, interop) -- the oracle reports discarded packets now, and the two are different failures with different fixes:
run 1: seen=6 discarded=2
run 2: seen=3 discarded=3
The receive loop discards a packet it cannot act on -- a key level this endpoint does not have yet, an unauthenticated packet, a 0-RTT or Retry packet, a too-short Initial -- and refuses one it can decrypt but will not accept. Run 2 discarded everything it saw.
That is the shape of a client that has not installed the Handshake keys the peer's packets need, which moves
the question away from "which parser check fires" and onto "does this endpoint's own handshake advance":
process_packet on the peer's Initial must deliver the ServerHello to the TLS layer, and the TLS layer must
derive the Handshake secrets. If it does not, the peer's Handshake packets are correctly discarded, the peer
retransmits forever (its log says exactly that: Duplicate CRYPTO data received for epoch Epoch.INITIAL), and
the client's WT_ERR_PROTOCOL refusals are the Initial-epoch packets whose CRYPTO it is re-processing.
Next, and it is one field rather than one guess: report whether keys are installed per packet-number space (and, if the runtime knows it, the TLS handshake state), which says in one line whether the client is stuck before or after the ServerHello. The peer's "duplicate CRYPTO for epoch INITIAL" line is the corroboration: the client is re-sending Initial CRYPTO because it never processed what came back.
85 CTest tests green in debug, release and ASan/UBSan; containers cleaned up after the measurement.
Addendum: the client derives Handshake and Application keys -- and the handshake state says idle (WT-135)
WT-135 (P1, c99, interop) -- the oracle now reports the receive keys per packet-number space and the handshake state, and its first readings refute last round's hypothesis, which is exactly what it is for:
run A: seen=6 discarded=2 keys initial=no handshake=yes application=yes
run B: seen=2 discarded=2 keys initial=yes handshake=yes application=no
run C: seen=0 discarded=0 keys initial=yes handshake=no application=no
Last round read "discarding most of what it sees" as a client without Handshake keys. Run A is the opposite: this client derives Handshake and Application secrets, so it processes the ServerHello, installs 1-RTT keys, and still never becomes established. The stall is therefore after the key schedule, not before it, and the discards are not "keys we never installed".
Two further facts matter more than the hypothesis they replace:
- The shapes differ between runs against the same peer (three shapes in five runs). That is a timing shape in this endpoint, not a fixed protocol mismatch -- and it is why single-run conclusions have been wrong twice.
-
The handshake state reads
idlein every run, including run A where Initial keys are gone because Handshake and Application keys exist, and run C where Initial keys are present. Those cannot both describe the same state machine.session->handshakeIS used (the runtime drives it throughwt_quic_handshake_on_frameand..._on_lost), so the question is wherestateis set -- or not set -- on the path the runtime takes. That is a question for the library, not for the peer, and it is the next thing to answer: it is also the kind of inconsistency that would explain a handshake that installs keys and never reports CONNECTED.
85 CTest tests green in debug, release and ASan/UBSan; containers cleaned up after the measurements.
WT-135 (P1, c99, interop) -- ad1c8b0-era work. The handshake-state question was answered by first finding
that my own oracle was wrong twice:
- the assignments sat after
wt_runtime_session_clear, so the handshake state was read from a cleared struct -- which is why it saididlein every run, including runs where Initial keys were gone because Handshake and Application keys existed; - the patch that inserted them had iterated over a list it was growing, so some failure paths carried the block twice.
Both are gone: one record_oracle(loop, out) helper, called immediately before every clear, with the reason
in its comment. That is the third time in this interop work that the instrumentation, not the peer, was the
thing at fault -- "a counter that is never written reads like a counter that measured zero", and now "a field
read after the struct was cleared reads like a state machine that never moved".
The corrected reading is the finding:
run 1: state=connected keys handshake+application seen=6 disc=2
run 2: state=client-waiting keys initial+handshake firstError=protocol errors=13
Run 1 reaches CONNECTED with 1-RTT keys installed, and the session still reports established=false after its
timeout. So the handshake completes and the session does not. That is a question about
wt_runtime_session_established and what it waits for -- a client is confirmed by the peer's HANDSHAKE_DONE,
and session->handshake.confirmed is what the accessor reads -- rather than about the peer, the network or the
parser. Run 2 shows the other shape (mid-handshake, a parse refusal), which is the nondeterminism recorded two
rounds ago.
Next: read what wt_runtime_session_established requires and whether confirmed is ever set on this path,
then compare that against what aioquic sends after its handshake completes. The peer's log lines and the capture
harness are both one command away.
85 CTest tests green in debug, release and ASan/UBSan; containers cleaned up.
WT-135 (P1, c99, interop) -- the previous round ended with "run 1 reaches CONNECTED and still reports established=false", and the obvious alternative explanation was a race with the deadline: the handshake completes during the last pump, so the loop exits before it can notice. That explanation is wrong, and one run says so:
--timeout-ms 20000
{"status":"timeout","established":false,"firstReceiveError":"ok","receiveErrors":0,
"packetsSeen":6,"packetsDiscarded":2,
"keys":{"initial":false,"handshake":true,"application":true},"handshakeState":"connected"}
Twenty seconds, no receive errors at all, the handshake state CONNECTED, Handshake and Application keys
installed -- and established still false. So the handshake completes and stays complete, and the session never
becomes established. wt_runtime_session_established is session->handshake.confirmed, and confirmed is set in
exactly two places in src/quic/handshake.c: in the client's handling of a received HANDSHAKE_DONE frame, and
on the server's own completion. So the client never processes a HANDSHAKE_DONE.
Two questions follow, and they are different questions:
- Does aioquic send one? A server sends HANDSHAKE_DONE when its handshake is confirmed, and the peer's log shows it accepted the connection. It should -- unless it never considered its own handshake confirmed, which would itself be a consequence of what it receives from us.
-
Would we process it if it did? The frame type is implemented (
WT_QUIC_FRAME_HANDSHAKE_DONE, 0x1e, withhandshake_done_pendingand theconfirmedtransition), and this run discarded 2 of 6 packets -- so a HANDSHAKE_DONE inside a discarded datagram is a candidate.
And one design question the run exposes: a QUIC client may send 1-RTT data as soon as its handshake COMPLETES;
it does not need confirmation (RFC 9000 section 7: a client's handshake is confirmed by HANDSHAKE_DONE, which
matters for discarding Handshake keys, not for being allowed to talk). The CLI's loop waits for
wt_runtime_session_established -- the CONFIRMED state -- before it sends its CONNECT, so a peer that is slow to
confirm, or that never does, stalls a session that is perfectly able to proceed. That is worth separating whether
or not it turns out to be the interop cause: the tool should distinguish "the handshake is done" from "the
handshake is confirmed".
Nothing is claimed as met; what changed is that the question is now about one frame and one accessor rather than about the peer's packets in general.
Addendum: the peer DOES confirm us -- and the change that showed it needs both ends at once (WT-135, WT-142)
WT-135 (P1, c99, interop) -- the question from last round is answered, and by experiment: aioquic does send HANDSHAKE_DONE and this client does process it. The proof is what appeared when the client stopped waiting for confirmation before it was willing to speak:
{"status":"timeout","established":true,"connectAccepted":false,"receivedBytes":0,
"firstReceiveError":"ok","receiveErrors":0,"packetsSeen":8,"packetsDiscarded":3,
"keys":{"initial":false,"handshake":true,"application":true},"handshakeState":"connected"}"established":true -- the session reached the CONFIRMED state against a foreign implementation for the first
time. So the previous round's "CONNECTED and never confirmed, even with twenty seconds" was not a missing or
dropped frame: the client was sitting in its handshake loop waiting for confirmation before doing anything,
and its own progress was what the confirmation depended on. A QUIC client may send 1-RTT data as soon as its
handshake completes (RFC 9000 section 7 makes confirmation about discarding Handshake keys, not permission to
speak), and the loop did not allow that.
WT-142 (P2, c99, cli, runtime, tests) -- OPEN, scoped by this round's failure. The one-sided version of
that change (the CLI's client loop waiting for wt_quic_handshake_is_connected instead of
wt_runtime_session_established) made the interop session reach CONFIRMED but broke the local pair: the three
CLI session tests stalled for their full timeout, because the C99 server's own readiness notion still waits for its
completion state, so the client's CONNECT arrives before the server is in its serving loop. The change was
reverted rather than left half-applied, and the tree is exactly as committed (git diff empty) with 85 CTest
tests green in all three configurations.
The task is therefore not "make the client stop waiting" but "separate handshake-done from confirmed, in the runtime's accessors and in both tools, in one pass, with the three CLI session tests in the loop" -- which is what this project's own rule says about a change that reaches several call sites.
One more observation worth keeping: while the scratch build directory was under load from parallel container
builds, wt_cli_session_datagram stalled to its 13-second timeout while wt_cli_session_stream passed, and both
were green again in the scripted build. The CLI session tests are timing-sensitive under CPU contention, which is
worth knowing before reading a single red run as a defect -- and is itself a reason the readiness notions should be
explicit rather than emergent.
WT-142 (P2, c99, cli, runtime, tests) -- first step CLOSED at the commit that added
wt_runtime_session_handshake_done. The interop rounds established the distinction the hard way: a client that
waits for CONFIRMATION before speaking stalls a session that is entirely able to proceed, because a QUIC client
may send 1-RTT data as soon as its handshake is DONE, and confirmation (the server's HANDSHAKE_DONE) is about
discarding the Handshake keys (RFC 9000 section 7).
-
wt_runtime_session_handshake_done-- the handshake's CONNECTED state: both Finished messages in, 1-RTT keys installed, this endpoint may speak. -
wt_runtime_session_established-- unchanged: the CONFIRMED state, which is what every existing caller and test already meant by it. No call site changes meaning, which is why this lands on its own. -
test_runtime_session_pairasserts both, against a real loopback handshake where the server sends the HANDSHAKE_DONE that confirms the client -- so the distinction is tested where both values are TRUE rather than only where one is false. 104 checks; the suite is 80,174.
What is left, and why it is one pass: moving the CLI's loops onto the DONE state is the change that made the interop session reach CONFIRMED and broke the local pair, because the C99 server's readiness notion still waits for its own completion state. Both tools and the three CLI session tests have to move together -- the project's own rule about a change that reaches several call sites -- and the accessor is what makes that pass expressible rather than a matter of guessing which end is early.
And one process note: this round's first attempt to add the accessor reported success while the
implementation did not reach session.c, and the missing symbol only appeared at LINK time. The lesson is the
same one this interop work keeps producing: a script's own report is not evidence. The verification was the link
error and then a clean three-configuration run.
85 CTest tests green in debug, release and ASan/UBSan; check-matrix and check-portability pass.
WT-142 (P2, c99, cli, runtime, tests) -- still OPEN, and narrower. The accessor landed last round
(wt_runtime_session_handshake_done). This round attempted the pass it exists for: move both tools' handshake
loops from the CONFIRMED state to the DONE state, in one pass, with the three CLI session tests in the loop.
It failed, and the failure is informative. All three CLI session tests fail with both ends on DONE, exactly as they did with only the client moved -- so the earlier explanation ("the server was still waiting for its own completion state") was wrong, and the cause is not which end is early.
What the shape points at, and what the next diagnosis must confirm with both sides' oracles rather than by reasoning:
- a QUIC client may send 1-RTT data as soon as its handshake is DONE -- the server, however, installs application keys only when it processes the client's Finished, which is one flight later;
- so the client's CONNECT is sent while the server still cannot read it, and the server discards it (correctly: a packet for a key level it does not have);
- the exchange then depends on the client retransmitting that 1-RTT stream data (QUIC's loss recovery), and the tool's loop drives a simulated clock in 2 ms rounds, so whether the PTO ever fires is the question.
The change was reverted, again rather than left half-applied: git diff is empty and 85 CTest tests pass in
all three configurations. That is twice this specific change has been rejected by the local pair, which is the
tests doing their job -- the interop peer wanted it, and the pair says the runtime is not ready for it.
The next step is a measurement, not another edit: run the local pair with the DONE loops and read BOTH sides'
oracles (the client's and the server's packets_discarded, keys and state), to see whether the server discards the
CONNECT and whether the client ever retransmits it. If the answer is "the server discards and nothing
retransmits", the task is in the runtime's loss recovery for 1-RTT data, not in the CLI at all -- and the
interop work has found its next real defect.
85 CTest tests green in debug, release and ASan/UBSan; the tree is exactly as committed.
WT-142 (P2, c99, cli, runtime, tests) -- CLOSED at b97116a. The change that was rejected twice passes
now, because the third attempt has the half the first two were missing, and the measurement this round is what
named it:
with the loops on DONE alone:
{"status":"state","established":true,...,"keys":{"handshake":true,"application":true},"handshakeState":"connected"}
The handshake was complete and CONFIRMED, and the CONNECT start was refused with WT_ERR_STATE -- because
opening a request stream needs the peer's TRANSPORT PARAMETERS, which arrive in the same flight as the Finished
and are applied by the NEXT pump. Breaking out of the loop on DONE alone left the loop before that pump ran, so
the tool tried to open a stream with no limits in force. My previous explanation (a missing 1-RTT retransmission)
was wrong, and the oracle is what showed it -- the third time in this interop work that a reading replaced a
guess, and the second time my own instrumentation had been part of the problem.
The predicate is both halves: handshake DONE and the peer's parameters in force. One helper, four call sites, and the three CLI session tests pass -- along with the whole suite in all three configurations.
What it buys, measured against the third-party peer: the same run is now established:true with the CONNECT
SENT, where before it sat in its handshake loop until the timeout:
{"status":"timeout","established":true,"connectAccepted":false,"packetsSeen":8,"packetsDiscarded":3,
"firstReceiveError":"ok","receiveErrors":0,
"keys":{"initial":false,"handshake":true,"application":true},"handshakeState":"connected"}
connectAccepted is still false, and the peer's log says nothing beyond "New connection accepted" -- so the next
question is what aioquic does with our HTTP/3 request, and the first step is making the peer talk: the container's
log level, or a capture of what we send after the handshake, both of which the harness from two rounds ago can do
in one command.
85 CTest tests green in debug, release and ASan/UBSan; containers cleaned up.
WT-135 (P1, c99, interop) -- WT_INTEROP_CAPTURE=1 runs a tcpdump sidecar inside the peer's network namespace
while the client runs, and what it recorded is the sharpest statement of the interop problem so far:
client -> peer: Initial 1200, then a burst of SMALL packets (46, 80, 46, 37, 30, 30, 121, 34, 48)
peer -> client: Initial 1200 + Handshake 336, RETRANSMITTED twice, then 342
The peer keeps retransmitting its Handshake flight -- which a QUIC endpoint only does when it has not received
an acceptable acknowledgement of it -- while our client reports "handshakeState":"connected" with Handshake and
Application keys installed. So the two ends disagree about whether the handshake is complete, and the
disagreement is about our Handshake-space acknowledgement (or about what the peer makes of it). It is not
about the CONNECT, and not about keys: the peer never gets far enough to read an HTTP/3 request.
That reframes the question from "what does aioquic do with our HTTP/3 request" to "why does aioquic not accept our
acknowledgement of its Handshake packets". The next step is to decode the small packets the client sends after the
Initial -- are they ACK frames, in which packet-number space, and do the packet numbers they name match what the
peer actually sent -- which the same capture answers with tcpdump -v, or by feeding the pcap to this tree's own
packet reader.
The harness mode is committed, so the next round starts with the pcap rather than with a guess. 85 CTest tests green in debug, release and ASan/UBSan; the C99 pair is unaffected; containers cleaned up.
Addendum: the retransmissions were pre-ACK and stopped -- the question moves past the handshake (WT-135)
WT-135 (P1, c99, interop) -- a correction to the previous round's reading, from the code and the capture together.
The code says both ends discard the Handshake keys at the RFC's moment: a server when it verifies the client's
Finished, a client when it receives HANDSHAKE_DONE (src/quic/handshake.c, the two
wt_quic_connection_discard_keys(..., WT_QUIC_SPACE_HANDSHAKE) calls). wt_quic_connection_flush sends for every
packet-number space, and the ACK sender only skips a space it has no OUTPUT keys for -- so "we stop acknowledging
the Handshake" would require us to have discarded those keys, which for a client happens only after
HANDSHAKE_DONE.
And the capture's own ordering says the client did receive one: the peer's retransmissions of 1200 + 336 are at
43.052 and 43.461, and the peer's next packet is a 342 at 44.264 -- the 1-RTT packet carrying
HANDSHAKE_DONE, after which our client reports established:true. So the retransmissions were the ordinary
"not acknowledged yet" behaviour, they stopped, and the handshake completed on both ends.
That moves the question to where it belongs: after the handshake. The client sent its CONNECT in the burst of
small packets (46, 80, 46, 37, 30, 30, 121, 34, 48), the peer sent nothing but HANDSHAKE_DONE, and the
exchange timed out with connectAccepted:false. So the next question is what aioquic makes of our HTTP/3 request
-- the control streams, the SETTINGS, the QPACK section -- and the next step is a capture that runs PAST the
handshake (the previous one was limited to 30 packets and ended on the peer's HANDSHAKE_DONE), plus the peer's
log at a level that says something about HTTP/3. Both are harness settings rather than code.
One process note worth keeping: the previous round's reading ("the two ends disagree about the handshake") was drawn from a capture cut off at the moment the disagreement would have resolved. A capture is evidence only about the window it covers -- the same lesson as the counter that is never written.
85 CTest tests green in debug, release and ASan/UBSan; containers cleaned up.
WT-135 (P1, c99, interop) -- with the capture length raised to 150 packets, the whole exchange is visible and it is short:
client -> peer Initial 1200
peer -> client Initial 1200 + Handshake 342
client -> peer a BURST of small 1-RTT packets: 46, 80, 46, 37, 30, 30, 121, 34
peer -> client 60 (an ACK)
peer -> client Initial 1200 + Handshake 336, retransmitted once
client -> peer 48 (the Handshake ACK)
peer -> client 1200 + 336
peer -> client 342 (1-RTT, carrying HANDSHAKE_DONE)
... and NOTHING from either side afterwards, for the remaining nine seconds
The CONNECT is sent before the peer can read it -- the client's burst of 1-RTT packets goes out at the moment
its own handshake completes, while the peer is still retransmitting its Handshake flight and has not installed
application keys. A QUIC endpoint discards a packet for a key level it does not have, so those packets are simply
lost. What should recover them is loss recovery, and nothing is retransmitted: no PTO, no ACK of the peer's
HANDSHAKE_DONE, no further packets at all.
Two candidate gaps, and they are different:
- the client does not ACK the 1-RTT packet carrying
HANDSHAKE_DONE(which is ack-eliciting), so the peer has no reason to believe we read it; - the client does not retransmit the 1-RTT stream data the peer could not read.
Both are in the runtime's application space. wt_runtime_session_pump does call
wt_quic_connection_on_timeout, so the timer is being asked -- which makes both gaps questions about what the
application space arms (ack-pending, the loss/PTO timer for that space) rather than about whether the loop
calls it. That is the next thing to read, and it is a library question with an interop measurement behind it.
And the correction from last round stands: the earlier "the two ends disagree about the handshake" came from a window that ended before the resolution, and the same capture at 150 packets shows the resolution.
85 CTest tests green in debug, release and ASan/UBSan; containers cleaned up.
WT-135 (P1, c99, interop) -- the two gaps from last round were "does the client ACK the 1-RTT packet that carried HANDSHAKE_DONE" and "does it retransmit the CONNECT the peer could not read". Reading the timer path answers the first half of that: the timer is not the problem.
wt_quic_connection_on_timeout is well formed and does both things:
- it walks every packet-number space and, for each with an expired ACK delay, calls
flush_space(..., force=1)-- so an owed acknowledgement goes out in the space that owes it; - it arms the PTO per space (only for spaces with OUTPUT keys) and flushes a probe in the earliest one.
wt_quic_connection_flush covers every space, and wt_runtime_session_pump calls on_timeout with the loop's
clock. So the silence after HANDSHAKE_DONE is upstream of the timer, and there are two candidate places, both
specific:
- the receive path may not be recording the application-space packet as ack-eliciting, so
ack_pendingis never set and no acknowledgement is ever owed (wt_quic_ack_recordis called afterprocess_packet-- the question is what it is passed for an application-space packet); - the send path may not be registering the 1-RTT stream frames for loss recovery, so nothing is outstanding
and the PTO never arms (
send_one_frameis where a sent frame is remembered).
And the test that would have caught either one does not exist, because the pair harness uses real loopback sockets and never loses a packet: the C99 pair's handshake is quick and lossless, so the two properties this interop run exercises -- "an ack-eliciting 1-RTT packet is acknowledged" and "an unacknowledged 1-RTT stream frame is retransmitted after the PTO" -- have never been asserted. A loss test needs a relay that drops one datagram in process (the CLI pair goes through a socket, so a shim is the shape), or a connection-level unit test that hands a connection crafted datagrams.
That is the next task, and it is a library task with an interop measurement behind it rather than a harness one: the finding is that this tree has no test for the obligations that only matter when a packet is LOST -- which is precisely the class of environment the interop criterion exists to reach.
85 CTest tests green in debug, release and ASan/UBSan.
WT-135 (P1, c99, interop) -- last round named two candidate places for the silence after HANDSHAKE_DONE.
Reading them clears both, which is worth as much as finding one:
-
receive:
wt_quic_ack_record(&connection->spaces[space].received, packet.packet_number, ack_eliciting)is called for every decrypted packet, andconnection->received_at[space] = nowis stamped right after -- so an ack-eliciting 1-RTT packet DOES setack_pendingand DOES start the acknowledgement delay. -
send:
send_one_frameregisters every packet withwt_quic_loss_on_sent, includingin_flight = 1and the packet's number space -- so a sent 1-RTT frame IS outstanding and the PTO has something to fire on.
With the timer path already read as correct (on_timeout forces expired acknowledgements per space and arms the
PTO per space), that leaves a conclusion of a different kind: the mechanism is written, the interop peer is the
first environment that exercises it, and this tree has no way to test it.
That is the structural gap, stated plainly: every test in this repository runs over loopback with no loss -- the pair harness uses two real sockets, the connection suite uses two real connections, and the interop harness loses nothing on purpose. So the obligations that only matter when a packet is LOST or DELAYED (an acknowledgement of an ack-eliciting 1-RTT packet; a PTO retransmission of unacknowledged 1-RTT stream data) have never been asserted anywhere, and the first environment that could show them up is a third-party peer that read our packets before it had the keys to read them.
The next task is therefore a harness, not a fix: a relay between two sockets that can DROP one datagram (and delay one), so that "the peer lost our packet and we retransmitted it" is a test the tree can run. Everything after that -- whether the application space really arms the PTO in that case -- is a question that harness can then answer with a counter instead of a capture.
85 CTest tests green in debug, release and ASan/UBSan; nothing in the tree changed this round, and the record is the result.
WT-135 (P1, c99, interop, tests) -- ed162b6. The structural gap named last round is closed: this tree can now
lose a packet on purpose, and it reproduces the interop stall with no container and no peer.
- a relay sits on a third socket between the two ends; both address it, it learns the client's address from the first packet that is not the server's, forwards in both directions, and drops ONE datagram when told to;
-
test_a_lost_packet_is_retransmittedruns the whole handshake through the relay, then drops the NEXT packet the client sends -- which is the CONNECT -- and asks whether the exchange completes anyway.
It does not. The client never retransmits, so the server waits for a request that will never arrive. That is the interop peer's stall, in one process, in 600 rounds, with no container and no third-party implementation -- and the same run also asserts the two facts either side of it (the handshake DID complete through the relay, and the drop DID happen), so a future pass cannot be a test that stopped testing.
The assertion is written in the direction that is true today:
WT_EXPECT_TRUE("the exchange did NOT complete, because the client never retransmitted (WT-135)",
connect_arrived(&pair) == 0);so the suite stays green while the reproduction stays in it. The line flips to connect_arrived(&pair) != 0 on
the day the retransmission lands -- and the next task now has a test that will fail for exactly the right reason
the moment it is written, which is what several rounds of captures were working toward.
Sequence worth keeping: the interop peer showed a stall -> captures narrowed it to "the CONNECT is sent before the peer can read it and is never resent" -> reading the timer, the receive path and the send path cleared all three as suspects -> and the conclusion was that the MECHANISM is written and has never been tested, because no test in the tree could lose a packet. Building that test came before touching the library, and it is what makes the next change verifiable rather than hopeful.
85 CTest tests green in debug, release and ASan/UBSan; 138 checks in this suite; 80,206 checks in the tree. The
commit message was repaired with a --force-with-lease amend seconds after the push, for the second time in this
interop work: backticked identifiers in a -m argument are shell command substitutions.
WT-135 (P1, c99, interop, quic) -- the deterministic test from last round localised the defect in one reading, and it is smaller and more serious than any of the four suspects:
/* src/runtime/session.c */
static void session_on_lost(void *context, const wt_quic_tx_frame_t *frame) {
...
wt_quic_handshake_on_lost(&session->handshake, frame); /* and nothing else */
}
/* src/quic/handshake.c */
void wt_quic_handshake_on_lost(void *context, const wt_quic_tx_frame_t *frame) {
...
if (!frame->is_crypto) return; /* <- here */A lost frame is reported to the handshake and to nobody else, and the handshake's handler returns immediately for anything that is not CRYPTO. So a lost STREAM frame -- which is what the HTTP/3 CONNECT travels in -- is dropped on the floor: no retransmission, no notification, nothing. That is the interop stall exactly, and it explains why the client's small 1-RTT burst went out once and was never seen again.
What the fix needs, and why it is not a one-liner:
- the runtime needs a lost-frame hook beside
wt_runtime_session_set_frame_handler(which is for RECEIVED frames --driver.hhas no loss entry point at all: the word does not appear in it); - the HTTP/3 driver needs to resend a stream range when told that the bytes at
offset/lengthin a space were lost, which means it must either retain what it sent or be able to rebuild it from its own state.
And the gate already exists: test_a_lost_packet_is_retransmitted fails the moment the retransmission is
missing and passes when it is there, with the drop and the handshake-completed facts asserted either side of it.
The assertion flips with the fix, which is what it was written for.
This is the fourth interop-only defect and the first one in the QUIC runtime's loss path -- found by a third-party peer, narrowed by captures, cleared of three suspects by reading, reproduced deterministically in one process, and now localised to an early return. Nothing about it was visible to 80,206 checks before this round, because none of them could lose a packet.
The tree is unchanged this round, and the record is the result.
WT-135 (P1, c99, quic, tests) -- two things this round, and the second is the finding.
Added: the lost-frame hook. wt_quic_connection_set_handlers takes a received-frame handler and a
lost-frame one; the runtime installed its own for both, and the lost one went to the handshake alone -- whose
handler returns immediately for anything that is not CRYPTO (if (!frame->is_crypto) return;). A lost STREAM frame
therefore reached nobody. wt_runtime_session_set_lost_frame_handler is that missing path, with the handshake
always told first because CRYPTO frames are its business whatever else is listening.
Found: the hook is never called. The relay test installs it on the client, drops the CONNECT packet -- and the hook does not fire. So the dropped frame is not merely unresendable: its loss is never reported at all. The probe timeout does not fire for the application space, which refutes the earlier reading ("the mechanism is written and has never been tested"): there is nothing to retransmit from, because nothing knows anything was lost.
Why this matters more than the first part: three rounds of reading had cleared the timer, the receive path and
the send path as suspects, and the conclusion was "untested mechanism". The deterministic test says otherwise, and
it says it in one process: the gap is in the in-flight ack-eliciting accounting for the client's 1-RTT packets,
which is what the probe timeout is armed from (wt_quic_loss_ack_eliciting_in_flight is the check at the top of
probe_time's path).
Both facts are in the test in the direction that is true today -- the drop happened, the handshake completed, the hook did not fire, the exchange did not complete -- so the suite stays green and the reproduction stays in it. Each line flips when the loss path works, and the next task is one question: why does a sent 1-RTT STREAM packet not count as an ack-eliciting packet in flight?
85 CTest tests green in debug, release and ASan/UBSan; 141 checks in this suite; 80,208 in the tree.
Addendum: the descriptor IS created -- so the loss is never declared, or is declared after it is gone (WT-135)
WT-135 (P1, c99, quic, interop) -- the question this round asked was "why does a sent 1-RTT STREAM packet not count as an ack-eliciting packet in flight", and the reading refines it rather than answering it:
-
wt_quic_connection_send_streamdoes request a retransmission descriptor:send_one_frame(..., has_descriptor=1, is_crypto=0, stream_id, offset, length, ...), with the comment that says exactly why -- "a descriptor, so a loss names the stream and the range to send again: the CALLER keeps the bytes -- this layer cannot, and should not -- and the lost handler hands the descriptor back to it". So the design is right and the descriptor exists. -
on_lostreports a packet's frame only whentag < WT_QUIC_CONNECTION_FRAMES_MAX && connection->frames[tag].in_use, and the hook is installed by the runtime, so the reporting path exists too. - And the test still shows the hook never fires.
So the gap is one of two things, and both are countable rather than readable:
- the packet is never declared lost -- the loss/PTO timer does not fire for the application space in the relay test's 600 rounds (~1.2 s of simulated time, against an initial PTO of 100 ms, so it should fire); or
- it is declared lost but the descriptor is gone by then --
free_frameclearsin_use, and a descriptor freed early (for instance by the acknowledgement path) would make the loss silent.
Two counters settle it, in the relay test, in one process: "packets declared lost, by space" and "descriptors in use at the moment of loss". Both belong in the connection and both are exactly the kind of counter this project keeps adding when a reading replaces a guess -- this is the fifth time in this interop work that the answer came from a measurement rather than from the code.
Next: add those two counters (a few lines, no behaviour change), re-run the relay test, and read which of the two it is. The tree is otherwise unchanged this round and the record is the result.
WT-135 (P1, c99, quic, tests) -- the two counters landed
(packets_declared_lost[space], lost_without_descriptor, incremented in on_lost) and the relay test reads
them. The answer eliminates the second candidate outright:
initial=0 handshake=0 application=0 without_descriptor=0
No packet is declared lost in ANY space. So the loss is not "declared with nothing to name": the loss detector never ran at all, and the hook is not called for the simplest possible reason -- there is nothing to call it about. The descriptor-reuse theory is dead.
That leaves the timer arithmetic, or the arming of the loss module, as the thing to read, and the shape of the remaining question is now narrow enough to be answerable from the tree:
-
wt_runtime_session_pumpdoes callwt_quic_connection_on_timeouton every pump (theWT_ERR_AGAINpath does not return early -- checked), so the timers are being asked; -
on_timeoutdeclares losses only whenwt_quic_loss_time(...)says a loss time has arrived, then arms the PTO throughprobe_time(...), whose first branch iswt_quic_loss_pto(...)with the space's RTT and max ACK delay; - the relay test advances a simulated clock by 1000 microseconds per round, 600 rounds to a little over a second, against an initial PTO of 100 ms -- so a PTO that never fires within that window means the computed time is far larger than the arithmetic suggests, which is exactly the kind of thing a "what is the PTO, in microseconds, at this moment" reading answers in one line.
Next: read the PTO and the RTT estimate out of the connection at the moment of the drop (two more fields, or a
call to wt_quic_loss_pto from the test), and the answer is arithmetic rather than architecture.
The pattern is worth naming: five times in this interop work a reading has replaced a guess, and twice the reading was wrong because it came from a window or a field that did not mean what it looked like. The counters are what make the sixth reading cheap.
85 CTest tests green in debug, release and ASan/UBSan; 80,212 checks.
WT-135 (P1, c99, quic, interop, tests) -- the fourth measurement names the defect, and it is arithmetic plus one rule from the RFC:
count=6 packets remembered ack_eliciting_in_flight=2 (the dropped CONNECT among them)
pto_count=0 loss_time=0
application-space RTT: smoothed=0 rttvar=0 latest=0 min=0 has_sample=0
The application space's RTT estimator has no sample at all, because the peer never acknowledged anything in that space (our client sent its 1-RTT burst before the peer had keys, so nothing came back to measure). With no sample there is no time-threshold loss time, so nothing is ever declared lost -- which is why the counters from last round read zero -- and when the probe timeout fires, the probe path builds a PING rather than resending the outstanding frames.
RFC 9002 section 6.2.4 says a PTO MUST send new frames or RETRANSMIT unacknowledged data. So a lost STREAM frame is never resent in either path, and that is the interop stall exactly: the CONNECT goes out once, before the peer can read it, and no mechanism in this tree ever sends it again.
The fix is one place and one rule: the probe path must carry the outstanding frames (the connection already keeps a descriptor per sent packet, with the stream id and the byte range, and the runtime now has a lost-frame hook to hand it to the layer that owns the bytes). The relay test's final assertion flips from "the exchange did NOT complete" to "the exchange completed" on the day it does.
Sequence worth keeping, because it is the whole method working: a third-party peer stalled -> captures showed the CONNECT sent once and never again -> three rounds of reading cleared the timer, the receive path and the send path -> the structural gap (no test could lose a packet) was closed with a relay -> and then four measurements, each one eliminating a candidate: the hook is never called, nothing is declared lost in any space, the descriptor exists, and finally the RTT has no sample and the probe carries a PING. None of it was reachable by reading alone, and none of it was visible to 80,215 checks before the relay existed.
85 CTest tests green in debug, release and ASan/UBSan; 80,215 checks.
WT-135 (P1, c99, quic, interop, tests) -- two results, one landed and one recorded.
Landed: a probe timeout retransmits the outstanding data (RFC 9002 section 6.2.4: a PTO MUST send new frames or RETRANSMIT unacknowledged data). The probe packet itself is a PING, so without this the data is never resent. The oldest outstanding ack-eliciting packet's descriptor is now handed to its owner -- and the descriptor is NOT freed, because the packet is still in flight and a later acknowledgement retires it. The owner, the layer that kept the bytes, is what resends them.
Recorded: the fifth measurement explains the fourth, which had blamed a missing mechanism. The initial probe
timeout is 1,333,000 microseconds (RFC 9002 section 6.2.1's kInitialRtt), and the relay test ran 600 rounds
of 1,000 microseconds -- 0.6 seconds against a timer that needs 1.33. The PTO never fired because the test was
too short, not because the path was absent:
now=601000 earliest=1000 pto_count=0 loss_time=0 ack_eliciting_in_flight=2
Raising the window changes which packet the drop lands on, so the test's targeting logic needs re-deriving for a window past the PTO. That attempt did not hold together (five assertions moved), and it was reverted rather than left failing: the test file is exactly as committed and the suite is green.
Two named things for the next round: re-derive the relay test's drop targeting for a window longer than 1.33 s, and give the layer that owns the bytes something to resend them from (a retained request buffer). The probe-reporting half is done, so the test's un-called-hook assertion is the one that moves next.
The pattern, now five times over: a reading replaced a guess; twice the reading was wrong because it looked at a window or a field that did not mean what it appeared to; and this time the reading was about the test's own clock. Nothing here was reachable by reading the library alone.
85 CTest tests green in debug, release and ASan/UBSan.
WT-135 (P1, c99, http3, quic, interop) -- b8f2f2c-era. The two halves of RFC 9002 section 6.2.4's "send new
frames or retransmit unacknowledged data" are now both present in the tree:
- the report (last round): a probe timeout hands the oldest outstanding packet's descriptor to its owner, without freeing it -- the packet is still in flight and a later acknowledgement retires it;
-
the retention (this round): the HTTP/3 driver records the request's stream and length as it sends it and can
send those bytes again through
wt_http3_driver_resend_request.
What is left is the wiring, not a mechanism: nothing calls the resend yet. The runtime hook is where the lost frame is reported, the driver function is what can answer it, and the CLI is where the two meet -- a small change with the relay test as its gate.
The contract is written down rather than assumed: the retained bytes are the ones send_message left in the
driver's scratch, so they stay valid until the driver sends another message. That is true for a client's CONNECT,
which is the only message it sends before the response, and WT_ERR_STATE when nothing is retained is a caller
asking at the wrong time rather than a peer doing something.
And the relay test needs its window past 1.33 seconds before it can see any of this: the fifth measurement from last round (initial PTO 1,333,000 microseconds against a 600-round, 0.6-second loop). Its drop targeting changes when the window does, which is the other named task.
85 CTest tests green in debug, release and ASan/UBSan.
Addendum: the resend is wired, and the interop still times out -- so the question is whether it RAN (WT-135)
WT-135 (P1, c99, cli, http3, quic, interop) -- the two halves have a place to meet now:
- the connection reports the oldest outstanding frame to its owner on a probe timeout (RFC 9002 section 6.2.4);
- the HTTP/3 driver retains what it sent;
- and the client tool answers the report by sending the request again -- only for its own request stream, and only when the driver has something retained, because anything else is a frame this tool has no bytes for and saying so is better than sending something wrong.
The transport the driver sends through moved into the loop struct, because a report of a lost frame arrives long after the call that built it returned.
Measured against the third-party peer with the whole chain in place: still timeout, connectAccepted false.
So the next question is no longer "is the mechanism there" but "did this path run" -- and the tool can answer
with one counter. That is the next change: pack the number of resends into the oracle, run the container, and read
whether the probe fired and the request went out again. If the count is zero, the question moves back one step (the
probe is not firing in the real run, where the clock is real rather than simulated); if it is non-zero, the peer is
receiving a request it does not answer, and the HTTP/3 content is the next thing to capture.
85 CTest tests green in debug, release and ASan/UBSan; 80,215 checks.
WT-135 (P1, c99, cli, quic, interop) -- one counter answers the question the last round asked, and the answer is negative:
"established":true "connectAccepted":false "packetsSeen":8 "resends":0
The retransmission path did not run against the real peer. "Is the mechanism there" and "did the mechanism run" are different questions, and until this counter the tool could only answer the first. The relay test had said the same thing in its own clock (a probe needs past 1.33 seconds, and its window was 0.6); now the real run says it with a counter rather than with a timeout.
That puts the next question in one place, on the connection rather than in the tool: does the probe timeout
fire at all in a real run? The loss counters already in the tree cannot tell "no probe" from "probe with nothing to
report" apart, because a probe is not a loss -- so the next change is a probes_sent counter (by space) beside
them, and the same container run reads it.
Worth noting about the shape of this whole investigation: five rounds have gone into one stall, and every round has produced a fact that eliminated a candidate -- the hook is never called, nothing is declared lost, the descriptor exists, the RTT has no sample in the test, the probe needs 1.33 s the test did not have, and now the path does not run in a real run either. Each of those was a measurement, and two of them corrected a reading that had looked conclusive. The mechanism being correct and the mechanism being reached are different things, and this tree had no way to ask the second question until the counters existed.
85 CTest tests green in debug, release and ASan/UBSan.
WT-135 (P1, c99, quic, interop) -- two counters (probes_sent[space], probes_with_data) answer the question
the last two rounds were circling, and the answer reframes the whole stall:
"probes":0 "probesWithData":0 "resends":0 "connectAccepted":false
The probe timeout never fires, over eight seconds with a 1.333-second initial PTO -- and that is the timer
being right, not absent. probe_time's fallback arms a probe only while something ack-eliciting is still in
flight, and the peer acknowledged our 1-RTT packets. It could, because a server derives application keys when
it processes the client's Finished -- before it sends HANDSHAKE_DONE -- so our CONNECT was readable and was
read.
So the interop stall is NOT packet loss. The peer received the request, acknowledged it, and answered nothing. That moves the question to the content of our HTTP/3 request: the control streams, the SETTINGS, the QPACK section, or a request-stream frame order that aioquic refuses. The loss-path work stands on its own -- it is RFC 9002 section 6.2.4's rule, the relay test exercises it, and it would matter on any real network -- but it was not this stall, and the counters are what said so.
This is the sixth measurement to eliminate a candidate, and the second to overturn a reading that had looked conclusive (the first was "the two ends disagree about the handshake", which a longer capture resolved). The chain went: stall -> packets sent once -> loss suspected -> loss path cleared -> no probe -> no loss. Reading the code alone had suggested packet loss three rounds running; the counters needed three rounds to disagree.
Next: capture past the handshake and read what the peer does with the request (the harness has the capture mode), plus the peer's own HTTP/3 view -- which needs the container's log at a level that says something, or a decode of what we send on the control and request streams.
85 CTest tests green in debug, release and ASan/UBSan.
WT-135 (P1, c99, interop) -- the peer now says what it sees, and what it says is silence.
tests/interop/peer/ is the same pywebtransport/aioquic server with aioquic's logging turned to DEBUG (one line
changed), because the upstream logs at INFO and HTTP/3's state transitions are at DEBUG -- so "what does the peer
make of our request" had no answer from the peer's own side. The answer:
DEBUG Buffering QUIC event until connection is set: ProtocolNegotiated(alpn_protocol='h3')
DEBUG WebTransport protocol handler initialized (client=False)
... and then SILENCE
ALPN negotiated, the WebTransport handler initialised, and no HTTP/3 event after it. aioquic's HTTP/3 layer never processed a frame from this client. Combined with last round's counters -- no probe, nothing lost, our packets acknowledged -- the question is now provably inside our 1-RTT payloads: the control streams, the SETTINGS, or the request's HEADERS.
Four reframings, each from a measurement rather than from reading:
- "the peer refuses our connection" -- true, and fixed (WT-141, the missing
initial_source_connection_id); - "the two ends disagree about the handshake" -- a longer capture said no, the retransmissions stopped;
- "our packets are lost" -- the counters said no: nothing was lost, nothing was probed, everything was acknowledged;
- "the peer's HTTP/3 layer never saw us" -- the peer's own DEBUG log says so.
Next: decode what this tree sends on the control and request streams at the moment they go out. The tree already has an HTTP/3 frame decoder and a QPACK decoder, so this is a test or a small tool rather than a capture -- and the verbose peer is what confirms whatever it finds.
85 CTest tests green in debug, release and ASan/UBSan; containers cleaned up.
WT-135 (P1, c99, cli, http3, interop) -- the verbose peer says its HTTP/3 layer never saw a frame, and the counters say nothing was lost and our packets were acknowledged. Those two facts together point at a timing explanation rather than a content one:
a server installs its application read keys when it processes the client's Finished -- one flight after the client considers its own handshake done. A request sent on the client's first 1-RTT packet can therefore reach a peer that cannot read it yet; the probe path would resend it (RFC 9002 section 6.2.4), but a peer never acknowledges a packet it could not read, so there is nothing for the loss timer to work from and no sample for the RTT estimator -- which is exactly the state the counters reported (
probes: 0, no sample, nothing declared lost).
The cheap test is to wait. Keep pumping until the handshake is CONFIRMED before starting the session, and see whether the peer's HTTP/3 layer then reacts. If it does, the stall is timing and the conservative wait is the fix (or the resend path needs to fire on a different trigger); if it does not, the request's CONTENT is next and the verbose peer plus this tree's own frame and QPACK decoders are the way to read it.
That attempt was not landed. The edit went into the client's CONNECT block rather than before it (status came
out undeclared, the compiler said so immediately), and it was reverted rather than left broken: the tree is
exactly as committed and 85 CTest tests pass in all three configurations. The next round starts from the hypothesis
and the correct insertion point rather than from the mistake.
Worth recording about the shape: this round's first real finding was again from a tool rather than from reading -- the peer's DEBUG log -- and the round's only mis-step was a patch placement, caught by the compiler rather than by a test failing later.
Addendum: the timing hypothesis is refuted -- the peer's HTTP/3 layer sees nothing either way (WT-135)
WT-135 (P1, c99, cli, http3, interop) -- the experiment ran and the answer is no, which is a result:
(with the client waiting for HANDSHAKE_DONE before it sends its CONNECT)
"established":true "connectAccepted":false "receivedBytes":0 "resends":0 "probes":0
Waiting for confirmation changes nothing. So the stall is not "the request arrives before the peer can read it": whenever we send it, the peer's HTTP/3 layer does not react. The verbose peer's log said the same from its own side -- ALPN negotiated, the WebTransport handler initialised, and not one HTTP/3 event after it.
That leaves three candidates, and they are now the whole of the question:
- our 1-RTT packets are not decrypted by the peer -- the handshake completed on both ends, so the application secrets should match, and a mismatch would be a key-derivation difference rather than a timing one;
- our HTTP/3 frames are malformed in a way aioquic drops without an event (its HTTP/3 layer would normally log a frame-level error, and it logged none);
- we never send the request at all after the handshake -- the earlier capture showed the burst going out before confirmation, and this run's job was to change when it goes, not whether.
The experiment was reverted: it changes behaviour (a client need not wait for confirmation), it does not fix the interop, and the tree is exactly as committed with 85 CTest tests green in all three configurations.
Next, and it is a measurement either way: capture this exchange again to see whether anything leaves the client after the handshake, and -- if it does -- decode it with this tree's own HTTP/3 frame and QPACK decoders rather than with a capture. The two answers are different work: "nothing is sent" is a client-flow question, "something malformed is sent" is a codec question, and the verbose peer says the peer is not the obstacle.
WT-135 (P1, c99, http3, interop) -- an elimination that comes from evidence already in hand rather than from a new measurement, and it removes the first of the three candidates:
Our application WRITE keys match the peer's read keys. The peer's HANDSHAKE_DONE arrived protected with its
1-RTT write keys and our client decrypted it -- that is what set handshakeState: connected and
established: true. TLS 1.3 derives both directions from the same traffic secret, so if our read keys match the
peer's write keys, our write keys match the peer's read keys, and the peer can decrypt our 1-RTT packets.
That eliminates "our 1-RTT packets are not decrypted". And the counters eliminated "we never send them": nothing is outstanding, which means the packets we sent were acknowledged -- a peer cannot acknowledge a packet it did not read. So the peer read our 1-RTT packets, decrypted them, and its HTTP/3 layer logged nothing.
That leaves the content of what we send on the control and request streams, and it is now the only candidate: the control stream's type prefix, its SETTINGS payload, the QPACK streams, the request's HEADERS frame, or the order they are opened in. aioquic reports frame-level problems at DEBUG and reported none, which is itself a clue worth keeping: what we send is probably not malformed in a way that raises an error, but not what a peer expects to receive -- a stream opened with the wrong type, a control stream opened twice, a SETTINGS frame that never arrives before a request.
Next: decode this tree's own output with this tree's own decoders -- an HTTP/3 frame decoder and a QPACK decoder both exist here -- and compare what it writes on each stream at session start against what draft-16 and RFC 9114 require. That is a test with a captured byte stream as its fixture, or a small tool; the verbose peer is what confirms the result afterwards.
The tree is unchanged this round; the record is the result. 85 CTest tests green in debug, release and ASan/UBSan.
WT-135 (P1, c99, http3, interop) -- the last candidate is "the content of what we send on the control and request streams", and this round checked the two coarsest parts of it:
-
the stream type prefixes are the RFC's own numbers:
WT_HTTP3_ENDPOINT_STREAM_CONTROL = 0,..._QPACK_ENCODER = 2,..._QPACK_DECODER = 3,..._WEBTRANSPORT = 4-- matching RFC 9114 section 6 and draft-16's WebTransport stream type. The driver writes those, so a peer cannot be mis-reading a stream by its type; -
the direction flag is not inverted: the driver opens the control and QPACK streams with the transport's flag
0and the request with1, andquic_open_streampasses that straight towt_quic_connection_open_stream(connection, bidirectional, ...), whose parameter is named for what it means. A mix-up here would be an interop-only defect that the local pair (same code both ends) could never show, so it was worth checking explicitly rather than assuming.
What is left is the frames inside those streams: the SETTINGS payload's contents on the control stream, the QPACK stream prefixes' payloads, and the request's HEADERS frame with its QPACK field section. aioquic reports frame-level problems at DEBUG and reported none, which still points at "not what a peer expects" rather than "malformed".
Next, and it is a test rather than a capture: a recording transport -- the driver's own transport interface, with
a stub that keeps every byte written per stream -- driving wt_http3_driver_start_session, then decoded with this
tree's own HTTP/3 frame and QPACK decoders. That turns "what do we send" into a fixture with assertions, and the
verbose peer is what confirms the answer on the wire afterwards.
The tree is unchanged this round; the record is the result. 85 CTest tests green in debug, release and ASan/UBSan.
WT-135 (P1, c99, http3, tests, interop) -- the recording-transport test landed, and its 24 checks say the structure and the request are right:
- four streams opened: control (type
0x00, unidirectional) whose first frame is SETTINGS (0x04); the QPACK encoder (0x02) and decoder (0x03) streams carrying their prefix alone; and the request on a bidirectional stream whose first frame is HEADERS (0x01); - and the request's field section, decoded with this tree's own QPACK decoder, yields CONNECT +
:protocol webtransport+:path /chat+:authority example.com.
So the peer's silence is not explained by a wrong stream type, a wrong direction, a missing SETTINGS frame, or a malformed request line. Two things the test does not yet read, and they are the last candidate:
-
the SETTINGS payload's own contents -- whether
WT_ENABLEDis advertised correctly and whether something a peer requires is missing (this is the one part of our own output still unread); -
what aioquic's development server expects of a WebTransport CONNECT -- an
origin, a protocol list, a settings-validation flag -- against what we send, which carries none of those.
Both are readable in the same test, and the verbose peer confirms the answer on the wire.
The method note worth keeping: six rounds of hypotheses about the peer ended with a test of our own output decoded by our own decoders -- and the answer was "our output is right", which is exactly the kind of thing that cannot be concluded from captures and logs alone.
86 CTest tests green in debug, release and ASan/UBSan.
WT-135 (P1, c99, http3, tests, interop) -- the last unread part of our own output is read, and it is correct:
00 04 05 ac 7c f0 00 01
^ ^ ^ ^-----------^ ^
| | | WT_ENABLED (0x2c7cf000) in QUIC's four-byte varint form
| | the payload's length
| the SETTINGS frame (0x04)
the control stream type (0x00) ... and the value is 1
So every part of what this client sends at session start is now read and correct: the stream types, the
directions, the SETTINGS frame and its payload, and the request's QPACK field section (CONNECT +
:protocol webtransport + path + authority).
And the round's own mistake is worth recording, because it is the third of its kind. My first attempt read the stream with a hand-written cursor loop that found nothing, and the assertion failed -- the bytes proved the PARSER wrong, not the encoder. That is the third time in this interop work that a hand-written parse of a wire format was the thing at fault: the varint transcription ({0x41, 0x02} read as two fields when it is one 258), the oracle fields read after the structure was cleared, and now this. The assertions are on bytes for that reason, and the comment in the test says so.
One thing is left between this tree and an interop session: what aioquic's development server expects of a
WebTransport CONNECT that we do not send -- an origin, a protocol list, a settings-validation flag. That is a
question about the PEER's requirements rather than about our output, and it is the next thing to read (its source,
or the Swift suite's client configuration, which talks to the same server).
86 CTest tests green in debug, release and ASan/UBSan; 80,239 checks.
WT-135 (P1, c99, tls, interop) -- the peer's own unfiltered DEBUG log names the problem that nine rounds of measurement were circling:
DEBUG Decryption key is not available
DEBUG Decryption key is not available
DEBUG Loss detection triggered
DEBUG Scheduled CRYPTO data for retransmission
... repeating, forever
The peer cannot decrypt our packets and keeps retransmitting its handshake CRYPTO: the handshake never completes
on its side, while this client reports handshakeState: connected and established: true. That is the root
cause of the interop stall, and it is in TLS rather than in HTTP/3: the peer never installs application read
keys, so our request is undecryptable, its HTTP/3 layer sees nothing, and every downstream measurement (no probe, no
loss, stream ids right, SETTINGS right, request right) is consistent with it.
And it overturns a deduction from three rounds ago. "The keys match, because the peer's HANDSHAKE_DONE was
decrypted" cannot be right if the peer cannot decrypt us. That is the fourth reading in this interop work to be
overturned by a measurement (the others: "the two ends disagree about the handshake", "the retransmissions show a
disagreement", "our packets are lost"), and it is the reason this project's rule is to measure rather than to reason
from what a field appears to mean.
Measured alongside it, and correct: the request's stream id and the stream counts --
"requestStreamId":0 "streamsOpened":{"bidi":1,"uni":3}
one client-initiated bidirectional stream for the request (stream 0, the first of its kind) and three unidirectional ones (control, QPACK encoder, QPACK decoder).
Next: find which handshake message the peer cannot read -- the client's Finished, or the Handshake-level packets
carrying it -- with the peer's log as the oracle and this tree's own TLS suites as the comparison. The verbose peer
(tests/interop/peer/) is what made this visible, and it is one command.
86 CTest tests green in debug, release and ASan/UBSan.
Addendum: the labels are right and the key schedule is RFC-tested, so the difference is upstream of them (WT-135)
WT-135 (P1, c99, tls, interop) -- "which handshake message can the peer not read" is now two questions, and one of them is already answered by the tree's own evidence.
What is ruled out:
- the derivation labels are RFC 8446's own:
src/tls/keyschedule.cderivesc hs traffic,s hs traffic,c ap trafficands ap trafficfrom the handshake and master secrets, with the pair treated as one (a failure zeroes the first rather than leaving half a direction); - the key schedule itself is verified against RFC 8448's published vectors --
tests/vectors/rfc8448_vectors.h, extracted from the RFC text and checked bytest_tls13_keyscheduleandcheck-vectors.shin CI. So for the transcript those vectors describe, this implementation derives exactly the secrets the RFC lists.
What that leaves: if the secrets are right for a given transcript, and the peer still cannot decrypt our Handshake-level packets, then the transcript this client hashes differs from the one the peer hashes -- or our client's Finished is not sent at all, which the peer's endless "Scheduled CRYPTO data for retransmission" would look identical to from its side.
And both are consistent with everything measured so far: the pair works because BOTH ends of it hash the same way; the interop peer hashes the RFC's way. That is precisely the class of defect the interop criterion exists to find, and it is the last thing standing between this tree and a session with a third-party implementation.
Next: make the client say what the peer cannot. Two candidates, two measurements: (1) does the client send a Handshake-level packet after its ServerHello-derived secrets -- a capture with the packet lengths already suggests a burst, so the count of Handshake packets sent is the sharper question; (2) does the client's transcript hash match an independent computation over the same messages -- which the RFC 8448 vectors can be extended to cover for this handshake's own byte sequence.
The tree is unchanged this round; the record is the result. 86 CTest tests green in debug, release and ASan/UBSan.