Verified pixel expression -> x86_64 compiler for TempleOS in Isabelle/HOL
  • Isabelle 53.2%
  • Python 24%
  • Standard ML 9.8%
  • HolyC 9.5%
  • C 2.9%
  • Other 0.6%
Find a file
2026-12-03 22:20:23 +01:00
cli feat(movie): play video with ac97 audio in templeos using a proved playback kernel 2026-12-03 22:20:23 +01:00
examples feat(compiler): add verified pixel compiler and templeos runner 2026-08-31 12:00:00 +01:00
guest feat(movie): play video with ac97 audio in templeos using a proved playback kernel 2026-12-03 22:20:23 +01:00
media feat(x86): prove emitted instruction execution and return-frame consumption 2026-11-01 03:54:53 +00:00
src feat(movie): play video with ac97 audio in templeos using a proved playback kernel 2026-12-03 22:20:23 +01:00
tests feat(movie): play video with ac97 audio in templeos using a proved playback kernel 2026-12-03 22:20:23 +01:00
.gitignore feat(compiler): add verified pixel compiler and templeos runner 2026-08-31 12:00:00 +01:00
Makefile feat(movie): play video with ac97 audio in templeos using a proved playback kernel 2026-12-03 22:20:23 +01:00
README.md feat(movie): play video with ac97 audio in templeos using a proved playback kernel 2026-12-03 22:20:23 +01:00
ROOT feat(movie): play video with ac97 audio in templeos using a proved playback kernel 2026-12-03 22:20:23 +01:00

Pixel expressions compile to native x86_64 for TempleOS through an Isabelle/HOL compiler, with proofs of constant folding, register allocation, bounded branching and instruction level execution of the emitted bytes

i like men

Build

It uses Isabelle2026 and Python, plus NumPy and FFmpeg for video:

make check
make payload

Copy .build/payload/* onto C:/ in TempleOS and run:

#include "C:/Remy.HC";
Verify;
Show(0);

Usage

Compile, simulate and evaluate a shader, with both results returning 3:

.build/remy examples/Rings.remy /tmp/rings.bin
.build/remy simulate /tmp/rings.bin 17 23 41
.build/remy eval examples/Rings.remy 17 23 41

Compare against the original stack backend:

make measure

Live

Build a guest image, boot it and reload the shader on every edit:

make guest TEMPLE_ISO=/path/to/TempleOS.ISO
qemu-system-x86_64 -m 512 -smp 2 -cdrom .build/guest.iso \
  -chardev socket,id=live,path=/tmp/remy.sock,server=on,wait=off \
  -serial chardev:live &
python3 cli/watch.py examples/Rings.remy --socket /tmp/remy.sock

Movie

Build and boot a disc from any video with sound:

make movie VIDEO=clip.mp4 TEMPLE_ISO=/path/to/TempleOS.ISO
qemu-system-x86_64 -m 1024 -smp 2 -cdrom .build/movie.iso -boot d \
  -audiodev pa,id=sound -device AC97,audiodev=sound

Play it in TempleOS, using the up and down arrows for volume and Escape to stop:

#include "Movie.HC";
Play;

Its arithmetic is proved and generated into HolyC, while the device code, copy loop and converter are not verified

Silicon

The interpreter is proved sound against the x86 semantics and replayed against the host CPU on random programs:

python3 tests/silicon.py

HolyC

The whole verified compiler also runs inside TempleOS as generated HolyC:

#include "C:/Shade.HC";
Shade("(xor x y)");

Check it against the Poly/ML build:

make holy TEMPLE_ISO=/path/to/TempleOS.ISO