PostgreSQL code coverage of ephyra-postgresql's inputs: the analogue of sqlite-coverage's qscore, for scoring generator changes. Also the PostgreSQL fuzz runner (guide in RUNNER.md) and its deployment and pre-triage (deploy/README.md, deploy/PRETRIAGE.md).
- Instrumented PostgreSQL: master built with clang's source-based
coverage:
CFLAGS="-O1 -g -fprofile-instr-generate -fcoverage-mapping" LDFLAGS=-fprofile-instr-generate --enable-cassert --enable-debug --without-icu --with-lz4 --with-zstd --without-readline, installed with contrib, at~/Projects/postgres-cov/inst/bin(src/lib.rs'sbin_dir, fixed: no environment override), from a checkout in a directory namedpostgres-cov(functions.tsvkeeps source paths after/postgres-cov/).deploy/build-pg.sh --coveragebuilds one inPG_BUILDS/<commit12>-cov/; link or move it there. libpq's "no exit()" check fails on the profile runtime'satexit;touch src/interfaces/libpq/libpq-refs-stampskips it (PostgreSQL's own--enable-coverageskips it too). - The cluster:
.pghere, started by the first session withLLVM_PROFILE_FILE=.pg/prof/%m_%p.profraw. Backends are forked, not exec'd, so all of them merge into the postmaster's file (<sig>_0_<postmaster pid>.profraw) at exit. Restarting the cluster starts a new file. Long-lived processes flush only at shutdown (not counted). - src/lib.rs: raw profile parsing (version 10), snapshots of
the merged file under a shared lock, the counter-to-file map
functions.tsv(function name, source file). functions.tsvis generated and not in the repository (13 MB, specific to the instrumented build):cargo run --release --bin functionsstarts the instrumented cluster, runs one session so the profile exists, merges it withxcrun llvm-profdataand writes each function's name and file fromxcrun llvm-cov exportof the instrumentedpostgres(macOS as written: on Linux, replace thexcruncalls inwrite_function_fileswithllvm-profdata/llvm-covof the clang that built PostgreSQL). Regenerate it after rebuilding the instrumented PostgreSQL; qscore reads it.qscore:cargo run --release --bin qscore -- [--seed S] [--inputs N] [--dirs OUT.tsv]: batches of 10 inputs, one session each; scoreΣ_c(share of batches whose backend grew counter c), counters insrc/backend. First measures (2026-10-13, master 158b6d5109): seed 0, 200 inputs: 29062.5 and 29069.9 (two runs), seed 1: 29040.5; about 5-8 inputs/s. Measured gaps of the generator: gaps/2026-10-16.md.runner(src/bin/runner/, guide in RUNNER.md): the fuzz runner, sqlite-coverage's runner ported: a supervisor, workers on one assertion-enabled cluster of the run's own (D/pg), the model property and nine oracles in turn, crash/hang/memory handling, records andephyra.postgresql.*metrics over DogStatsD (optional). Not coverage-guided. It is not part of the frozen scorer (its own modules andbuild.rs, which only setsRUNNER_BUILT_VERSION).deploy/: scripts that build PostgreSQL master, run the runner unattended on a Linux host with a watchdog and a nightly master refresh, and pre-triage findings against the known bugs of deploy/known-bugs.json (paths relative tocase-studies/; the bugs' folders are under ../bugs).- Not yet: held-out monitors, a control (what any input reaches, e.g. connection setup, is in every batch), frozen-scorer checksums.