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

Hotfix: Properly reset metadata variables #1553

Merged
merged 3 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
### Removed
### Fixed

- Fixed a problem where traces other than the first one when `--n-traces` > 1
and `--mbt` is true had the incorrect `action_taken` and `nondet_picks` values
(#1553).

### Security

## v0.22.3 -- 2024-10-28
Expand Down
4 changes: 3 additions & 1 deletion quint/io-cli-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,14 +894,16 @@ rm out-itf-example.itf.json

<!-- !test in run with n-traces itf -->
```
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt
quint run --out-itf=out-itf-example.itf.json --n-traces=3 --mbt --max-steps=5 --seed=123 ../examples/tutorials/coin.qnt
cat out-itf-example0.itf.json | jq '.["#meta"].status'
cat out-itf-example1.itf.json | jq '.states[0].action_taken'
rm out-itf-example*.itf.json
```

<!-- !test out run with n-traces itf -->
```
"ok"
"init"
```

### Run to generate multiple ITF traces with violation
Expand Down
6 changes: 6 additions & 0 deletions quint/src/runtime/impl/VarStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ export class VarStorage {
reset() {
this.vars.forEach(reg => (reg.value = initialRegisterValue(reg.name)))
this.nextVars.forEach(reg => (reg.value = initialRegisterValue(reg.name)))
if (this.storeMetadata) {
this.actionTaken = undefined
this.nondetPicks.forEach((_, key) => {
this.nondetPicks.set(key, undefined)
})
}
}

/**
Expand Down
Loading