Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support/arbitrary: Instead of uniform random sampling, we should use a distribution that #196

Open
github-actions bot opened this issue Oct 28, 2022 · 0 comments
Assignees
Labels
to do To be done tracker Issue tracked by bot

Comments

@github-actions
Copy link

On 2022-10-28 @recmo wrote in 49f6271 “Merge pull request #195 from recmo/pow2”:

Instead of uniform random sampling, we should use a distribution that
exercises different scales more. Something like sum(±2ⁱ for random i). The
reduction step can then remove terms or make them smaller.

#![cfg(feature = "arbitrary")]
#![cfg_attr(has_doc_cfg, doc(cfg(feature = "arbitrary")))]
use crate::Uint;
use arbitrary::{Arbitrary, Result, Unstructured};

// TODO: Instead of uniform random sampling, we should use a distribution that
// exercises different scales more. Something like sum(±2ⁱ for random i). The
// reduction step can then remove terms or make them smaller.

// TODO: We should use `rand` in tests, not `arbitrary`.

impl<'a, const BITS: usize, const LIMBS: usize> Arbitrary<'a> for Uint<BITS, LIMBS> {
    fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {

From src/support/arbitrary.rs:7

@github-actions github-actions bot added to do To be done tracker Issue tracked by bot labels Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to do To be done tracker Issue tracked by bot
Projects
None yet
Development

No branches or pull requests

1 participant