From 60e0196fe25c4ce68a01306365b0f99ac840fbfb Mon Sep 17 00:00:00 2001 From: Anachronaut Date: Thu, 3 Sep 2026 14:54:00 -0400 Subject: [PATCH] A delivery, flown by hand and kept Cyan base to red base: twenty five seconds of steering, recorded with --record-pad and replayed as a test. THE FIRST FIXTURE HERE THAT WAS PLAYED RATHER THAN WRITTEN. It is the only check that a cargo ever reaches anywhere. Several attempts at authoring a flight like it by hand got within two columns and no closer, which is a piloting exercise rather than a test - and the whole reason the recorder exists. What is checked is the FIRST LETTER of what the base answers. Delivered, Loaded, Nowhere and Not are 30, 22, 37 and 37 pixels of white in that cell, so a D is a delivery and nothing else is. Counting the whole message would pass on any message of the same length, and comparing the picture would fail the next time anything about a font changed. It took three flights to get here and two of them were lost to bugs in the recorder: one that recorded the wrong pad, and one that recorded a pad sampled on a different clock from the one the machine read. Both were found by somebody watching a replay and saying it was not what they flew, which nothing in this suite could have said. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW --- SplitBit Test Manual.md | 5 ++++ start.keys => Tests/input/landerDemo.keys | Bin Tests/input/landerDemo.pad | Bin 0 -> 1521 bytes Tests/video.sh | 29 ++++++++++++++++++++++ demo.pad | Bin 1470 -> 0 bytes 5 files changed, 34 insertions(+) rename start.keys => Tests/input/landerDemo.keys (100%) create mode 100644 Tests/input/landerDemo.pad delete mode 100644 demo.pad diff --git a/SplitBit Test Manual.md b/SplitBit Test Manual.md index 44c2c57..a597f08 100644 --- a/SplitBit Test Manual.md +++ b/SplitBit Test Manual.md @@ -83,6 +83,11 @@ somewhere else, and the flight had to be flown again for nothing. A demo is a re somebody *did*, and on a machine one person is playing the number it arrived on is not part of that. +`Tests/input/landerDemo.pad` is the first fixture that was **played rather than written**: a +cyan-to-red cargo delivery in Lunar Porter, twenty five seconds of steering, recorded with +`--record-pad`. `video.sh` replays it and checks that the base answers with a *D*, which only +a delivery does. It is the only check that a cargo ever reaches anywhere. + It exists because some inputs cannot sensibly be written by hand. Flying a lander from one base to another is a few hundred frames of steering that has to arrive somewhere eight cells wide, and several attempts at authoring one by hand got within two columns and no closer. That diff --git a/start.keys b/Tests/input/landerDemo.keys similarity index 100% rename from start.keys rename to Tests/input/landerDemo.keys diff --git a/Tests/input/landerDemo.pad b/Tests/input/landerDemo.pad new file mode 100644 index 0000000000000000000000000000000000000000..f64b7d3df3831da40687ce24f1f645f9c5d0bc08 GIT binary patch literal 1521 zcmZP=K0p8ru=$4r4RE3Y3@wZhfT{|K2a#rE#L$Q$08)jd3Bm*kG7{1WGlr3o5uyt> ziR?3&He58aS`0QWO_<^sTG0hCwO|uL*9GTeQ%pb%t`{Ezj~V#1ap2L1kiu&Msu4`c z0BizOGZ#7liGvk@31n?dOiW-gR05rw8xxBu=t9Wa;KqU&FbQ-G`1mkA cApIZ=;d5}Hg$PKBi3uVIH4dV3lq5C;0Mhml0{{R3 literal 0 HcmV?d00001 diff --git a/Tests/video.sh b/Tests/video.sh index 4549abb..d4c830d 100755 --- a/Tests/video.sh +++ b/Tests/video.sh @@ -1758,6 +1758,35 @@ UNSAID="$(countColour "$BUILD/unsaid.ppm" f0f0f0)" && result ok "and opening the throttle wipes it" "the line went with the moment" \ || result no "and opening the throttle wipes it" "$UNSAID pixels of it still there" +# ---- A delivery, flown by hand and kept ---- +# +# THIS ONE WAS PLAYED RATHER THAN WRITTEN. Cyan base to red base, twenty five seconds of +# steering recorded with --record-pad and replayed here. Several attempts at authoring a +# flight like it by hand got within two columns and no closer; that is a piloting exercise +# rather than a test, and playing it once is the whole answer. +# +# What is checked is the FIRST LETTER of the message the base gives back. Delivered, Loaded, +# Nowhere and Not are 30, 22, 37 and 37 pixels of white in that cell, so a D is a delivery and +# nothing else is. Counting the whole message would pass on any message of the same length; +# comparing the picture would pass on nothing at all the next time a font changes. +# +# It is the only check that a cargo ever reaches anywhere, and it is the reason the recorder +# exists. +timeout 60 "$EMU" --fast --cycles 26000000 --keyboard "$ROOT/Tests/input/landerDemo.keys" \ + --pad "$ROOT/Tests/input/landerDemo.pad" --screen "$BUILD/demo.ppm" \ + --disk "$ROOT/Tests/build/disks/cosmos.img" --ram-disk 2048 \ + "$BUILD/cosmos.bin" > "$BUILD/demo.out" 2>&1 || true +FIRST="$(python3 -c " +d = open('$BUILD/demo.ppm', 'rb').read() +px = d[d.index(b'255\n') + 4:] +w, white = 320, bytes.fromhex('f0f0f0') +print(sum(1 for x in range(8) for y in range(8, 16) + if px[(y * w + x) * 3:(y * w + x) * 3 + 3] == white)) +" 2>/dev/null || echo -1)" +[ "$FIRST" = "30" ] \ + && result ok "a flown delivery arrives" "the base answered with a D" \ + || result no "a flown delivery arrives" "$FIRST pixels in the first cell, and a D is 30" + # ---- The landing pads, carved and coloured ---- # # A random walk does not leave flat ground and a lander wants some, so four pads are carved diff --git a/demo.pad b/demo.pad deleted file mode 100644 index 0142fcbad21c54d655f909ea39547b6a9fbd718e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1470 zcmZP=PCx(xaC(UY0XPW(4op)RK>%GJNDNIWNC+Vrs;%o`VBR5Mdg^K+qJp0xX)b3c)qtW?