Skip to content

Blog· Philosophy

A Design Is Just Text — Why .lens Is the Foundation of AI-Native

The entire state of a lens is a piece of .lens text. The AI can read it and write it, and every change is a visible diff.

The LensBench TeamOct 17, 2026 · 2 min read

In LensBench, the entire state of a lens is a piece of .lens text:

title "Cooke Triplet"
aperture EPD 10
field angle 0, 14, 20
wave F, d*, C

surf OBJ  T=inf
surf 1    R=22.01359    T=3.25896   glass=SCHOTT:N-SK16
surf 2    R=-435.76044  T=6.00755
surf 3    R=-22.21328   T=0.99997   glass=SCHOTT:F2
surf 4    stop  R=20.29192  T=4.75041
surf 5    R=79.6836     T=2.95208   glass=SCHOTT:N-SK16
surf 6    R=-18.39533   T=solve(marginal_height, 0)
surf IMA

var R1..R6

The table (LDE), the text and the commands stay in sync in real time: change a radius in the table and only that one number changes in the text; when the AI changes it with a command, it also touches only that one number, and comments and layout are preserved as they were.

Why this matters for AI ​

  • The AI can read it and write it. With an engineering file in a proprietary format, the AI can only poke at it through an interface; a piece of text it can read into its context in full, and can write out as a patch directly.
  • Changes are naturally reviewable. Every change the AI makes is a diff, just like a code review, so you can see exactly which numbers changed.
  • It fits into git and can be sent to colleagues. Version comparison, rollback and sharing need no special tool.
  • There's a safety net when something is written wrong. When the syntax is wrong, the diagnostic gives an error code, the line and column, and a suggested fix, which the AI can understand and can usually correct on its own.

Speaking Zemax ​

Surface numbers run OBJ=0…IMA, glass is the medium after the surface, lengths are in mm, wavelengths in µm, spot diagrams in µm, and operands use Zemax's names (EFFL, TOTR…). For you this is a familiar convention; for the AI, the large body of Zemax knowledge that large models have learned can be used directly, without learning a new vocabulary. Wherever the convention differs from Zemax's, the conversion is done inside the engine and guarded by regression tests. For the item-by-item comparison see Zemax → LensBench mapping.

Glass is matched exactly only ​

Grades are matched exactly by "manufacturer:grade" and never fuzzily replaced with another glass; when a grade name exists at several manufacturers, you are asked to write it in full. If the AI writes a wrong grade, it gets an error directly instead of quietly being swapped for another material.

For the full syntax see the .lens guide.

Docs ship with the software, same version; the reference sections are generated from code (Chinese only for now)