Regression: Change rand() to mt19937() to have same test results on Linux and MacOS#9578
Regression: Change rand() to mt19937() to have same test results on Linux and MacOS#9578fredowski wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
Conversation
rand() produces different sequences on glibc from linux versus Apple libc. mt19937 produces the same sequence on all platforms. This affects 26 tests in gpl and 3 tests in rsz plus the python tests which test the same. This reduces the regression test failures on MacOS from 60 to 11. Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
The new platform deterministic mt19937 random number generator produces new reference files. This commit contains the updated golden reference files. Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
The new platform deterministic mt19937 random number
generator produces different results. This commit
contains the updated json files for the test/orfs tests
Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
|
Note The number of changes in this pull request is too large for Gemini Code Assist to generate a review. |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
There are quite a few failures to address. |
Very strange that //src/pdn/test:pads_black_parrot_flipchip_connect_overpads-tcl_test FAILED in 2.4s fails on CI Bazel while that one passes on debian 13 x86_64 locally. But i noticed already that that one is "flaky". It also fails on MacOS. The test is pass on local Debian 13 aarch64. Fail on MacOS: Golden Reference: It is however unexpected for me that there is a difference between Ubuntu 2204 and Debian 13 both on x86_64. It is the only failing test from the 1212 bazel ones. But that one passes on Ctest: Then from the ctest regression: So there seem to be tests that differ between ctest and bazel and are excluded in bazel. As I only tested in bazel, I did not "see" them failing. The
Strange. Maybe this is also in the category of unexplained differences between ctest and bazel and we exclude that one also from bazel? The other tests seem to be excluded from bazel regular tests because there are unexplained differences between ctest and bazel. I look a little bit closer to the tests which are excluded from bazel. |
rand() is linked from glib on Linux and from some different library on MacOS. The two different versions produce different pseudorandom sequences. This makes the regression results different on Linux and on MacOS. As the "golden" reference files are produced on Linux, the regression fails on MacOS.
This patch changes the rand function in gpl from rand() to mt19937()
I update the reference files accordingly. I do not see how this can have an impact on real functionality. This reduces the number of failed tests for src/... from 60 to 14 on MacOs