Skip to content

Reuse exact text and metric decisions from compiled policies across frames - #738

Merged
ctate merged 1 commit into
mainfrom
ctate/reuse-exact-text-8dff56
Oct 18, 2026
Merged

ctate merged 1 commit into
mainfrom
ctate/reuse-exact-text-8dff56

Conversation

@ctate

@ctate ctate commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator
  • Layout asks a compiled TypeScript core's window policy the same questions on every frame, and each answer crosses into the core. With the compiled view this was millions of calls per session, almost all of them repeats.
  • For policies a host registers as answering from their request bytes alone (the TS app host registers the compiled core's policy), scalar text estimates, text-query step chains, and widget metric and intrinsic measurement steps now reuse an earlier answer only when every input byte matches. Native measurement capabilities still run on every query, and any other policy callback is called exactly as before. Sealed replay through the compiled view is 19–32% faster in the ui-inbox, code-workbench and accordion-policy examples, so their extended test timeouts are removed.
  • Adds unit tests for registration, exact reuse and byte equality.

…rames

- Layout asks a compiled TypeScript core's window policy the same questions every frame, and each answer crosses into the core. For policies a host registers as answering from their request bytes alone, scalar text estimates, text-query step chains, and widget metric and intrinsic measurement steps now reuse an earlier answer only when every input byte matches; native measurement capabilities still run on every query, and any other policy callback is called exactly as before.
- Sealed replay through the compiled view is 19–32% faster in the ui-inbox, code-workbench and accordion-policy examples, so their extended test timeouts are no longer needed.
- Adds unit tests for registration, exact reuse and byte equality.
@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
native-sdk Ready Ready Preview, v0 Oct 18, 2026 3:38pm UTC
native-sdk-schema Ready Ready Preview, v0 Oct 18, 2026 3:38pm UTC

@ctate
ctate merged commit c09968f into main Oct 18, 2026
36 checks passed

This branch was successfully deployed

2 active deployments
Preview – native-sdk — a85f1a47 Deployed Oct 18, 2026 by vercel[bot]
Preview – native-sdk-schema — a85f1a47 Deployed Oct 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant