Skip to content

feat(engine): surface abandoned-earcut-worker count for leak observability #384

Description

@Kohei-Wada

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions