|
| 1 | +## Relacy tests |
| 2 | + |
| 3 | +[Relacy (RRD)](https://www.1024cores.net/home/relacy-race-detector/rrd-introduction) |
| 4 | +is a data race detector. It replaces the OS scheduler with an scheduler that |
| 5 | +explores many different thread interleavings, and logs detected races or assertion |
| 6 | +failures. Relacy can also simulate relaxed hardware by simulating old values of a |
| 7 | +variable as allowed by the C++11 memory model. |
| 8 | + |
| 9 | +Relacy requires a specialized build. In particular, it is a header only library that |
| 10 | +replaces the standard library and pthread APIs at compile time. Since it places some |
| 11 | +standard library includes, writing new tests may require working around certain |
| 12 | +limitations in terms of what the replacement headers and accompanying runtime can |
| 13 | +support. For example, Relacy's atomic replacements cannot support `++x`, so the |
| 14 | +stdexec library could needs to use `x.fetch_add(1)` to be compatible with Relacy. |
| 15 | + |
| 16 | +## Instructions |
| 17 | + |
| 18 | +Run the following commands from within this directory (`./tests/rrd`). |
| 19 | + |
| 20 | +``` |
| 21 | +# TODO: Merge patches into upstream Relacy @ dvyukov's version |
| 22 | +git clone -b stdexec https://github.com/ccotter/relacy |
| 23 | +CXX=g++-11 make -j 4 |
| 24 | +./build/split |
| 25 | +``` |
| 26 | + |
| 27 | +## Recommended use |
| 28 | + |
| 29 | +The Relacy tests can be manually built and executed. New tests can be written for |
| 30 | +new algorithms, or new use cases in the stdexec library. |
| 31 | + |
| 32 | +At this time, integrating the tests into CI is not yet recommended. If we can figure |
| 33 | +out a more stable build on all environments/compilers, we should revisit this. |
| 34 | + |
| 35 | +## Supported platforms |
| 36 | + |
| 37 | +The stdexec Relacy tests have been verified to build and run on |
| 38 | + * Linux based GCC+11 with libstdc++ (`x86_64`) |
| 39 | + * Mac with Apple Clang 15 with libc++ (`x86_64`) |
| 40 | + |
| 41 | +G++12 and newer are known to have issues that could be addressed with patches |
| 42 | +to Relacy. |
0 commit comments