Skip to content

Queries read deployed views from arrangements; revision on query replies (V9) #315

Closed

Description

@jsam

Part of epic #305.

Problem. combine prepends the dependency closure's rules to every query and the engine re-derives them (src/storage_engine/snapshot.rs:302-405); a one-row bound read costs 62 ms / 2.9 s at 1M edges and depends on the rule's recursion form (report 4.1, A.4); base point reads stream the whole relation (?edge(K,Y) 5.4 ms at 1M; src/code_generator/mod.rs:1514-1523).

Target. With engine.views = maintained: query workers import the maintainer's base and view arrangements at the frontier (import_frontier) into the query's short-lived dataflow; deployed heads are bound to imported arrangements instead of rules; a query whose body is one deployed atom with leading key columns bound is served by a cursor seek without a dataflow; ?base(K,..) uses the keyed base arrangement; session rules compile on top; sort/limit/offset unchanged; query replies carry revision. Guard queries of guarded writes use the same path at the staging revision.

Acceptance. rule_evaluations = 0 and view_reads > 0 for every read of a deployed view (fixture corpus + snapshot specs); results equal recompute at the same revision (oracle); B1-B4 pass (bound view read <= 1 ms, base point read <= 1 ms at 1M edges); recursion form no longer changes bound-read cost; queries never run on the maintainer thread (thread assertion).

Size L. Dependencies V5, #296 merged. Order slot 4. Supersedes #187 (serving half).

Scenarios. flips scenario S2 to required (counter part, reads::s2_one_row_view_read_is_a_lookup); flips scenario S3 to required (counter part, reads::s3_ad_hoc_query_joins_facts_and_views); flips scenario S4 to required for the query revision (consistency::s4_subscription_and_query_agree_at_a_revision). Their expected failures name #315 (#337).

Activity

  1. jsam commented on Oct 5, 2026

    @jsam
    ContributorAuthor

    Captain priority (2026-10-05): a query over a deployed rule must take the rule's result from its live view, never recompute it. This issue is where that lands; keep the acceptance criteria (zero rule evaluations for reads of deployed views, keyed read under 1 ms at 1M edges, recursive or not) non-negotiable.

  2. jsam commented on Oct 7, 2026

    @jsam
    ContributorAuthor

    Part one landed in https://github.com/inputlayer/inputlayer-symbolic/pull/36: a lock-free read primitive for maintained views (rows of a base relation or view, whole or by key, with their revision), independently verified under concurrent writers. Still open: the query path reading deployed views through it, revision on query replies, guards in write programs, and the measured bars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions