oxidecomputer / oxidecomputer/omicron

typed-rng: serde support

Open
#11,217 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

RFD 726's simulator saves and restores state, including its RNGs, so a loaded snapshot continues exactly as the saved session would have. The plan is to use ChaCha12Rng (which is what rand 0.9's StdRng wraps anyway), whose full state serializes via rand_chacha's serde feature.

TypedRng<T, R> is already generic over its generator; only the aliases hardcode StdRng. The work is adding (probably feature-gated) Serialize/Deserialize impls for TypedRng where the underlying generator supports them.

Contributor guide

Open the contributing guide

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

Start in typed-rng/src/lib.rs, reading the generic TypedRng definition around line 106 and the StdRng aliases around lines 255-256. Check how rand_chacha exposes its serde feature and how the crate gates optional features. Done means TypedRng supports serialization and deserialization when its generator does, while existing aliases continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.