ir3/shader_bisect: Allow a 'r' response to retry a run mid-bisect.

Sometimes it takes a minute to get to the failing scene and I get
distracted and miss it, but don't want to lose the whole run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41665>
This commit is contained in:
Emma Anholt 2026-05-11 16:10:50 -07:00 committed by Marge Bot
parent 09a71809e0
commit 2af9c035fd

View file

@ -16,14 +16,6 @@ def dump(args):
run(args.cmd, extra_env)
def was_good():
while True:
response = input('Was the previous run [g]ood or [b]ad? ')
if response in ('g', 'b'):
return response == 'g'
def bisect(args):
with open(args.input, 'r') as f:
ids = [l.strip() for l in f.readlines()]
@ -42,10 +34,15 @@ def bisect(args):
print(f'Bisecting between {lo} and {hi} ({len(ids)} shaders remaining)')
run(args.cmd, extra_env)
if was_good():
del ids[lo_id:hi_id + 1]
else:
del ids[hi_id + 1:]
while True:
response = input('Was the previous run [g]ood or [b]ad, or [r]etry? ')
if response in ('g', 'b', 'r'):
if response == 'g':
del ids[lo_id:hi_id + 1]
elif response == 'b':
del ids[hi_id + 1:]
break
print(ids)