Skip to content

[FRONTEND] Add descriptive messages to bare asserts#10405

Merged
lezcano merged 1 commit into
triton-lang:mainfrom
Chennesxu:fix/frontend-assert-messages
May 28, 2026
Merged

[FRONTEND] Add descriptive messages to bare asserts#10405
lezcano merged 1 commit into
triton-lang:mainfrom
Chennesxu:fix/frontend-assert-messages

Conversation

@Chennesxu
Copy link
Copy Markdown
Contributor

Summary

Improve error diagnostics for user-facing assert statements in
semantic.py and core.py by adding descriptive messages following
the "expected X, got Y" pattern.

As requested by @lezcano in #10341 — previously, users hitting these
asserts (e.g., mismatched accumulator dtype in tl.dot) would get an
empty AssertionError with no guidance on what went wrong.

Changes

  • semantic.py: 17 bare asserts → descriptive messages
  • core.py: 5 bare asserts → descriptive messages
  • Split compound assert shape == X and dtype == Y into two separate
    asserts for clearer diagnostics

Improve error diagnostics for user-facing assert statements in
semantic.py and core.py by adding "expected X, got Y" messages.
This makes it easier to diagnose issues like mismatched accumulator
dtype in tl.dot (ref triton-lang#10341).
@Chennesxu Chennesxu requested a review from ptillet as a code owner May 28, 2026 14:48
@lezcano lezcano enabled auto-merge (squash) May 28, 2026 18:11
@lezcano lezcano merged commit d92727c into triton-lang:main May 28, 2026
10 checks passed
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