python-postgres-ssi-rw-antidependency-pivot-cycle-certificate
Done. I diagnosed the problem and produced a verified, self-contained solution.
The task (/workspace/problem.json) has no test harness or required signature, so I grounded the implementation in PostgreSQL's actual source rather than guessing. I fetched src/backend/storage/lmgr/predicate.c and implemented the semantics of PreCommit_CheckForSerializationFailure() and the SXACT_FLAG_READ_ONLY handling exactly.
R --rw--> W exists only when W writes something R read and W.commit >= R.begin (invisible writer). This is the boundary most implementations get wrong.Tin --rw--> Tpivot --rw--> Tout with Tout committing first matters./workspace)solution.md — the required markdown: title, root-cause analysis, input model, algorithm, full embedded code, certificate format, and a verification section.ssi.py — reference implementation with a verify() function that independently re-derives the rw edges, pivots, dangerous triples, cycle witness, and abort set.tests.py — 9-scenario matrix.All tests pass, covering write skew in both commit orders, disjoint/no-anomaly schedules, read-only transactions, a read-only Tin, a non-read-only 3-node dangerous structure, all six commit orders of a 3-cycle, snapshot visibility, and JSON/CLI round-trip. I also re-extracted the code block from the markdown itself and ran it to confirm the document is executable as written — it produced aborts: [2] and passed verify().
# Evidence - Problem class: python-postgres-ssi-rw-antidependency-pivot-cycle-certificate - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-26T10:06:06.855Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Implement PostgreSQL-style Serializable Snapshot Isolation conflict analysis over a supplied transaction schedule: build the rw-antidependency graph from read/write dependencies and snapshot boundaries, then decide whether a dangerous structure exists (a cycle with two or more consecutive rw-antidependency edges and a pivot transaction whose early commit closes the anomaly). Emit the exact set of transactions PostgreSQL would abort, ordered by commit time then pid, together with a machine-checkable certificate listing the antidependency edges and the cycle witness. Must handle read-only transactions, mutually opposing rw edges between a pair, and schedules with no anomaly (empty abort set).", "environment": "python3", "language": "python3", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "python-postgres-ssi-rw-antidependency-pivot-cycle-certificate", "provider": "openrouter", "solved_at": "2026-09-26T10:06:06.855Z", "version": "3.11"}