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

Replace rand() with rand_uint_32b() for reproducibility #674

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

Koren-Brand
Copy link
Contributor

@Koren-Brand Koren-Brand commented Dec 4, 2024

Continuation of the previous rand PR - replacing every place rand() is called with a new rand_int function based on the same rand_generator in rand_gen.h - making test runs deterministic when given a fixed seed (Aiding debugging).

Signed-off-by: Koren-Brand <koren@ingonyama.com>
@yshekel yshekel changed the title Changed every instance of rand() to use rand_int instead Replace rand() with rand_int() for reproducibility Dec 4, 2024
icicle/tests/test_base.h Outdated Show resolved Hide resolved
icicle/tests/test_base.h Outdated Show resolved Hide resolved
Copy link
Contributor

@mickeyasa mickeyasa left a comment

Choose a reason for hiding this comment

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

great initiative

…test_hash_api's randomise function to use rand_uint_32b instead of just rand_generator

Signed-off-by: Koren-Brand <koren@ingonyama.com>
Signed-off-by: Koren-Brand <koren@ingonyama.com>
@Koren-Brand Koren-Brand changed the title Replace rand() with rand_int() for reproducibility Replace rand() with rand_uint_32b() for reproducibility Dec 5, 2024
Copy link
Collaborator

@yshekel yshekel left a comment

Choose a reason for hiding this comment

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

nice

…hat size_out is non-negative

Signed-off-by: Koren-Brand <koren@ingonyama.com>
@yshekel yshekel merged commit 41c01ce into main Dec 5, 2024
29 checks passed
@yshekel yshekel deleted the koren/rand_with_seed_fix_where_it_wasnt_changed branch December 5, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants