Internals
Understand the runtime mechanisms behind view evaluation, layout, scene updates, and rendering.
A UI update moves through several representations before it reaches the display, and each representation has its own ownership and scheduling rules. These guides follow those mechanisms for contributors and advanced integrators, explaining where a change belongs and which invariants it needs to preserve.
Client Update Lifecycle
Within Kit, a model write changes runtime attributes and propagates affected derived computations through the attribute graph. The UI loop separately schedules view evaluation, which produces a candidate tree for layout to resolve. Reconciliation can then compare that geometry and content with the accepted tree to determine the necessary scene operations.
If those operations change the wire scene, the host sends them through IPC and waits for the retained outcome. Acceptance publishes the candidate as the client's new baseline, including its callbacks and ownership. The server then handles rendering and presentation through their own lifecycles.
Implementation Guides
-
Attribute graph and reactivity covers values, revisions, dependency edges, propagation, and batching.
-
Mounted identity and lifetime covers state paths, keys, leases, and removal.
-
View evaluation and memoization covers body execution, dependency recording, and cache reuse.
-
Layout engine covers constraints, derived measurements, shared stack/grid computations, and validation.
-
Reconciliation and publication covers accepted and candidate state and rollback boundaries.
-
Threading and queues covers the UI loop, external updates, and the render worker.
-
Text and fonts covers shaping, editing, measurement, and glyph resources.
-
Input dispatch covers lineage, focus, cancellation, and target provenance.
-
Render graph covers server-side passes and GPU resource dependencies.
-
Renderer optimizations catalogs frame preparation, damage, culling, pixel caches, shader specialization, resource reuse, and presentation with file-and-line source references.
-
Renderer audit — October 16, 2026 records Pi 5 measurements at revision
1f358406and follow-up optimization results.
Architectural Boundaries
These representations use different identities because they belong to different owners. Kit's AttrId, layout node ID, and mounted identity describe local runtime structures, whereas protocol node IDs refer to retained server state. The client UiNode tree and server SceneSnapshot likewise serve different stages of the update.
Keep those identities and ownership layers distinct when adding caches, debugging tools, or scheduling shortcuts. A local evaluation result becomes a retained server baseline only through the commit outcome protocol.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/kit/docs/INTERNALS.mdcrates/kit/src/app/mod.rscrates/renderer/src/vulkan/scene/README.md