Skip to content

subscriptions: a stale round can clear parameterized sharing under newer rules #276

Closed as not planned

Description

@jsam

Follow-up from #254 (review finding stale-recursion-stop-ungated, accepted as-is).

In src/protocol/subscription/parameterized.rs, Family::evaluate runs self.sharing.store(false) unconditionally whenever binds_recursion(&snapshot) is true. For a snapshot older than the judged rule revision, binds_recursion returns the verdict under that older snapshot's rules. So a stale round can clear sharing under the current rules.

Sequence:

  1. Rules R1 make a parameter bind a recursive relation.
  2. A rule change to R2 removes the recursion. The family is judged and starts sharing under R2.
  3. A view that last validated under R1 reads with an R1 snapshot before any newer round exists.
  4. round_for creates an R1 round, and evaluate sees binds_recursion=true under R1.
  5. Sharing is cleared under R2 without resetting costs or counting a stop.

Effect: wasted probe CPU and per-view evaluations until the family re-probes. Results stay correct, and latency does not regress because views fall back to their own evaluation. It does break the invariant that snapshots older than the judged revision never update family state.

Fix: only store false when self.judges(snapshot.persistent_rules()), or return the Err without writing when the snapshot's rules are not the judged ones. Add a test for the sequence above.

Activity

  1. jsam commented on Oct 5, 2026

    @jsam
    ContributorAuthor

    Superseded by #318 (V11) in the incremental-views plan, epic #305.

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