Repository navigation
Cypher/GFQL cannot lower MATCH + OPTIONAL MATCH reply-author flag queries after a connected MATCH #996
Description
Activity
Benchmark update from
pyg-benchon 2026-04-01 after rerunninginteractive-short-7/message-repliesagainst isolatedorigin/mastere0396cbd3(v0.53.16).Artifact:
results/runs/dgx-spark-snb-interactive-is7-origin-master-e0396cbd3-reuse-r5/
Current measured result:
GFQL:partialvia workaround under#880- direct
Cypher:primitive_gapunder#996
Direct Cypher note from the probe:
Direct Cypher lowering does not yet support the measured MATCH + OPTIONAL MATCH row-seeded shape used by the reply-author flag query.
So
#996remains the correct active issue for the currentIS7lane on latest measured master.Addressed in #1021 (squash-merged).
What landed:
- Connected
MATCH ... OPTIONAL MATCH ... RETURNqueries now compile and execute. The compiler lowers each clause independently, left-outer-joins binding-row tables on shared node aliases, and delegates RETURN / ORDER BY / SKIP / LIMIT to the standard row pipeline. - 19 regression tests covering expression breadth, join edge cases, and post-projection ops.
- GPU-validated on DGX with RAPIDS 26.02 (886 passed across full GFQL surface).
Remaining scope (out of this PR):
- WHERE clauses on OPTIONAL MATCH results (e.g.,
WHERE c:C) — still rejected - Multiple OPTIONAL MATCH clauses
- 3+ MATCH clauses with mixed OPTIONAL
- OPTIONAL MATCH with UNWIND/WITH/SKIP/LIMIT between clauses
The IS7 query shape (
MATCH connected OPTIONAL MATCH ... RETURN ... CASE ... ORDER BY) is now supported. The full IS7 query with property predicates and labels needs the graph to have the right label/property columns but the compiler no longer rejects the shape.- Connected
#996 is now the umbrella issue for OPTIONAL MATCH support.
Landed:
- feat(cypher): support connected MATCH + OPTIONAL MATCH (#996) #1021 — Connected
MATCH ... OPTIONAL MATCH ... RETURN(the IS7 shape)
Remaining sub-issues:
- Cypher/GFQL: support WHERE clauses on OPTIONAL MATCH results #1024 — WHERE clauses on OPTIONAL MATCH results
- Cypher/GFQL: support multiple OPTIONAL MATCH clauses #1025 — Multiple OPTIONAL MATCH clauses
- Cypher/GFQL: support OPTIONAL MATCH with WITH/UNWIND/SKIP/LIMIT between clauses #1026 — OPTIONAL MATCH with WITH/UNWIND/SKIP/LIMIT between clauses
- feat(cypher): support connected MATCH + OPTIONAL MATCH (#996) #1021 — Connected
Benchmark follow-up from
pyg-benchon currentorigin/mastercd7c7bc23ca26a502d2c9f02419f7cc567f8110aafter#1021/ the current#996landing:Pinned launcher artifact:
results/runs/dgx-spark-snb-interactive-is7-cypher-origin-master-cd7c7bc23-no-warmup-r1/
Command:
uv run python scripts/run_dgx_spark_suite.py --suite snb-interactive --config configs/suites/snb-interactive-is7-cypher-conformance-sf1-no-warmup.yaml --output-dir results/runs/dgx-spark-snb-interactive-is7-cypher-origin-master-cd7c7bc23-no-warmup-r1 --graphistry-repo-path /tmp/pygraphistry-origin-master-cd7c7bc23 --host-uv
What changed:
- this no longer fails in the old direct-Cypher lowering/compiler bucket
- fixture load completes on the narrow
core_fastpath - direct Cypher probe actually starts on the official
interactive-short-7/message-replieslane
What still happens on
sf1:- remote launcher returns
137 dgx.execute_remote_command duration_ms = 187901.489snb.load_dataset_fixture duration_ms = 13030.692
I then reran the same staged remote directory directly under
/usr/bin/time -vusing the existing.venv/bin/pythonto separate “launcher problem” from runtime behavior. That follow-up was also killed:- terminated by signal
9 - elapsed wall time
3:28.95 - max RSS
7811192 kbytes - shell-reported
EXIT_CODE=137
So the benchmark read is now:
#996did moveIS7past the old lowering rejection- but official
IS7on currentsf1is not benchmark-closed yet; the direct-Cypher lane still dies during execution with a runtime/perf/memory kill rather than a compiler error
I am not filing a separate issue yet because
#1030is the next obvious OPTIONAL MATCH follow-on and may materially change this lane again. If it lands and the same runtime kill remains, that would justify splitting a dedicated execution/perf issue from the old compiler umbrella.Update: #1030 merged (closes #1024 + #1025).
Now landed:
- feat(cypher): support connected MATCH + OPTIONAL MATCH (#996) #1021 — Connected MATCH + OPTIONAL MATCH
- feat(cypher): WHERE on OPTIONAL MATCH + multiple OPTIONAL MATCH (#1024, #1025) #1030 — WHERE on OPTIONAL MATCH + multiple OPTIONAL MATCH
Remaining:
- Cypher/GFQL: support OPTIONAL MATCH with WITH/UNWIND/SKIP/LIMIT between clauses #1026 — OPTIONAL MATCH with WITH/UNWIND/SKIP/LIMIT between clauses (p3)
#1026 investigation started — WIP PR #1044.
Two sub-issues identified:
- Simple
WITH + OPTIONAL MATCHgives wrong results (inner join, no null-fill) — bug on current master - Multi-alias
WITH + OPTIONAL MATCHfails to compile — TCK match-where6-5
Root cause:
_compile_bounded_reentry_query()doesn't inject OPTIONAL semantics into the suffix compilation. Plan atplans/issue-1026-optional-match-with-stages/plan.md.- Simple
- added 8 commits that reference this issue
on Apr 5, 2026 Fixed in #1061 (merged). Root cause:
__cypher_case_eq__usedpd.Series == Nonewhich always returns False in pandas; fixed by returning the null-mask when either operand is a scalar null literal. Also fixed a cudf incompatibility in_apply_connected_optional_match(marker.apply(lambda)→marker.notna()). 12 new regression tests added.
Status
Still open as of April 2, 2026.
This remains the active
interactive-short-7/ OPTIONAL MATCH lane.Related landed work:
#880open-range bindings replay bug.#880replay boundary.#880residual bindings-table lane is now considered done and should not be treated as remaining scope for this issue.Summary
Direct Cypher execution currently rejects
MATCH ... OPTIONAL MATCH ... RETURN CASE ...reply-author flag queries with:[unsupported-cypher-query] Only node-only pre-binding MATCH clauses are supported before the final connected MATCH in this phaseThis is now a measured benchmark blocker from
pyg-benchfor LDBC SNB Interactiveinteractive-short-7/IS7.Repro Shape
Actual
Compiler/runtime rejects the query before execution with:
Expected
The query should lower and execute, preserving row semantics for the connected reply rows while null-extending the optional
KNOWSbinding for the boolean flag.Benchmark Impact
interactive-short-7OPTIONAL MATCH+CASEsemantics rather than only the already-known row/materialization gapsRelationship To Existing Issues
#989#981, which covers multi-binding projection problems after lowering/execution begins#994, which is an undirected peer-binding wrong-answer bug on a query that already executes#880, which covered the residual bindings-table / replay lane and is now closed after#1016and#1018