Skip to content

Model random values with scenario-supplied randomness #65

Closed

Description

@e54-bot

Context

Bastion on athena-sim now stops at value randomInteger at tick 0 (after athena#57 merged). Parent: #45.

Problem

Random Integer, Random Real, Random Value In Array, Random Number-family values and Randomized Array are nondeterministic in the client. The simulator must stay deterministic and must not guess (see docs/findings.md).

Requirements

  • Scenario input supplies randomness: an optional scenario field (seed or explicit sequence of draws) that the simulator consumes in evaluation order. Choose the smallest shape; document it in docs/scenario-format.md and docs/scenario.schema.json.
  • With a supplied source, random values evaluate deterministically from it; ranges, inclusive bounds and array selection follow the workshop-rs catalog description. The mapping from draws to values is recorded modeled-not-measured (no client capture of the distribution).
  • Without a supplied source, the run ends missing_input naming the random input (not not_modeled, not a hidden default seed).
  • The trace records that a random draw happened (rule, value) so the viewer can show it.
  • Run Bastion with a scenario that supplies randomness and record the next stop in the PR body.

Acceptance criteria

  • Tests: same seed gives identical traces; different seed can differ; missing source gives missing_input; bounds (min==max, min>max handling per catalog), Random Value In Array on empty array, Randomized Array keeps the elements.
  • Docs updated: simulator-interface, scenario-format, findings.
  • fmt, clippy -D warnings, cargo test, wasm32 check pass.
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions