From 4b4379712d17f66674e260e80fa889547530fa4c Mon Sep 17 00:00:00 2001 From: arvidn Date: Thu, 20 Oct 2022 17:15:51 +0200 Subject: [PATCH] simplify back-end selection in brun, and fix auto-detection --- clvm_tools/cmds.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/clvm_tools/cmds.py b/clvm_tools/cmds.py index 71f8f3e..05c6cbc 100644 --- a/clvm_tools/cmds.py +++ b/clvm_tools/cmds.py @@ -218,15 +218,18 @@ def launch_tool(args, tool_name, default_stage=0): try: output = "(didn't finish)" - use_rust = ( - (tool_name != "run") - and not pre_eval_f - and ( - args.backend == "rust" - or (run_chia_program and args.backend != "python") + if args.backend == "rust": + use_rust = True + elif args.backend == "python": + use_rust = False + else: + use_rust = ( + tool_name != "run" + and not pre_eval_f + and run_chia_program + and args.stage.__name__ == "stages.stage_0" ) - and args.stage == 0 - ) + max_cost = args.max_cost if use_rust: time_parse_input = time.perf_counter()