{
  "title": "Imladri GCP Local SSD branchd isolation benchmark",
  "date": "2026-05-19",
  "host": {
    "provider": "GCP Compute Engine",
    "machine": "N2D standard 8 vCPU / 32 GiB RAM",
    "cpu": "AMD EPYC 7B13",
    "storage": "750 GiB striped Local SSD mounted as Btrfs",
    "sourceFixture": "1B-row Postgres source fixture"
  },
  "goal": "Separate prepared physical branch creation from first connection/query startup, steady branch query latency, psql process startup, branch-write pressure, async cleanup/refill behavior, branchd-side session pooling, and phased pool replenishment under 100-way contention.",
  "conclusion": [
    "Prepared branch create/lease stayed below 200ms p95 in the original pg benchmark runs, but first query startup was the tail.",
    "A warm second query on an already-open pg client measured 4ms p50 / 12.67ms p95, isolating the first-query startup cost.",
    "Adding branchd-side session pooling and preconnecting ready branches produced a clean read-only 100-way run with 82.3ms create p95, 77.16ms first-query p95, and 216.44ms wall time.",
    "The clean branchd event-write run kept 100/100 success, 0 deadlocks, 0 source mutations, and 99.92ms create p95; branch-local event writes were visible at 170.86ms p95 before the sustained-burst pass.",
    "A sustained 5x100 branchd event-insert run with targeted source probing, deferred Btrfs tombstones, and refill concurrency 16 completed 500/500 samples with 95.41ms create p95, 33.36ms first-query p95, 105.4ms branch-write p95, 10.62s ready-refill p95, 0 deadlocks, and 0 source mutations.",
    "Increasing refill concurrency to 32 regressed tails, and a larger 300-branch reserve overloaded the 8-vCPU node. Instrumentation showed the bottleneck was pipelining Btrfs snapshots, Postgres starts, and session preconnects at the same time.",
    "Phased pool warming fixed that refill bottleneck on this GCP Local SSD VM: the 5x100 run completed 500/500 samples with 91.13ms create p95, 28.67ms first-query p95, 95.6ms branch-write p95, 3.93s ready-refill p95, 0 deadlocks, and 0 source mutations."
  ],
  "runs": {
    "eventProbePg": {
      "ok": true,
      "checkedAt": "2026-05-19T22:25:01.903Z",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "sourceDatabaseSizeBytes": 99050380311,
      "sourceDatabaseSizeGiB": 92.25,
      "concurrency": 100,
      "samplesSucceeded": 100,
      "wallMs": 526.11,
      "queryRunner": "pg",
      "firstQuerySql": "select 1",
      "branchWriteMode": "event_probe",
      "branchWriteSql": null,
      "cleanupWaitMs": 600000,
      "cleanupPollMs": 10000,
      "summary": {
        "createMsP50": 142.61,
        "createMsP95": 149.14,
        "createMsMax": 150.15,
        "checkpointMsP50": 0,
        "checkpointMsP95": 0,
        "cloneMsP50": 0,
        "cloneMsP95": 0,
        "postgresStartMsP50": 0,
        "postgresStartMsP95": 0,
        "firstQueryMsP50": 175.99,
        "firstQueryMsP95": 242.55,
        "branchWriteMsP50": 115.75,
        "branchWriteMsP95": 151.45,
        "destroyMsP50": 49.03,
        "destroyMsP95": 112.68
      },
      "cleanupDrain": {
        "ok": true,
        "cleanupPending": 0,
        "durationMs": 200225.68
      },
      "sourceMutations": {
        "probeRowsBefore": 1000000000,
        "probeRowsAfter": 1000000000,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0
    },
    "noWritePg": {
      "ok": true,
      "checkedAt": "2026-05-19T22:38:14.805Z",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "sourceDatabaseSizeBytes": 99050380311,
      "sourceDatabaseSizeGiB": 92.25,
      "concurrency": 100,
      "samplesSucceeded": 100,
      "wallMs": 432.27,
      "queryRunner": "pg",
      "firstQuerySql": "select 1",
      "branchWriteMode": "skip",
      "branchWriteSql": null,
      "cleanupWaitMs": 600000,
      "cleanupPollMs": 10000,
      "summary": {
        "createMsP50": 145.85,
        "createMsP95": 175.77,
        "createMsMax": 177.01,
        "checkpointMsP50": 0,
        "checkpointMsP95": 0,
        "cloneMsP50": 0,
        "cloneMsP95": 0,
        "postgresStartMsP50": 0,
        "postgresStartMsP95": 0,
        "firstQueryMsP50": 195.5,
        "firstQueryMsP95": 236.94,
        "branchWriteMsP50": 0,
        "branchWriteMsP95": 0,
        "destroyMsP50": 41.88,
        "destroyMsP95": 150.03
      },
      "cleanupDrain": {
        "ok": true,
        "cleanupPending": 0,
        "durationMs": 210242.87
      },
      "sourceMutations": {
        "probeRowsBefore": 1000000000,
        "probeRowsAfter": 1000000000,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0
    },
    "warmSecondPg": {
      "ok": true,
      "checkedAt": "2026-05-19T22:43:53.747Z",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "sourceDatabaseSizeBytes": 99050380311,
      "sourceDatabaseSizeGiB": 92.25,
      "concurrency": 100,
      "samplesSucceeded": 100,
      "wallMs": 420.35,
      "queryRunner": "pg",
      "firstQuerySql": "select 1",
      "branchWriteMode": "custom",
      "branchWriteSql": true,
      "cleanupWaitMs": 600000,
      "cleanupPollMs": 10000,
      "summary": {
        "createMsP50": 117.95,
        "createMsP95": 128.67,
        "createMsMax": 130.77,
        "checkpointMsP50": 0,
        "checkpointMsP95": 0,
        "cloneMsP50": 0,
        "cloneMsP95": 0,
        "postgresStartMsP50": 0,
        "postgresStartMsP95": 0,
        "firstQueryMsP50": 210.45,
        "firstQueryMsP95": 247.88,
        "branchWriteMsP50": 4,
        "branchWriteMsP95": 12.67,
        "destroyMsP50": 42.85,
        "destroyMsP95": 111.07
      },
      "cleanupDrain": {
        "ok": true,
        "cleanupPending": 0,
        "durationMs": 210224.6
      },
      "sourceMutations": {
        "probeRowsBefore": 1000000000,
        "probeRowsAfter": 1000000000,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0
    },
    "noWritePsql": {
      "ok": true,
      "checkedAt": "2026-05-19T22:49:18.793Z",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "sourceDatabaseSizeBytes": 99050380311,
      "sourceDatabaseSizeGiB": 92.25,
      "concurrency": 100,
      "samplesSucceeded": 100,
      "wallMs": 1038.84,
      "queryRunner": "psql",
      "firstQuerySql": "select 1",
      "branchWriteMode": "skip",
      "branchWriteSql": null,
      "cleanupWaitMs": 600000,
      "cleanupPollMs": 10000,
      "summary": {
        "createMsP50": 396.95,
        "createMsP95": 775.77,
        "createMsMax": 824.53,
        "checkpointMsP50": 0,
        "checkpointMsP95": 0,
        "cloneMsP50": 0,
        "cloneMsP95": 0,
        "postgresStartMsP50": 0,
        "postgresStartMsP95": 0,
        "firstQueryMsP50": 542.08,
        "firstQueryMsP95": 827.58,
        "branchWriteMsP50": 0,
        "branchWriteMsP95": 0,
        "destroyMsP50": 24.8,
        "destroyMsP95": 76.51
      },
      "cleanupDrain": {
        "ok": true,
        "cleanupPending": 0,
        "durationMs": 200221.75
      },
      "sourceMutations": {
        "probeRowsBefore": 1000000000,
        "probeRowsAfter": 1000000000,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0
    },
    "branchdSessionReadyEventProbe": {
      "ok": true,
      "checkedAt": "2026-05-19T23:55:48.264Z",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "sourceDatabaseSizeBytes": 99050380311,
      "concurrency": 100,
      "samplesSucceeded": 100,
      "wallMs": 423.54,
      "queryRunner": "branchd",
      "firstQuerySql": "select 1",
      "branchWriteMode": "event_probe",
      "cleanupWaitMs": 240000,
      "cleanupPollMs": 5000,
      "summary": {
        "createMsP50": 81.85,
        "createMsP95": 99.92,
        "createMsMax": 100.3,
        "checkpointMsP50": 0,
        "checkpointMsP95": 0,
        "cloneMsP50": 0,
        "cloneMsP95": 0,
        "postgresStartMsP50": 0,
        "postgresStartMsP95": 0,
        "firstQueryMsP50": 104.25,
        "firstQueryMsP95": 117.43,
        "firstQueryServerMsP50": 70.46,
        "firstQueryServerMsP95": 81.64,
        "branchWriteMsP50": 111.41,
        "branchWriteMsP95": 170.86,
        "branchWriteServerMsP50": 78.28,
        "branchWriteServerMsP95": 106.06,
        "destroyMsP50": 82.12,
        "destroyMsP95": 105.33
      },
      "cleanupDrain": {
        "ok": true,
        "cleanupPending": 0,
        "durationMs": 160271.82
      },
      "sourceMutations": {
        "probeRowsBefore": 1000000000,
        "probeRowsAfter": 1000000000,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0
    },
    "branchdSessionReadyReadOnly": {
      "ok": true,
      "checkedAt": "2026-05-20T00:00:22.369Z",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "sourceDatabaseSizeBytes": 99050380311,
      "concurrency": 100,
      "samplesSucceeded": 100,
      "wallMs": 216.44,
      "queryRunner": "branchd",
      "firstQuerySql": "select 1",
      "branchWriteMode": "skip",
      "cleanupWaitMs": 240000,
      "cleanupPollMs": 5000,
      "summary": {
        "createMsP50": 77.47,
        "createMsP95": 82.3,
        "createMsMax": 82.93,
        "checkpointMsP50": 0,
        "checkpointMsP95": 0,
        "cloneMsP50": 0,
        "cloneMsP95": 0,
        "postgresStartMsP50": 0,
        "postgresStartMsP95": 0,
        "firstQueryMsP50": 68.32,
        "firstQueryMsP95": 77.16,
        "firstQueryServerMsP50": 40.24,
        "firstQueryServerMsP95": 50.07,
        "branchWriteMsP50": 0,
        "branchWriteMsP95": 0,
        "branchWriteServerMsP50": 0,
        "branchWriteServerMsP95": 0,
        "destroyMsP50": 64.3,
        "destroyMsP95": 76.88
      },
      "cleanupDrain": {
        "ok": true,
        "cleanupPending": 0,
        "durationMs": 140239.64
      },
      "sourceMutations": {
        "probeRowsBefore": 1000000000,
        "probeRowsAfter": 1000000000,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0
    },
    "pgReadOnlyAfterSessionReady": {
      "ok": true,
      "checkedAt": "2026-05-20T00:04:56.890Z",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "sourceDatabaseSizeBytes": 99050380311,
      "concurrency": 100,
      "samplesSucceeded": 100,
      "wallMs": 288.86,
      "queryRunner": "pg",
      "firstQuerySql": "select 1",
      "branchWriteMode": "skip",
      "cleanupWaitMs": 240000,
      "cleanupPollMs": 5000,
      "summary": {
        "createMsP50": 141.52,
        "createMsP95": 149.36,
        "createMsMax": 150.08,
        "checkpointMsP50": 0,
        "checkpointMsP95": 0,
        "cloneMsP50": 0,
        "cloneMsP95": 0,
        "postgresStartMsP50": 0,
        "postgresStartMsP95": 0,
        "firstQueryMsP50": 75.45,
        "firstQueryMsP95": 98.58,
        "firstQueryServerMsP50": 0,
        "firstQueryServerMsP95": 0,
        "branchWriteMsP50": 0,
        "branchWriteMsP95": 0,
        "branchWriteServerMsP50": 0,
        "branchWriteServerMsP95": 0,
        "destroyMsP50": 53.43,
        "destroyMsP95": 70.27
      },
      "cleanupDrain": {
        "ok": true,
        "cleanupPending": 0,
        "durationMs": 145236.43
      },
      "sourceMutations": {
        "probeRowsBefore": 1000000000,
        "probeRowsAfter": 1000000000,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0
    },
    "sustainedDeferredDeleteRefill16": {
      "ok": true,
      "checkedAt": "2026-05-20T15:27:50.797Z",
      "label": "sustained branchd event insert with deferred Btrfs delete and refill concurrency 16",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "concurrency": 100,
      "burstCount": 5,
      "totalSamples": 500,
      "samplesSucceeded": 500,
      "branchWriteMode": "event_insert",
      "queryRunner": "branchd",
      "firstQuerySql": "select 1",
      "sourceProbeDatabaseSize": false,
      "sourceMutationCheck": "targeted event table count before/after",
      "refillConcurrency": 16,
      "deferredBtrfsDelete": true,
      "summary": {
        "burstsSucceeded": 5,
        "failedBursts": 0,
        "deadlockErrors": 0,
        "sourceMutationBursts": 0,
        "burstWallMsP50": 296.92,
        "burstWallMsP95": 308.41,
        "readyWaitMsP50": 8450.78,
        "readyWaitMsP95": 10623.06,
        "readyWaitMsMax": 10623.06,
        "createMsP50": 86.45,
        "createMsP95": 95.41,
        "firstQueryMsP50": 25.08,
        "firstQueryMsP95": 33.36,
        "branchWriteMsP50": 70.38,
        "branchWriteMsP95": 105.4,
        "branchWriteServerMsP50": 43.17,
        "branchWriteServerMsP95": 82.12,
        "destroyMsP50": 75.75,
        "destroyMsP95": 112.05,
        "perBurstCreateP95Min": 88.44,
        "perBurstCreateP95Max": 98.32,
        "perBurstFirstQueryP95Min": 25.96,
        "perBurstFirstQueryP95Max": 34,
        "perBurstBranchWriteP95Min": 77.99,
        "perBurstBranchWriteP95Max": 109.74
      },
      "finalReady": {
        "ok": true,
        "label": "final drain",
        "waitMs": 8537.16,
        "attempts": 5,
        "probe": {
          "ok": true,
          "provider": "imladri_btrfs_subvolume_branchd",
          "providerReady": true,
          "canRunPhysicalSnapshot": true,
          "poolReady": 100,
          "poolWarming": 0,
          "poolTargetCount": 100,
          "poolAutoRefill": true,
          "poolRefillBatchSize": 100,
          "poolRefillDelayMs": 1000,
          "poolRefillLeaseDelayMs": 1000,
          "poolRefillContinueDelayMs": 1000,
          "poolRefillConcurrency": 16,
          "poolAdmissionWaitMs": 60000,
          "poolWarmingStaleMs": 120000,
          "residentState": true,
          "stateFlushDelayMs": 25,
          "cleanupPending": 0,
          "cleanupQueueDepth": 0,
          "cleanupInFlight": 0,
          "cleanupConcurrency": 8,
          "deferBtrfsDelete": true,
          "deferredBtrfsDeleteDelayMs": 3600000,
          "deferredBtrfsDeleteQueueDepth": 0,
          "deferredBtrfsDeleteInFlight": 0,
          "deferredBtrfsDeleteScheduled": 500,
          "deferredBtrfsDeleteConcurrency": 1,
          "btrfsTrashRoot": "/mnt/localssd/branches/.imladri-branch-trash-refill16-20260520-152630",
          "readQueryConcurrency": 0,
          "readQueryActive": 0,
          "readQueryQueued": 0,
          "writeQueryConcurrency": 0,
          "writeQueryActive": 0,
          "writeQueryQueued": 0,
          "staleReady": 0,
          "asyncDestroy": true,
          "cleanupStartDelayMs": 1000,
          "postgresStopMode": "immediate",
          "postgresTuningMode": "ephemeral",
          "sessionPoolEnabled": true,
          "sessionDriver": "client",
          "sessionPreconnectReady": true,
          "sessionPreconnectOnLease": false,
          "sessionPoolMax": 1,
          "sessionCloseTimeoutMs": 1000,
          "sessionPoolsOpen": 100
        }
      },
      "sourceMutations": {
        "checkedTables": [
          "events"
        ],
        "probeRowsBefore": 0,
        "probeRowsAfter": 0,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0,
      "burstOutputs": [
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill16-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152630-burst-01.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill16-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152630-burst-02.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill16-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152630-burst-03.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill16-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152630-burst-04.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill16-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152630-burst-05.json"
      ]
    },
    "sustainedDeferredDeleteRefill32": {
      "ok": true,
      "checkedAt": "2026-05-20T15:29:24.846Z",
      "label": "diagnostic sustained branchd event insert with refill concurrency 32",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "concurrency": 100,
      "burstCount": 5,
      "totalSamples": 500,
      "samplesSucceeded": 500,
      "branchWriteMode": "event_insert",
      "queryRunner": "branchd",
      "firstQuerySql": "select 1",
      "sourceProbeDatabaseSize": false,
      "sourceMutationCheck": "targeted event table count before/after",
      "refillConcurrency": 32,
      "deferredBtrfsDelete": true,
      "summary": {
        "burstsSucceeded": 5,
        "failedBursts": 0,
        "deadlockErrors": 0,
        "sourceMutationBursts": 0,
        "burstWallMsP50": 312.77,
        "burstWallMsP95": 379.12,
        "readyWaitMsP50": 8529.16,
        "readyWaitMsP95": 12712.56,
        "readyWaitMsMax": 12712.56,
        "createMsP50": 97.39,
        "createMsP95": 171.36,
        "firstQueryMsP50": 26.35,
        "firstQueryMsP95": 35.15,
        "branchWriteMsP50": 81.96,
        "branchWriteMsP95": 108.71,
        "branchWriteServerMsP50": 61.56,
        "branchWriteServerMsP95": 85.23,
        "destroyMsP50": 71.27,
        "destroyMsP95": 120.04,
        "perBurstCreateP95Min": 96.81,
        "perBurstCreateP95Max": 172.9,
        "perBurstFirstQueryP95Min": 24.75,
        "perBurstFirstQueryP95Max": 38.74,
        "perBurstBranchWriteP95Min": 93.77,
        "perBurstBranchWriteP95Max": 114.23
      },
      "finalReady": {
        "ok": true,
        "label": "final drain",
        "waitMs": 8456.69,
        "attempts": 5,
        "probe": {
          "ok": true,
          "provider": "imladri_btrfs_subvolume_branchd",
          "providerReady": true,
          "canRunPhysicalSnapshot": true,
          "poolReady": 100,
          "poolWarming": 0,
          "poolTargetCount": 100,
          "poolAutoRefill": true,
          "poolRefillBatchSize": 100,
          "poolRefillDelayMs": 1000,
          "poolRefillLeaseDelayMs": 1000,
          "poolRefillContinueDelayMs": 1000,
          "poolRefillConcurrency": 32,
          "poolAdmissionWaitMs": 60000,
          "poolWarmingStaleMs": 120000,
          "residentState": true,
          "stateFlushDelayMs": 25,
          "cleanupPending": 0,
          "cleanupQueueDepth": 0,
          "cleanupInFlight": 0,
          "cleanupConcurrency": 8,
          "deferBtrfsDelete": true,
          "deferredBtrfsDeleteDelayMs": 3600000,
          "deferredBtrfsDeleteQueueDepth": 0,
          "deferredBtrfsDeleteInFlight": 0,
          "deferredBtrfsDeleteScheduled": 500,
          "deferredBtrfsDeleteConcurrency": 1,
          "btrfsTrashRoot": "/mnt/localssd/branches/.imladri-branch-trash-refill32-20260520-152828",
          "readQueryConcurrency": 0,
          "readQueryActive": 0,
          "readQueryQueued": 0,
          "writeQueryConcurrency": 0,
          "writeQueryActive": 0,
          "writeQueryQueued": 0,
          "staleReady": 0,
          "asyncDestroy": true,
          "cleanupStartDelayMs": 1000,
          "postgresStopMode": "immediate",
          "postgresTuningMode": "ephemeral",
          "sessionPoolEnabled": true,
          "sessionDriver": "client",
          "sessionPreconnectReady": true,
          "sessionPreconnectOnLease": false,
          "sessionPoolMax": 1,
          "sessionCloseTimeoutMs": 1000,
          "sessionPoolsOpen": 100
        }
      },
      "sourceMutations": {
        "checkedTables": [
          "events"
        ],
        "probeRowsBefore": 0,
        "probeRowsAfter": 0,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "deadlockErrors": 0,
      "burstOutputs": [
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill32-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152828-burst-01.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill32-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152828-burst-02.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill32-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152828-burst-03.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill32-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152828-burst-04.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-refill32-select1-targeted-source-probe-event-insert-bursts-hot-5x100-20260520-152828-burst-05.json"
      ]
    },
    "sustainedPhasedRefill16": {
      "ok": true,
      "checkedAt": "2026-05-20T16:22:12.803Z",
      "label": "sustained branchd event insert with phased pool warming, deferred Btrfs delete, and refill concurrency 16",
      "provider": "imladri_btrfs_subvolume_branchd",
      "sourceRows": 1000000000,
      "concurrency": 100,
      "burstCount": 5,
      "totalSamples": 500,
      "samplesSucceeded": 500,
      "branchWriteMode": "event_insert",
      "queryRunner": "branchd",
      "firstQuerySql": "select 1",
      "sourceProbeDatabaseSize": false,
      "sourceMutationCheck": "targeted event table count before/after",
      "refillConcurrency": 16,
      "poolWarmPhased": true,
      "poolStartConcurrency": 16,
      "poolPreconnectConcurrency": 16,
      "deferredBtrfsDelete": true,
      "summary": {
        "burstsSucceeded": 5,
        "failedBursts": 0,
        "deadlockErrors": 0,
        "sourceMutationBursts": 0,
        "burstWallMsP50": 281.02,
        "burstWallMsP95": 326.71,
        "readyWaitMsP50": 3822.64,
        "readyWaitMsP95": 3934.51,
        "readyWaitMsMax": 3934.51,
        "createMsP50": 83.28,
        "createMsP95": 91.13,
        "firstQueryMsP50": 26.06,
        "firstQueryMsP95": 28.67,
        "branchWriteMsP50": 81.96,
        "branchWriteMsP95": 95.6,
        "branchWriteServerMsP50": 56.45,
        "branchWriteServerMsP95": 70.06,
        "destroyMsP50": 71.67,
        "destroyMsP95": 122.9,
        "perBurstCreateP95Min": 85.35,
        "perBurstCreateP95Max": 95.33,
        "perBurstFirstQueryP95Min": 26.67,
        "perBurstFirstQueryP95Max": 28.85,
        "perBurstBranchWriteP95Min": 86.34,
        "perBurstBranchWriteP95Max": 123.15
      },
      "finalReady": {
        "ok": true,
        "label": "final drain",
        "waitMs": 4227.07,
        "attempts": 27,
        "probe": {
          "ok": true,
          "provider": "imladri_btrfs_subvolume_branchd",
          "providerReady": true,
          "canRunPhysicalSnapshot": true,
          "poolReady": 100,
          "poolWarming": 0,
          "poolTargetCount": 100,
          "poolAutoRefill": true,
          "poolRefillBatchSize": 100,
          "poolRefillDelayMs": 0,
          "poolRefillLeaseDelayMs": 0,
          "poolRefillContinueDelayMs": 0,
          "poolRefillConcurrency": 16,
          "poolWarmPhased": true,
          "poolStartConcurrency": 16,
          "poolPreconnectConcurrency": 16,
          "poolAdmissionWaitMs": 60000,
          "poolWarmingStaleMs": 120000,
          "residentState": true,
          "stateFlushDelayMs": 25,
          "cleanupPending": 0,
          "cleanupQueueDepth": 0,
          "cleanupInFlight": 0,
          "cleanupConcurrency": 8,
          "deferBtrfsDelete": true,
          "deferredBtrfsDeleteDelayMs": 3600000,
          "deferredBtrfsDeleteQueueDepth": 0,
          "deferredBtrfsDeleteInFlight": 0,
          "deferredBtrfsDeleteScheduled": 500,
          "deferredBtrfsDeleteConcurrency": 1,
          "btrfsTrashRoot": "/mnt/localssd/branches/.imladri-branch-trash-phased-refill16-20260520-162146",
          "readQueryConcurrency": 0,
          "readQueryActive": 0,
          "readQueryQueued": 0,
          "writeQueryConcurrency": 0,
          "writeQueryActive": 0,
          "writeQueryQueued": 0,
          "staleReady": 0,
          "asyncDestroy": true,
          "cleanupStartDelayMs": 1000,
          "postgresStopMode": "immediate",
          "postgresTuningMode": "ephemeral",
          "sessionPoolEnabled": true,
          "sessionDriver": "client",
          "sessionPreconnectReady": true,
          "sessionPreconnectOnLease": false,
          "sessionPoolMax": 1,
          "sessionCloseTimeoutMs": 1000,
          "sessionPoolsOpen": 100
        }
      },
      "sourceMutations": {
        "checkedTables": [
          "events"
        ],
        "probeRowsBefore": 0,
        "probeRowsAfter": 0,
        "writeProbeRowsBefore": 0,
        "writeProbeRowsAfter": 0,
        "eventProbeRowsBefore": 0,
        "eventProbeRowsAfter": 0,
        "changed": false
      },
      "sourceMutationBursts": 0,
      "deadlockErrors": 0,
      "burstOutputs": [
        "/opt/imladri/tmp/benchmarks/gcp-branchd-phased-refill16-select1-event-insert-bursts-hot-5x100-20260520-162146-burst-01.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-phased-refill16-select1-event-insert-bursts-hot-5x100-20260520-162146-burst-02.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-phased-refill16-select1-event-insert-bursts-hot-5x100-20260520-162146-burst-03.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-phased-refill16-select1-event-insert-bursts-hot-5x100-20260520-162146-burst-04.json",
        "/opt/imladri/tmp/benchmarks/gcp-branchd-phased-refill16-select1-event-insert-bursts-hot-5x100-20260520-162146-burst-05.json"
      ]
    }
  },
  "diagnostics": {
    "branchdSessionPreconnectOnLease": {
      "note": "Diagnostic only: preconnecting on lease lowered first-query p95 to 23.05ms, but moved connection startup into create/lease and did not drain cleanup before the shorter benchmark deadline. Post-run branchd probe later showed cleanupPending=0 and poolReady=100.",
      "run": {
        "ok": false,
        "checkedAt": "2026-05-19T23:44:50.621Z",
        "provider": "imladri_btrfs_subvolume_branchd",
        "sourceRows": 1000000000,
        "sourceDatabaseSizeBytes": 99050380311,
        "concurrency": 100,
        "samplesSucceeded": 100,
        "wallMs": 456.63,
        "queryRunner": "branchd",
        "firstQuerySql": "select 1",
        "branchWriteMode": "custom",
        "cleanupWaitMs": 90000,
        "cleanupPollMs": 5000,
        "summary": {
          "createMsP50": 328.54,
          "createMsP95": 336.07,
          "createMsMax": 337.07,
          "checkpointMsP50": 0,
          "checkpointMsP95": 0,
          "cloneMsP50": 0,
          "cloneMsP95": 0,
          "postgresStartMsP50": 0,
          "postgresStartMsP95": 0,
          "firstQueryMsP50": 22.12,
          "firstQueryMsP95": 23.05,
          "firstQueryServerMsP50": 4.49,
          "firstQueryServerMsP95": 6.18,
          "branchWriteMsP50": 16.06,
          "branchWriteMsP95": 27.39,
          "branchWriteServerMsP50": 0.48,
          "branchWriteServerMsP95": 1.27,
          "destroyMsP50": 77.65,
          "destroyMsP95": 88.69
        },
        "cleanupDrain": {
          "ok": false,
          "cleanupPending": 36,
          "durationMs": 90175.04
        },
        "sourceMutations": {
          "probeRowsBefore": 1000000000,
          "probeRowsAfter": 1000000000,
          "writeProbeRowsBefore": 0,
          "writeProbeRowsAfter": 0,
          "eventProbeRowsBefore": 0,
          "eventProbeRowsAfter": 0,
          "changed": false
        },
        "deadlockErrors": 0
      }
    },
    "targetedSourceProbe": {
      "note": "The event-insert sustained benchmark checks only the source event table before and after the run. A prior generic source probe counted unrelated legacy probe tables and became benchmark overhead on the large fixture. Each branch-write mode now needs its matching source-mutation probe.",
      "implementedIn": "scripts/db-branch-providers/benchmark-imladri-postgres-snapshot-concurrency.mjs"
    },
    "deferredBtrfsDelete": {
      "note": "Btrfs subvolume deletion is deferred by renaming retired branch directories into a tombstone root and scheduling physical delete outside the branch destroy hot path. The branchd trash-requeue command is idempotent and skips already scheduled tombstones.",
      "implementedIn": "scripts/db-branch-providers/imladri-postgres-snapshot-provider.mjs"
    }
  }
}
