Skip to content

Cypher lowering does not support WITH ... UNWIND after MATCH-introduced graph aliases #1000

Description

@lmeyerov

Summary

Resolved on April 3, 2026 by PR #1039.

Direct Cypher support for the exact official LDBC SNB Interactive interactive-complex-6 / tag-cooccurrence query is now landed on master.

Resolution

Final measured state

As of April 3, 2026:

  • the exact official IC6 query passes in-tree on master
  • the dgx-spark host-CPU conformance rerun reports cypher = ok for interactive-complex-6
  • exact host-CPU benchmark artifacts were recorded at:
    • /home/lmeyerov/Work/pyg-bench/results/runs/dgx-spark-issue-1000-ic6-1037-mergecheck

Observed benchmark notes on April 3, 2026:

  • cypher: ok
  • gfql: suite summary still partial, but that reflects a separate GFQL adapter/workaround lane and was not part of the direct-Cypher #1000 closeout
  • exact cypher direct query latency: 177912.063 ms
  • exact cypher rows returned: 0

Exact benchmark repro that is now fixed

Residual benchmark repro comment:

Exact official query:

MATCH (knownTag:Tag { name: $tagName })
WITH knownTag.id as knownTagId

MATCH (person:Person { id: $personId })-[:KNOWS*1..2]-(friend)
WHERE NOT person=friend
WITH
    knownTagId,
    collect(distinct friend) as friends
UNWIND friends as f
    MATCH (f)<-[:HAS_CREATOR]-(post:Post),
          (post)-[:HAS_TAG]->(t:Tag{id: knownTagId}),
          (post)-[:HAS_TAG]->(tag:Tag)
    WHERE NOT t = tag
    WITH
        tag.name as tagName,
        count(post) as postCount
RETURN
    tagName,
    postCount
ORDER BY
    postCount DESC,
    tagName ASC
LIMIT 10

Exact parameters:

  • personId = 4398046511333
  • tagName = "Carl_Gustaf_Emil_Mannerheim"

Activity

  1. lmeyerov commented on Mar 31, 2026

    @lmeyerov
    ContributorAuthor

    Second measured manifestation from pyg-bench on 2026-03-31:

    • LDBC SNB Interactive interactive-complex-6 (Tag co-occurrence) hits the same family
    • GFQL covers it via a 1..2-hop friend plus local tag co-occurrence aggregation workaround under #880
    • direct Cypher currently fails earlier with:
    [invalid-cypher-syntax] Invalid Cypher query syntax
    

    The common shape is still:

    • MATCH ...
    • WITH collect(distinct friend) AS friends
    • UNWIND friends AS f
    • MATCH ...

    So #1000 now has at least two official SNB manifestations:

    • interactive-complex-9
    • interactive-complex-6
  2. lmeyerov commented on Apr 1, 2026

    @lmeyerov
    ContributorAuthor

    Benchmark rerun against isolated ambient graphistry v0.53.11 from pyg-bench shows the old #1000 lane is now split rather than uniformly blocked.

    Artifact:

    • results/runs/local-snb-interactive-v05311-rerun/

    Observed on March 31, 2026:

    • interactive-complex-9 / recent-network-messages now gets past the old WITH collect(distinct friend) -> UNWIND -> MATCH blocker and fails later at graphistry/pygraphistry#981:
      • [unsupported-cypher-query] Cypher row lowering currently supports one MATCH source alias at a time | field: where | value: 'NOT friend = root'
    • interactive-complex-6 / tag-cooccurrence still reproduces #1000 with the narrower carried-scalar shape:
      • WITH knownTagId, collect(distinct friend) AS friends
      • UNWIND friends AS f
      • MATCH (f)<-[:HAS_CREATOR]-(post:Post), ...
      • current message is still [invalid-cypher-syntax] Invalid Cypher query syntax

    So the fix in v0.53.11 clearly helped, but the remaining benchmark-visible residual seems to be the WITH scalar, collect(alias) AS list -> UNWIND -> MATCH variant rather than the simpler WITH collect(alias) AS list -> UNWIND -> MATCH form.

  3. lmeyerov commented on Apr 2, 2026

    @lmeyerov
    ContributorAuthor

    Benchmark update from pyg-bench on April 2, 2026.

    We reran official SNB Interactive complex 6 (tag-cooccurrence) on latest master commit a916c183b using the benchmark harness on dgx-spark.

    Important benchmark-side correction first: the initial latest-master rerun was dying in our harness during fixture load because tag-cooccurrence did not yet have a narrow core_fast fixture/spec path. We fixed that on the benchmark side and reran.

    Current measured result after the harness fix:

    • backend: direct Cypher
    • status: parser_gap
    • issue ref: #1000
    • error: [invalid-cypher-syntax] Invalid Cypher query syntax
    • probe notes still classify it as the carried-scalar WITH knownTagId, collect(distinct friend) AS friends -> UNWIND -> MATCH boundary

    Matching GFQL workaround lane on the same query is still partial under #880.

    Measured benchmark artifact details:

    • local artifact: results/runs/dgx-spark-snb-interactive-ic6-origin-master-a916c183b-fresh-r3/
    • setup latency: 2084.248 ms
    • GFQL query latency: 431.218 ms
    • fixture timings: csv_load=1089.63 ms, derivation=223.773 ms, graph_bind=770.845 ms

    So the practical benchmark conclusion is: merged #1000 did not yet unblock the official interactive-complex-6 query shape we care about. If useful, I can provide the exact official query text + harness params next.

  4. lmeyerov commented on Apr 2, 2026

    @lmeyerov
    ContributorAuthor

    Adding exact residual repro instructions from pyg-bench so teammates can verify the latest benchmark-visible #1000 shape without reconstructing it from prior comments.

    This is the current measured residual after the #1000 merge:

    • official SNB query: interactive-complex-6 / tag-cooccurrence
    • latest tested PyGraphistry master commit: a916c183b
    • measured artifact: results/runs/dgx-spark-snb-interactive-ic6-origin-master-a916c183b-fresh-r3/
    • direct Cypher status: parser_gap
    • error: [invalid-cypher-syntax] Invalid Cypher query syntax

    Exact local benchmark command:

    cd /home/lmeyerov/Work/pyg-bench
    PYGRAPHISTRY_PATH=/path/to/parent/of/graphistry/package \
      uv run python scripts/run_suite.py \
        --suite snb-interactive \
        --config configs/suites/snb-interactive-ic6-conformance-sf1.yaml \
        --output-dir /tmp/pyg-bench-ic6-1000-repro

    Notes:

    • PYGRAPHISTRY_PATH must be the parent directory containing graphistry/, not the package directory itself.
    • The first latest-master DGX rerun only exposed a benchmark-harness fixture-gap on our side. The result below is from the corrected benchmark harness with tag-cooccurrence on the narrow core_fast fixture path.

    Exact official query text used by the benchmark:

    MATCH (knownTag:Tag { name: $tagName })
    WITH knownTag.id as knownTagId
    
    MATCH (person:Person { id: $personId })-[:KNOWS*1..2]-(friend)
    WHERE NOT person=friend
    WITH
        knownTagId,
        collect(distinct friend) as friends
    UNWIND friends as f
        MATCH (f)<-[:HAS_CREATOR]-(post:Post),
              (post)-[:HAS_TAG]->(t:Tag{id: knownTagId}),
              (post)-[:HAS_TAG]->(tag:Tag)
        WHERE NOT t = tag
        WITH
            tag.name as tagName,
            count(post) as postCount
    RETURN
        tagName,
        postCount
    ORDER BY
        postCount DESC,
        tagName ASC
    LIMIT 10

    Exact official parameters used by the benchmark fixture:

    • personId = 4398046511333
    • tagName = "Carl_Gustaf_Emil_Mannerheim"

    What to inspect after the run:

    • /tmp/pyg-bench-ic6-1000-repro/probe-results.json
    • backend = cypher
    • query_id = tag-cooccurrence
    • status = parser_gap
    • issue_refs = ["graphistry/pygraphistry#1000"]
    • error_type = GFQLSyntaxError
    • error_message = [invalid-cypher-syntax] Invalid Cypher query syntax ...

    The benchmark-side interpretation is still the same residual family we were discussing earlier:

    • WITH knownTagId, collect(distinct friend) AS friends
    • UNWIND friends AS f
    • MATCH ...

    So from the benchmark perspective, #1000 is not actually cleared for the official interactive-complex-6 query shape yet.

  5. added 2 commits that reference this issue on Apr 2, 2026
  6. lmeyerov commented on Apr 2, 2026

    @lmeyerov
    ContributorAuthor

    Benchmark rerun update from pyg-bench on refreshed current master 14dafaf6b951954d8de840f9236f3e874249ebac.

    Official SNB lane:

    • query: interactive-complex-6 / tag-cooccurrence
    • artifact: /home/lmeyerov/Work/pyg-bench/results/runs/dgx-spark-snb-interactive-ic6-origin-master-14dafaf6b9-fresh-r4
    • command:
      uv run python scripts/run_dgx_spark_suite.py --suite snb-interactive --config configs/suites/snb-interactive-ic6-conformance-sf1.yaml --output-dir results/runs/dgx-spark-snb-interactive-ic6-origin-master-14dafaf6b9-fresh-r4 --graphistry-repo-path /tmp/pygraphistry-origin-master-14dafaf6b --host-uv

    Measured outcome on dgx-spark:

    • GFQL: partial under #880
    • direct Cypher: still parser_gap under #1000
    • error:
      [invalid-cypher-syntax] Invalid Cypher query syntax | suggestion: Check Cypher clause structure and punctuation.
    • benchmark-side classification note:
      Official query text hits the current WITH -> UNWIND continuation parser/front-end boundary after graph aliases are introduced.

    Timing from the same run:

    • setup_latency_ms = 1964.749
    • query_latency_ms = 393.61
    • csv_load = 1007.418 ms
    • derivation = 209.915 ms
    • graph_bind = 747.416 ms

    So on refreshed current master, the official carried-scalar WITH knownTagId, collect(distinct friend) AS friends -> UNWIND -> MATCH benchmark shape is still not cleared.

  7. added 11 commits that reference this issue on Apr 2, 2026
  8. lmeyerov commented on Apr 3, 2026

    @lmeyerov
    ContributorAuthor

    Fresh benchmark-side rerun after origin/master moved to cec32d1812678c57eb19f25771db1dde8a7eee83 (Merge pull request #1027 from graphistry/fix/issue-1000-dynamic-pattern-properties).

    Pinned DGX artifact:

    • /home/lmeyerov/Work/pyg-bench/results/runs/dgx-spark-snb-interactive-ic6-origin-master-cec32d181-fresh-r1

    Command:

    • uv run python scripts/run_dgx_spark_suite.py --suite snb-interactive --config configs/suites/snb-interactive-ic6-conformance-sf1.yaml --output-dir results/runs/dgx-spark-snb-interactive-ic6-origin-master-cec32d181-fresh-r1 --graphistry-repo-path /tmp/pygraphistry-origin-master-cec32d181 --host-uv

    Current measured outcome on official interactive-complex-6 / tag-cooccurrence:

    • gfql: still partial
    • direct cypher: still blocked
    • exact direct-Cypher failure remains:
      • [invalid-cypher-syntax] Cypher WITH after post-WITH MATCH WHERE is not yet supported in the current GFQL Cypher compiler

    Timing from this rerun:

    • setup_latency_ms = 1981.264
    • query_latency_ms = 395.825

    Interpretation:

    • #1027 alone is not sufficient to clear the benchmark-visible IC6 residual
    • the next meaningful benchmark rerun for this lane should be after #1039 lands / origin/master moves again
  9. lmeyerov commented on Apr 3, 2026

    @lmeyerov
    ContributorAuthor

    Fresh benchmark-side rerun after origin/master moved to cd7c7bc23ca26a502d2c9f02419f7cc567f8110a (Merge pull request #1039 from graphistry/fix/issue-1000-linear-aggregate-overlap).

    Pinned DGX artifact:

    • /home/lmeyerov/Work/pyg-bench/results/runs/dgx-spark-snb-interactive-ic6-origin-master-cd7c7bc23-fresh-r1

    Command:

    • uv run python scripts/run_dgx_spark_suite.py --suite snb-interactive --config configs/suites/snb-interactive-ic6-conformance-sf1.yaml --output-dir results/runs/dgx-spark-snb-interactive-ic6-origin-master-cd7c7bc23-fresh-r1 --graphistry-repo-path /tmp/pygraphistry-origin-master-cd7c7bc23 --host-uv

    Current measured outcome on official interactive-complex-6 / tag-cooccurrence:

    • gfql: still partial
    • direct cypher: now ok

    Timing from this rerun:

    • setup_latency_ms = 1836.562
    • query_latency_ms = 178593.167
    • direct cypher measured query time = 178176.52 ms
    • untimed direct cypher warmup also took about 180851.923 ms

    Interpretation:

    • #1039 clears the benchmark-visible #1000 correctness blocker for the official IC6 lane
    • the remaining headline problem on this exact benchmark lane is no longer syntax/lowering correctness, it is extremely slow execution on the current CPU host-uv path
  10. added a commit that references this issue on Apr 3, 2026
    cd7c7bc
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions