Aggregate codegen errors and lower Julia throws#248
Merged
Conversation
Member
Author
|
Errors probably can be ordered better; the |
b153d0a to
dbfb5e0
Compare
A statement that consumes a poisoned value but emits fine used to break the taint chain, so failures further down the dataflow surfaced as fresh root causes. Also check operands statically in the diagnostic boundary: emitters that throw before reading their arguments (e.g. rejecting a statement on its type) never set the dynamic touched_poison flag. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A control-flow op whose carried result inferred as Any records a diagnostic before its regions are emitted, so it cannot know yet whether the body will surface the actual cause. Bracket the carry collection and drop the carry diagnostic again when region emission recorded further errors; keep it when the body is clean (e.g. branch arms yielding different tile shapes). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deep-inlining-first ordering put symptoms ahead of causes (PR feedback: the randn error on line 3 sorted after the store error on line 4), and full-stack dedup kept every inlining path of the same problem. Keep recording order — emission order is program order — and dedup on (message, kernel line). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A non-IRError escaping statement emission is a compiler bug, not a kernel diagnostic. Abort immediately, but point the report at the offending kernel statement and ask for an issue; the original exception renders as the cause via the exception chain. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bytecode-version requirements of FP8-E8M0/FP4 dtypes, the unsupported- dtype fallback, and the load/store latency range are all triggerable from kernel code, so they belong in the collected diagnostics rather than aborting as ArgumentError/ErrorException (which would now be misreported as internal compiler errors). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f32e669 to
5322388
Compare
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.
This changes codegen to collect independent errors instead of stopping at the first one. Failed values are replaced with poison values so compilation can continue, while follow-on errors caused by those values are suppressed. The final error reports the useful root causes in source order.
It also handles Julia throw calls directly. Throws that are unavoidable become compile-time diagnostics, while throws in conditional control flow become runtime Tile IR assertions. Static exception messages are preserved when possible, and exception objects are removed before Tile IR codegen.
Taking the example from #237:
An unconditional throw is reported during compilation:
A conditional throw is preserved as a runtime assertion: