~icefox

Trackers

~icefox/oorandom

Last active 5 months ago

~icefox/cf_issues

Last active 1 year, 5 days ago

#2 Serde support? 5 months ago

Feature added by ~icefox on ~icefox/oorandom

#1 Ability to save/load the Rand32/Rand64 state 5 months ago

Feature added by ~icefox on ~icefox/oorandom

#2 Serde support? 5 months ago

Ticket created by ~icefox on ~icefox/oorandom

Could be optional, and basically all it needs is the following code from #1:

#[derive(Serialize, Deserialize)]
pub struct Game {
     // a bunch of other fields

    #[serde(with = "Rand32Serde")]
    rng: Rand32,
}

fn rand32_get_state(r: &Rand32) -> u64 {
    r.state().0
}

fn rand32_get_inc(r: &Rand32) -> u64 {
    r.state().1
}

#[derive(Serialize, Deserialize)]
#[serde(remote = "Rand32")]
struct Rand32Serde {
    #[serde(getter = "rand32_get_state")]
    state: u64,
    #[serde(getter = "rand32_get_inc")]
    inc: u64,
}

impl From<Rand32Serde> for Rand32 {
    fn from(r: Rand32Serde) -> Rand32 {
        Rand32::from_state((r.state, r.inc))
    }
}

#1 Ability to save/load the Rand32/Rand64 state 5 months ago

Comment by ~icefox on ~icefox/oorandom

Nice, glad to hear it works for you! Serde support might happen sooner or later, I'll play with it.

#1 Ability to save/load the Rand32/Rand64 state 5 months ago

Comment by ~icefox on ~icefox/oorandom

Published as version 11.0.1, let me know how it works out!

REPORTED RESOLVED FIXED

#1 Ability to save/load the Rand32/Rand64 state 6 months ago

Comment by ~icefox on ~icefox/oorandom

Whoops, new_inc() does extra initialization work so we need a separate create from saved state function. Or to undo its setup to produce the stored state, but that doesn't seem worth the trouble and maybe not even possible.

Implementation in https://hg.sr.ht/~icefox/oorandom/rev/9aefacac1a3b47aaf8831f98fe2477a9ae5c486e , any thoughts?

#1 Ability to save/load the Rand32/Rand64 state 6 months ago

Comment by ~icefox on ~icefox/oorandom

Oh snap, congrats on getting first post on the issue tracker. ;-)

I'm totally down for adding this ability. Serde might be possible, it would be easy to do and easy to make optional. In the interests of keeping everything as brain-dead as possible though, I think for the moment there should just be a function to return the internal states so they can be be fed back to ::new_inc(). Making the internal fields pub is tempting but tinkering with them directly is not something to be encouraged so let's make a consistent interface.

#50 Open source the thing 1 year, 5 days ago

Comment by ~icefox on ~icefox/cf_issues

GPL v3. It's aite for my purposes, since this isn't intended to be a library.

Just need repo changes and such.

#41 Add cargo_metadata resolver benchmarks 1 year, 7 days ago

Comment by ~icefox on ~icefox/cf_issues

Eh2406 reported back that the slowest resolver times were not reproducible, I expect that they were outliers spending a lot of time on disk I/O or something. Would still like a note if we discover something consistently taking >10 seconds. The current setup is really optimized for throughput though, not timing analysis.

#50 Open source the thing 1 year, 7 days ago

AREA-Infrastructure added by ~icefox on ~icefox/cf_issues