Skip to content

Cypher multihop: expand direct variable-length support beyond endpoint-only patterns #973

Description

@lmeyerov

Current state

Direct Cypher now supports the narrow endpoint-only single variable-length relationship subset, for example MATCH (a)-[*2]->(b) RETURN b and typed/reverse/undirected variants.

Latest tests also make the remaining boundaries explicit:

  • bounded/exact variable-length WHERE pattern predicates still fail fast
  • mixed connected patterns where the variable-length relationship is not the only relationship in the connected pattern still fail fast
  • named-path / path-value semantics remain separate work

Relevant coverage today:

  • graphistry/tests/compute/gfql/cypher/test_lowering.py::test_string_cypher_failfast_rejects_bounded_variable_length_where_pattern_predicates
  • graphistry/tests/compute/gfql/cypher/test_lowering.py::test_string_cypher_failfast_rejects_nonterminal_variable_length_relationship_patterns

Why track this separately

This is narrower than the broader GFQL path-semantics issue and is the next direct-Cypher parity step after the landed endpoint-only multihop subset.

Related but intentionally separate:

  • #722 covers broader path naming / path tracking / path-sensitive predicate semantics
  • #950 covers non-string params= research and is unrelated here

Desired scope

Expand direct Cypher variable-length support for the next user-visible families:

  1. Positive bounded/exact variable-length WHERE pattern predicates, for example:
  • MATCH (n) WHERE (n)-[:R*2]-() RETURN n
  • MATCH (n) WHERE (n)<-[:R*1..2]-() RETURN n
  1. Connected patterns where the variable-length relationship is not the only relationship in the connected pattern, for example:
  • MATCH (a)-[:LIKES*2]->()-[:LIKES]->(c) RETURN c.name
  • MATCH (a)-[:LIKES]->()-[:LIKES*3]->(c) RETURN c.name

Non-goals for this issue

Keep these out of scope unless they fall out cleanly:

  • named path alias materialization like RETURN p
  • path-value operators like length(p) / relationships(p)
  • relationship alias list-carrier semantics like RETURN r or count(r)
  • zero-hop *0 / *0..n forms unless explicitly designed

Success criteria

  • parser/lowering/runtime accept the targeted direct-Cypher shapes above
  • focused tests cover exact/ranged WHERE predicates and mixed connected patterns
  • unsupported named-path / path-value cases continue to fail fast with explicit validation errors unless intentionally implemented
  • user-facing docs are updated to widen the supported direct-Cypher multihop boundary accurately

Activity

  1. lmeyerov commented on Mar 30, 2026

    @lmeyerov
    ContributorAuthor

    While testing official SNB Interactive query shapes from pyg-bench, I hit the zero-hop open-range case *0.. used by IS2. Since this issue explicitly leaves zero-hop forms out of scope, I opened #983 to track that gap separately.

  2. lmeyerov commented on Apr 2, 2026

    @lmeyerov
    ContributorAuthor

    Benchmark clarification from current-master dgx-spark rerun on 14dafaf6b951954d8de840f9236f3e874249ebac:\n\n- interactive-short-6 / message-forum no longer reproduces as a direct-Cypher blocker on current master\n - artifact: results/runs/dgx-spark-snb-interactive-is6-origin-master-14dafaf6b9-fresh-r1/\n - direct Cypher status: ok\n - direct_query_latency_ms = 28984.047\n- GFQL in the same run remains partial under #880, but the old benchmark-side claim that message-forum direct Cypher was still blocked by #973 is now stale.\n\nSo #973 may still matter for other shapes, but interactive-short-6 should be removed from the active benchmark blocker examples on current master.

  3. lmeyerov commented on Apr 4, 2026

    @lmeyerov
    ContributorAuthor

    Benchmark update from pyg-bench (2026-04-04, origin/master 14dafaf6b9):

    message-forum / interactive-short-6 direct Cypher is no longer an active benchmark blocker on current master.

    Measured artifact: results/runs/dgx-spark-snb-interactive-is6-origin-master-14dafaf6b9-fresh-r1/

    This lane is no longer in the active direct-Cypher benchmark blocker queue. The remaining open item on IS6 is the GFQL joined-row materialization workaround under #880.

  4. lmeyerov commented on May 7, 2026

    @lmeyerov
    ContributorAuthor

    Meta update: child issue #1001 is now closed via merged PR #1329.

    Update details:

    • Added exact-result + split-vs-connected parity regressions for the two-MATCH reentry varlen shapes (match5-25/26 family)
    • This hardens the already-supported behavior and prevents wrong-row regressions

    Remaining #973 scope is still the broader expansion items (notably bounded/exact variable-length WHERE pattern predicates and other boundary work listed in this meta issue).

  5. added a commit that references this issue on May 7, 2026
  6. added a commit that references this issue on May 7, 2026
  7. lmeyerov commented on May 7, 2026

    @lmeyerov
    ContributorAuthor

    Land receipt: merged via #1328 on 2026-05-07.\n\nFollow-through completed before merge:\n- review-skill convergence artifacts under plans/issue-973/\n- targeted blackbox + whitebox amplification around bounded/exact varlen WHERE predicates\n- CI green, including tck-gfql on the merge head.

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