MODEL PROTEIN FOLDING · COMPUTING · INTERACTIVE FOLDER · under KEEPER ERIS

The HP Lattice · Fold It Yourself

Dill’s HP model: residues are H (hydrophobic) or P (polar) on a lattice, and each non-bonded H–H contact scores −1. Fold the classic 20-mer benchmark by hand and let Dave’s I-13 VM count the energy and catch crossings from raw coordinates.

Dave (t249u): "can you build some pages on protein folding, the math and the difficulty, edutaiton please, use this wasm engine"

Dave’s I-13 engine on this page

booting I-13 v0.3…

LIT What the VM computes here: Every time the fold changes, the VM gets a freshly generated I-13 program with the raw x, y, z of every residue. For each pair it computes the squared distance, then counts bonds (=1 for neighbours in sequence), clashes (=0) and H–H contacts. JS does the same count, and the two must agree.

LIT The HP model (Dill 1985; Lau & Dill 1989) is the simplest model that captures the hydrophobic core. The chain is a self-avoiding walk on the square (2D) or cubic (3D) lattice, and E = −(number of H–H neighbours not adjacent in sequence).

LIT Benchmark S1 = HPHPPHHPHPPHPHHPPHPH (20 residues) has optimum E = −9 in 2D. This batch re-proved it by exhaustive branch-and-bound over every fold up to symmetry.

LIT On a bipartite lattice, contacts can only join residues an odd number of positions apart. That is why the contact map shows a checkerboard.

MODEL Keys: R L U D (and F B in 3D) or the arrow keys and PgUp/PgDn. The move string is absolute directions.

Lab MODEL interactive, computed on the I-13 VM

sequence

moves

contact map: yellow = H–H contact (counts −1), white = other lattice neighbours.

Sources (browsed Oct 2026)

  1. Dill (1985) Theory for the folding and stability of globular proteins, Biochemistry 24:1501
  2. Lau & Dill (1989) A lattice statistical mechanics model of the conformational and sequence spaces of proteins, Macromolecules 22:3986
  3. Unger & Moult (1993) Genetic algorithms for protein folding simulations, J Mol Biol 231:75 (benchmark sequences)

MODEL Two agents, as Dave set for every world. The ARTIST folds the 20-residue HP chain S1 HPHPPHHPHPPHPHHPPHPH on the square (2D) lattice with pivot, corner and kink moves. The CRITIC judges each move (Metropolis at temperature T) and scores the best fold as −E/9 (E_ref = -9, proved optimal by exhaustive search here). It also has Dave’s I-13 VM recount every kept fold from raw coordinates. Rendered with Three.js r160 from a pinned CDN, devicePixelRatio capped at 2. Drag to orbit, scroll to zoom.

LIT on load: the seal is recomputed, the page’s facts are re-checked as arithmetic (throws on mismatch), 200 seeded ARTIST rounds must improve, the workspace loop logs 5 entries, and the OBJ and SVG exports must agree. Then the engine boots, its SHA-256 is checked, and the page’s VM results are compared with independent JS.

Gallery of kept folds (WebGL snapshots):

Workspace improvement loop: instructions for agents MODEL

  1. Measure: every 40 rounds, record the acceptance rate, the best score, the best E and the rounds since the last improvement.
  2. Try next: after a 40-round plateau, reheat T ×1.5. If acceptance is under 15%, warm T ×1.25; if over 45%, cool T ×0.7; otherwise anneal T ×0.9.
  3. Log back: append {entry, round, measured, tried, T} to the workspace log (in the JSON export and the list below), and have the I-13 VM recount the best fold.
  4. Repeat, forever: never stop improving. Re-check every claim against the engine and the sources before you make it.

Live workspace log:

    Shared board MODEL ARTIST ↔ CRITIC

      Background art: AMBER MODEL a generative field seeded from this page’s seal.

      proving…

      Seal sha256(name|slug|blurb): 95b792d153581be9aeae8a4f8df27994517e794e6d6c0216cbaa03821e3c0203

      ↑ Protein Folding index · ← ERIS, keeper of Mayhem