{"record":{"id":"f1359c493218d4de","repo":"dotnet/runtime","slug":"tiering-options-have-no-effect-for-pmi-or-crossgen","errorCode":null,"errorMessage":"Tiering options have no effect for pmi or crossgen2 collections.","messagePattern":"Tiering options have no effect for pmi or crossgen2 collections\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":717,"sourceCode":"\n        self.superpmi_path = determine_superpmi_tool_path(coreclr_args)\n        self.mcs_path = determine_mcs_tool_path(coreclr_args)\n\n        self.collection_command = coreclr_args.collection_command\n        self.collection_args = coreclr_args.collection_args\n\n        if coreclr_args.pmi:\n            self.pmi_location = determine_pmi_location(coreclr_args)\n            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)\n\n        if coreclr_args.crossgen2:\n            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)\n\n        if coreclr_args.pmi or coreclr_args.crossgen2:\n            self.assemblies = coreclr_args.assemblies\n            self.exclude = coreclr_args.exclude\n            if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:\n               raise RuntimeError(\"Tiering options have no effect for pmi or crossgen2 collections.\")\n\n        if coreclr_args.nativeaot:\n            self.ilc_rsps = coreclr_args.ilc_rsps\n            self.exclude = coreclr_args.exclude\n            if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:\n                raise RuntimeError(\"Tiering options have no effect for nativeaot collections.\")\n\n        if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:\n            raise RuntimeError(\"Pass only one tiering option.\")\n\n        self.coreclr_args = coreclr_args\n\n        self.temp_location = None\n\n        # Pathname for a temporary .MCL file used for noticing SuperPMI replay failures against base MCH.\n        self.base_fail_mcl_file = None\n\n        # The base .MCH file path","sourceCodeStart":699,"sourceCodeEnd":735,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi.py#L699-L735","documentation":"Thrown by SuperPMICollect.__init__() when the user requests a PMI or crossgen2 collection mode (--pmi or --crossgen2) and simultaneously passes --tiered_compilation or --tiered_pgo. Tiered compilation and tiered PGO are runtime JIT behaviors that only apply when the JIT is invoked through the normal runtime path; PMI and crossgen2 invoke the JIT directly at compile time (AOT-style), making tiering options meaningless and potentially misleading.","triggerScenarios":"At lines 713-717: if coreclr_args.pmi or coreclr_args.crossgen2, and (coreclr_args.tiered_compilation or coreclr_args.tiered_pgo), line 717 raises. The combination is explicitly rejected because tiering has no effect on PMI/crossgen2 compilation.","commonSituations":"A developer copies flags from a runtime benchmarking command and adds them to a SuperPMI collect command without realizing PMI and crossgen2 don't support tiering. Misunderstanding that SuperPMI PMI collections capture single-tier JIT output for deterministic replay, and tiering would introduce non-determinism.","solutions":["Remove --tiered_compilation and --tiered_pgo flags when using --pmi or --crossgen2 with superpmi.py collect.","If you need tiered compilation data, use the default collection mode (a collection command) instead of --pmi or --crossgen2.","Understand that PMI and crossgen2 produce deterministic single-tier output; tiering cannot be applied to these collection types."],"exampleFix":"# before: incompatible flags\npython superpmi.py collect --pmi -assemblies ./libs --tiered_pgo\n\n# after: remove tiering flags for pmi/crossgen2\npython superpmi.py collect --pmi -assemblies ./libs","handlingStrategy":"validation","validationCode":"# Validate argument compatibility before calling SuperPMICollect\nif (coreclr_args.pmi or coreclr_args.crossgen2):\n    if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:\n        raise ValueError('Tiering options (--tiered_compilation, --tiered_pgo) are incompatible with --pmi or --crossgen2')","typeGuard":"def is_valid_collection_mode_combo(pmi: bool, crossgen2: bool, tiered_compilation: bool, tiered_pgo: bool) -> bool:\n    if pmi or crossgen2:\n        return not (tiered_compilation or tiered_pgo)\n    return True","tryCatchPattern":"try:\n    collector = SuperPMICollect(coreclr_args)\nexcept RuntimeError as e:\n    if 'Tiering options have no effect for pmi or crossgen2' in str(e):\n        logging.error('Remove --tiered_compilation and --tiered_pgo when using --pmi or --crossgen2')\n        sys.exit(1)\n    raise","preventionTips":["Never combine --tiered_compilation or --tiered_pgo with --pmi or --crossgen2.","Understand that PMI and crossgen2 produce deterministic single-tier JIT output.","If tiering investigation is needed, use the default collection command mode, not --pmi."],"tags":["superpmi","validation","tiering","pmi","crossgen2","collect"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}