UPS optimized 12-beacon smelting - w/minimal circuits

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Belter »

disentius wrote: Sun Feb 06, 2022 9:19 pm Nice work, Belter!
You forgot to post the saves with your post, though:)
Thank you. Saves are lurking in the attachments, check it, its there just hard to find.
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Belter »

mmmPI wrote: Sun Feb 06, 2022 9:08 pm It may also reveal some limits to the UPS optimization. Maybe the most efficient design in terms of raw UPS is not the most fluid in game due to having some higher varation in update times in between different frames.
I think we're at the limits of measurements, yes, even w/500 lanes. But thinking about a whatever spm megabase, I'd expect only some parts timed and things smooth out. Also output belts are never 100% used, so idle will happen probably causing more changes in UPS than timed stuff?
mmmPI wrote: Sun Feb 06, 2022 9:08 pm given how few times is required to update the circuit network compared to the entity though, i guess the margin of optimization are easier to find somewhere else, like in the green science if i were to guess based on previous trend :)
Unless something big comes up here, I'm done w/smelting... Steel/GC comes!
mmmPI wrote: Sun Feb 06, 2022 9:08 pm My idea is that it's loosely related to the magic that happens to make circular belt function properly[...]
I like this idea. The 2nd mini-gap is disappearng on a straigtht part. Maybe undeground belts has some dirty secret also, or folks at Wube did some magic when they optimized the belts or ensured full belts work consistently. I've read some FFFs, well, loads of effort went into this. As I consume the belt 100% using editor extension there is no way that plates are slipping there.

Let this be the biggest "bug" in Factorio! :)
mmmPI
Smart Inserter
Smart Inserter
Posts: 3620
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by mmmPI »

disentius wrote: Sun Feb 06, 2022 9:19 pm @mmmPi: Making sure the inserters do not have to wait for a free belt piece was the biggest UPS boost (by Belter) Dave managed to find a more efficient signal transmission.
thanks for the recap ! i tunneled vision on the graph which is showing the not so big UPS boost in the signal transmission in this particular case. When i look at the graph the entity (yellow part) is too complicated/chaotic to dinstinguish a clear pattern. that's where the biggest UPS boost lies. But looking at the orange part it seems that the spike are roughly similar in height and frequency between the signal compression and non-compressed signal. What changes would be the "noise" the average level of orange in-between the spikes. ( that's one way to describe) At the end the result is a clear UPS gain in the circuit network part from 0.51 to 0.31 when looking at it applied to Belter's deisgn. That's almost a 40% gain considering only the circuit parts !

To me it makes sense that the orange spike is the same height, the circuit network requires the same amount of time in both case when the inserter is activated. With that the reduction of orange in the other part would seem to confirm that when no value changes in the circuit it takes less time for the circuit network to be processed by the game. Or in other word, that entities connected to the circuit network are smart enough to not consume time machine when the circuit is not changing value. Or again, than if one can avoid having value changing all the time on the circuit network for no particular reason, it's best/ good practice to avoid it because it has an inpact on every entity connected to it. If you have somewhere 100000 inserter waiting for the "iron" signal, you don't want to connect them to the same circuit network where you read content on a full belt with the "pulse" signal or to the mega mall full of connected chest with their content changing every tick. This is the lesson i'm going to remember from the graph and your different tests :).
Belter wrote: Sun Feb 06, 2022 10:35 pm I think we're at the limits of measurements, yes, even w/500 lanes. But thinking about a whatever spm megabase, I'd expect only some parts timed and things smooth out. Also output belts are never 100% used, so idle will happen probably causing more changes in UPS than timed stuff?
You can set up your factory so that output belts are 100% used depending on how you setup your train conditions :) but it's pretty uncommon to design this way on purpose. Another way it happens is when you don't have enough material coming, not a shortage of 1 material in particular, but things like you can produce 100 SPM but only have enough material input for 90 due to a train congestion. It's not like 1 particular material will stockpile and then the congestion will be better, it can alternate between different material arriving too late maybe 1 will stockpile like 10 or 20% of the buffer at most when 2 train arrive in quick succession, and then all empty when no train of that material arrive to make up for the previous. The thing is happening more often unwillingly it's easier to spot when it arrives than to describe the conditions for it x).

I see it as the test is only 1 part of making the megabase, then you have to properly implement the good design recognized in the test so that it behave in the factory like it does in the test !

The signal network compression is not reducing the height of 1 particular spike of time machine consumed for the circuit network processing, it is reducing the noise in between the spikes. Thus if you implement a gigantic array with signal compression you may want to offset the spikes from one another. Otherwise you may risk having those particular frame where all the logic is happening becoming notceable in game. but that would require several clocks :)

Given the very low % of time required by the circuit network in the smelting setup in general the risk doesn't seem that high here. But those orange spike are roughly correlated with yellows spikes too, since when the inserter is active it triggers some other calculations. There are obvisouly other more important parameter than just the circuit network that result in the total time per frame looking chaotic but if you reduce all noise and synchronize everything the raw UPS gain may be happening in a visible manner at the detriment of a regularity in the the time machine required per each frame. Not the limit of measurement !
Belter wrote: Sun Feb 06, 2022 10:35 pm The 2nd mini-gap is disappearng on a straigtht part. Maybe undeground belts has some dirty secret
I agree they do mysterious things
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Belter »

Actually I did not know why the circuits are in sync... and they are, obviously. I use 5 circuits for my 500 lane tests for the 5x100 blocks.

To test I deynced one by replacing it again the combinators using copy & paste:
Desync.png
Desync.png (49.51 KiB) Viewed 5677 times

First idea was power cut / save/load game but the state remained (well, makes sense). So Region Cloner keeps that even in sync, nice job!

It means that in normal cicumstances, working from BPs - unless a global timer is used - they won't be in sync.

Edit: in the documentation at github they do mention this feature. RTFM...
Attachments
biron51_belter-iron-V6.75-desync.zip
(5.09 MiB) Downloaded 126 times
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Belter »

This BP has space for substations, which is almost never the case for high beacon setups.

I'm sure I'll be slaughtered but... ..I added substatoins and measured the difference.

9000 poles vs 2000 substations.+0.8% UPS. Result is consistent at least for me.

No idea why entity updates went up.
poles-subtations.gif
poles-subtations.gif (4.79 MiB) Viewed 5642 times
Pole-vs-Sub.png
Pole-vs-Sub.png (63.36 KiB) Viewed 5642 times
Attachments
biron5ps results.csv
(768 Bytes) Downloaded 147 times
biron5ps-Belter-v6.75s.zip
(4.48 MiB) Downloaded 155 times
biron5ps-Belter-v6.75p.zip
(5.47 MiB) Downloaded 163 times
Gummiente27
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Mon Jul 16, 2018 2:59 am
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Gummiente27 »

7000 less things to progress
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by disentius »

I recreated your test, with the following modifications:
(500 belts, 100 down, 5 columns)

- removed circuit controllers except one in the left top (I would only use one in a real game)
- made sure all furnaces are filled to capacity (in your saves, some furnaces are still filling up, so the input inserters are more active)
- added DaveMcW's save for reference
- removed the rewire mod (it makes comparison with older tests difficult)
- 50000 ticks, 3 runs

Looks like substations are the better solution, marginally:)
2022-02-08 12_54_22-Window.png
2022-02-08 12_54_22-Window.png (39.74 KiB) Viewed 5615 times
Attachments
bm_ smelting results.csv
(1.08 KiB) Downloaded 131 times
raw logs.zip
(8.92 MiB) Downloaded 117 times
bm_iron-DaveMcW-V2.zip
(3.32 MiB) Downloaded 114 times
bm_iron-belter-v6.75sV2.zip
(4.64 MiB) Downloaded 118 times
bm_iron-belter-v6.75pV2.zip
(4.99 MiB) Downloaded 87 times
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Belter »

disentius wrote: Tue Feb 08, 2022 11:57 am I recreated your test, with the following modifications:[...]
Looks like substations are the better solution, marginally:)
I really appreciate this, thank you! Your points are all valid and I will pay more attention for those in the future.

Per the Avg UPS numbers Dave's BP is 1% faster than the pole version. The substation is +2% on top of that giving a 3% difference (+2% to Dave's).
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Belter »

Mind the gap - the challenge!
There is a clear explanation why the mini-gaps appearing. Can you find it out?

I give hints - the last one is the solution. If you liked this challenge reply here your hint level 0..4.

So:
- top row has mini gaps
- bottom row has no mini gaps
Why is that?

MindTheGap.png
MindTheGap.png (858.13 KiB) Viewed 5569 times
Hint 1
Hint 2
Hint 3
Hint 4
Last edited by Belter on Wed Feb 09, 2022 7:59 am, edited 2 times in total.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3715
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by DaveMcW »

You have discovered the difference between a 0-to-143 clock and a 1-to-144 clock.

If you want the 0 signal to last 32 ticks, you need to use the 0-to-143 version.
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Belter »

Belter v6.78p
- After fixing the timer I've re-organized my BP - signal compression is from DaveMcW
- Finally beats DaveMcW v2 - +3.71% UPS. Not much, but consistent
- No further ideas to improve UPS. Time to move to steel finally?
BelterSC v6.78p.png
BelterSC v6.78p.png (547.19 KiB) Viewed 5402 times
Belter v6.78smin
- I thought that using substations would improve even further the UPS. Wrong. Not sure why but slower.
BelterSC v6.78smin.png
BelterSC v6.78smin.png (427.06 KiB) Viewed 5402 times
DaveMcW v2
- Using the BP as posted here
DaveMcW v2.png
DaveMcW v2.png (295.27 KiB) Viewed 5399 times
Benchmark results
- Did a 3 x 50.000 tick measurement w/5x100 lanes.
- Double-checked to have all 3 saves with full smelters. Saves also attached
- Results.csv does not have header as I deleted the file with other results after started the benchmark, data is intact
- Avg UPS: avg UPS of the 3 runs. Min/Max: the slowest/fastest UPS of the 3 runs
- See this post for more pole setup results
Attachments
UPS.png
UPS.png (50.85 KiB) Viewed 5402 times
Times.png
Times.png (50.11 KiB) Viewed 5402 times
b_smeltwiret_DaveMcWv2.zip
(5.48 MiB) Downloaded 237 times
b_smeltwiret_4_Belter-p.zip
(5.1 MiB) Downloaded 234 times
b_smeltwiret_1_Belter-smin.zip
(6.52 MiB) Downloaded 224 times
b_smeltwiret results.csv
(1.05 KiB) Downloaded 235 times
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by disentius »

Davemcw with substation will beat yours:)

2022-02-15 11_51_59-Window.png
2022-02-15 11_51_59-Window.png (124.89 KiB) Viewed 5368 times
Attachments
bm_iron-belter-v6.75s.zip
(2.73 MiB) Downloaded 138 times
bm_iron-DaveMcWs.zip
(1.25 MiB) Downloaded 126 times
bm_ smelting results.csv
(4.8 KiB) Downloaded 129 times
Belter
Fast Inserter
Fast Inserter
Posts: 207
Joined: Sun Mar 14, 2021 12:38 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by Belter »

disentius wrote: Tue Feb 15, 2022 10:55 am Davemcw with substation will beat yours:)
Use v6.78 pls, not 6.75

Substation v6.78s is here: viewtopic.php?f=193&t=101598&p=561689#p561689 with saves.
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by disentius »

i did use your latest saves, and posted results there.
[edit] oops.
Here: viewtopic.php?p=561734#p561734
Last edited by disentius on Wed Feb 16, 2022 11:03 am, edited 1 time in total.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3715
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by DaveMcW »

I found a perfect alignment for the middle inserter that save a few ticks.

I also optimized the clock by removing one active circuit network.

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by disentius »

I ran a benchmark with v3(my modified davemcw with substations vs) v4 (Dave's latest entry).

Base blueprints:
v3
ironv3.png
ironv3.png (555.33 KiB) Viewed 5238 times
v4
ironv4.png
ironv4.png (735.47 KiB) Viewed 5238 times
Results:
2022-02-16 14_16_13-bm_ smelting results.csv - LibreOffice Calc.png
2022-02-16 14_16_13-bm_ smelting results.csv - LibreOffice Calc.png (81.72 KiB) Viewed 5238 times
Attachments
bm_ smelting results.csv
(2.55 KiB) Downloaded 95 times
logfiles.zip
(16.1 MiB) Downloaded 84 times
empty.zip
(397.35 KiB) Downloaded 85 times
bm_iron-DaveMcW-v4.zip
(1.15 MiB) Downloaded 81 times
bm_iron-DaveMcW-v3.zip
(1.17 MiB) Downloaded 78 times
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by disentius »

(Made new saves for both)
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by disentius »

Did the same test with both saves expanded to 500 belts, per remarks of Dave about RAM.
Results:
2022-02-16 16_27_38-bm_ smelting results500 belts.csv - LibreOffice Calc.png
2022-02-16 16_27_38-bm_ smelting results500 belts.csv - LibreOffice Calc.png (81.21 KiB) Viewed 5222 times
Can someone repeat the test? also, why is V3 faster?
Attachments
bm_ smelting results500 belts.csv
(2.68 KiB) Downloaded 170 times
bm_iron-DaveMcW-v3 500.zip
(3.25 MiB) Downloaded 157 times
bm_iron-DaveMcW-v4 500.zip
(3.09 MiB) Downloaded 152 times
logfiles 500 belts.zip
(19.33 MiB) Downloaded 90 times
flame_Sla
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Fri Mar 01, 2019 12:54 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by flame_Sla »

Belter,
why is a full belt used to feed ore?
it should be much better this way
Attachments
UPS optimized 12-beacon smelting - wminimal circuits.png
UPS optimized 12-beacon smelting - wminimal circuits.png (549.54 KiB) Viewed 5166 times
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: UPS optimized 12-beacon smelting - w/minimal circuits

Post by disentius »

Tested Flame's config.
As POC I made a DaveMcW v5 and tested it against v4(Dave's latest entry and v3(substations). it was a bit of a puzzle, and I had to abandon using Substations as in v3.
- all saves have run at least 10 minutes , or as long as it takes to fill the furnaces to 100 plates.
- 100 belts production

Results:
Seems like it is slightly better. v5 has more belts, and 100 more infinity loaders, and is still slightly faster.
2022-02-18 15_02_18-Window.png
2022-02-18 15_02_18-Window.png (108.02 KiB) Viewed 5132 times
Attachments
bm_iron-DaveMcW-v4 100.zip
(1.15 MiB) Downloaded 84 times
bm_iron-DaveMcW-v3 100.zip
(1.17 MiB) Downloaded 86 times
bm_iron-DaveMcW-v5 100.zip
(1.35 MiB) Downloaded 95 times
bm_ smelting results 100 belts.csv
(3.86 KiB) Downloaded 103 times
logfiles 100 belts2.zip
(24.28 MiB) Downloaded 71 times
Post Reply

Return to “Combinator Creations”