Skip to content
New issue

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

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

Already on GitHub? # to your account

tests: map: Enhance random number generator #209

Merged
merged 5 commits into from
Sep 5, 2023

Conversation

visitorckw
Copy link
Collaborator

Enhanced randomness and broader range by replacing the rand() function with the mt19937 32-bit algorithm in test-map.c. Verified correctness by comparing output for the top 10000 generated random numbers with all seeds in the [0, 10000) range against GCC 9.4.0 --std=c++11 implementation of mt19937, confirming identical behavior.

Enhanced randomness and broader range by replacing the rand() function
with the mt19937 32-bit algorithm in test-map.c. Verified correctness
by comparing output for the top 10000 generated random numbers with all
seeds in the [0, 10000) range against GCC 9.4.0 --std=c++11
implementation of mt19937, confirming identical behavior.
@jserv jserv requested a review from EagleTw September 4, 2023 15:41
@EagleTw
Copy link
Collaborator

EagleTw commented Sep 5, 2023

I'm not sure whether not passing "CI / arch-tests (pull_request)" is okay for check-in code.

@jserv
Copy link
Contributor

jserv commented Sep 5, 2023

I'm not sure whether not passing "CI / arch-tests (pull_request)" is okay for check-in code.

@qwe661234 will resolve architecture test regressions.

@jserv jserv changed the title Enhance random number generator in test-map.c tests: map: Enhance random number generator Sep 5, 2023
@jserv jserv merged commit 1c45d0a into sysprog21:master Sep 5, 2023
@visitorckw visitorckw deleted the feat/enhanced-rng-mt19937 branch October 21, 2023 21:13
vestata pushed a commit to vestata/rv32emu that referenced this pull request Jan 24, 2025
Enhanced randomness and broader range by replacing the rand() function
with the mt19937 32-bit algorithm in test-map.c. Verified correctness
by comparing output for the top 10000 generated random numbers with all
seeds in the [0, 10000) range against GCC 9.4.0 --std=c++11
implementation of mt19937, confirming identical behavior.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants