Page 1 of 1

[0.17.66] bug in the fluid flow?

Posted: Sun Aug 18, 2019 5:18 am
by cyfrov
Came across a really strange behavior that brought a whole refinery to a halt...production-output-wise.
Apparently, factorio doesn't have a graceful way of handling parallel pipes, or when pipes might form loops.

Anyways, I've boiled it down to the attached scenario
once you start it, you'll need to disable the constant combinator, and the fluid oscillator will run itself...tried to set it up this way, to rule out it was background processes slowing down my machine.
To test the bug, simply vary the parallel join pipes (circled pink), and look at the game tick readout (circled blue, it's thermometer coded from right to left), once the done light goes on (circled red)
flow bug.JPG
flow bug.JPG (285.17 KiB) Viewed 1290 times
There's some strange non-determinism going on, since there are some subtle timing differences between scenario instances (might not get a consistent timing behavior between different launches of the scenario)

In one instance, I saw the following tick counts for the tank to fill up:
(binary coded presense of a pipe from top to bottom) = (game ticks for tank to fill up, average over 3 cycles)
0000 = 960
1000 = 1227
0100 = 1241
0010 = 962
0001 = 962
0011 = 1267
1100 = 1248
1010 = 1351
0101 = 1354
1111 = 5183


Blueprint for the unit-test structure

Code: Select all

0eNrdWtuOo0YQ/ZWoHyO84tLNxUr2ZTX5grxFKwvbbbsVDKiBSawR/54G22MPFFCFZ3aifdlZsM/pourUpdu8sHVSyVyrtGTLF6Y2WVqw5V8vrFD7NE6ae+Upl2zJVCmPzGJpfGyuijLT8V4uyjj9m9UWU+lW/suWTv3dYjItVankmae9OK3S6riW2nzhlSHb7YpDpuUir465Ic6zwqCytFnSMC0ii53MHyeqa6tH46JpnDEa75VmwojgizAPuVVabs4fc4sZV5U6S1ZreYifVaYbzEbpTaXKlfls+0q0U7ooVz2HPitdVubOzaftNxZPjT+bOBjfmqDYzcUxj3VcNmuwr6w+f56ebSkaSqf5R8vtvcuVueJ2/b2GnpzfnlwZa/pP7l+fHEKLKTQfQ/tTXnd+Vq8HU3676s2H0OEUOhxDR1PoYAzt2FjBCBDuYOHw6i5WcPDqHhYOrz6ZLN4ofDJb3FG4PwV3RuFozXEQHmLhHghHqw5c3bWxkofhaNXBcBcbdxiOVh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0RsejDb43R6jz8mmVEK+2GZPrhaJV+wC5ace/bZeb39rXY5d1btBZL4rU0YxH7I8n++eVPWZSyGfWepS5aWODZThj4EbfDuv4PeLyDwg==

Re: [0.17.66] bug in the fluid flow?

Posted: Sun Aug 18, 2019 5:43 am
by Rseding91
cyfrov wrote: Sun Aug 18, 2019 5:18 am Apparently, factorio doesn't have a graceful way of handling parallel pipes, or when pipes might form loops.
Correct. That may change one day but right now that's how it is :)

Re: [0.17.66] bug in the fluid flow?

Posted: Sun Aug 18, 2019 7:17 am
by cyfrov
...but it's really easy to fix...you can even copy pasta CppSim for inspiration