Skip to content

Revert "fix(base): stop list searches when the result is known (#1548)" - #1629

Merged
Lorenzobattistela merged 1 commit into
mainfrom
revert-1548-list-search
Oct 16, 2026
Merged

Lorenzobattistela merged 1 commit into
mainfrom
revert-1548-list-search

Conversation

@Lorenzobattistela

Copy link
Copy Markdown
Collaborator

Fixes #1616.

Reverts #1548 (32d23b4). After #1548, List.all/any/find/contains match 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 like List.all(f, 5n <> t) == False stopped 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.bend from #1548 is removed with the revert.

Gates: repo 54/54, test 1648/1648, perf 124/124, ping 62/62. Not run: safe, Linux, CUDA.

@Lorenzobattistela Lorenzobattistela self-assigned this Oct 16, 2026
@Lorenzobattistela
Lorenzobattistela merged commit e5527d5 into main Oct 16, 2026
1 check passed
@Lorenzobattistela
Lorenzobattistela deleted the revert-1548-list-search branch October 16, 2026 21:48
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

Successfully merging this pull request may close these issues.

Since #1548, List.all/any/find/contains of h <> t stay stuck when h decides the result, so a lemma over an erased tail has no proof

1 participant