Summary
The engine keeps no metric for how many earcut workers it has
abandoned. Each abandoned worker is a leaked OS thread (#305) that
burns a core forever; today the only way to notice the engine is
leaking is to watch process CPU / thread count from outside. Surface
the count so the leak is observable in-app.
Proposal
- Engine:
EarcutWorker counts each TimedOut abandonment. The count
accumulates naturally — Canvas (which owns the worker) is a
persistent Renderer field, cleared per frame, not recreated.
Expose leaked_count().
- Reporting path: carry the count from the render thread to the parent
(extend the FrameSink payload or add a dedicated EngineEvent),
then to the App.
- UI: surface it (status readout and/or a notify once it crosses a
small threshold) so the user knows when a manual RestartEngine is
worthwhile.
Acceptance
- Engine increments a counter on each earcut timeout (unit test driving
a timeout triangulation).
- The count reaches the App and is visible to the user.
- Restarting the engine resets the observed count to 0.
Out of scope
Relationship to other issues
Summary
The engine keeps no metric for how many earcut workers it has
abandoned. Each abandoned worker is a leaked OS thread (#305) that
burns a core forever; today the only way to notice the engine is
leaking is to watch process CPU / thread count from outside. Surface
the count so the leak is observable in-app.
Proposal
EarcutWorkercounts eachTimedOutabandonment. The countaccumulates naturally —
Canvas(which owns the worker) is apersistent
Rendererfield, cleared per frame, not recreated.Expose
leaked_count().(extend the
FrameSinkpayload or add a dedicatedEngineEvent),then to the App.
small threshold) so the user knows when a manual
RestartEngineisworthwhile.
Acceptance
a timeout triangulation).
Out of scope
follow-up; this issue is observability only).
triangulator / pre-validation).
precise, portable signal.
Relationship to other issues
RestartEnginecommand (feat(app): restart-engine command — recycle the engine subprocess #383, mitigates earcut worker leak: abandoned triangulators keep burning CPU after timeout #305):this provides the signal for when to invoke it, and is the intended
trigger source for a future runaway auto-restart.