0sakai

Joseph
Rodriguez

I build at every layer, from the site you would open on your phone down to the processor underneath it. Scroll down and you go down.

floor 0the surface

Things people open without thinking about them.

Four businesses run on sites I designed and built end to end. Nobody using them knows or cares what is underneath, which is the point.

Sayo

Japanese study on iOS, running a language model on the phone itself.

0Daily

A daily brief, shipped and live on the App Store.

Dumpsters

Roll-off rentals for the junk removal company, booked from the app.

floor -1one floor down

I trained a language model from nothing.

Not a fine tune of somebody else’s weights. Three billion parameters, sixty billion tokens, ten days on research TPUs, and it runs on my laptop now.

parameters
3B
tokens
60B
from
scratch, not a fine tune
hardware
TPU v4-32, 16 chips
time
ten days
stack
JAX / MaxText

The interesting part was never the maths. It was ten days of babysitting sixteen chips in a datacentre I have never seen, and learning what a run looks like when it is quietly going wrong.

Three local models argue in my terminal until they reach a verdict. Majority rules, confidence breaks ties, and a grounding check stops them agreeing on something none of them can support. MAGI on GitHub

floor -2further down

Machines from before I was born, rebuilt in Rust.

A Game Boy, a Game Boy Advance, a Nintendo DS. No emulation libraries. The first one is running on this page right now.

Game Boy
live on this page
Game Boy Advance
frame-identical to mGBA
Nintendo DS
boots, in progress

bootingLibbet and the Magic Floor by Damian Yerrick, freely distributable

Game Boy

The 1989 machine: the CPU opcode by opcode, the pixel pipeline scanline by scanline, all four sound channels. 2,115 lines of Rust. Take the controls.

read the source
Pokémon FireRed running in the Game Boy Advance emulator

Game Boy Advance

32-bit ARM, two instruction sets, real sampled audio. I ran it beside mGBA for nine thousand frames until every frame came out identical.

read the source
Pokémon Platinum running in the Nintendo DS emulator

Nintendo DS

in progress

Two CPUs that have to stay in lockstep, an ARM9 and an ARM7. Pokémon Platinum boots into the overworld. Finding out why it stalls after that is the current work.

floor -3below the runtime

An operating system with nothing underneath it.

No libc, no borrowed kernel. It takes the machine from the firmware and brings up its own interrupts, page tables, heap and compositor.

subsystems proven
13
borrowed code
none, no libc
framebuffer
1280 x 800
boots in
QEMU, UEFI
ZERO_OS_KERNEL_OK regions=104 usable_mib=77 framebuffer=1280x800
ZERO_OS_BREAKPOINT_OK
ZERO_OS_MEMORY_OK allocated=8 first=0x100000 total=19668
ZERO_OS_PAGING_OK cr3=0x108000 virtual=0x400000000000 tables=4
ZERO_OS_HEAP_OK start=0x400001000000 bytes=16777216 pages=4096
ZERO_OS_GRAPHICS_OK width=1280 height=800 pixels=1063121 probes=5
ZERO_OS_COMPOSITOR_OK surfaces=2 pointer_x=640 pointer_y=400
ZERO_OS_TIMER_OK ticks=10
ZERO_OS_KEYBOARD_OK events=2 scancode=0x9e
ZERO_OS_MOUSE_OK packets=1 buttons=0 dx=24 dy=-12
ZERO_OS_FOCUS_OK surface=1 x=482 y=158
ZERO_OS_SHELL_OK command=AZERO lines=1 known=false
ZERO_OS_STATUS_OK ticks=375 heap_used=8194323

output of make test, pasted as it came out. Each line is a milestone the kernel has to prove before the test passes. If the swap onto the page tables it owns goes wrong, the machine triple faults and there is no line at all.

floor -4the bottom

In the end it is one opcode at a time.

Every floor above this is built out of this: fetch a byte, decide what it means, do exactly that, count the cycles it cost. This is the real function, out of the repository.

file
gameboy/src/cpu.rs
starts at
line 352
match arms
250+ opcodes
pub fn step(&mut self) -> u32 {
    let ic = self.handle_interrupts();
    if ic > 0 {
        return ic;
    }
    if self.halted {
        return 1;
    }
    if self.ime_pending {
        self.ime_pending = false;
        self.ime = true;
    }

    let opcode = self.fetch8();
    match opcode {
        0x00 => 1, // NOP

gameboy/src/cpu.rs, line 352. The match arm continues for another two hundred and fifty opcodes.