Feedback was giving me trouble.
I was trying to study just the effect of feedback on the square waves. These as expected show a noise around the downslope, and a delay in the upslope. But what I wasn't expecting was that the noise had a period of three samples.
This really confused me. If the feedback was from the previous sample, there should be a 2 sample period to the noise. During the first half of the wave, the feedback is pushing you forward so you reach the downslope early. At this point, the output suddenly drops, so that feedback pushes you back into the high part of the waveform, and the next output goes up again.
If the feedback is delayed by two samples, then the noise should have a period of 4 samples.
However I think I have it cracked.
The feedback phase shift is a sum of the previous two samples, shifted by some amount directly related to the value of FB. This seems to give the correct result.