What did I do?
Load this save file to skip to the last step:
- Make a test world with cheats enabled, and make a powered area with a substation and some cheated electricity
- Place a constant combinator on the left, with a random item with a recipe set, like an iron chest for example
- Place an assembling machine 2 to the right of the constant combinator, and an arithmetic combinator below the assembler.
- Connect constant -> assembler with green, constant -> arithmetic with red, assembler -> substation with red, and arithmetic -> substation with green. (The substation is so we can easily read the output signals, and the wires are alternating colors to prevent the recipe signal from leaking through the assembler and combinator)
- Set the assembler to set the recipe, and read the ingredients
- Set the arithmetic combinator to add 0 to each, this is just a passthrough for the recipe signal to simulate the delay I expect
- Pause the game and tick step it, whilst turning on/off the constant combinator. Observe how long it takes for the signals to reach the substation by hovering the mouse cursor over the substation.
When the recipe is changed (say, from nothing to an iron chest), the newly created recipe signal (chest) reaches the substation 1 tick before the ingredients list (iron plates), despite both signals going through one building. It seems that the assembler needed one tick to set the recipe, and then another to calculate/output the actual ingredient list.
What did I expect to happen?
I expected both the recipe signal going through the delaying arithmetic contaminator, and the calculated ingredient list to arrive at the substation at the same time, because they are both passing through one building / operation.
When does this happen?
The 2 tick delay in the assembler is consistent. Both when just turning on the recipe and letting it play out a few ticks, or when changing the recipe every tick.
Further notes
I think the root cause has to do with it first taking a tick to set the recipe, and then taking another to output the ingredients. If you have alt mode enabled, you can see that it takes a tick for the assembler to take the recipe, and then another before it starts outputting the ingredients.
For my purposes it is not an actual problem: I can just add another delay combinator to account for the 2-tick assembler delay. This bug report is made because the 2 tick delay is unexpected from my knowledge about combinators: converting a recipe signal to an ingredient signal feels like a single operation, just like turing a signal into the 5x of that signal when put through an arithmetic combinator.
Also, to fix this, either the recipe setting or the ingredient calculation would have to become instantanious. It would make the assembler more logical in the above described signal-processing sense, but making one of these instant might make other situations less logical. I cannot think of any with practical implications though.
Finally, I did not test this for other assemblers, or other machines with similar recipe setting and ingredient reading functionality. It is getting late and I need to do stuff tomorrow...