Parent: #1179
Depends on: #1180 (pass framework), #1181 (pushdown safety primitives)
Objective
Implement the actual PredicatePushdownPass logical-plan rewrite now that framework and safety primitives are merged.
Scope
- Add
PredicatePushdownPass implementation under graphistry/compute/gfql/passes/.
- Rewrite
Filter(input=PatternMatch(...)) by pushing safe predicates into PatternMatch.predicates.
- Respect
OPTIONAL MATCH null-extension semantics via existing safety helpers in gfql/ir/pushdown_safety.py.
- Respect
WITH/ScopeFrame barriers (no pushdown across scope-reset boundaries).
- Keep pass pure (no in-place mutation).
Acceptance
- Safe predicates are pushed into
PatternMatch.predicates and residual predicates remain as Filter when only partially pushable.
- Null-rejecting predicates on optional-arm aliases are not pushed into optional arms.
- WITH-boundary barrier blocks pushdown where required.
- Pass executes through
PassManager and verifier remains green after pass application.
- No semantic regression in existing Cypher OPTIONAL behavior tests.
Test Gate
- Unit tests for full-push, partial-push, and no-push cases.
- Negative tests proving optional-arm null-rejecting predicates stay above optional match.
- Boundary tests proving WITH/ScopeFrame blocks backward pushdown.
- Integration test proving logical plan flows through pass manager and produces stable output plan shape.
Non-goals
- No IndexRewritePass in this issue.
- No broad cost-based optimization work in this issue.
- No physical planner route changes in this issue.
Notes
- Prefer small deterministic rewrites and explicit plan-shape assertions in tests.
- If discovered edge cases require additional safety helper extensions, track those in this PR scope only when directly required for predicate pushdown correctness.
Parent: #1179
Depends on: #1180 (pass framework), #1181 (pushdown safety primitives)
Objective
Implement the actual
PredicatePushdownPasslogical-plan rewrite now that framework and safety primitives are merged.Scope
PredicatePushdownPassimplementation undergraphistry/compute/gfql/passes/.Filter(input=PatternMatch(...))by pushing safe predicates intoPatternMatch.predicates.OPTIONAL MATCHnull-extension semantics via existing safety helpers ingfql/ir/pushdown_safety.py.WITH/ScopeFrame barriers (no pushdown across scope-reset boundaries).Acceptance
PatternMatch.predicatesand residual predicates remain asFilterwhen only partially pushable.PassManagerand verifier remains green after pass application.Test Gate
Non-goals
Notes