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

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

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. Still open from WT-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_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, 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.

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.

Clone this wiki locally