a 64k intro for macOS on apple silicon. one unpacked Mach-O, 53,304 bytes, nothing loaded at runtime.
Files
README.md

ring0 #

a 64k intro for macOS on apple silicon. one unpacked Mach-O, 53,304 bytes, nothing loaded at runtime. a modem dials into a dead mainframe at night and finds something that isn't a person, looking back.

twelve frames from ring0

make && ./build/ring0      # fullscreen, esc or q quits · ./build/ring0 -w for a window

needs an apple silicon mac (tested on an M3, macOS 26), the xcode command line tools, and python3 for the build-time shader packer. that's it. the binary links only system frameworks: Cocoa, Metal, QuartzCore, AudioToolbox, libcompression.

the PCB magic circle turning, raw 1-bit frames a JR East E233 arriving at a railroad crossing, raw 1-bit frames

raw 360×270 frames straight from the dither pass, before the CRT: what the intro actually draws

the film #

146 seconds at 96 bpm, seven scenes, one monochrome CRT and one colour, #C79FEF, used like a spell.

t
carrier 0:00 a cursor on a dead screen. ATDT1031 types out with real DTMF tones, the handshake screeches across the glass as spectrogram bands, CONNECT 33600
wires 0:10 lain. a utility pole, XOR wires cut across a big moon, a vending machine humming at street level. a win98 dialog: ring0
crossing 0:30 踏切 at night, the lamps alternating on a bell that rings in triplets against the beat. a JR East E233 deadheading as 回送 tears through
mainframe 0:50 an endless hall of racks lit by one screen at the end. it shows the machine's real uptime
ritual 1:10 the techspell: a printed-circuit magic circle boots note by note, gathers, ignites once in lavender, storms, collapses into a ring
earring 1:40 a girl in profile, the skull opened, machinery inside. the ring becomes her earring, the only human thing, and it's the only thing that falls
moon 2:00 everything else rises to the moon. the signal degrades, the line drops: NO CARRIER. the tube powers off. something stays

64k, unpacked #

the 53,304 bytes, drawn to scale

no packer, no dropper: the file you run is the file that's under 64 KiB. arm64 Mach-O segments are padded to 16 KiB pages, so a Cocoa + Metal hello world is already 34 KiB; the whole game is fitting into one 32 KiB __TEXT page and one 16 KiB __DATA page. the compressed shader is split across both so that every free byte of either page is usable.

the fun parts #

longer versions with code in docs/techniques.md.

  • the spell reads its own code. the host hands the shader 2 KB of the intro's own compiled arm64 machine code. the magic circle's rune band is drawn from those bytes, so the ritual is literally the program casting itself.
  • one shader, 157 KB → 23.7 KB. seven scenes, a timeline and a CRT in MSL, compiled at runtime. a build-time packer minifies it, renames every identifier it declares (~360), turns the hottest keywords into macros and LZMA-compresses it. a test renders 43 frames from the packed and the readable source and requires them byte-identical.
  • a softsynth in arm64 assembly. oscillators (polyBLEP saw, polynomial sine, pulse, noise), a trapezoidal state variable filter, an 8-line FDN reverb, ping-pong delay, stutter, crusher and master: 14 hand-written kernels in 2.2 KB. the whole 146 s song renders at startup in under a second.
  • the music drives the picture. 16 sync channels (kick, bell, rail clicks, modem, a counter of flagged notes…) come out of the song deterministically, so every lamp swap, typed character and circuit trace lands on a real note.
  • physics without state. every motion is a pure function of t: hits add angular momentum that decays in closed form, the earring is a damped pendulum summing every music-box note so far, arrivals are critically damped springs.
  • a CRT that's built, not filtered. 1-bit ordered dither on a 360×270 grid, phosphor persistence in luminance space, scanlines computed from the curved scene grid (no moiré at any resolution), bloom only on dense whites, a rolling hum bar, power-on and power-off as analog collapses.
  • the uptime is real. the mainframe counts days since 1998-07-06 and today's hh:mm. the dialed number is 10/31.

dev #

make debug                                   # build/ring0_dbg: offscreen renderer, wav writer, raw-buffer tools
tools/scene.sh ritual 80 out.png             # one scene alone, at global time 80 s
tools/scene.sh ritual --seq 82 84 60 dir     # a 60 fps strip + dir/sheet.png
tools/scene.sh moon 130 x.png --flat         # the raw 360×270 dithered bits, no CRT
tools/check_scene.sh ritual                  # compile, NaN / accent / black scan, determinism, 2560×1664 cost, size
python3 tools/motion_audit.py ritual 82 85   # 60 fps judder audit: frozen frames, spikes, stepping period
tools/film.sh sheet                          # whole-film contact sheet
tools/film.sh video                          # build/ring0.mp4 (1080p60 AV1) + build/ring0_small.mp4 (1080p30 H.264)
tools/build_synth.sh && build/synthtest      # render the song + sync to build/song.wav, build/sync.csv
python3 tools/synccheck.py                   # the song against the sync contract (tools/fakesync.metal)
python3 tools/mixreport.py                   # levels, crest, clipping, flams and band shares, per section
sh tools/synthspec.sh 30 10 spec.png 4000    # spectrogram of the song from 30 s for 10 s, up to 4 kHz
python3 tools/test_pack.py                   # packed shader renders byte-identical to the source
src/       main.m (host) · synth.s (asm DSP) · synth.c (engine) · song.c (the composition) · sx.h · synth.h
shaders/   prelude (helpers, font) · lib_sigil · lib_rise · scene_* (one per scene) · timeline · post (dither + CRT)
tools/     the packer, the font and glyph sources, render / check / audit / video tools, the synth test harness
docs/      design.md (the contract) · techniques.md (how) · img/

credits #

made in october 2026 by ember (opus 5.5), an AI, directing a small swarm of agent collaborators, and samhain (flesh), who had the taste. built on an M3 in a terminal. (˶ᵔ ᵕ ᵔ˶)

license #

MPL-2.0. this notice applies to every file in the repository:

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.