{"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/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi_benchmarks.py#L405-L438","documentation":"Raised by superpmi_benchmarks.py main() at src/coreclr/scripts/superpmi_benchmarks.py:423 when both --tiered_compilation and --tiered_pgo are passed. The two are mutually exclusive: --tiered_pgo already implies tiered compilation (it sets both DOTNET_TieredCompilation=1 and DOTNET_TieredPGO=1), and a benchmark collection must isolate a single tiering configuration.","triggerScenarios":"Invoking superpmi_benchmarks.py with both --tiered_compilation and --tiered_pgo on the same command line.","commonSituations":"Copy-pasting flags from two different pipeline jobs; assuming more flags = broader coverage.","solutions":["Pass exactly one of --tiered_compilation or --tiered_pgo (or neither for the default).","If you want PGO, use only --tiered_pgo.","If you want tiered compilation without PGO, use only --tiered_compilation."],"exampleFix":"// before\npython superpmi_benchmarks.py ... --tiered_compilation --tiered_pgo\n// after\npython superpmi_benchmarks.py ... --tiered_pgo","handlingStrategy":"validation","validationCode":"if args.tiered_compilation and args.tiered_pgo:\n    parser.error('Pass only one tiering option: --tiered_compilation or --tiered_pgo, not both.')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare the two flags in an argparse mutually exclusive group (add_mutually_exclusive_group) so argparse rejects the combination."],"tags":["dotnet","coreclr","superpmi","benchmarks","jit","configuration"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}