Skip to content

chore(3vl): pushdown/3VL consistency test + doc follow-ups#76

Merged
Felipe705x merged 2 commits into
mainfrom
chore/3vl-followups
Jul 5, 2026
Merged

chore(3vl): pushdown/3VL consistency test + doc follow-ups#76
Felipe705x merged 2 commits into
mainfrom
chore/3vl-followups

Conversation

@Felipe705x

Copy link
Copy Markdown
Collaborator

Follow-ups after the 3VL merge (#73).

Pushdown/3VL consistency (the substantive bit)

The interpreter (eval_binop) returns Value::Null for a null-operand comparison; the pushdown (cmp_values) returns false. These stay row-equivalent not by luck: the value-predicate pushdown only lifts positive attr op literal AND-conjuncts, where a null operand means drop under both — and pushing a conjunct out of an OR / under a NOT is already forbidden (wrong for non-null rows too). The keep-despite-null shapes (… OR true, NOT (…)) stay residual on the 3VL interpreter.

  • tests/pushdown_null_test.rs pins this across the node-scan, LTJ NodeAttrCmp, and btree range-fold paths. It fails if the optimizer ever pushes a non-conjunct, or if the two comparison cores drift on keep/drop.
  • cmp_values now documents the invariant and the exact trigger to unify into a shared cmp_3vl core: if a pushed comparison's value is ever consumed as something other than keep/drop (e.g. a future computed-column pushdown feeding a projection/CASE).

Docs

  • docs/internals/iso-gql-gaps.md §3.4 — records the ISO data-exceptions workstream the CLAUDE.md "Null semantics" note already pointed at (essential-error hard-abort 22G12, material NOT NULL 22G12/22G03, closed-graph property validation).
  • Marks IN-as-membership as a froGQL extension (SQL-3VL-consistent; not in ISO GQL nor FPPC) in the doc and the eval_binop comment.

No behavior change. cargo fmt / clippy -D clean; full sweep green.

🤖 Generated with Claude Code

Felipe705x and others added 2 commits July 5, 2026 12:27
The interpreter's `eval_binop` yields `Value::Null` for a null-operand
comparison; the pushdown `cmp_values` yields `false`. They produce identical
rows because the value-predicate pushdown only lifts positive `attr op literal`
AND-conjuncts, where a null operand means "drop" under both — and pushing a
conjunct out of an OR / under a NOT is already forbidden (wrong for non-null
rows too). `tests/pushdown_null_test.rs` pins this across the node-scan, LTJ
`NodeAttrCmp`, and btree range-fold paths, so a future optimizer change that
pushes a non-conjunct is caught. Also documents the invariant and the exact
"unify into a shared cmp_3vl" trigger on `cmp_values`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds iso-gql-gaps.md §3.4 (the CLAUDE.md "Null semantics" note pointed here but
the entry was missing): froGQL empties on type errors (FPPC model) where ISO
wants a hard `22G12`/`22G03` data exception — essential-error hard-abort,
material `NOT NULL` types, closed-graph property validation. Also notes that
`IN`-as-membership is a froGQL extension (SQL-3VL-consistent; not in ISO/FPPC),
in the doc and the eval_binop comment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Felipe705x Felipe705x merged commit 3c09637 into main Jul 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant