E29C v3: add a bounded typed incoming-reference lookup in write transactions · Issue #924 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

v3: add a bounded typed incoming-reference lookup in write transactions #924

Done

Description

@adityamukho

Problem

A cascading delete needs to discover every live typed reference to a target entity, including inbound attributes it did not anticipate, in the same write transaction that will apply the delete. On the benchmark's pinned core (29dd5888), the unbound-attribute query falls back to an empty-prefix EAVT scan; an output limit does not bound examined facts. The external fact log rejects access during an active write. This blocks full-payload JNI DEL7 in SNB Interactive v2 tracking. It is distinct from #518, which handles a known attribute and value via AVET, and does not depend on choosing a new pending index implementation in #762.

Suggested implementation

  1. Expose a bounded incoming-reference lookup on the v3 write transaction. Take an exact typed Ref target and return live source-entity/attribute pairs across attributes in that transaction's current view. Do not match an identically named Keyword. An unknown target should return no matches without mutating the dictionary.
  2. Reuse the existing target-first VAET prefix on durable and large-write working trees. No durable key-format change appears necessary. For small writes, add or reuse target-keyed pending/staged lookups and merge them with the committed range using the existing visibility rules; staged retractions must shadow older assertions. Include WAL-recovered pending data. See snapshot selection.
  3. Bound both returned live links and records examined (or demonstrate an equivalent bounded seek over old versions). The current live-key cap limits emitted links, not target-local retracted or superseded history. Return a distinct budget-exhausted outcome rather than a silently partial set, so the caller can refuse the delete before any mutation. Do not fall back to a whole-index scan.

Acceptance tests

  • Exact results with multiple inbound attributes, an unexpected relation, a same-spelling Keyword, and an unknown target; cover staged assertions/retractions, rollback, checkpoint/reopen, and WAL recovery in the applicable write paths.
  • Instrument examined records: at fixed live degree, adding e.g. 100,000 unrelated facts does not introduce a linear scan. In a separate target-local history fixture, a low visit budget reports exhaustion even with few or no live links.
  • Cover exact result-cap boundary and overflow. On either budget failure the caller can leave the graph unchanged; no partial graph update or durable-format change is required.

This issue is for the core lookup only. Retain the benchmark pin and track JNI DEL7 integration, its independent reference comparison, and qualification in the benchmark repo.

Activity

  1. added this to the v3.0.0 milestone on Nov 28, 2026
  2. adityamukho commented on Nov 29, 2026

    @adityamukho
    CollaboratorAuthor

    Done on v3: the core lookup (#926), the JVM binding (project-minigraf/minigraf-java#29) and the docs (project-minigraf/minigraf-docs#104) are merged. Ships in v3.0.0. Parity for the other bindings is tracked in #925.

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

      0