[OM] Delay assertions until worklist drained#10267
Merged
Merged
Conversation
Base automatically changed from
dev/seldridge/om-evalautor-debug-logging
to
main
April 18, 2026 05:45
Fix an issue with the OM evaluator where asserts were evaluated too early. This could cause the `getStrippedValue` reference chasing to hit a null value and assert. By delaying assertions until the worklist has drained this avoids running into a null reference and also allows all assertions to be evaluated together, providing a complete picture of all failures to a user. Fixes #10264. Assisted-by: OpenCode:claude-sonnet-4-6 Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
6b07627 to
d3b7833
Compare
Contributor
uenoku
approved these changes
Apr 18, 2026
Member
There was a problem hiding this comment.
LGTM for assertion queue. Note that the original test case of #10264 still fails (since it doesn't have an assertion).
I believe the root cause is that %4 is evaluated before %3 when referenced value %3 still being nullptr.
om.class @Domain(%in: !om.string) -> (out: !om.string) {
om.class.fields %in : !om.string
}
om.class @Foo_Class(%basepath: !om.frozenbasepath) -> (test: i1) {
%0 = om.constant "A" : !om.string
%1 = om.object @Domain(%0) : (!om.string) -> !om.class.type<@Domain>
%2 = om.object.field %1, [@out] : (!om.class.type<@Domain>) -> !om.string
%3 = om.object @Domain(%2) : (!om.string) -> !om.class.type<@Domain>
%4 = om.object.field %3, [@out] : (!om.class.type<@Domain>) -> !om.string
%5 = om.constant "B" : !om.string
%6 = om.prop.eq %4, %5 : !om.string
om.class.fields %6 : i1
}
Member
Author
|
Thanks for pointing out this doesn't fix it. 🫣 The real motivation was getting the assertions working for situations where these are lowered to intermediary objects. Also, I'm fine with abandoning this (and reverting 6273dde) if this can be fully subsumed by your later PR. |
Member
Author
|
And by your "later" PR (#10265) I clearly mean "earlier". |
Member
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.
Fix an issue with the OM evaluator where asserts were evaluated too early.
This could cause the
getStrippedValuereference chasing to hit a nullvalue and assert. By delaying assertions until the worklist has drained
this avoids running into a null reference and also allows all assertions
to be evaluated together, providing a complete picture of all failures to
a user.
Is an attempt at #10264. This fixes the assertion issue, but not the actual issue. (h/t @uenoku).
Assisted-by: OpenCode:claude-sonnet-4-6