{
  "schemaVersion": 1,
  "id": "atlas-lesson-device-completion-reset-epochs",
  "title": "Completion, reset and execution epochs",
  "category": "learning",
  "format": "Atlas lesson",
  "description": "Separate physical work, accepted completion and useful output while a device is stopped and reinitialized.",
  "canonicalUrl": "https://semiaifoundry.com/learn/atlas/device-completion-reset-epochs/",
  "publishedDate": null,
  "revisionDate": "2026-10-07",
  "author": null,
  "topic": "Executable software",
  "series": null,
  "license": null,
  "rightsUrl": "https://semiaifoundry.com/ai-atlas/licenses.html",
  "version": "1.3.0",
  "status": "Published educational lesson",
  "evidenceScope": "Primary sources establish the cited runtime mechanisms. Numerical values, address ranges, ABI strings, event schedule and reset/retry epochs are authored teaching contracts. No real device, firmware image, operating-system driver, page table, cache protocol or security verification is executed.",
  "contentCoverage": "published-lesson",
  "artifactUrl": "https://semiaifoundry.com/ai-atlas/lesson-data/device-completion-reset-epochs-25590d0d23232447.json",
  "interactiveUrl": "https://semiaifoundry.com/ai-atlas/#device-completion-reset-epochs",
  "related": [],
  "supersedes": [],
  "supersededBy": [],
  "contentHash": "e81f923527108d8e70cab8e1ced5d8174f122ce53fb2d49699484f478f71f192",
  "contentLength": 7358,
  "jsonUrl": "https://semiaifoundry.com/agents/publications/atlas-lesson-device-completion-reset-epochs.json",
  "markdownUrl": "https://semiaifoundry.com/agents/publications/atlas-lesson-device-completion-reset-epochs.md",
  "sections": [
    {
      "id": "section-1",
      "title": "Completion, reset and execution epochs",
      "start": 36,
      "end": 523
    },
    {
      "id": "section-2",
      "title": "The mechanism",
      "start": 523,
      "end": 2186
    },
    {
      "id": "section-3",
      "title": "Science and assumptions",
      "start": 2186,
      "end": 2214
    },
    {
      "id": "section-4",
      "title": "Account every executed MAC",
      "start": 2214,
      "end": 3024
    },
    {
      "id": "section-5",
      "title": "Completion must belong to the live attempt",
      "start": 3024,
      "end": 3816
    },
    {
      "id": "section-6",
      "title": "Engineering example",
      "start": 3816,
      "end": 4310
    },
    {
      "id": "section-7",
      "title": "Distinctions and tradeoffs",
      "start": 4310,
      "end": 4844
    },
    {
      "id": "section-8",
      "title": "Specifications and interfaces",
      "start": 4844,
      "end": 5226
    },
    {
      "id": "section-9",
      "title": "Interfaces",
      "start": 5226,
      "end": 5471
    },
    {
      "id": "section-10",
      "title": "Check your understanding",
      "start": 5471,
      "end": 5500
    },
    {
      "id": "section-11",
      "title": "A reset cancels four MACs, then a full retry executes eight. How much arithmetic was executed and committed?",
      "start": 5500,
      "end": 5870
    },
    {
      "id": "section-12",
      "title": "Evidence and scope",
      "start": 5870,
      "end": 6388
    },
    {
      "id": "section-13",
      "title": "Sources",
      "start": 6388,
      "end": 6729
    },
    {
      "id": "section-14",
      "title": "Continue exploring",
      "start": 6729,
      "end": 6752
    },
    {
      "id": "section-15",
      "title": "Foundations",
      "start": 6752,
      "end": 6995
    },
    {
      "id": "section-16",
      "title": "Related lessons",
      "start": 6995,
      "end": 7358
    }
  ],
  "citations": [
    {
      "title": "Explore in Atlas",
      "url": "https://semiaifoundry.com/ai-atlas/#device-completion-reset-epochs"
    },
    {
      "title": "OASIS — Virtual I/O Device (VIRTIO) Version 1.3",
      "url": "https://docs.oasis-open.org/virtio/virtio/v1.3/virtio-v1.3.html"
    },
    {
      "title": "Published lesson data",
      "url": "https://semiaifoundry.com/ai-atlas/lesson-data/device-completion-reset-epochs-25590d0d23232447.json"
    },
    {
      "title": "Atlas releases and licensing",
      "url": "https://semiaifoundry.com/ai-atlas/licenses.html"
    },
    {
      "title": "DMA visibility, ordering and buffer lifetime",
      "url": "https://semiaifoundry.com/learn/atlas/dma-visibility-ownership/"
    },
    {
      "title": "Firmware handoff and device readiness",
      "url": "https://semiaifoundry.com/learn/atlas/firmware-device-contract/"
    },
    {
      "title": "When completed work survives a restart",
      "url": "https://semiaifoundry.com/learn/atlas/retained-work-restart-boundary/"
    },
    {
      "title": "Checkpointing, failure and retained useful work",
      "url": "https://semiaifoundry.com/learn/atlas/checkpoint-retained-work/"
    },
    {
      "title": "Commissioning a usable AI cluster",
      "url": "https://semiaifoundry.com/learn/atlas/cluster-commissioning-gates/"
    }
  ],
  "recordHash": "5eef2523c6f2c0cfabdd7ed8c29b02300587fb02c31c15d3540989b9bbaba1a0",
  "contentFormat": "text/markdown",
  "content": "Executable software · Atlas v1.3.0\n\n# Completion, reset and execution epochs\n\nSeparate physical work, accepted completion and useful output while a device is stopped and reinitialized.\n\n[Explore in Atlas](https://semiaifoundry.com/ai-atlas/#device-completion-reset-epochs)One process and device job; logical states and byte addresses, no timing or physical geometry\n\nLearning objectiveReconcile partial output, discarded arithmetic and one accepted result across a device reset, and reject an old or duplicate completion.\n\n## The mechanism\n\nAn asynchronous device job can have written some output without establishing an accepted completion. Reset makes that distinction consequential: the host must not assume that every in-flight request finished, or that none of its side effects occurred. The teaching recovery path first establishes quiescence, retires the old queue and mappings, and cancels the uncommitted attempt. It then optionally runs the same pure matrix job under a new epoch with intact host inputs. The stable job identity connects both attempts, while the epoch prevents an older host-side notification from authorizing the new result. Every executed multiply-accumulate remains counted, including work whose partial output is discarded. The accepted consumer result appears once after all current-attempt writes, matching completion identity and output visibility. This finite replay is safe only under the stated pure-operation contract; repeating external side effects would require a stronger application recovery design.\n\n1.  A descriptor carries the stable job ID and the current execution epoch.\n2.  Every output cell is written before the normal completion record is posted.\n3.  Reset-needed stops the host from treating the old attempt as successful; the device is then assumed quiescent only at reset acknowledgement.\n4.  The old attempt’s arithmetic becomes discarded work, and its queue/mappings are retired before reuse.\n5.  An optional retry reestablishes readiness and performs the same operation under a new epoch.\n6.  A previously queued host notification for the old epoch is rejected; only one matching current completion can authorize publication.\n\n## Science and assumptions\n\n### Account every executed MAC\n\n$$\nN_{\\mathrm{executed}}=N_{\\mathrm{active}}+N_{\\mathrm{discarded}}+N_{\\mathrm{committed}}\n$$\n\nExecuted MACs equal active, discarded and committed MACs at every event.\n\nSymbols and units\n\nNexecuted\n\nAll performed multiply-accumulates\n\nMAC count\n\nNactive\n\nWork in the current uncommitted attempt\n\nMAC count\n\nNdiscarded\n\nWork belonging to canceled attempts\n\nMAC count\n\nNcommitted\n\nWork in the once-accepted attempt\n\nMAC count\n\nReset moves the uncommitted attempt’s active count to discarded. Publication moves the accepted attempt’s active count to committed. Committed arithmetic is still separately checked for semantic correctness.\n\nAssumptions Exact finite ledger of this one pure 2×2 job, at most one reset and one retry. Reads and writes are accounted separately in bytes.\n\n### Completion must belong to the live attempt\n\n$$\nG_{\\mathrm{completion}}=(j_c=j_a)\\land(e_c=e_a)\\land Q\\land W\\land\\neg A_c\n$$\n\nCompletion acceptance requires matching job and epoch, a live queue, all output cells written and no prior acceptance.\n\nSymbols and units\n\njc,ja\n\nCompletion and active job identities\n\nidentifier\n\nec,ea\n\nCompletion and active epochs\n\ncount\n\nQ\n\nQueue and published descriptor are live\n\nBoolean\n\nW\n\nAll four output cells have been written\n\nBoolean\n\nAc\n\nA completion was already accepted\n\nBoolean\n\nThe implementation additionally requires a published live descriptor. A repeated notification cannot cause a second accepted result.\n\nAssumptions A bounded local protocol. Epochs are identifiers here, not cryptographic tokens or a distributed exactly-once guarantee.\n\n## Engineering example\n\nReset the default job after its second output cell. The old memory contains \\[19,22,−777,−777\\], but no C is published. A retry performs eight more MACs, producing 12 executed = 4 discarded + 8 committed, with 64 input read bytes and 24 output write bytes across both attempts. It publishes \\[\\[19,22\\],\\[43,50\\]\\] once. Stop instead publishes nothing. Reset after all four writes still cancels eight uncommitted MACs when the completion boundary has not been crossed.\n\n## Distinctions and tradeoffs\n\nPhysical writes and notifications do not independently establish that an entire intended job is safe to publish.\n\nKeeping inputs and tracking generations enables this pure-job retry. The model does not restore corrupted input memory, repair firmware or make side-effecting requests safely replayable.\n\nLong-running accelerator services need to separate retried execution from completed useful requests. Recovery correctness is part of delivered compute capacity, not merely an availability percentage.\n\n## Specifications and interfaces\n\nJob identity\n\nmatrix-job-1\n\nRetained across attempts; completion also needs the active epoch.\n\nDefault reset position\n\nAfter two output cells\n\nFour MACs have executed and eight output bytes have been written.\n\nRetry assumption\n\nIntact inputs and acknowledged quiescence\n\nNo fault rate, repair latency or external side-effect recovery is inferred.\n\n### Interfaces\n\nDeclared runtime inputs Input\n\nStable matrix job, buffer identities and the stated device/visibility contract\n\nInspectable accepted or rejected result Output\n\nEvent trace, actual buffer values and bounded completion/work ledger\n\n## Check your understanding\n\n### A reset cancels four MACs, then a full retry executes eight. How much arithmetic was executed and committed?\n\n1.  Eight executed, eight committed\n2.  Twelve executed, twelve committed\n3.  Twelve executed, eight committed\n\nAnswer and reasoning\n\nTwelve executed, eight committed\n\nThe canceled four MACs remain physical work but do not belong to the accepted attempt.\n\n## Evidence and scope\n\nPrimary sources establish the cited runtime mechanisms. Numerical values, address ranges, ABI strings, event schedule and reset/retry epochs are authored teaching contracts. No real device, firmware image, operating-system driver, page table, cache protocol or security verification is executed.\n\nThe commissioning-execution-1 studio executes this bounded 2×2 matrix, buffer and completion contract. The surrounding atlas scene is conceptual; it is not a firmware emulator or system simulator.\n\n## Sources\n\n-   [OASIS — Virtual I/O Device (VIRTIO) Version 1.3](https://docs.oasis-open.org/virtio/virtio/v1.3/virtio-v1.3.html)\n\n[Published lesson data](https://semiaifoundry.com/ai-atlas/lesson-data/device-completion-reset-epochs-25590d0d23232447.json) · [Atlas releases and licensing](https://semiaifoundry.com/ai-atlas/licenses.html)\n\n## Continue exploring\n\n### Foundations\n\n-   [DMA visibility, ordering and buffer lifetime](https://semiaifoundry.com/learn/atlas/dma-visibility-ownership/)\n-   [Firmware handoff and device readiness](https://semiaifoundry.com/learn/atlas/firmware-device-contract/)\n\n### Related lessons\n\n-   [When completed work survives a restart](https://semiaifoundry.com/learn/atlas/retained-work-restart-boundary/)\n-   [Checkpointing, failure and retained useful work](https://semiaifoundry.com/learn/atlas/checkpoint-retained-work/)\n-   [Commissioning a usable AI cluster](https://semiaifoundry.com/learn/atlas/cluster-commissioning-gates/)"
}
