Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does the implicit crash action work in serial block modifiers? #144

Open
TSPMP opened this issue Feb 1, 2025 · 2 comments
Open

How does the implicit crash action work in serial block modifiers? #144

TSPMP opened this issue Feb 1, 2025 · 2 comments

Comments

@TSPMP
Copy link

TSPMP commented Feb 1, 2025

I am referring to the serial block modifier example

---
options:
  max_actions: 10
  max_concurrent_actions: 2
---

action Init:
  a = 0
  b = 0

serial action Add:
  a = (a + 1) % 3
  b = (b + 1) % 3

All traces I write here are assumed to be taken from the initial state.

If I go to the explorer in the playground then I can simulate the trace

Add -> crash

which indicates that the first thread can crash. I can also go from the initial state

Add -> Add

which interleaves another Add action after the first Add action in another thread. Now, I would expect that the two threads can crash independently but there is only one crash action active. After taking the crash action, i.e.

Add -> Add -> crash

I have the actions Add and action-1 available which would indicate that the second thread crashes. But now I would expect that also the first thread can still crash which is not available.

Is this a bug or is my understanding of the serial block modifier wrong?

@jayaprabhakar
Copy link
Collaborator

But now I would expect that also the first thread can still crash which is not available.

That's a great question. From the observable state space perspective, the second thread crashing at this point is exactly the same as the first thread crashes before the Add was called.

That is,
Add (a=1,b=0) -> Add (a=2,b=0) -> crash-action-1 (state space not generated)
is exactly equivalent to

Add (a=1,b=0) -> crash -> Add (a=2,b=0)

In both the cases, the observable state is the same, thread alive 1, current thread is action-2, program counter also matches).

So FizzBee optimizes the state spaces and simplifies the graph to include only one since scenario (always crash implies the currently active these crashed)

@TSPMP
Copy link
Author

TSPMP commented Feb 2, 2025

@jayaprabhakar - Thank you, that makes me understand a little better how fizzbee behaves there. I have a follow-up question then 😄: in the generated state graph I was looking for the equivalent state for the trace

Add -> crash -> Add -> crash

which is the state

a = 2, b = 0, no threads alive

and found it here

Image

but it is reached in the state graph through another trace. It looked to me that the Actions: 5, Forks: 10 should be the minimal number of Actions and Forks to reach that state but I guess that is not true because the aforementioned trace

Add -> crash -> Add -> crash

would reach this with Actions: 2, Forks: 4. How should I interpret the Actions, Forks values in the state graph?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants