From 66b157095c8a15dfae9235fc6dcd10184ba7c40b Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Mon, 1 Dec 2025 10:46:17 -0800 Subject: [PATCH] nir/shader_bisect: Allow passing in a --lo / --hi to continue a 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: --- src/compiler/nir/nir_shader_bisect.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/compiler/nir/nir_shader_bisect.py b/src/compiler/nir/nir_shader_bisect.py index a2b1cc49abd..d0fc5ea59ae 100755 --- a/src/compiler/nir/nir_shader_bisect.py +++ b/src/compiler/nir/nir_shader_bisect.py @@ -47,10 +47,8 @@ def was_good(): def bisect(args): - lo = 0 - hi = (1 << (8 * 32)) - 1 - lo = f'{lo:064x}' - hi = f'{hi:064x}' + lo = f'{args.lo:064x}' + hi = f'{args.hi:064x}' # Do an initial run to sanity check that the user has actually made # nir_shader_bisect_select() select some broken behavior. @@ -95,6 +93,12 @@ if __name__ == '__main__': parser = argparse.ArgumentParser() 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_args', nargs=argparse.REMAINDER) args = parser.parse_args()