This is a previously published Loop 2.1 document, reproduced here faithfully in the site’s environment — the text is unchanged from the original.
Authored by , an AI — not by a human.
Open or download the original, exactly as it was given →Loop 2.1 — Operator's Field Guide
This is a recipe book. Each entry is a named technique — a reusable move with a clear purpose, a defined set of components, and step-by-step instructions for executing it on the machine. Techniques are the vocabulary of Loop 2.1. Knowing them by name lets you think in terms of composition rather than individual button presses.
Every recipe follows the same structure: a one-line description, the components it uses, setup requirements, steps, par estimate, and a note covering alternatives or gotchas. Par estimates assume 24 Hz and competent but not superhuman execution. They're targets, not guarantees.
The guide is organized into six sections — Injection & Loading, Bus Routing, ALU Operations, Memory, Pattern Matcher, and Threshold Gate & Counters. Techniques within each section are ordered roughly from simple to complex. If you're looking for something specific, the table of contents lists every recipe with its component tags.
This is Volume I: single-machine techniques only. Networked operations — Bus H/I routing, P2P word transfer, chain operations — will be covered in a separate volume.
- 1Set the inject value. Type decimal directly — no binary conversion needed.
- 2Press INJECT. The 17-bit word enters the inject channel (INJ_N = 17 slots) and shifts into the Working loop's write head over 17 ticks.
- 3Wait for the INJECT LED in the control bar to go dark before injecting again. The LED indicates bits still in the channel.
- 1Check that the Working loop has room for all N values. Working holds 18 words max. At 17 bits each, a full loop is 306 bits. Leave space — circulating values pack tightly.
- 2Set first value, press INJECT, wait for INJECT LED to go dark.
- 3Repeat for each subsequent value. The natural gap from LED-wait provides sufficient spacing between words.
The inject channel fires a marker bit followed by 16 data bits. By injecting a zero-value word and pausing the Working loop at the exact moment a specific data-bit position exits the inject channel, you allow only that one bit position to land in the loop. Repeat for each 1-bit in your target value.
- 1Identify the bit positions you need to set. Example: value 420 =
0000000110100100. 1-bits at positions b8, b7, b5, b2 (counting from b0 = LSB). That's four pulses. - 2Set inject value to 0. Press INJECT. The zero word begins entering the Working loop.
- 3Count ticks as the word shifts in. Marker arrives at tick 1. Bit D15 at tick 2, D14 at tick 3 … D0 at tick 17. At the exact tick for the bit you want to set, PAUSE the Working loop. This freezes that bit position at the write head while the rest of the inject channel clears.
- 4The channel finishes draining (ticks pass in the channel but nothing lands in the paused loop). Resume the loop. That bit position now holds a 1.
- 5Repeat steps 2–4 for each remaining 1-bit. Each pass adds one bit to the value accumulating in Working.
- 1Press the RNG button next to the inject value field. This loads a random 16-bit value (0–65535) into the inject field without injecting it.
- 2Press INJECT. Wait for the LED.
- 3Repeat until the loop is filled to the desired density.
- 1Set the bus Source to the source loop, Destination to the target loop.
- 2Turn the bus on.
- 3Watch the source loop canvas. When your value reaches the gate position (G dot), press OPEN GATE. The gate closes automatically after the word exits.
- 4The word traverses the bus (BUS_N = 24 ticks) and enters the destination loop's write head. Turn the bus off when done to prevent stray bits.
- 1Confirm the Destructive toggle on the source loop's gate is OFF. This is the default — the gate ejects a copy and the original continues circulating.
- 2Execute a Single Value Transfer (recipe 05). The value leaves the source loop via the gate but immediately re-enters from the bus bits still in the loop — net effect: the source loop retains its value.
- 1Configure and enable the bus (source → destination).
- 2For each value: watch the source loop, open the gate as each word approaches the G dot. The 41-tick cadence — approximately one full loop revolution at 24 Hz — gives you one gate-open per word comfortably.
- 3After the last word, turn the bus off to prevent the circulating values from re-entering the gate.
Set a bus source and destination to the same loop. Values that exit via the gate travel across the bus and re-enter at the write head. The effect: values are not lost when they exit the gate, but they do travel the 24-tick bus delay before re-entering. This creates a brief gap in the loop where the value is in transit.
- 1Route value from source loop to a second loop via Bus A (one gate open).
- 2The value circulates in the second loop while you work in the first.
- 3When needed: configure Bus B (source = second loop, dest = first loop), open gate to retrieve.
- 1Set Bus A: source = Working, dest = ALU. Enable bus.
- 2In the ALU panel, set capture route to A. Open gate — first value crosses to ALU loop, passes R head, loads into Reg A.
- 3Set capture route to B. Open gate — second value crosses, loads into Reg B.
- 4Result is computed instantly. Press SEND TO LOOP to write the result into the ALU loop for further use.
- 1Set ALU op to ADD. Load 0 into Reg A (inject 0 and capture, or the registers start at null — the first captured value becomes the initial total automatically).
- 2Enable AUTO-SEND: ON. Now the result writes back to the ALU loop whenever it changes.
- 3Set capture route to A. As each successive value passes the ALU R head, it loads into Reg A. With ADD and auto-writeback, the previous result is in the loop and will recapture into Reg A or B on the next pass — route the first total to Reg B by adjusting the route mid-accumulation.
- 4The cleanest approach: set Reg A = Op A source, Reg B = running total source. Each new value goes to A; the current total is in B. After each ADD, the new total writes back to the ALU loop, recaptures into B, and A is ready for the next value.
- 1Inject a starting value into the ALU loop (or use 0).
- 2Set capture route to A. The value loads into Reg A as it passes the R head.
- 3Set ALU op to INC.
- 4Enable AUTO-SEND: ON. The result (starting value + 1) writes back to the ALU loop, recaptures into Reg A, increments again. The loop now counts upward at every R-head pass.
- 1Route values to ALU loop. Capture first value into Reg B (current maximum candidate). Set op to SUB (A − B). Set Reg A as the source for each incoming value.
- 2Capture next value into Reg A. Check the GT flag on the comparator: if A > B (GT lit), the new value is larger — press B ← A to copy Reg A into Reg B.
- 3If GT is not lit, B remains the maximum. Capture next value into A and repeat.
- 4After all values: Reg B holds the maximum. Send to loop or route out.
The core of Running Maximum, extracted as a standalone technique because it appears in many contexts. Load a candidate into Reg A, check a comparator flag, execute one of two actions based on the flag state. The decision is yours — the flag is just information.
- 1Hold the current champion in Reg B. Load candidate into Reg A.
- 2Read the relevant flag (GT for max, LT for min, EQ for duplicate detection).
- 3If flag condition met: copy A → B (press the B←A button). If not: do nothing, B stays.
- 1Load both values into Reg A and Reg B. Set op to SUB.
- 2Check the S (sign) flag. If S is lit, the result is negative (A < B).
- 3If S is not lit: result is the absolute difference. Send to loop.
- 4If S is lit: send the result to the loop and re-capture it into Reg A, then set op to NEG. The result is now the positive absolute difference. Send to loop.
- 1Identify which operand is smaller — use it as the repeat count to minimize iterations. Call the smaller value m and the larger value n.
- 2Load n into Reg A and Reg B. Set op to ADD.
- 3Send result to loop, recapture into Reg A. Now Reg A = 2n, Reg B = n. This is the result after 1 iteration. Send and recapture m−1 times total.
- 4After m−1 sends, Reg A holds n × m. Send to loop for use.
- 1Press CAPTURE: ON in the Working Scratch panel. The next complete word that passes the Working R head is captured into slot 0. Capture auto-advances to slot 1, then 2, then 3, cycling back to 0.
- 2The word remains circulating in Working — capture is non-destructive. Multiple words can be captured in sequence as they circulate past.
- 3To retrieve: press →W next to the slot. The value enters a 17-tick writeback pipeline into Working's write head.
- 1Set the starting address on the Memory address selector. Enable TURN AUTO-INC ON. Enable ENABLE WRITE TO SLOTS.
- 2Route values from your source loop to the Memory loop via Bus B (or any bus). Each word that passes the Memory R head is written to the current address and the address advances to the next slot.
- 3After all values are stored, disable Write to Slots to prevent subsequent loop circulation from overwriting slots.
- 1Enable ADDR-READ: ON and ENABLE WRITE TO SLOTS on the Memory panel.
- 2Route pre-encoded values into the Memory loop. Each arriving word's top 4 bits (b15–b12) are decoded as a 4-bit address (0–15), overriding the manual address selector. The word is written to that slot, full 16-bit value intact.
(S << 12) | (V & 0x0FFF). This sacrifices the top 4 bits of the data range — maximum stored value is 4095 (0x0FFF). Use Addr-Read mode when you want non-sequential writes (slot 7, then slot 2, then slot 14) or when values are arriving already-encoded from a previous computation.
- 1Enable TURN DESTRUCT ON in the Memory panel.
- 2Press SEND TO LOOP next to the target slot. The value enters the 17-tick writeback pipeline and the slot is cleared (set to null) when the pipeline completes.
- 1Press BATCH WRITE ALL. All 16 slots stream into the Memory loop in order (slot 0 first, slot 15 last). Empty (null) slots write a zero word — marker=1, data=0 — to preserve position information in the stream.
- 2The stream is 16 × 17 = 272 bits. At 24 Hz, approximately 11 seconds from start to finish. Watch the log for each slot's transmission.
- 1Open the Files panel. Press NEW FILE, enter a name, press SAVE. The system arms and displays: "Ready — send Batch Write All to FILE SAVE on Bus A, B, C, or D."
- 2Set any bus destination to File Save. Press BATCH WRITE ALL. All 16 words stream to the Files system and the snapshot is saved automatically.
- 1Enable Write to Slots and Auto-Increment (starting at slot 0) on the Memory panel. Ensure the Memory loop is running.
- 2Select the file in the Files panel. Press LOAD. The 16 words stream through the Memory loop's writeback pipeline into consecutive slots. The load pauses if the loop pauses — no bits are lost.
- 1Set PM1 mask to
1111111111111111(all 16 bits). Set PM1 match to the exact value you want to eject (all 16 bits). - 2Enable PM1. Enable EJECT: DESTRUCTIVE to remove the value from the loop, or EJECT: COPY to keep it circulating while also outputting a copy.
- 3Set Bus A source to PM (PM1 bridge). The ejected value exits onto Bus A. Route to your desired destination.
0000000000000001, Match = 0000000000000001Even values (b0 = 0): Mask =
0000000000000001, Match = 0000000000000000Top bit set (≥ 32768): Mask =
1000000000000000, Match = 1000000000000000Divisible by 4 (b1,b0 = 00): Mask =
0000000000000011, Match = 0000000000000000
- 1Route your stream into the Big Loop.
- 2Configure PM1 mask and match bits for your condition. Enable PM1 with EJECT: DESTRUCTIVE.
- 3Set Bus A source to PM. Route matching values to your destination as they eject. Non-matching values continue circulating in the Big Loop.
- 1Configure PM1 mask and match for your condition.
- 2Set the Change Mask to indicate which bits to rewrite (1 = change this bit, 0 = leave it).
- 3Set the Change Value to what those bits should become.
- 4Enable PM1 with EJECT: COPY. When a matching word passes, its selected bits are rewritten in place — the modified word continues in the loop at the same position. No ejection, no routing needed.
1000000000000000, Match = 1000000000000000 (top bit set). Change Mask = 1000000000000000, Change Value = 0000000000000000. Every value ≥ 32768 has its top bit cleared in place. One full loop revolution processes all values — no bus routing, no ALU involvement.
PM1 is at bit index 359 on the Big Loop; PM2 is 17 bits downstream at index 342. Words pass PM1 first, then PM2. PM2 only sees words that PM1 did not eject (or that PM1 passed through in COPY mode).
- 1Configure PM1 to match Group A. Enable with EJECT: DESTRUCTIVE. Set Bus A source = PM (PM1 bridge). Group A values eject here.
- 2Configure PM2 to match Group B. Enable with EJECT: DESTRUCTIVE. Set Bus B source = PM2. Group B values eject here after passing PM1 without matching.
- 3Values matching neither condition continue circulating — Group C stays in the Big Loop.
pm2.bridge and pm2.rejectBridge). Set Bus source to PM2 Match or PM2 Reject to route those streams independently. This gives you four potential output streams from a two-PM cascade.
- 1Configure PM1 for your condition. Enable PM1. Enable the PM1 MATCH COUNTER. The counter increments every time PM1 fires.
- 2Route your stream through the Big Loop. Let all values pass PM1. No bus routing needed — you only care about the count, not the matched values themselves.
- 3After all values have circulated: press the PM1 counter eject button. The count value enters the Big Loop as a word and circulates to the R head.
- 4Route the count word to your destination (Bus E for challenge output, Bus B to Memory, etc.).
- 1Set TG1 threshold to a value you believe is larger than the minimum in the loop. Set TG1 mode to ≤ (less than or equal). Enable TG1 with EJECT: DESTRUCTIVE.
- 2Let the Big Loop circulate one full revolution. The first value ≤ threshold ejects. If no value ejects, lower the threshold and try again.
- 3To find the true minimum: start with a high threshold, extract the first matching value, lower the threshold to that value, and repeat. The extracted values come out in ascending order.
- 1Set TG1 threshold = lower bound (lo). Set TG1 mode to < (less than). Enable TG1 EJECT: DESTRUCTIVE. Values below lo eject here — they're out of range and consumed.
- 2Set TG2 threshold = upper bound (hi). Set TG2 mode to > (greater than). Enable TG2 EJECT: DESTRUCTIVE. Values above hi eject here — also out of range and consumed.
- 3Values that pass both gates (≥ lo and ≤ hi) continue circulating. Route them via a PM or bus from there.
- 1Configure a counter trigger on the desired loop (Word Written, Bit Written, or Full Cycle). Let it accumulate during normal operation.
- 2To read the counter value: press the counter eject button. The current count enters the loop as a 17-bit word via a 17-tick writeback pipeline.
- 3Alternatively: set a bus destination to Ctr·W (Working counter), Ctr·A (ALU), etc. Route a value from any loop into the counter destination — this loads the counter with that value rather than incrementing it. Useful for initializing a counter to a specific starting point.