Skip to content

Deterministic runtime crate#5016

Open
Shubham8287 wants to merge 46 commits into
masterfrom
shub/sim
Open

Deterministic runtime crate#5016
Shubham8287 wants to merge 46 commits into
masterfrom
shub/sim

Conversation

@Shubham8287
Copy link
Copy Markdown
Contributor

@Shubham8287 Shubham8287 commented May 13, 2026

Description of Changes.

Introduces deterministic runtime crate.
Integrate it with RelationalDB.

I think best steps to review:

  • Read the README of runtime crate.
  • Look at the integration with existing crates - durability, core, snapshot, etc.
  • Read runtime crate's code.

Draft branch to Test code - #5019

API and ABI breaking changes

NA

Expected complexity level and risk

Does not intend to change any production functionality, but it's big code.

Testing

  • new crate contains unit and integration tests.
  • Existing tests should work for production.

@Shubham8287 Shubham8287 changed the title Deterministic Runtime crate Deterministic runtime crate May 13, 2026
@Shubham8287 Shubham8287 self-assigned this May 14, 2026
Comment thread crates/runtime/src/lib.rs
Tokio(tokio::task::JoinHandle<T>),
#[cfg(feature = "simulation")]
Simulation(sim::JoinHandle<T>),
Detached(PhantomData<T>),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is interesting and could use some commentary!

Comment thread crates/runtime/src/sim_std.rs
Comment thread crates/runtime/DETERMINISM_COVERAGE.md
Comment thread crates/runtime/src/sim/time/mod.rs Outdated
Comment thread crates/snapshot/tests/remote.rs
let original = PTHREAD_ATTR_INIT.get_or_init(|| unsafe {
// `RTLD_NEXT` skips this interposed function and finds the libc
// implementation that would have been called without the simulator.
let ptr = libc::dlsym(libc::RTLD_NEXT, c"pthread_attr_init".as_ptr().cast());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wild.

Copy link
Copy Markdown
Contributor Author

@Shubham8287 Shubham8287 May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overriding libc methods turning out to be limited for detecting source of nondeterminism. I am experimenting with eBPF, which looks more powerful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants