Skip to content

Reset the random streams before every replayed record - #25

Merged
LuShadowX merged 1 commit into
mainfrom
reseed-per-record
Aug 8, 2026
Merged

Reset the random streams before every replayed record#25
LuShadowX merged 1 commit into
mainfrom
reseed-per-record

Conversation

@LuShadowX

Copy link
Copy Markdown
Owner

random.seed(0) ran once per replay process, so the records shared one stream.
A candidate that changes how many values one function draws shifts every
record after it, and a function nobody touched is reported as different.

Reproduced with two functions, one drawing randoms and one merely formatting
one: adding a single extra draw to the first made the second report 2 of 2
inputs differ. It was never edited.

That is a false positive, which is the one error this tool cannot afford, and
it was reachable by any refactor touching random use. Reseeding per record
costs nothing and hides nothing: a function that stops using randomness still
returns something other than the seeded value, so real changes are still
caught. The regression test is the reproduction.

random.seed(0) ran once per replay process, so the records shared one stream.
A candidate that changes how many values one function draws shifts every
record after it, and a function nobody touched is reported as different.

Reproduced with two functions, one drawing randoms and one merely formatting
one: adding a single extra draw to the first made the second report 2 of 2
inputs differ. It was never edited.

That is a false positive, which is the one error this tool cannot afford, and
it was reachable by any refactor touching random use. Reseeding per record
costs nothing and hides nothing: a function that stops using randomness still
returns something other than the seeded value, so real changes are still
caught. The regression test is the reproduction.
@LuShadowX
LuShadowX merged commit a9a8c5b into main Aug 8, 2026
10 checks passed
@LuShadowX
LuShadowX deleted the reseed-per-record branch August 8, 2026 05:04
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