Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Errors, Change Detection, and Lifecycle

ReliabilityCoherent framesRevision 78002f6

System and command errors flow through configurable handlers. The fallback can panic, but applications can install policy appropriate to a game, editor, or server. Executor panics are captured from worker tasks and resumed on the coordinating thread after scoped work is reconciled.

Change detection uses ticks attached to component mutations and system runs. Changed<T> means “changed relative to this system’s last observation,” not a global event queue. Tick aging and wraparound handling are therefore part of correctness.

Entity identifiers include generations so stale handles do not silently refer to newly allocated entities. Typed asset handles similarly separate stable identity from asynchronous availability; failed loads become observable load state and events.

Deferred commands create an explicit failure boundary: the producing system may finish successfully while applying a queued command can fail later. Error context must preserve which system and command created the obligation.

Application exit is data-driven through AppExit, but cleanup still belongs to the runner, sub-apps, task pools, windows, render resources, and platform event loop. A coherent final frame requires stopping new work, applying or discarding known deferred work according to policy, and releasing GPU/OS ownership.