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

Introduce deterministic random #178

Merged
merged 6 commits into from
Dec 22, 2023
Merged

Introduce deterministic random #178

merged 6 commits into from
Dec 22, 2023

Conversation

slinkydeveloper
Copy link
Contributor

Fix #155.

Please note that because the JDK UUID class doesn't have a way to specify a seed to its internal RNG, we can't use this Random instance to generate uuids. Perhaps we can re-iterate on this later by adding a method ourselves?

Copy link
Contributor

github-actions bot commented Dec 11, 2023

Test Results

102 files  ±0  102 suites  ±0   10m 32s ⏱️ -27s
  93 tests ±0    93 ✔️ ±0  0 💤 ±0  0 ±0 
232 runs  ±0  232 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 332895f. ± Comparison against base commit baf72af.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Dec 11, 2023

Unit Test Results

  46 files  ±  0    46 suites  ±0   3m 45s ⏱️ -4s
595 tests +18  588 ✔️ +18  7 💤 ±0  0 ±0 
596 runs  +18  589 ✔️ +18  7 💤 ±0  0 ±0 

Results for commit 332895f. ± Comparison against base commit baf72af.

♻️ This comment has been updated with latest results.

@slinkydeveloper slinkydeveloper changed the title Introduce deterministic random [WIP] Introduce deterministic random Dec 11, 2023
@slinkydeveloper slinkydeveloper changed the title [WIP] Introduce deterministic random Introduce deterministic random Dec 22, 2023
Copy link

@igalshilman igalshilman left a comment

Choose a reason for hiding this comment

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

Looks good @slinkydeveloper!

private final Syscalls syscalls;
private boolean seedInitialized = false;

RestateRandom(long randomSeed, Syscalls syscalls) {

Choose a reason for hiding this comment

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

nit: Should this be just BooleanSupplier ?

Copy link
Contributor Author

@slinkydeveloper slinkydeveloper Dec 22, 2023

Choose a reason for hiding this comment

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

I prefer to use Syscalls here, it makes a bit more clear this code.

@slinkydeveloper slinkydeveloper merged commit b715d5b into main Dec 22, 2023
5 checks passed
@slinkydeveloper slinkydeveloper deleted the issues/155 branch December 22, 2023 15:53
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.

Introduce deterministic Random
2 participants