Skip to content

feat: add PostgreSQL 18 support, interactive engine switcher, full 120-task leaderboard, and indexing analysis - #1

Merged
sethusrinivasan merged 1 commit into
mainfrom
feat/postgres-support-and-leaderboard-update
Nov 13, 2026
Merged

sethusrinivasan merged 1 commit into
mainfrom
feat/postgres-support-and-leaderboard-update

Conversation

@sethusrinivasan

Copy link
Copy Markdown
Owner

Overview

This PR delivers multi-database engine support, adds interactive database engine switching to the live benchmark dashboard, expands the Multi-Model Frontier Leaderboard to reflect full 120-task evaluation results across all models in Antigravity's context, and includes an in-depth empirical physical plan and indexing analysis.


Key Changes

1. PostgreSQL 18+ Docker Compose Instance & Analytical Extension Suite

  • Containerized Infrastructure: Added docker-compose.yml and docker/Dockerfile building PostgreSQL 18.7 with native multi-extension support.
  • Turnkey Setup Script: Added setup_postgres.sh (chmod +x setup_postgres.sh) automating container build, healthcheck polling, and extension verification.
  • Extensions Enabled via docker/init.sql:
    • vector (pgvector 0.8.7): HNSW and IVFFlat vector indexing, cosine similarity (<=>), Euclidean distance (<->), and MIPS inner product (<#>).
    • pg_trgm: Trigram indexing and fuzzy text similarity.
    • fuzzystrmatch: Levenshtein distance, Soundex, and Metaphone phonetics.
    • btree_gist: GiST indexing for temporal range overlaps and exclusion constraints.
    • tablefunc: Dynamic crosstab pivots and connectby tree traversals.
    • ltree, hstore, intarray, uuid-ossp.
  • PostgreSQL Polyfill Compatibility Layer: Added analytical compatibility functions for round(double precision, integer), array_cosine_similarity(), array_distance(), array_inner_product(), date_diff(), list(), median(), and range().

2. Dual-Engine Execution Sandbox (SQLEvalEngine)

  • Updated harness/engine.py to support both duckdb (default in-memory columnar OLAP) and postgres (PostgreSQL 18+ via psycopg2).
  • Implemented clean schema-level isolation (eval_sandbox) per task execution in PostgreSQL, alongside statement timeout enforcement (SET statement_timeout = '15s') and EXPLAIN (ANALYZE, FORMAT JSON, VERBOSE) plan extraction.
  • Updated run_eval.py and run_all_models.py with --engine={duckdb,postgres} CLI flags.
  • Added unit tests in tests/test_harness.py validating PostgreSQL isolation, query execution, and plan operator profiling (14/14 tests pass).

3. Dashboard Updates & Multi-Engine Interactive Switcher

  • RCA Banner Removal: Removed the obsolete incident banner "Root Cause Analysis (RCA): Yesterday's Run Abort & Ubuntu Process Termination" from reports/index.html and generate_reports.py.
  • Dynamic Engine Switcher: Added an interactive toggle (⚡ DuckDB 2.0 vs 🐘 PostgreSQL 18.7) with client-side state management in reports/script.js and reports/style.css. Allows live switching of hero KPIs, pass rates, latency metrics, and engine-specific leaderboards with localStorage persistence.
  • Full 120-Task Multi-Model Leaderboard: Expanded the leaderboard from 8-task samples to complete 120-task empirical evaluations across all 6 models available in Antigravity's context (claude-opus-4-6-thinking, gemini-3.8-flash-medium, gemini-3.8-flash-low, claude-sonnet-4-6, gpt-oss-120b-medium, gemini-3.8-flash-high) on both DuckDB 2.0 and PostgreSQL 18.7.

4. Physical Plan Optimization & Indexing Architecture Analysis

  • Embedded an empirical analysis across 120 physical execution plans into reports/index.html, README.md, BENCHMARK_REPORT.md, and PHYSICAL_PLAN_OPTIMIZATION_AND_LLM_ANALYSIS.md:
    • The Columnar Indexing Paradox: Sequential table scans account for only 5.5% of analytical query runtime in DuckDB, while in-memory operations account for 94.5%. Secondary B-Tree/ART indexes are completely bypassed by DuckDB's SIMD chunk scanner.
    • PostgreSQL Optimization Levers: Evaluated Composite Covering Indexes (INCLUDE) to enable pure Index-Only Scans, HNSW vector indexes for 100x ANN acceleration, GIN trigram indexes for substring matching, and BRIN indexes for append-only timestamp streams.
    • Root Causes of LLM Failure: Identified SELECT-only prompt scoping, OLTP B-tree muscle memory, statistical cardinality blindness, and the absence of an execution feedback loop.
    • Actionable DB Artifact Optimization: Outlined dual-phase DDL+query prompting, automated EXPLAIN ANALYZE feedback loops, and engine-aware primitive guidance.

Verification & Testing

  • Unit test suite: pytest tests/ -v (14/14 passed)
  • Turnkey verification script: ./verify.sh (PASSED across all 4 stages: unit tests, DuckDB golden baseline, PostgreSQL golden baseline, and offline trap evaluation)
  • CI integration: Updated .github/workflows/ci.yml to automatically initialize the PostgreSQL container and run the dual-engine test suite.

…d switcher, full 120-task leaderboard across all models, and indexing analysis
@sethusrinivasan
sethusrinivasan merged commit 7b23594 into main Nov 13, 2026
2 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