Repository navigation
Revert "fix(base): stop list searches when the result is known (#1548)" - #1629
Merged
Merged
Conversation
This reverts commit 32d23b4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1616.
Reverts #1548 (32d23b4). After #1548,
List.all/any/find/containsmatch the tail before the head's result is used, so with an erased tail (h <> t) the call stays stuck even when the head decides it. Lemmas likeList.all(f, 5n <> t) == Falsestopped checking, and bend-mathlib lost 23 defs.We tried keeping the early stop in Base only (checking the head before the tail). That fixed the one-element case but not
1n <> 5n <> t, which v2.0.37 proved. Matching the flag first is rejected by the termination check, so the shape can't be fixed without a checker change.Cost of the revert: list searches on very long lists (50k) overflow the stack again and lose the early stop. That overflow is the known host-stack limit in WONTFIX.txt.
Test:
tests/base/list_search_head.bend(one- and two-element head-decides cases) fails on main and passes here.tests/base/list_search.bendfrom #1548 is removed with the revert.Gates: repo 54/54, test 1648/1648, perf 124/124, ping 62/62. Not run: safe, Linux, CUDA.