nir/shader_bisect: Allow passing in a --lo / --hi to continue a run.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Sometimes you fumble an answer, and would like to not restart from the
beginning (or just want to see the behavior of the script late in the run
if you're debugging it).  Pass in the last bad range, and you can keep
going.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38760>
This commit is contained in:
Emma Anholt 2025-12-01 10:46:17 -08:00 committed by Marge Bot
parent 4287bb761e
commit 66b157095c

View file

@ -47,10 +47,8 @@ def was_good():
def bisect(args): def bisect(args):
lo = 0 lo = f'{args.lo:064x}'
hi = (1 << (8 * 32)) - 1 hi = f'{args.hi:064x}'
lo = f'{lo:064x}'
hi = f'{hi:064x}'
# Do an initial run to sanity check that the user has actually made # Do an initial run to sanity check that the user has actually made
# nir_shader_bisect_select() select some broken behavior. # nir_shader_bisect_select() select some broken behavior.
@ -95,6 +93,12 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-d', '--debug', action='store_true') parser.add_argument('-d', '--debug', action='store_true')
parser.add_argument('--lo', type=lambda x: int(x, base=16),
default=0,
help="NIR_SHADER_BISECT_LO from a bad range, to continue a cancelled run")
parser.add_argument('--hi', type=lambda x: int(x, base=16),
default=(1 << (8 * 32)) - 1,
help="NIR_SHADER_BISECT_HI from a bad range, to continue a cancelled run")
parser.add_argument('cmd') parser.add_argument('cmd')
parser.add_argument('cmd_args', nargs=argparse.REMAINDER) parser.add_argument('cmd_args', nargs=argparse.REMAINDER)
args = parser.parse_args() args = parser.parse_args()