Skip to content

GFQL implementation shrink: Cypher lowering core residue investigation #1611

Description

@lmeyerov

GFQL implementation shrink: Cypher lowering core residue investigation

Reference: #1058

Branch investigated: codex/gfql-lowering-shrink off origin/master @ 2d0be647690d0932306585a857e64bb1cc7cd46c

Target: graphistry/compute/gfql/cypher/lowering.py

Outcome: no PR opened. The safe in-file shrink candidates found in lowering.py did not meet the lane threshold for a meaningful production shrink, so this is the structural receipt path rather than a code PR.

Evidence:

  • Enumerated _lower_* helpers and large functions in lowering.py (8,101 LOC on base).
  • Cross-checked recent shrink PRs:
  • No _APPROVED_UNPLANNED_CHAIN_FALLBACK_CODES or equivalent stale approved-unplanned guard remains in current lowering.py.
  • Logical-plan defer / optional reentry routing remains active and tested, so it was treated as protected.
  • Attempted safe helper extraction around:
    • duplicate projection-name diagnostics,
    • aggregate runtime temp projection wiring,
    • row-column suffix/scope construction,
    • pattern-predicate binding-op lowering,
    • active row-step / UNWIND setup.
  • Exploratory patch measured only +399/-428 in lowering.py (net -29) after preserving protected behavior. That is not worth a PR for this lane.
  • A candidate dead helper, _rewrite_where_clause_and_resync, is imported by graphistry.compute.gfql.cypher.reentry.compiletime; deleting it broke aggregate reentry tests, so it is not safe deletion residue.

Exploratory validation:

  • python3 -m pytest -q graphistry/tests/compute/gfql/cypher/test_lowering.py::test_string_cypher_projection_duplicate_name_error_preserves_context graphistry/tests/compute/gfql/cypher/test_lowering.py::test_lower_match_query_rejects_where_pattern_predicate_introducing_new_aliases passed.
  • python3 -m pytest -q graphistry/tests/compute/gfql/cypher/test_lowering.py -k 'aggregate and not cudf' passed (43 passed).
  • Local cuDF aggregate slice failed because local host has cuDF installed but no CUDA device; run on dgx-spark only if a future PR touches these runtime paths.

Recommendation:

  • Do not open a cosmetic helper-motion PR from this lane.
  • Treat lowering.py core aggregate/reentry/defer logic as currently active/protected until adjacent architecture changes land.
  • A future meaningful tranche likely needs one of:
    • moving a whole, well-owned lowering subdomain into an existing focused module with net production shrink across files,
    • further retiring direct-Cypher fallback/reentry machinery after its benchmark gates close,
    • or planner-level consolidation that coordinator explicitly authorizes because it touches protected compiler-plan surfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions