[herd,cat] Fix some problems with the C architecture#1912
Conversation
be5585a to
13863fa
Compare
|
The error is fixed, but I see behavior changes in LKMM litmus tests. Litmus test: Expected output Output as of fix-some-cat-primitives There seems to be lost orderings implied by atomic accesses. |
|
Is $ dune exec herd7 -- -set-libdir herd/libdir -model repro.cat herd/tests/instructions/AArch64/A01.litmus
File "./repro.cat", line 1, characters 6-16: primitive delift: argument mismatchwhere |
Nice catch! Fix on its way. It is likely that V.Empty will not occur un ClassRel context, but robustness commands fixing. |
Since PR #1855, the polymorphic value empty circulates more. Some primitives were performing set and relation normalisation by themselves, overlooking the cases of empty and universe. We fix this by using the already present and complete normalisation functions `as_set` and `as_rel` slightly generalised to handle different error reporting. Reported-by: Akira Yokosawa <akiyks@gmail.com>
13863fa to
b41930f
Compare
|
Just pushed a small fix for the ClassRel arguments of primitives. In ambiguous cases, I favored event set and relation. |
|
Commit ba788a2 should fix the |
|
Unfortunately, the added tests would not have caught the |
|
Just confirmed this restores expected behavior. |
|
Hi @relokin and @HadrienRenaud. I am leaving next Monday for two weeks. Could we merge this PR that fixes two bugs soon? |
C models, including the linux kernel memory model, define this set as `RMW`, however the common `stdlib.cat` file that defines the `rmw` relation need this set to be called `X`. Reported-by: Akira Yokosawa <akiyks@gmail.com>
8b41148 to
0b0dedc
Compare
HadrienRenaud
left a comment
There was a problem hiding this comment.
I can't claim to understand all the details nor consequences of those changes, but overall I don't see why we shouldn't merge it
|
Thanks @HadrienRenaud. Merging. |
This PR fixes two problems:
V.Emptycirculates more. Some primitives were performing set and relation normalisation by themselves, overlooking the cases of empty and universe. We fix this by using the already present and complete normalisation functionsas_setandas_relslightly generalised to handle different error reporting.rmwis computed by defining it in stdlb.cat. The Cat definition of the relationrmwassumes that atomic effects are gathered in the setX, which was not the case of the C semantics. As a result thermwrelation was empty when the read-modify-write instructions are implemented by two (atomic) effects.