cpuinside03 is a small Raylib app that renders an interactive CPU blueprint for an AArch64 lock-contention scenario.
The code is AI Slop but the visualisation is cool.
cpuinside.mov
The visualization focuses on:
- two CPU cores with register files, ALU, load/store units, and L1 data caches
- a coherency fabric and main memory
- a source-to-assembly view of a spinlock loop using
LDAXR/STXR - a kernel-side futex path showing syscall entry, wait queue, scheduler, and wakeup flow
The app is not a hardware simulator. It is a visual walkthrough of a fixed 12-step sequence that shows how lock ownership, cache-line state, and the fallback into futex_wait move through the system.
This repo contains a single C source file, main.c, and a simple Makefile.
Requirements:
- a C compiler such as
ccorclang raylibpkg-configso theMakefilecan resolve Raylib compiler and linker flags
Build and run:
make
make runThe binary produced by the Makefile is blueprint_app.
q: quit1: switch to the blueprint page2: switch to Page 2space: pause or resume time-based animationnorRight Arrow: advance the lock/coherency demo by one stepr: reset the camera, execution state, page, and pause state- left mouse drag: pan the blueprint
- mouse wheel: zoom around the cursor
- left click or drag inside the minimap: jump the camera within the world
- left click on the top bar page buttons: switch pages
Page 1 is the main view. It contains four top-level regions:
C++ SourceAssemblyCPUKernel
As you zoom in, more detail appears, including:
- highlighted source and assembly lines for the current step
- register values and read/write ports
- active cache-line ownership and coherence state
- syscall, futex queue, scheduler, and wakeup annotations
- a minimap for navigating the large blueprint
Page 2 currently exists in the UI but is only a placeholder labeled "Reserved for future views."