This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Explore a run

Recorded runs of Viv programs

Each card plays a short walk through a program's run; its arrows move a stop at a time. Explore the run opens the program's own page: your browser runs it once, recording every step, and then you move through the run forward and back by line, by step, by pass of a loop or by call, without running it again. At each point you see where you are in the program's graph, what that part is for, the code that ran, and the values it set.

Look inside a program

  • Atlas

    The program’s map: every function and which calls which.

  • Explore

    Run it and step through what each part did, with the code, values and plots beside it.

Levenberg-Marquardt on Rosenbrock's function

MINPACK's lmder, ported to Viv, walks Rosenbrock's curved valley from (-1.2, 1) to (1, 1) in 16 iterations. Each iteration factors the Jacobian, lmpar finds the step that fits the trust region, and the step is kept or rejected by how well the linear model predicted it; the first trial step is rejected.

lib/minpack/story_rosenbrock.viv · 40 defs in 8 files · 51 named steps in its code

Explore the run →The whole walk →

Run records the program in your browser, then the walk follows the recording call by call.

Electron mobility fitted to NIST's certified digits

The NIST Thurber problem: a seven-parameter rational model fitted to 37 electron-mobility measurements by lmder, checked against NIST's certified values.

posts/2026-09-25-fitting-electron-mobility-with-minpack.viv · 26 defs in 6 files · 41 named steps in its code

Explore the run →The whole walk →

Run records the program in your browser, then the walk follows the recording call by call.

Water, restricted Hartree-Fock

The Hartree-Fock energy of water in the 6-31G basis, from the core-Hamiltonian guess, using lib/hf. The self-consistent field loop builds J and K, forms the Fock matrix, extrapolates it with DIIS and solves for new orbitals until the density stops changing.

scf/story_water.viv · 413 defs in 30 files · 28 named steps in its code

Explore the run →The whole walk →

Run records the program in your browser, then the walk follows the recording call by call.

Water against PySCF, restricted Hartree-Fock

The PySCF port test (study/ports/pyscf) at its parity size: water in 6-31G through lib/hf's rhf path, from the core-Hamiltonian guess with DIIS from the second iteration, as PySCF 2.5.0 runs it. The run ends in two checks that are steps of the program: the energy against PySCF's -75.98394849810563 within 1e-10, and the orbital energies within 1e-8.

study/ports/pyscf/viv/water_631g.viv · 418 defs in 31 files · 30 named steps in its code

Explore the run →The whole walk →

Run records the program in your browser, then the walk follows the recording call by call.

Oxygen-16, Skyrme Hartree-Fock

The ground state of oxygen-16 from the SLy5 Skyrme functional on a radial mesh, using lib/skyrme. Each pass computes the fields from the densities, solves each (l, j) block for its lowest orbital by inverse iteration, builds new densities and mixes half of them in, until the energy changes by less than 1e-9 MeV. The post solves on two meshes and extrapolates; this runs its 0.1 fm mesh only.

lib/skyrme/story_o16.viv · 15 defs in 2 files · 14 named steps in its code

Explore the run →The whole walk →

Run records the program in your browser, then the walk follows the recording call by call.

Water, Casida excitation energies

The singlet and triplet excitation energies of water in 6-31G, at the post's size, using lib/hf and lib/hf/casida. From the RHF ground state it moves the integrals to the orbital basis, builds the Casida matrices A and B, and solves the Tamm-Dancoff problem (A alone) and time-dependent Hartree-Fock (A and B, folded into a symmetric problem).

scf/story_casida.viv · 447 defs in 32 files · 39 named steps in its code

Explore the run →The whole walk →

Run records the program in your browser, then the walk follows the recording call by call.

Silicon, plane-wave DFT

Silicon in the dense plane-wave engine (dft/pwdft.viv) at a 5 Ha cutoff on four k-points: the bases, the self-consistent loop from a uniform density, and the bands along L, Gamma, X.

dft/explore_si.viv · 19 defs in 5 files · 13 named steps in its code

Explore the run →The whole walk →

Run records the program in your browser, then the walk follows the recording call by call.

A small GPT trained on one repeated line

A GPT with two blocks of two attention heads, 6,560 parameters, trained in your browser on the line "hello world!" repeated: token and position embeddings, RMSNorm, causal self-attention and a ReLU-squared MLP in each block, cross-entropy, the gradient from value_and_grad (the explorer shows its forward pass as the defs it was written in), and 30 steps of Muon for the block matrices and Adam for the rest. The loss falls from log 9 to 0.20, and from the prompt "hello" the model writes the line on.

lib/gpt/story_gpt.viv · 132 defs in 10 files · 27 named steps in its code

Explore the run →The whole walk →

Run records the program in your browser, then the walk follows the recording call by call.

Each program can also be watched as it runs. The walk puts the whole program on one map, modules as regions and defs as boxes, and moves a camera along the recording: to the def each call enters, the step and line running there, and back to the caller on return.

Steps and loops

The compiler reads the program as a graph: its defs, the steps inside them, and the loops that hold steps. For each step it works out the interface: the values the step reads that were set before it, and the values it sets that are read after it. viv graph prints that graph.

A loop is one position until you open it; then you see its first pass line by line and only the passes where something changed. A loop without steps, such as a matrix fill inside a step, is always one line, and the recording keeps one event for it however many times it went round.