AIKernel.NET
version: 0.0.2 / status: Refactor / edition: Draft / published: 2026-05-16 / updated: 2026-05-16

06. Replay Dump Spec

1. Purpose

Define the execution dump contract for deterministic replay and auditability. In AIKernel.NET, deterministic means not only input equivalence but also fully fixed model/runtime conditions and compute resource conditions.

2. Scope

  • DumpId
  • KernelVersion
  • Seed
  • InferenceParameters (for example Temperature)
  • LockedProviderInfo (fixed execution-model information)
  • ComputeShape (IComputeShapeAdvisor decision)
  • PromptArtifactHash
  • PipelineDefinitionHash
  • MaterialSnapshotHashSet
  • ExecutionOutcomeHash
  • TrustDecision
  • KeyId

3. Normative Requirements

  • RDS-001 Mandatory fields MUST be present.
  • RDS-002 References MUST resolve via content hashes.
  • RDS-003 Timestamps MUST be serialized in UTC ISO-8601.
  • RDS-004 Canonical key ordering MUST be used.
  • RDS-005 Freezing Non-Determinism: Runtime Seed, inference parameters (for example Temperature), and compute shape selected by IComputeShapeAdvisor (arity/tensor type) MUST be fully recorded.
  • RDS-006 Semantic Snapshot Capture: Orchestration, Material, and Expression buffers in ContextCollection MUST be captured in ROM format with semantic hashes.
  • RDS-007 Trust Chain Inclusion: TrustDecision from ISignatureTrustStore and signing key identifier (KeyId) MUST be persisted.

3.1 Deterministic Replay Lock Contract

  • RDS-LOCK-001 Replay dump MUST include ReplayContext.LockedProviderInfo as a mandatory field.
  • RDS-LOCK-002 LockedProviderInfo MUST include at least ProviderId, ModelId, QuantizationProfile, and CapacitySnapshot.
  • RDS-LOCK-003 If replay-time environment diverges from LockedProviderInfo (for example unavailable provider), the system MUST abort in fail-closed mode.

4. Fail-Closed

  • RDS-F001 Replay is denied on hash-chain mismatch.
  • RDS-F002 Loading is denied when mandatory fields (especially LockedProviderInfo) are missing.
  • RDS-F003 Abort on critical version incompatibility.
  • RDS-F004 Environment Divergence: Block execution when replay environment critically diverges from recorded LockedProviderInfo.
  • RDS-F005 Broken Hash Chain: Abort replay when ExecutionOutcomeHash does not match expected value derived from Prompt/Pipeline/Material hashes.

5. Acceptance Criteria

  • AC1: Identical dumps reproduce identical replay outcomes.
  • AC2: LockedProviderInfo forces historical model selection without dynamic routing.
  • AC3: Tampered dumps or dumps missing major parameters are always rejected.
  • AC4: When environment divergence is detected (for example missing model), replay halts immediately without ambiguous fallback.

6. DTO Definition

Immutable data structure for strict replay context definition.

public sealed record ReplayContext(\n    string DumpId,\n    LockedProviderInfo LockedProviderInfo,\n    string InputHash,\n    string MaterialHash,\n    string PolicyHash,\n    DateTime CreatedAtUtc);

7. Dump Architecture (ROM-based Structure)

Replay dump is represented as a single ROM entity.

---\nid: "dump.exec.20260504.001"\ntype: "kernel.replay_dump"\nkernel_version: "0.0.7"\nseed: 42\n---\n# Frozen Execution Environment\n* [locked_provider]: [[provider.openai.gpt4o]]\n* [quantization]: "fp16"\n* [shape_advisor]: [[advisor.npu_v1]]\n\n# Hash Integrity Chain\n* [prompt_hash]: "sha256:7f8e9a..."\n* [material_hashes]: ["sha256:e3b0c4..."]\n* [outcome_hash]: "sha256:9d8c7b..."\n\n# Frozen Buffers\n* [orchestration]: [[ref.rom.prompt_artifact]]\n* [material]: [[ref.rom.material_snapshot]]\n* [expression]: [[ref.rom.result_expression]]

8. Replay Sequence

IKernelReplayer reconstructs execution in the following sequence.

  1. Integrity Check
  2. Validate complete hash chain and detect tampering.

  3. Environment Emulation
  4. Load LockedProviderInfo and apply Force Provider Mode.

  5. State Unfreezing
  6. Restore ContextCollection from ROM frozen buffers.

  7. Shadow Execution
  8. Re-execute under frozen conditions (Seed/Model/Param) and compare with ExecutionOutcomeHash.


Changelog

  • v0.0.0 / v0.0.0.0: Initial draft
  • v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
Source: specs/06.REPLAY_DUMP_SPEC.md