Skip to content

fix(check): resolve callee dispatch and optional weights - #145

Merged
zhen8838 merged 2 commits into
tile-ai:mainfrom
zhen8838:fix/specialize-through-a-call
Aug 31, 2026
Merged

fix(check): resolve callee dispatch and optional weights#145
zhen8838 merged 2 commits into
tile-ai:mainfrom
zhen8838:fix/specialize-through-a-call

Conversation

@zhen8838

Copy link
Copy Markdown
Collaborator

Why

  • analyze --dim rejected a call to a dispatch prototype even when the caller's dimension bindings selected exactly one variant.
  • check required --weights even when a run reached no weights, while a declaration-based gate could not identify weights reached through child modules.

What

  • Select dispatching callees with variant_for during dimension specialization, recursively rebuild the chosen body, and preserve specialization provenance.
  • Make omitted --weights an empty resource so unused weights need no source and reached weights fail at their first read with the declaring module and weight name.
  • Replace stale tests and examples with coverage for both callee variants, nested dispatch, missing dimensions, and the four reached/unreached weight-source cases.

Contract

  • HIR specialization now resolves a callee dispatch from the caller's dimensions, rebuilds affected call targets, and records provenance; evaluation continues to dispatch from concrete argument shapes.
  • --weights is optional. Without it, a reached weight is rejected at first use and names its declaring Module and weight.

Risk

  • Dispatch variants on a tuple-returning entry still cannot express the required return annotation (TF-2b).
  • gen_model.py documents the removed specialization limit but intentionally still emits the direct attend_by_context call; switching it back to the prototype is a separate model change.

@zhen8838
zhen8838 merged commit 101652a into tile-ai:main Aug 31, 2026
1 check passed
@zhen8838
zhen8838 deleted the fix/specialize-through-a-call branch August 31, 2026 15:03
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.

1 participant