rust-lang / rust-lang/rfcs

Deterministic parallel execution of native threads

Open
#1,090 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T-dev-tools T-lang
Dominant language
Markdown
Stars
6.6k
Forks
1.7k
Avg merge
16h 14m
Merged PRs (30d)
1

Description

Bergan, Anderson, Devietti, Ceze & Grossman. (2010). CoreDet: a compiler and runtime system for deterministic multithreaded execution. ACM SIGARCH Computer Architecture News 38(1), pp. 53-64.

The applications include:

  • Deterministic execution during debugging
  • Manipulating thread scheduling to uncover concurrency bugs. This would be very powerful combined with coverage-based adaptive fuzzing.

The system described in the paper uses alternating stages of parallel and serial execution, each bounded in time. In the simplest execution model, inter-thread communication blocks until serial mode. They also describe how to optimize this using approaches similar to cache coherence.

Their implementation uses an LLVM pass to instrument each access to possibly-shared memory. In Rust it should suffice to instrument std::sync::atomic or the equivalent LLVM intrinsics. From §7.3:

for data race free programs, deterministic synchronization is sufficient for full determinism

The LLVM pass injects other code to handle calls to external libraries (which may have uninstrumented data races), and to provide deterministic, bounded time quanta during execution. rr uses hardware performance counters for the latter purpose, which would be an interesting variation to explore.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or entry points are named. Start by reading the linked CoreDet paper and use its execution model and instrumentation approach to define a concrete, implementable scope for Rust native-thread determinism; done means a focused proposal with clear boundaries and expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.