{
  "id": "GW-2026-0003",
  "type": "report",
  "title": "Compiler-Hidden PostgreSQL Continuations for Direct-Style Server Programs",
  "abstract": "This paper presents Gray's compiler-hidden PostgreSQL continuation architecture, which preserves direct source-order database calls while moving connection and query waiting onto readiness-driven runtime state machines. The work responds to a retained one-hour baseline that delivered 3,999.85 requests per second at 4,000 requested but accumulated 802.82 ms corrected p99. The replacement path uses nonblocking libpq connection establishment, parameterized query dispatch, output flushing, input consumption, result draining, cancellation, and connection retirement under a normalized readiness reactor. A rate curve placed the new useful corrected-latency knee between 12,000 and 16,000 requested requests per second. A separate Static qualification with PostgreSQL 16, a 64-connection pool, four wrk2 threads, and 256 persistent HTTP connections delivered 7,961.48/s at 8,000 requested with 1.43 ms corrected p50, 4.60 ms p99, and 8.74 ms p99.9. During load, the runtime exposed as many as 164 simultaneously suspended handlers while using zero general task workers; after completion, active task, worker, and continuation counts returned to zero. Semantic gates covered overlapping queries with one configured task worker, typed errors after resumption, HTTP/2 multiplexing, cancellation and connection replacement, 404/500 behavior, and Adaptive deployment replacement. The result demonstrates that direct-style server code and readiness-driven database concurrency can coexist as one compiler-runtime contract without requiring application-authored polling logic or a worker per blocked handler.",
  "author": [
    {
      "family": "Proctor",
      "given": "Annabella",
      "ORCID": "https://orcid.org/0009-0000-0799-1757"
    }
  ],
  "publisher": "Grayworth Technical Publications",
  "issued": {
    "date-parts": [
      [
        2026,
        7,
        26
      ]
    ]
  },
  "version": "1.0",
  "DOI": "10.5281/zenodo.21633225",
  "URL": "https://grayworth.com/publications/gw-2026-0003",
  "keyword": "Gray; PostgreSQL; libpq; continuations; direct style; nonblocking I/O; readiness reactor",
  "publisher-place": "Sacramento, California, United States",
  "note": "Grayworth Publication ID GW-2026-0003. Related news record: https://grayworth.com/news/gray-postgresql-continuations."
}
