LocalLeakyImpulseBucket Overflow output fires incorrectly if both pulse outputs are connected to other nodes
Describe the bug?
The behaviour of the Pulse and Overflow pulse outputs is incorrect if both are connected to downstream nodes. Specifically, the Overflow output pulses incorrectly if the CurrentCapacity is 0 and the Trigger input receives a pulse. The pulse in this situation should come from Pulse instead, as it does if only the Pulse output is connected to a downstream node. The incorrect pulse from Overflow also doesn't occur if only the Overflow output is connected to downstream nodes - of course, it's impossible to test if the Pulse output fires correctly in this context.
To Reproduce
Spawn a LocalLeakImpulseBucket node and set the Interval input to 1 second and the MaximumCapacity to 3.
Pull out a pulse display node from both the Pulse output and the Overflow output of the LocalLeakyImpulseBucket node. Pulsing the Trigger input once causes one immediate output (assuming current capacity is 0) from the Overflow output. Compare this incorrect behaviour to the expected behaviour if a pulse output is only connected to one of either Pulse or Overflow.
This behaviour can be conveniently explored in this simple world: resrec:///U-Zyzyl/R-1121af3e-6e58-47ec-9978-180113430a42
Expected behavior
The Overflow output should only pulse when the Trigger input is pulsed and the CurrentCapacity is equal to MaximumCapacity. This should not depend on the specific configuration of downstream connections.
Screenshots
No response
Resonite Version Number
2023.10.13.743
What Platforms does this occur on?
Windows
What headset if any do you use?
HP Reverb G2, Desktop mode
Log Files
No response
Additional Context
No response
Reporters
Zyzyl (zyzylian on Discord) marsmaantje
It appears that all pulses sent when there are no bucketed impulses (CurrentCapacity of 0) will always output through the overflow instead of the pulse.
SHIFTY-LAPTOP - 2024.1.31.744 - 2024-02-01 15_43_57.log
It doesn't appear that there is any relevant information recorded in the log file.
https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/54213390/083928e6-f0c3-42dd-9e89-6926836406c1
Hopefully this should be an easy fix. This issue otherwise seems to have everything it needs now, @Frooxius @ProbablePrime.
agreed, ill take a look
This is quite cursed. In this setup the Overflow will execute only if the display node is connected to Pulse.