Repository navigation
Project Tracker
The single place where known work on WebTransport is recorded: what is being
worked on, what has been fixed, and what is known but not yet scheduled. Update
this page whenever a change lands on main or a new defect or task is identified.
Last updated: 13 September 2026, at release 1.3.7. Records two bodies of
work: the XAIOS-side C99 port of the TLS/QUIC layer (WT-44 to WT-53, on
XAIOS main as of 471349d) and the portable C99 implementation in this
repository under C99/ (WT-54 to WT-67, Phases 0 to 2 complete on main at
53a86ec). WT-84 records the Swift runtime defect fixed on main at
d94f9f8 (issue #23).
This is the only project tracker for the repository. If a second list of tasks ever appears elsewhere, this page wins and the other one should be folded into it.
Current release: 1.3.7, published 13 September 2026 from commit 3df28f2. It is a defect-fix release for issue #23: maxConcurrentConnections was handed to NetworkListener.newConnectionLimit, which caps a listener's whole life rather than its concurrency, so a server stopped accepting permanently once it had served that many sessions in total (WT-84). Nothing in this list is a blocker for it; the open items below are future work.
- A row leaves Open work when the change is merged to
mainand the documentation is updated, and moves to Resolved. -
Numbering. Every item has a stable reference that never changes once
assigned, so a commit message, an issue, or a review comment can point at one row
and stay correct.
-
#N— a GitHub issue number, where one exists. -
WT-N— a tracker-local item with no issue yet. Work discovered while doing something else is recorded here first and filed as an issue later if it warrants one; theWT-Nreference stays valid either way. - Numbers are never reused and never renumbered. An answered question moves to Resolved like anything else rather than being deleted, so the numbering stays contiguous and the answer is still findable later.
-
- Unknown problems belong here too. Anything noted but not understood — a suspicion that could not be reproduced, a behaviour that looks wrong but has no trigger yet — gets a row and a number, marked unverified in its Notes. A suspicion recorded is cheap; a suspicion forgotten is re-discovered later at full cost.
- Severity follows the repository label scheme: P0 blocks a release or breaks core functionality or creates a security risk, P1 is required for MVP or release readiness, P2 is important but not blocking, P3 is polish or hardening.
| Ref | Severity | Area | Item | Notes |
|---|---|---|---|---|
| WT-1 | P2 | transport | The Retry Integrity Tag is never computed or verified, so a caller that treats decode as validation will accept a forged Retry packet. RFC 9001 section 5.8 requires the tag to be checked, and the packet type does not retain the original Destination Connection ID it would need as associated data. |
Needs an API decision: verifying the tag requires the original DCID, so the type or its decode signature has to carry it. Not a small change, and the shipped runtime uses Network.framework's QUIC rather than this codec. |
| WT-2 | P3 | api | Several fixed codecs and the transport-parameter validator are not on the shipped path, which uses Network.framework's QUIC rather than this package's QUIC/HTTP-3 stack. The fixes are real but exercise only where an embedder constructs those types directly. | Recorded so the coverage boundary is not mistaken later. Not a defect; a scope statement. |
| WT-3 | P2 | c99, crypto | The C99 plan's OpenSSL 3.x dependency cannot be used on the target: XAIOS vendors BearSSL for its TLS 1.2 client and has no OpenSSL. The good news is that BearSSL is compiled in full by scripts/build-bearssl.sh — every src/**/*.c, with -std=c99 -ffreestanding -fno-builtin -Os -Wall -Wextra -Werror — so all 294 sources are available, not only the objects xapt reaches. |
Verified by reading the XAIOS tree. BearSSL supplies the primitives a TLS 1.3 implementation needs: AES-GCM (br_gcm_*), ChaCha20-Poly1305, HKDF (br_hkdf_*), SHA-256/384/512, X25519 (br_ec_c25519_*, curve 29), ECDSA verify on P-256/384/521 and RSA-PSS verify. The plan should name BearSSL instead of OpenSSL. |
| WT-4 | P1 | c99, transport | The entire QUIC transport currently comes from NetworkListener<QUIC> and NetworkConnection<QUIC>. Nothing equivalent exists on the target platform, so this is new code written from the RFCs, not a port. |
Verified by measurement: 19 references across 2 files, one of which is 2,228 lines; the two files total roughly 3,340 lines of the 17,126-line source tree. This is the largest single workstream. |
| WT-5 | P1 | c99, crypto | Apple-only crypto and key handling must be replaced with C99 implementations: 9 source files import Security or CryptoKit. |
Verified by grep over Swift/Sources. Covers AES-GCM, ChaCha20-Poly1305, HKDF, SHA-256, X25519 and ECDSA/Ed25519 verification. |
| WT-6 | P0 | c99, security |
BearSSL has no TLS 1.3, and QUIC requires TLS 1.3. The vendored copy is explicitly "for the xapt TLS 1.2 client". |
Answered on the XAIOS side, on main as of 787622c. userspace/wt/ now implements the whole client handshake in C99 over BearSSL's primitives: the key schedule (RFC 8446 section 7.1) in its two phases, QUIC traffic keys, Initial secrets, the Retry integrity tag and packet protection (RFC 9001 sections 5 and 6), handshake framing and the transcript, a ClientHello builder, ServerHello, EncryptedExtensions, CertificateRequest, Certificate and CertificateVerify parsers, x25519, Finished compute and verify, the CertificateVerify signature check, the pinned-key trust policy, and the state machine that sequences them. 1214 host checks against RFC 8446, 8448, 9001, 7301 and 7748 run in XAIOS CI and under AddressSanitizer and UndefinedBehaviorSanitizer, with the vectors extracted from the RFC text and two Python oracles recomputing them. The handshake completes end to end against a server flight built by an independent Python implementation (tests/security/generate_wt_quic_flight.py), which is what makes the client's own Finished a check rather than a tautology. What is not implemented: 0-RTT and the session tickets it needs, so there is no early-data encryption level; HelloRetryRequest, which is refused by name rather than handled; and client certificates, where the client answers a CertificateRequest with an empty Certificate (RFC 8446 section 4.4.2) and never a CertificateVerify. Recording B-79 in the XAIOS tracker, which stays open for those three. Five adversarial audits and the sanitizer runs found and closed a remote stack overflow in the Retry tag, a resumption secret derived from the wrong transcript, a packet number encoder using the wrong range, a decrypt path that failed on every packet, a CertificateVerify digest buffer sized for SHA-256 while offering SHA-512, a public key that pointed into a dead decoder frame, and an ALPN extension read in a format RFC 7301 does not define. |
| WT-9 | P2 | c99, tests | The test suite that gives this port its correctness evidence cannot run on a freestanding target. The protocol stack needs a host build with libc and a test crypto backend, where the RFC vectors and the existing Swift suite act as an oracle. | Verified by the plan's own completion criteria, which require RFC vectors, malformed-input corpora and interop runs. The target having a full libc makes this easier than expected: a host build is now a build-flag difference rather than a portability project. |
| WT-10 | P2 | c99 | Size estimate for the C99 port: roughly 15,000 to 25,000 lines, in the nature of a multi-month effort. | Partly verified, partly inferred. The Swift side is measured at 17,126 lines across 49 files. The QUIC-runtime-from-scratch and crypto/X.509 portions have no Swift counterpart to size against, so the range carries real uncertainty and should not be treated as a committed estimate. |
| WT-12 | P1 | c99, security | The trust model is now largely answered. XAIOS already pins an operator-set RSA public key for xapt runtime identity verification rather than doing general path building, and BearSSL provides the X.509 parser and ECDSA/RSA-PSS verifiers regardless. |
Answered by reading XAIOS. The remaining question is narrower: does the WebTransport port adopt the same operator-pinned model, or validate chains against a configured trust set? Pinning removes general path building from scope and is consistent with how XAIOS already does TLS identity. |
| WT-13 | P2 | c99, docs | The port's real dependency surface is ISO C99 plus POSIX.1-2008, not ISO C99 alone. Sockets (SOCK_DGRAM, sendto/recvmsg), poll, clock_gettime and close are POSIX, not C99; only printf/memcpy/int64_t and friends are ISO C99. |
Verified by compiling a probe, and now realised: src/runtime/udp.c is the one POSIX translation unit (with src/core/time.c), it uses sendto, recvmsg, poll, getsockname and close, and the build sets _POSIX_C_SOURCE=200809L for the library on Unix-but-not-Apple only. "100% C99 libc" in practice means C99 plus Unix, which is exactly what the port needs. |
| WT-14 | P2 | c99, config | Feature-test-macro discipline is a real portability hazard, and it bit the probe. Defining _POSIX_C_SOURCE=200809L on this host removed INADDR_LOOPBACK, so the same source that compiles bare fails with the macro set. A different libc will have different defaults. |
Verified on the development host and answered by the policy now in the build: _POSIX_C_SOURCE=200809L is set for the library on Unix-but-not-Apple (documented in cmake/WTCompilerWarnings.cmake), and the source uses no BSD-only name -- the loopback addresses are written out as bytes rather than taken from INADDR_LOOPBACK. The rule the port follows: only names POSIX 2008 guarantees, so the macro can be set anywhere. |
| WT-15 | P2 | c99, transport | The UDP socket surface had to be specified rather than assumed: datagram receive must report truncation, and IPv6 must work. | Closed into WT-16 and WT-17, which record what XAIOS actually exposes now that its source has been read. |
| WT-36 | P2 | c99, transport | Datagram receive must report truncation. QUIC needs to know when a datagram exceeded its buffer rather than silently parsing a short one. |
Implemented at d3eaacd: wt_udp_receive uses recvmsg and reports WT_ERR_TRUNCATED from MSG_TRUNC with the length zeroed, so a caller cannot parse the prefix of a packet; the sender's address is still reported. The documented alternative is sizing the buffer at WT_UDP_MAX_DATAGRAM (65507), which cannot truncate. An earlier row part follows: Answered on the XAIOS side, and the answer is narrower than the row assumed. A datagram that does not fit SOCKET_BUFFER_SIZE (16384) is dropped whole at the frame and counted, never queued in part, and that check runs against the same bound the read is clamped to. So a caller passing a buffer of SOCKET_BUFFER_SIZE cannot be truncated, and that is the whole maximum-datagram-size policy the row concluded would be needed. A caller passing less than that can still be truncated with nothing said: the syscall request structure has no flags field, and adding one is a syscall change rather than a stack one. Recorded in network_stack.c beside the check. The port should therefore size its receive buffer at the maximum rather than at the QUIC default. |
| WT-37 | P3 | c99, config | XAIOS builds freestanding: -ffreestanding -fno-builtin -fno-pic -fno-pie, --target=aarch64-none-elf, with its own linker script and crt0.S, and picolibc is currently an empty placeholder directory built on demand by scripts/build-libc.sh. |
Verified. The port must build the same way, which means no dynamic loading, no errno-driven libc behaviour to rely on, and its own allocator strategy. This is a build-system constraint rather than a blocker, but every #include must come from the sysroot. |
| WT-38 | P3 | c99, transport | XAIOS's network stack exists in kernel (kernel/net/: ipv4.c, ipv6.c, arp.c, ndp.c, routing.c, socket_buffer.c, net_device.h, plus e1000e, virtio_net, vmxnet3 drivers) with IPv6 dual-stack addressing through xaios_ip_addr_t. |
Verified. Recording it so the C99 plan's "platform runtime" section names the real backend instead of a generic BSD socket layer. Note the target's socket surface is a capability-checked syscall API (XAIOS_CAP_NET_SOCKET per process), not raw POSIX. |
| WT-39 | P2 | c99, transport |
NETWORK_MAX_LISTENERS is 16 and one row serves both TCP and UDP, so sixteen concurrent endpoints of either kind exhausts it. WT-35 made every datagram socket register one, which is what makes this reachable without anything asking for it. |
New, found while implementing WT-35 on the XAIOS side (webtransport branch, commit 4ddd7d8). The registration path logs network: UDP listener registry full and returns void, so a socket that is refused a row is left with no reply path and no error to the caller. QUIC's own connection counts are bounded well below sixteen in the current design, so nothing here reaches it; it is recorded because the limit is now on a path that did not ask for it. |
| WT-68 | P2 | c99, config | The two C99 bodies of work now meet at an interface and do not share an implementation. The XAIOS side runs on vendored BearSSL; the portable C99/ tree links OpenSSL 3 (WT-3). C99/include/webtransport/crypto/crypto.h is deliberately the whole boundary -- one header, one file behind it -- but a BearSSL backend does not exist, and neither does the socket layer the portable tree would need on a target with no POSIX sockets. |
New, found by completing WT-55. Recorded rather than solved: the portable tree is the one the plan describes, and the XAIOS tree is already merged and tested on its own primitives, so nothing is blocked. The decision to make is whether C99/src/quic/ is ever built for XAIOS, which would mean a crypto_ bearssl.c behind this header plus a datagram layer over the capability-checked syscall API. Exit criterion: either a documented "the two trees stay separate" decision, or a BearSSL backend that passes the same RFC 9001 vectors as the OpenSSL one. |
| WT-69 | P2 | c99, transport |
WT-55 completed the key update derivation (wt_quic_packet_keys_update, checked against RFC 9001 A.5's quic ku) and the header documents that the lifecycle is not here: when to initiate an update, the key phase bit, and holding the previous keys so a reordered packet under the old phase still decrypts (RFC 9001 sections 6.1 to 6.4). |
New, found by completing WT-55, and it is a deliberate deferral rather than an oversight: the phase table's task list names the lifecycle, and the phase's completion criteria are the round trip and tamper rejection, both met. The state belongs to the Phase 4 connection runtime. Exit criterion: a key update is initiated and confirmed, a packet under the new phase decrypts, a reordered packet under the previous phase still decrypts within the RFC's limits, and an update that is refused for a missing confirmation is refused by name. |
| WT-71 | P3 | c99, tls | The resumption master secret is derived and tested against RFC 8448, and nothing consumes it: there is no NewSessionTicket handling, so the C99 tree cannot resume a session and has no 0-RTT to offer (RFC 8446 sections 4.6.1 and 7.1). |
New, found by completing the key schedule. Recorded rather than solved: nothing in draft-16 requires resumption, so this is scope rather than a gap in the protocol -- but the derivation exists without a consumer, and the tracker is where that is visible. Exit criterion: either the server issues a ticket and the client resends a PSK with a binder (which needs the res binder and c e traffic labels this schedule deliberately omits), or an explicit decision that resumption is out of scope for the C99 tree. |
| WT-73 | P1 | c99, security, docs |
wt_quic_unprotect_frames returned WT_ERR_PROTOCOL when an AEAD tag did not verify, while status.h defines WT_ERR_AUTHENTICATION for exactly that case and says it is deliberately not WT_ERR_PROTOCOL, because the packet is well formed and simply was not produced by the holder of the key. Two documented contracts disagreed, and the connection runtime is where that bites: a caller cannot choose between discarding a datagram and closing a connection when both arrive as the same error. |
Fixed on main at 261c4e2. The function returns WT_ERR_AUTHENTICATION, its header says the choice of remedy is the caller's (RFC 9001 section 5.3 discards), and wt_quic_packet_read passes it through. The five Phase 2 expectations that pinned the old value were wrong and were the reason the defect survived: a test can hold a defect in place. |
| WT-79 | P2 | c99, transport | RFC 9000 section 14.1's datagram-size rule is not implemented, in either half. A CLIENT must expand the payload of every UDP datagram carrying an Initial packet to at least 1200 bytes, and a SERVER must discard an Initial packet carried in a datagram smaller than that. The runtime does neither: its Initial packets are only as large as the frames in them (the handshake test's ClientHello datagram is 207 bytes), and a server reads an Initial packet out of any datagram that holds one. The two halves have to land together, because enforcing the server's discard without the client's padding would refuse the runtime's own handshake. |
New, found while looking for the next Phase 4 rule to enforce (ef89b92). It matters beyond tidiness: the 1200-byte floor is what makes the handshake's anti-amplification budget meaningful, since a server's response is bounded by three times what it received. Exit criterion: a client pads its Initial datagrams to at least 1200 bytes through the existing padding path (WT-72's helper is the same idea at a smaller scale), a server discards an Initial packet in a smaller datagram and counts it, the handshake test still completes with padded datagrams, and a test sends an undersized Initial to a server and requires the discard. A first attempt (ef89b92 working tree, reverted) wrote both halves and compiled, but the test binary then took more than 60 seconds where it had taken under one: THE FLOOR MAKES EVERY HAND-BUILT INITIAL PACKET IN THE EXISTING TESTS SUBJECT TO IT. test_discards sends Initial packets to a SERVER on purpose -- to have them refused for the address or the connection ID -- and the floor now refuses them first, so each following wt_udp_wait expires its full two-second timeout instead of returning immediately. The next attempt must give those packets the floor too (they are meant to test a different refusal) and re-check the loss tests, where 1200-byte Initial packets are ten to the initial congestion window. A SECOND ATTEMPT MEASURED THE TWO HALVES SEPARATELY, and the finding changed the shape of the task: with the CLIENT PADDING ALONE -- no server discard, so nothing can be refused for its size -- test_quic_connection still fails 76 of 401 checks ("processing nothing more: want 1, got 0" and "processing two datagrams in all: want 2, got 1" among them), while test_quic_handshake passes unchanged. So the entanglement is not only the server-side discard: the existing connection tests' expectations depend on the sizes the client sends, and WHERE has to be measured rather than reasoned about (run the test binary with a progress line per function, or bisect by returning the padding to one space at a time). The next attempt should instrument first, and treat "which existing expectations depend on packet size" as the real question. PARKED after a fourth attempt (829d300 working tree, reverted). The fourth attempt fixed the cause the third one exposed -- the padding was aimed at the floor by arithmetic, so the rebuilt packet came out two bytes above the path's maximum and every Initial packet a client sent was refused, which is also what made the earlier attempts look like hangs: nothing arrived, so every wait in the suite expired its full timeout. With the padding measured instead (pad, rebuild, adjust until the packet is between the floor and the ceiling), test_quic_handshake still passes its 240 checks and test_quic_connection still does not finish, so a fifth unknown remains in the connection tests. Decision: park this row. It is an anti-amplification hardening rule, not a prerequisite -- the handshake completes and interoperates without it, and no other task depends on it -- and four sessions' remaining budgets have now gone into it. The next session should spend its budget on WT-78 (the stream layer), which the phase and everything after it actually needs, and return to this row only with a session that can instrument the connection tests properly (per-test progress output, or bisecting the suite). |
| WT-80 | P1 | c99, transport | Landing the receive-side rule that a first frame CREATES a stream (RFC 9000 section 3.2) exposed a SENDER bug: stream_id_allowed allowed this endpoint to send on a stream the peer had opened UNIDIRECTIONALLY, and a unidirectional stream carries data one way -- the peer's (section 2.1). test_quic_handshake.c had been sending on stream 3, the server's own unidirectional stream, as if it were the client's. A third finding: inserting stream-count grants into the handshake test moves a later MAX_STREAMS block's expectations, because the counts have to be granted BEFORE the STREAM frame that needs them. |
Closed on main at 0d927c7 (the twenty-fourth part re-landed): stream_id_allowed returns whether a peer's stream is bidirectional, the handshake test asserts the refusal instead of sending on stream 3, and its grants moved ahead of the frame that needs them. 38/38 suites pass, 75,820 checks. Committed from a fresh clone because this working copy's git object store became unreadable (pack read timeouts, 99% disk) -- the tree was recovered into a clean checkout, rebuilt and pushed from there. |
WT-81 (P1, c99, transport) -- CLOSED on main at eece125 (the twenty-sixth part): the connection now keeps
connection-level flow control and charges every STREAM frame's data against both limits, choosing the RFC's error code
by asking each limit in turn. The diagnosis below is what made it possible; it is kept because the reason the status
cannot be trusted is worth remembering.
wt_quic_stream_on_data returns WT_ERR_PROTOCOL when the PER-STREAM limit is exceeded and when a
final size contradicts what arrived, and it returns wt_quic_flow_on_received's limit status when the
CONNECTION limit is exceeded. A caller therefore cannot map the status to a transport error code by
itself. The connection must decide: compute end = offset + length (guarding the overflow) and report
FLOW_CONTROL_ERROR when end > stream->max_stream_data or the status is a limit, and
FINAL_SIZE_ERROR otherwise.
The attempt in round 53 was written, compiled and reverted after two checks failed: the receiver
closed on a first 3-byte frame with FINAL_SIZE_ERROR (6) because the test's config.local_max_stream_data
seed never applied, leaving the stream's limit at zero -- which the module was right to refuse, and which
the wrong mapping then mislabelled. Next attempt: seed local_max_stream_data in both test config
builders (open_pair in test_quic_connection.c and connection_config in test_quic_handshake.c,
verifying each with a grep rather than assuming the edit landed), seed set_max_data on the receiver, and
use the two-part mapping above. Exit criterion: a frame beyond either limit closes with
FLOW_CONTROL_ERROR, a frame beyond a final size closes with FINAL_SIZE_ERROR, an ordinary frame is
accepted and advances the connection's received total, and the suite is 38/38.
Also outstanding from round 52: the phase-4 row in this file still does not name the twenty-fifth part (RESET_STREAM and STOP_SENDING reaching their state machines); the Implementation Status page does.
-
Part 25 (
31619f4): RESET_STREAM and STOP_SENDING reach their state machines as they arrive, with FINAL_SIZE_ERROR (RFC 9000 section 4.5) and STREAM_STATE_ERROR (section 19.5) for the states the RFC makes errors. The connection applies them before the caller's handler sees the frame: the handler observes the data, the state machine owns the lifecycle. -
Part 26 (
eece125, closesWT-81): received STREAM data is accounted against BOTH the stream's limit and the connection's, and the RFC's error code is chosen by asking each limit in turn. -
Outstanding in the tracker file itself: the phase-4 row above does not name parts 25 and 26 (this addendum does), because two anchor-based edits to that row failed and appending is what works here.
-
Part 27 (
d5ea4c0): the receive limits are raised as the data arrives -- MAX_DATA and MAX_STREAM_DATA for the next window -- which is RFC 9000 section 4.1's rule applied where arrival is consumption, because this runtime hands each frame's bytes to the caller's handler immediately. The test is end to end: the peer sends exactly what was granted, and reads the grant the connection sent by itself. -
Part 28: a sender can cancel a stream --
wt_quic_connection_reset_streamsends RESET_STREAM with the final size computed from what was sent, and refuses a stream that is not this endpoint's to send on or one already finished. With the receive side handling an arriving reset, the phase's "cancellation" item has both directions. -
Part 29 (
847cedc): a lost stream packet names what to send again -- a STREAM send carries a retransmission descriptor (the stream, the offset, the length) which the connection hands to the owner when loss detection declares its packet lost. The same shape the CRYPTO stream uses. The test also records two rules worth keeping: an ACK must be in the SAME packet number space as the packets it acknowledges, and a burst of losses reports several packets in send order. -
Part 30: STOP_SENDING, the other half of cancellation -- the receiver asks the peer to stop, once and only on a stream it receives on, with a frame that could not be sent leaving the stream unchanged.
-
Part 31: the Retry integrity tag (RFC 9001 section 5.8), with a property test. New task (WT-82, P2, c99, vectors): RFC 9001 appendix A.4's Retry packet is not extracted yet, so the tag's value is unchecked against the RFC; the extractor should derive the pseudo-packet, the tag and the ODCID from the RFC text the way the other vectors are, and the test should then assert the value.
-
Part 32: issuing connection IDs -- NEW_CONNECTION_ID with the issuer's own bound and the peer's
active_connection_id_limitless the handshake's ID (RFC 9000 section 5.1.1), and the stateless reset token taken from the caller because section 10.3 requires it to be unguessable. Still open fromWT-70: handling a RECEIVED NEW_CONNECTION_ID and RETIRE_CONNECTION_ID, and using a newly issued ID when the connection migrates. -
Part 33: the peer's connection IDs are stored (NEW_CONNECTION_ID with FRAME_ENCODING_ERROR, PROTOCOL_VIOLATION and CONNECTION_ID_LIMIT_ERROR for the cases RFC 9000 section 19.15 and 5.1.1 name). Still open from
WT-70: RETIRE_CONNECTION_ID, and actually USING an issued ID when the connection migrates. -
WT-83 (P3, c99, transport): the decoder's refusal of a NEW_CONNECTION_ID whose
retire_prior_tois above its sequence (RFC 9000 section 19.15's FRAME_ENCODING_ERROR) is NOT covered by a test, because the frame ENCODER refuses to produce such a frame -- this library refuses to encode what it would refuse to decode -- so the packet has to be written by hand, as the malformed-input corpus does for other frames. Exit criterion: a hand-built NEW_CONNECTION_ID withretire_prior_to > sequencecloses the connection with FRAME_ENCODING_ERROR, alongside the same case in the malformed corpus.Also recorded: the commit for part 33 was pushed while one suite failed, because the shell gate matched "tests passed", which prints even when tests fail; the gate now checks for zero failures.
WT-84 (P1, swift, runtime) -- CLOSED on main at d94f9f8 and released as 1.3.7
from commit 3df28f2 (issue #23): a listener stopped accepting for the rest of its life once it
had served maxConcurrentConnections sessions in total.
The runtime passed the policy's ceiling to NetworkListener.newConnectionLimit. Measured
on macOS 26.6.2 with a minimal listener, that limit is a budget for the listener's whole
life and not a concurrency cap: a listener built with a limit of 2 hands exactly two
connections to its handler and never a third, even after both have ended and been
cancelled, and an ended connection does not return its slot. The default ceiling of 16 is
low enough to reach in normal operation — a desktop app that reconnects on each launch
reaches it in a handful of runs — and the failure was silent: the process stayed healthy,
every other transport it served kept working, and only new WebTransport sessions timed
out. The issue was reported after that symptom was chased as a client-side problem; with
the ceiling raised to 4096 the same loop got 90/90, which is what identified the limit as
a lifetime budget.
The fix: the listener runs without a framework limit and the runtime counts in-flight
connections itself (InteroperableQUICConnectionBudget). A connection is admitted only
while fewer than the ceiling are being served, and its slot is returned exactly once —
when the session is closed, when the peer closes it, when a session is released without
being closed, or when an accept fails — through a one-shot lease
(InteroperableQUICConnectionLease). Connections over the ceiling are still refused before
their handshake is driven, which is unchanged in effect from before.
Recorded alongside it, because it constrains any future teardown work: a started
NetworkConnection cannot be cancelled. The Swift Network API exposes no cancel()
on NetworkConnection (it does on the legacy NWConnection), and the new API ties a
connection's life to its NetworkListener.run handler instead. This runtime takes the
connection out of that handler after start(), which is what lets a session outlive the
accept, so the framework keeps the QUIC connection until the peer closes it or it idles
out. That is why the framework slot is not something this code can give back explicitly,
and why maxConcurrentConnections is now the runtime's own accounting rather than the
framework's. WT-85 records the consequence that remains open.
WT-85 (P3, swift, runtime): a session that ends cleanly leaves its QUIC connection to
the framework instead of closing it, so both peers keep a connection until the peer closes
it or QUIC's idle timeout expires. Nothing in the runtime can cancel it (WT-84), and the
WebTransport session close it does send — CLOSE_WEBTRANSPORT_SESSION plus a FIN on the
CONNECT stream — is a session-level ending that the transport does not treat as a reason
to stop. The observable cost is bounded resource use, not incorrect behaviour, and the
listener no longer depends on those connections ending. Exit criterion: either a supported
way to end the underlying connection promptly is found and used in session teardown, or
the idle timeout the server advertises is measured and documented as the bound.
WT-86 (P2, swift, runtime) -- FIXED on main at 354480f, in the unreleased section: a peer that
ends an inbound stream before writing to it was reported as
QUICCodecError.truncated(needed: 1, available: 0).
Issue #24 asked whether a client that connects and then waits can lose its session to an empty stream read.
Measured against the real framework on macOS 26.6.2, with a plain NetworkListener<QUIC> and a raw
NetworkConnection<QUIC> client: receive(atMost:) waits for a byte, because atLeast defaults to 1, and
a stream the peer opens without writing to is not even delivered to the inbound-stream handler until its
first byte arrives. The interleaving the report feared therefore does not exist, and the consumer's "speak
first" workaround can be deleted with its note corrected.
An empty read does happen in one case -- the peer FINs a stream with nothing on it -- and the runtime
discarded the endOfStream flag that says so, so the empty buffer reached the codecs and a peer protocol
violation was reported as an internal truncation. InteroperableQUICHelpers.decideFirstChunk now
classifies a chunk as bytes, a wait, or a peer ending; an empty chunk on a stream that has not ended is
waited out; and WebTransportNetworkRuntimeError.peerClosedStreamWithoutData(streamID:) is raised on the
four reads whose protocol requires data: the extended CONNECT request stream, an inbound WebTransport
stream, the peer's HTTP/3 control stream, and the CONNECT response. Three tests cover it, 300 package tests
pass, and the strict build, strict test run and formatting lint are clean.
WT-79 (P2, c99, transport) -- CLOSED on main at 6496ad6 (the thirty-sixth part): RFC 9000
section 14.1's datagram-size rule is now implemented on both sides. A client expands every UDP datagram
carrying an Initial packet to at least 1200 bytes with PADDING frames, and a server discards an Initial
packet whose datagram is smaller before the frame walk. The item had recorded four failed attempts; what
they missed is that the long header's Length field is a varint whose width grows with the value it carries,
so a size computed from the unpadded payload lands a byte short and adding the shortfall lands a byte over,
which the caller's max_datagram_size then refused as a limit. The send path now rebuilds and measures
instead of computing: each pass adds the shortfall the previous packet reported, and trims padding when a
pass overshoots, so the datagram lands on the minimum rather than above the path's limit. Two tests cover
it, and the frame-permission test -- which hand-built a short Initial to exercise RFC 9000 section 12.4 --
now expands its packet first, because the discard rule correctly applies before the rule under test.
Part 34 (c99, transport): a short packet is padded until it can be sampled. RFC 9001 section 5.4.2 takes the header protection sample from sixteen bytes four bytes into the packet number, so a packet too short to hold one cannot be protected -- and could not be sent at all. Found while adding the RETIRE_CONNECTION_ID handling below, whose frame is two bytes: the builder returned a truncation error and the frame never left the process, which applies equally to PING and to a small acknowledgement. The shortfall is at most three bytes and is filled with PADDING frames; the header's own length cancels out of the requirement, which is why no caller has to know the rule.
Part 35 (c99, transport): RETIRE_CONNECTION_ID retires an issued connection ID. RFC 9000 section 19.16
makes two sequences a PROTOCOL_VIOLATION -- one never issued, and the one the carrying packet was
addressed to -- and the frame was previously only handed to the caller, leaving the ID counted against the
peer's limit forever. Retiring now frees the slot and the peer's active_connection_id_limit budget, a
repeat of an already-retired sequence is tolerated because the frame is retransmitted when lost, and
replacing a retired ID stays with the caller because only it can produce a fresh ID and stateless reset
token. Writing that test exposed a second defect: the first ID this endpoint announced was numbered 0,
colliding with the handshake's own connection ID from section 5.1.1. Sequences now start at 1.
CI: the C99 job is green on all three legs as of
run 34730959272 (macOS clang, Ubuntu
gcc, Ubuntu clang). Two findings from the run before it are recorded because they were not what they looked
like. gcc's -Wmaybe-uninitialized failed the Release build on the Retry integrity tag's one-byte buffer
for a zero-length plaintext: a real uninitialized read if any backend ever touched it, fixed by zeroing the
buffer rather than by silencing the warning. The Ubuntu clang "Package consumer" failure, by contrast, did
not reproduce in the next run and no functional change was made to that script in between -- so it was a
runner-side flake, and the useful outcome is that check-package.sh now prints the failing step's output
and checks for the installed config file explicitly. Before that change the failure reached the CI log as
exit code 1 and nothing else, which is the opposite of what a check whose whole job is to diagnose the
install tree should do.
WT-82 (P3, c99, crypto, tests) -- CLOSED on main at 10471a3 (the thirty-seventh part): RFC 9001
appendix A.4's Retry packet and the integrity tag printed with it are extracted by
tests/vectors/extract_rfc9001_retry.py and asserted in test_quic_protection.c. The tag existed and was
computed, but nothing checked the value against the document: the test that existed proved it was computed
consistently -- the same answer twice, a different answer for another original connection ID -- which a
wrong key or nonce satisfies just as well. For a value whose only job is to let a client tell a Retry the
server sent from one an attacker injected, "self-consistent" is not the property that matters.
The extractor refuses to write a block that does not parse as a version-1 Retry with a zero-length
Destination Connection ID, a Source Connection ID of 1..20 bytes, a non-empty token and exactly sixteen
bytes of tag, and it checks that the original destination connection ID A.4 names in prose is the one A.2's
client Initial packet carries -- read from that packet's own hex, not from the sentence, so a typo in
either place fails the extraction. check-vectors.sh now runs its --check with the other four
extractors, so a hand-edited header fails CI rather than quietly changing what a test proves.
WT-83 (P3, c99, transport, tests) -- CLOSED on main at 369c163 (the thirty-eighth part), and it
turned out to be more than a test gap. The task was to cover the decoder's refusal of a NEW_CONNECTION_ID
whose retire_prior_to is above its sequence (RFC 9000 section 19.15), which the encoder cannot produce
because this library refuses to write what it would refuse to read -- so the frame had to be written by
hand into a packet. Writing it found that the refusal never reached the peer: the decoder reported the
code, but the connection returned the error status to its caller instead of closing, so a peer that sent an
undecodable frame was left uninformed and the connection stayed open, with the failure visible only to a
caller that noticed the status. RFC 9000 section 12.4 makes such a frame a connection error, so
process_packet now closes with the code the frame's own rule named, or with FRAME_ENCODING_ERROR when the
failure came back from the cursor helpers as a truncation -- which section 12.4 defines the same way. A
status raised by the frame visitor is left alone, because those paths have already closed with the code
they chose.
Worth recording as a pattern: both of these were recorded as test tasks and both found behaviour the tests could not have been written around honestly -- one a value never checked against its document, the other a protocol error never sent. The lesson is not that test gaps are cheap; it is that a test written against the specification rather than against the implementation is a review of the implementation.
Phase 4, the QUIC connection runtime, is complete on main at f07b592, and Phase 5 (the HTTP/3
core) is next. The plan's three completion criteria are met and stated in C99/README.md: IPv4 and IPv6
loopback carries a whole TLS 1.3 handshake and protected, acknowledged packets on macOS and Linux in CI;
the loss, probe-timeout and close-path suites pass; and every suite runs again under AddressSanitizer and
UndefinedBehaviorSanitizer. The C99 CI job was green on all three legs as of
run 34730959272 for the commit that
carried parts 36 to 38.
The tail of the phase, after the runtime itself was in place, was four parts and four recorded findings, and the pattern is worth keeping: three of the four were found by writing a test that asserted what the specification requires rather than what the code does.
-
Part 36,
WT-79: RFC 9000 section 14.1's 1200-byte Initial rule, on both sides -- the client expands, the server discards. Four earlier attempts had failed on the long header's Length varint, whose width grows with the value it carries; the send path now measures from the packet it just built and trims when a pass overshoots. -
Part 37,
WT-82: RFC 9001 appendix A.4's Retry packet and its integrity tag, extracted from the document bytests/vectors/extract_rfc9001_retry.pyand asserted in the test. The tag had existed and been computed consistently; nothing had checked it against the RFC, which a wrong key satisfies just as well. -
Part 38,
WT-83: the decoder's refusal of a NEW_CONNECTION_ID whoseretire_prior_tois above its sequence, written by hand because the encoder refuses to produce it. Writing it found that the refusal never reached the peer: the connection returned the error status instead of closing, so a peer that sent an undecodable frame was left uninformed. RFC 9000 section 12.4 makes it a connection error; it now closes with the code the frame's rule names. -
Part 39: packets addressed to a connection ID this endpoint issued are accepted, which is what makes
issuing them worth anything -- before this, a peer that used one had its packets discarded as somebody
else's. Section 19.16's "cannot retire the ID the packet was addressed to" now uses the sequence the
packet actually used. Writing the test also found that
wt_quic_connection_issue_connection_idaccepted an ID of a length this endpoint could never receive, because a short header carries no connection ID length; it is refused at the call now.
Phase 5, the HTTP/3 core, has its first part on main at 565b9d6. include/webtransport/http3/frame.h
is RFC 9114's frame codec: a varint type, a varint length and that many bytes of payload, with the
registered frame types of section 11.2.1, the error codes of section 8.1, the stream types of section
6.2.1, and the section 7.2.8 predicate for the frame types HTTP/2 reserved (0x1f * N + 0x21). Six tests
cover the round trips, the truncated cases, the encode refusals and the stream type prefix; the suite count
is 39 and the check count 76,388.
Three decisions in it are the ones later parts will lean on, and they are recorded here because they are the kind that get undone by accident:
- The codec interprets nothing. What a SETTINGS identifier means, what a GOAWAY identifier permits, and whether a frame may appear on the stream it arrived on are the stream layer's rules. One place decides whether a frame is well formed, another decides whether it is allowed.
-
A frame whose declared length is not in the buffer is a frame error, not a request to wait. HTTP/3 has
no partial frame: the stream layer assembles a frame's bytes before handing them over, so a short buffer
means the peer's frame was malformed. A length that does not fit
size_tis refused rather than narrowed. - A failed decode leaves the cursor where it was, so a caller can report which frame failed rather than only that one did, and an unknown frame type decodes like any other -- a codec that refused one would refuse whatever a later revision defines.
Phase 5's second part is on main at 2b85b35: include/webtransport/http3/settings.h parses and
encodes RFC 9114 section 7.2.4's identifier and value pairs. The suite count is 40, the check count 76,448.
Three of the section's rules decided the shape, and one of them decided the data structure rather than the code:
- A reserved HTTP/2 identifier (
0x02to0x05, section 11.2.2) is H3_SETTINGS_ERROR, and so is a value above one forENABLE_CONNECT_PROTOCOL, which RFC 9220 section 3 makes a boolean. - A duplicate identifier is a MAY in the section ("MAY treat the presence of duplicate setting identifiers as a connection error of type H3_SETTINGS_ERROR") and this build takes the option: a peer that names the same setting twice is disagreeing with itself, and there is no reading of the frame that is not a guess. The same MAY is available to be reversed later, which is why it is recorded here.
- An unknown identifier MUST be ignored, and the
0x1f * N + 0x21identifiers exist solely to exercise that rule. The table therefore stores identifiers as well as values: a duplicate of a setting this build does not understand is an error, while the setting itself is ignored. Refusing the exercise identifiers would break the one rule they exist to test.
The table is fixed at sixteen entries, so more settings than that is H3_EXCESSIVE_LOAD rather than a peer-authored memory bound, and a payload ending between an identifier and its value is H3_SETTINGS_ERROR rather than a short read -- HTTP/3 has no partial frame, the same rule the frame codec follows.
Recorded because it is the kind of thing a test is supposed to catch: the first version of the encoder's
ordering loop emitted entries twice and skipped others. The round trip would have reported only "the
payload does not parse", with PROTOCOL as the cause; the test that asserts the exact wire bytes by hand
named the real fault. check-vectors.sh-style exact-bytes assertions are cheap and this is why they earn
their place.
Phase 5's third part is on main at edb67be: include/webtransport/http3/control.h is RFC 9114
section 6.2.1's state machine for the peer's control stream. The suite count is 41 and the check count
76,525.
All four of the section's rules are connection errors, and the interesting one is the set of frames it refuses after SETTINGS. DATA, HEADERS and PUSH_PROMISE describe requests and have nothing to describe on a control stream; a second SETTINGS is forbidden by section 7.2.4's "MUST NOT be sent subsequently"; and the frame types section 7.2.8 reserved for HTTP/2 are checked before those, so a reserved type is reported as reserved rather than as whatever it resembles. CANCEL_PUSH, GOAWAY, MAX_PUSH_ID and unknown extension frames are allowed -- the half an over-eager implementation breaks -- so the tests cover the allowed set as carefully as the refused one.
Two design points recorded because later parts inherit them. The machine decides permission and nothing
else: it takes a frame TYPE rather than a frame, so what a SETTINGS, GOAWAY or MAX_PUSH_ID says stays with
the part that owns that frame. And a frame arriving before the stream was opened, or after it closed, is the
caller's own ordering: it returns WT_ERR_STATE and names H3_NO_ERROR, because there is no error to send
the peer -- a distinction the first version of the test got wrong by expecting a bare zero, which is why
the check reads the code rather than the status alone.
Phase 5's fourth part is on main at 54549ae: include/webtransport/http3/goaway.h carries RFC 9114
section 7.2.6 with section 5.2's shutdown rules, and http3/role.h is new alongside it because several
HTTP/3 rules are one-directional. The suite count is 42 and the check count 76,596.
The payload is one varint, so the work is in what it means. A server's identifier is a client-initiated bidirectional stream ID -- section 7.2.6 makes any other stream type H3_ID_ERROR, and RFC 9000 section 2.1's two low bits are zero exactly for that type -- while a client's is a push ID. That asymmetry is why the state carries the sender's role rather than just the identifier.
Three rules are worth recording because they are easy to get subtly wrong:
- The identifier may not grow. A larger one later is H3_ID_ERROR, and the reason is not tidiness: a client may already have retried the requests it was told were not processed, so a server that raised the number would be contradicting a decision the client has acted on. An equal or lower identifier is fine.
-
Rejected means
>=, not>. Section 5.2: "Requests or pushes with the indicated identifier or greater are rejected". Zero is therefore the "nothing was processed" case that rejects every request, which the tests pin. - A payload that is not exactly one varint is a frame error, for the same reason the frame codec gives: reading the first field and ignoring the rest would accept a frame this implementation cannot interpret.
http3/role.h was added rather than folded into the frame header: a role is not a frame property, and the
request-stream constraints, the push frames and the WebTransport session layer all need it.
Phase 5's fifth part is on main at 25f3940: include/webtransport/http3/streams.h is RFC 9114
section 7.2's "which frame belongs on which stream" table in one place. The suite count is 43 and the check
count 76,674.
The reason it is one function rather than eight checks is that each of the section's eight frame subsections
ends with the same sentence in its own words -- a frame on a stream it has no business on is
H3_FRAME_UNEXPECTED -- and a rule stated eight times is a rule with seven places to forget it. Two of the
rules turned out to be about the receiving endpoint's role rather than the stream, which is why
wt_http3_role_t (added with GOAWAY last part) is a parameter here: section 7.2.7 makes MAX_PUSH_ID a
client's frame and section 7.2.5 makes PUSH_PROMISE a server's, so receiving your own frame is the error in
each case. A QPACK stream is refused before the table is consulted at all, because section 4.2 says those
streams carry instructions rather than frames.
Recorded because it is the second time this happened in two parts, and in the same direction: the first version of the MAX_PUSH_ID test asserted that a client may receive the frame, when section 7.2.7 says the opposite. The failing check was in the test, not the code -- which is the direction that costs nothing. It is worth noting that the two role-dependent rules are exactly the two the test got wrong, so the table would have been written correctly by reading the sections in order and incorrectly by pattern-matching from the other six.
Phase 5's sixth part is on main at 9bbe679: include/webtransport/http3/request.h is RFC 9114
section 4.1's shape for the request direction -- HEADERS, DATA*, HEADERS? -- with the section's own sentence
enforced: anything that is not the next frame in that shape, and anything after the trailing HEADERS, is
H3_FRAME_UNEXPECTED. The suite count is 44 and the check count 76,731.
Two decisions are recorded because both are cases where the obvious implementation is the wrong one.
-
The response direction is deliberately absent. A server may send zero or more informational (1xx)
responses before the final one, and whether a HEADERS frame is informational can only be known from its
decoded
:status-- which needs QPACK. A machine that guessed from frame order would report a legal pair of responses as a duplicate, so the response half lands with QPACK, where it can be right. - An end before the request's HEADERS is not a malformed sequence. Section 4.1 has the server abort its own RESPONSE stream with H3_REQUEST_INCOMPLETE, which is a STREAM error; the machine reports it as one, because a caller that closed the connection over it would be turning its own decision into the peer's fault. The distinction between the two kinds of error is the thing this part exists to keep straight.
The request direction is the half that needs no QPACK, which is why it could be done now: a client never sends 1xx, so nothing about its stream depends on a decoded field.
Phase 6, QPACK, has its first part on main at 1e30aa3: include/webtransport/http3/qpack.h
exposes RFC 9204 appendix A's 99 entries with the exact-pair and by-name lookups a field line needs, plus the
section 8 error codes. The suite count is 45 and the check count 76,759, and check-vectors.sh now verifies
six vector sets, the static table being the sixth.
The table is generated from the RFC's own ASCII table rather than typed into C. That is not ceremony: an encoder that indexes entry 17 as one field and a decoder that reads it as another produce two different header sections, and nothing in the exchange would say so -- there is no checksum on a field section and no error to observe, just two peers disagreeing quietly. The extractor refuses to write unless the indices are 0..98 with no gap or repeat and every row parses, which is why the whole table can be regenerated and compared in CI.
Two findings are recorded because both are the kind that recur:
- The extractor first found the appendix heading in the RFC's table of contents instead of the body, so it read an empty section. The Retry extractor (part 37) made exactly the same mistake, and the fix in both is to match headings as whole lines. Any future extractor should start that way.
- The test first expected
:methodat index 44, which is HPACK's numbering. QPACK orders its static table by frequency -- CONNECT, DELETE, GET, HEAD, OPTIONS, POST, PUT at 15 to 21 -- not by pseudo-header as HPACK does. The code was right and the test was wrong. A table that exists in two specifications under the same name is exactly where an assumption like that gets made, so both numbers are now asserted with the reason written beside them.
Phase 6's second part is on main at ea870b8: RFC 9204 section 4.1's two primitives -- an integer
behind an N-bit prefix and a string whose length is one behind a seven-bit prefix with the H bit above it --
are in include/webtransport/http3/qpack.h and src/http3/qpack_primitives.c. The suite count is 46 and the
check count 77,321.
Two decisions are recorded because both are places where the convenient implementation loses information that cannot be recovered later.
- The H bit is returned, not dropped. This build does not decode Huffman yet. A codec that read the bytes and ignored the flag would hand field content that is actually Huffman-coded to the layer above, which would build a header section the peer cannot parse -- and nothing in the exchange would report it. The flag travels with the bytes so the caller has to decide.
-
The encoder's flags are the bits above the prefix, and only those. A flag inside the prefix is refused
rather than masked: a caller that set one meant something else, and silently dropping it would change the
representation it asked for. The first version of this check tested the wrong bits -- it required the flags
to fit in the top
8 - prefix_bitsbits, which refuses the entirely legal0x80above a seven-bit prefix, i.e. the indexed-field-line pattern this module exists to serve. The boundary tests caught it before anything used it.
The pattern across the last three parts is worth noting for the phases ahead: each one has had exactly one
wrong-first-version, and in every case the failing check was in the test rather than the code (MAX_PUSH_ID's
direction, :method's index, and now the flag mask). Test-first boundary cases are the cheapest review this
project has.
Phase 6's third part is on main at df89604: RFC 7541 appendix B's Huffman code, which RFC 9204
section 4.1.2 adopts, is generated into src/http3/qpack_huffman_table.h and decoded by
src/http3/qpack_huffman.c. The suite count is 47, the check count 77,331, and check-vectors.sh now
verifies seven vector sets.
Two decisions of substance:
- The decode index is derived, not assumed. The appendix prints the table in symbol order, so walking the rows to build a canonical (first code, offset, count) index per length does not work; the extractor sorts by (length, code) and then checks the canonical property against every entry before writing it. The decoder walks that index, which is O(1) per bit rather than a 257-entry scan.
-
The example is a test vector, not implementation data. Appendix C.4.1's Huffman-coded
:authorityvalue is written totests/vectors/, where the other RFC vectors live; only the table itself goes into the source tree. That split is worth keeping: the table is code, the example is evidence.
Three extractor findings, each a way a table parser goes wrong, and all three found by the extractor's own validation rather than by a failing test:
- The appendix prefixes printable symbols with their ASCII form, including
'|'for symbol 124 -- the one row a pattern that excludes pipes silently loses (the first version read 256 rows, not 257). - The table is in symbol order, not canonical order, which invalidated the first index derivation.
- C.4.1 prints two hex blocks -- the encoded header block and a per-representation decoding walk -- so the extractor has to take the first and stop at the blank line, or it splices the block together with its own explanation (the first version read 28 bytes for a 12-byte string).
Phase 6's fourth part is on main at a0316f7: wt_qpack_huffman_encode writes the same generated
table the decoder reads and pads the final byte with one-bits (the EOS prefix, RFC 7541 section 5.2).
wt_qpack_huffman_encoded_size exists because the code is not a fixed width, so a caller that guessed
would either overflow its buffer or refuse a string that fits. The suite count is 48 and the check count
78,373.
The point worth recording is the one the test makes: a round trip is not evidence here. An encoder and a
decoder that share a wrong table round-trip perfectly, and this project has already had one table bug that a
self-consistent test would have missed (the static table extraction, part 45's :method index). So the
verification is the RFC's own appendix C.4.1 plaintext encoding to exactly the twelve bytes the RFC prints,
which neither side can satisfy by agreeing with the other, followed by an exhaustive pass over all 256
symbols to cover the five-bit codes, the thirty-bit ones and the bit packing across byte boundaries.
That is the general shape for the remaining QPACK work: every table, every representation and every dynamic state change needs a check that comes from outside this implementation, because QPACK's whole failure mode is two peers disagreeing quietly.
Phase 6's fifth part is on main at 5a547bd: src/http3/qpack_field.c reads and writes all seven of
RFC 9204 section 4.5's forms. The suite count is 49 and the check count 78,410.
The decision that shaped the API is that the type says which table a line needs -- static, dynamic or
post-base -- instead of the decoder assuming. Resolving a dynamic index against the static table is the
mistake that silently produces a different header section, and it is invisible in any exchange because both
sides believe they are right. So the two static forms resolve to a name through
wt_qpack_field_line_static_name, while the dynamic and post-base forms return WT_ERR_STATE until the
dynamic table part consumes them deliberately.
Two smaller decisions, both about not taking a decision that belongs to a later layer: the decoder PEEKS the first byte rather than reading it, because each form's index (and the literal form's name length) is an integer whose prefix lives in that byte and the integer primitive is what reads it; and the N bit and the H bits travel in the parsed line rather than being acted on, exactly as the string primitive reports Huffman coding rather than decoding it.
Two mistakes of mine in this part, recorded because both are cheap to repeat: a test decoded from an
uninitialised buffer (the encoder's output lived in the helper's own array, so the helper's assertion passed
while the decode read garbage), and a hand-written "truncated value" vector began with 0xc1, which is the
INDEXED prefix rather than the name-reference prefix it was meant to exercise. The first was caught by the
test's own assertions, the second by the assertion failing in the direction the vector's name did not predict.
Phase 6's sixth part is on main at 0fa51ea: src/http3/qpack_dynamic.c is RFC 9204 section 3.2's
FIFO -- entries sized as name plus value plus 32, evicted from the oldest end, absolute indices that never
change meaning. The suite count is 50 and the check count 78,478.
Three decisions worth recording:
-
An evicted index is reported, not resolved.
WT_ERR_CLOSEDfor an index below the oldest live entry, because the alternative -- answering with whatever now occupies that position -- is how a decoder produces a header section the encoder never wrote while both sides believe they agree. - The table is bounded like every other piece of peer-driven state here: 32 entries and a 4 KiB arena, with refusals rather than growth, and an entry larger than the capacity refused outright because section 3.2.1 says the encoder must not insert one.
- Eviction compacts the arena, which is what keeps a long-lived table from running out of bytes after capacity's worth of traffic.
The bug this part found is the most instructive one in Phase 6 so far, and it was found by the test that inserts three entries into a two-entry table: the eviction moved the surviving entries' BYTES down but left their recorded OFFSETS behind, so the second entry's name pointed into what had been the first entry's value. That is a wrong name read out of a well-formed table -- the quietest possible QPACK defect, and one that every round-trip test written against this code alone would have passed. It is the second finding in a row that a test written against the structure (rather than against the implementation's own output) caught, and it argues for the remaining QPACK parts -- the encoder and decoder stream instructions, and the header block codec -- being tested the same way.
Phase 6's seventh part is on main at e5663b2: src/http3/qpack_encoder_stream.c applies RFC 9204
section 4.3's four instructions to the dynamic table and writes each of them from this implementation's own
side, so the writers and the reader are checked against each other on the wire. The suite count is 51 and the
check count 78,533.
Two errors are only visible at this layer, and both are the kind that must be errors rather than adjustments:
- A capacity above the SETTINGS limit this endpoint advertised (section 4.3.1) is QPACK_ENCODER_STREAM_ERROR, not a clamp to the limit. Clamping would accept a peer's instruction while doing something else, which is the disagreement QPACK has no way to detect later.
-
An index naming an evicted entry is an error for the same reason the dynamic table reports
WT_ERR_CLOSED: resolving it to whatever now occupies that position is precisely the quiet corruption the previous part's offset bug produced.
The Huffman-coded insertion is refused explicitly (WT_ERR_STATE) rather than decoded here: the encoder
stream stores DECODED bytes, so a coded name or value needs a decoder buffer that belongs with the part that
owns the insertion path end to end. That is recorded as remaining work rather than papered over.
One C detail worth keeping: an enum member may not share a name with a macro. The error codes were
already #defined, so the first version of the error enum was macro-replaced before the compiler saw it and
the header failed to parse in every translation unit that included it -- a whole-tree build failure from one
line, caught immediately but worth remembering as a layout rule for this header.
Phase 6's eighth part is on main at 5ea48dd: src/http3/qpack_decoder_stream.c applies RFC 9204
section 4.4's section acknowledgement, stream cancellation and insert count increment, and writes them. The
suite count is 52 and the check count 78,566.
The section's two error rules are both about instructions that would otherwise be no-ops: an increment of zero says nothing (QPACK_DECODER_STREAM_ERROR), and an increment that would take the acknowledged count past the number of insertions cannot describe a decoder that processed them.
The correction this part produced matters more than the instruction parsing, and it changed a part that
was already committed. A truncated instruction was being reported as QPACK_*_STREAM_ERROR in both stream
modules. But an instruction whose bytes have not all arrived is INCOMPLETE, not malformed -- RFC 9204 section
2.2 delivers instructions on a stream, in pieces, and waiting for the rest is the correct response. Only a
malformed instruction is the peer's fault; the caller that sees the stream END with an instruction half-read
is what reports the error. Both modules now return WT_ERR_TRUNCATED with no error code for that case, and
both tests assert the distinction.
That is worth recording as a general rule for the parts left: a parser that reports "malformed" for "not yet" turns an ordinary network split into a connection error, and the stream-shaped protocols here (QPACK instructions, HTTP/3 frames, the WebTransport session layer) all deliver their units in pieces. The packet-shaped layer is the one place where "not all here" really is malformed, because a packet is a datagram.
A smaller note: the first version of the truncation test used 0x80 as its vector, which is a COMPLETE
section acknowledgement of section zero -- the seven-bit prefix holds the whole value. 0x7f is the
instruction whose prefix is full and whose continuation is missing.
Phase 6's ninth part is on main at 980cc77: src/http3/qpack_header_prefix.c is RFC 9204 section
4.5.1's Required Insert Count and Base, with both of the section's error exits and wt_qpack_max_entries to
derive the window from the capacity. The suite count is 53 and the check count 78,616.
The finding is the kind only an exact-byte check catches, and it is worth recording as a reading rule for the
rest of RFC 9204: the S bit is the MOST significant bit of the Base byte, not the bit below it. The RFC's
figures number their bits left to right from the top, so | S | Delta Base (7+) | means S = 0x80 and the
prefix = 0x7F. Reading it as 0x40 puts the sign inside the seven-bit prefix, which this module's own flag
check then rejected -- so the encoder refused every prefix whose Base was below its required count, and the
tests that failed were the ones asserting a valid prefix encodes, not the ones asserting it round-trips.
That is the third time in Phase 6 that the failure was caught by a check written against the specification rather than against the implementation's own output, and the second time the bit-level reading of a figure was the issue (the earlier one was the flag mask in the integer primitive). The rule those two share: RFC 9204's bit figures are drawn MSB-first, and anything that reads a figure's bit positions has to say so out loud in a comment, because both readings look plausible in code.
Phase 6's tenth part is on main at a1afa89: src/http3/qpack_field_section.c resolves one field line
at a time against the static table, the dynamic table and the section's prefix. The suite count is 54 and the
check count 78,668.
Four points worth recording:
-
The index arithmetic is the part that needs adversarial tests.
Base - Index - 1for a dynamic reference andBase + Indexfor a post-base one are the only two places the directions live, and a sign error resolves to a DIFFERENT but perfectly valid entry -- a wrong header field, not a parse failure, and nothing later in the exchange can detect it. The tests assert both directions with neighbouring indices at the same Base (0 and 1) rather than one index that would pass either way, plus an index AT the Base and an entry the table never held. -
Two failures are kept apart. A reference the tables cannot resolve is
QPACK_DECOMPRESSION_FAILED; a scratch buffer the caller did not make large enough is
WT_ERR_LIMITwith no error code, because it says nothing about the peer. Conflating them would make this endpoint close a connection over its own buffer size. - A resolved field must be plain bytes, and this is the layer that knows it: an inline Huffman name or value is decoded into the caller's scratch here rather than handed up coded.
-
A gap is now explicit rather than implied.
wt_qpack_string_encodewrites only plain strings, so this build cannot yet WRITE a Huffman-coded string into a field line. The test builds that line by hand from section 4.5.3's figure, because a test that used the encoder would be testing a line the encoder cannot produce. The encoder-side Huffman string is remaining work, recorded rather than hidden.
That last point is the pattern for what is left in Phase 6: the decoder side is now complete enough to read a section, and the encoder side -- Huffman strings on the way out, the section encoder, the reference tracking that decides what may be evicted -- is what the remaining parts have to build.