-
Notifications
You must be signed in to change notification settings - Fork 479
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
[Test] [Bug] Trigger the overpruned dependency bug #6517
Conversation
@michaelpj any idea? |
What happens if you get rid of the bit where it tries to prune dead constructors? |
The test becomes green, see 229b690. |
Since you have a small test case I would dump the output from just after the bad dead code pass and see what's wrong. It looks like a simple case we should handle properly... |
From the error it seems like we get rid of |
Yes, I've done exactly that when investigating and you're right that this is what's happening:
|
I don't see why from just looking at it, some debugging is going to be required I think! |
Wanna do some debugging on a weekend? 🙂 |
…to effectfully/test/bug/overpruned-dependency
({cpu: 34304100 | ||
| mem: 214500}) No newline at end of file | ||
({cpu: 37152100 | ||
| mem: 232300}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zliu41 is this large enough difference to keep the bug in the dead code eliminator that causes necessary constructors to get eliminated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10% is bad but only a small number of golden files are affected - I'm fine either way. What's your preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess let's keep the bug in then, I think it's quite low priority compared to other things and I don't feel like studying the DCE algo at the moment (or ever haha). I'll reflect this problem in an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
-- See Note [Dependencies for datatype bindings, and pruning them] | ||
let nonDatatypeClique = G.clique (fmap Variable tus) | ||
pure $ G.overlays $ [vDeps] ++ tvDeps ++ cstrDeps ++ [destrDeps] ++ [nonDatatypeClique] | ||
let tyus = fmap (view PLC.theUnique) $ _tyVarDeclName d : fmap _tyVarDeclName tvs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure what this does; worth some comment. There should also be some explanation or reference to the bug here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea either, that's Michael code and as you can see above Michael isn't particularly keen on dealing with it :)
({cpu: 34304100 | ||
| mem: 214500}) No newline at end of file | ||
({cpu: 37152100 | ||
| mem: 232300}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10% is bad but only a small number of golden files are affected - I'm fine either way. What's your preference?
I've added an entry to #5967, so that we don't forget about this bug, and let's close this PR for now. |
The added test fails with
The bug is in the dead code eliminator. To be precise, it's this part that it doesn't handle correctly despite promising to in
PlutusIR.Analysis.Dependencies
:I don't know what went wrong there.