aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect/minimize
Commit message (Collapse)AuthorAgeFilesLines
* all: use any instead of interface{}Dmitry Vyukov2025-12-221-2/+2
| | | | Any is the preferred over interface{} now in Go.
* all: remove loop variables scopingTaras Madan2025-02-171-1/+0
|
* all: use min/max functionsDmitry Vyukov2025-01-171-4/+1
| | | | They are shorter, more readable, and don't require temp vars.
* pkg/bisect/minimize: introduce SliceWithFixedAleksandr Nogikh2024-08-272-0/+73
| | | | | The function is similar to minimize.Slice(), but it allows to designate a subset of slice elements that must always remain.
* pkg/bisect: add a generic slice minimization algorithmAleksandr Nogikh2023-07-072-0/+343
Given a set of chunks and a predicate, the algorithm does the following: a) If the chunk is not needed (*), drop it. b) Split the chunk in two and attempt to drop these halves individually. Optimizations are applied to avoid unneeded predicate invokations. Also, the algorithm proceeds from larger to smaller chunks, thus providing on average the best possible result at each step. This represents the generic functionality needed both for program bisection in pkg/repro and kernel config bisection in pkg/kconfig. (*) Needed means that the predicate returns true when the chunk is present and false when it's removed.