-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/volatile #18
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
Open
lukecheeseman
wants to merge
16
commits into
fxpl:main
Choose a base branch
from
lukecheeseman:feature/volatile
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/volatile #18
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c03f477
adding a tikz output to match the paper
lukecheeseman 31413b9
better linear drawing
lukecheeseman d2cd2c4
linear conflicts follow paths proprly and vars are subscripted
lukecheeseman a3a1696
stage changes are now communicated
lukecheeseman b50cc99
better layout for linear
lukecheeseman db4674d
linear diagrams have more space to breath
lukecheeseman 383bd13
better layout that respects ordering of inter-thread event timings
lukecheeseman f05221b
better communication messages
lukecheeseman 02efab2
failing pullpush don't do show the push part on the diagram
lukecheeseman ecf112a
some fixups to alignment
lukecheeseman ff6aa51
remove some doublearrows artifacts
lukecheeseman 56a52af
update gitignore
lukecheeseman eb38614
Adding support for volatiles: parsing, interpreter, tests, grpahs
lukecheeseman bec6481
Linear volatile read is pull only not pullpush
lukecheeseman e26c50e
Split compound volatile reads and writes in one statement into sepera…
lukecheeseman a411d89
Add hositing of multiple volatile access in one statement into sepera…
lukecheeseman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,7 @@ | |
| *.out | ||
| *.app | ||
| build | ||
|
|
||
| *.DS_Store | ||
| *.vscode | ||
| *.dot | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| @v1 = 1; | ||
| assert(@v1 == 1); |
26 changes: 26 additions & 0 deletions
26
examples/accept/semantics/branching/volatile_read_is_pull_not_push.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // This test demonstrates that volatile reads are pull actions, not push actions. | ||
| // In particular, the read of @v in t2 should not push the changes from t2 to t1, | ||
| // and so the assertion on y should always succeed. | ||
|
|
||
| @v = 0; | ||
| x = 0; | ||
| y = 0; | ||
|
|
||
| t1 = spawn { | ||
| x = 1; | ||
| @v = 1; | ||
| assert(y == 0); | ||
| }; | ||
|
|
||
| t2 = spawn { | ||
| y = 1; | ||
| if (@v == 1) { | ||
| assert(x == 1); | ||
| } else { | ||
| assert(x == 0); | ||
| } | ||
| join t1; | ||
| }; | ||
|
|
||
| join t1; | ||
| join t2; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| assert(@v == 2); | ||
| }; | ||
| assert(@v == 2); |
7 changes: 7 additions & 0 deletions
7
examples/accept/semantics/branching/volatile_sync_conflict_two_vars.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| $t = spawn { | ||
| x = 1; | ||
| @v1 = 1; | ||
| }; | ||
| x = 2; | ||
| @v2 = 2; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| @v1 = 1; | ||
| assert(@v1 == 1); |
26 changes: 26 additions & 0 deletions
26
examples/accept/semantics/linear/volatile_read_is_pull_not_push.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // This test demonstrates that volatile reads are pull actions, not push actions. | ||
| // In particular, the read of @v in t2 should not push the changes from t2 to t1, | ||
| // and so the assertion on y should always succeed. | ||
|
|
||
| @v = 0; | ||
| x = 0; | ||
| y = 0; | ||
|
|
||
| t1 = spawn { | ||
| x = 1; | ||
| @v = 1; | ||
| assert(y == 0); | ||
| }; | ||
|
|
||
| t2 = spawn { | ||
| y = 1; | ||
| if (@v == 1) { | ||
| assert(x == 1); | ||
| } else { | ||
| assert(x == 0); | ||
| } | ||
| join t1; | ||
| }; | ||
|
|
||
| join t1; | ||
| join t2; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| assert(@v == 2); | ||
| }; | ||
| assert(@v == 2); |
5 changes: 5 additions & 0 deletions
5
examples/accept/semantics/linear/volatile_sync_communicate.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| assert(@v == 2); | ||
| }; | ||
| assert(@v == 2); |
9 changes: 9 additions & 0 deletions
9
examples/reject/semantics/branching/volatile_increment_race.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Two volatile writes to @v with no happens-before between them (write->write | ||
| // is not a synchronizes-with edge). The stores are atomic but they still race: | ||
| // the final value is order-dependent. A concurrent write-write on a volatile is | ||
| // a race and must be rejected. | ||
| @v = 0; | ||
| $t = spawn { | ||
| @v = @v + 1; | ||
| }; | ||
| @v = @v + 1; |
5 changes: 5 additions & 0 deletions
5
examples/reject/semantics/branching/volatile_sync_communicate_volatile.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| @v = 41; | ||
| }; | ||
| assert(@v == 2); |
10 changes: 10 additions & 0 deletions
10
examples/reject/semantics/branching/volatile_sync_conflict.gm
|
EliasC marked this conversation as resolved.
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // The two volatile writes to @v are concurrent with no happens-before between | ||
| // them (write->write is not a synchronizes-with edge, only write->read is), so | ||
| // they race -- and so do the piggybacked x writes. All models detect it. | ||
|
|
||
| $t = spawn { | ||
| x = 1; | ||
| @v = 1; | ||
| }; | ||
| x = 2; | ||
| @v = 2; |
8 changes: 8 additions & 0 deletions
8
examples/reject/semantics/branching/volatile_write_write_race.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Two volatile writes to @v with no happens-before between them (write->write | ||
| // is not a synchronizes-with edge). The stores are atomic but they still race: | ||
| // the final value is order-dependent. A concurrent write-write on a volatile is | ||
| // a race and must be rejected. | ||
| $t = spawn { | ||
| @v = 1; | ||
| }; | ||
| @v = 2; |
5 changes: 5 additions & 0 deletions
5
examples/reject/semantics/linear/volatile_sync_communicate_volatile.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| @v = 41; | ||
| }; | ||
| assert(@v == 2); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| $t = spawn { | ||
| x = 1; | ||
| @v = 1; | ||
| }; | ||
| x = 2; | ||
| @v = 2; |
7 changes: 7 additions & 0 deletions
7
examples/reject/semantics/linear/volatile_sync_conflict_two_vars.gm
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate of examples/reject/semantics/linear/volatile_sync_conflict.gm |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| $t = spawn { | ||
| x = 1; | ||
| @v1 = 1; | ||
| }; | ||
| x = 2; | ||
| @v2 = 2; |
8 changes: 8 additions & 0 deletions
8
examples/reject/semantics/linear/volatile_write_write_race.gm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Two volatile writes to @v with no happens-before between them (write->write | ||
| // is not a synchronizes-with edge). The stores are atomic but they still race: | ||
| // the final value is order-dependent. A concurrent write-write on a volatile is | ||
| // a race and must be rejected. | ||
| $t = spawn { | ||
| @v = 1; | ||
| }; | ||
| @v = 2; |
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate of examples/accept/semantics/linear/volatile_sync.gm