Skip to content

Catalog work off the commit path; dense revisions; registration cost independent of catalog size (V6) #313

Closed

Description

@jsam

Part of epic #305.

Problem. Every publish rebuilds and topologically sorts all rules, re-formats the rule prefix and compares it to reuse the plan cache, and clones the relation map (src/storage_engine/mod.rs:2380-2381; src/rule_catalog.rs:868-921; src/storage_engine/snapshot.rs:231-240). Registering 200 rules took 9.6 s (48 ms per rule at a 200-rule catalog vs 21 ms at 50); 200 unrelated rules add 2 ms to every write->delta at 10k edges (report 4.2). Transient staging snapshots consume global revisions, so published revisions have gaps (src/storage_engine/write_program.rs:264-270; snapshot.rs:226).

Target. Compute the ordered rule list and prefix once per catalog change (cached in PersistentRules), not per publish; registration validates incrementally (stratification over the affected SCC only); staging snapshots use a separate counter so published revisions are dense and Unissued is exact.

Acceptance. Perf gate: write->delta and ack independent of unrelated rule count (B12); registering 200 rules <= 2 s and linear (B13); a revision sequence test shows no gaps across writes, guarded writes and proofs.

Size S. Dependencies V0. Order slot 3.

Activity

  1. jsam commented on Oct 6, 2026

    @jsam
    ContributorAuthor

    Landed in https://github.com/inputlayer/inputlayer-symbolic/pull/26: rule order cached per catalog change, stratification over a clause's dependencies, one-file catalog saves with crash-safety tests, dense revisions, wait-free rule parse on the query path. Registering 200 rules: about 2.4 s against 11 to 13 s before. Still open: the 2 s bar on slower disks (a durability-design change, estimated one to two days) and the write-to-delta bar against unrelated rule count (not measured yet).

  2. jsam commented on Oct 10, 2026

    @jsam
    ContributorAuthor

    Done in https://github.com/inputlayer/inputlayer-symbolic/pull/61 (with https://github.com/inputlayer/inputlayer-symbolic/pull/26). One caveat: B12 was measured with bench-views and criterion rather than as a judged make perf-gate fixture, so a literal reading of "passes in the perf gate" still owes one gate run.

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