[litmus] Print fault occurrences as generated - #1988
Merged
Merged
Conversation
maranget
force-pushed
the
fix-litmus-pp-faults
branch
3 times, most recently
from
September 3, 2026 22:18
61c1bf0 to
b919173
Compare
maranget
force-pushed
the
fix-litmus-pp-faults
branch
2 times, most recently
from
September 11, 2026 14:05
cdc0a5f to
6b9caa8
Compare
Contributor
|
I've validated that the output is as expected, manually: There's an example transcript of litmus logs with faults in doc/litmus.tex, it should be updated. I have to say they fail on my system, do these need to be changed? |
Member
Author
I do not understand. Do you mean that we should perform some experiment again? |
Complete fault occurrences appear in logs. When no fault occurred
that match a given specification, the specificaton appears negated.
Simple example:
```
AArch64 TST
Variant=vmsa
{
int x=1;
[TTD(x)]=(af:0);
0:X1=x;
1:X0=(oa:PA(x),af:1); 1:X1=TTD(x);
}
P0 | P1 ;
LDR W0,[X1] | STR X0,[X1] ;
forall
0:X0=0 => fault(P0,x)
/\
0:X0=1 => ~fault(P0,x)
```
Running `TST` on some AArch64 machine yields:
```
Test TST Required
Histogram (2 states)
1015017:>0:X0=1; ~fault(P0,x);
984983:>0:X0=0; fault(P0,x,D-MMU:AccessFlag);
Ok
Witnesses
Positive: 2000000, Negative: 0
Condition forall ((0:X0=0 => fault(P0,x)) /\ (0:X0=1 => not (fault(P0,x)))) is validated
Hash=0402bea6baacf20eca40414cc190ce26
Variant=vmsa
Observation TST Always 2000000 0
Faults TST 984983 P0:984983
Time TST 2.04
```
In histogram, observe that the fault description is complete when positive
and conform to specification when negative.
maranget
force-pushed
the
fix-litmus-pp-faults
branch
from
September 16, 2026 15:06
6b9caa8 to
a1ae115
Compare
psafont
approved these changes
Sep 16, 2026
Contributor
I was wondering why it fails when running in my system, and whether the experiment needed to be changed. I see that you regenerated the output, which is what I meant. |
maranget
force-pushed
the
fix-litmus-pp-faults
branch
from
September 17, 2026 06:19
a1ae115 to
d5ce1a9
Compare
Member
Author
|
Merged, thanks @psafont. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is the litmus7 equivalent of the PR #1984 that fixes fault printing in herd7. The objective is the same: printing faults that have occurred in complete format and negated fault specifications from the final condition when they match no fault that has occurred.
In the case of litmus7 the situation was made more complex by the semantics of prefixless fault types in specifications. In short, they were viewed as differing from prefixed fault types. For instance
fault(P0,x,MMU:AccessFlag)was considered to differ fromFault(P0,x,D-MMU:AccessFlag)andFault(P0,x,I-MMU:AccessFlag)and not as a partial specification of those. As an example, consider the simple test:Before this PR, running
TSTon some AArch64 machine yielded:Observe that
Fault(P0,x,MMU:AccessFlag)does not appear in the histogram. Moreover the count of faults1967099reveals that some faults did occur and suggests that the faults should appear in the second histogram line.With this PR, running the test with litmus yields:
Observe that the fault occurrences are now displayed and that the final condition is validated,
Additionally, we changed litmus7 implementation of fault recording and matching, following what herd7 does: fauts are recorded in sorted arrays (herd7 uses OCaml sets), matching follows the same rules and printing is performed in the same way: first scan the recorded faults to print them and then, for each specification, scan all recorded faults again to print non-matched specifications negated.