ir3/bisect: fix off-by-one issues while bisecting
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Fixes two separate issues:
- Getting stuck when ending up with a list of 2 ids;
- Removing a potential bad id.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38993>
This commit is contained in:
Job Noorman 2025-12-17 11:58:34 +01:00 committed by Marge Bot
parent 3c5c96fedb
commit f601aa5ce7

View file

@ -32,7 +32,7 @@ def bisect(args):
while len(ids) > 1: while len(ids) > 1:
lo_id = 0 lo_id = 0
hi_id = len(ids) // 2 hi_id = len(ids) // 2 - 1
lo = ids[lo_id] lo = ids[lo_id]
hi = ids[hi_id] hi = ids[hi_id]
extra_env = { extra_env = {
@ -44,7 +44,7 @@ def bisect(args):
if was_good(): if was_good():
del ids[lo_id:hi_id + 1] del ids[lo_id:hi_id + 1]
else: else:
del ids[hi_id:] del ids[hi_id + 1:]
print(ids) print(ids)