{"record":{"id":"531c00ed64990d67","repo":"dotnet/runtime","slug":"invalid-summary-type-coreclr-args-summary-type","errorCode":null,"errorMessage":"Invalid summary_type: {coreclr_args.summary_type}","messagePattern":"Invalid summary_type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":4697,"sourceCode":"\ndef summarize_json_summaries(coreclr_args):\n    logging.info(\"Summarizing {} files:\".format(coreclr_args.summary_type))\n    for file in coreclr_args.summaries:\n        logging.info(\"  {}\".format(file))\n\n    summary_type_to_prefix = {\n        \"asmdiffs\": \"diff\",\n        \"metricdiff\": \"metricdiff\",\n        \"tpdiff\": \"tpdiff\",\n    }\n\n    if coreclr_args.summary_type not in summary_type_to_prefix:\n        logging.error(\n            \"Invalid summary_type '%s'. Valid values are: %s\",\n            coreclr_args.summary_type,\n            \", \".join(sorted(summary_type_to_prefix.keys())),\n        )\n        raise ValueError(f\"Invalid summary_type: {coreclr_args.summary_type}\")\n\n    file_name_prefix = summary_type_to_prefix[coreclr_args.summary_type]\n    if coreclr_args.output_long_summary_path:\n        overall_md_summary_file = coreclr_args.output_long_summary_path\n    else:\n        overall_md_summary_file = create_unique_file_name(coreclr_args.spmi_location, file_name_prefix + \"_summary\", \"md\")\n        if os.path.isfile(overall_md_summary_file):\n            os.remove(overall_md_summary_file)\n\n    short_md_summary_file = create_unique_file_name(coreclr_args.spmi_location, file_name_prefix + \"_short_summary\", \"md\")\n    if os.path.isfile(short_md_summary_file):\n        os.remove(short_md_summary_file)\n\n    if coreclr_args.summary_type == \"asmdiffs\":\n        base_jit_options = []\n        diff_jit_options = []\n        summarizable_asm_diffs = []\n","sourceCodeStart":4679,"sourceCodeEnd":4715,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi.py#L4679-L4715","documentation":"Raised as a ValueError (not RuntimeError) by summarize_json_summaries when coreclr_args.summary_type is not one of the three supported keys: 'asmdiffs', 'metricdiff', or 'tpdiff'. The summary_type selects which JSON summary format to aggregate and which output filename prefix to use, so an unknown value cannot be mapped. The valid set is logged just before the raise.","triggerScenarios":"Called in the 'summary' subcommand path: after logging the invalid value and the list of valid values, if coreclr_args.summary_type not in {'asmdiffs','metricdiff','tpdiff'} the ValueError is raised. Occurs when --summary_type is omitted but defaults to something invalid, mistyped (e.g. 'asm-diffs', 'asmdiff'), or a new summary kind that hasn't been registered in summary_type_to_prefix.","commonSituations":"Typo in --summary_type (e.g. 'asmdiff' instead of 'asmdiffs', 'tp' instead of 'tpdiff'); invoking summarize with a summary_type from a newer/older tool version; a CI script passing the wrong token.","solutions":["Pass one of the documented values: --summary_type asmdiffs | metricdiff | tpdiff.","Check the error log line immediately preceding the exception, which prints the accepted values.","If adding a new summary kind, extend the summary_type_to_prefix dict in summarize_json_summaries."],"exampleFix":"// before\nsummary_type_to_prefix = {\"asmdiffs\": \"diff\", \"metricdiff\": \"metricdiff\", \"tpdiff\": \"tpdiff\"}\nif coreclr_args.summary_type not in summary_type_to_prefix:\n    raise ValueError(f\"Invalid summary_type: {coreclr_args.summary_type}\")\n// after (fix invocation)\npython superpmi.py summary --summary_type asmdiffs --summaries file1.json file2.json","handlingStrategy":"validation","validationCode":"VALID_SUMMARY_TYPES = {'asmdiffs', 'metricdiff', 'tpdiff'}\ndef validate_summary_type(summary_type):\n    if summary_type not in VALID_SUMMARY_TYPES:\n        raise ValueError(f\"Invalid summary_type '{summary_type}'. Valid values: {sorted(VALID_SUMMARY_TYPES)}\")\n    return summary_type","typeGuard":"from typing import Literal\nSummaryType = Literal['asmdiffs', 'metricdiff', 'tpdiff']\ndef is_valid_summary_type(value: str) -> bool:\n    return value in {'asmdiffs', 'metricdiff', 'tpdiff'}","tryCatchPattern":null,"preventionTips":["Use exactly one of: asmdiffs, metricdiff, tpdiff.","Validate summary_type in your wrapper script before invoking superpmi.py.","When adding a new summary kind, register it in summary_type_to_prefix."],"tags":["summary","validation","configuration","superpmi","valueerror"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}