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

Memory data-race tests #212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Memory data-race tests #212

wants to merge 1 commit into from

Conversation

art-w
Copy link
Contributor

@art-w art-w commented Nov 22, 2022

This adds three negative tests for references, mutable record fields and arrays, that tends to trigger memory data-races (the tests are very similar, I'll let you choose which ones to keep!) It takes a lot of trials, about 50k on my computer on a good day, so perhaps the count = 100_000 is too low... and it's very hard for the shrinker to reproduce the observed data-race.

Many thanks to @OlivierNicole for recommending qcheck-lin as a way to confirm that my hardware is doing read/write reordering optimizations :)

@jmid
Copy link
Collaborator

jmid commented Nov 23, 2022

Thanks a bunch for sharing these! 🙏 😃
I'm happy to see that we can trigger such failures with sufficiently high counts!

ATM we are still moving things around and renaming - so I'll let this PR rest a bit until that has settled.

@art-w
Copy link
Contributor Author

art-w commented Nov 23, 2022

(... wow it successfully failed really fast on the CI https://github.com/jmid/multicoretests/actions/runs/3526003194/jobs/5913754957#step:10:1388 ! The test might be less fragile than I expected :D )

@jmid
Copy link
Collaborator

jmid commented Nov 23, 2022

Note: We already have Array tests in https://github.com/jmid/multicoretests/blob/main/src/array/lin_tests_dsl.ml
Because they test more Array functions they tend to find and report observed "sequential inconsistency" of these, rather than performing a focused data-race drilling of get and set. As such, there may be a good reason to run both though... 🤔

For all three, I'm also wondering if playing with rep_count (how many times each instance is repeated) could help reduce the outer iteration count - and hence overall testing time 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants