Skip to content

Seed the two unseeded RNG uniformity tests so they cannot fail by chance - #728

Open
ciaranra wants to merge 1 commit into
devfrom
seed-unseeded-rng-uniformity-tests
Open

Seed the two unseeded RNG uniformity tests so they cannot fail by chance#728
ciaranra wants to merge 1 commit into
devfrom
seed-unseeded-rng-uniformity-tests

Conversation

@ciaranra

@ciaranra ciaranra commented Sep 6, 2026

Copy link
Copy Markdown
Member

Summary

test_randint_uniformity and test_choice_uniformity in python/pecos-rslib/tests/test_numpy_random_comparison.py run a chi-square test at p > 0.01 on unseeded draws. By construction that fails about one CI run in a hundred; it took down the pr-core-python (rest) shard on #711 (p=0.0093) for a change that does not touch the RNG.

Every other statistical test in the file already calls pc.random.seed(...) "for deterministic test behavior". This applies the same convention to the two that were missed, with seeds not used elsewhere in the file.

Verification

uv run --frozen pytest python/pecos-rslib/tests/test_numpy_random_comparison.py -k uniformity

4 passed. pre-commit run --files on the changed file: all hooks pass.

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.

1 participant