-
Notifications
You must be signed in to change notification settings - Fork 752
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
Fix UGen initialization: LFUGens pt. 1/3, Trig, Trig1 #6035
Fix UGen initialization: LFUGens pt. 1/3, Trig, Trig1 #6035
Conversation
c09ba77
to
aed4090
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
changes lgtm thanks! is there any plan for further testing and how should we integrate these? is it ok to merge piecemeal or do you want to wait until all have been reviewed? |
Thanks, @mossheim.
I try to do tests with a variety of argument rates, etc. for each UGen: So I'd consider my testing done, and my hope has been that these spend some time in circulation in the dev branch for more exposure.
I try to batch these into sensible clusters for each PR so they can be be reviewed and merged individually, otherwise it would run on for years, literally 😆 For UGens that are particularly complex, if the changes are beyond fixing initialization problems, or if changes may be contentious for other reasons, I try to make them separate PRs (E.g. Delay1/2, EnvGen, etc.) |
Are these in the test suite or purely manual testing?
OK, so it is not a problem if we release a version with fixes to some UGens but not all? |
The tests are manual. I have a template, but unfortunately each one requires manual setup specific to each UGen.
Correct, each PR is standalone. I try to avoid cross-dependencies in general, but I'll note them in the description if there are (this one doesn't have any). |
What do you mean? Are you instrumenting the C++ code somehow or using additional tooling? |
My template is in SC, it generates multiple function calls for the UGen under test, with varying i/o and arg rates, then plots the output over some useful number of cycles. Then I inspect plots. By "manual" I mean I have to tune each UGen test to set argument ranges and input signals that are appropriate to the UGen. I also have to insert print statements in the C++ code in order to inspect the init sample, since this can't be inspected from SC (it's never written out), and compare it to the first output sample. |
aed4090
to
fa25808
Compare
Pinging on this batch of initialization fixes. |
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 sure if it would help to add a few more tests? Since this changes subtle behaviour it would be good if one could understand (and fix) these changes through the boundary cases.
fa25808
to
fcda564
Compare
Sure, currently working on adding unit tests now (will update here when that's complete)... I suppose there's a balance to be struck for the larger project of fixing UGen initialization bugs. If we require unit tests for each fix, it adds quite a bit of overhead to a project that's already a bit of a slog. I don't disagree it's useful of course... |
d9ad818
to
2efe4d7
Compare
@mtmccrea I think its the existing unit tests that check for initialisation that are often flaky when ran on through CI. Might want to be extra careful how they are written. |
I'm not sure what kind of initialization you're referring to, but this pertains to the "initialization sample" problem, which can't actually be checked directly because that sample is never actually written out—instead the approach is to check the proper phase of the signal, which will be off if the UGen state isn't reset in the course of graph initialization.
EDIT: OK so looks like a version bump was merged #6196 |
2efe4d7
to
bb13fd9
Compare
This comment has been minimized.
This comment has been minimized.
8b0a92a
to
e833c07
Compare
Since this PR fixed a handful of unit tests in So it looks like this CI should pass, so I think this is finally good to go. |
@JordanHendersonMusic could you confirm I addressed your concern with the unit tests? Otherwise I think I've addressed everything in the comments/reviews and this should be ready to go. |
Oh yea, I was wrong and thought it was failing for a different reason! |
would anyone like to give this an "official" review? |
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.
This looks really good fixes many failing tests on my system, thanks!
I've got no issue with the approach.
The comments here are about C++ guidelines and sc formatting and code clarity (except the static cast which should definitely be used instead). If you don't agree with them, I'm quite happy to just approve as is however!
fix: don’t advance mLevel state in Ctor fix: when BUFLENGTH==64, call Line_next_nova_64 instead of Line_next_nova
fix: don’t advance mGrowth in the Ctor so first sample == start.
e833c07
to
1118a25
Compare
+ Remove incorrect arg index comment
…phase for trigger test and decouple the freq of SinOsc from the test duration.
… LFCub, LFtri, SinOsc
They're currently the only UGens breaking the whole batch of equivalence tests, so just comment them out locally.
1118a25
to
fae9062
Compare
Purpose and Motivation
A majority of UGens do not initialize with a correct initialization sample, and subsequently output an incorrect first sample. This PR is part of an ongoing effort to fix UGen initializations, the progress of which is tracked here.
This fixes the initialization of a batch of
LFUGens
:Line
,XLine
Vibrato
LFPulse
,LFSaw
,LFPar
,LFCub
,LFTri
Trig
andTrig1
were also fixed (they're inTriggerUGens
) - this was needed in order to pass related unit testsLine
was also made to callLine_next_nova_64
, which was omitted previously.(fixed Issues will be updated here)
Types of changes
To-do list
Duty
inTestCoreUGens
, andTestEnvGen_server: test_zero_gate_n_off_not_sent
, but they were failing before so are unrelated.