Skip to content

Simulation mode running more actions than configured, incorrectly updating state #215

@ANorwell

Description

@ANorwell

Here is a model and associated simulation run:

---
options:
    max_actions: 2
deadlock_detection: False
---

action Init:
    history = []

fair action Generate:
    history.append("A")


atomic fair<strong> action Process:
    require len(history) > 0
    event = fair any history
    print("processing: " + str(event))
    history.pop()
    print("done processing: " + str(history))

always eventually assertion LotsOfElements:
    return len(history) > 1000
 ./fizz --simulation --max_runs 1000 --seed 1748538852856350 test.fizz
Simulation mode is enabled
Model checking test.json
configFileName: fizz.yaml
fizz.yaml not found. Using default options
StateSpaceOptions: options:{max_actions:2 max_concurrent_actions:2} deadlock_detection:false
Seed: 1748538852856350
processing: A
done processing: ["A"]
processing: A
done processing: ["A"]
FAILED: Model checker failed. Invariant:  LotsOfElements
seed: 1748538852856350
------
Init
--
state: {"history":"[]"}
------
Generate
--
state: {"history":"[\"A\"]"}
------
Generate
--
state: {"history":"[\"A\", \"A\"]"}
------
Process
--
state: {"history":"[\"A\", \"A\"]"}
------
Writen graph json: out/run_2025-05-29_13-17-42/error-graph.json
Writen graph dotfile: out/run_2025-05-29_13-17-42/error-graph.dot
To generate an image file, run:
dot -Tsvg out/run_2025-05-29_13-17-42/error-graph.dot -o error-graph.svg && open error-graph.svg
Writen error states as html: out/run_2025-05-29_13-17-42/error-states.html
To open:
open out/run_2025-05-29_13-17-42/error-states.html

The result here is quite confusing for several reasons:

  • Even though max_actions is 2, it seems to be running 4 actions: the Generate, Generate, Process shown in the output, and also a second Process that was run according to stdout, but not shown in the output (also seen in Confusing simulation mode Deadlock/stuttering detected #214)
  • The state field doesn't seem to be being updated properly. stdout shows that it has been modified (has only one element), but the actual state shown in the output doesn't reflect that (still has two elements), and the second, repeated execution of Process again starts with two elements.

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