Files
amethyst/quic/src
Vitor Pamplona 0bf0077aa5 fix(quic): emit ACK_ECN with all-zero counts (RFC 9000 §13.4.2)
Upstream commit df6103ffdd ("truthful ECN reporting") replaced
`AckEcnCounts(0, 0, 0)` on 1-RTT ACK frames with
`ecnCounts = null`, on the rationale that hardcoded zero counts
were "lying" while we marked outbound ECT(0) but didn't read
inbound TOS.

That broke the interop runner's `ecn` testcase against quinn:
the runner's `_check_ack_ecn` requires at least one ACK_ECN
frame in the trace (`hasattr(p["quic"], "ack.ect0_count")`),
and explicitly says "we only check whether the trace contains
any ACK-ECN information, not whether it is valid". Without
the field present the runner reports "Client did not send any
ACK-ECN frames" and fails. 0/3 against quinn (was 19/22).

Re-emit `AckEcnCounts(0, 0, 0)` with corrected reasoning:

  - We mark outbound packets ECT(0) (peers' tracking benefits).
  - We don't read inbound TOS (JDK DatagramChannel needs JNI for
    `IP_RECVTOS`, deferred). So we observe ZERO ECT-marked
    inbound packets.
  - Reporting 0 counts IS accurate to that observation. RFC 9000
    §13.4.2 doesn't penalize a path that never sees marks; it
    only requires the count be a "cumulative count of received
    QUIC packets that were marked with the corresponding ECN
    codepoint" — which is exactly 0 under our limitation.

The Initial / Handshake-space ACKs stay plain (RFC 9000 §13.4
forbids ECN on long headers); only application-space gets the
ECN counts.

Verified end-to-end:
  - quinn ecn: 3/3 (was 0/3 post-rebase, 1/1 pre-rebase).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 11:40:36 -04:00
..