{"record":{"id":"c78c703963756b6f","repo":"dotnet/runtime","slug":"pass-only-one-tiering-option-c78c70","errorCode":null,"errorMessage":"Pass only one tiering option.","messagePattern":"Pass only one tiering option\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi_benchmarks.py","lineNumber":423,"sourceCode":"        print(f\"-strip failed. Copying {old_mch_filename} to {new_mch_filename}.\")\n        copyfile(old_mch_filename, new_mch_filename)\n        copyfile(old_mch_filename + \".mct\", new_mch_filename + \".mct\")\n        return\n\n    # Create toc file\n    run_command([mcs_exe, \"-toc\", new_mch_filename])\n\n\ndef main(main_args):\n    \"\"\" Main entry point\n\n    Args:\n        main_args ([type]): Arguments to the script\n    \"\"\"\n    coreclr_args = setup_args(main_args)\n\n    if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:\n        raise RuntimeError(\"Pass only one tiering option.\")\n\n    all_output_mch_name = os.path.join(coreclr_args.output_mch_path + \"_all.mch\")\n    build_and_run(coreclr_args, all_output_mch_name)\n    if os.path.isfile(all_output_mch_name):\n        pass\n    else:\n        print(\"No mch file generated.\")\n\n    strip_unrelated_mc(coreclr_args, all_output_mch_name, coreclr_args.output_mch_path)\n\n\nif __name__ == \"__main__\":\n    args = parser.parse_args()\n    sys.exit(main(args))\n","sourceCodeStart":405,"sourceCodeEnd":438,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi_benchmarks.py#L405-L438","documentation":"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.","triggerScenarios":"coreclr_args.tiered_compilation is truthy AND coreclr_args.tiered_pgo is truthy after argparse.","commonSituations":"Pipeline YAML sets both DOTNET_TieredCompilation and a tiered-pgo flag; copy-paste of args from another scenario; misunderstanding that tiered_pgo implies tiering.","solutions":["Pass only one: use --tiered_pgo OR --tiered_compilation, not both.","If you want a non-tiered baseline, pass neither.","Audit the job's argument template for duplicate tiering flags."],"exampleFix":"// before\n--tiered_compilation --tiered_pgo  // raises [192]\n// after\n--tiered_pgo","handlingStrategy":"validation","validationCode":"if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:\n    raise SystemExit('pass only one of --tiered_compilation / --tiered_pgo')","typeGuard":"def tiering_args_consistent(tc, tp) -> bool:\n    return not (tc and tp)","tryCatchPattern":"try:\n    main(args)\nexcept RuntimeError as e:\n    if 'only one tiering' in str(e):\n        args.tiered_pgo = False  # resolve to one option, then re-run","preventionTips":["Document the mutual-exclusion in arg help text","Use argparse mutually_exclusive_group","Audit YAML templates for duplicate tiering flags"],"tags":["configuration","benchmarks","superpmi","jit"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}