Skip to content

refactor(task): relocate map_task_synonym to loader.task as to_optimum_task#801

Merged
timenick merged 3 commits into
mainfrom
zhiwang/task-to-optimum-boundary
Jun 3, 2026
Merged

refactor(task): relocate map_task_synonym to loader.task as to_optimum_task#801
timenick merged 3 commits into
mainfrom
zhiwang/task-to-optimum-boundary

Conversation

@timenick
Copy link
Copy Markdown
Collaborator

@timenick timenick commented Jun 2, 2026

What

PR1 of #800. Relocate map_task_synonym -> loader/task.py::to_optimum_task to establish a single WinML->Optimum task-collapse boundary.

Changes

  • loader/task.py: add to_optimum_task + TASK_SYNONYM_EXTENSIONS (moved from export/io.py); exported via loader/__init__.py.
  • export/io.py: local implementation removed; map_task_synonym kept as a backward-compatible alias (= to_optimum_task); internal use repointed.
  • Optimum-boundary call sites repointed to to_optimum_task: commands/inspect.py, export/htp/exporter.py, inspect/resolver.py.
  • commands/build.py: TASK_SYNONYM_EXTENSIONS now imported from loader.
  • New tests/unit/loader/test_task_boundary.py pins the collapse contract.

Behavior

No behavior change. map_task_synonym stays importable from export.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_task and relies on this single collapse boundary.

timenick added 2 commits June 2, 2026 17:48
…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.
@timenick timenick requested a review from a team as a code owner June 2, 2026 09:50
Comment thread src/winml/modelkit/export/htp/exporter.py
@timenick timenick enabled auto-merge (squash) June 3, 2026 03:16
@timenick timenick merged commit dbfb072 into main Jun 3, 2026
9 checks passed
@timenick timenick deleted the zhiwang/task-to-optimum-boundary branch June 3, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants