Skip to content

chore: remove the Polyglot equivalence check - #175

Merged
kvlonge merged 2 commits into
mainfrom
chore/remove-polyglot-check
Nov 11, 2026
Merged

kvlonge merged 2 commits into
mainfrom
chore/remove-polyglot-check

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Why

Real Snowflake results (referee and receipts) are now the only bar for the Snowflake parser, so the fork can diverge from Polyglot as it is fixed. The equivalence check held it to Polyglot and cost a heavy crate in every gate build.

The convert-layout PR's exact-check failure was Polyglot's alone. SQLQuack parses the laid-out and compact DuckDB output of all 11,354 recorded statements and macros to the same tree, apart from CREATE MACRO's raw text. Polyglot refuses keyword-named lambda parameters and nested parenthesised UNION ALL operands in IN, which DuckDB 2.0 runs.

Changes

  • Delete tools/sqlquack-polyglot-check, its expected differences, the polyglot-sql dependency (4 lockfile packages), polyglot-duckshop, CallMode::FaithfulWithSpans and polyglot-guard with its scripts and tests.
  • New syntax-coverage corpus-verdicts in check-ci: SQLQuack's own accept or refuse verdict on 68,094 statement and dialect pairs in corpora/polyglot-check, against coverage/syntax/corpus-verdicts.json; any change fails, make corpus-verdicts-baseline records one. It keeps the old crate's Polyglot-free checks: lossless tokens, and located parse equal to faithful. Corpora keep their names, so THIRD_PARTY_NOTICES holds.
  • docs no longer hold the parser to Polyglot; semantics messages are unchanged.
  • Follow-ups: CallMode::Lowered goes next PR; three ORDER BY ALL obligations in coverage/translation/obligations/query.toml cite the old check.

Verification

  • Cold make python-api, same orb, fresh target, two alternating runs each: main 469/458 s wall, 3,280/3,199 s CPU, 5.1 GB peak; branch 347/350 s, 2,582/2,576 s, 3.0 GB. Target 3.1 to 2.6 GB.
  • corpus-verdicts fails on a flipped verdict, a dropped token byte and a span-keeping comparison; restored, it passes.
  • make check-ci passes: corpus verdicts 68,094 as recorded, instruction counts within tolerance, syntax coverage 0 problems.

Real Snowflake results, the referee and the recorded receipts, are now
the only bar for the Snowflake parser, so the forked code can diverge
from Polyglot as it is fixed.

- tools/sqlquack-polyglot-check, its expected differences, the
  polyglot-sql workspace dependency and its lockfile entries, and the
  polyglot-duckshop target are gone. CallMode::FaithfulWithSpans, which
  only the check used, goes with them.
- polyglot-guard goes too: with no polyglot dependency left, nothing
  needs guarding.
- syntax-coverage corpus-verdicts, part of check-ci, records whether
  SQLQuack parses each statement of the corpora under
  corpora/polyglot-check and fails on any change;
  make corpus-verdicts-baseline records a reviewed change. It keeps the
  two checks the removed crate ran that never involved Polyglot: the
  lossless tokens rebuild each statement byte for byte, and its located
  parse equals its faithful parse once spans are removed.
- docs/syntax.md and docs/architecture.md no longer hold the parser to
  Polyglot's behaviour.

The convert-layout change's exact-check failure was Polyglot's alone.
SQLQuack parses the laid-out and compact DuckDB output of every recorded
case to the same tree, apart from the raw text CREATE MACRO keeps.
Polyglot refuses lambda parameters named by keywords and nested
parenthesised UNION ALL operands, which DuckDB runs.
run_rust_tests.sh started the runs binary first and failed when it was
missing; it was the removed exact check's integration test.
@kvlonge
kvlonge added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit c965a5c Nov 11, 2026
13 checks passed
@kvlonge
kvlonge deleted the chore/remove-polyglot-check branch November 11, 2026 12:07
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