Skip to content

Project Tracker

Pummelchen edited this page Sep 13, 2026 · 377 revisions

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.8, with WT-185, WT-186, WT-192, WT-193, WT-194 and WT-195 closed afterwards and WT-134 partially closed, while WT-191, WT-196, WT-197, WT-198, WT-199 and WT-200 are open (the handover note and the closing addenda are at the end of this page). 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).

How to use this page

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.8, published 13 September 2026 from commit 13d29fd, with Swift CI green on the tagged revision, both conformance suites passing on the published binaries, and reproducible artifacts verified against their published checksums. It is a defect-fix release for issue #24: a peer that FINs an inbound stream before writing a byte was reported as an internal truncation rather than as the peer behaviour it is (WT-101). 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 main and 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; the WT-N reference 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.
  • A row's STATUS is the second column, and it is the only thing a reader has to look at to tell a parked row from a finished one: open, answered (the question was settled by reading something), or closed at <sha> / closed by decision. It exists because WT-79 read as an open P2 for months of rounds after 6496ad6 landed it: its closure was a sentence at the end of a Note longer than most addenda, and nothing that greps for "Closed" could see it. The column carries what the row's own text already said, and a row that closes gets the value in the same edit as the addendum that closes it (WT-174).
  • The wiki has no CI, so the column is a convention rather than a checked invariant. The addendum at the end of this page is the index for the same reason, and the two are meant to agree: a closure is recorded in both.
  • 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.

Open work

Ref Status Severity Area Item Notes
WT-1 open 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 answered (scope statement) 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 answered 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 answered (became the C99 tree) 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 answered (became the C99 tree) 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 answered (XAIOS side) 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 answered (the host build exists: C99/out) 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 answered (estimate, superseded by measurement) 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 answered 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 answered 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 answered (policy in the build) 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 closed into WT-16, WT-17 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 closed at d3eaacd 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 answered (build constraint) 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 answered (XAIOS side) 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 open (XAIOS side) 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 closed by decision (this addendum) P2 c99, config CLOSED by decision (this addendum): the two trees stay separate. 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 closed at 088b659 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). CLOSED on main at 088b659. The lifecycle is in the connection runtime: wt_quic_connection_initiate_key_update (refusing before the handshake is confirmed and refusing a second update before the first is acknowledged, both as the caller's state error), the response to a peer's update with the send keys moved BEFORE the acknowledgement, the retained phase for reordered packets, KEY_UPDATE_ERROR for a second update before this endpoint has sent anything in the new phase and for a higher-numbered packet under the old keys, and confirmation by the acknowledgement that reaches the phase's first packet number. The packet layer had to be split for it -- wt_quic_packet_unprotect_header plus wt_quic_packet_open -- because the Key Phase bit is inside the header protection mask and the header protection key is the one thing an update does not change. 36 new checks; the whole existing suite passed the split unchanged.
WT-71 closed by decision (this addendum) P3 c99, tls CLOSED by decision (this addendum): resumption and 0-RTT are out of scope. 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 closed at 261c4e2 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 closed at 6496ad6 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. CLOSED at 6496ad6 -- both halves landed there and the row was never updated (see the addendum "WT-79 was already done"). The Note below is the history of the four attempts, kept because it records how the entanglement was found. 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 closed at 0d927c7 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-185 | closed at b1b48bb | P2 | swift, ci, tests | The listener-ceiling test failed three times in CI with a bare POSIXErrorCode — ENETDOWN (50) twice and ENOTCONN (57) once — in the macOS SwiftPM job and the TSan job, and never locally. | CLOSED on main at b1b48bb. The row was filed with a narrower record than the evidence supports: it named one code (ENETDOWN) and two occurrences, where the CI logs show two codes and three occurrences across two different jobs. The cause was not the test — InteroperableQUICHelpers.waitForReady rethrew NetworkConnection.State.failed(error) verbatim, so a transient transport condition reached connectSession/acceptSession callers as a raw framework error. WebTransportNetworkRuntimeError.connectionEstablishmentFailed(role:domain:code:) now names it, isTransientEstablishmentFailure answers whether a fresh connection can clear it, and the test retries only that case, bounded, with one accept waiter per round. A new unit test pins that timeout — the signature of the issue #23 defect the file guards — is not retryable. | | WT-186 | closed at 22d4ec2 | P3 | swift, tools, docs | The conformance runner had no "skipped" notion, so release-products and release-script-stale-spikes — which read Package.swift and Swift/build-release-apple-silicon.sh from the working directory — reported as FAILED outside a checkout (passed=38 failed=2). | CLOSED on main at 22d4ec2 (code half; the documentation half closed at 52d7449). WebTransportCLIConformanceStatus adds the third state; a scenario declares the repositoryFiles it reads and is skipped with its reason when none is present; the summary counts it separately and the run exits 3 when nothing failed but something was not attempted. Verified end to end on the built binaries: passed=40 failed=0 skipped=0 total=40 exit 0 inside a checkout, passed=38 failed=0 skipped=2 total=40 exit 3 outside one. Mirrors the C99 report's WT_CLI_RESULT_UNSUPPORTED. | | WT-191 | open | P2 | swift, tests, ci | pkcs12WithRSAIdentityStillResolvesAfterTheExceptionBoundary fails on the development host with OSStatus -26276, deterministically and in isolation. | New, found while verifying WT-185, and unrelated to it. Proven pre-existing: the identical failure reproduces on a clean 0bb6c95 worktree with no working-tree changes, and both fixture checksums match Resources/README.md exactly, so the bundles are intact. SecPKCS12Import refuses a LibreSSL 3.3.6-generated RSA bundle on macOS 26.6.2 here while the CI macos-26 runners accept it, and the same bundles are RC2-40-CBC, which a Homebrew OpenSSL 3.x also declines to read. Whether the difference is the macOS build or this host's Security state is not established. Consequence: on this host the Swift suite is 307 of 308 and 286 of 287 under TSan; every other test passes. |

| WT-192 | closed at b1b48bb | P2 | swift, transport, tests | isTransientNotConnected could never return true for the error the runtime actually receives, so the ENOTCONN retry in openBidirectionalStream was dead code. | New, found while fixing WT-185, and it is the same misunderstanding. The predicate tested error as? POSIXError and then (error as NSError).domain == NSPOSIXErrorDomain, but NWError.posix(.ENOTCONN) is neither: it bridges under the domain "Network.NWError". Every real failure therefore took the "not transient" branch. Measured, not assumed — the first version of the WT-185 predicate had the identical flaw and was proven inert by a test that builds a real NWError and watches it bridge. The predicate now unwraps the NWError case first, and transientNotConnectedRecognisesRealFrameworkErrors pins it against the error types the framework really delivers. Closed in the same commit as WT-185, because separating them would have left the same trap in place one function away. |

| WT-193 | closed at df6d03d | P1 | c99, cli, security | --trust system is the C99 client's own default, and the session loop ignored the option: whatever --trust said, the client took the loopback development bypass. The report still printed "trust":"system". | CLOSED on main at df6d03d. Found while setting up the VPS matrix: the client "verified" a routable peer's certificate against a default authority of "localhost", which is a loopback name, so the trust layer's own guard against using the bypass for a real endpoint was satisfied by a default rather than by the peer's identity. The mode is now carried to the TLS policy and --authority names the identity the certificate must prove. wt_cli_trust is the new case that cannot pass unless the option is honoured, because the two modes must disagree about a self-signed leaf. | | WT-194 | closed at 0d14d1c | P0 | c99, quic, security | A remotely-triggerable SIGSEGV. PING, CRYPTO, NEW_TOKEN, DATA_BLOCKED and STREAMS_BLOCKED were dispatched to handle_path_challenge, which reads frame->as.path_challenge.data; for those kinds that union member holds the previous frame's bytes, so a non-NULL garbage pointer passed the null check and was memcpy'd from. | CLOSED on main at 0d14d1c. Not theoretical: the C99 client segfaulted against quinn, quiche and h3 on the VPS matrix, and all three send a PING, while pywebtransport (which did not) completed. AddressSanitizer named it: memcpy from 0x2e in wt_writer_put under the PATH_RESPONSE encode. The five kinds now go to deliver_to_handler with DATAGRAM. The regression test sends DATA_BLOCKED then PING in ONE packet, because a PING alone leaves the union zeroed and passes with the defect in place; reverting the fix alone makes test_quic_connection SEGFAULT. | | WT-195 | closed at ee36626 | P2 | c99, tools, tests | The plan's Phase 11 names C99/scripts/run-vps-third-party-interop.sh and it did not exist: the seven proofs were run by hand on the VPS through ssh, so the matrix was not reproducible from the repository. | CLOSED on main at ee36626. The script runs the seven proofs with --trust system and --authority, and emits the aggregate the plan names — testedImplementationCount, passedProofCount, requiredProofCount, allPassed — by counting the proof files rather than by asserting what the run expected. A proof passes on the session AND the echo. The address is per proof, because a deployment may publish all five peers on one host or give each its own. Measured on the VPS: 4 of 7 across 5 implementations, with the three failures recorded below rather than left as bare failures. | | WT-196 | open | P1 | infra, interop | The VPS interop peers are on a certificate that expires 18 September 2026, and their certificate files no longer exist on the host. | New, found while running the matrix. All five containers mount /etc/letsencrypt, which is a symlink to /var/minecraftai/web/letsencrypt — a path that no longer exists — so the peers hold their certificates only in memory from startup and cannot be restarted or renewed: a restart fails on a missing fullchain.pem. The leaf is CN=pummelchen.91.99.176.243.nip.io, issued 20 June 2026, expiring 18 September 2026, so the whole environment goes dark in days. Rebuilding it needs the certificate restored (or new peers provisioned) before any further VPS matrix work. |

| WT-197 | open | P2 | swift, transport, tests | A raw framework error still escapes through the inbound-stream and connection queues, so a bare POSIXErrorCode can still reach listenerServesMoreSequentialSessionsThanTheDefaultCeiling. | New, found by CI on df6d03d — the TSan job failed on that test with POSIXErrorCode(rawValue: 57) (ENOTCONN) after WT-185 was closed, which is the useful part: it proves the fix was incomplete rather than wrong. WT-185 named the error at waitForReady, and that path works. The remaining escapes are InteroperableQUICConnectionQueue.dequeue and InteroperableQUICInboundStreamCollector.next, which throw failure with whatever the framework handed them. The adversarial audit of WT-185 predicted exactly this and the commit documented it rather than closing it; CI has now shown it is not only theoretical. The fix is to translate at those two boundaries as well — the open design question is that both are used after establishment too, so connectionEstablishmentFailed would mislabel a mid-session failure, which is why this is a row and not a one-line change. | | WT-198 | partially closed at d6bcf9e | P2 | c99, interop | The Phase 11 blockers, both in the peers rather than in this tree: erlang-webtransport's leaf-only chain (fixed) and web-transport-quinn's missing datagram advertisement (fixed); what is left is erlang's datagram path taking the peer down. | Found by running the matrix with the runner WT-195 added. Neither is a defect in the C99 client and neither is a guess. erlang: openssl s_client -quic -alpn h3 reports Certificate chain with a single entry (index 0) and Verify return code: 21 (unable to verify the first certificate) for erlang, against depth=0..3 and Verify return code: 0 (ok) for h3 presenting the same leaf — and the cause is in the peer's own source, not its configuration: webtransport.erl's read_cert_file/1 keeps only the first certificate of the PEM ([{_, CertDer, _} ...]), and the QUIC listener path passes cert => CertDer with no chain, while the library's chain support exists only on its SNI-callback path, which builds certs_keys with the leaf followed by the chain. Pointing CERTFILE at a four-certificate fullchain does not help, which was tested rather than assumed. quinn: the peer echoes datagrams it receives but never advertises one, and the crate source says why — web-transport-quinn 0.11.9's ServerBuilder exposes only new, with_addr, with_congestion_control and with_certificate, and with_certificate builds quinn::ServerConfig::with_crypto(..) and hands it straight to quinn::Endpoint::server, so the transport config is quinn's default and datagram_receive_buffer_size is never set. There is no setter for it in that version, so no configuration change can fix the peer: enabling datagrams there means patching the crate or bypassing ServerBuilder to build the endpoint directly. Our client's datagram path is not implicated — the h3 datagram proof passes. Closing these means changing the peers and rebuilding them, which is gated on WT-196. |

A second pass turned the matrix into a script and the two blockers into evidence. WT-195 is closed: the seven proofs now run from C99/scripts/run-vps-third-party-interop.sh, which emits the plan's aggregate by counting the proof files. Running it gave the same four of seven, so the manual result reproduces.

Getting there also showed that the frozen peers were not the only way to run this. The Caddy certificate store on the VPS holds full chains with private keys, so a parallel peer set was stood up in this session's own space (wt2-*, ports 55501-55505, mounting a four-certificate fullchain) without touching the running containers. It is worth recording because it removes the "the peers cannot be restarted" excuse from WT-196: new peers can be run at any time, and the expiry only ends the existing set.

That is how the erlang blocker stopped being a guess. Reproducing it against a peer that had a real fullchain certificate proved the configuration was never the problem: erlang's own read_cert_file/1 keeps only the first certificate and its QUIC listener passes a bare cert, so no fullchain file can fix it. The fix belongs in the peer, and the peer is third-party. WT-198 records both remaining blockers with that measurement, and the two are now genuinely peer defects rather than unknowns.

The erlang chain is fixed, in the peer, and the fix is in the repository. C99/tests/interop/peer/patch-erlang-chain.py patches erlang-webtransport's h3 listener to send its chain, and it records why the obvious fix does not work: the chain has to ride inside quic_opts, because quic_h3:build_server_quic_opts/1 lifts only cert/key/cacerts from the top level and merges quic_opts last. The first attempt put cert_chain at the top level and did nothing at all — openssl still reported a single-entry chain and the client still reported status=trust, which is how the drop was found rather than assumed. With the patch, openssl reports depth=0..3 and Verify return code: 0 (ok), and the erlang stream proof passes. It lives in this repository rather than only on the VPS because the matrix depends on it, and an interop result whose peer setup is not recorded is not reproducible.

What is left is two datagram proofs, and both are peer faults. web-transport-quinn never advertises QUIC DATAGRAM — its ServerBuilder is never given a datagram transport config — so our client correctly declines to send one. And erlang-webtransport takes itself down on the datagram path: against a freshly started peer the first stream proof passes and the first datagram attempt times out, after which every proof times out, and the peer's log shows its session state machine terminating with {error,{invalid_state,draining}}. That is a peer crash, reproduced across a container restart, and it is why the erlang stream proof passes only against a fresh peer — a reproducible matrix for it needs a peer restart per proof, which is a note for the runner rather than a change to it.

So the honest count is five of seven on a fresh peer set (pywebtransport stream, quinn stream, quiche stream, h3 datagram, erlang stream), with the two datagram proofs blocked by defects in the peers that the plan names as the independent implementations. Nothing in this tree is implicated: the h3 datagram proof exercises our client's datagram path and passes. |

| WT-199 | open | P2 | c99, transport, tests | test_runtime_udp fails 6 of 177 checks on Windows, in the WT-36 datagram-truncation contract. | New, found by RUNNING the Windows tree under Wine — the thing compiling and linking cannot do. The failures are receiving it into a small buffer is a truncation: want truncated, got limit, the sender is still named: want 1, got 0 (twice), whole: expected ok, got truncated, and with its length: want 8, got 0. That is the _WIN32 branch of src/runtime/udp.c, and it is exactly the surface C99/docs/PORTABILITY.md describes: on Windows a peek cannot see past the caller's buffer, so the FULL_LENGTH flag is not a truncation report. The branch compiled and linked cleanly and was reasoned about correctly; it had simply never been executed. | | WT-200 | open | P2 | c99, quic, tests | test_quic_connection fails 6 of 2276 checks on Windows, all in the Retry path (WT-168). | New, found by RUNNING the Windows tree under Wine. the destination is the Retry's Source Connection ID, byte for byte and and the TOKEN is on the wire as the peer sent it are both expected true, with four further checks following. Nothing in that path is endian- or alignment-dependent by construction, so this is a finding to diagnose rather than a known class — and it is the second defect that only executing the tree could have produced. |

| WT-134 | partially closed at 3700d07 | P1 | c99, ci, windows, freebsd | The plan's Phase 12 requires CI on macOS 26, Debian, FreeBSD and Windows 11. Windows now compiles, links and runs; FreeBSD has no runner. | The Windows half is measured as far as a Linux host can take it, and further than it had been. C99/scripts/check-windows-wine.sh runs every linked test binary through Wine: 84 ran, 82 passed, 2 failed, 0 hung, with the reported checks summing to 89,099. The two failures are real findings rather than setup noise — WT-199 (test_runtime_udp, the _WIN32 truncation contract) and WT-200 (test_quic_connection, the Retry path) — and they are the first defects in this port that only EXECUTING the tree could produce. What is still owed is a real Windows runner (Wine is a faithful Win32 implementation, not Windows, so both failures stand as "under Wine" until one confirms them) and the FreeBSD leg, whose environment is now known rather than assumed: the VPS has no nested virtualization — /dev/kvm does not exist and /proc/cpuinfo carries neither vmx nor svm, so QEMU is TCG-only — but a FreeBSD 15.1-RELEASE amd64 image is already cached at /root/.cache/xaios/freebsd/ (put there by the XAIOS work), and it boots under TCG on this host in about seven minutes: the captured log reaches FreeBSD/amd64 (freebsd) (ttyu0) login:. FreeBSD is therefore reachable here rather than blocked; what it needs is a dedicated round for a TCG-paced toolchain install, build and full test run, which is hours of emulated work rather than a missing capability. |

Addendum: C99 flow control on receive (WT-81)

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.

Addendum: the stream layer, parts 25 and 26

  • 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, closes WT-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_stream sends 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_limit less 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. Closed: a received NEW_CONNECTION_ID and RETIRE_CONNECTION_ID are handled, and an issued ID can be USED when the connection moves (WT-70, closed at 9fb1f96; the part that stays the caller's is replacing an ID the peer retires, WT-171).

  • 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). Closed: RETIRE_CONNECTION_ID is sent when an ID is abandoned, and using an issued ID is wt_quic_connection_use_new_connection_id (WT-70, closed at 9fb1f96).

  • WT-83 (P3, c99, transport): the decoder's refusal of a NEW_CONNECTION_ID whose retire_prior_to is 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 with retire_prior_to > sequence closes 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.

Addendum: the listener's connection ceiling is a concurrency cap (WT-84)

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.

Addendum: a stream ended before its first byte (WT-86)

WT-86 (P2, swift, runtime) -- FIXED on main at 354480f and released as 1.3.8: 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.

Addendum: the packet and connection-ID layer, parts 34 to 36

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.

Addendum: the Retry tag and the decode-error close, parts 37 and 38

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.

Addendum: Phase 4 is complete (parts 34 to 39)

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 by tests/vectors/extract_rfc9001_retry.py and 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 whose retire_prior_to is 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_id accepted 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.

Addendum: Phase 5 has begun (HTTP/3 core)

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_t is 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.

Addendum: HTTP/3 SETTINGS (Phase 5, second part)

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 (0x02 to 0x05, section 11.2.2) is H3_SETTINGS_ERROR, and so is a value above one for ENABLE_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 + 0x21 identifiers 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.

Addendum: the HTTP/3 control stream (Phase 5, third part)

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.

Addendum: HTTP/3 GOAWAY (Phase 5, fourth part)

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.

Addendum: the frame-per-stream table (Phase 5, fifth part)

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.

Addendum: the request stream's frame order (Phase 5, sixth part)

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.

Addendum: Phase 6 has begun (QPACK's static table)

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 :method at 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.

Addendum: QPACK's prefixed integers and strings (Phase 6, second part)

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_bits bits, which refuses the entirely legal 0x80 above 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.

Addendum: QPACK's Huffman decoding (Phase 6, third part)

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 :authority value is written to tests/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).

Addendum: QPACK's Huffman encoder (Phase 6, fourth part)

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.

Addendum: QPACK's field line representations (Phase 6, fifth part)

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.

Addendum: QPACK's dynamic table (Phase 6, sixth part)

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_CLOSED for 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.

Addendum: QPACK's encoder stream instructions (Phase 6, seventh part)

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.

Addendum: QPACK's decoder stream instructions (Phase 6, eighth part)

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.

Addendum: QPACK's field section prefix (Phase 6, ninth part)

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.

Addendum: QPACK's field section decoder (Phase 6, tenth part)

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 - 1 for a dynamic reference and Base + Index for 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_LIMIT with 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_encode writes 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.

Addendum: Huffman strings on the way out (Phase 6, eleventh part)

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.

Addendum: whole QPACK field sections (Phase 6, twelfth part)

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_begin returns WT_ERR_AGAIN with 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".

Addendum: QPACK's encoder eviction bookkeeping (Phase 6, thirteenth part)

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.

Addendum: HTTP/3's message header rules (Phase 5, seventh 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.

Addendum: HTTP/3 messages (Phase 5, eighth part)

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_AGAIN all 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.

Addendum: the WebTransport session request (Phase 7, first part)

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_ENABLED refuses with 501 rather than serving a session the client could not have known about -- which is what makes the setting mean anything.

Addendum: WebTransport capsules (Phase 7, second part)

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_TRUNCATED with 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 (or WT_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.

Addendum: the WebTransport session lifecycle (Phase 7, third part)

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.

Addendum: the session's flow control (Phase 7, fourth part)

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.

Addendum: WebTransport stream and datagram framing (Phase 7, fifth part)

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.

Addendum: the public API's umbrella header (Phase 8, first part)

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.

Addendum: the public API's first substantive part (WT-87)

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.

Addendum: the public event-loop seam (WT-88)

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.

Addendum: the session's own flow control, and two Phase 7 corrections (WT-89, WT-90)

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.

Addendum: the sample consumer, the API contract, and a dropped test (WT-91, WT-92)

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.

Addendum: endpoints and trust on the public API (WT-93)

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.

Addendum: Phase 9 begins -- the HTTP/3 endpoint's own streams (WT-94)

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.

Addendum: request streams at the HTTP/3 endpoint (WT-95)

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.

Addendum: the QPACK decode path at the HTTP/3 endpoint (WT-96)

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.

Addendum: writing the request and the response (WT-97)

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.

Addendum: reassembling a stream's type prefix (WT-98)

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.

Addendum: starting an endpoint's own streams (WT-99)

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.

Addendum: HTTP/3 frame boundaries on a stream (WT-100)

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.

Addendum: WebTransport Swift 1.3.8 is published, with a green run of the tag (WT-101)

WT-101 (P2, swift, release, ci) -- CLOSED on main; the release is public at releases/tag/1.3.8. The tag alone was not the release; these were the publish-and-confirm steps, and all four are done.

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 reproducible artifacts across two independent clean arm64 builds.

Then the four steps this addendum was written to track:

  1. The CI run is green, and it is a run of the tagged revision. Run 34755613646 was dispatched on the tag because the push-triggered run for 13d29fd (34734361916) was cancelled by the workflow's own concurrency group when later commits reached main -- not starved by a runner backlog, which is what this row said before the run was read. All three jobs pass: macOS 26 / Swift 6.3.3, the peer-input fuzz job under ASan and the in-process suite under TSan. The run is green on a second attempt; the first failed listenerServesMoreSequentialSessionsThanTheDefaultCeiling with a runner-side Network is down (ENETDOWN), which is WT-185.
  2. The assets are uploaded -- WebTransportClient, WebTransportServer and SHA256SUMS -- built from a worktree at the tag rather than from main, so the binaries match the tagged source even though later commits had landed. Published sums: WebTransportClient f6de934c…, WebTransportServer fdd026fa…. They differ from the 9b2c2848…/d8abe2c3… this row recorded earlier because a raw Mach-O hash carries the linker's UUID; only the normalized hash (UUID zeroed) is stable across builds, which is what the script compares and what makes the reproducibility claim the right shape.
  3. The published assets are verified. Downloaded back from the release, shasum -a 256 -c SHA256SUMS passes for both, and both 40-scenario conformance suites were run against the downloads from the tagged checkout: passed=40 failed=0 total=40 each. That check found a real gap -- release-products and release-script-stale-spikes read Package.swift and Swift/build-release-apple-silicon.sh from the working directory, so from a directory holding only the assets the suite reports passed=38 failed=2, and the README's own download-and-run instructions therefore reported two failures. The README now says to chmod +x (a release upload does not carry the mode) and which two scenarios need a checkout; making them report "not in a checkout" rather than fail is WT-186.
  4. The interop boundary is stated. The release page says the containerized five-implementation matrix was last run against 1.3.5 and was not rerun for 1.3.8, which changes no wire encoding, rather than implying that interop evidence is per-release.

Addendum: the driver as a connection's frame handler (WT-102)

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.

Addendum: the outbound half through a transport table (WT-103)

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.

Addendum: the transport bound to a real QUIC connection (WT-104)

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.

Addendum: one options parser for the three CLI tools (WT-105)

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.

Addendum: the conformance report and the scenarios that can run (WT-106)

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.

Addendum: the tools' local socket (WT-107)

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.

Addendum: the packet session driver (WT-108)

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:

  1. The Initial keys come from the DESTINATION CONNECTION ID, in both directions, with the from_server flag 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.
  2. 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.
  3. 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-ms or be interrupted; the caller owns the clock and passes now. 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.

Addendum: a real handshake between two sessions over loopback (WT-109)

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.

Addendum: HTTP/3 joins the session -- three fixes and one open gap (WT-110, WT-111)

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_stream on the client accepts an 8-byte send on the request stream and returns WT_OK, but not one byte arrives and the client's stream->send_offset stays ZERO. send_offset is 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_stream itself showed it runs exactly ONCE on the server (stream 2, bidir=0, index=0, granted=8) and admits it. It never refuses anything, so STREAM_LIMIT_ERROR does 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).

Addendum: a whole WebTransport exchange crosses a real connection (WT-118)

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.

Addendum: the response routing bug, and where WT-115 stands (WT-116)

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_response returns 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.

WT-113 (P3, c99, runtime, quic) -- CLOSED on main at afbf491

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.

  1. 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.
  2. 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_request does both and says why in its comment.
  3. 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.

Addendum: the transport adapter must record what it sent (WT-112), and WT-110's next step

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.

Addendum: the client's opening sequence in one call (WT-114)

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.

Addendum: the response path, and the stream the server does not have (WT-115)

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:

  1. print, inside the STREAM branch, the stream's pointer both immediately after ensure_peer_stream and 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;
  2. check wt_quic_connection_is_closed and 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;
  3. if the stream is genuinely absent, wt_quic_connection_stream is 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.

Addendum: a self-signed identity for local development (WT-119)

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.

Addendum: a change that was reverted, and why that is the right outcome (WT-120)

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.

Addendum: a message on a WebTransport stream, and the session ID in the prefix (WT-121)

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.

Addendum: a message as a datagram (WT-122)

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.

Addendum: the conformance tool runs real IPv4 and IPv6 sessions -- Phase 9's criteria met (WT-123)

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.

Addendum: the tools run a real session loop, and the accept path is what is missing (WT-124)

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:

  1. 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;
  2. alternatively a peek on the UDP layer that leaves the packet for the connection to read;
  3. 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).

Addendum: the two CLI tools complete a session with each other (WT-124 closed, WT-126)

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.

Addendum: Phase 10 begins -- a malformed-input corpus for the layers above QUIC (WT-127)

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.

Addendum: the bounded tables, at their bounds (WT-128)

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.

Addendum: the tools' test covers both exchange modes (WT-129)

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.

Addendum: the split bidirectional prefix, attempted and reverted (WT-130)

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.

Addendum: the split bidirectional prefix, found by its counter (WT-130 closed)

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.

Addendum: the CLI tools' process contract, and the --help bug it found (WT-131)

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.

Addendum: the Definition of Done audit -- what is met, what is not (WT-132 to WT-136)

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.yml covers 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 has run-docker-interop.sh and 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.

Addendum: the draft-16 compliance matrix, with a checker that keeps it honest (WT-132 closed)

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_ERROR for a client, H3_STREAM_CREATION_ERROR for 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).

Addendum: the CLI tools over IPv6, with an honest skip (WT-133, first half)

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.

Addendum: the measured status, from the matrix rather than from memory (WT-136 closed)

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).

Addendum: seven refusal scenarios, twelve in the report (WT-133, second half)

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.

Addendum: the platform surface inventoried and checked (WT-134, first step)

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_PEEK cannot 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.

Addendum: the platform header, with POSIX behaviour unchanged (WT-134, second step)

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_close
  • wt_udp_platform_set_nonblocking
  • wt_udp_platform_wait_readable
  • wt_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:

  1. the datagram calls (recvmsg/sendmsg with struct iovec; the Windows form is WSABUF with WSARecvFrom/WSASendTo), which is the largest remaining piece; and
  2. the public int fd field, which a Windows port must widen to SOCKET -- 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.

Addendum: a conformance scenario found a real spec violation in our own parser (WT-137)

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 type H3_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:

  1. the parser (wt_http3_settings_parse must refuse wt_http3_setting_is_exerciser identifiers with H3_SETTINGS_ERROR);
  2. 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;
  3. this scenario, which flips from unsupported to passed.

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.

Addendum: the reserved-SETTINGS rule fixed in one focused pass (WT-137 closed)

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:

  1. the parser (wt_http3_settings_parse) refuses a reserved identifier (wt_http3_setting_is_exerciser, 0x1f * N + 0x21) with H3_SETTINGS_ERROR, which is what RFC 9114 section 7.2.4.1 requires;
  2. 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;
  3. the predicate's comment no longer claims the opposite of the section ("reserved to exercise the rule that unknown identifiers are ignored");
  4. 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, and test_http3_driver's oversized-settings payload, which built its size from 0x21 + i * 0x1f, the reserved family itself. The header now names WT_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.

Addendum: the datagram calls are one pass, not three edits (WT-134, third step)

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.

Addendum: the conformance report reaches thirty scenarios (WT-133, breadth)

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 is H3_CLOSED_CRITICAL_STREAM whether 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.

Addendum: the positive QPACK side, and a layering fact a failed assertion taught (WT-133)

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 :protocol token survive QPACK encoding and decoding. The token is the whole negotiation, so it is asserted byte for byte alongside :method, :scheme, :authority and :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.

Addendum: two sessions in one connection, and the datagram that belongs to neither (WT-133)

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 to CLOSED with its own code and refuses it new streams, while the second stays ESTABLISHED with 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.

Addendum: the first interop matrix, and the varint mistake it caught (WT-133)

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.

Addendum: the datagram interop matrix (WT-133)

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_ERROR and 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_size rather 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.

Addendum: the GOAWAY, close and drain matrix, and forty scenarios (WT-133)

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.

Addendum: the CONNECT interop matrix (WT-133)

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;
  • DATA before HEADERS is H3_FRAME_UNEXPECTED; HEADERS then DATA leaves the request in its body; ending a request before its HEADERS is H3_REQUEST_INCOMPLETE; a frame on a stream the endpoint never tracked is refused; and a client receiving a request stream is H3_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.

Addendum: the malformed and flow-control matrix, and all five interop matrices done (WT-133)

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, and HEADERS or DATA on it is H3_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.

Addendum: the release checks land in the package check, and find a real gap (WT-133)

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-products asks 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.txt now installs wt-client-c99, wt-server-c99 and wt-conformance-c99, naming the three targets rather than installing a bin/ directory wholesale. wt-api-sample exists to keep the documented public API compiling and is not a tool; no test binary is a product at all.
  • release-script-stale-spikes asks that a release not carry stale spike binaries. The C99 mirror is the same install tree: scripts/check-package.sh fails if anything matching test_*, *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.

Addendum: the flow-control matrix, and an assertion that was the thing at fault (WT-133)

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_DATA capsule establishes the limit; there is no default;
  • a repeated MAX_DATA is refused as WT_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.

Addendum: the mapping audit found a real feature gap, not a documentation one (WT-133, WT-138)

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.

Addendum: the negotiation is wired into the decision; the append path is what is left (WT-138)

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 is WT_ERR_LIMIT and 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 becomes WT_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 is WT_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.

Addendum: WT-138 closed, and the append path needed no new API (WT-138)

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-protocol field, 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.

Addendum: the datagram calls join the platform header (WT-134, step 1 complete)

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 (POSIX MSG_PEEK);
  • FULL_LENGTH -- report the datagram's own length rather than the copied one (POSIX MSG_TRUNC as 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 what PORTABILITY.md step 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.

Addendum: the coverage criterion is met, and what "met" rests on (WT-133 closed)

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.sh installs 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 and test_api_session; buffering -> the split-prefix scenario; the smoke matrix -> multi-session-isolation plus 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.

Addendum: the Windows branch is compiled now -- and that found a defect (WT-134)

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.sh compiles tests/windows/platform_probe.c -- a translation unit that names all six of the _WIN32 branch's operations and the datagram structure -- with mingw-w64 and the same warnings-as-errors the POSIX build uses. No cross-compiler means unsupported with 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 (macOS brew, Debian gcc-mingw-w64-x86-64) and runs it.
  • It found a real defect on its first run. FIONBIO does not fit a signed long on Windows (0x8004667E is above LONG_MAX), so passing it to ioctlsocket is 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_acquire is called before the socket is made and released in wt_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, so udp.c names one lifetime instead of carrying an #if.
  • The public handle is intptr_t, with WT_UDP_INVALID_FD as (intptr_t)-1 -- POSIX's -1 and Windows' INVALID_SOCKET both -- because a SOCKET is pointer-sized and an int field would truncate it silently. CMake links ws2_32, guarded by TARGET so 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.

Addendum: udp.c compiles for Windows, and the compiler named four more differences (WT-134)

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 * against const 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:

  • EHOSTDOWN does 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_ntop takes a size_t there and a socklen_t here, so the capacity needed a platform name;
  • setsockopt wants const char * for its option value there and const void * here;
  • a SOCKET is unsigned and pointer-sized, so storing it in the intptr_t field 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.

Addendum: the whole tree compiles for Windows, and the sweep found two more defects (WT-134)

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.c had four assignments to a local wt_webtransport_capsule_t that nothing read, left over from a version that built one. clang's -Wunused-but-set-variable does not diagnose it; GCC's does, and the mingw compiler is a GCC.
  • tests/unit/test_runtime_udp.c compared the socket's handle field with -1 -- right for a POSIX descriptor, a narrowing conversion for a pointer-sized SOCKET. It asserts WT_UDP_INVALID_FD now, 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.

Addendum: the whole tree LINKS for Windows, and the link found a defect (WT-134)

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 three ONLY modes 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 means unsupported with 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:

  1. docker run -p 54001:54001 publishes TCP. A UDP peer needs -p 54001:54001/udp. Without it the container's Udp: InDatagrams counter stayed at 0 while the client waited -- so the first "the server logs nothing" measurement was the harness, not the implementation. With /udp the counter moves.
  2. 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.c and scenario_session.c call 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_parameters asserts 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.

Addendum: the stall was the harness -- the client's socket saw ZERO packets (WT-135)

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.

Addendum: the client runs in a container now, and the remaining symptom is protocol-shaped (WT-135)

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 on debian: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's interop-docker contexts, 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.

Addendum: the oracle was on the wrong path -- the client DOES refuse the peer's packets (WT-135)

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.

Addendum: the refusal names no rule, and the handshake is nondeterministic (WT-135)

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_PROTOCOL is a parse-level refusal that never sets a close code;
  • the peer never sends CONNECTION_CLOSE either.

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 idle in 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->handshake IS used (the runtime drives it through wt_quic_handshake_on_frame and ..._on_lost), so the question is where state is 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.

Addendum: two instrumentation faults of my own, and then the real reading (WT-135)

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 said idle in 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.

Addendum: CONNECTED and never confirmed -- even with twenty seconds (WT-135)

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:

  1. 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.
  2. Would we process it if it did? The frame type is implemented (WT_QUIC_FRAME_HANDSHAKE_DONE, 0x1e, with handshake_done_pending and the confirmed transition), 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.

Addendum: DONE and CONFIRMED are separate states now, on purpose (WT-142)

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_pair asserts 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.

Addendum: the loop change is not a loop change -- the stall is at the first 1-RTT packet (WT-142)

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.

Addendum: WT-142 closed -- the missing half was the peer's limits (WT-142, WT-135)

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.

Addendum: the two ends disagree about the handshake -- and the capture says so (WT-135)

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.

Addendum: the exchange stops right after HANDSHAKE_DONE (WT-135)

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:

  1. 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;
  2. 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.

Addendum: the timeout path is right, so the silence is upstream of it (WT-135)

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:

  1. the receive path may not be recording the application-space packet as ack-eliciting, so ack_pending is never set and no acknowledgement is ever owed (wt_quic_ack_record is called after process_packet -- the question is what it is passed for an application-space packet);
  2. 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_frame is 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.

Addendum: both suspects cleared by reading, and the structural gap confirmed (WT-135)

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, and connection->received_at[space] = now is stamped right after -- so an ack-eliciting 1-RTT packet DOES set ack_pending and DOES start the acknowledgement delay.
  • send: send_one_frame registers every packet with wt_quic_loss_on_sent, including in_flight = 1 and 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.

Addendum: the interop stall is reproduced deterministically in a unit test (WT-135)

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_retransmitted runs 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.

Addendum: the root cause is one early return -- lost STREAM frames go nowhere (WT-135)

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:

  1. the runtime needs a lost-frame hook beside wt_runtime_session_set_frame_handler (which is for RECEIVED frames -- driver.h has no loss entry point at all: the word does not appear in it);
  2. the HTTP/3 driver needs to resend a stream range when told that the bytes at offset/length in 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.

Addendum: the hook is installed, and the test says the loss is never reported (WT-135)

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_stream does 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_lost reports a packet's frame only when tag < 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:

  1. 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
  2. it is declared lost but the descriptor is gone by then -- free_frame clears in_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.

Addendum: no packet is declared lost in any space (WT-135)

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_pump does call wt_quic_connection_on_timeout on every pump (the WT_ERR_AGAIN path does not return early -- checked), so the timers are being asked;
  • on_timeout declares losses only when wt_quic_loss_time(...) says a loss time has arrived, then arms the PTO through probe_time(...), whose first branch is wt_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.

Addendum: the root cause is the probe path -- a PTO sends a PING, not the data (WT-135)

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.

Addendum: the PTO is 1.33 s and the test window was 0.6 -- the mechanism was there (WT-135)

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.

Addendum: the driver retains the request now, and can send it again (WT-135)

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.

Addendum: the retransmission path never ran -- resends = 0 (WT-135)

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.

Addendum: the probe never fires -- the stall is not packet loss at all (WT-135)

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.

Addendum: the peer's HTTP/3 layer never saw a frame from us (WT-135)

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:

  1. "the peer refuses our connection" -- true, and fixed (WT-141, the missing initial_source_connection_id);
  2. "the two ends disagree about the handshake" -- a longer capture said no, the retransmissions stopped;
  3. "our packets are lost" -- the counters said no: nothing was lost, nothing was probed, everything was acknowledged;
  4. "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.

Addendum: the next hypothesis is timing, and the test of it needs a careful edit (WT-135)

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:

  1. 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;
  2. 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);
  3. 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.

Addendum: the keys match, so the peer CAN read us -- the request's content is what is left (WT-135)

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.

Addendum: the prefixes and the direction flag are right -- the frames inside are left (WT-135)

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 0 and the request with 1, and quic_open_stream passes that straight to wt_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.

Addendum: the driver's output is structurally right, and the request decodes (WT-135)

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:

  1. the SETTINGS payload's own contents -- whether WT_ENABLED is advertised correctly and whether something a peer requires is missing (this is the one part of our own output still unread);
  2. 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.

Addendum: the SETTINGS payload is right too, so everything we send is read (WT-135)

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.

Addendum: the peer cannot decrypt us -- the root cause is in TLS (WT-135)

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.c derives c hs traffic, s hs traffic, c ap traffic and s ap traffic from 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 by test_tls13_keyschedule and check-vectors.sh in 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.

Addendum: the client DID send its Finished -- the peer cannot read it (WT-135)

WT-135 (P1, c99, tls, quic, interop) -- a counter for packets sent per space answers the last question, and the answer moves the defect onto the TLS transcript:

"sent":{"initial":1,"handshake":4,"application":5}

The client sent four Handshake-level packets (its Finished flight) and five application ones -- so it is not "we never finished the handshake"; it is "the peer cannot read what we finished with". The peer derives a different client_handshake_traffic_secret than this client does.

What is already ruled out for that derivation: the LABELS are RFC 8446's own (c hs traffic, s hs traffic, c ap traffic, s ap traffic) and the key schedule is verified against RFC 8448's published vectors in CI. So the difference is in the transcript -- the bytes hashed, not the hashing -- and the reference to compare against is not the RFC text but a known-good implementation of it:

the Swift client interoperates with this very peer, so its transcript path is what our C99 one should match, message for message.

That is the next task, and it is a comparison rather than a hypothesis: record the handshake messages this client appends to its transcript (their type byte, three-octet length and body, and nothing else -- QUIC carries handshake messages with no record layer) and compare them, byte for byte, with the same exchange's transcript from an implementation that completes it with the same peer.

This is the tenth measurement in this interop investigation, and it is the first that points at the TLS layer rather than at QUIC, HTTP/3 or the harness -- which is where nine rounds of counting finally arrived. Four of those ten readings were overturned by later measurements, including three of my own deductions, which is why every step here is a counter or a log line rather than an argument.

86 CTest tests green in debug, release and ASan/UBSan.

Addendum: the local pair cannot validate the transcript -- only agree with itself (WT-135)

WT-135 (P1, c99, tls, interop) -- the ClientHello append sites are two ALTERNATIVE entry points (the caller's bytes, or the library's own build), each appending exactly once, so a double ClientHello is not it. The reasoning that follows is what this round contributes, and it is a constraint on how the defect can be found.

The C99 pair's success cannot validate this client's transcript. Both ends are the same code, so any mistake in which bytes are hashed is made identically by the client that hashes them and the server that hashes what it receives -- and the handshake still completes, because both sides compute the same wrong hash. A third-party peer hashes exactly the handshake messages RFC 8446 says to hash, so it disagrees. That is why the pair has passed for the whole life of this tree while aioquic says Decryption key is not available about a Finished this client really did send.

So the transcript must be checked against the RFC's list rather than against the pair, and the RFC's list is short: ClientHello, ServerHello, then -- for the secrets in question -- EncryptedExtensions, Certificate, CertificateVerify, Finished, in that order, each as the handshake message with its type byte and three-octet length and nothing else. QUIC carries handshake messages with no record layer, so a record header appearing in the transcript would be exactly this class of mistake: invisible to a pair that shares it, fatal to a peer that does not.

The test that settles it uses the machinery already in the tree: drive a local TLS client handshake and record every wt_tls13_transcript_append (type byte, length, running hash), then assert the sequence is the RFC's list -- which is a handful of assertions against a transcript that today has none, and it names the defect rather than narrowing it.

Where this investigation stands after ten measurements: QUIC, loss, HTTP/3 framing, stream types, QPACK content, the SETTINGS payload, the harness and the peer's own behaviour have all been measured and cleared; the defect is one handshake's transcript, it has been there since the TLS phase, and 86 CTest tests and 80,242 checks cannot see it because every one of them runs both ends of the same code.

The tree is unchanged this round; the record is the result.

Addendum: the transcript is exactly the RFC's list -- packet protection is what is left (WT-135)

WT-135 (P1, c99, tls, quic, interop) -- the transcript records the type byte of every message it absorbs, the client tool prints the list, and the interop run says:

"transcriptTypes":"0102080b0f1414"
 ClientHello 01, ServerHello 02, EncryptedExtensions 08, Certificate 0b,
 CertificateVerify 0f, Finished 14, Finished 14

Which is exactly RFC 8446 section 4.4.1's list for a client -- including its own Finished, appended after sending it -- and nothing else. So the transcript is NOT the difference: the fifth hypothesis in this interop work eliminated by a measurement, and the third of my own deductions to be overturned.

Two more pieces checked in the same pass, both correct:

  • wt_tls13_transcript_append refuses a message whose three-octet header length disagrees with its size, so a record header cannot be hiding in the transcript -- the contents are handshake messages or nothing;
  • the client's read/write mapping is the RFC's: read is the server's handshake secret, write the client's (wt_tls_client_handshake_secrets), and the QUIC layer installs them in that order.

What is left is packet PROTECTION for the Handshake epoch: the quic key/quic iv/quic hp derivation from the handshake traffic secret, or the nonce and AAD the packets are built with -- a mistake there is invisible to a pair that shares it and fatal to a peer that does not, which is precisely the shape of everything found so far.

Next: compare this tree's packet-protection inputs for the Handshake epoch against RFC 9001 section 5.1's labels and the nonce construction, and -- the sharper test -- protect a packet with a known secret and compare it byte for byte with RFC 9001 appendix A.2's published packet, which the tree already carries vectors for. If those pass, the difference is in which secret is fed in rather than in how it is used.

86 CTest tests green in debug, release and ASan/UBSan.

Addendum: the labels are right and the peer read us -- so it never got an acceptable ACK (WT-135)

WT-135 (P1, c99, tls, quic, interop) -- three more pieces checked, and together they force a different conclusion than the one the last round reached:

  • the packet-protection labels are RFC 9001 section 5.1's own: quic key, quic iv, quic hp, and quic ku for key update, each used once from one helper (src/quic/protection.c);
  • the protection itself is verified against RFC 9001's published vectors -- tests/vectors/rfc9001_vectors.h carries A.1's Initial keys and A.2's client Initial packet, checked by test_quic_protection and check-vectors.sh in CI;
  • and the peer's handshake messages reached us: the transcript recorded 08 0b 0f 14 (EncryptedExtensions, Certificate, CertificateVerify, Finished). Those can only be obtained by DECRYPTING the peer's Handshake-level packets -- so this client's handshake secrets match the peer's, and the peer can decrypt ours in return.

That contradicts "the peer cannot read our Finished". What the peer's log actually shows is: Decryption key is not available -- which a QUIC endpoint logs for a packet at an epoch whose keys it has discarded (Initial, after the handshake) -- followed by Loss detection triggered and Scheduled CRYPTO data for retransmission, repeating.

So the peer keeps retransmitting its Handshake flight because it never receives an acceptable ACK for it -- not because it cannot read our Finished. The defect is therefore in our client's Handshake-space acknowledgement: whether one is sent at all (one of its four Handshake packets should be an ACK-only packet), and whether the ranges it names are the packet numbers the peer actually sent.

Next: make the client say what it acknowledged. The connection counts what it receives per space; a counter for ACK frames SENT per space, plus the largest packet number each acknowledged, is the same kind of measurement that has settled every previous step -- and the peer's Scheduled CRYPTO data for retransmission is what "the ACK was not acceptable" looks like from its side.

This is the sixth hypothesis to be overturned by a measurement, and the second in a row that was mine. The sequence of eliminated candidates now covers QUIC loss, HTTP/3 framing, stream ids, QPACK content, the SETTINGS payload, the TLS transcript, the key directions and the protection labels -- with the acknowledgement path as what is left.

Addendum: the client IS acknowledging -- the ACK path is alive (WT-135)

WT-135 (P1, c99, quic, interop) -- the ACK counters landed, and they eliminate the hypothesis the last round ended on:

"acks":{"initial":[0,0],"handshake":[3,6],"application":[1,3]}
"sent":{"initial":1,"handshake":4,"application":5}

The client sends three Handshake-space acknowledgements naming up to packet 6, and one application-space acknowledgement. The path is alive and in the right spaces -- the seventh measurement in this interop work, and the fourth of my own hypotheses, to be eliminated by counting rather than by arguing.

What is left is narrower than a queue of suspects. The peer's retransmissions mean it does not consider its Handshake flight acknowledged while our client says it was, so either:

  1. the ACK names packet numbers the peer never sent, in which case a strict peer ignores it;
  2. the ACK never arrives -- it is inside a Handshake-level packet the peer cannot read after all (which the earlier transcript evidence argued against, and which one measurement could settle definitively);
  3. the peer's own retransmission logic is waiting for something else entirely (an ACK of a different space, or its own confirmation).

The peer's packet numbers are what would settle it, and its DEBUG log does not print them. That is the next thing to obtain: either by capturing and decrypting the peer's packets with this tree's own keys (which it has, for the handshake), or by finding a logging level in aioquic that names what it expects.

Where this stands: ten-plus measurements have cleared QUIC loss, HTTP/3 framing, stream ids, QPACK content, the SETTINGS payload, the TLS transcript, the key directions, the protection labels and now the ACK path. The interop criterion is doing exactly what it was written for -- every one of those was invisible to 80,242 checks that run both ends of the same code.

86 CTest tests green in debug, release and ASan/UBSan.

Addendum: the peer's TLS never leaves SERVER_EXPECT_FINISHED (WT-135, WT-143)

WT-135 (P1, c99, tls, interop) -- the peer's FULL log, unfiltered this time, names the exact stall point:

DEBUG Network path ('127.0.0.1', 44944) discovered
DEBUG QuicConnectionState.FIRSTFLIGHT -> QuicConnectionState.CONNECTED
INFO  Negotiated protocol version 0x00000001 (VERSION_1)
DEBUG TLS State.SERVER_EXPECT_CLIENT_HELLO -> State.SERVER_EXPECT_FINISHED
DEBUG Buffering QUIC event until connection is set: ProtocolNegotiated(alpn_protocol='h3')
DEBUG Registered handler for event EventType.SESSION_REQUEST
INFO  Accepting incoming connection
DEBUG WebTransport protocol handler initialized (client=False)
... and then nothing but "Decryption key is not available" and CRYPTO retransmissions

The peer's TLS machine enters SERVER_EXPECT_FINISHED and never leaves it. It is waiting for the client's Finished, and the packets carrying it are the ones it says it cannot decrypt. So the whole interop stall reduces to one sentence: this client's Finished never arrives in a form the peer accepts, and everything downstream (no application keys, no HTTP/3 frames, no request) follows from it.

That also reconciles the evidence that looked contradictory: our client DID decrypt the peer's EncryptedExtensions/Certificate/CertificateVerify/Finished (the transcript recorded 08 0b 0f 14), so the peer's write protection and our read keys agree -- while our write protection and the peer's read keys do not. The asymmetry is the whole defect, and it is why the pair cannot see it.

WT-143 (P2, c99, quic, tls) -- OPEN, found on the way, and it is the right shape to be the cause: the QUIC handshake protects Handshake and 1-RTT packets with connection->config.aead, a value the CALLERS hardcode to WT_AEAD_AES_128_GCM (apps/support/session_loop.c, apps/conformance/scenario_session.c), rather than with the cipher suite the TLS handshake NEGOTIATED -- which RFC 9001 section 5.2 requires ("the cipher suite is the one negotiated"). It happens not to bite today only because this client's ClientHello offers exactly ONE suite (WT_TLS_CIPHER_SUITE) and the hardcoded value matches it; the moment it offers a second, the two ends of this tree would still agree and a peer would not. Recorded as its own task rather than folded into this one: a latent defect that a single-suite ClientHello hides is exactly the kind that survives a whole port.

Next: find the asymmetry between our write protection and the peer's read protection for the Handshake epoch -- the AEAD (WT-143), the quic key derivation input, or the handshake secret fed in -- with the peer's SERVER_EXPECT_FINISHED as the fixed point to explain. This is the first round where the target is one packet rather than one layer.

Addendum: the key installation convention is right, so the asymmetry is in the key material (WT-135, WT-143)

WT-135 (P1, c99, quic, tls, interop) -- one more piece checked, and it narrows the asymmetry to the last place it can be:

install_level reads the convention literally and correctly:

set_keys(connection, space, /*inbound=*/1, keys_from(read_secret))    <- the peer's secret, for reading
set_keys(connection, space, /*inbound=*/0, keys_from(write_secret))   <- ours, for writing

and wt_quic_connection_set_keys's parameter IS named inbound (connection.h), so the two directions are installed the way they are named. wt_tls_client_handshake_secrets(&client, read, write) in turn returns the peer's secret first and ours second (read_out = server_handshake_secret, write_out = client_handshake_secret), which is the same convention. Both checked, both right.

So the asymmetry is not in the plumbing but in the KEY MATERIAL, and there are only two ways that can be:

  1. our write secret differs from what the peer derives for its read direction -- and the derivation is the same code that produces the read secret that provably works, so this would mean a difference in the transcript or the handshake secret ALONE for one direction, which the code does not do; or
  2. the packet is protected correctly from our keys but framed or numbered in a way that makes the peer's decryption fail -- a Handshake-level packet number or header the peer cannot reconstruct (RFC 9001's nonce is iv XOR packet_number, so a packet number the peer reconstructs differently makes the AEAD fail with exactly "decryption failed", which a peer reports as a missing key in some stacks).

That makes candidate 2 the target, and it is testable without the peer: capture one of our Handshake-level packets from the wire, parse its header with this tree's own packet reader, and check the packet number it reconstructs against the largest the peer would have seen -- a wrong truncated packet number, or a header protection mask applied to the wrong bytes, produces exactly this.

Where the whole investigation stands: two directions of the same key schedule, one working and one not, with every layer above and below measured and cleared. The next round's first action is to parse our own Handshake packets off the wire and check the two numbers the AEAD depends on -- the packet number and the header bytes -- since everything else about them is already verified against RFC 9001's vectors.

Addendum: the negotiated suite and the configured AEAD DO match -- so the target is the packet (WT-135, WT-143)

WT-135 (P1, c99, quic, tls, interop) -- the last cheap asymmetry is checked and it is not one:

#define WT_TLS_CIPHER_SUITE WT_TLS_CIPHER_AES_128_GCM_SHA256   /* src/tls/session.c */
config->aead = WT_AEAD_AES_128_GCM;                            /* the callers */

The suite this client offers -- and therefore the one the peer must select, since the ClientHello lists exactly one -- is AES-128-GCM-SHA256, and the AEAD the QUIC layer protects with is AES-128-GCM. They match, so the packet protection inputs agree and the asymmetry is not there.

That leaves exactly one place, and it is the one the last round named: the packet itself -- the truncated packet number, the header-protection mask, or the nonce's packet number -- since the secrets, the labels, the directions, the AEAD and the transcript have all been measured and cleared.

WT-143 stands as recorded (the AEAD comes from configuration rather than from the negotiated suite, which RFC 9001 section 5.2 requires): it is not this interop's cause today, because the ClientHello offers one suite, and it is exactly the kind of latent defect that a single-suite ClientHello hides. Fixing it is a small change with no behavioural difference today, and the reason to do it is the second suite, not this bug.

The next action, unchanged and now the only one: parse a Handshake-level packet this client sent, with this tree's own packet reader, and check the packet number and header bytes the AEAD depends on -- or run the Swift client against the same verbose peer for a working reference and diff the two handshakes. Both are measurements; neither is a hypothesis.

Where the investigation stands after twelve measurements: QUIC loss, HTTP/3 framing, stream types and ids, QPACK content, the SETTINGS payload, the TLS transcript, the key directions, the protection labels, the AEAD, the ACK path, the state of the peer's TLS machine and the installation convention have each been measured -- and each was invisible to the 80,242 checks that run both ends of the same code. The defect now has a single sentence: the peer cannot decrypt the Handshake-level packets that carry this client's Finished, while this client decrypts the peer's.

Addendum: the whole protection chain is verified -- so the secret itself must be compared (WT-135)

WT-135 (P1, c99, quic, tls, interop) -- the last unchecked link is checked, and the chain is now verified end to end:

/* src/quic/connection.c */
if (inbound) { connection->keys_in[space] = *keys;  connection->has_keys_in[space] = 1;  }
else         { connection->keys_out[space] = *keys; connection->has_keys_out[space] = 1; }

So every link is verified, each by a check rather than by reading alone:

link evidence
transcript contents wt_tls13_transcript_append refuses a message whose header length disagrees; the recorded types are RFC 8446's list (01 02 08 0b 0f 14 14)
secret derivation RFC 8446 labels, RFC 8448 vectors, check-vectors.sh in CI
direction mapping read_out = server_handshake_secret, write_out = client_handshake_secret, installed inbound=1 / inbound=0 in that order
AEAD negotiated suite is AES-128-GCM-SHA256; the configured AEAD is AES-128-GCM
protection RFC 9001 A.1/A.2 vectors
packet numbers RFC 9000 A.3 vectors
key installation set_keys stores inbound/outbound by name

And the symptom is one-directional: this client decrypts the peer's Handshake packets (its transcript contains the peer's four messages) and the peer cannot decrypt ours. With every mechanism verified, what is left is the secret itself -- this client's client_handshake_secret differs from the one the peer derives for its read direction -- and that can only be settled against an independent implementation, not against this tree.

The decisive measurement, and it is bounded: log this client's client_handshake_secret (hex) and the peer's ServerHello bytes, then derive the same value independently -- openssl or a twenty-line script over the same transcript (ClientHello and ServerHello, whose bytes this client has) -- and compare the two. If they differ, the transcript or the ECDHE input is the difference and the diff of the two derivations names it; if they agree, the difference is in how the packet is protected despite everything above, and the capture of one packet becomes the fixture.

This is the thirteenth measurement, and the first that requires a value from outside this tree. Twelve layers, mechanisms and counters have been measured and cleared; the defect is now a single 32-byte value whose two derivations have to be compared. That is as narrow as this investigation can get without the comparison.

Addendum: the peer CAN log its own secrets, so the comparison is possible (WT-135)

WT-135 (P1, c99, tls, interop) -- the last round's decisive measurement needed a value from outside this tree, and this round found where to get it: aioquic can write an NSS keylog.

>>> [n for n in dir(QuicConfiguration) if 'secret' in n.lower() or 'log' in n.lower()]
['quic_logger', 'secrets_log_file']

QuicConfiguration.secrets_log_file writes the standard CLIENT_HANDSHAKE_TRAFFIC_SECRET / SERVER_HANDSHAKE_TRAFFIC_SECRET lines -- the peer's OWN view of the very value this client derives and the peer cannot use. Comparing the two is the differential test, and it needs no secret dumping from the C99 side beyond the one value under test.

One obstacle, and its shape: the server the Swift tree's container uses is pywebtransport.create_development_server(host, port, generate_certs) -- three arguments, no configuration passthrough, so there is no way to hand it a secrets_log_file. The answer is a minimal aioquic peer of our own in tests/interop/peer/ (the same library, the same protocol, ~60 lines, with secrets_log_file set and a / echo route), which is a better fixture for this investigation anyway: it can log what it wants, at the level it wants, and it is ours to instrument.

The plan for the next round, in order:

  1. write that peer (aioquic's HTTP/3 server example is the starting point, with WebTransport enabled and a keylog);
  2. run the C99 client against it and capture both the peer's keylog and this client's client_handshake_secret;
  3. compare. Equal means the secret is right and the packet is the difference (and one captured packet becomes the fixture); different means the transcript or the ECDHE input differs, and the two derivations name which.

Where the investigation stands: thirteen measurements have cleared every layer, mechanism and counter between the socket and the request; the defect is one 32-byte value with two derivations, and the next round has both of them in hand. The SERVER_EXPECT_FINISHED state the peer never leaves is the anchor: whatever the comparison finds has to explain that single fact.

Addendum: the keylog peer exists, and the first run says why it produced nothing (WT-135)

WT-135 (P1, c99, tls, interop) -- both halves of the differential test now exist in the tree:

  • tests/interop/peer/aioquic_peer.py and Dockerfile.aioquic -- the smallest aioquic peer that completes a handshake and writes an NSS keylog. It does not serve WebTransport, because the question is the handshake secret and that is settled long before a request; what it adds over the pywebtransport container is configuration.secrets_log_file, which pywebtransport's three-argument development server cannot be handed;
  • WT_TLS_SECRET_LOG=<path> makes the C99 client append its own CLIENT_HANDSHAKE_TRAFFIC_SECRET to that path in the same format -- a diagnostic gated by an environment variable and documented as one, because it writes a traffic secret to a file.

The first run produced NO keylog lines on either side, and the likely reason is already recorded from an earlier round: the client was told to connect to wt-keylog:54010, a non-loopback address, and --trust local-development refuses to bypass certificate verification for one --

"the development bypass is refused for a non-loopback address"

-- which is exactly the message this harness produced the first time it was tried. The working harness puts the client in the peer's network namespace and connects to 127.0.0.1, and the next run does the same. That is a harness setting, not a code change.

So the next round is one command: run the client with --network container:wt-keylog, the keylog mounted, and WT_TLS_SECRET_LOG set; then compare the two CLIENT_HANDSHAKE_TRAFFIC_SECRET values. Equal means the secret is right and the packet is the difference; different means the transcript or the ECDHE input is, and the two derivations name which.

Where the investigation stands: thirteen measurements have cleared every layer, mechanism and counter between the socket and the request, and the fourteenth now has both sides of the value in hand -- with the peer's SERVER_EXPECT_FINISHED as the fact any answer has to explain.

86 CTest tests green in debug, release and ASan/UBSan.

Addendum: this client's client_handshake_secret reads as ALL ZEROS (WT-135)

WT-135 (P1, c99, tls, interop) -- the differential test ran, and it produced a value that explains the asymmetry:

ours:  CLIENT_HANDSHAKE_TRAFFIC_SECRET 00 0000000000000000000000000000000000000000000000000000000000000000
peer:  CLIENT_HANDSHAKE_TRAFFIC_SECRET 00 e43a270c41b31ad36c1948dc9c586d9bfdc2ead241dbf37e18ea68cc00eedc6b

This client's client-side handshake traffic secret reads as thirty-two zero bytes, while the peer derived a real one. If that is the value the keys are built from, the whole symptom follows exactly:

  • our client's write keys come from zeros, so the peer cannot decrypt our Handshake-level packets -- which is what it says, and why it never leaves SERVER_EXPECT_FINISHED;
  • our client's read keys come from the peer's secret, which is derived correctly, so this client decrypts the peer's messages -- which the transcript proves it does;
  • and both ends of the C99 pair derive the same zeros, so the pair completes and only a peer that computes the RFC's value disagrees. That is the shared-mistake shape this investigation has been chasing for a dozen rounds.

Two possibilities, and one measurement separates them:

  1. the secret really is never derived -- a defect in the TLS client's handshake-secret step, or the derivation writing elsewhere;
  2. the field is cleared after use -- in which case my dump reads a cleared struct and this is the FOURTH time in this interop work that the instrumentation was the thing at fault.

The discriminator is one dump at derivation time rather than after the handshake: print the secret inside wt_tls13_handshake_traffic_secrets's caller (or immediately after it), and read it again. Everything else about the comparison is now in place -- both sides write keylogs, and the peer's value is captured.

Why the dump exists at all is worth repeating: it is a gated diagnostic (WT_TLS_SECRET_LOG) written to answer a question that reading could not, and the first thing it produced was a value nobody expected. That is the fourteenth measurement, and the first that produced a specific suspect rather than another elimination.

Next: dump at derivation time, and if the value is still zero, read wt_tls13_handshake_secret's inputs (the early secret and the ECDHE shared secret) for the same handshake.

Addendum: the differential test worked -- the two handshake secrets DISAGREE (WT-135)

WT-135 (P1, c99, tls, interop) -- the value at DERIVATION time, next to the peer's own keylog:

ours (at derivation):  e36e192afce070dcf02ce65be397389af6944d7882aaff1cf0b562ef37dda87c
peer (its keylog):     e43a270c41b31ad36c1948dc9c586d9bfdc2ead241dbf37e18ea68cc00eedc6b

The secret is NOT zero. The previous round's reading was the CLI dumping a field the TLS client has already cleared after use -- the fourth time in this interop work that my own instrumentation was the thing at fault (varint transcription, oracle fields after a clear, a cursor loop that found nothing, and now a cleared secret).

And the values DISAGREE. The differential test has done exactly what it was built for: it turned "the peer cannot decrypt us" into "the two ends derive different client_handshake_traffic_secret values", which has only two possible inputs:

  • the ECDHE shared secret, or
  • the transcript hash.

The transcript's CONTENT is RFC-correct in the messages it absorbs -- the recorded types are 01 02 08 0b 0f 14 14 and wt_tls13_transcript_append refuses a message whose framing disagrees -- so the ECDHE input is the prime suspect: which of the two keys is fed to X25519, in which order, and with what byte order. That is exactly the class of mistake a pair of the same code shares and a peer does not, which is the shape every defect in this investigation has had.

Next, and it is one function: read the ECDHE step -- wt_tls13_handshake_secret(early_secret, ecdhe, ...) and where ecdhe comes from (the client's private key and the peer's public key, and the order they are passed to the X25519 scalar multiplication) -- and compare against RFC 7748 section 6.1's own vectors, which the tree already carries for the primitive. If the primitive is right and the wiring is right, the remaining input is the transcript BYTES rather than its message list.

Where this stands: fourteen measurements, four of them mine that were wrong, and the defect is now a single derivation whose two inputs are both checkable in the tree. The peer's SERVER_EXPECT_FINISHED is still the fact any answer has to explain -- and it is explained by exactly this: the peer cannot derive our keys because we did not derive theirs.

Addendum: every INPUT to the derivation is checked -- the transcript hash is the last one (WT-135)

WT-135 (P1, c99, tls, interop) -- the differential test said the two client_handshake_traffic_secret values differ, and this round walked the two inputs it can have. Both are wired correctly:

  • ECDHE: derive_after_server_hello takes the share the ServerHello's extensions produced (wt_tls_key_share_server(extension, &share) at the caller, not the client's own), and computes the shared secret from client->private_key and share->key -- the right two keys, in the right order, through the RFC 7748 primitive the tree already tests against that RFC's vectors;
  • the Early Secret: wt_tls13_early_secret uses a string of Hash.length zero bytes as the input keying material when there is no PSK, which is RFC 8446 section 7.1's own rule and RFC 8448's trace -- the comment there even records that an empty IKM would be a different HMAC key, which is the exact mistake available at that line and is not made;
  • the transcript's contents are the RFC's message list (01 02 08 0b 0f 14 14), and append refuses a message whose framing disagrees, so no record header can be in it.

So the last unchecked input is the transcript HASH for ClientHello...ServerHello -- not which messages went in (checked), but which BYTES they were. That is a comparison, not a reading, and it is now cheap: dump the two messages this client hashed (public data, both directions are messages it sent or received) and compute SHA-256 over their concatenation independently, then compare with this client's wt_tls13_transcript_hash at the same point.

If the hashes agree, then the derivation code and the inputs are all correct and the difference is in the handshake secret derivation between them (wt_tls13_handshake_secret, the HKDF-Extract of the ECDHE into the early secret), which is one function with a published vector for exactly this step; if they disagree, the bytes hashed are the difference and the diff names the message.

Where this stands: fifteen measurements, four of my own that were wrong, and every layer from the socket to the HTTP/3 request cleared except one 32-byte value whose inputs have each been checked by reading and whose bytes now have to be compared by computing. That is the last step this investigation can take without an independent implementation of the whole handshake -- and RFC 8448's trace is one, for a handshake with the same shape.

Addendum: the secrets MATCH the peer's -- the difference is in the packet (WT-135)

WT-135 (P1, c99, tls, quic, interop) -- the differential test, run properly, says the opposite of what the last round recorded, and the mistake was mine again:

ours (at derivation):  client=ee17bd3096d858fe9fa213423d68cae1d60152ec18e7dd10d209be3b4ca76ee1
                       server=6af72a5f9bb7d780cf655863040bfa8dba5fca4f5586eca9322ff822c75ff051
peer (its keylog):     CLIENT_HANDSHAKE_TRAFFIC_SECRET ee17bd3096d858fe9fa213423d68cae1d60152ec18e7dd10d209be3b4ca76ee1
                       SERVER_HANDSHAKE_TRAFFIC_SECRET 6af72a5f9bb7d780cf655863040bfa8dba5fca4f5586eca9322ff822c75ff051

Both directions match exactly. Our TLS key derivation is correct, and the peer has exactly the keys it needs to decrypt this client's Handshake-level packets.

Why the previous round said they disagree: the keylog APPENDS. The peer's file held the line from an EARLIER connection (the first line), and I compared a value from this run against a value from an old one. That is the fifth instrumentation mistake in this interop work, and the second that produced a false lead (the cleared-field dump being the other). The rule this work keeps relearning has a new clause: a file that appends is not a record of the run you just made.

What it does establish, and it is a large step backwards to a much smaller question:

  • the handshake secrets are RIGHT (c hs traffic and s hs traffic both match the peer's own keylog);
  • so the peer CAN derive the keys to read our Finished;
  • and yet it reports Decryption key is not available and never leaves SERVER_EXPECT_FINISHED.

That leaves the packet: the epoch it is sent in, its type bits, its header protection, or the packet number the peer reconstructs -- because every secret, label, transcript, AEAD and direction has now been compared against the peer's own view and agrees. The next step is the one named three rounds ago and now the only one left: capture a Handshake-level packet this client sent and parse it with this tree's own reader, comparing the two numbers the AEAD depends on.

And the harness lesson is worth keeping: the keylog must be cleared before each run (rm the file, and read the LAST line, not the first), because its whole value is being a record of one handshake.

Addendum: with the keys proven right, the packet is the whole question (WT-135)

WT-135 (P1, c99, quic, tls, interop) -- the state after the last three rounds, stated as one paragraph, because the ground under the investigation changed twice:

The TLS keys are RIGHT. Both directions of this client's handshake traffic secrets were compared against the peer's own NSS keylog -- cleared before the run, last line read -- and they match exactly:

ours client=ee17bd30...  peer CLIENT_HANDSHAKE_TRAFFIC_SECRET ee17bd30...
ours server=6af72a5f...  peer SERVER_HANDSHAKE_TRAFFIC_SECRET 6af72a5f...

And the peer still cannot read our Finished. It receives the packets (they cross loopback; our counters say four Handshake-level packets were sent, and the peer's own UDP counter moves), it holds the correct keys, and it stays in SERVER_EXPECT_FINISHED saying Decryption key is not available. With the secrets, labels, transcript, AEAD, directions and the RFC 9001/9000 vectors all checked, the only thing left that can make a correctly-keyed packet undecryptable is the packet itself: its type bits, its encryption level, its header protection, or the packet number the peer reconstructs.

The next step is a tool, not a reading, and it should be built the clean way: rather than parsing tcpdump -X output by hand (which this round tried and did not converge on), have the CLIENT write the bytes of each packet it sends to a file under an environment variable -- the same gated-diagnostic pattern the keylog uses -- and then a small test parses those bytes with this tree's own packet reader. That answers, for a real interop packet: which type bits, which space, which packet number, and what the header protection was computed over.

Where this stands after sixteen measurements: every layer from the socket to the HTTP/3 request has been cleared or corrected, four of my own readings have been overturned, and the defect is now a single packet whose bytes have to be looked at rather than reasoned about. The peer's SERVER_EXPECT_FINISHED remains the fact any answer must explain, and the keys are no longer a candidate for it.

Addendum: the packets are right too -- and the RFC 9001 vectors only cover INITIAL (WT-135)

WT-135 (P1, c99, quic, tls, interop) -- a gated diagnostic now writes what this client ACTUALLY sends (WT_QUIC_PACKET_LOG), and every packet is right:

sent space=0 type_bits=0 first=0xc6 length=1200 pn=0     Initial
sent space=1 type_bits=2 first=0xe6 length=80   pn=0     Handshake
sent space=1 type_bits=2 first=0xee length=46   pn=1     Handshake
sent space=2 type_bits=0 first=0x49 length=37   pn=0     short header

The Initial is padded to 1200 (RFC 9000 section 14.1), the Handshake packets carry type bits 0b10 -- which header protection does NOT mask (RFC 9001 section 5.4.1) -- the 1-RTT packets use a short header, and the packet numbers start at zero in each space.

So three independent things now agree: the secrets (compared against the peer's own keylog), the packets (read off the wire), and the derivations (RFC 8446/8448 labels and vectors). And the peer still says Decryption key is not available and never leaves SERVER_EXPECT_FINISHED.

Which leaves the PROTECTION of a Handshake-epoch packet, and one fact makes that a specific suspect rather than a guess: the RFC 9001 vectors this tree carries are A.1/A.2 -- the INITIAL epoch. The Handshake epoch calls the same functions with different secrets, so a mistake in the parts that differ -- which secret is used for which direction at that level, the nonce's packet number at that level, or the header-protection sample offset -- is invisible to every vector the tree has and to the pair, which shares it. The Initial epoch cannot show it.

Next: protect one Handshake-epoch packet with a chosen secret and packet number, and check the nonce, the AAD and the header-protection sample against RFC 9001 section 5.3/5.4 by hand -- or, better, add a Handshake-epoch vector: RFC 9001's appendix A uses Initial, so the vector has to be constructed from the RFC's own rules rather than copied, which is exactly the kind of test that would have caught this.

Where this stands: seventeen measurements, five of my own that were wrong, and three independent artefacts (secrets, packets, derivations) now agree while the peer still cannot read one packet. The suspect list has one item.

Addendum: the peer now writes a qlog, which is the artefact this needed (WT-135)

WT-135 (P1, c99, quic, interop) -- the keylog peer also sets configuration.quic_logger = QuicFileLogger(...), because a keylog says what the peer's secrets are and a qlog says what the peer DID with each packet -- including the ones it could not read, and why. It is the only artefact in this investigation that can say why a packet was dropped rather than that it was, and the whole last three rounds have been asking exactly that question from the outside.

The first run wrote no qlog (the path handling or the image rebuild needs checking), so the next round starts there: confirm the peer image carries the change (docker logs), give the logger a directory it can create files in, and then read the events -- quic:packet_dropped, quic:packet_received and the TLS handshake events, per connection, with the reason each carried.

Why this is the right next step rather than another derivation check: three independent artefacts now agree -- this client's secrets match the peer's keylog exactly, its packets are correctly typed and numbered, and the derivations are RFC-verified -- while the peer still cannot leave SERVER_EXPECT_FINISHED. Every remaining hypothesis is about why a correctly-keyed packet was not processed, and that is a question only the receiver can answer. The qlog is the receiver answering.

Where this stands: eighteen measurements, five of my own that were wrong, three artefacts agreeing, and one question left that no amount of reading this tree can settle -- the peer has to say what it did with the packet. The harness for that is one line of configuration away.

Addendum: the qlog needs a flush, not a fix (WT-135)

WT-135 -- the qlog's directory is created by the peer script now (aioquic refuses a missing one, with the exact message this artefact is being added to read), and the run after that fix still produced no file. The likely reason is aioquic's own buffering -- it flushes per connection, and the peer container is removed the moment the client returns -- so the next run keeps the peer alive briefly after the client exits, or reads the peer's own log for an error, before the file can be trusted.

Everything else is in place: the peer writes keylogs and qlogs, this client writes its secrets and its packets on request, and the three artefacts that agree (secrets, packets, derivations) have left one question -- why a correctly-keyed packet was not processed -- which only the receiver can answer.

Addendum: the qlog is a dead end in this aioquic version -- and the alternative is bounded (WT-135)

WT-135 (P1, c99, quic, interop) -- three rounds have gone into getting the RECEIVER's own account of a packet it could not read, and this one ends it:

  • the peer sets configuration.quic_logger = QuicFileLogger(dir), and the directory now exists (aioquic refuses a missing one);
  • the run after that, with the peer left alive five seconds past the client's exit so a flush could happen, still produced no qlog file, and the peer's own log reports no error.

So QuicFileLogger on a serve()-created connection does not produce a file in this version, and the remaining options for the receiver's view are not worth more rounds: reading aioquic's internals to find where it drops a packet, or patching aioquic in the container.

The bounded alternative, and it answers the same question from our side: decrypt one Handshake-epoch packet that this client sent, using the peer's own secret from its KEYLOG, with an INDEPENDENT implementation (cryptography in a container, twenty lines). That is the "construct the vector" test the last two rounds have been pointing at, and it needs nothing from the receiver:

  1. this client writes the packet bytes (WT_QUIC_PACKET_LOG already writes space, first byte, length and number -- extend it to the bytes);
  2. the peer's keylog gives CLIENT_HANDSHAKE_TRAFFIC_SECRET;
  3. an independent script derives quic key/quic iv/quic hp, removes header protection, and opens the AEAD;
  4. the same script then does it with the SAME packet as this tree would -- and any difference between the two answers is the defect, named by the step at which they diverge.

That is a stronger test than the qlog would have been, because it also exercises our own protection code against a second implementation rather than only observing the peer's behaviour -- and it is the test this tree should have had all along: RFC 9001's vectors cover the INITIAL epoch, and nothing covers HANDSHAKE.

Where this stands: nineteen measurements, five of my own that were wrong, three artefacts agreeing (secrets, packets, derivations), one question left, and now one bounded plan for it rather than a queue.

Addendum: the packet OPENS with the peer's own secret -- independently (WT-135)

WT-135 (P1, c99, quic, tls, interop) -- the second implementation was written and run, and it settles the last three rounds:

pn_length=1: OPENED, packet_number=0, plaintext=060024140000203cdab8a35b110d1a2ae91d09ebe0c8b2a1

That is the first Handshake packet this client sent, opened with the CLIENT_HANDSHAKE_TRAFFIC_SECRET from the peer's own keylog, by tests/interop/peer/decrypt_packet.py -- which derives quic key/quic iv/quic hp, removes header protection and opens the AEAD without using a line of this tree's code. Read as RFC 9000 frames and RFC 8446 messages:

  • 06 CRYPTO frame, 00 offset 0, 24 length 36;
  • 14 000020 TLS HandshakeType 0x14 (Finished), length 32 -- 32 bytes of verify_data, exactly what a Finished is.

So the packet is well formed, correctly numbered, correctly protected with the key the peer derived, and carries exactly the Finished it should. Three rounds of suspicion about the packet end here.

What that relocates the defect to: the CONTENT of the Finished rather than its carriage. A Finished's verify_data is a transcript hash; if this client's transcript hash differs from the peer's, the peer decrypts the packet fine and then rejects the Finished -- which is a TLS alert, and aioquic's DEBUG log would say so if it reached that point. The peer's log has to be re-read around this packet, because "Decryption key is not available" (what was seen) and "the Finished is wrong" (what the evidence now points at) are different failures.

And the tools this took are worth keeping: WT_QUIC_PACKET_LOG writes the packet bytes, the keylog peer writes the peer's own secrets, and decrypt_packet.py is the independent implementation. Together they can answer, for any packet on the wire, what it is -- which is what seventeen rounds of this investigation were missing.

Where this stands: twenty measurements, five of my own that were wrong, and the first positive result of the whole interop effort: this client's QUIC Handshake packet is CORRECT, verified by a second implementation using the peer's own key. The remaining question is one TLS verify_data.

Addendum: the peer's five failures are NOT the Finished -- they are our 1-RTT packets (WT-135)

WT-135 (P1, c99, tls, quic, interop) -- the peer's log, counted rather than grepped, says exactly one thing five times and nothing else:

5  DEBUG Decryption key is not available
5  DEBUG Loss detection triggered
4  DEBUG Scheduled CRYPTO data for retransmission
   (and eleven INFO lines about starting up and accepting a connection)

No TLS error, no HTTP/3 error, no "bad Finished". Put beside the independent decryption that opened this client's Finished with the peer's OWN key, that count has only one reading: the five packets the peer cannot decrypt are not the Finished. The Finished is Handshake-epoch and opens; the packets that "have no key" are the application-space ones -- four of the seven this client sent -- which arrive while the peer's handshake is incomplete, and which a QUIC endpoint discards with exactly that message.

So the peer is not failing to read us at all, and its handshake still does not complete. Its four CRYPTO retransmissions are its own Handshake flight going unacknowledged, and its state stays SERVER_EXPECT_FINISHED. The only remaining explanation is that it decrypts the Finished and rejects its verify_data -- a transcript-hash difference -- and that pywebtransport's logger swallows the TLS alert that would say so.

That is the last hypothesis standing, and it is checkable in this tree now: with the peer's keylog giving the handshake secret and this client's own messages available, the Finished's verify_data can be computed independently (finished_key = HKDF-Expand-Label(client_handshake_traffic_secret, "finished", "", 32), then HMAC(finished_key, Transcript-Hash(ClientHello..CertificateVerify))) and compared with the 32 bytes the decryptor recovered: 3cdab8a35b110d1a2ae91d09ebe0c8b2a1.... If they differ, the transcript this client hashes is the defect, and the independent implementation that says so is already in the tree.

Where this stands: twenty-one measurements, five of my own that were wrong, and the investigation has narrowed from "a peer that cannot read us" to "a peer that reads us and disagrees about one hash". The tools for the last step -- keylog, packet log, independent decryptor -- are all in the tree, and the next round needs only to compute one HMAC.

Addendum: the hashed ClientHello is captured; the sent one is one decryption away (WT-135)

WT-135 (P1, c99, tls, quic, interop) -- WT_TLS_TRANSCRIPT_LOG makes the client write the ClientHello it appends to its transcript, at both entry points (the first attempt instrumented only one and the run produced nothing, which is how the second was found):

hashed-clienthello length=187 bytes=010000b7030364100bc98dd4bfa08a...

187 bytes, starting 01 00 00 b7 -- HandshakeType 0x01 (ClientHello) with a body of 183 -- which is well formed.

With the packet log writing the Initial packet this client SENT, the two can be compared byte for byte, and the sent one can be obtained independently: an Initial packet's keys come from the connection ID (RFC 9001 section 5.2's HKDF with the client in/server in labels and the RFC's salt), so tests/interop/peer/decrypt_packet.py can be extended to derive them and open the Initial without a keylog at all.

That comparison decides the last hypothesis in this investigation. If the bytes this client hashed differ from the bytes it sent, then:

  • the transcript is wrong, so the peer's Finished verification fails -- a TLS alert pywebtransport swallows;
  • while the packet decrypts perfectly -- which is what the independent decryptor showed;
  • and the defect is a re-encoding between "build" and "send", invisible to a pair that shares it.

Where this stands: twenty-two measurements, five of my own that were wrong, and three artefacts (the hashed ClientHello, the sent packets, the peer's secrets) now captured in one place. The next round is one decryption and one comparison, and both tools are committed.

Addendum: the decryptor takes an Initial, and needs one more debugging step (WT-135)

WT-135 (P1, c99, tls, interop) -- the independent decryptor now has an Initial mode: it derives the Initial keys from the connection ID (RFC 9001 section 5.2's salt and the client in label), so the ClientHello's own packet can be opened with no keylog at all -- and the packet log now writes the whole packet (the previous 80-byte dump limit could not open a 1200-byte Initial, which the first attempt proved by failing).

The AEAD still does not open, and the reason is inside the tool rather than in this tree: the derivation, the sample offset and the header protection each have a subtlety, and the tool is the newest code in the chain -- with five instrumentation mistakes already recorded in this work, it gets the same scepticism as everything else.

What is established is everything the comparison needs:

  • the hashed ClientHello: 187 bytes, 01 00 00 b7 …, well formed;
  • the sent Initial: 1200 bytes, complete, with its connection ID in the clear.

So the last step is one debugging round in a tool, and the tool is committed. When it opens, the CRYPTO payload of that Initial is the ClientHello as it went on the wire, and comparing it byte for byte with the 187 bytes above settles the transcript question that the last four rounds have narrowed to.

Where this stands: twenty-three measurements, five of my own that were wrong, and the defect has gone from "a peer that cannot read us" to "a peer that reads us and disagrees about one hash" -- with all three artefacts needed to prove it captured and committed. The tree itself is unchanged and green.

Addendum: the client hashes EXACTLY what it sends -- proven independently (WT-135)

WT-135 (P1, c99, tls, quic, interop) -- the decryptor opens an Initial packet now, after two fixes of its own (both worth the comments they carry):

  • RFC 9001's initial_secret is the HKDF-EXTRACT output; asking cryptography's HKDF for 32 bytes gives Expand(PRK, "", 32) = HMAC(PRK, 0x01), a different value -- that was one round lost;
  • an Initial carries a Token field between the source connection ID and the Length, and skipping it put the header-protection sample one byte out.

With those, the ClientHello's own packet opens without a keylog (the keys come from the connection ID) and its CRYPTO payload is the message as it went on the wire:

plaintext 06 00 40bb 01 0000b7 03 03 5b34ec92...
          CRYPTO, offset 0, length 187, ClientHello (0x01) of 183

and compared byte for byte with the 187 bytes this client appends to its transcript:

sent   (374 hex): 010000b703035b34ec927ade1235ab10...
hashed (374 hex): 010000b703035b34ec927ade1235ab10...
IDENTICAL

So the client hashes exactly what it sends. The transcript's first message is not the difference, the secrets match the peer's own keylog, and the packets are correctly typed and numbered.

What is left, in order of the evidence: the REST of the transcript (the peer's messages, hashed as this client receives them -- already shown to be the RFC's message list), or something outside the transcript. The next concrete candidate is the destination connection ID our Handshake packets carry: a peer drops a packet addressed to a connection ID it did not choose, before any key is consulted, and this client's own server may not enforce that routing while aioquic does. The same three tools compare that one byte range.

Where this stands: twenty-four measurements, five of my own that were wrong, and the positive results now outnumber the eliminations -- the secrets match, the packets are right, and the transcript's first message is byte-identical to what was sent. The investigation is one routing field away from the end of its list.

Addendum: THE ROOT CAUSE -- this client never adopts the server's chosen connection ID (WT-135)

WT-135 (P1, c99, quic, interop) -- the routing candidate from last round is not a candidate. Reading our own logged packets side by side:

Initial:    c3 00000001 08 1122334455667788 08 1122334455667788 ...
Handshake:  e5 00000001 08 1122334455667788 08 1122334455667788 ...
                     ^--- DCID ------------^

Both carry the same Destination Connection ID -- the one hardcoded in the tool's configuration (1122334455667788) -- and that is wrong: RFC 9000 section 7.2 requires a client to use the SERVER's Source Connection ID as the Destination Connection ID of every packet after the ServerHello. The server chose its own ID in that message, and this client never adopts it.

And the code says why: connection->peer_connection_id is written once, from the configuration at start (src/quic/connection.c), and the peer's initial_source_connection_id transport parameter is only named and checked (src/quic/transport_parameters.c) -- nothing adopts it.

That explains every measurement in this investigation at once:

  • our packets are well formed, correctly typed, numbered and protected -- verified by an independent decryptor with the peer's own key;
  • our transcripts and secrets are right -- verified against the peer's own keylog;
  • and the peer drops our Handshake packets because they are addressed to a connection ID it did not choose, which a receiver does before consulting any key. Hence "Decryption key is not available", the endless CRYPTO retransmissions, and SERVER_EXPECT_FINISHED that never advances.
  • It is invisible to the C99 pair because this tree's own server does not enforce CID routing -- both ends accept the hardcoded ID -- which is the shared-mistake shape every defect in this investigation has had.

The fix is narrow and its home is known: wt_quic_connection_set_peer_parameters (which already parses the peer's parameters) should adopt the peer's initial_source_connection_id as the destination connection ID for sending -- updating connection->peer_connection_id, its length and config.peer_connection_id, which is what the packet builder reads. A Retry's retry_source_connection_id is the same idea one message later and belongs in the same place.

The test that would have caught it does not exist and is worth adding with the fix: a connection whose peer chooses a DIFFERENT source connection ID must send its next packet to that ID -- a unit assertion over the built packet's header bytes, which is exactly the kind of thing this tree's packet tests can read.

Where this stands: twenty-five measurements, five of my own that were wrong, and the interop criterion has produced a defect that no test in the tree could see: the client speaks to the right address and the wrong connection ID.

Addendum: THE INTEROP SESSION WORKS -- the C99 client talks to an independent implementation (WT-135)

WT-135 (P1, c99, quic, interop) -- the first successful interop, at fad9cd2:

client: "established":true  "connectAccepted":true  "responseStatus":200
peer:   INFO Starting handler for session ...
        INFO Handler task created for session ...
        INFO session ready path=/

The C99 client has completed a WebTransport session with pywebtransport/aioquic -- an implementation this tree shares no code with -- and the peer's own WebTransport handler reports the session ready at the path it asked for.

What made the difference is one rule this endpoint never followed: RFC 9000 section 7.2 -- after the ServerHello, a client addresses every packet to the Source Connection ID the server chose. Nothing did that; the destination ID was written once from the configuration, so the peer dropped every packet sent after the handshake as belonging to another connection, before consulting any key. wt_quic_connection_set_peer_parameters, which already parses the peer's parameters, now adopts initial_source_connection_id as the destination ID for sending.

Why it took twenty-six measurements to see. Every artefact was correct except the address on the envelope: the packets were typed, numbered and protected right; the Finished opened with the peer's OWN key in an independent decryptor; the secrets matched the peer's keylog to the byte; the transcript's first message was byte-identical to what was sent. Each of those was verified because the peer kept refusing, and each verification eliminated a layer until one field was left.

And why the entire test suite missed it: 86 CTest tests, 80,242 checks, 46 conformance scenarios and two real sessions over IPv4 and IPv6 all passed with the client addressing the wrong connection ID, because every one of them runs both ends of this same code and this tree's server does not enforce CID routing. That is the interop criterion's justification, written as a result rather than as an argument.

Remaining for the criterion: the echo payload (receivedBytes is still 0, so the exchange is established and accepted but the message does not come back yet), and the other two containerized peers (quinn, quiche), which the harness from round 123 runs with one command each.

Addendum: the session is accepted end to end; the MESSAGE does not arrive (WT-135)

WT-135 (P1, c99, interop) -- with the connection-ID fix, the peer's own log shows the whole session path working and then stopping at exactly one place:

INFO ALPN negotiated protocol h3
INFO Received WebTransport session request: Fm8OD9b73pi9-eislfhtFg for path '/'
INFO Processing session request: session_id=..., stream_id=0
INFO Routing session request for path '/' to handler 'echo'
INFO Accepted WebTransport session: ...
INFO SESSION_READY event received for session ...
INFO Session ... is ready (path='/').
INFO Starting handler for session ...
INFO session ready path=/

and nothing after it -- no stream in:, no datagram in:. The client reports client: ok, response 200, received 0 byte(s) on a stream, so the CONNECT was accepted and the response read, and the message this tool then sends on its WebTransport stream never reaches the peer's handler.

That is a much smaller question than any of the last twenty-six, and it has three candidates, all checkable with the artefacts already in the tree:

  1. the client's message is never sent -- send_message opens a bidirectional stream and writes the WebTransport prefix plus the payload; the client's own stream counters (streamsOpened) and the packet log would say whether a stream was opened and whether packets went out after the response;
  2. it is sent on a stream the peer does not accept as a WebTransport stream -- the prefix names request_stream_id (0), and the peer's stream_id=0 for the session matches, so this is the least likely;
  3. it is sent but the peer's handler is not yet attached to the stream -- the peer logged session ready before the exchange, so this needs its own evidence.

The first measurement is the client's own counters plus the packet log, both of which are already there: if streamsOpened.bidi is 1 after the handshake (only the CONNECT), the message was never sent; if it is 2 and packets went out, the question moves to the peer's handling.

Where this stands: the interop criterion's first half is met -- a session established and accepted by an independent implementation -- and the second half (the exchange) is one counter away from being localised.

Addendum: THE EXCHANGE WORKS -- the prefix belongs to the stream's initiator (WT-135, WT-144, WT-145, WT-146)

The interop criterion is met. The C99 client against pywebtransport/aioquic in a container now completes the whole session and the message exchange:

client: ok, response 200, received 13 byte(s) on a stream
peer:   INFO stream in: 13 bytes
peer:   INFO stream echoed

--connect 127.0.0.1:54001 --exchange stream --message hello-interop against the peer's echo handler. This is the criterion no local test can satisfy, because every local test runs both ends of this same code.

The last measurement, and the whole of it. The client's own counters and its packet log answered the previous addendum's three candidates in one run: streamsOpened: {bidi: 1, uni: 4}, sent.application: 7, receivedBytes: 0. So the message was sent (the fourth unidirectional stream was the data stream, ahead of the response), the peer's echo never arrived, and the peer's own debug log ended with stream echoed followed 94 microseconds later by Connection close received (code 0x1, reason ) -- 0x1 being INTERNAL_ERROR, which this tree sends from deliver_to_handler when a frame handler refuses and named no code.

Four defects, found in this order, each one visible only from outside:

  1. the message was sent as a unidirectional stream while the Swift library's exchange opens a bidirectional one and sends with endOfStream: true -- and an unfinshed stream cannot be answered by a peer that reads it to its end (await stream.read_all()), which is exactly what the echo handler does;
  2. --exchange stream with no --message sends the prefix and FIN alone, which is a valid stream and a silent one: the peer's if frame_data or stream_ended has nothing to report that a client could count. The interop script now names a message, exactly as check-cli-session.sh does;
  3. with both of those fixed the peer logged stream in: 13 bytes and stream echoed, and the client still received nothing -- because the answer on a stream carries no prefix: the draft gives the signal value and the session ID to the stream's initiator (§4.2, §4.3), so the responder's bytes on the same stream are payload. Our client classified hello-interop's first byte (0x68, a two-byte varint) as a signal value, refused it, and closed the connection with INTERNAL_ERROR -- while the tool printed "status":"ok";
  4. the driver's field-by-field initialiser had left data_stream_count uninitialised, which segfaulted test_http3_driver the moment the receive path asked how many data streams there are. wt_http3_driver_init is now a single memset with the one non-zero field named: the "name every field so a new one forces a visit" style had already failed at exactly the thing it was there for.

The fix is one function and one rule. wt_http3_driver_open_data_stream opens the stream, writes the prefix, sends the bytes with fin, and remembers the stream ID; wt_http3_driver_owns_data_stream is what the receive path asks before it classifies anything. The driver now also learns which session it serves -- start_session and send_response set it from the CONNECT stream's ID, which nothing had ever done, so driver->session_id_set was 0 in every real run and the prefix's session check was dead. test_http3_driver_streams gained the mirrored test: the prefix as QUIC's own varint encoding (40 41, not one byte), the ownership, the answer arriving as payload with no prefix, and the other half of the rule -- an unowned stream's bytes are still a prefix's business.

WT-144 (P1, c99, cli, runtime, observability) -- OPEN, and the next task. A tool must not report success after it has killed the connection. The run above printed "status":"ok" while the client had sent CONNECTION_CLOSE with INTERNAL_ERROR, because process_packet deliberately returns WT_OK once the connection is closed and pump_once discards the pump's status. The connection should record what this endpoint actually closed with -- the code, the frame type, and the status the refusing handler returned -- and the CLI should report it and exit non-zero. This is the defect that hid the real one for several rounds; it is worth its own task.

WT-145 (P2, c99, interop, http3) -- NEW. quinn completes the QUIC handshake and the client reports handshakeState connected with application keys, but the CONNECT is never answered (response 0, timeout, 5 packets seen, 2 discarded). A handshake that completes against an independent stack and a session request that is ignored is one layer up from WT-135 and should be the next interop question after WT-144.

WT-146 (P3, c99, interop, quic) -- NEW. quiche does not complete the handshake at all: the client ends in client-waiting, Initial keys only, 5 packets seen and 5 discarded. Either it refuses something in our ClientHello or transport parameters, or its server needs a parameter we do not send. Worth one capture on the peer's side.

State: 86/86 CTest tests pass, test_http3_driver_streams is at 41 checks, and the repository's own scripts/score-matrix.sh re-scores the interop criterion from "not met" to met for the pywebtransport peer, with WT-145 and WT-146 recording the two peers that are not there yet.

Addendum: WT-144 closed -- a tool may not report ok after it killed the connection (WT-144)

WT-144 (P1, c99, cli, runtime, observability) -- CLOSED at 116132b. The defect was not in the protocol, it was in what the tools could SAY, and it is the reason the exchange hunt took as long as it did: for several rounds wt-client-c99 printed "status":"ok" for a session it had itself ended with CONNECTION_CLOSE and INTERNAL_ERROR.

The mechanism, exactly. A frame handler that refuses leaves close_code/close_frame_type/close_code_set as a HINT so the connection can name the handler's code in the close it sends; deliver_to_handler then clears that flag before calling close_with. So the only close field the report read was zero whether or not a close had been sent, and a caller asking "what did we close with, and why" read a connection that looked untouched. Modern sibling: process_packet returns WT_OK once the connection is closed (deliberately), and pump_once discarded the pump's status, so the failure reached nobody at all.

What landed:

  • wt_quic_connection_close_state -- the close THIS endpoint sent (kind, error code, frame type, reason), which is the record of what the peer was told; wt_quic_connection_close_cause -- the status of the handler whose refusal closed it, WT_OK when the close was deliberate or the peer's. The cause is stored where the hint is cleared.
  • the oracle, both tools' JSON (closeKind, closeSentErrorCode, closeSentFrameType, closeCause) and both tools' human output carry it, printed even when the status is ok, which is the whole point;
  • wt_loop_run_client/wt_loop_run_server return the cause instead of WT_OK when their own close ended the run, so status can no longer claim success for a connection the endpoint killed. A deliberate close with no refusal is WT_ERR_PROTOCOL.
  • test_quic_connection: 991 checks (up from 912) -- a refusing handler leaves a readable transport close naming INTERNAL_ERROR with no frame blamed and the hint cleared, and a handler that names its own code gets that code and frame type into the close the peer is told about. The opposite direction is guarded as well: check-cli-session.sh asserts a HEALTHY session reports "closeKind":0 ... "closeCause":"ok" on both ends, so the fix cannot break the tools by inventing a close.

Honest limit. The true-positive path is covered at the library level and the app forwards it in six lines; no CTest entry drives a hostile peer into making our endpoint refuse one frame and then asserts the tool exits non-zero. WT-147 records that.

WT-147 (P3, c99, tests, interop) -- NEW. A negative CLI test with a refusing/hostile peer: one frame our endpoint must refuse, then status non-zero, closeKind 1, closeCause naming the layer, and the peer's own code in closeSentErrorCode. It needs a small in-tree stub peer that completes a handshake and then misbehaves, which is the same shape run-container-interop.sh already has for well-behaved ones.

State: 86/86 CTest tests pass in debug, release and ASan+UBSan (80 test programs, 80,335 checks), the container interop still completes the exchange against pywebtransport, and main is at 116132b.

Addendum: WT-145 is four defects deep -- and each one was invisible from inside (WT-145, WT-148)

WT-144 closed at 116132b (recorded in the previous addendum); this round's work is WT-145, and it is the most productive interop round so far: four real defects found, all four fixed, none of them visible to any test in this tree, because every local test runs both ends of this same code.

Where quinn is now. quinn used to be "handshake completes, CONNECT unanswered". After the four fixes its handshake completes fully, the connection stays alive for 179 packets, its application packets are acknowledged (acks.application up to 64), and the client probes and retransmits normally -- but the CONNECT is still not answered. That is one layer further in, and it is a much more specific question than the one we started with.

The four defects, in the order the measurements found them:

  1. max_idle_timeout in the wrong unit. RFC 9000 section 18.2 defines it in milliseconds and this runtime compared it against a microsecond clock, so quinn's 30000 (30 s) became a 30 ms limit: the connection was closed silently (section 10.1 sends nothing) while the peer was still preparing its answer. Local tests never saw it because both ends read the same wrong number, and test_quic_peer_limits had encoded the bug in three places -- the same value on both sides of the assertion. The conversion now happens once, at the peer-parameters boundary, with a saturating multiply for the varint's huge values, and the test names the wire value in milliseconds and the runtime's in microseconds. pywebtransport's default (60000 ms) had survived only because the exchange finishes inside 60 ms -- the accident that let the container interop start working at all.
  2. CRYPTO refused in the 1-RTT space. frame_forbidden_in_space said "forbidden in Application" for CRYPTO, but Table 3 of RFC 9000 section 12.4 gives CRYPTO IH01; only 0-RTT forbids it (RFC 9001 section 4.6.1) and this tree implements no 0-RTT. A consequence of the fix was the next defect, which is how it was confirmed:
  3. A post-handshake NewSessionTicket failed the whole handshake with CRYPTO_ERROR/unexpected_message (alert 10, code 266). RFC 8446 section 4.6: the handshake is not the end of the CRYPTO stream, and a client that does not resume accepts and ignores the ticket; the CONNECTED state now does, while still refusing what really is unexpected there (KeyUpdate changes the keys and is not implemented).
  4. Two reporting defects, both caught the moment the report was PARSED rather than grepped. The server's --json was invalid -- "pin":"..."closeKind":0, a missing quote and comma from appending the close fields -- and the client wrote a leftover DIAG mode=... line to stderr. Every existing assertion matched a substring, so both shipped. check-cli-session.sh now runs a JSON parser over every report line, which is what a caller does. This is the same lesson as WT-144, one level down: the tool's output had never been checked as the format it claims to be.

WT-148 (P3, c99, cli, tests) -- CLOSED with this round's commit: wt_quic_connection_close_was_sent separates a close that was SENT from one that was only decided on. close_sent cannot: the silent idle timeout sets it too, because it means "send nothing further". Without the distinction the new close reporting would have announced an idle timeout as a connection this endpoint told the peer about -- the same untruth as WT-144, in the other direction -- and it is what "closeSent":false on a healthy session now asserts.

WT-145 (P1, c99, interop, http3) -- OPEN, one layer in. With the handshake healthy the client sends the CONNECT, quinn's packets arrive and are acknowledged, and no response headers are ever delivered to the session sink. The next measurements are the same ones that localised the exchange: our own requestStreamId/stream counters (is the CONNECT on the wire complete), and the peer's own view of the request -- quinn's echo server logs nothing per connection, so the next step is a capture or a qlog from the peer rather than more of our counters.

WT-146 (P3, c99, interop, quic) -- still OPEN and unmoved by these fixes: quiche never completes the handshake (5 packets seen, 5 discarded, Initial keys only, client-waiting), so its question is still the first one: what does quiche refuse in our ClientHello or transport parameters.

State: main at 78a86ec; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,371 checks; the pywebtransport interop still completes the whole exchange.

Addendum: the draft-16 settings a WebTransport endpoint MUST send, and the ones this tree did not (WT-145, WT-149, WT-150)

WT-145 is three more defects deep. The measurement that opened the round was the packet pattern of the quinn run: 115 of our 150 application packets were 29 bytes (acknowledgements and probes), quinn sent two packets for every one of ours, and our client acknowledged quinn's application packets -- a live connection in which the CONNECT was simply never answered. Then the peer's own source answered the question: web-transport's supports_webtransport() requires ENABLE_DATAGRAM == 1 (0x33) and a WebTransport setting, and the only codepoints it looks for are WEBTRANSPORT_MAX_SESSIONS (0xc671706a) and the pre-draft-06 pair (0x2b603742/0x2b603743) -- not the draft-16 SETTINGS_WT_ENABLED (0x2c7cf000) this tree sends. Its check returned zero, so its server never saw a WebTransport endpoint and never answered.

Three defects, all of them draft requirements, none of them visible to a suite whose two ends are this code:

  1. The client advertised only SETTINGS_WT_ENABLED. Draft-16 section 3.1's list for a client is SETTINGS_H3_DATAGRAM = 1 plus, for a draft version, the version codepoint. wt_webtransport_settings_apply now owns the whole set for both roles -- the same precedent as wt_quic_transport_parameters_build owning the mandatory transport parameters -- and it sends the pre-rename enabling codepoints too, because section 7.1 negotiates a version with one codepoint per version and a deployed peer recognises none of the others. A server also sends SETTINGS_ENABLE_CONNECT_PROTOCOL, without which RFC 9220 makes a :protocol request illegal.
  2. The client never sent initial_max_stream_data_bidi_remote. RFC 9000 section 18.2: the credit for data the peer sends on streams this endpoint opened -- the response, and every answer on a WebTransport data stream. Absent means zero, and a peer that honours the limit may send nothing back at all, which is the entire session. aioquic's server answered anyway, which is the only reason the container interop ever worked; quinn's does not.
  3. The server never opened a control stream and never sent a SETTINGS frame. RFC 9114 section 6.2.1 makes both mandatory for any HTTP/3 endpoint, and draft-16 section 3.1 makes the settings the thing a client waits for before establishing a session -- so wt-server-c99 was not a server a third-party client could have talked to. This tree's own client never checked, which is why nothing failed: the same "both ends are this code" blind spot as every other defect in this interop story.

Tests: test_webtransport_session_request asserts the whole advertised set for both roles (35 checks), and test_quic_transport_parameters reads the credit parameters back off the wire (150 checks).

WT-145 (P1, c99, interop, http3) -- OPEN, and the next measurement is the PEER's view. quinn still does not answer the CONNECT (handshake healthy, connection alive, its packets acknowledged, no response headers, no close). Our own counters have now said everything they can: seven defects have been extracted from them and each fix moved the peer further without producing an answer. The next step is to read the wire, not our counters.

WT-149 (P2, c99, quic, transport, tests) -- NEW. Add the empty reset_stream_at transport parameter that draft-16 section 3.1 lists for both roles. This tree implements the RESET_STREAM_AT frame (test_reset_stream_send) but never advertises the extension, so the mandatory "both endpoints send an empty reset_stream_at parameter" is unmet. The parameter's codepoint must come from the reliable-stream-reset draft rather than be guessed, which is why it is a task and not a line in this commit.

WT-150 (P2, c99, interop, tooling) -- NEW. Make BOTH directions of the wire readable from this tree. The client can already dump its own packets (WT_QUIC_PACKET_LOG) and dump the TLS secrets at derivation (WT_TLS_SECRET_LOG), and tests/interop/peer/decrypt_packet.py opens an Initial packet -- but nothing opens a 1-RTT packet, so "did the peer answer our CONNECT, and with what?" cannot be asked of a peer that logs nothing. Extending the decryptor to the application space, driven by the keylog the client already writes, is what turns WT-145 from a search into a reading.

State: main at a2fda05; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,390 checks; the pywebtransport interop still completes the whole exchange.

Addendum: WT-145 IS SOLVED -- the peer's connection ID was adopted one pump too late (WT-145, WT-151, WT-152)

The C99 client now completes a whole WebTransport session against quinn, not only against pywebtransport/aioquic:

peer:   session established / stream in: 13 bytes / stream echoed
client: ok, response 200, received 13 byte(s) on a stream

and the shape of the run confirms it: 2 Handshake packets and 0 probes, where the failing runs sent 7 Handshake packets and 32 probes over six seconds.

Two counters and one log made the search finite.

  1. packets_acked, new in the oracle and the client's JSON, said quinn acknowledged 119 of 125 application packets -- so it was reading us, and choosing not to answer. That single number separated "the peer cannot read us" from "the peer reads us and will not answer", which is the question seven rounds of fixes had been guessing at.
  2. The quinn peer now initialises a tracing_subscriber when RUST_LOG is set (it had no logging at all, which is why its view could not be read). Its own trace then said, in three lines, exactly what was wrong:
ignoring non-initial packet for unknown connection 1122334455667788
dropping short packet during handshake          (x4)
... established                                 3.5 seconds later

The defect. Our client flushed its Finished in the same pump that completed its handshake -- and that flush still used the connection ID the client had chosen, because the peer's transport parameters (and with them the peer's Source Connection ID, RFC 9000 section 7.2) were only adopted at the TOP of the next pump. apply_peer_parameters is now called on both sides of the receive: once before, as before, and once after, so a packet that carries the parameters and completes the handshake takes effect before anything is flushed.

The consequence was a cascade that looked like anything but a connection-ID bug: quinn dropped the Finished as a packet for an unknown connection, so its handshake never completed; so it dropped every 1-RTT packet that followed ("dropping short packet during handshake"); so it took two probe timeouts before a retransmitted Finished reached it; and by then the tool's --timeout-ms had nothing left to spend. Our client, meanwhile, believed the session was established and reported "status":"timeout" on a connection that had never actually started. pywebtransport tolerated the stale ID, which is precisely why the defect survived every local test: both ends of a local session use the same eight connection-ID bytes, so the ID never has to change.

WT-151 (P2, c99, cli, quic, interop) -- NEW, and the reason a local test cannot guard this. Both tools use one hardcoded connection-ID constant for both roles, so a local session never exercises adoption or the DCID rule. A server must choose its OWN Source Connection ID and send the client's initial DCID as original_destination_connection_id (RFC 9000 section 7.3, which the client validates). The app has the data to do it -- the first datagram it peeks -- and wt_quic_transport_parameters_build already takes both IDs; the CLI passes one for both. Until this lands, the regression guard for this round's fix is the container interop rather than CTest, which is the wrong place for it.

WT-152 (P2, c99, quic, tests) -- NEW. The receive path never checks the Destination Connection ID of an arriving packet against the IDs this endpoint issued, so a packet for another connection is processed anyway. RFC 9000 section 10.2 makes discarding them the rule, it is what makes off-path injection pointless, and -- with WT-151 -- it is what would let a local test catch a stale-DCID send: an endpoint that routes by connection ID cannot be fooled by one that does not.

WT-146 (P3, c99, interop, quic) -- still OPEN, and unmoved: quiche never completes the handshake (5 packets seen, 5 discarded, Initial keys only, client-waiting). Its question is still the first one: what does quiche refuse in our ClientHello or transport parameters. Worth one capture, now that a peer's own view is readable.

WT-149 (P2, c99, quic, transport, tests) -- still OPEN: the empty reset_stream_at transport parameter draft-16 section 3.1 requires of both roles.

State: main at 9c47a5c; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,390 checks; two of the three containerized peers now complete a whole WebTransport session and the message exchange (pywebtransport/aioquic and quinn/web-transport).

Addendum: the connection IDs are real now, and the SERVER half of the rule was missing (WT-151, WT-153)

WT-151 closed at 39fb86b. WT-145's fix had no local guard, and the reason was one constant: both CLI tools used the same eight connection-ID bytes for both roles, so a client that never adopted the peer's Source Connection ID behaved exactly like one that had. Making the two differ was the whole task -- and it immediately exposed the server half of the same rule.

What a third-party client would have hit. A client chooses the destination connection ID of its first Initial arbitrarily (RFC 9000 section 7.2), so a server cannot know it from its configuration. This server accepted only packets addressed to its own configured ID, which worked solely because the client happened to share the constant. Any real client would have been refused outright -- its Initial discarded as a packet for another connection. That is the server-side counterpart of WT-145, and no test in this tree could see it either.

What landed:

  • wt_quic_connection_set_original_destination_id tells a server what the client chose; wt_runtime_session_start_server sets it from the initial_connection_id it already had for the Initial keys (RFC 9001 section 5.2 uses the same value), and the receive path accepts it until the handshake is confirmed.
  • the CLI server picks its own Source Connection ID and reads the client's two IDs from the first Initial it already peeks -- Source is who it answers, Destination is the original_destination_connection_id a client validates (RFC 9000 section 7.3).
  • wt_quic_long_header_connection_ids reads exactly those two IDs from the front of a datagram. wt_quic_long_header_decode cannot: it reads the Length field and hands back a view of the payload, so it needs the entire packet. The first attempt at this change used it with a 64-byte peek, got WT_ERR_TRUNCATED for every Initial, and made the server accept nothing at all and time out -- a reminder that a listener peeks a prefix, which is a different read from a receiver's.
  • the conformance session scenario uses distinct IDs too, so the in-process path exercises adoption and the new rule instead of sidestepping both.

Tests: test_quic_packet reads the IDs from a prefix and refuses truncation, a short header and a missing fixed bit (131 checks); test_quic_connection asserts a server accepts its client's chosen ID, delivers the frame, and still discards a genuinely unknown one (1,052 checks, up from 991). And check-cli-session.sh -- stream, datagram and IPv6 -- is now a real guard for round 189's ordering fix: a client that flushed its Finished to its own ID would be dropped by this server.

WT-152 (P2, c99, quic, tests) -- CLOSED as already implemented. The receive path does validate the Destination Connection ID (local_connection_id_sequence, RFC 9000 section 5.2), which is why the local CLI session became a guard the moment the IDs differed. The task was written on the assumption that it did not; the assumption was wrong, and WT-151 is what made the check matter.

WT-153 (P1, c99, interop, tests) -- NEW, and now the largest remaining hole in the interop evidence: no third-party CLIENT has ever talked to this tree's SERVER. run-container-interop.sh drives our client against peers only, so every server-side defect -- including the one this round fixed -- is found only by reading the code. A second runner that points a peer's client (aioquic and quinn both have one in the Swift tree's interop-docker contexts) at wt-server-c99 --listen is the mirror of the runner that found seven defects on the client side, and it is now the highest-value interop work left.

WT-146 (P3, c99, interop, quic) -- still OPEN: quiche never completes the handshake. WT-149 (P2, c99, quic, transport) -- still OPEN: the empty reset_stream_at parameter draft-16 section 3.1 requires.

State: main at 39fb86b; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,434 checks; pywebtransport and quinn both complete a whole WebTransport session and the message exchange against the client.

Addendum: a third-party CLIENT against our server -- two defects in one run (WT-153, WT-154)

WT-153's runner exists and works, and it found two real defects the moment it ran. scripts/run-container-interop-server.sh starts wt-server-c99 --listen in a container, a pywebtransport/aioquic client joins its network namespace, and the run is asserted on BOTH sides' reports -- the server must see the session and receive the peer's message. It exits non-zero when a peer does not complete, unlike the client-side runner, because this one exists to prove something; it is deliberately not a CTest entry, since Docker is not a test dependency.

It proved round 190's fix on the first run. The third-party client completes the handshake -- with a destination connection ID it chose itself, which the old server would have discarded. That is the server-side connection-ID rule confirmed against a real client rather than against our own tools.

And then the CONNECT was refused, twice over:

  1. The authority was compared exactly. RFC 9114 section 4.3.1 makes :authority the target URI's authority, so a client on a non-default port sends 127.0.0.1:54070 -- and this server's policy names a HOST. It refused every real client that named the port it was actually talking to, which is every real client. The comparison now ignores the port, found from the END and only outside a bracketed IPv6 literal (::1 is full of colons that are not separators), and a policy that names no authority serves any. CLOSED at 56da3f3.
  2. The peer's :protocol decoded as "localhostort" instead of "webtransport", so the request was judged "not WebTransport". Captured by a new gated dump (WT_HTTP3_SECTION_LOG) and decoded independently with pylsqpack in the peer image, the section is
0000cf2f00b95d8749c87a3f89f058d360ea4567b13fd7c15086a0e41d139d09
:method CONNECT / :protocol webtransport / :scheme https / :path / / :authority localhost

Our decoder gets the correct NAME for the field line and a wrong VALUE, which points at the literal-with-literal-name representation's Huffman value path (RFC 9204 section 4.5.6: 001 N H NameLen, a Huffman name, then H ValueLen). This tree's own encoder never produces that combination, which is why every test in it passed.

WT-154 (P1, c99, http3, qpack, tests) -- NEW, with its evidence already in hand. Fix the third-party decoding, and add the 32-byte section above as a vector: it comes from an independent encoder, pylsqpack decodes it to the five pseudo-headers, and our decoder must agree. The runner will be the end-to-end proof: it currently reports the server's own line, "request":"CONNECT localhostort localhost /", which is exactly what a wrong decoder looks like from outside.

WT-155 (P3, c99, cli, diagnostics) -- NEW. The server's report now carries the decoded request, the session layer's outcome, its status and the HTTP/3 error -- which is what turned "status":"protocol" into two named defects -- but the CLIENT has no equivalent: its --json has no field for the response's decoded status when a peer answers something unexpected. The same one-run diagnosis should be possible in both directions.

State: main at 56da3f3; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,444 checks. Client direction: pywebtransport and quinn both complete a whole session and the message exchange. Server direction: the runner exists, the handshake succeeds against a third-party client, and the CONNECT is one QPACK fix away.

Addendum: WT-154 closed -- a field's bytes must survive the fields after it, and the server now ACCEPTS a peer's session (WT-154, WT-156)

WT-154 CLOSED at 1c404c9. The third-party client's CONNECT had decoded as :protocol: localhostort, and that value is the explanation: "localhost" is the :authority field that comes later in the section, written over the head of "webtransport" and leaving the tail of the old value behind -- which is what a scratch buffer shared by every field line looks like from outside.

wt_qpack_field_section_next reset its scratch cursor on every call, and wt_http3_message_decode keeps pointers into that scratch. So each literal value was decoded over the previous one, and only the last field's bytes were ever readable. The cursor belongs to the SECTION now: it lives in wt_qpack_field_section_decoder_t, begin resets it, and the walker advances through the caller's buffer. This tree's own encoder never produced a literal with a literal NAME, which is why every test in it agreed with every other one.

The change needed a bound as well: with an accumulating cursor, capacity - *scratch_used wraps once the cursor passes the end, and the decode would write past the caller's buffer. A section with more inline strings than the buffer holds is the caller's LIMIT, which is what it reports now -- and the existing "too small scratch" test is what caught it.

The regression vector is the peer's own section: 0000cf2f00b95d8749c87a3f89f058d360ea4567b13fd7c15086a0e41d139d09, which pylsqpack decodes to :method CONNECT / :protocol webtransport / :scheme https / :path / / :authority localhost. The test reads all five fields FIRST and asserts them afterwards, so it fails on any decoder that lets a later field overwrite an earlier one. 75 checks in test_qpack_field_section, up from 57.

End to end this moved the server runner a long way. The peer's session is now accepted ("connectAccepted":true, "requestOutcome":0) and the client sends its 25-byte message. The server then fails with "closeCause":"truncated" on a STREAM frame -- named by the new closeCauseFrame field, which is the only reason that is a fact rather than a guess.

WT-156 (P1, c99, http3, webtransport, tests) -- NEW, and the state of the server direction. The CONNECT stream carries the session's capsules after the response (draft-16 section 5), and the driver parses that stream's bytes as HTTP/3 FRAMES: a peer's flow-control capsule is read as a frame type and a frame length, and when the length reaches past the end of the stream the driver returns WT_ERR_TRUNCATED at FIN -- which the QUIC layer turns into a CONNECTION_CLOSE with INTERNAL_ERROR. Two things to fix, and they are separable: route the CONNECT stream's post-response bytes to the session layer's capsule parser, and make an incomplete frame at FIN an H3_FRAME_ERROR stream error rather than a connection close. This tree's own client sends no capsules, which is why nothing in it ever saw either.

WT-155 (P3, c99, cli, diagnostics) -- still OPEN: the client has no equivalent of the server's new request/requestOutcome/h3Error/closeCauseFrame reporting.

State: main at 1c404c9; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,315 checks. Client direction: pywebtransport and quinn both complete a whole session and the message exchange. Server direction: the handshake succeeds, the session is accepted, the peer's message is sent -- and the CONNECT stream's capsules are the next thing to route.

Addendum: BOTH DIRECTIONS INTEROPERATE -- the server answers a third-party client (WT-156, WT-153)

A third-party client now completes a whole WebTransport session with wt-server-c99, sends a message and receives the server's answer:

peer:   established true, sentBytes 25, receivedBytes 13, received "pong-from-c99"
server: status ok, connectAccepted true, receivedBytes 25

Together with the client direction (pywebtransport/aioquic and quinn/web-transport), this tree now speaks the protocol with independent implementations both ways, which is what the interop criterion was always about.

WT-156 CLOSED at 7228b3b. The driver classified the WebTransport prefix correctly and then forgot it. aioquic sends the prefix in one STREAM frame and the message in the next, so the next frame on the same stream took the request-stream path: its bytes were parsed as HTTP/3 frames, a frame type was read out of the message text itself, and the parser waited for a length that never came until FIN -- where the driver returned WT_ERR_TRUNCATED and the QUIC layer closed the connection with INTERNAL_ERROR. That is the "closeCause":"truncated" the closeCauseFrame field (added last round) named.

This tree's own client writes the prefix and the message in one frame, which is exactly why every test in the tree passed. The gated WT_HTTP3_STREAM_LOG dump -- the diagnostic added this round -- showed the peer's two frames and made it a fact rather than a theory:

stream=4 offset=0 has_length=1 length=3  fin=0 bytes=404100
stream=4 offset=3 has_length=1 length=15 fin=1 bytes=68656c6c6f2d66726f6d2d70656572

wt_http3_driver_is_data_stream now answers for both directions: the table holds every stream whose prefix is SETTLED, whether this endpoint opened it or classified the peer's, and the receive path consults it first. remember_data_stream is the one place that records one, bounded like the endpoint's request table (32, refused with WT_ERR_LIMIT rather than silently mis-routed). test_a_data_stream_the_peer_splits_across_frames is the regression test.

The server direction reached that in two runs and found three defects: the authority comparison (:authority carries the port a real client is talking to), the QPACK value bug (a field's bytes must survive the fields after it, WT-154), and this one. That is what a runner is for: none of the three was visible from inside.

WT-157 (P3, c99, http3, diagnostics) -- NEW. Three gated dumps now exist for interop work (WT_QUIC_PACKET_LOG, WT_TLS_SECRET_LOG, WT_HTTP3_SECTION_LOG, WT_HTTP3_STREAM_LOG) and each was added under pressure during an investigation. They deserve one page in C99/docs/ saying what each one records, how to turn it on, and what question it answers -- so the next person does not rediscover them, and so the cost of having them in the library is a documented decision rather than an accumulation.

WT-158 (P2, c99, http3, webtransport) -- NEW, and the other half of WT-156. An HTTP/3 frame that ends part way through at FIN is an H3_FRAME_ERROR stream error (RFC 9114 section 7.1), and this driver returns WT_ERR_TRUNCATED to a handler whose only option is to close the CONNECTION with INTERNAL_ERROR. The peer's bug is fixed, but a peer that really does end a frame early should lose the stream and not the session.

State: main at 7228b3b; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,469 checks. Client direction: pywebtransport and quinn. Server direction: pywebtransport's client. quiche does not complete the handshake at all (WT-146).

Addendum: WT-158 closed -- a refusal is the APPLICATION close RFC 9114 asks for (WT-158, WT-159, WT-147)

WT-158 CLOSED at 17d2959. RFC 9114 makes a frame that ends part way through at FIN a connection error of type H3_FRAME_ERROR, so closing the connection was already right -- but this tree closed the TRANSPORT with INTERNAL_ERROR: a different frame (0x1e instead of 0x1d), a different code, and a peer that cannot tell which rule it broke. Every HTTP/3 refusal had that shape, because a handler's only way to refuse was to return a status and deliver_to_handler had a transport code and nothing else.

  • wt_quic_connection_refuse_application leaves an APPLICATION hint beside the transport one, and deliver_to_handler closes with wt_quic_close_application when it is set. The encoder already emits the 0x1d form with no frame-type field for that kind, so the bytes follow the state.
  • wt_http3_driver_last_error is how the code gets there: the driver records the HTTP/3 error of its last refusal and side_on_frame -- the boundary between the two layers -- translates it. The routing body moved behind a route_quic_frame that writes through &driver->last_error, so every return path records the code without repeating itself. A refusal with NO HTTP/3 error (a caller's own bound, WT_ERR_LIMIT) leaves the connection's default in force, because that is not an HTTP/3 error at all.

One trap, and it is the mirror of the memset lesson from WT-151: "no error" is not zero in the HTTP/3 error space (WT_HTTP3_NO_ERROR is 0x100), so a zeroed last_error would have read as a refusal with code 0 and the app would have sent an application close for a bound. wt_http3_driver_init names it. Two rounds, two memsets, two different ways for a zero to mean the wrong thing.

Tests: test_an_http3_refusal_is_an_application_close (kind, code, and -- through the encoder -- that the frame has no frame-type field) and test_a_frame_that_ends_at_fin_names_the_http3_error (H3_FRAME_ERROR for a truncated final frame, and no error for a frame that is merely incomplete). 1,084 checks in test_quic_connection and 53 in test_http3_driver_streams.

WT-159 (P2, c99, tests, conformance) -- NEW. The application-close rule is asserted at the QUIC layer and by the driver's recorded code, but no end-to-end path exercises it: nothing in this tree makes a peer break a rule and then checks what IT was told. The conformance tool stands both ends up in one process and already has a refusal scenario family -- one scenario where the peer sends a frame that ends at FIN, asserting that the offending stream's connection is closed with an APPLICATION close carrying H3_FRAME_ERROR, is the missing link.

WT-147 (P3, c99, tests, interop) -- still OPEN, and now with a second reason: a hostile peer would also let the interop runners assert what the peer was TOLD, not just whether the exchange completed.

WT-149 (P2, c99, quic, transport, tests) -- still OPEN: the empty reset_stream_at transport parameter draft-16 section 3.1 requires of both roles.

State: main at 17d2959; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,506 checks. Both interop directions work: pywebtransport and quinn against our client, and pywebtransport's client against our server (session accepted, its message received, the server's answer delivered).

Addendum: the driver states its own refusals (WT-159, WT-160)

WT-159's first half closed at 177b332. Last round's fix put the translation from an HTTP/3 error to an application close in the app boundary, which worked and was in the wrong place: the HTTP/3 error code belongs to the driver, and a translation written in each caller is one a caller will forget -- the same shape as the four connection-ID and stream-routing defects this interop work kept finding in boundaries rather than in rules.

wt_http3_driver_bind_connection binds a driver to the connection its refusals belong to, and wt_http3_driver_on_quic_frame states the refusal itself: an HTTP/3 error becomes wt_quic_connection_refuse_application, which the QUIC layer turns into a CONNECTION_CLOSE of type 0x1d carrying the HTTP/3 code; a refusal WITHOUT an HTTP/3 error (a caller's own bound) leaves the connection's default in force. side_on_frame in both tools is back to three lines that route a frame and return its status.

Tests, split where the layers are: test_http3_driver_streams asserts the driver's half for a frame cut off by FIN -- the recorded H3_FRAME_ERROR and the APPLICATION hint left on the bound connection -- and test_an_http3_refusal_is_an_application_close in test_quic_connection asserts the other half, where the hint is consumed into the close state and the encoder emits the application form with no frame-type field.

WT-160 (P2, c99, conformance, tests) -- NEW, and it is what stands between WT-159 and an end-to-end scenario. scenario_session.c stands a whole two-endpoint session up inline: sockets, certificates, transport parameters, both runtimes, both drivers and the HTTP/3 exchange, in one ~200-line function. A scenario that drives a refusal end to end -- a peer sends a frame that ends at FIN, and the test asserts what THAT peer is told -- cannot be written without a second copy of it. Factoring the pair setup into a helper is the work; the assertion itself is then a few lines. Named because it is the third time this session that "the setup is inline and therefore unreusable" has decided what could be tested.

WT-159 (P2, c99, tests, conformance) -- OPEN, narrowed to the end-to-end scenario above. The chain itself is now library-owned and covered at both halves.

WT-149 (P2, c99, quic, transport, tests) -- still OPEN: the empty reset_stream_at transport parameter draft-16 section 3.1 requires of both roles. WT-146 (P3): quiche does not complete the handshake. WT-157 (P3): document the gated diagnostics on one page.

State: main at 177b332; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,510 checks. Both interop directions work.

Addendum: WT-159 closed -- a refusal driven end to end, and the peer is told which rule it broke (WT-159, WT-160)

WT-159 CLOSED at 15c1a1a. The chain from a received frame to what the peer is TOLD is three layers long -- the connection delivers it, the HTTP/3 driver refuses it with an HTTP/3 error code, and the driver states that refusal as an APPLICATION close -- and nothing drove the whole of it. That is exactly how the reporting could be in the wrong layer twice in two rounds: first the connection's generic INTERNAL_ERROR, then a translation in the app that a second caller would have had to repeat.

test_runtime_session_pair now drives it: the pair completes a handshake, the client sends a HEADERS frame whose declared length never arrives and ends the stream, and the test asserts what both ends know -- the server's close is of the APPLICATION kind with H3_FRAME_ERROR, it names no frame (which is what distinguishes that form on the wire), and the peer reads the same HTTP/3 code out of the close it receives.

The harness was already there. Sockets, certificates, both runtimes, both HTTP/3 sides and a pump that waits on the sockets: test_runtime_session_pair.c has had all of it since the WT-142 work, and this test needed no new plumbing -- about sixty lines. That is worth recording against WT-160: the reusable pair harness existed in the unit tests all along, and the conformance tool's inline copy is the outlier.

The conformance tool's drivers are bound the same way, so a refusal in a scenario behaves as it does in the tools: 46 scenarios still pass.

WT-160 (P2, c99, conformance, quality) -- still OPEN, and now clearly a quality task rather than a blocker. scenario_session.c stands a whole two-endpoint session up inline (~200 lines) while test_runtime_session_pair.c has the same thing factored. Factoring the conformance copy is worth doing for the next scenario author, but it no longer stands between anything and a test.

WT-149 (P2, c99, quic, transport, tests) -- still OPEN: the empty reset_stream_at transport parameter draft-16 section 3.1 requires of both roles. WT-146 (P3): quiche never completes the handshake. WT-157 (P3): document the four gated diagnostics on one page. WT-155 (P3): client-side reporting parity.

State: main at 15c1a1a; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,543 checks; 46 conformance scenarios pass; both interop directions work.

Addendum: WT-149 closed -- the extension draft-16 requires of both roles is advertised (WT-149, WT-161)

WT-149 CLOSED at 2229883. Draft-16 section 3.1 lists the reliable-stream-reset extension for both roles: "a WebTransport endpoint ... sends an empty reset_stream_at transport parameter". This tree implements the RESET_STREAM_AT frame but never advertised the extension, so the one parameter that says it can receive one was missing -- and a WebTransport stream is exactly where it matters, because the session prefix is the first thing on the stream and a reset that dropped it would leave the peer with a stream it cannot attribute to a session at all.

  • WT_QUIC_TP_RESET_STREAM_AT (0x17f7586d2cb570, from draft-ietf-quic-reliable-stream-reset, whose text the tracker round confirmed rather than guessed) is sent with an empty value by both roles. It is a flag rather than a number, which the encoding says: the value is zero bytes long.
  • wt_quic_transport_parameters_check refuses a non-empty value with TRANSPORT_PARAMETER_ERROR naming the parameter -- the rule the extension's own draft states for an implementation that understands it, because a value nobody reads is a negotiation nobody can rely on.
  • wt_quic_peer_limits_t records the peer's support as reset_stream_at: presence is the whole parameter, so a sender that used the frame without it would be relying on an extension the peer never advertised.

The compliance matrix gained its row, which is the part worth noting: the requirement was in the draft's section 3.1 list and in no row of the matrix, so the "26 of 26" was 25 of 25 for a requirement nobody had counted. The matrix measures what it measures; the audit that walks a draft section by section is what finds the rows that were never written.

WT-161 (P3, c99, quic, tests) -- NEW, and a direct consequence. The RESET_STREAM_AT frame may only be sent to a peer that advertised the parameter, and the connection now knows whether it did (peer_limits.reset_stream_at). The send path does not consult it. Gating it is a few lines; it is a task rather than part of this commit because the existing RESET_STREAM_AT test sends the frame to a peer whose parameters were never parsed, and that test's intent needs deciding first.

WT-160 (P2, c99, conformance, quality) -- still OPEN: scenario_session.c's inline pair setup, which test_runtime_session_pair.c already has factored. WT-146 (P3): quiche never completes the handshake. WT-157 (P3): document the four gated diagnostics on one page. WT-155 (P3): client-side reporting parity.

State: main at 2229883; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,561 checks; 26 of 26 draft-16 matrix rows exercised, all 46 named symbols present; 46 conformance scenarios pass; both interop directions work, and quinn -- which understands this parameter -- completed a session with it.

Addendum: WT-161 closed -- the reliable reset can be sent, gated on what the peer advertised (WT-161, WT-162)

WT-161 CLOSED at 91e7025. Draft-16 section 3.1 says WebTransport over HTTP/3 "relies on the RESET_STREAM_AT frame", and it says why: a WebTransport stream carries its session prefix first, so a reset that dropped the prefix leaves the peer with a stream it cannot attribute to a session. This tree could decode the frame and did nothing else with it -- no stream semantics, no way to send one -- so last round's newly advertised reset_stream_at parameter had nothing to gate.

The stream machine now has the extension's rules, because they are facts about the stream rather than about the frame: a Reliable Size past the Final Size is a FRAME_ENCODING_ERROR; a frame that raises the reliable size is ignored (a peer may promise less, never more); and a changed application error code or final size is a STREAM_STATE_ERROR. peer_reliable_size and peer_reset_at record what the application may rely on.

And it can be sent: wt_quic_connection_reset_stream_at, returning WT_ERR_STATE when the peer never advertised the extension -- a frame the peer cannot read is not a fallback to one it can -- and WT_ERR_INVALID_ARGUMENT for a commitment past the end of the stream. That check comes before the reset for the same reason it exists: the test caught the first version ending the send half and then refusing, which leaves a stream reset by a frame that was never sent.

Tests. test_the_reliable_stream_reset_rules covers the receive rules with frames injected whole -- including the two malformed ones written by hand, because the encoder rightly refuses to produce a frame its own decoder must reject, which is itself a fact worth knowing about this tree's layering. test_the_reliable_stream_reset_is_sent_and_applied covers the send path's contract (the gate, both refusals, and that a valid call goes out), and test_a_reliable_stream_reset_crosses_the_connection drives it across a real handshake in the runtime pair -- which is also where the pair's parameters now advertise the extension, as both roles must.

WT-162 (P2, c99, quic, tests) -- NEW, and it is the honest gap in the above. In the runtime pair the frame crosses (the peer reads the packets, its driver sees frames, and the four bytes ARE applied to the stream), but the peer's stream shows no reset -- while the same frame injected raw is applied correctly by the receive rules. So the difference is in what the send path puts on the wire or in how the runtime delivers that packet, and the next step is to log the frame the sender built. Recorded rather than guessed at, because "the raw path works and the pumped path does not" is exactly the shape of a real defect, and it is one test away from being named.

WT-160 (P2, c99, conformance, quality) -- still OPEN: scenario_session.c's inline pair setup, which test_runtime_session_pair.c already has factored. WT-146 (P3): quiche never completes the handshake. WT-157 (P3): document the four gated diagnostics on one page. WT-155 (P3): client-side reporting parity.

State: main at 91e7025; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,720 checks; 26 of 26 draft-16 matrix rows exercised; both interop directions complete a whole session with the message exchange.

Addendum: WT-162 closed -- the reset crosses a real handshake, and the defect was the TEST's parameters (WT-162, WT-163)

WT-162 CLOSED at 51b3bd0, and it was not a product defect: the test harness's parameter list lacked initial_max_stream_data_bidi_remote. That is the credit for a stream the peer opens -- the one a request stream and a WebTransport data stream both use -- so the peer legitimately closed the connection with FLOW_CONTROL_ERROR (RFC 9000 section 4.1) when the four bytes arrived, and every frame after that was ignored because visit_frame skips a closed connection. The reset was never going to be applied.

That omission is the same one the LIBRARY's builder had, fixed in WT-145: build_parameters in test_runtime_session_pair.c rolls its own list instead of calling wt_quic_transport_parameters_build, so it kept a defect the library had already lost. That is the whole argument for the library owning those parameters, and it now has a second example.

What the tests assert, each claim where it belongs:

  • test_a_reliable_stream_reset_crosses_the_connection (runtime pair) -- the end to end: both ends advertise the extension, a real handshake completes, four bytes go out, the reset follows, and the peer reads back peer_reliable_size == 4, peer_error_code == 0x0b and a receive half ended by a RESET_STREAM_AT. A frame with the wrong fields cannot produce that, which is why the connection test stopped duplicating it.
  • test_the_reliable_stream_reset_is_sent_and_applied (connection) -- the send path's contract: the gate when the peer did not advertise the extension, the refusal of a commitment past the end of the stream, and that the packet the send path produced carries a STREAM frame with the four bytes -- read off the wire by peeking it and opening it with the connection's own keys, so the server's own receive still finds it.

The method that found it is worth naming, because it was not cleverness: the failures said "the peer read the packets, its driver saw frames, the four bytes were applied, and the reset was not", and the connection's own counters (frames_walked incremented, the handler never called, nothing discarded) narrowed it to "the frame was walked and ignored", which is exactly the guard visit_frame has for a closed connection. Then the close state's error code named the rule. Four measurements, each one a number the code already kept.

WT-163 (P3, c99, tests) -- NEW. One flake was seen while the suite ran six times: test_runtime_session_pair failed once and then passed four consecutive full runs. It binds loopback sockets and shares the machine with the rest of the suite, so a timing assumption is the first thing to look at -- but a flaky test in a suite that gates every commit is a defect of its own, and a flake that is shrugged off is a flake that hides a real failure later.

WT-160 (P2, c99, conformance, quality), WT-146 (P3, quiche), WT-157 (P3, diagnostics documentation), WT-155 (P3, client reporting) -- all still OPEN.

State: main at 51b3bd0; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,732 checks; 26 of 26 draft-16 matrix rows; both interop directions complete a whole session with the message exchange.

Addendum: the flake was a loop that spun faster than loopback, and the diagnostics have a page (WT-163, WT-157)

WT-163 CLOSED at dae52d3. The flake reproduced on the fifth of 300 runs, and the failure named it: the relay-based tests failed at "the handshake completes through the relay". The relay loop drained its socket with a non-blocking receive and never waited, so it could spend all 600 rounds before loopback delivered the handshake's first packet -- about one run in five. That is the rule pump_pair states in its own comment ("a loop that spun faster than the loopback interface would finish before the first Initial packet did"), and the relay loop was the one place that did not follow it.

(void)wt_udp_wait(&relay, 2000U) now paces it: every datagram in that test passes through the relay, because both ends address it, so it is the one place a wait is needed. The simulated clock is untouched -- pair.now still advances 1000us per round -- so the loss and probe assertions the test makes are unchanged; only the real-time window grew. 300 consecutive runs, zero failures (it failed on run 5 before).

Worth recording as a pattern, because it is the third time this session that a test harness was the defect: the inline parameter list that lacked initial_max_stream_data_bidi_remote (WT-162), and now a loop that outran the network it was measuring. Harnesses are code, and this one had a comment describing exactly the mistake it made.

WT-157 CLOSED at the same commit. C99/docs/DIAGNOSTICS.md documents the five environment-gated dumps on one page: what each records, the exact key=value shape, how to turn it on, which interop defect it closed, and the cost of having them in the library -- one getenv on paths that already exist, nothing formatted when the variables are unset, and the honest note that two of them write secrets in the clear and that the library reads the environment as a deliberate exception to its own "never writes to a file" rule. The alternative -- threading a diagnostics sink through QUIC, TLS and HTTP/3 -- is why the exception won: a dump that needs a caller to configure it does not exist at the moment it is needed.

What is left, in order of what it would prove:

  • WT-160 (P2, conformance, quality): scenario_session.c's inline ~200-line pair setup, which test_runtime_session_pair.c already has factored. It is the last "the setup is inline and therefore unreusable" item, and the next scenario author pays for it.
  • WT-146 (P3, interop): quiche never completes the handshake -- the last of the three containerized peers.
  • WT-155 (P3, cli): the client has no equivalent of the server's request/requestOutcome/h3Error/ closeCauseFrame reporting.
  • WT-153's runner now covers one peer for the server direction; quinn's client and quiche's client would make that direction a matrix rather than a data point.
  • WT-134 (CI legs: FreeBSD and Windows) is unchanged and needs portability work before a job would be green.

State: main at dae52d3; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80 test programs and 80,732 checks; 26 of 26 draft-16 matrix rows; both interop directions complete a whole session with the message exchange; a 300-run repeat of the flaky test is clean.

Addendum: the pair harness is shared, and a refusal is asserted on both ends (WT-160, WT-159)

WT-160 CLOSED at c28cc33. It was recorded twice as "a quality task rather than a blocker", and that was the right call: the refactor proved to be about sixty lines of movement, because the setup had already been written once and the factoring was mechanical. apps/wt-conformance-c99/scenario_pair.{c,h} now holds it -- both sockets, the pinned self-signed identity, the authority, the transport parameters built from the LIBRARY's list (so a mandatory one cannot be forgotten by a scenario), both runtimes, both HTTP/3 sides, the driver-to-connection binding, the advertise and the handshake -- behind scenario_pair_open, with scenario_pump_once for the paced pump and one scenario_pair_close for teardown. scenario_session.c keeps only the exchange: 445 lines to 141, and all 46 pre-existing scenarios still pass scenario for scenario, which is what makes the move credible.

WT-159's last gap CLOSED at the same commit, and this is why the harness was worth doing. The eleven refusal scenarios are decisions: they call a validator and check the code a peer WOULD be sent. That is a different claim from the code a peer IS sent, and the distance between them is three layers -- the frame arrives through the QUIC connection, the HTTP/3 driver refuses it, and the runtime states that refusal to the connection as an APPLICATION close. scenario_refusal_wire.c drives all three and then reads both ends: it sends a HEADERS frame whose declared length is cut off by the end of the stream (RFC 9114 section 7.1 makes that a connection error of type H3_FRAME_ERROR), and asserts that the endpoint which refused closed as WT_QUIC_CLOSE_APPLICATION with 0x106 and that the peer read back that same kind and code from the close it received. The two rows are named draft16-a-truncated-frame-is-an-application-close and draft16-the-refusal-reaches-the-peer-as-its-http3-code.

The scenario was checked for being load-bearing, which is not the same as being green: with the FIN dropped from the send -- so the frame is incomplete but the stream never says so -- it reports "the refusal was kind 0 with code 0x0" and "the refusal never reached the peer". A regression in either half fails it, so it is evidence rather than decoration. That check is now the habit for any scenario written against a state that has only one correct value: mutate the input that produces the state and confirm the row goes red.

State: main at c28cc33; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80,732 checks; 48 of 48 conformance scenarios pass (46 before, plus the two on-the-wire rows); 26 of 26 draft-16 matrix rows.

Addendum: WT-160 closed and WT-159's last gap closed (see above); WT-164 filed

WT-164 (P1, c99, http3, webtransport, tests) -- NEW, found while closing WT-160 and not covered by any open task. Draft-16 section 5 puts the session's control messages on the CONNECT stream as capsules -- drain and close, and the four flow-control capsules that grant credit (MAX_DATA, MAX_STREAM_DATA, MAX_STREAMS_BIDI, MAX_STREAMS_UNI) -- and this tree has the codec (webtransport/capsule.h, with a round-trip and malformed-input suite) but no wiring: the HTTP/3 driver parses every byte of the CONNECT stream as an HTTP/3 frame from the first byte to FIN, and nothing in the runtime or either CLI ever calls wt_webtransport_capsule_decode on bytes a peer sent on that stream.

What that costs is silent rather than loud, which is why it survived: a flow-control capsule's type (0x190b4d3d and its neighbours) is an eight-byte varint that is an unknown HTTP/3 frame type, so the driver reads the capsule's length field as a frame length and skips the capsule -- the peer's credit is dropped on the floor and a session that needs it stalls at its initial limit instead of reporting anything. A capsule whose length field is shorter than its payload desynchronises the frame parser instead, and FIN then reports the truncated-stream refusal of WT-158 (an application close with H3_FRAME_ERROR) for a peer that did nothing wrong. An earlier draft of the definition text filed this under WT-156, whose closure named the data-stream prefix instead; the capsule half was never done, and the interop runs have not seen it because the peers tested so far either send no capsules after the response or send them where the framing happens to resynchronise.

Exit criterion: a capsule a peer sends on the CONNECT stream is decoded by the session that owns the stream, in both directions -- a MAX_DATA capsule raises the send limit that the endpoint actually enforces, a drain turns new streams off, a close ends the session with the peer's code, and a capsule the framing cannot make sense of is a named refusal rather than a dropped credit. Asserted end to end through a real connection, and with the tree's own client sending the flow-control capsule a correct peer would send.

Addendum: WT-164 CLOSED -- the CONNECT stream's capsules are read, applied and asserted on the wire (WT-164, WT-165)

WT-164 CLOSED at 28e1fb7, in three commits, one per layer. The layering is what made it tractable, and it is also what the defect was hiding behind: the tree had a tested capsule CODEC and no wiring, so every layer looked finished on its own.

  • The driver at 9651822. wt_http3_driver_mark_capsule_stream(driver, stream_id, headers_pending) says a stream is a WebTransport CONNECT stream, and after its single HEADERS frame the rest of it goes to the stream-data sink. The flag is not decoration: a client marks its request stream when it sends the CONNECT (the RESPONSE is the frame still to come) while a server marks the peer's stream when it accepts the request (whose HEADERS it has just read), and start_session makes the client's mark itself before the request goes out. The receive path asks at the top of the frame LOOP and not only on entry, because the response HEADERS and a capsule may arrive in one STREAM frame -- and the sink is free to make the mark from inside the HEADERS delivery, which is exactly what a server does. 9 new checks in test_http3_driver_streams; verified load-bearing (7 fail with the server's mark removed).
  • The session at c1298aa. wt_webtransport_session_on_capsule_bytes applies what the lifecycle machine owns -- a drain, a close, the first close's code -- and hands the rest to an observer, because the flow-control grants belong to whoever enforces them. Two rules are about the buffer rather than the bytes: the walker decodes into a COPY of the cursor and commits only on success, so a capsule that has not fully arrived leaves the caller's cursor on its first byte; and the bound on one capsule is the CALLER's parameter, because passing the bytes PRESENT as that bound (my first attempt) would have called every split capsule excessive load. 65 checks in test_webtransport_session, up from 46.
  • The applications at 28e1fb7. apps/support/capsule_stream.{c,h} is the one implementation both CLI tools and the conformance tool's pair harness use, so "the session's capsules" cannot mean two things. The tools keep a session (established by the response on the client, by the accept on the server) and report what the peer said on the CONNECT stream -- peerMaxDataSet/peerMaxData, peerDrained, peerSessionClosed/peerSessionCloseCode -- because a session close leaves the QUIC connection open and a transport-level report cannot show it.

The end-to-end evidence is scenario_capsules.c over a real loopback connection with a real handshake: the client's MAX_DATA capsule moves the limit the server enforces to 65536, then the server drains (new streams stop) and closes with application code 0x42, which the client reports. Both rows are load-bearing: without the server's mark the grant row fails with set=0, value=0, capsules=0 -- the capsule skipped as an unknown frame, which IS the defect -- while the drain/close row is unaffected because that direction settles through start_session. The interop runner was re-run to check the new reporting against a real peer: pywebtransport/aioquic completes a session with wt-server-c99 and reports peerMaxDataSet:false, so it sends no capsules after the response and the new fields change nothing about that run -- read from what moved rather than assumed.

WT-165 (P2, c99, http3, webtransport, cli) -- NEW, and it is the half of the refusal path WT-164 did not close. A capsule this endpoint refuses cannot currently be NAMED to the peer. wt_capsule_stream_apply_flow returns WT_ERR_PROTOCOL when a grant does not strictly increase (section 5.1's flow-control error, code 0x045d4487), and the walker returns WT_ERR_LIMIT with H3_EXCESSIVE_LOAD for a capsule past the caller's bound -- but wt_capsule_stream_on_bytes has no out_error at all, so H3_EXCESSIVE_LOAD is DISCARDED, and an application-level refusal has no way to reach the driver's last_error, which is the only channel that states an HTTP/3 code to a bound connection. The result today is a connection closed with INTERNAL_ERROR, and a session-level flow-control violation that should close the SESSION with the draft's own code closing the connection instead. Exit criterion: a capsule past the bound closes the connection naming H3_EXCESSIVE_LOAD; a grant that does not strictly increase closes the session with WT_WEBTRANSPORT_FLOW_CONTROL_ERROR while the connection stays up; and both are asserted over a real connection, on the end that refused AND on the end that is told.

State: main at 28e1fb7; 86/86 CTest tests pass in debug, release and ASan+UBSan; 50 of 50 conformance scenarios; 26 of 26 draft-16 matrix rows; pywebtransport/aioquic completes a session in both directions.

Addendum: WT-165 CLOSED -- a refused capsule is named to the peer, and a refused report row cannot vanish (WT-165)

WT-165 CLOSED at 1900ab9, and it was worth filing rather than waving through: the refusal path had a silent half and a wrong half.

The silent half. wt_capsule_stream_on_bytes had no out_error parameter, so the HTTP/3 code the capsule decoder had already produced -- H3_EXCESSIVE_LOAD for a capsule declaring more than the caller will buffer -- was DISCARDED, and the connection closed with INTERNAL_ERROR naming a rule the peer had not broken. Threading the code through is the fix: the app leaves the application refusal hint and returns its failure, which is how an HTTP/3 error reaches a peer (RFC 9114 section 8).

The wrong half, and the more interesting one. A grant that does not strictly increase is NOT an HTTP/3 error: it is draft-16 section 5.1's flow-control error, a SESSION code (0x045d4487) that closes the session in a capsule while the connection stays up. The app's first wiring returned the failure to the transport for both cases, which would have closed the connection over the session's own error -- the exact confusion the two error spaces invite. wt_capsule_stream_refuse therefore answers with a NAME rather than a flag: WT_CAPSULE_REFUSAL_SESSION means the refusal has already been stated in full and the caller must return OK, WT_CAPSULE_REFUSAL_HTTP3 means the hint is set and the caller MUST return its failure, because a hint is not a close. Two rows in scenario_capsules.c assert both directions of it, each on its own pair because each ends something: the oversized capsule closes the CONNECTION with H3_EXCESSIVE_LOAD and the peer reads that code; the repeated grant closes the SESSION with the draft's code while BOTH connections are asserted open.

The best find of the round was a scenario row that disappeared. The first run printed 51 of 52 scenarios and exited 0. The missing row's name is EXACTLY 64 characters, WT_CLI_SCENARIO_NAME_MAX is 64, wt_cli_report_add refuses rather than truncates -- and every scenario helper in the tool ignores the status it returns. So the tool silently dropped a scenario, which is the one failure mode a conformance report must not have, and it was invisible to the summary line, the exit status and the README count (which I had already written as 52 before running it). Fixed in the report rather than in the one scenario: wt_cli_report_t counts refused rows, the exit status fails on them, both writers say so, and wt_cli_report_init zeroes the struct WHOLE -- field by field left rejected holding the caller's stack and printed 4305162049 refused rows, which is the same class of mistake the driver's own data_stream_count segfault was (WT-158 era). Verified load-bearing: a 69-character name now exits 1 with "1 scenario row(s) were REFUSED". test_cli_report is at 108 checks.

State: main at 1900ab9; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80,805 checks; 52 of 52 conformance scenarios; 26 of 26 draft-16 matrix rows.

Addendum: WT-146's root cause is named -- the last peer sends a Retry (WT-146, WT-166, WT-70)

WT-146 -- DIAGNOSED, not a handshake defect. The last containerized peer fails for a reason that had nothing to do with what four rounds of the interop work were looking at: quiche's server sends a Retry, and this connection discards an inbound Retry by name ("A Retry is not read here either", with a packets_discarded++ that is exactly the five discards the tool reports). The evidence is complete now, and it took two changes to get:

  • The runner could capture the wire from the peer's namespace but could not turn on the CLIENT's own gated dumps, so WT_INTEROP_PACKET_LOG=1 (and SECRET/TRANSCRIPT/STREAM) now forwards them into a mounted directory and prints what they wrote after the run -- a dump that dies with its container is a dump nobody reads. The packet dump says the client sent five Initials and nothing else.
  • The capture's 95-byte reply decodes to a Retry: first byte f0 (long header, Retry type), version 1, Destination Connection ID = our Source Connection ID, a 20-byte Source Connection ID the server chose, a 44-byte token ending in 000001 1122334455667788 (quiche's address-validation cookie carrying the version and our SCID), and a 16-byte integrity tag.

WT-166 (P2, c99, quic, interop, tests) -- NEW, and it is the whole of what is left for quiche. The pieces exist and are tested in isolation -- wt_quic_retry_packet_decode and wt_quic_retry_packet_encode (src/quic/packet.c), wt_quic_retry_integrity_tag (src/quic/protection.c), and RFC 9001 appendix A.4's Retry vector extracted by tests/vectors/extract_rfc9001_retry.py -- and the CONNECTION never calls any of them. Exit criterion: a client that receives a Retry whose integrity tag checks against its ORIGINAL Destination Connection ID adopts the Retry's Source Connection ID as the new destination, carries the token in its next Initial, recomputes its Initial keys from the new connection ID (RFC 9001 section 5.2), and completes a handshake; a Retry with a bad tag, a second Retry, or a Retry that arrives after the handshake is discarded rather than obeyed (RFC 9000 section 17.2.5.2); and quiche's server completes a session. WT-70's "Retry integrity tag" item is the primitive half of this and is already implemented, so WT-166 is the connection half and should reference it rather than duplicate it.

State: main at cd589b3; 86/86 CTest tests pass in debug, release and ASan+UBSan; 80,805 checks; 52 of 52 conformance scenarios; both interop directions complete with pywebtransport/aioquic and quinn (re-verified after the capsule work); quiche now has a NAMED cause.

Addendum: WT-146 CLOSED -- quiche's server sends a Retry, and the client answers it (WT-146, WT-166, WT-167)

WT-146 CLOSED at 91a31b5, and the answer was not in the handshake at all. quiche's server answers a client Initial with a Retry: first byte f0, Destination Connection ID = the client's own Source Connection ID, a 20-byte Source Connection ID, a 44-byte token ending in the version plus that connection ID, and a 16-byte integrity tag. The connection discarded an inbound Retry by name -- the comment said "A Retry is not read here either" -- and its packets_discarded was exactly the five the tool reported, so the client retransmitted a token-less Initial until it timed out. The primitives had been written and tested for three phases (wt_quic_retry_packet_decode, wt_quic_retry_packet_encode, wt_quic_retry_integrity_verify, and RFC 9001 A.4's vector extracted by tests/vectors/extract_rfc9001_retry.py); nothing called any of them.

WT-166 CLOSED at the same commit. on_retry_packet is RFC 9000 section 17.2.5.2's rules in the section's own order, and each discard is COUNTED because "the peer retried us and we could not answer" must not look like a peer that never spoke: a server discards every Retry; a client accepts at most one per connection attempt and discards one that arrives after the server has been heard; a wrong version, a zero-length token, a Source Connection ID equal to the client's own destination, and an integrity tag that does not verify are each discarded. On acceptance the token goes in every later Initial (section 17.2.5.3), the Retry's Source Connection ID becomes the destination of every later packet (section 17.2.5.1), and the packet numbers are deliberately NOT reset -- the section's MUST NOT, which a "reset everything" implementation would have broken.

The keys are the part the connection cannot do alone, and that shaped the design. The Initial keys are a function of the destination connection ID (RFC 9001 section 5.2), so accepting a Retry makes them the wrong keys. The connection records that it is waiting (wt_quic_connection_retry_pending_keys), REFUSES to send an Initial until it is cleared, and the runtime session derives them again from the Retry's connection ID on the pump that read it -- before either flush, because a flush first would protect the new Initial with the keys the server threw away. The handshake re-offers the SAME cryptographic handshake message through the existing retransmission path, which needed one new function: wt_quic_loss_discard_space forgets everything a space has in flight and hands each descriptor back, because those packets can never be acknowledged and holding them would hold the congestion window against bytes that will never arrive.

RFC 9000 section 7.3's client half came with it, because a Retry is what makes it load-bearing: a client must check the server's original_destination_connection_id against the destination IT chose, and retry_source_connection_id must be present exactly when a Retry was received and name its Source Connection ID. The client did not even RECORD its own original destination ID -- nothing had ever needed it -- which wt_runtime_session_start_client now does. The check runs only when there is something to check against: a bare connection object that was never told (which only a caller bypassing the runtime can build) has nothing to compare, and inventing a requirement it cannot satisfy would make conformant parameters impossible. That distinction is what kept the connection-level tests honest instead of rewriting them around a rule they cannot meet.

The result is the interop criterion's best evidence yet: quiche completes the handshake AND the whole session (client: ok, response 200, received 13 byte(s) on a stream; the peer logs session established / stream in: 13 bytes / stream echoed), so the CLIENT direction is three of three peers, and pywebtransport still completes both directions. Re-verified after the change: all three peers, both directions. 20 new checks in test_quic_connection (1434 total) including the token and destination read back off the WIRE by unprotecting the header with the new keys; load-bearing, since removing the integrity check fails 3 and removing the loss discard fails 2.

WT-167 (P3, c99, quic, interop) -- NEW, and it is a loose end the success exposed. The quiche run completes, and its report says "firstReceiveError":"protocol","receiveErrors":1: ONE received packet produced a protocol error that did not stop the session. The most likely cause is an ACK naming a packet from the Initial space the Retry discarded -- RFC 9000 section 13.1 lets an endpoint treat an acknowledgement of a packet it never sent as PROTOCOL_VIOLATION, which is legal but is not what a peer that retried us should be able to provoke. Exit criterion: say which packet and which rule, decide whether the refusal is right now that a space can be discarded mid-flight, and either tolerate it or record why refusing is better.

Also filed, unchanged and worth the same pass: wt-client-c99/wt-server-c99 still cannot send a Retry themselves (the parameter builder and the server path have no token), which is the other half of section 8.1.2 and is not needed for any peer in this matrix.

Addendum: WT-167 CLOSED -- the same round, because a successful run's one stray error was a real hole (WT-167)

WT-167 CLOSED at 5cbc112. It was filed an hour earlier as "a loose end the success exposed" -- the quiche run completed while its report said "firstReceiveError":"protocol","receiveErrors":1 -- and the instrumentation that found it was three probes deep, because the receive loop has six places that can fail and only one of them was guilty. The guilty line called wt_quic_packet_read, and the reason was in that function's own header decode: the long-header decoder refused non-zero reserved bits before the packet protection was checked.

That is the wrong order, and RFC 9000 section 17.2 says so in as many words -- non-zero reserved bits are a connection error "after removing both packet and header protection" -- while both the fixed bit and the reserved bits are inside the AEAD's associated data, so RFC 9001 section 5.3's rule comes first: a packet that cannot be authenticated is DISCARDED. The packet that tripped it was quiche's answer to an Initial the Retry had already invalidated, protected with the retired keys, whose unmasked reserved bits a

Clone this wiki locally