Skip to content

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

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

[DO NOT MERGE] POC: Tessar query materialization#6085
christse wants to merge 8 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

DO NOT MERGE — active Tessar POC. Shared dashboard readers currently reconstruct query inputs and repeat computed work. Tessar investigates consuming indexed outputs and using reverse query watches to refresh only affected saved views.

The first implementation increments add an explicit internal snapshot reader, a reverse matcher using the existing Boxel SQL query compiler, and a durable Postgres watch registry with conservative candidate routing and publication guards. A deterministic synthetic generator supports smoke, 1,255-instance and 12,550-instance datasets. No production records are copied.

Where to start

  • docs/tessar-query-materialization-plan.md describes the contract, implementation stages and required benchmark report.
  • packages/base/field-support.ts and card-api.gts hold snapshot values independently of authored data and keep query membership without eager graph hydration.
  • packages/runtime-common/tessar-query-registry.ts stores watches and dirty revision requirements. The exact predicate verifier reuses index-query-engine.ts.
  • scripts/tessar/ provides fabricated datasets and an independent correctness oracle.

Key decisions and non-obvious mechanics

  • Correctness and freshness are validity gates. The initial ordinary-query GET case returned membership alongside stale statistics; those reads are recorded as failures, never speedups.
  • Routing is conservative; exact verification evaluates both old and new documents. Empty queries remain registered. Page limits do not restrict invalidation.
  • Registry mutations take a pinned transaction. Dirty state survives a new connection; stale results cannot clear a newer required revision. Retired owners retain a revision tombstone.
  • Four focused browser tests pass 49 assertions, two Postgres tests exercise SQL and durable guards, and the existing computed regression suite passes 15 tests / 41 assertions.
  • Not complete: the registry and snapshot primitive are not enabled in normal server/client reads. Index publication, consistent indexed inputs, automatic owner refresh, dashboard/feeder adaptation and the full 10x browser/concurrency/freshness report remain required. No performance improvement is claimed yet.

Use an isolated local worktree runtime for this experiment. The private definition fork does not make a shared staging backend run this branch. Do not merge, enable auto-merge, or deploy these runtime changes to production.

@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