8000 Determinism tools for the core's types: canonical encoding, hash, version for saves · Issue #22 · ynishi/enzan · GitHub
[go: up one dir, main page]

Skip to content

Determinism tools for the core's types: canonical encoding, hash, version for saves #22

Open

Description

@ynishi

Problem

A game that replays or saves has to build its own determinism tools around the core: a canonical form of its state, a hash to compare two runs, and a version check so a save is not read by another version of the rules.

Found by the arena (#16): arena/src/sim/save.ts writes its own canonical JSON and FNV-1a digest, and stamps a save with the content hash and contractVersion() so a save from another contract is refused.

Evidence from comparable libraries

Idea

For the core's own types (progress, rolled items, random states, a character sheet if #17 lands): a canonical encoding and a stable hash, and a version a save can carry.

Open — decided when this is picked up

  • Which types; whether the hash is part of the contract (stable across releases) or only within one version.
  • Relation to the existing native/WebAssembly determinism check.

Found by the arena: #16.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementbehaviour that does not exist yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0