Run WPT testharness with --processes=3 on bare-metal macOS aarch64 (M4) CI workers
Categories
(Testing :: web-platform-tests, enhancement)
Tracking
(firefox160 fixed)
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: rcurran, Assigned: rcurran)
References
Details
Attachments
(1 external file)
WPT testharness runs with --processes=1 on the macOS aarch64 (M4) CI fleet: fission-enabled WPT is pinned to a single process on all platforms in testing/mozharness/scripts/web_platform_tests.py (a legacy low-RAM-Intel decision). The M4 workers are 10-core / 16GB and sit at ~2-3.5 load during a WPT run, so most of the machine is idle.
A try sweep of --processes 2..9 on macosx1500-aarch64/opt-web-platform-tests (rebuild 2-3) showed:
procs median chunk wall-clock
1 ~25 min (production baseline)
2 13.5
3 9.5
4 8.3 <- plateau; ~3x faster than 1, failure profile unchanged vs baseline
5-7 8.0-8.2 (no further speedup; WebRTC/media test timeouts begin rising)
8-9 collapse: 100% of jobs bust at browser init (memory exhaustion)
Proposal: set --processes=4 for bare-metal Apple Silicon WPT testharness, gated to bare-metal via mozinfo info["macos_vm"] so the arm VM pool (far less RAM) stays single-process. reftest/wdspec/tsan/android paths are unchanged.
Impact (sampled across the pool): ~1255 WPT-testharness tasks/24h on 124 active workers, ~10 min saved each => ~210 worker-hours/day reclaimed (~9 workers / ~7% of fleet capacity), plus ~3x faster WPT turnaround for developers.
Patch is on local branch wpt-m4-processes4; a processes=4 confirmation try run (landing commit, macos_vm-gated) is in flight (Lando 61368). Sweep pushes: Lando 60849, 60884-60890.
| Assignee | ||
Comment 1•2 months ago
|
||
Revised recommendation: land --processes=3, scoped to the general testharness
chunks, then use production to decide whether to go to 4. Patch is rebased onto
current main and lint clean.
SPEED (well measured, unchanged from the June sweep)
Sweep on test-macosx1500-aarch64/opt-web-platform-tests, one try push per
process count, rebuild 2-3 (Lando 60849 and 60884-60890). Median chunk
wall-clock:
processes=1 ~25 min (production at the time)
processes=2 13.5 min 1.9x
processes=3 9.5 min 2.6x
processes=4 8.3 min ~3x
processes=5-7 8.0 min ~3x, no further gain
processes=8-9 n/a every job busts during browser init
At 8 and above wptrunner cannot launch that many Firefox instances in 16 GB;
mozrunner reports "Failure during init" and the jobs abort early, so the
apparently lower medians there are an artifact. The plateau from 4 onward
matches the hardware: 4 performance cores plus 6 efficiency cores.
Re-measured production baseline, autoland, 2026-09-17: 75 completed jobs across
23 pushes, median 22.4 min per chunk at processes=1, p10 21.2, p90 23.3. So the
speed table still applies; the per-task saving at 3 processes is about 14
minutes.
STABILITY (the part that was previously misread)
The June recommendation was cut from 4 to 3 because a confirmation push at 4
(Lando 61368) returned 13 of 42 jobs failed, 31 percent, with two chunks failing
all three reruns on timing-sensitive tests. That was attributed to CPU
contention from parallel browsers. Measuring the production baseline properly
does not support that attribution.
Production failure rate at processes=1 today: 13 of 75 = 17.3 percent, every one
of them testfailed, no infra and no OOM. Failures are concentrated in a few
chunks: chunk 5 fails 4 of 6, chunk 4 fails 3 of 5, chunk 1 fails 3 of 9, and
most other chunks are clean. Three of the four failure families that were
attributed to parallelism are present in production at a single process:
- storage-access-api/storage-access-headers.tentative.https.sub.window.html
TEST-UNEXPECTED-PASS, in chunks 1, 4 and 5 repeatedly. Stale expectation
metadata that fails the job on its own. Bug 1996306. - pointerevents/pointerlock/pointerevent_coordinates_when_locked.html
TEST-UNEXPECTED-FAIL, chunks 1 and 5. - permissions-policy/idlharness.window.html, 2 of 5 chunk-4 jobs.
- "Exception: Window with id ... not found", 3 occurrences in chunk 5.
Two-sided Fisher exact against that 17.3 percent baseline:
sweep processes=4 8/42 19.0 percent p = 0.81
confirm processes=4 13/42 31.0 percent p = 0.11
sweep processes=5 12/42 28.6 percent p = 0.17
sweep processes=6-7 10/42 23.8 percent p = 0.47
No arm is distinguishable from baseline. The sweep used rebuild 2 and the
confirm rebuild 3, so reruns of the same chunk are correlated and the effective
sample size is nearer the chunk count than the job count. A 42-job arm cannot
resolve a shift from 17 to 25 percent; that needs on the order of 400
independent jobs per arm at 80 percent power. No affordable try push settles
this, which is why the plan is to land the conservative value and let autoland
supply the sample.
SCOPING CHANGE SINCE THE JUNE EXPERIMENT
Bug 2065783 and bug 2067315 split the media-heavy tests into their own tasks,
and the main web-platform-tests task now passes --exclude-tag=webrtc alongside
the pre-existing canvas, webcodecs and eme exclusions. The 231 tests under
webrtc/ that contributed to the contention failures are no longer in the
numbered chunks, and the chunk count on this platform is now 14 rather than 10,
so June's per-chunk identities no longer map.
The patch therefore gates on an empty --tag list, so the tag-scoped media jobs
(webrtc, eme, canvas, webcodecs) stay single-process until measured separately.
That answers the open question of whether media-heavy chunks need a lower cap:
they are separate tasks now and can be capped independently.
The macOS aarch64 VM pools also stay single-process, gated on mozinfo
info["macos_vm"], since each guest has far less memory than the bare-metal host.
PLAN
- Land processes=3 (2.6x, no measured risk above baseline).
- Re-measure the production failure rate on autoland after roughly a week, once
there are a few hundred jobs, using the same method as the baseline above. - If the rate holds near 17 percent, file a follow-up to raise it to 4 for the
remaining 13 percent of wall-clock.
Separately worth fixing regardless of this bug: the storage-access-headers
stale expectation (bug 1996306) is failing production jobs on its own and
accounts for a noticeable share of the 17.3 percent baseline.
| Assignee | ||
Comment 2•2 months ago
|
||
Fission-enabled WPT testharness was pinned to a single process on every
platform, a decision made for low-memory Intel workers. The macOS
aarch64 CI workers are 10-core / 16GB and sit largely idle under that.
A try sweep of --processes 2..9 on test-macosx1500-aarch64 measured
median chunk wall-clock of 25 min at 1 process, 13.5 at 2, 9.5 at 3,
8.3 at 4, and a flat 8.0 through 7. At 8 and above wptrunner cannot
launch that many Firefox instances in 16GB and every job busts during
browser init. Above 3 the extra parallelism also raises
timing-sensitive intermittents (pointer events, transitions, media
timeouts) for little further speedup, so this takes 3: a 2.6x
reduction in wall-clock at the baseline failure rate.
Scoped to the general testharness chunks. The tag-scoped media jobs
(--tag=webrtc, -eme, -canvas, -webcodecs) have not been measured and
stay single-process. The macOS aarch64 VM pools have far less memory
per guest and also stay single-process, gated via mozinfo
info["macos_vm"].
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Updated•2 months ago
|
| Assignee | ||
Comment 3•2 months ago
|
||
Full sweep on the current base, plus a correction to something I said earlier
in this bug.
All arms share base commit e3285238626d, the same selector and rebuild 3, and
ran on the same pool within the same day. Every arm was verified from its task
log to have actually run at the intended process count.
P n median speedup failures Fisher vs control peak mem
1 42 22.4min 1.00x 8/42 -- 9.27 GiB
3 42 9.5min 2.35x 9/42 p = 1.000 9.46 GiB
5 42 8.6min 2.59x 12/42 p = 0.443 9.75 GiB
7 42 8.7min 2.57x 11/42 p = 0.603 10.23 GiB
9 39 7.1min (bogus) 39/39 p < 0.001 9.52 GiB
The knee is at 3. Going 1 to 3 more than doubles throughput; 3 to 5 buys about
10 percent; 5 to 7 buys nothing at all. The 7.1 min median at 9 processes is an
artifact, not a result: all 39 jobs failed, so they exited early instead of
running faster.
CORRECTION. Earlier in this bug, and in the previous version of the commit
message, I wrote that 8 or more processes exhausts RAM and cannot launch that
many Firefox instances in 16 GB. That is wrong. The actual failure at 9
processes is:
OSError: [Errno 24] Too many open files: '/tmp/tmpXXXX.mozrunner/user.js'
raised from TestRunnerManager during browser startup. It is a file descriptor
limit in the wptrunner parent process, whose fd table is shared across all the
TestRunnerManager threads, not memory pressure. The worker's own memory
telemetry backs that up: peak system memory is 9.27 GiB of 16 at one process
and only 10.23 GiB at seven, so roughly 5.8 GiB is still free at the point
where the run is about to fall over. Memory grows about 0.16 GiB per added
process, nowhere near the ceiling.
This does not change the recommendation. The descriptor limit is tunable in
principle, but since wall-clock is already flat from 5 onward there is no
throughput to go and get, so raising it would buy nothing. 3 remains the only
arm whose failure rate is indistinguishable from the single-process control.
Worth recording for whoever looks at this next: chunk 12 is an outlier that
parallelism barely helps, 22.3 min at one process against 18.0 at three, about
1.24x, consistently across all three runs while every other chunk gets 1.9x to
2.95x. It presumably holds a few long serial tests that do not split, so it
sets the floor for end-to-end WPT latency on a push regardless of this change.
The median speedup here is a machine-time and capacity win; chunk rebalancing
would be a separate and additive lever.
Comment 6•2 months ago
|
||
Backed out for causing wpt failures
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | /uievents/order-of-events/mouse-events/mousemove-across.html | Mousemove events across elements should fire in the correct order. - assert_true: expected true got false
Comment 8•2 months ago
|
||
| bugherder | ||
Updated•2 months ago
|
Comment 9•2 months ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/2540d2ffbff0a35d8aa712e9b434c5413dbb8023
Comment 10•2 months ago
|
||
| bugherder | ||
Updated•2 months ago
|
| Assignee | ||
Comment 11•1 month ago
|
||
Found the cause of the backout. It's not a problem with parallelism itself, and not with the test.
pointerlock_wheel_event_outside_target.html sends a synthetic wheel at viewport 250,250. When pointer lock is released, Firefox warps the real OS cursor back to the last known event position, which is that synthetic point, so the cursor ends up inside the content area and stays there. With 3 runners, a later test window opens under it, macOS sends a real mouseenter, and mousemove-across.html sees an extra mouseover/mouseenter on element a before its own input. A cursor trace on try showed the cursor going from 10,10 to 254,360 at unlock and staying there until the failing test.
Reproduced on try with the autoland chunk 8 test list: 5 of 5 failures at 3 processes (push 2052700), 0 of 5 at 1 process (push 2052696). With the fix from bug 2077556 applied on top of this patch, the same selection is 5 of 5 green at 3 processes (push 2055229), with no pointerlock WPT or mochitest regressions.
I'll re-land this once bug 2077556 lands. This patch itself doesn't need to change.
Separately, a correction to comment 3: the slow long-pole chunk isn't a fixed chunk number. It's a block of html/cross-origin-opener-policy/popup-* tests at about 26s each, which wptrunner keeps on one runner, so whichever chunk gets them sets a floor of about 18 minutes for WPT on a push.
Comment 12•1 month ago
|
||
| Assignee | ||
Comment 13•1 month ago
|
||
^^ landed after this https://lando.moz.tools/D330392/
Comment 14•1 month ago
|
||
| Assignee | ||
Comment 15•1 month ago
|
||
Cause of the second backout: with 3 processes the browser windows overlap on one screen, macOS marks the covered ones as occluded and their documents become hidden, so css-view-transitions fails with "Skipped ViewTransition due to document being hidden". It failed on 11 of 15 chunk-7 runs after landing and never in the 11 days before. wptrunner already sets MOZ_WINDOW_OCCLUSION=0 to prevent this, but only Windows reads it.
Fix is in bug 2079664. On try, using the failing chunk's 98 directories at 3 processes: without the fix 3/3 failed, with it 5/5 passed, and the pointer-lock fix from bug 2077556 held (mousemove-across ok in every job).
Running a full opt and debug testharness sweep with the fix, and comparing it per directory against production, before relanding.
Comment 16•1 month ago
|
||
| Assignee | ||
Comment 17•1 month ago
|
||
On the hackbot analysis of opt-web-platform-tests-10 on push 2062903: since the landing, autoland has completed 127 macOS aarch64 testharness jobs, and the overall failure rate is unchanged (opt 8.0 percent vs 8.4 before, debug 2.6 vs 2.8).
What has changed is a thin tail of new rare intermittents: prefetch-uses-cache (2 failures), prefetch-traverse-reload, picture-in-picture user activation, clipboard copy and fullscreen keyboard lock (1 each). Most need focus or user activation, which only one of the three browser windows can have at a time. Chunk 10's history isn't one test's history either, since chunks are rebalanced every push.
I'm out tomorrow. When I'm back I'll file a tracking bug and annotate the ones that repeat. If the tail keeps growing, these jobs will move to 2 processes. Please classify these as intermittent rather than backing out
Comment 18•1 month ago
|
||
| bugherder | ||
Description
•