Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

✨(worker) Add support for non-serializable data in workers #4063

Merged
merged 45 commits into from
Mar 26, 2024

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Jul 10, 2023

Requirements:

  • getState and fromState in pure-rand
  • expose it in Random (as in this PR)
  • update of the API of property, ideally we should be able to link generate output to a run (except cloned case or including it)
  • add opt-out for this mode
  • handle no shrink (via property being able to track the generate output and know we failed to send it)

Category:

  • ✨ Introduce new features
  • 📝 Add or update documentation
  • ✅ Add or update tests
  • 🐛 Fix a bug
  • 🏷️ Add or update types
  • ⚡️ Improve performance
  • Other(s): ...

Potential impacts:

  • Generated values
  • Shrink values
  • Performance
  • Typings
  • Other(s): ...

Requirements:
- getState and fromState in pure-rand
- expose it in Random (as in this PR)
- update of the API of property, ideally we should be able to link generate output to a run (except cloned case or including it)
- add opt-out for this mode
- handle no shrink (via property being able to track the generate output and know we failed to send it)
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 10, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e1af65e:

Sandbox Source
@fast-check/examples Configuration

@dubzzz dubzzz added the 🧪 Experiment Performing some experiments for potential future features implying deep changes label Aug 30, 2023
dubzzz added a commit to dubzzz/pure-rand that referenced this pull request Mar 20, 2024
Exposing the internal state of our generators is a requirement for some extra features on fast-check (see dubzzz/fast-check#4063).

This PR only adds the capability on the type definition of our `RandomGenerator`. Next PRs will connect it generator by generator.
dubzzz added a commit to dubzzz/pure-rand that referenced this pull request Mar 20, 2024
Exposing the internal state of our generators is a requirement for some extra features on fast-check (see dubzzz/fast-check#4063).

This PR only adds the capability on the type definition of our `RandomGenerator`. Next PRs will connect it generator by generator.
dubzzz added a commit that referenced this pull request Mar 20, 2024
In the context of #4063, we need to have an access onto the internal state of the PRNG backing the instance of `Random` in order to be able to serialize it and recreate the "exact" same instance of `Random` on destination (another worker thread).

The current PR adds a `getState` method on `Random`.

Adding it should be enough to fulfill the needs of #4063. But we will wait for it to be confirmed before releasing any minor version including that change.
@dubzzz dubzzz changed the title ✨ Add support for non-serializable data in workers ✨(worker) Add support for non-serializable data in workers Mar 20, 2024
dubzzz added a commit that referenced this pull request Mar 20, 2024
In the context of #4063, we need to have an access onto the internal state of the PRNG backing the instance of `Random` in order to be able to serialize it and recreate the "exact" same instance of `Random` on destination (another worker thread).

The current PR adds a `getState` method on `Random`.

Adding it should be enough to fulfill the needs of #4063. But we will wait for it to be confirmed before releasing any minor version including that change.
Copy link
Contributor

👋 A preview of the new documentation is available at: http://65fb6560b19da7330078ba0a--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://65fb67acfb208c32cb9b7b68--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://65fb6bddc9fa883ada18b918--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://65fcdb136148eca5e59c6716--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://65ff1e0beb2037344a1face0--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://65ff2501ab32b239e58e16f5--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://65fff8e7ab32b2be0d8e170f--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://65ffff4689da71c02b192e78--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://6600465b159c7ff4afcec124--dubzzz-fast-check.netlify.app

@dubzzz dubzzz removed the 🧪 Experiment Performing some experiments for potential future features implying deep changes label Mar 25, 2024
@dubzzz dubzzz enabled auto-merge (squash) March 25, 2024 08:01
Copy link
Contributor

👋 A preview of the new documentation is available at: http://66012f7fe8ba20905499cbb8--dubzzz-fast-check.netlify.app

Copy link
Contributor

👋 A preview of the new documentation is available at: http://660280adc1dfcfba814875c7--dubzzz-fast-check.netlify.app

@dubzzz dubzzz merged commit 0c23121 into main Mar 26, 2024
50 checks passed
@dubzzz dubzzz deleted the worker-non-serializable branch March 26, 2024 08: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