S028: merge main (S031 timers patch kept) into s022-mse-proto; progress note

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-12 21:24:38 -06:00
commit 67095081bd

View file

@ -319,10 +319,21 @@ Later: S010 list: user checks the Discord icon with their own client (the Discor
- Not to spec / not done: player integration (S028): `loadedmetadata`/HAVE_METADATA after the init segment only (duration-boundaryconditions 0/13, play/seek tests 0/1 each); changeType across containers (gst can't; changetype-play* ~1/19); errors before the init segment; `buffered` after `removeSourceBuffer` should throw; Opus/fLaC in MP4 (no decoder). Worker MSE and ManagedMediaSource out of scope.
- Seen once: a full WPT run hung the script thread (driver timer stopped at file 19); not reproduced in the rerun. Watch in S028.
## S031 — SIGSEGV after an ad-blocked script load (R5-01, 2026-11-12)
- Repro: `crash-adblock.txt` (685 cancelled loads/run) 0 crashes in 3 runs, heavy-web 0/2, a YouTube search loop 0/3. The crash is rare online; the two S024 cores (hidden Xvfb heavy-web runs) were symbolized with an unstripped rustc twin of the same commit (same .text).
- Backtrace (both cores): script thread, `ScriptThread::handle_msgs` → `TimerListener` task → `OneshotTimers::fire_timer` → `Function::Call_` → `GlobalScope::from_object` → `JS::GetNonCCWObjectGlobal` reading a swept object (`0x4b4b…` poison). The ad-block log line before it was a bystander.
- Cause: `fire_timer` (servo-script `event_loop/timers.rs`) moves every due timer out of the traced timer list into a plain local `Vec` and runs them one by one; a GC inside one callback can't see the rest, so their `TracedCallback` functions are swept and the next call reads a dead object (or a reused cell: the wrong function runs).
- Proof offline: `pages/crash-timers.html` (40 timers due together, each allocating): 9 of 40 callbacks run, the other 31 are silently lost, 3 of 3 runs; without the allocation all run.
- Fix: servo-script vendored (`vendor/servo-script`, `[patch.crates-io]`); `fire_timer` keeps due timers in a `RootedTraceableBox<VecDeque>`, `JsTimerTask::invoke` roots the running callback (DESIGN.md "Vendored servo-script patches"). After: 40 of 40 run.
- Smoke `crash-adblock.txt` (~870 cancelled loads + 3200 timers under GC pressure): fixed build exits 0 3/3 (visible); the pre-fix build (68346f0) fails it (timer page never finishes). No Nacre-side change, so no unit test.
- Reruns (resumed session): crash-adblock 3/3, net-adblock, launch green (visible); heavy-web ×2 no SIGSEGV and no core, both reach `status done`; their failed asserts are YouTube search/playback/PiP (main has no MSE, S028). `cargo test` 70 green.
- S028 merge: the MSE branch also vendors `vendor/servo-script`; take the branch's files and re-apply the two `Nacre patch (S031)` hunks in `event_loop/timers.rs` (the branch's timers.rs is the pristine 0.7.0 file).
## S028 — MSE player integration (WIP, stopped for the weekly limit, 2026-11-12, branch s022-mse-proto)
- Done: main merged in (mse smoke green). Attach doesn't block the script thread (max stall 35 ms, was ~1 s). loadedmetadata after the init segment (own MP4/WebM byte-stream check; gst_mse reports it only with frames), readyState from buffered at currentTime, byte-stream append errors (garbage / media before init), `buffered` throws once removed, failure steps detach the MediaSource, codec table (vp09, Opus/fLaC, vorbis, hevc). New `tests/smoke/mse-player.txt`: 7/9 cases.
- Next: two gst_mse C fixes: (1) msesrc sends no EOS after endOfStream (S027's abort patch dropped it), so no `ended`: set EOS on the track buffers at end of stream, clear on reopen; (2) `on_duration_changed` shrinks a page-set duration (breaks seek past buffered): only raise it. Then cargo test (new unit tests never run), WPT rerun (baseline 239/407), full smoke set, DESIGN/FEATURES, merge.
- Merge note: main vendors servo-script too (S031, 0ecfd0f): take the branch's servo-script files and re-apply the two `Nacre patch (S031)` hunks in event_loop/timers.rs.
- State (stopped by orchestrator, 2026-11-12): gst_mse patches 10-11 (EOS at endOfStream, duration only grows) committed; mse-player 9/9, cargo test 70 + media crate tests 11 green; DESIGN/FEATURES/CLAUDE docs done; plan boxes 1-5 ticked. origin/main merged into the branch (servo-script = branch files + main's S031 timers.rs), merge NOT built. Smokes on the pre-merge binary: launch, basics, input, chrome, keys green; mse.txt fails `reopen` (mse-spec.html, regression from patch 10's clear-EOS on reopen? check first); settings, mse-player rerun, heavy-web, WPT not run. Next: fix `reopen`, build the merged branch, rerun smokes + crash-adblock + WPT, then merge into main.
## Later
- Turnstile widget paints as a black half-disc (Servo painting of its iframe/shadow DOM, S006 site doctor).