Skip to content

Heuristics for lengths of sequence-like symbolics #247

@pschanely

Description

@pschanely

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions