dotnet/runtime · error · NotImplementedError
{coreclr_args.mode}
Error message
{coreclr_args.mode} What it means
Raised as a defensive fallback in superpmi.py's main() dispatch when coreclr_args.mode does not match any of the implemented modes (collect, replay, asmdiffs, tpdiff, metricdiff, upload, upload-private, download, list-collections, merge-mch, summarize). It signals that a mode value reached the dispatch chain at src/coreclr/scripts/superpmi.py:6126 without a matching elif handler.
Source
Thrown at src/coreclr/scripts/superpmi.py:6126
elapsed_time = end_time - begin_time
logging.debug("Finish time: %s", end_time.strftime("%H:%M:%S"))
logging.debug("Elapsed time: %s", elapsed_time)
elif coreclr_args.mode == "list-collections":
if coreclr_args.local:
list_collections_local_command(coreclr_args)
else:
list_collections_command(coreclr_args)
elif coreclr_args.mode == "merge-mch":
success = merge_mch(coreclr_args)
elif coreclr_args.mode == "summarize":
summarize_json_summaries(coreclr_args)
else:
raise NotImplementedError(coreclr_args.mode)
return 0 if success else 1
################################################################################
# __main__
################################################################################
if __name__ == "__main__":
args = parser.parse_args()
sys.exit(main(args))
View on GitHub (pinned to 60108ba66e)
Solutions
- Run `python superpmi.py --help` to list valid subcommands and use the exact name.
- Check for typos or stray whitespace in the mode argument.
- Grep the checked-out superpmi.py for `coreclr_args.mode ==` to confirm the mode is implemented in this version.
- If you are adding a new mode, add a matching elif branch in both dispatch blocks (setup near line 5333 and run near line 5918).
Example fix
// before python superpmi.py collcet -core_root ... // after python superpmi.py collect -core_root ...
Defensive patterns
Strategy: validation
Validate before calling
valid_modes = {'collect', 'replay', 'asmdiffs', 'tpdiff', 'metricdiff',
'upload', 'upload-private', 'download', 'list-collections',
'merge-mch', 'summarize'}
if coreclr_args.mode not in valid_modes:
parser.error(f"Unknown mode '{coreclr_args.mode}'. Valid: {sorted(valid_modes)}") Prevention
- Use argparse subparsers with choices= to reject invalid modes at parse time.
- When adding a mode to the parser, add the matching elif branch in the same commit.
When it happens
Trigger: Passing an unrecognized or misspelled --mode/subcommand to superpmi.py, or invoking main() with a mode string that exists in the argument parser but has no corresponding elif branch in the run-dispatch block.
Common situations: Typos in the mode name (e.g. 'collcet'), using a mode name from a different/newer checkout than the one running, or programmatic calls that set coreclr_args.mode to an unhandled value.
Related errors
- Unknown OS.
- Invalid arch.
- Pass only one tiering option.
- Collection 'smoke_tests' is only available for 'nativeaot' c
- Cannot find System.Private.CoreLib.dll at {corelib_src}
AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10).
Data as JSON: /api/errors/2ff4869c4835395a.
Report an issue: GitHub.