dotnet/runtime · error · RuntimeError

Pass only one tiering option.

Error message

Pass only one tiering option.

What it means

Raised by main() in superpmi_benchmarks.py when both --tiered_compilation and --tiered_pgo are set. The benchmark collection must run with exactly one tiering configuration so results are attributable; passing both is ambiguous.

Source

Thrown at src/coreclr/scripts/superpmi_benchmarks.py:423

        print(f"-strip failed. Copying {old_mch_filename} to {new_mch_filename}.")
        copyfile(old_mch_filename, new_mch_filename)
        copyfile(old_mch_filename + ".mct", new_mch_filename + ".mct")
        return

    # Create toc file
    run_command([mcs_exe, "-toc", new_mch_filename])


def main(main_args):
    """ Main entry point

    Args:
        main_args ([type]): Arguments to the script
    """
    coreclr_args = setup_args(main_args)

    if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:
        raise RuntimeError("Pass only one tiering option.")

    all_output_mch_name = os.path.join(coreclr_args.output_mch_path + "_all.mch")
    build_and_run(coreclr_args, all_output_mch_name)
    if os.path.isfile(all_output_mch_name):
        pass
    else:
        print("No mch file generated.")

    strip_unrelated_mc(coreclr_args, all_output_mch_name, coreclr_args.output_mch_path)


if __name__ == "__main__":
    args = parser.parse_args()
    sys.exit(main(args))

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. Pass only one: use --tiered_pgo OR --tiered_compilation, not both.
  2. If you want a non-tiered baseline, pass neither.
  3. Audit the job's argument template for duplicate tiering flags.

Example fix

// before
--tiered_compilation --tiered_pgo  // raises [192]
// after
--tiered_pgo
Defensive patterns

Strategy: validation

Validate before calling

if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:
    raise SystemExit('pass only one of --tiered_compilation / --tiered_pgo')

Type guard

def tiering_args_consistent(tc, tp) -> bool:
    return not (tc and tp)

Try / catch

try:
    main(args)
except RuntimeError as e:
    if 'only one tiering' in str(e):
        args.tiered_pgo = False  # resolve to one option, then re-run

Prevention

When it happens

Trigger: coreclr_args.tiered_compilation is truthy AND coreclr_args.tiered_pgo is truthy after argparse.

Common situations: Pipeline YAML sets both DOTNET_TieredCompilation and a tiered-pgo flag; copy-paste of args from another scenario; misunderstanding that tiered_pgo implies tiering.

Related errors


AI-assisted analysis of dotnet/runtime@290d5ab72c (2026-08-06). Data as JSON: /api/errors/c78c703963756b6f. Report an issue: GitHub.