This sounds very similar to Cuzz from Application Verifier for Windows:
https://learn.microsoft.com/en-us/windows-hardware/drivers/d...
It is possible to do this entirely in userspace without a custom scheduler.
See the implementation here: https://github.com/ClickHouse/ClickHouse/blob/master/src/Com...
It works and makes significant improvements for the detection of concurrency bugs, including complex logical races in distributed scenarios.
For Rust, https://crates.io/crates/turmoil https://crates.io/crates/loom https://crates.io/crates/shuttle are interesting.
Bugs? "It is possible to do this entirely in user space without a custom scheduler." Exactly.
Its a feature.