Skip to content

Clean up unreferenced / orphaned modules in src/winml/modelkit #989

Description

@xieofxie

Background

An import-graph analysis of src/winml/modelkit (AST-parsed all modules; modeled dynamic command loading via LazyGroup, string-based _LAZY_IMPORTS, and parent-__init__ side-effect registration) found several modules that are not reachable from any CLI command.

The clearly-dead, zero-reference files were already removed in the accompanying PR:

  • analyze/console_writer.py, analyze/utils/table_utils.py, core/onnx_node_bucketizer.py, core/operation_config.py, core/strategy_selector.py, core/tag_utils.py

This issue tracks the remaining cases that need a decision rather than a straight delete.

1. Empty stub

2. Dead islands (modules importing each other, unreachable from any command)

  • analyze/onnx_opset/__init__.py, _impl/opset_ai_onnx_preview_training1.py, _impl/opset_com_microsoft1.py. Re-exports from onnxscript; nothing in the codebase imports the package.
  • analyze/pattern/__init__.py + check_patterns.py. check_patterns imports live modules but nobody imports check_patterns, and the analyze command never wires it in.

Decide: wire into the analyze pipeline if intended, otherwise remove.

3. Product-dead, kept alive only by their own tests

No src importer — only a test imports each. Removing the module orphans the test:

  • analyze/runtime_checker/check_ops.pytests/unit/analyze/test_check_ops.py
  • analyze/runtime_checker/result_processor.pytests/unit/analyze/runtime_checker/test_result_processor_per_op.py
  • onnx/inspection.pytests/unit/onnx/test_onnx_inspection.py

Decide: remove module + test if the feature is abandoned, or re-wire into product code if intended.

Not dead (recorded to avoid re-flagging)

  • session/qairt/compile_qairt_bin.py is executed as a subprocess script (Path(__file__).parent / "compile_qairt_bin.py"), not imported — keep.
  • serve/ and data/ are reachable only via the intentionally-disabled run/serve commands — keep.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions