oxidecomputer / oxidecomputer/omicron
typed-rng: serde support
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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