← All Demos

Loom Sudoku

9x9 Sudoku solved by the 146x512 transformer (8.8 MB model). Same C source, compiled in-browser to 284 ISA instructions.

Loading...
Given
Solved
Trying
Backtrack
Steps: 0 Cells: 0 Backtracks: 0 Status: Ready
Sudoku Solver: C Source

How It Works

The C source is compiled in-browser to 0 ISA instructions using the STORE opcode for indirect writes. Two engines: ISA Interpreter executes instructions directly; ONNX Transformer runs each instruction as a 146x512 neural network forward pass via WebGPU/WASM. Both produce identical results.

The solver uses iterative backtracking: tries values 1-9 at each empty cell, checking row, column, and 3x3 box constraints. Fixed cells are stored as negative values. Config: d_model=146, n=512, 8 layers, 8.8 MB ONNX model.