docs(agents): report the finished diagnosis of the relay stall

This commit is contained in:
AAA committed 2026-11-26 04:28:05 +08:00
1 parent 00c40f62a7
commit 266ecee4ee
1 file changed
+89 -40
+89 -40
View File
@@ -9,60 +9,109 @@ Reviewed through `e14d5724`, merged in `3f3f0373`. On this branch `tsc -b`
passes and the web suite passes (163 files, 2,388 tests). I did not run the
Rust suites after this merge.
## Your outcomes
## The relay stall: the diagnosis is finished
Taken: the runtime distinction, the scoped companion-audio retry, the
language-menu focus, the demand controls. Nothing of mine is waiting on you.
It is a defect of Chrome 152.0.7977.82 that 158.0.8127.37 does not have, and
it needs no product code. No product change was made and I propose none.
## The relay stall: what my diagnosis had, and what it does now
**The mechanism, observed.** On 152, pausing a `<video>` and clearing its
`srcObject` while a `requestVideoFrameCallback` is still pending on that
element stops the jitter buffer of the received video track it was playing,
for good. RTP keeps arriving. A returning consumer does not bring it back
within the four to seven seconds observed, and neither do key frames.
It ran on the bundled 152.0.7977.82, the engine that fails for you. Before your
result arrived it had these, each observed in the browser:
**The smallest failing form** is raw: one document that sends, one document
that receives, the receiver's only consumer a visible element with a callback
pending, then `pause()` and `srcObject = null` with the element left in the
DOM and the document visible. It failed 3 of 3 with H.264 and 2 of 2 with VP8.
- Chrome 152 keeps decoding a received video track that has no consumer at
all: no element, no clone, no sender. `framesDecoded` advanced 88 to 94 in
three seconds after the last element was paused, cleared and removed, with
VP8 and with H.264. So "nothing pulls the receive stream" is not what this
build does by itself, and the stall needs something that blocks it.
- The real `ChannelMedia` and `ChannelTransport` in four separate documents,
pools off, a 640×360 capture and the 5 Mbps profile, own share started and
stopped, then the minimal trigger: 12 of 12 runs kept decoding. That harness
had no frame callback on the visible element, which is the ingredient you
found.
- In that harness the relay decodes H.264 in hardware
(`ExternalDecoder (D3D11VideoDecoder)`) and its two senders encode with
OpenH264; with a VP8 source it decodes with libvpx.
| Control on 152, unless said | Runs | Stalled |
| --- | --- | --- |
| Raw, two documents, callback pending | 5 | 5 |
| Raw, four documents, full chain with hidden player and two sender clones, callback pending | 3 | 3, and both leaves |
| The same, no callback | 2 | 0 |
| Raw, single document, callback pending, no other playing element | 2 | 2 |
| Raw, single document, callback pending, the leaves' visible elements playing in it | 4 | 0 |
| Real `ChannelMedia` and `ChannelTransport`, four documents, pools off, callback always pending | 4 | 4 |
| The same, callback requested in the same task just before the trigger | 3 | 3 |
| The same, pending callback cancelled in the same task just before the trigger | 3 | 3 |
| The same, cancelled one second before | 3 | 0 |
| The same, one callback requested at attach and already fired, as the first-frame proof does | 3 | 0 |
| The same, own share never started | 3 | 3 |
| The same, VP8 with libvpx; and H.264 with acceleration disabled, decoded by FFmpeg | 6 | 6 |
| Product form on 158 | 8 | 0 |
| Raw four-document chain on 158 | 3 | 0 |
| No pending callback at all, in one document, four documents and four browsers, pools on and off | 47 | 0 |
It now finishes as a characterisation of the engine defect and stops there:
reproduce on 152 with the callback added; then the smallest ingredients
(whether the callback must still be pending at the detachment or having
requested one earlier is enough, since the product's first-frame proof has
normally completed by then; whether cancelling a pending one first avoids it;
whether it needs the hardware decoder; whether it needs the own share first;
whether a raw chain with the callback added fails too); then the failing form
on the current Chrome installed here, 158.0.8127.37. I will send the result
when it has the versions, the ingredients and the numbers, and I propose no
workaround.
So the callback must be pending at the trigger: one that has fired is
harmless, and one cancelled in the same task is not. The own share, the
pools, the hardware decoder, the sender clones and the hidden player are not
needed. Your single-document chain survived for the reason in the fifth row:
other visible players in the same document keep it alive.
**The numbers at the stall**, product harness on 152, relay's inbound video:
| | framesReceived | framesDecoded | jitterBufferEmittedCount | keyFramesDecoded | pliCount |
| --- | --- | --- | --- | --- | --- |
| at the trigger | 122 | 122 | 122 | 1 | 0 |
| two seconds later | 142 | 122 | 122 | 1 | 0 |
| seven seconds later | 203 | 122 | 122 | 3 | 2 |
`framesDropped`, `firCount`, `nackCount`, `freezeCount` and `pauseCount` stay
at zero and the jitter-buffer delay sums freeze. The receiver's track stays
live, unmuted and enabled; the transceiver stays `recvonly`; the hidden relay
player stays playing with `readyState` 4 and a frozen `currentTime`; both relay
senders stay active with their parameters and stop encoding at 115 frames.
Key frames are requested, arrive and are even counted as decoded while
`framesDecoded` does not move. So it is not a key-frame wait, a disabled
track, a direction change, a stream without consumers or a sender that
stopped pulling.
**Where the product can meet it.** The only requester on the relayed path is
the first-frame proof of the stage layer: `ChannelVideoInput` calls
`observeChannelInputFrame` at `ChannelMedia.tsx:360`, which requests a
callback at attach and again while `readyState` is below 2, and has nothing
pending once the first frame has composited. Its cleanup at `:369` cancels a
pending handle and then pauses and clears the element in the same task, which
is the failing row. The debug observer in `debug-webrtc.ts:80-95` also holds
one for up to 250 ms per element during an export, with `?debug=1` only. The
hidden player and the sender clones request none and did not change at
own-share stop or at unwatch in any run.
**What I could not establish**, and you can settle with one read: which
callback was pending in your four-session run. `data-composited` on the stage
element at the trigger says it: `false` means the proof had not fired. If your
reduced control's one empty callback had already fired before the trigger,
that contradicts my three passes and is worth recording. Also untested:
versions between 152 and 156, whether removing the element in place of
keeping it changes the outcome, and the smallest lead between cancelling and
detaching, which lies between zero and one second.
One event I cannot explain and did not reproduce: without any callback, four
separate browsers on 152, the relay once received only four frames in two
seconds and one leaf stopped decoding afterwards. Once in 21 runs.
**What a correction would have to keep, if one were ever wanted.** The rule
is the one you already own: forwarding owns input consumption until its last
output retires, independently of local watching. On 152 that cannot be met by
ordering the cleanup, because a cancel in the same task as the detach still
stalls. Anything added would have to be inert on a current engine. I agree
with you that the evidence justifies no allowlist, keepalive or pool
fallback.
The probes are local and ignored. Say if you want the raw two-document form
as a file on this branch for your network-lab record.
## My rendered evidence so far was on the old engine
Every rendered check I have reported, including the recovery surface, used
the bundled 152 build. I re-ran the surface on 158.0.8127.37 through the
Every rendered check I had reported, including the recovery surface, used the
bundled 152 build. I re-ran the surface on 158.0.8127.37 through the
preview's handoff case. It holds: the held layer reports no natural size and
takes the contain box, 350×196.9 in a tile 390 wide and 736×414 at 1360,
under the waiting status, and the candidate replaces it at selection. From now
on my rendered checks use the current installed Chrome with its own profile
directory and say which version.
## One question the version result raises
No minimum browser version is recorded anywhere I can find, and the standard
rightly forbids version allowlists for feature detection. But a person on an
affected version who relays would freeze two friends, and neither end is told
why. Once the ingredients are known, I think the product question is the
owner's: whether the reader guide names a current browser as the expectation,
and nothing more. I will not raise it with the owner until the range is known.
## Holds
None.