Repository navigation
WebTransport Swift 1.3.1
Published from commit ac1c71c. A patch release over 1.3.0, carrying one correctness fix. The code audit for the 1.3 series was performed by Claude Opus 5.
Corrected after publication. These notes originally claimed this fix cut session establishment failures from 14 in 2100 to 1 in 1400. That measurement was taken on a development machine under heavy load and does not reproduce. On four otherwise idle Macs, 1.3.0 and 1.3.1 each completed 4000 loopback sessions without a failure, and with every core saturated both failed at roughly 1% with no difference between them. The fix is real and worth having, but it is a correctness fix, not a reliability improvement. The withdrawn figures and the replacement measurements are recorded in Audit Phase 05.
Fixed
An inbound QUIC stream delivered twice was processed twice.
A QUIC stream identifier is unique for the life of a connection and is never reused, so the same identifier arriving twice is a re-delivery of a stream already handed out. Network.framework does this occasionally: the peer's CONNECT request stream is delivered, read, used to establish the session, and then delivered again afterwards.
Passing the repeat on failed the session, in whichever of two ways the timing chose:
- handed to the WebTransport stream path, it was parsed as a new stream and rejected with
unknown WebTransport stream marker: 0— the marker being the HTTP/3 control stream type read back off a stream the peer never framed that way; - handed instead to a reader waiting for real work, it blocked on a stream with nothing left to give, and the session sat there until it timed out.
The second shape was originally believed to account for the failures that look like plain hangs. Later measurement does not support that: the hangs are load-induced and occur equally with and without this fix. What the guard demonstrably removes is the unknown WebTransport stream marker: 0 failure, which has not been observed since.
Measured
Correlation, before anything was changed: across 300 sessions instrumented to report repeats, 299 succeeded with none and the single failure had one.
Paired interleaved runs against the released 1.3.0 binaries, alternating arms under identical conditions:
Measured on four otherwise unused Mac minis with the published release binaries, paired and interleaved:
| Host state | 1.3.0 | 1.3.1 |
|---|---|---|
| Idle (load ~1.5 on 8 cores) | 0 / 4000 | 0 / 4000 |
| Every core saturated (load ~30) | 21 / 2400 (0.88%) | 28 / 2400 (1.17%) |
Neither release fails on an idle machine, and under load the two are indistinguishable.
Known limitation
Session establishment is load-sensitive. No failures were observed in 4000 sessions per release on an unsaturated machine; with every core saturated, roughly 1% fail to establish and end in a timeout rather than an error. The underlying race has not been isolated, because enabling diagnostic logging suppresses it entirely. Treat a connect timeout as retryable whenever the host may be under load. See Known Limitations.
Verification
- 260 package tests, plus 40 client and 40 server conformance scenarios, under
-warnings-as-errorswith complete concurrency checking. Four tests are new; two of them fail against 1.3.0 and pass here. - CI green on the release commit across all three jobs.
- Docker interop 5/5 across pywebtransport/aioquic, web-transport-quinn and web-transport-quiche.
Binaries
Thin arm64 Mach-O, running natively on every Apple Silicon Mac (M1 and later). Ad-hoc signed rather than Developer ID signed, and not notarized, so Gatekeeper quarantines them on first run.
shasum -a 256 -c SHA256SUMS
xattr -d com.apple.quarantine WebTransportClient WebTransportServer
./WebTransportServer --scenario all| Artifact | SHA-256 |
|---|---|
WebTransportClient |
d74e99f6dacb2b8c8af0d03c6fd6f418f22010f6c2cd9b2ce230b5c8294a0af6 |
WebTransportServer |
1113bd10bb1e4013586eeb9476a158345723338752081058fdd8716a8fefed6f |
Both are reproducible: ./Swift/build-release-apple-silicon.sh performs two clean builds and compares normalized Mach-O hashes.