refactor(task): relocate map_task_synonym to loader.task as to_optimum_task#801
Merged
Conversation
…m_task Establish a single WinML->Optimum task collapse boundary in loader/task.py. map_task_synonym and TASK_SYNONYM_EXTENSIONS move from export/io.py to loader/task.py as to_optimum_task; export.io keeps map_task_synonym as a backward-compatible alias. Optimum-boundary call sites (inspect command, HTP exporter, inspect resolver) call to_optimum_task directly. No behavior change. Part of #800.
zhenchaoni
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PR1 of #800. Relocate
map_task_synonym->loader/task.py::to_optimum_taskto establish a single WinML->Optimum task-collapse boundary.Changes
loader/task.py: addto_optimum_task+TASK_SYNONYM_EXTENSIONS(moved fromexport/io.py); exported vialoader/__init__.py.export/io.py: local implementation removed;map_task_synonymkept as a backward-compatible alias (= to_optimum_task); internal use repointed.to_optimum_task:commands/inspect.py,export/htp/exporter.py,inspect/resolver.py.commands/build.py:TASK_SYNONYM_EXTENSIONSnow imported fromloader.tests/unit/loader/test_task_boundary.pypins the collapse contract.Behavior
No behavior change.
map_task_synonymstays importable fromexport.io; the collapse semantics (image-feature-extraction->feature-extraction, WinML extensions preserved) are byte-identical. Existing synonym and #777/#782 regression tests stay green.Sets up PR2 (#800), which adds the modality-aware
detect_taskand relies on this single collapse boundary.