Skip to content

[OM] Delay assertions until worklist drained#10267

Merged
seldridge merged 1 commit into
mainfrom
dev/seldridge/issue-10264
Apr 18, 2026
Merged

[OM] Delay assertions until worklist drained#10267
seldridge merged 1 commit into
mainfrom
dev/seldridge/issue-10264

Conversation

@seldridge
Copy link
Copy Markdown
Member

@seldridge seldridge commented Apr 18, 2026

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.

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

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>
@seldridge seldridge force-pushed the dev/seldridge/issue-10264 branch from 6b07627 to d3b7833 Compare April 18, 2026 05:47
@seldridge seldridge marked this pull request as ready for review April 18, 2026 05:47
@seldridge seldridge requested review from mikeurbach and uenoku April 18, 2026 05:48
@fabianschuiki
Copy link
Copy Markdown
Contributor

Results of circt-tests run for d3b7833 compared to results for 6273dde: no change to test results.

Copy link
Copy Markdown
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
}

@seldridge
Copy link
Copy Markdown
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.

@seldridge
Copy link
Copy Markdown
Member Author

And by your "later" PR (#10265) I clearly mean "earlier".

@uenoku
Copy link
Copy Markdown
Member

uenoku commented Apr 18, 2026

No even with #10265 it still ignores assertions that are not immediately evaluatable, so this PR (and logging) look great to me. #10265 should fix scheduling of nested references, but it still requires a bit more of unification between isFullyEvaluated and Pending state.

@seldridge seldridge merged commit db89b21 into main Apr 18, 2026
6 checks passed
@seldridge seldridge deleted the dev/seldridge/issue-10264 branch April 18, 2026 15:21
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.

3 participants