{
  "schemaVersion": 1,
  "kind": "measured-software-behavior",
  "generatedAt": "2026-10-14T07:22:13.886933+00:00",
  "title": "SQLite rollback-journal lifecycle: process-exit observations",
  "scriptSha256": "7bf90246ff8fd97eb8de979688e1bc536f53f2dff660ab7806813e80cc7d0511",
  "environment": {
    "python": "3.12.3",
    "sqlite": "3.45.1",
    "sqliteSourceId": "2024-01-30 16:01:20 e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257ccalt1",
    "sqliteCompileOptions": [
      "ATOMIC_INTRINSICS=1",
      "COMPILER=gcc-13.3.0",
      "DEFAULT_AUTOVACUUM",
      "DEFAULT_CACHE_SIZE=-2000",
      "DEFAULT_FILE_FORMAT=4",
      "DEFAULT_JOURNAL_SIZE_LIMIT=-1",
      "DEFAULT_MMAP_SIZE=0",
      "DEFAULT_PAGE_SIZE=4096",
      "DEFAULT_PCACHE_INITSZ=20",
      "DEFAULT_RECURSIVE_TRIGGERS",
      "DEFAULT_SECTOR_SIZE=4096",
      "DEFAULT_SYNCHRONOUS=2",
      "DEFAULT_WAL_AUTOCHECKPOINT=1000",
      "DEFAULT_WAL_SYNCHRONOUS=2",
      "DEFAULT_WORKER_THREADS=0",
      "DIRECT_OVERFLOW_READ",
      "ENABLE_COLUMN_METADATA",
      "ENABLE_DBSTAT_VTAB",
      "ENABLE_FTS3",
      "ENABLE_FTS3_PARENTHESIS",
      "ENABLE_FTS3_TOKENIZER",
      "ENABLE_FTS4",
      "ENABLE_FTS5",
      "ENABLE_LOAD_EXTENSION",
      "ENABLE_MATH_FUNCTIONS",
      "ENABLE_PREUPDATE_HOOK",
      "ENABLE_RTREE",
      "ENABLE_SESSION",
      "ENABLE_STMTVTAB",
      "ENABLE_UNLOCK_NOTIFY",
      "ENABLE_UPDATE_DELETE_LIMIT",
      "HAVE_ISNAN",
      "LIKE_DOESNT_MATCH_BLOBS",
      "MALLOC_SOFT_LIMIT=1024",
      "MAX_ATTACHED=10",
      "MAX_COLUMN=2000",
      "MAX_COMPOUND_SELECT=500",
      "MAX_DEFAULT_PAGE_SIZE=32768",
      "MAX_EXPR_DEPTH=1000",
      "MAX_FUNCTION_ARG=127",
      "MAX_LENGTH=1000000000",
      "MAX_LIKE_PATTERN_LENGTH=50000",
      "MAX_MMAP_SIZE=0x7fff0000",
      "MAX_PAGE_COUNT=0xfffffffe",
      "MAX_PAGE_SIZE=65536",
      "MAX_SCHEMA_RETRY=25",
      "MAX_SQL_LENGTH=1000000000",
      "MAX_TRIGGER_DEPTH=1000",
      "MAX_VARIABLE_NUMBER=250000",
      "MAX_VDBE_OP=250000000",
      "MAX_WORKER_THREADS=8",
      "MUTEX_PTHREADS",
      "SECURE_DELETE",
      "SOUNDEX",
      "SYSTEM_MALLOC",
      "TEMP_STORE=1",
      "THREADSAFE=1",
      "USE_URI"
    ],
    "os": "Linux",
    "kernel": "6.8.0-146-generic",
    "architecture": "x86_64",
    "statfsTypeLabel": "ext2/ext3"
  },
  "workload": {
    "rowsPerCase": 256,
    "payloadBytesPerRow": 2048,
    "initialPayload": "A",
    "updatedPayload": "B",
    "randomness": "none",
    "independentDatabasePerCase": true
  },
  "caseCount": 5,
  "observations": [
    {
      "case": "delete-committed",
      "writerCommitted": true,
      "writerExitCode": 0,
      "settings": {
        "journalMode": "delete",
        "synchronous": 2,
        "pageSizeBytes": 4096,
        "cacheSizePages": 8,
        "cacheSpill": 8
      },
      "databaseBytesChangedBeforeRead": true,
      "updatedPayloadBytesPresentBeforeRead": true,
      "recoveryConnectionJournalMode": "delete",
      "journalBeforeRecoveryRead": {
        "exists": false,
        "sizeBytes": 0,
        "prefixHex": null
      },
      "journalAfterRecoveryRead": {
        "exists": false,
        "sizeBytes": 0,
        "prefixHex": null
      },
      "rowCount": 256,
      "rowPayloadBytes": 2048,
      "visiblePayload": "B",
      "allRowsMatchOracle": true,
      "integrityCheck": "ok"
    },
    {
      "case": "truncate-committed",
      "writerCommitted": true,
      "writerExitCode": 0,
      "settings": {
        "journalMode": "truncate",
        "synchronous": 2,
        "pageSizeBytes": 4096,
        "cacheSizePages": 8,
        "cacheSpill": 8
      },
      "databaseBytesChangedBeforeRead": true,
      "updatedPayloadBytesPresentBeforeRead": true,
      "recoveryConnectionJournalMode": "delete",
      "journalBeforeRecoveryRead": {
        "exists": true,
        "sizeBytes": 0,
        "prefixHex": ""
      },
      "journalAfterRecoveryRead": {
        "exists": true,
        "sizeBytes": 0,
        "prefixHex": ""
      },
      "rowCount": 256,
      "rowPayloadBytes": 2048,
      "visiblePayload": "B",
      "allRowsMatchOracle": true,
      "integrityCheck": "ok"
    },
    {
      "case": "persist-committed",
      "writerCommitted": true,
      "writerExitCode": 0,
      "settings": {
        "journalMode": "persist",
        "synchronous": 2,
        "pageSizeBytes": 4096,
        "cacheSizePages": 8,
        "cacheSpill": 8
      },
      "databaseBytesChangedBeforeRead": true,
      "updatedPayloadBytesPresentBeforeRead": true,
      "recoveryConnectionJournalMode": "delete",
      "journalBeforeRecoveryRead": {
        "exists": true,
        "sizeBytes": 1105424,
        "prefixHex": "0000000000000000"
      },
      "journalAfterRecoveryRead": {
        "exists": true,
        "sizeBytes": 1105424,
        "prefixHex": "0000000000000000"
      },
      "rowCount": 256,
      "rowPayloadBytes": 2048,
      "visiblePayload": "B",
      "allRowsMatchOracle": true,
      "integrityCheck": "ok"
    },
    {
      "case": "delete-uncommitted-exit",
      "writerCommitted": false,
      "writerExitCode": 23,
      "settings": {
        "journalMode": "delete",
        "synchronous": 2,
        "pageSizeBytes": 4096,
        "cacheSizePages": 8,
        "cacheSpill": 8
      },
      "databaseBytesChangedBeforeRead": true,
      "updatedPayloadBytesPresentBeforeRead": true,
      "recoveryConnectionJournalMode": "delete",
      "journalBeforeRecoveryRead": {
        "exists": true,
        "sizeBytes": 1101320,
        "prefixHex": "d9d505f920a163d7"
      },
      "journalAfterRecoveryRead": {
        "exists": false,
        "sizeBytes": 0,
        "prefixHex": null
      },
      "rowCount": 256,
      "rowPayloadBytes": 2048,
      "visiblePayload": "A",
      "allRowsMatchOracle": true,
      "integrityCheck": "ok"
    },
    {
      "case": "persist-uncommitted-exit",
      "writerCommitted": false,
      "writerExitCode": 23,
      "settings": {
        "journalMode": "persist",
        "synchronous": 2,
        "pageSizeBytes": 4096,
        "cacheSizePages": 8,
        "cacheSpill": 8
      },
      "databaseBytesChangedBeforeRead": true,
      "updatedPayloadBytesPresentBeforeRead": true,
      "recoveryConnectionJournalMode": "delete",
      "journalBeforeRecoveryRead": {
        "exists": true,
        "sizeBytes": 1101320,
        "prefixHex": "d9d505f920a163d7"
      },
      "journalAfterRecoveryRead": {
        "exists": false,
        "sizeBytes": 0,
        "prefixHex": null
      },
      "rowCount": 256,
      "rowPayloadBytes": 2048,
      "visiblePayload": "A",
      "allRowsMatchOracle": true,
      "integrityCheck": "ok"
    }
  ],
  "limits": [
    "Deterministic synthetic workload, actual local observations; not fleet data.",
    "os._exit terminates the writer without SQLite close or rollback; the OS and its caches remain alive.",
    "No power loss, kernel crash, torn sector, I/O fault injection or device flush verification.",
    "Single database only: no ATTACH, super-journal or cross-file atomicity experiment.",
    "One installed SQLite build and filesystem; no failure probability or performance estimate.",
    "Eight-byte journal prefix is an observation, not a complete hot-journal validator."
  ],
  "sources": [
    "https://sqlite.org/atomiccommit.html",
    "https://sqlite.org/lockingv3.html",
    "https://sqlite.org/pragma.html#pragma_journal_mode"
  ],
  "reproduce": "python3 sqlite-journal-observation.py --work-root . --output result.json"
}
