Skip to content

[DO NOT MERGE] POC: Tessar query materialization - #6085

Draft
christse wants to merge 12 commits into
mainfrom
codex/do-not-merge-query-materialization-poc
Draft

[DO NOT MERGE] POC: Tessar query materialization#6085
christse wants to merge 12 commits into
mainfrom
codex/do-not-merge-query-materialization-poc

Conversation

@christse

@christse christse commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Background and Goal

Tessar is a DO NOT MERGE experiment for shared dashboard lists and statistics. Opted-in card definitions use existing Boxel queries and computeVia; the indexer persists query watches and computed outputs, while readers consume complete snapshots without reconstructing the input graph. Pending or failed work cannot appear as a current successful result.

The final guarded build passes 20 connected Chromium reads and nine mutations on 12,550 fabricated records: 800 ms median / 831 ms p95 interactive readiness, zero input-card/search requests, and at most 5,222 ms acknowledgement-to-display delay across those mutations. Worker interruptions before and after source publication recover within the fixed 10-second deadline; a new authenticated browser opened during pending publication also passes, without stale initial HTML. Seven focused browser tests / 80 assertions, six Postgres cases, four generator/browser-oracle tests, the sliding-sync regression, and modified-package lint/type checks pass.

This is an implementation checkpoint, not a completed POC. A preceding matched stable-data series observed 674 ms median for Tessar versus 13,576 ms for the corrected getCards reference, but the reference fails write freshness, so this is not a qualified overall speedup. The complete 10× HTML rebuild still has one Chrome render timeout after bounded prewarming fixed an earlier worker heap failure. JSON-path measurements are explicitly labeled; controlled 1× and larger matching-set runs, broader lifecycle coverage, and full application workflows remain. No additional AI-generation capacity is claimed.

Where to start

  • docs/tessar-query-materialization-plan.md records scope and unfinished gates. docs/tessar-performance-report.md, its exportable chart, and sanitized results preserve the evidence and failed runs.
  • packages/runtime-common/tessar-index-publication.ts connects reverse matching, concrete dependencies, durable dirty state and guarded publication to the existing index transaction. The first-watch registration race has a failing-before/passing-after regression.
  • packages/runtime-common/tessar-materialization.ts, base snapshot support and the host store implement the versioned read contract. Initial HTML shares the readiness/revision checks; HTML-only rendering consumes published values, while indexing still computes.
  • scripts/tessar/ contains deterministic generation, independent full-output oracles, real Chromium checks, concurrent reads, worker interruptions and benchmark tools. Presets are smoke, 1× (1,255 records) and 10× (12,550); no production records are inputs.

Key decisions and non-obvious mechanics

  • The resolved Boxel query AST remains authoritative. Indexed routing terms select conservative candidates; the existing SQL compiler verifies old/new matches. Empty queries, membership exits, content edits and transitive dependencies participate in invalidation.
  • Watch replacement, output publication and dirty markers share a pinned transaction; rendering stays outside it. Generation guards reject work racing the first watch or newer source publication. The existing queue handles worker recovery.
  • The browser gate requires a live realm subscription and removal of server markup. First-sync and reconnect revalidation close the tested notification gaps. Historical DOM-only timings remain provisional. Anonymous published pages need a separate freshness contract.
  • Initial HTML rejects queued/failed or older materializations, and realms with active materializations use no-store instead of deployment-ETag validation. Explicit drill-down can hydrate a selected source; ordinary snapshot display does not.
  • Three private-fork application projections pass a fresh full JSON/HTML build and feeder-to-dashboard browser checks with fabricated data. Full capture/generation flows and personal overlays remain. No deployment realm or shared staging runtime was modified; this draft remains DO NOT MERGE with auto-merge disabled.

@christse christse changed the title [DO NOT MERGE] POC: Classroom Central query materialization [DO NOT MERGE] POC: Tessar query materialization Sep 11, 2026
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   2h 12m 22s ⏱️
4 743 tests 4 729 ✅ 14 💤 0 ❌
4 758 runs  4 744 ✅ 14 💤 0 ❌

Results for commit fead7a1.

Realm Server Test Results

    1 files    210 suites   1h 14m 13s ⏱️
2 764 tests 2 762 ✅ 0 💤 2 ❌
2 803 runs  2 801 ✅ 0 💤 2 ❌

Results for commit fead7a1.

For more details on these errors, see this check.

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