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

Make parameter generators smarter #149

Closed
ndkoval opened this issue Mar 26, 2023 · 3 comments
Closed

Make parameter generators smarter #149

ndkoval opened this issue Mar 26, 2023 · 3 comments
Assignees

Comments

@ndkoval
Copy link
Collaborator

ndkoval commented Mar 26, 2023

We need custom parameter generators in rare cases, most of which are for testing concurrent Maps or similar data structures. To read/update the same key with higher probability, users often specify a small range for this parameter. Yet, the range size should also depend on the scenario size (the bigger scenario, the more different values).

Do we really need customizing parameters for such scenarios? I believe "no." We can solve the issue more smartly: with some constant probability (e.g., 50%), Lincheck could take an already used value, generating a new one otherwise.

Let's investigate whether this solution fits the practical needs and eliminate custom parameter generators if so.

@alefedor
Copy link
Contributor

There are cases when parameters are not simple integers in some range (e.g., when there are certain requirements on them) and when parameters are of non-primitive types, so custom parameter generators can not be removed.

What I see is:

  1. Generators that re-use generated values with some probability to encourage interesting scenarios as default generators.
  2. Uniform generators (as before) as an option.
  3. Option to define custom generators (as before).

@ndkoval
Copy link
Collaborator Author

ndkoval commented Mar 27, 2023

Hi @alefedor, thanks for the comment. Could you please provide use cases for (2) and (3)?

We are working on a new API, and supporting custom parameter generators is quite painful. Therefore, we are considering removing them entirely and adding them back when requested. However, this is still under discussion.

@ndkoval
Copy link
Collaborator Author

ndkoval commented Mar 30, 2023

Let's keep custom generators for now, but use the suggested strategy in the default ones.

@ndkoval ndkoval changed the title Do we need custom parameter generators? Make parameter generators smarter Mar 30, 2023
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

When branches are created from issues, their pull requests are automatically linked.

3 participants