Page 1 of 1

[0.17.11] Cloning combinators doesn't preserve signals "in flight"

Posted: Wed Mar 13, 2019 8:33 pm
by mulark
When cloning a set of combinators, for example a memory cell, the signals stored by/on the wires of the combinator are not cloned.

The most simple example of this is an arithmetic combinator feeding back into itself, A+1 output A, the cloned combinator will begin the count at 0, not the value the original had.

Re: [0.17.11] Cloning combinators doesn't preserve signals "in flight"

Posted: Thu Mar 14, 2019 1:11 pm
by Rseding91
Thanks for the report however I don't consider this worth changing. The clone logic doesn't preserve this kind of data on almost anything. The data isn't actually on the entity but on the logistic network itself which is not cloned/cloneable.

Re: [0.17.11] Cloning combinators doesn't preserve signals "in flight"

Posted: Sat Dec 11, 2021 6:38 pm
by SuicideJunkie
This does come up in game for Space Exploration mod.
Whenever a ship is launched and the contents are cloned to the travel surface, all of our combinator computers get rebooted.

Observations:
When power is cut, combinators retain their outputs.
Even when not connected to any network, the powered-down combinator remembers.
It is this internal combinator state that is failing to get cloned.

PS: The combinators taking a tick to power up is important here; when pausing and replacing all the wires without the electical blip, the data is lost.
It seems like we need to refresh the tally of outputs in the network when the wires change.

For example: I've fed a math combinator with some starter values, and then removed the power. It remembers its outputs many ticks later:
combinator_retention.png
combinator_retention.png (583.38 KiB) Viewed 1365 times
I then delete all logic networks from the map.
null_network.png
null_network.png (200.39 KiB) Viewed 1365 times
Restoring power and adding a brand new logic network to feed back, which currently has no signal tally in it.
null_network2.png
null_network2.png (155.12 KiB) Viewed 1365 times
And it just works. Signal values from the combinator state itself.
null_network3.png
null_network3.png (165.26 KiB) Viewed 1365 times
It looks to me like the network is holding a cache with the sum of combinator outputs, used for display purposes and speeding up logic calculations, but that cache needs to be refreshed at the beginning of the tick if there are any changes, and the combinators are where the true source of the data is.

As a fancier logic test, a fibbonachi sequencer was able to operate successfully after powerdown, complete wire replacement, and resume.