Skip to content

GFQL Cypher: var-length path trail semantics + lane-dependent cardinality (round-005 umbrella) #1903

Description

@lmeyerov

Round-005 path probe (76 queries × both engines @ d8668fd, hand-computed trail-semantics oracles, twice-verified; scripts in session scratchpad probe-paths/). Fixtures: diamond, directed 3-cycle, self-loop, parallel edges, typed, disconnected.

SILENT-WRONG:

  1. Lane-dependent cardinality — three answers for one MATCH (diamond [*2]): RETURN y.id→1 row, count(*)→2, RETURN x.id, y.id→2. Single-alias endpoint projections compile to a reachability lane that collapses path multiplicity.
  2. Single-alias lane BFS visited-pruning drops valid k-trails to nearer nodes (3-cycle undirected [*2] → [] vs oracle [b,c]); the two-alias row lane gets it right — pandas disagrees with itself.
  3. Row/agg lane uses WALK semantics on self-loops (edge reused within a path: [*2] on self-loop returns (s,s), count 2 vs oracle 1; yet [*3] → 0 — neither walk nor trail).
  4. Relationship uniqueness not enforced across pattern elements: (x)-[]->(m)-[]-(y) on a single-edge graph reuses the edge → 1 row vs oracle 0; parallel-edge 2-hop 6 vs 4.
  5. Undirected self-loop: projection lane drops it, agg lane double-counts orientations.
  6. shortestPath unreachable in PLAIN MATCH → null row instead of no row (pandas; indistinguishable from OPTIONAL).
  7. polars [*0..1] silently drops the zero-hop seed (pandas correct; polars' own NIE text lists include_zero_hop_seed as must-error, but these forms don't raise).

TYPED-GAP: 8. [*..3] (valid openCypher omitted-lower-bound) → GFQLSyntaxError; parser grammar (~904-953) lacks the *..M production; also blocks bounded shortestPath.

Honest NIEs and a solid correct inventory (cycle termination exact, typed alternation, shortestPath ties/typed/min-bound) in the probe report. Net: path counting is only trustworthy via multi-alias row projections or grouped aggregates on acyclic neighborhoods. Successor context: #1748 (polars var-length), #1658 (CSR engagement).

Activity

  1. lmeyerov commented on Aug 18, 2026

    @lmeyerov
    ContributorAuthor

    Umbrella verified served on master e6625ed28 — recommending close after review, with one bookkeeping dependency noted below.

    pandas: 13/13 hand-oracled checks pass — the silent-wrong lanes are gone:

    • one-MATCH three-lanes now agree (y-only=[d,d], count=2, two-alias=2)
    • 3-cycle undirected [*2] → [b,c]; self-loop [*2] → 0 rows
    • cross-element relationship-uniqueness → 0; parallel-edge 2-hop → 2
    • undirected self-loop rows=count=1; shortest-path unreachable → 0 rows
    • [*0..1] keeps the zero-hop row; [*..2] parses

    polars: every lane that used to return wrong values now raises a typed NotImplementedError instead — fwd/rev min_hops>1 lanes cite #1748 by number; undirected min_hops>1 cites the deferred-features NIE (tracked in #1906). Where polars answers, values match the pandas oracle. So: no silent-wrong remains; all residual work is split into open issues.

    Bookkeeping: #1748's own filed defect is now resolved-by-decline (verified separately), but the polars NIE messages cite #1748 as the tracker for native hop-gating — if #1748 is closed, that native-polars feature needs a successor tracker (or fold it into #1906) so the citation doesn't dangle.

  2. lmeyerov commented on Aug 18, 2026

    @lmeyerov
    ContributorAuthor

    Closing: verified fixed on master e6625ed28 by the 2026-08 stack — empirical repro + hand-computed oracle in the verification comment above. Residual sub-items, where any, are tracked in the successor issues named there (#1916, #1908, #1906, #1934-#1938).

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions