Skip to content

Instantly share code, notes, and snippets.

@Grimy
Last active February 10, 2018 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Grimy/2b8f0c98647ea5269f04c99bb44c5d03 to your computer and use it in GitHub Desktop.
Save Grimy/2b8f0c98647ea5269f04c99bb44c5d03 to your computer and use it in GitHub Desktop.

Preservative Salt in 23 cycles — An analysis

Overview

[gif] Preservative Salt in 23 cycles

There’s… a lot of things happening, here. The first thing to notice is that this solution actually consists of two independent pipelines. The main one can reach a throughput of 1:3, while the slow one makes a single output out of the leftovers of the main pipeline. This is inspired by the “odd one out” designs of /u/biggiemac42 (Wakefulness Potion, Universal Solvent, Wheel Representation).

[gif] Main pipeline only

This is the main pipeline in isolation. It’s a modified version of my 24 cycles solution. The 24 grabs airs every 3 cycles, making it impossible to grab any more without crashing. This solution instead grabs airs on cycles 1, 5, 7, 11, 13, 17, leaving the airs from 3, 9, 15 available. It also grabs its first quad-salt input on cycle 3, which is why it is 2 cycles slower.

Slow pipeline only

This is the slow pipeline in isolation. It grabs the quad-salt on 1, the air on 3, 9, 15, and outputs on 22, right before the 5th output of the main pipeline. It looks a bit silly on its own, since most of what it’s doing is to avoid collisions with the main pipeline. Note that the top-left arm is shared between the two pipelines.

Period Converter

There’s a total of 5 atoms in the inputs, and 7 atoms in the output. This means that the maximum throughput possible is 5:14 (5 outputs every 14 cycles, which is the time it takes to grab each input 7 times).

However, a 1:3 throughput (93% of max) is much easier to work with, and can generate the 6th output just as fast as 5:14. Since the timer stops after the 6th output, reaching max throughput is actually useless when optimizing this puzzle for cycles. It would be a very different story if it required 30 outputs.

If we’re going to have 1:3 throughput, it would be natural to use a 3 cycles loop. 3-loops are very uncommon: the only other puzzle where I’ve used one is Litharge Separation. But Litharge is fully output-limited, so it doesn’t need more than one input every 3 cycles anyway. Here, we need to grab inputs every 2 cycles, and then somehow feed them into a 3-loop mechanism.

That’s the job of the first half of the main pipeline:

Period Converter

(The two 6-way arms were added just so the gif would record, ignore those.)

The leftmost track loop grabs one quad-salt every 6-loop, splices it up, and outputs salt atoms in two different spots, each one every 3 cycles. 4:6 = 1:3 + 1:3, math checks out.

The top two arms were copied from /u/DotaGuy12’s 28 cycles solution. They grab the quad-salt on cycles 3 and 5 of each 6-loop, and move it to the same position. But the arm grabbing on 5 has one extra cycle of latency, so even though the arms grab 2 cycles apart, they release 3 cycles apart. Which is convenient, since feeding this into a 3-loop is what we wanted to do in the first place.

The rightmost track grabs one air atom every 3 cycles, and adds it to the incoming quad-salt. But simply grabbing from the input every 3 cycles would leave it unusable, and moving too early would cause unwanted bonding, so instead it does some gymnastics with the catalyst.

The lonely top-right arm just brings air atoms to the duplication glyph. It needs the triangle track to avoid the collision from atoms crossing at a 60° angle.

Note that it’s necessary to duplicate now, because the next part is going to be extremely busy.

Assembly

Assembly

Here’s the assembly process, zoomed in and slowed down. This is the densest part of the solution: in just 3 cycles, it creates 6 bonds and converts one salt to air. This is made much harder by the two “missing” bonds in the output, which it must avoid creating. It all works on a 3-loop, which makes it hard to use rotations or pivots without having the arm bases collide into each other (3-loop imposes a limit of at most 2 non-translation instructions in a row, so for example pivot-pivot-release is impossible).

There’s no clever trick here, just a lot of trial and error.

The end

Here’s a summary, demonstrating my mad Paint skills:

Mad skills

And in closing, here’s the full gif again:

[gif] Preservative Salt in 23 cycles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment