You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EnumerationTask represents the task of enumerating final states. Currently, limited to litmus code.
There is a new option --mode={verification, enumeration} to select the type of task to solve.
I haven't test it, but seeing a new option and no changes to the relection file, it might be the case the options does not work in native. Also, if the option is in a new class, it will not be shown in the help. I will add (in another PR) some test so make sure we do not miss this situation anymore.
Possible TODOs:
Unit tests?
Done.
Many of the tests will fail, but this does not necessarily mean the exploraiton is wrong. I generated the expected results using the cat files in herd's repo, thus there might be a missmatch with our cat models. But if this is the case, we should figure out how and why the models differ.
From local testing, we still have 41 test failures. One of them times out due to OOTA.
Most of them have a spec and still list locations which causes a mismatch where Dartagnan enumerates less than intended. However, for the C11 litmus test ../litmus/C11/manual/imm-R2-alt.litmus, we enumerate 13 instead of 12 states. This one might be the only genuine discrepancy between Dartagnan and herd7.
I extracted a litmus test on which herd7 and Dartagnan disagree under c11.cat:
C imm-R2
(*
* Bridging the Gap between Programming Languages and Hardware Weak Memory Models
*)
{}
P0 (atomic_int* x, atomic_int* y) {
atomic_store_explicit(y, 1, memory_order_relaxed);
atomic_store_explicit(x, 1, memory_order_release);
}
P1 (atomic_int* x) {
atomic_thread_fence(memory_order_release);
int r0 = atomic_fetch_add_explicit(x, 1, memory_order_acquire);
atomic_store_explicit(x, 3, memory_order_relaxed);
}
P2 (atomic_int* x, atomic_int* y) {
int r0 = atomic_load_explicit(x, memory_order_acquire);
int r1 = atomic_load_explicit(y, memory_order_relaxed);
}
exists (1:r0=1 /\ 2:r0=2 /\ 2:r1=0) // Reachable in Dartagnan, unreachable in Herd7
It looks like a release-acquire chain interrupted by an RMW. Looking at the c11.cat memory model, it does not seem to have a construct like (rf;rmw)* to extend release-acquire chains like other models do.
@hernanponcedeleon Except for the one timeout due to OOTA, I think all remaining failing tests are due to the explicitly mentioned locations inside the tests that cause herd7 to enumerate more.
I think we have the following options:
Remove the locations bit from those tests and let herd7 generate new expected values
Skip those tests only for enumeration but not for verification (requires a separate skip list)
Add support for locations in litmus tests (probably the hardest solution to implement).
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
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.
EnumerationTaskrepresents the task of enumerating final states. Currently, limited to litmus code.--mode={verification, enumeration}to select the type of task to solve.Possible TODOs:
EnumerationSolverwithAssumeSolver: they share a lot of code.--mode=verification/enumerationto the shorter--mode=verify/enumerate?