Skip to content

PR-19 feat(worker): move authoritative simulation to worker runtime #38

Description

@HsienW

Objective

Move authoritative simulation off the main thread while keeping rendering on the main thread. Do not start by moving rendering — that's Phase 6.

Work

  • Batch input per logical tick/frame instead of posting one message per tiny operation; snapshot rate can differ from simulation tick rate if necessary.
  • Add a runtime-mode selector: Main Thread / Worker Simulation.
  • If Worker fails to initialize, fall back to main-thread runtime and show a non-blocking diagnostic.
  • Define behavior for: initialization timeout, worker runtime error, invalid message, worker termination, reset. The game should fail visibly, not silently freeze.

Exit criteria

  • Worker can restart cleanly
  • Main-thread fallback exists

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

improvementImprove existing functionality or performance.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions