{
  "experiment_date": "2026-10-24",
  "environment": {
    "python": "3.12.14",
    "sqlite": "3.53.1",
    "platform": "macOS-27.0.1-arm64-arm-64bit"
  },
  "scope": "One process, ordered actions, two local WAL connections per case; no HTTP server, load benchmark or other database engine tested.",
  "seed_id_created_at": [
    [
      1,
      100
    ],
    [
      2,
      100
    ],
    [
      3,
      200
    ],
    [
      4,
      200
    ],
    [
      5,
      300
    ],
    [
      6,
      300
    ]
  ],
  "sort_key_note": "created_at values are synthetic integer ordering keys, not actual Unix timestamps.",
  "queries": {
    "offset": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT ? OFFSET ?",
    "keyset": "SELECT id, created_at FROM items WHERE (created_at, id) < (?, ?) ORDER BY created_at DESC, id DESC LIMIT ?",
    "time_only": "SELECT id, created_at FROM items WHERE created_at < ? ORDER BY created_at DESC, id DESC LIMIT ?",
    "inclusive": "SELECT id, created_at FROM items WHERE (created_at, id) <= (?, ?) ORDER BY created_at DESC, id DESC LIMIT ?"
  },
  "cases_passed": [
    {
      "case": "ties_and_index",
      "incomplete_order_before_index": [
        5,
        6,
        3
      ],
      "incomplete_order_after_index": [
        6,
        5,
        4
      ],
      "total_order_before_and_after": [
        6,
        5,
        4
      ],
      "sql_trace": [
        {
          "connection": "reader",
          "sql": "PRAGMA journal_mode=WAL"
        },
        {
          "connection": "reader",
          "sql": "CREATE TABLE items(id INTEGER PRIMARY KEY, created_at INTEGER NOT NULL)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (1, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (2, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (3, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (4, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (5, 300)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (6, 300)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id FROM items ORDER BY created_at DESC LIMIT 3"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "reader",
          "sql": "CREATE INDEX items_feed ON items(created_at DESC, id DESC)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id FROM items ORDER BY created_at DESC LIMIT 3"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        }
      ]
    },
    {
      "case": "insert_above_cursor",
      "first": [
        6,
        5,
        4
      ],
      "cursor": [
        200,
        4
      ],
      "baseline_second": [
        3,
        2,
        1
      ],
      "offset_second": [
        4,
        3,
        2
      ],
      "keyset_second": [
        3,
        2,
        1
      ],
      "sql_trace": [
        {
          "connection": "reader",
          "sql": "PRAGMA journal_mode=WAL"
        },
        {
          "connection": "reader",
          "sql": "CREATE TABLE items(id INTEGER PRIMARY KEY, created_at INTEGER NOT NULL)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (1, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (2, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (3, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (4, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (5, 300)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (6, 300)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 3"
        },
        {
          "connection": "writer",
          "sql": "INSERT INTO items(id, created_at) VALUES (7, 400)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 3"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (200, 4) ORDER BY created_at DESC, id DESC LIMIT 3"
        }
      ]
    },
    {
      "case": "delete_above_cursor",
      "first": [
        6,
        5,
        4
      ],
      "offset_second": [
        2,
        1
      ],
      "keyset_second": [
        3,
        2,
        1
      ],
      "sql_trace": [
        {
          "connection": "reader",
          "sql": "PRAGMA journal_mode=WAL"
        },
        {
          "connection": "reader",
          "sql": "CREATE TABLE items(id INTEGER PRIMARY KEY, created_at INTEGER NOT NULL)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (1, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (2, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (3, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (4, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (5, 300)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (6, 300)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "writer",
          "sql": "DELETE FROM items WHERE id = 6"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 3"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (200, 4) ORDER BY created_at DESC, id DESC LIMIT 3"
        }
      ]
    },
    {
      "case": "incomplete_and_inclusive_cursor",
      "cursor": [
        200,
        4
      ],
      "time_only_second": [
        2,
        1
      ],
      "inclusive_second": [
        4,
        3,
        2
      ],
      "strict_pair_second": [
        3,
        2,
        1
      ],
      "sql_trace": [
        {
          "connection": "reader",
          "sql": "PRAGMA journal_mode=WAL"
        },
        {
          "connection": "reader",
          "sql": "CREATE TABLE items(id INTEGER PRIMARY KEY, created_at INTEGER NOT NULL)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (1, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (2, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (3, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (4, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (5, 300)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (6, 300)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE created_at < 200 ORDER BY created_at DESC, id DESC LIMIT 3"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) <= (200, 4) ORDER BY created_at DESC, id DESC LIMIT 3"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (200, 4) ORDER BY created_at DESC, id DESC LIMIT 3"
        }
      ]
    },
    {
      "case": "new_row_below_cursor",
      "first": [
        6,
        5,
        4
      ],
      "keyset_second": [
        3,
        7,
        2
      ],
      "new_id_on_second": 7,
      "sql_trace": [
        {
          "connection": "reader",
          "sql": "PRAGMA journal_mode=WAL"
        },
        {
          "connection": "reader",
          "sql": "CREATE TABLE items(id INTEGER PRIMARY KEY, created_at INTEGER NOT NULL)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (1, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (2, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (3, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (4, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (5, 300)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (6, 300)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "writer",
          "sql": "INSERT INTO items(id, created_at) VALUES (7, 150)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (200, 4) ORDER BY created_at DESC, id DESC LIMIT 3"
        }
      ]
    },
    {
      "case": "mutable_sort_key",
      "first": [
        6,
        5,
        4
      ],
      "keyset_second": [
        3,
        5,
        2
      ],
      "repeated_seen_id": 5,
      "sql_trace": [
        {
          "connection": "reader",
          "sql": "PRAGMA journal_mode=WAL"
        },
        {
          "connection": "reader",
          "sql": "CREATE TABLE items(id INTEGER PRIMARY KEY, created_at INTEGER NOT NULL)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (1, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (2, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (3, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (4, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (5, 300)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (6, 300)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "writer",
          "sql": "UPDATE items SET created_at = 150 WHERE id = 5"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (200, 4) ORDER BY created_at DESC, id DESC LIMIT 3"
        }
      ]
    },
    {
      "case": "explicit_read_snapshot",
      "first": [
        6,
        5,
        4
      ],
      "second_in_same_transaction": [
        3,
        2,
        1
      ],
      "first_in_same_transaction": [
        6,
        5,
        4
      ],
      "first_after_commit": [
        7,
        6,
        5
      ],
      "sql_trace": [
        {
          "connection": "reader",
          "sql": "PRAGMA journal_mode=WAL"
        },
        {
          "connection": "reader",
          "sql": "CREATE TABLE items(id INTEGER PRIMARY KEY, created_at INTEGER NOT NULL)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (1, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (2, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (3, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (4, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (5, 300)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (6, 300)"
        },
        {
          "connection": "reader",
          "sql": "BEGIN"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "writer",
          "sql": "INSERT INTO items(id, created_at) VALUES (7, 400)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 3"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "reader",
          "sql": "COMMIT"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        }
      ]
    },
    {
      "case": "static_walk_and_boundaries",
      "walks": [
        {
          "page_size": 1,
          "visited_ids": [
            6,
            5,
            4,
            3,
            2,
            1
          ],
          "terminal_page": []
        },
        {
          "page_size": 3,
          "visited_ids": [
            6,
            5,
            4,
            3,
            2,
            1
          ],
          "terminal_page": []
        }
      ],
      "empty_first_page": [],
      "null_sort_key_rejected": true,
      "sql_trace": [
        {
          "connection": "reader",
          "sql": "PRAGMA journal_mode=WAL"
        },
        {
          "connection": "reader",
          "sql": "CREATE TABLE items(id INTEGER PRIMARY KEY, created_at INTEGER NOT NULL)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (1, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (2, 100)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (3, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (4, 200)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (5, 300)"
        },
        {
          "connection": "reader",
          "sql": "INSERT INTO items(id, created_at) VALUES (6, 300)"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 1 OFFSET 0"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (300, 6) ORDER BY created_at DESC, id DESC LIMIT 1"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (300, 5) ORDER BY created_at DESC, id DESC LIMIT 1"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (200, 4) ORDER BY created_at DESC, id DESC LIMIT 1"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (200, 3) ORDER BY created_at DESC, id DESC LIMIT 1"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (100, 2) ORDER BY created_at DESC, id DESC LIMIT 1"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (100, 1) ORDER BY created_at DESC, id DESC LIMIT 1"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (200, 4) ORDER BY created_at DESC, id DESC LIMIT 3"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items WHERE (created_at, id) < (100, 1) ORDER BY created_at DESC, id DESC LIMIT 3"
        },
        {
          "connection": "writer",
          "sql": "DELETE FROM items"
        },
        {
          "connection": "reader",
          "sql": "SELECT id, created_at FROM items ORDER BY created_at DESC, id DESC LIMIT 3 OFFSET 0"
        },
        {
          "connection": "writer",
          "sql": "INSERT INTO items(id, created_at) VALUES (99, NULL)"
        }
      ]
    }
  ],
  "status": "passed"
}
