Hi, Dmitry!
First of all, thanks for the great tool (one of a kind)!!
Probably I missed something, but...
In my tests, 'load' is never being reordered with subsequent 'store', even when both tagged as 'relaxed'.
Example (see comment in 'after' method):
#include <relacy/relacy_std.hpp>
const size_t k_numberOfThreads = 2;
struct LoadStore : public rl::test_suite<LoadStore, k_numberOfThreads>
{
rl::atomic<int> a = 0;
rl::atomic<int> b = 0;
int x = 0;
int y = 0;
void thread(unsigned int index)
{
if (0 == index)
{
// Thread 1
x = a.load(rl::memory_order_relaxed);
b.store(1, rl::memory_order_relaxed);
}
else
{
// Thread 2
y = b.load(rl::memory_order_relaxed);
a.store(1, rl::memory_order_relaxed);
}
}
void after()
{
const bool outOfOrder = ((1 == x) && (1 == y)); // <--- Never fired!
RL_ASSERT(!outOfOrder);
}
};
int main()
{
rl::test_params p;
p.search_type = rl::sched_full;
rl::simulate<LoadStore>(p);
return 0;
}
Tested on Clang 18/21 (Linux Fedora 40/43) with Relacy/Jan8'2026
С++20
I also found 2 similar cases with 'suspicious' results:
load-relaxed / load-seq_cst
store-seq_cst / store-relaxed
(both never being executed out-of-order)
Could you please confirm whether it is a bug?
Or, may be, these cases can't be easily handled by technical reasons (I know that Relacy is not verifier of C++ formal model / abstract machine)?
Thanks in advance!
Hi, Dmitry!
First of all, thanks for the great tool (one of a kind)!!
Probably I missed something, but...
In my tests, 'load' is never being reordered with subsequent 'store', even when both tagged as 'relaxed'.
Example (see comment in 'after' method):
Tested on Clang 18/21 (Linux Fedora 40/43) with Relacy/Jan8'2026
С++20
I also found 2 similar cases with 'suspicious' results:
load-relaxed / load-seq_cst
store-seq_cst / store-relaxed
(both never being executed out-of-order)
Could you please confirm whether it is a bug?
Or, may be, these cases can't be easily handled by technical reasons (I know that Relacy is not verifier of C++ formal model / abstract machine)?
Thanks in advance!