sqlite-optimized RepositoryIndependent rebuild-and-reproduce audit · 8 August 2026 ·
repository github.com/ksenxx/sqlite-optimized
(commit 4b19d6bcf on upstream SQLite 3.54.0 trunk d0afe9c60),
cloned to ~/sqllite-optimized
speedtest1 --verify, kvtest --integrity-check — passed on every
repetition of every configuration. An independent read-only review by a second model
(gpt-5.6-sol) recomputed all numbers, confirmed the build fairness, and found
no engine bug, no cheating, and no verifier-introduced changes.
git clone of the public repository into
~/sqllite-optimized; integrity checked (git fsck clean, HEAD as published).configure + make sqlite3.c
regenerated the 9.5 MB amalgamation; the four benchmark binaries
(speedtest1, kvtest, tatp, ssb) were built
twice from the same amalgamation and sources:
a baseline build (-O2 -g, stock defaults) and the optimized build
(-O3 -march=native + the repository’s OPT_DEFS stack) —
exactly the reproduce commands published with the repository.benchks/bench.sh
(3 repetitions, hard-coded expected checksums, fail-fast) was run for baseline, optimized,
and a freshly retrained PGO build whose training workloads deliberately used different
sizes and seeds than the measured runs.veryquick suite (~332,000 checks) was run against
four differently-configured testfixture builds to separate code effects from
changed-default effects.gpt-5.6-sol, performed a strictly
read-only audit of every claim, log, and result file (≈0.03% of task budget, well under the 20% cap).Medians of 3 repetitions; smaller is faster. “Published” figures are from the original
optimization report (its v4 data).
| Benchmark | Baseline (today) | Optimized, documented steps | Speedup | Optimized + fresh PGO | Speedup | Published speedup |
|---|---|---|---|---|---|---|
speedtest1 (official, --verify) | 11.54 s | 5.51 s | 2.09× | 5.86 s | 1.97× | 2.06× |
| TATP transaction mix (academic OLTP) | 4.30 s | 2.37 s | 1.82× | 2.15 s | 2.00× | 1.90× |
| kvtest blob I/O (official, 3 phases) | 2.95 s | 2.31 s | 1.28× | 2.31 s | 1.28× | 1.25× |
| SSB 13 queries (academic OLAP) | 2.85 s | 2.76 s | 1.03× | 2.48 s | 1.15× | 1.30× |
| Geometric mean | 1.50× | 1.55× | 1.59× |
speedtest1 --verify internal result verification.kvtest --integrity-check reported ok after all 9 runs.139981 39920 140288 7955 55905 8107 7844 and checksum
10123417494647775989, and SSB row count 3394 / checksum
13164251427055023644, matched the hard-coded expected values on every repetition
of every build — identical answers from baseline and optimized builds.| testfixture configuration | veryquick result | Interpretation |
|---|---|---|
| Stock defaults (baseline) | 1 error / 332,420 — only zipfile-25.0 | Green. The one failure is a proven environmental artifact: a directory left behind by symlink.test; zipfile.test alone in a clean directory passes 0/120. |
| Code changes only (computed-goto + WAL write buffer) | 1 error / 332,420 — only zipfile-25.0 | Green. The engine code changes introduce no regression. |
| All tuned defaults except WAL-by-default | 26 errors / 332,796, run completed | Every failure is in a test that asserts a specific default value the build intentionally changes (WAL autocheckpoint 1000→16384, cache size, temp store, mmap). All 26 files pass in the code-only build. |
Full OPT_DEFS incl. WAL-by-default | Fails; aborted mid-suite | Expected: the upstream suite assumes rollback-journal defaults. Bisection proved the pattern: a WAL-default-only build reproduces the attach2 (26/71) and autovacuum (23/339) failures exactly, while the stock build passes them 0 errors. |
ADVERSARIAL.md,
HARDENING.md) say testing was done, and which this verification reproduced. The upstream
suite does not support builds whose runtime defaults are changed (WAL-by-default, autocheckpoint,
cache/mmap/temp-store); those failures were bisected to the changed defaults, not to code. Two related
reviewer notes: (a) two bisected files plus the completed defaults-minus-WAL run make the attribution
strong but not exhaustive for every failing case; (b) testfixture builds define SQLITE_TEST,
which by design disables computed-goto dispatch, so the suite exercises the fallback dispatch path
(the benchmark binaries do exercise computed-goto, under checksum verification).
OPT_DEFS/CFLAGS differ), and that the optimized defaults were genuinely active
(fresh databases born in WAL mode; baseline stays on rollback journal).-fprofile-use and no instrumentation.git clone https://github.com/ksenxx/sqlite-optimized ~/sqllite-optimized
cd ~/sqllite-optimized && mkdir build-base build-opt
( cd build-base && ../configure && make sqlite3.c )
cp build-base/sqlite3.{c,h} build-opt/
benchks/build_bench.sh build-base # baseline: -O2, stock defaults
. benchks/optflags.sh
CFLAGS="-O3 -march=native -g" benchks/build_bench.sh build-opt $OPT_DEFS
benchks/bench.sh build-base baseline 3 # results: benchks/results/baseline.txt
benchks/bench.sh build-opt final 3 # results: benchks/results/final.txt
( cd build-base && make testfixture && ./testfixture ../test/veryquick.test )
Raw artifacts from this verification remain in
~/sqllite-optimized/benchks/results/ (baseline-repro.txt,
final-repro.txt, final-pgo-repro.txt, final-pgo2-repro.txt)
and the build directories build-base, build-opt, build-pgo,
build-code, build-waldef, build-tunes.