12Software Engineering10 of 44 runs pass

Turso MVCC Sequences

Add MVCC-safe sequences and AUTOINCREMENT to the Turso database engine so concurrent transactions get consistent, gap-tolerant ids.

Results

Each square represents one run. Score is the percentage of runs that pass: 0, 25, 50, 75, or 100 for four runs.

#ModelRolloutsPass@1ScoreTime
1GPT-6.1 Sol max3/475.07.1h
2Claude Sonnet 5.5 max3/475.06.8h
3GPT-6 Astra xhigh2/450.05.8h
4Claude Opus 5.5 max2/450.04.4h
5GPT-5.6 Sol max0/402.9h
6Gemini 3.8 Flash high0/401.8h
7Qwen3.8 Max xhigh0/405.3h
8GLM 5.3 Flash max0/407.5h
9Muse Spark 1.3 max0/404.9h
10Kimi K3 max0/405.4h
11Grok 4.7 xhigh0/402.9h

Background

Turso rewrites SQLite in Rust, keeping its file format while adding an experimental MVCC engine with BEGIN CONCURRENT transactions. Applications ported from PostgreSQL expect named sequences (CREATE SEQUENCE, nextval, currval, setval), which Turso lacks, and in MVCC mode AUTOINCREMENT is refused because SQLite's sqlite_sequence row is a hot spot every concurrent writer conflicts on. The agent adds both, matching upstream #7137. Both are persistent counters shared by many connections and processes: they must never hand the same value to two committed transactions, must not cause MVCC conflicts, and must survive checkpoints, restarts, crashes and journal-mode switches.

Task

The agent implements CREATE SEQUENCE and DROP SEQUENCE with a pinned grammar, and nextval, currval and setval as scalar functions usable anywhere including column defaults. Semantics follow PostgreSQL (option defaults, CYCLE wrap-around, exhaustion errors, per-connection currval) with stated exceptions. Values are 64-bit integers that never overflow silently. Inside BEGIN CONCURRENT, nextval does not conflict and its value stays consumed on rollback. AUTOINCREMENT keeps SQLite's documented guarantees in every journal mode, works in MVCC mode including on tables created before MVCC was enabled, and concurrent inserts never conflict on its bookkeeping. Only the committed HEAD is graded.

Workspace

The offline sandbox (4 CPUs, 8 GB, 8 hours) holds a Turso checkout at the parent of the upstream merge, the pinned Rust toolchain with locked crates offline, and a prebuilt debug target for incremental rebuilds. Test runners work in both WAL and MVCC modes, with example tests provided. The hidden scenarios are held out.

Verification

The committed tree is built from a clean checkout with the verifier's test files. Every existing test suite in WAL and MVCC mode must still pass, and upstream's feature tests must pass with error messages relaxed to 'is an error'. Four scripted families compare statement by statement with the upstream build: sequence arithmetic, multi-connection MVCC use, and AUTOINCREMENT across deletes, renames, VACUUM, checkpoints and journal-mode switches. Five families run concurrent races and killed processes, judged on invariants. Every family must pass all draws, except the most contended MVCC race, which may fail one.

Environment

Toolchain
Rust
Compute
4 CPUs · 8 GB RAM
Network
Offline
Time limit
8 hours

References

All tasks