diff --git a/hypothesis-python/RELEASE.rst b/hypothesis-python/RELEASE.rst index 622f60af66..c1d7c9a37f 100644 --- a/hypothesis-python/RELEASE.rst +++ b/hypothesis-python/RELEASE.rst @@ -1,7 +1,7 @@ RELEASE_TYPE: minor -This release migrates the shrinker to our new internal representation, called the IR layer (:pull:`3962`). This greatly improves the shrinker's performance in the majority of cases. For example, on the Hypothesis test suite, shrinking is a median of 2.12x faster. +This release migrates the shrinker to our new internal representation, called the IR layer (:pull:`3962`). This improves the shrinker's performance in the majority of cases. For example, on the Hypothesis test suite, shrinking is a median of 1.38x faster. -It is possible this release regresses performance while shrinking certain strategies. If you encounter strategies where shrinking is slower than it used to be (or is slow at all), please open an issue! +It is possible this release regresses performance while shrinking certain strategies. If you encounter strategies which reliably shrink more slowly than they used to (or shrink slowly at all), please open an issue! You can read more about the IR layer at :issue:`3921`. diff --git a/hypothesis-python/src/hypothesis/internal/conjecture/engine.py b/hypothesis-python/src/hypothesis/internal/conjecture/engine.py index 54377b8776..89a8c7829c 100644 --- a/hypothesis-python/src/hypothesis/internal/conjecture/engine.py +++ b/hypothesis-python/src/hypothesis/internal/conjecture/engine.py @@ -342,7 +342,7 @@ def _cache_key_ir( for node in nodes + extension ) - def _cache(self, data: Union[ConjectureData, ConjectureResult]) -> None: + def _cache(self, data: ConjectureData) -> None: result = data.as_result() # when we shrink, we try out of bounds things, which can lead to the same # data.buffer having multiple outcomes. eg data.buffer=b'' is Status.OVERRUN diff --git a/hypothesis-python/tests/cover/test_stateful.py b/hypothesis-python/tests/cover/test_stateful.py index 6709a71153..094560c999 100644 --- a/hypothesis-python/tests/cover/test_stateful.py +++ b/hypothesis-python/tests/cover/test_stateful.py @@ -798,8 +798,8 @@ def fail(self, source): result = "\n".join(err.value.__notes__) for m in ["create", "transfer", "fail"]: - # TODO_BETTER_SHRINK: minimal here has 1 state each, not <= 2. - assert result.count("state." + m) <= 2 + # TODO_BETTER_SHRINK: minimal here has 1 state each. + assert result.count("state." + m) <= 3 assert "b1_0 = state.create()" in result # TODO_BETTER_SHRINK: should only be the source=b1_0 case, but sometimes we can't # discover that. (related to the above better_shrink comment).