Side experiment / reference evaluator

A simpler engine.
A clearer set of rules.

We built a simpler program to study how SQL should work. It is slower than the main engine, but selected operations have computer-checked proofs. It can also provide comparison answers for supported questions.

The reference evaluator is not publicly released. Release timing is still to be decided.

A checking tool alongside the fast engine.

A supported SQL query → Reference evaluator → A comparison answer

This reference program is separate from the engine in the alpha packages. Comparing their answers can reveal mistakes. Matching answers on a test do not prove that the fast engine is always correct.

The measurements below tested only the reference program. They did not compare it with the fast engine.

How far does the reference reach?

How much of the test collection could the reference handle with matching answers? The collection has 7,421,339 records in 622 files. A record is one entry in those test files.

The points show successive milestones, not time spent. Coverage grew both when proofs expanded and when the program accepted more kinds of queries.

All measured results as a table
Full-collection verified coverage; same denominator at every milestone
MilestoneMatched / all recordsCoverageEvidence
1. Baseline388,825 / 7,421,3395.24%Measurement summary (JSON)
2. Unary plus and constant SELECT1,624,341 / 7,421,33921.89%Measurement summary (JSON)
3. DISTINCT plus broader column admission2,427,379 / 7,421,33932.71%Measurement summary (JSON)
4. Whole-table aggregates2,997,068 / 7,421,33940.38%Measurement summary (JSON)
5. CASE/IN/BETWEEN/ABS3,710,253 / 7,421,33949.99%Measurement summary (JSON)
6. ORDER BY/LIMIT4,022,499 / 7,421,33954.20%Measurement summary (JSON)
7. Exact decimal comparisons4,964,030 / 7,421,33966.89%Measurement summary (JSON)
8. GROUP BY and HAVING5,086,352 / 7,421,33968.54%Measurement summary (JSON)
9. IN and NOT IN subqueries5,169,602 / 7,421,33969.66%Measurement summary (JSON)

The latest result covers 69.66% of all records. This is the reference program’s test coverage, not the share of fast-engine code proved. Counting only the 5,939,714 eligible records gives 87.03%; the chart keeps all records in its total.

No wrong outcomes were observed in these reference runs. The fast engine was not checked in these runs, so these results make no correctness claim about it.

Specific properties, with explicit boundaries.

A proof needs a precise rule. Here are examples of the rules checked for selected reference operations. NULL means a missing value in SQL.

DISTINCTDISTINCT removes repeated rows. Each different row appears once, keeping its first occurrence.
AggregatesAggregates summarize a table in one row. COUNT counts non-NULL values. With no input rows, COUNT returns 0; SUM, MIN and MAX return NULL.
ORDER BY / LIMITORDER BY sorts the rows without losing or adding any. Tied rows keep their relative order. LIMIT keeps only the requested number of rows from the start.
IN subqueriesIN asks whether a value appears in the result of another query. The proof follows SQLite’s rules for missing values and includes only rows where WHERE is TRUE. For an empty result, even NULL IN returns FALSE, and NULL NOT IN returns TRUE.
Versions, assumptions and sources

The historical reference measurements reach development version v11. An earlier source-only experiment linked v9. The evaluator and its proof workspace are not part of the public repository or packages; the Python and Rust alpha packages contain the fast engine only.

There are limits. Decimal comparisons still rely on an unproved assumption about which inputs safely match SQLite’s number behavior. The code that reads SQL, translates it, prepares data and compares answers is trusted separately, as are the compiler and proof tools. A higher coverage percentage does not remove those assumptions.

DISTINCT receipt · Aggregate receipt · Ordering receipt · Subquery receipt

A research path, with work still ahead.

The fast engine has a public repository, but this separate reference evaluator is not publicly released. We are still exploring how to make the experiment useful and reproducible. A separate release is not scheduled.

Discuss a contribution →