backend: (x86) report unsupported vector sizes without the raw KeyError - #6361
Merged
superlopuh merged 2 commits intoAug 14, 2026
Merged
Conversation
Raising DiagnosticException from inside 'except KeyError' chained the dict lookup onto the traceback, so a vector too wide for the target printed 'KeyError: 512' above the real explanation. Suppress the chain with 'from None' and list the sizes the target does support. Split out of xdslproject#6360 at review request, with a test covering all three targets and asserting the KeyError is not chained.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6361 +/- ##
=======================================
Coverage 86.93% 86.93%
=======================================
Files 439 439
Lines 65902 65919 +17
Branches 7490 7490
=======================================
+ Hits 57289 57304 +15
- Misses 7036 7038 +2
Partials 1577 1577 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
superlopuh
reviewed
Aug 14, 2026
superlopuh
approved these changes
Aug 14, 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.
Split out of #6360 as requested, with a dedicated test.
_register_type_for_vector_typeraisesDiagnosticExceptionfrom insideexcept KeyError, which chains the dict lookup onto the traceback. A vector too wide for the target therefore reports:The diagnostic underneath is correct, but
KeyError: 512is the first thing you see and it points at a dict rather than at the problem.Two changes:
raise ... from NoneThe test covers all three targets and asserts the
KeyErroris not chained, via__cause__and__suppress_context__, so a future refactor that drops thefrom Nonefails rather than quietly regressing the message.