Repository navigation
perf(engine): Macs with a hardware GPU render with more capture workers - #6636
Conversation
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 1 important · 0 nits · head 6e234229
The sizing change is sound for the screenshot→disk route, and the fails without the fix: line names a real test. The blocker is the red Comments run.
Scope
Read all 5 files. Traced the flag through resolveRenderWorkerCount (spread reaches both computeWorkerSizing and the baseline calculateOptimalWorkers), the DE router (pins 3 workers, unaffected) and the capture-plan routes. CI, Windows render verification, regression and CodeQL were still running at review time. No prior reviews.
— Genesis reviewer
Edit accuracy: accurate 271 (base branch 271), smooth 105 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (2)
|
193d321 to
fe217df
Compare
There was a problem hiding this comment.
Verdict: APPROVE — 0 open, 0 new · 193d321c → fe217dfa (rebase only). The PR patch matches 193d321 line for line apart from hunk offsets. The one main change in renderOrchestrator.ts it now sits on (calibration measures screenshot mode) does not touch the sizing flag. CI, Windows render verification, regression and Comments are green.
— Genesis reviewer
What
On a Mac with a hardware GPU, auto worker sizing for screenshot capture to disk uses budgets measured for that path. A 14-core, 24 GB Mac now captures with 8 workers instead of 4: a 5 minute film renders 43% faster.
Why
Auto sizing on these Macs was capped by budgets set for other capture paths:
--debugperf summary): 270 MB at 4 workers and 329 MB at 8 on a 42 s 1080x1920 film; 61 MB and 163 MB on a 5 minute 1080p film. That is about 15-25 MB per extra worker, against Node's ~4.1 GB default heap. The cap held a 14-core Mac at 4 workers.The memory rule (half of RAM at 1.5 GB per worker) is unchanged and is what now binds: 8 workers on 24 GB, 5 on 16 GB. The low-memory profile still pins 8 GB machines to one worker.
Why under 100 lines
One lever: Mac hardware-GPU disk capture gets its own heap and core budget inside the existing sizing function. The memory rule, every other platform and every other capture path are untouched.
Related work
Refs #5945.
How
computeWorkerSizing(engine) takesappleGpuDiskCapture. When set, it uses 128 MB of heap per worker (about 5x the measured peak), 1.75 cores per worker, and an auto ceiling of 8. An explicitPRODUCER_CORES_PER_WORKERstill wins over the 1.75 default.isAppleGpuDiskCapture): macOS; the resolved browser GPU mode ishardware; the render does not take the layered composite route (HDR, or shader transitions on a format page-side compositing does not cover), whose workers feed frames through this process; and the parallel-stream router is off. Together these mean frames go to disk. It uses the existingshouldUseLayeredComposite,resolveParallelCaptureModeandisCaptureParallelStreamRouterEnabledowners.Test plan
coresPerWorkerstill applies.parallelCoordinator.test.ts > computeWorkerSizing > sizes Apple-GPU disk capture by its own heap and core budget(expected 4 to be 8with only the test applied).isAppleGpuDiskCaptureholds only for hardware-GPU Mac renders that write to disk; layered, streamed, software-GL and non-Mac renders keep the old sizing. Dropping the layered condition fails it (expected true to be false).tsc --noEmit(engine, producer) exit 0; engineparallelCoordinator.test.ts55 passed; producerrenderOrchestrator.test.ts290 passed; comment ratchet passes; oxfmt and oxlint clean.Before / after
Published
[email protected]vs the same bundle with only this change, both at auto worker count. Apple M4 Pro (14 cores, 24 GB, hardware GL),hyperframes renderon repo/synthetic fixtures that take the screenshot + disk path, interleaved, medians.wall - compiledrops compile, which is network-bound for the first two fixtures. Peak RSS is the whole process tree (CLI + Chrome + ffmpeg), sampled every 250 ms.style-11-prod, 1080x1920, 14 s (3 runs)overlay-montage-prod+ mix-blend layer, 42 s (3 runs)Explicit worker sweep on the same Mac (5 minute film): 4 workers 121.6 s, 6 workers 82.9 s, 8 workers 64.1 s, all byte-identical.