Skip to content

FIX: Bug in random generator persistence#331

Merged
adrinjalali merged 3 commits intoskops-dev:mainfrom
BenjaminBossan:fix-random-generator-persistence
Mar 28, 2023
Merged

FIX: Bug in random generator persistence#331
adrinjalali merged 3 commits intoskops-dev:mainfrom
BenjaminBossan:fix-random-generator-persistence

Conversation

@BenjaminBossan
Copy link
Copy Markdown
Collaborator

@BenjaminBossan BenjaminBossan commented Mar 28, 2023

Fixes #329

One of its children was not persisted correctly (pure dict instead of DictNode), which made it impossible to check the untrusted types on it. This fix correctly stores the state as a node.

Note that the old implementation does correctly load the Generator instance, but it doesn't work with anything but trusted=True.

Tests were extended to uncover this bug.

The old persistence scheme was preserved for protocol vesion 0 -- even though it is buggy, it can work under some circumstances.

One of its children was not persisted correctly (pure dict instead of
DictNode), which made it impossible to check the untrusted types on it.
This fix correctly stores the state as a node.

Tests were extended to uncover this bug.

The old persistence scheme was preserved for protocol vesion 0 -- even
though it is buggy, it can work under some circumstances.
@BenjaminBossan
Copy link
Copy Markdown
Collaborator Author

@skops-dev/maintainers ready for review

Copy link
Copy Markdown
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

This needs a changelog, otherwise LGTM.

@adrinjalali adrinjalali merged commit deaf6e2 into skops-dev:main Mar 28, 2023
@BenjaminBossan BenjaminBossan deleted the fix-random-generator-persistence branch March 28, 2023 13:55
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.

Bug: numpy default rng persistence

2 participants