From f601aa5ce7578c4aaf4408e9d7cdbd9ea6bf8015 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Wed, 17 Dec 2025 11:58:34 +0100 Subject: [PATCH] ir3/bisect: fix off-by-one issues while bisecting 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 Part-of: --- src/freedreno/ir3/ir3_shader_bisect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/ir3/ir3_shader_bisect.py b/src/freedreno/ir3/ir3_shader_bisect.py index 31f6b9d0bfc..fcb68062c20 100644 --- a/src/freedreno/ir3/ir3_shader_bisect.py +++ b/src/freedreno/ir3/ir3_shader_bisect.py @@ -32,7 +32,7 @@ def bisect(args): while len(ids) > 1: lo_id = 0 - hi_id = len(ids) // 2 + hi_id = len(ids) // 2 - 1 lo = ids[lo_id] hi = ids[hi_id] extra_env = { @@ -44,7 +44,7 @@ def bisect(args): if was_good(): del ids[lo_id:hi_id + 1] else: - del ids[hi_id:] + del ids[hi_id + 1:] print(ids)