Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Classlib: Correct 'a+b.neg' ugen optimization, and fix descendants #3437
This PR addresses the issues raised in #972.
Test case from #972.
Without the fix, Poll gets lost because its source (
With the fix, d and e are correctly dropped (dead code elimination) but the use of
Suggesting 3.9.1 as it is a bugfix (of a subtle issue that is hard to explain), not a new feature.
FWIW, just now, I wanted to check myself on the descendants logic. After some false starts, I'm satisfied that it's working correctly.
Something to ponder for the future -- It's incredibly difficult to test UGen states in the middle of optimization, for a few reasons:
I don't think we have to worry about it for this PR. I checked
scztt left a comment
Finally had some time to look through this more closely. This looks good, at least judging from my memory of this problem :). I keep feeling like these optimizations could be further generalized into just a couple functions, but given that this high-severity bug stuck around for years without a solution, the risk of further change far outweighs the benefit to clarity.