-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fuzzlyn: Assertion failed '((tree->gtDebugFlags & GTF_DEBUG_NODE_MORPHED) == 0) && "ERROR: Already morphed this node!"' #107542
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
We have:
Morph pushing the cast Morph has a limited ability here to tell that simplified tree doesn't include anything new, seems like we need to either extend this to an arbitrary subtree of the original operands. |
I think the root problem here is that the contract between morph and various utilities (notably Global morph may invoke these utilities in pre-order (before the root or any subtree is morphed) or in "mid-order" (after subtrees are morphed but before/during morphing of the root). The problematic case here is mid-order, where a utility can (a) do nothing; (b) return a subtree; (c) create an entire new tree; (d) return a tree that is a mixture of new and pre-existing nodes. The issue above is confusion between (c) and (d); morph thinks there's a new subtree that needs morphing, but it is an old subtree that was already morphed. There are various bits of logic scattered about in gentree to detect when a utility is called during global morph and do something. But these can't distinguish the pre-order from mid-order cases so it's not clear there is enough information to always do something reasonable. And likewise various bits of logic in morph to look at the utility result and decide what needs to happen next. Seems like we should make all this explicit, which means adding extra context to the utility calls, and deciding how to handle the cases where they are invoked outside of global morph (perhaps as part of a subsequent "late morphing" operation, eg from cse or assertion prop), and having them verify that the tree and subtrees end up in the expected state. Another option is to make the "morphed" flag part of the IR state, instead of just a debug check. Or if global morphing were idempotent (which it likely is not) the mid-order case could just remorph the subtrees. This likely has a TP cost. @dotnet/jit-contrib any thoughts here? |
Can this be solved in the same way as |
On osx arm64:
cc @dotnet/jit-contrib
The text was updated successfully, but these errors were encountered: