{
  "schemaVersion": 1,
  "title": "Constructed crash-state examples for three distinct writes",
  "updated": "2026-11-12",
  "evidenceType": "original deterministic teaching model",
  "humanPage": "https://hesela.com/analyses/ssd-mapping-cache-hmb/#crash-contracts",
  "codeUrl": "https://hesela.com/research/crash-contracts.mjs",
  "assumptionsApplyTo": "rows",
  "assumptions": [
    "Start from a successfully flushed [0,0,0]; three ordered requests set distinct sectors A, B, C to 1.",
    "Each request changes one sector atomically. No overlap, tearing, concurrent submissions or media errors.",
    "No additional completed flush occurs; in-flight refers to the final flush after all three writes.",
    "All writes fit within the research design's write bound.",
    "State enumeration gives possibilities, not probabilities; physical programming order is not modeled."
  ],
  "sources": [
    {
      "id": "optr",
      "url": "https://files.usenix.org/s3fs-public/cdn/atc19-chang_0.pdf",
      "locator": "Introduction; sections 3.2 and 3.5, Algorithm 1; sections 5-7",
      "accessed": "2026-11-12"
    },
    {
      "id": "scftl",
      "url": "https://www.usenix.org/system/files/osdi20-chang.pdf",
      "locator": "Sections 3.2-3.4, 4.1/Figure 4, 6-7",
      "accessed": "2026-10-15"
    }
  ],
  "limits": [
    "Not OPTR or SCFTL implementation, verification, performance reproduction, or retail-device qualification.",
    "Unordered is a specified toy model, not a claim that all real SSDs allow exactly these states.",
    "An in-flight snapshot flush may recover the old or the complete new state.",
    "No sampling or measured failure rate; confidence intervals do not apply."
  ],
  "rows": [
    {
      "contract": "unordered",
      "flush": "not-started",
      "stateCount": 8,
      "states": [
        [
          0,
          0,
          0
        ],
        [
          1,
          0,
          0
        ],
        [
          0,
          1,
          0
        ],
        [
          1,
          1,
          0
        ],
        [
          0,
          0,
          1
        ],
        [
          1,
          0,
          1
        ],
        [
          0,
          1,
          1
        ],
        [
          1,
          1,
          1
        ]
      ]
    },
    {
      "contract": "unordered",
      "flush": "in-flight",
      "stateCount": 8,
      "states": [
        [
          0,
          0,
          0
        ],
        [
          1,
          0,
          0
        ],
        [
          0,
          1,
          0
        ],
        [
          1,
          1,
          0
        ],
        [
          0,
          0,
          1
        ],
        [
          1,
          0,
          1
        ],
        [
          0,
          1,
          1
        ],
        [
          1,
          1,
          1
        ]
      ]
    },
    {
      "contract": "unordered",
      "flush": "completed",
      "stateCount": 1,
      "states": [
        [
          1,
          1,
          1
        ]
      ]
    },
    {
      "contract": "prefix",
      "flush": "not-started",
      "stateCount": 4,
      "states": [
        [
          0,
          0,
          0
        ],
        [
          1,
          0,
          0
        ],
        [
          1,
          1,
          0
        ],
        [
          1,
          1,
          1
        ]
      ]
    },
    {
      "contract": "prefix",
      "flush": "in-flight",
      "stateCount": 4,
      "states": [
        [
          0,
          0,
          0
        ],
        [
          1,
          0,
          0
        ],
        [
          1,
          1,
          0
        ],
        [
          1,
          1,
          1
        ]
      ]
    },
    {
      "contract": "prefix",
      "flush": "completed",
      "stateCount": 1,
      "states": [
        [
          1,
          1,
          1
        ]
      ]
    },
    {
      "contract": "snapshot",
      "flush": "not-started",
      "stateCount": 1,
      "states": [
        [
          0,
          0,
          0
        ]
      ]
    },
    {
      "contract": "snapshot",
      "flush": "in-flight",
      "stateCount": 2,
      "states": [
        [
          0,
          0,
          0
        ],
        [
          1,
          1,
          1
        ]
      ]
    },
    {
      "contract": "snapshot",
      "flush": "completed",
      "stateCount": 1,
      "states": [
        [
          1,
          1,
          1
        ]
      ]
    }
  ],
  "coalescingExample": {
    "input": {
      "writeCount": 4,
      "incomplete": [
        3
      ],
      "coalesced": [
        [
          1,
          4
        ]
      ]
    },
    "scope": "Four requests after a durable checkpoint, no later completed flush; supplied dependencies, not a page-level FTL execution.",
    "ignoringCoalescing": [
      0,
      1,
      2
    ],
    "respectingCoalescing": [
      0
    ]
  }
}
