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

Heuristics for lengths of sequence-like symbolics #247

Open
pschanely opened this issue Mar 9, 2024 · 0 comments
Open

Heuristics for lengths of sequence-like symbolics #247

pschanely opened this issue Mar 9, 2024 · 0 comments

Comments

@pschanely
Copy link
Owner

pschanely commented Mar 9, 2024

Is your feature request related to a problem? Please describe.
CrossHair doesn't have amazing performance on the "How not to sort by a partial order" hypothesis example, here. (using the new provider-plugins capability)

Describe the solution you'd like
I noticed that a good heuristic would be to try making sequence-like symbolic types (str, bytes, list, tuple, set, dict) be the same size, or perhaps be the same size when generated at the same stack trace. Not sure exactly how that would work though. Note also that care would need to be taken to prevent the generation of infinite data structures.

For that matter, some early runs where everything is empty, and then everything is a singleton, etc, would be good early explorations.

That said, our hypothesis integration is too low-level to actually understand what determines container lengths, so this solution doesn't actually help the original use case. Still, I like the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant