-
Notifications
You must be signed in to change notification settings - Fork 104
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 random function to make CI reproducible #665
base: main
Are you sure you want to change the base?
replace random function to make CI reproducible #665
Conversation
…d a seed that will be set and printed in the start of test_curve_api. Additionally now ctest outputs console on failed runs. Signed-off-by: Koren-Brand <koren@ingonyama.com>
Signed-off-by: Koren-Brand <koren@ingonyama.com>
Signed-off-by: Koren-Brand <koren@ingonyama.com>
Signed-off-by: Koren-Brand <koren@ingonyama.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good initiative
icicle/include/icicle/fields/field.h
Outdated
Field value{}; | ||
for (unsigned i = 0; i < TLC; i++) | ||
value.limbs_storage.limbs[i] = distribution(generator); | ||
value.limbs_storage.limbs[i] = rand(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe assert that limbs is 4 bytes here because rand() returns int. Otherwise if limbs is 64b then you don't randomize all numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of limbs_storage in field is uint32 so it is an exact fit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently, rand has a maximal value of 2^15 - 1 so another solution might be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved but please see the comment
Signed-off-by: Koren-Brand <koren@ingonyama.com>
Signed-off-by: Koren-Brand <koren@ingonyama.com>
icicle/include/icicle/fields/field.h
Outdated
@@ -689,14 +689,18 @@ class Field | |||
return rv; | |||
} | |||
|
|||
inline static std::mt19937 field_rand_generator = std::mt19937{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better if you moved all of this to utils and use it here from utils.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a good idea
Signed-off-by: Koren-Brand <koren@ingonyama.com>
Signed-off-by: Koren-Brand <koren@ingonyama.com>
icicle/include/icicle/fields/field.h
Outdated
@@ -24,6 +24,7 @@ | |||
#endif // __CUDACC__ | |||
|
|||
#include "icicle/errors.h" | |||
#include "icicle/utils/rand_gen.cpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to rename it to rand_gen.h
Signed-off-by: Koren-Brand <koren@ingonyama.com>
Describe the changes
This PR changes random generation to be based on rand such that bugs could be effectively reproduced.
Ctest (CI) Now outputs test log on test failure
Linked Issues
Resolves #