Changelog
Release notes of the laylight command-line tool.
What changed in each release of the laylight command line, newest first. Every release can be installed from the download site or from PyPI as laylight-cli. From 0.2.2 on, the Laylight Python library is released with it, at the same version, as laylight.
0.3.4 — 2026-12-05
Changed
- Large layouts compile in the browser as fast as on the command line.
compiler.compileof@photonstack/laylight-dsl-webread the source from its start for every placing statement, to give the statement's position in UTF-16: on a chip of 4,158 instances in one cell that was 3 of the 3.4 s of a compile. Each file is now walked once. On the same chip the browser compile takes 0.13 s. - Geometric connections (ports that meet) are found in time linear in the number of joints: every new connection was compared with all the connections of the cell. A chip with 8,316 joints evaluates in 35 ms instead of 80 ms, with
laylight buildand in the browser alike.
0.3.3 — 2026-12-04
Added
- Design rule checks in the browser compiler.
compiler.drc(files, entry, { tops, decks })of@photonstack/laylight-dsl-webcompiles likecompileand runs the program'sdefine drcdecks (all, or the ones named), returning the reportlaylight drc --reportwrites: every violation with its rule, cell, measured value and limit, position, edges or box, and the statements that drew and placed its shapes.
Fixed
- The language server in the browser (the DSL playground, the Tour) no longer stops on a program that has a
define drcdeck: the checks read a clock, which WebAssembly in the browser does not have. Their timings read 0 there.
0.3.2 — 2026-12-04
Added
- Design intent recovered from GDS.
laylight recover <file>reads a layout's polygons the way the design rule checker sees them and recovers what the compiler would have known: it fits the discretized curves of every ring (circles, or local circles along Euler bends and S-bends) and gives each side of a fitted edge its measured distance from the curve as a tolerance (a chord lies on the side of its arc's center and strays the other way by rounding alone, so curves drawn as coarsely as gdsfactory's default 2.5° steps are checked as drawn), while straight edges keep none, except straights drawn as polylines of rounded points (gdsfactory's 100-point straights) and the ends of bends whose curvature fades out within rounding (level edges and one-DBU rises at the ends of gdsfactory's Euler bends), whose oblique edges are measured against the fitted line; it recognizes disks, rings, racetracks, waveguide bands and rounded rectangles, and so their exact widths and the radii of their centerlines. Touching shapes are merged first, so a route written as straights and bends is recognized as one band. GDS paths are fitted on their centerline. It prints statistics and writes the recovered IR (-o), a JSON report of every recovered shape and unfitted curve (--report) and the layout with what it found on marker layers 1100–1111 (--markers). Seedocs/laylight-dsl/recover.md. - Old GDS as editable code.
laylight decompile chip.gds --recoverwrites the disks, rings, single-arc bends and axis-aligned rounded rectangles that recovery recognizes ascircle,ring,arc(placed at its start with its heading) andrectwithcorner_radius, with round parameters on the design grid, instead of polygons. Each statement is compiled and kept only if its outline stays within 2 DBU of the polygon; everything else is written as before. Shapes drawn coarser than Laylight's default (a 64-point circle) getsegments, and a ring cut into two halves becomes onering. It reports how many of the recognized shapes were written as primitives. - Port counts that follow the parameters. A marker's
atalso takes lists of points, and themarkersection sees the variables defined directly in the cell body, with the values they have once the body has run. A loop can collect the ends ofnwaveguides in a list for oneoutputmarker, as N×M MMIs, arrays and splitter trees need. A marker whose list is empty has no location and is not written to IR or GDS. The language server completes, finds and renames these variables in markers. See Exporting ports.
Changed
laylight drc chip.gds --rules tech.lyl(and.lyirinput) recovers curves, widths and radii first, so a ring at the minimum width or a bend at the minimum radius is not reported for its discretization, and radius rules apply to GDS input. On the DRC benchmark's twelve cases written as GDS this reports what the source does, where checking the bare polygons gave up to 157339 false positives and missed every radius violation.--recover offchecks the polygons as they are,--oblique-tol 1gives the other straight edges at angles other than multiples of 45° a 1 DBU tolerance,--curve-tol Nraises the limit on the two tolerances of a curve's edge from 2 DBU each (4 together) to N each (2N together; for coarser curves, at the cost of missing shallower violations on them), and--recover-reportwrites the recovery report.laylight fmtindents a line that continues an unfinished statement (after a trailing comma or a binary operator, or before a clause such aswithorat) one level deeper, as ruff and black do, and indents the contents of a bracket relative to the line it opens on. Files formatted by earlier releases can change when formatted again.- Design rule checks on GDS check the top cells and what they place, not every cell of the library (every cell when the library names no top cell). GDS written by gdsfactory carries a
$$$CONTEXT_INFO$$$cell that places every library cell, which--topstill checked: the gdsfactory PDK sheet now takes 1.9 s and 113 MB instead of more than 10 minutes and 12 GB. - Layers that share a GDS layer and datatype are one layer to the design rule checks, as they are in the GDS.
Fixed
- Design rule checks find violations between curves 2 DBU shallower than before. An edge's tolerance now has two sides: a chord lies on the side of its arc's center and strays the other way by rounding alone, so the outer edge of a ring gets 2 DBU inward and 1 DBU outward, and a pair is measured with the tolerance of the side that faces the other edge. Two rings 198 nm apart under a 200 nm space rule were not reported at all; the coupling gap of
coupler_pulley(196.3 nm) on the generic PDK sheet is now found. - Design rule checks no longer hide violations between edges that face each other just past the
angle_limit. Before deciding whether two edges face each other, the checker allows for how far each may turn from the drawn shape. For short edges it allowed up to 30°, because it derived the turn from the edge's tolerance. The compiler now records the actual turn: half the angular step for a chord of a curve, the rounding for an edge of a computed polygon. A piece cut off an edge where shapes merge now turns like the whole edge. On the generic PDK sheet this finds three missed violations: at the inner end ofspiral_archimedes, on the inner slab edge ofring_single_pn, and in the notch between the S-bends ofsplitter_tree. The edge that rounding leaves at the end of a hairline slit, where two abutting shapes meet, no longer forms an acute corner. - A port-to-port placement moved by
offset(or turned sideways byrotate) no longer records a connection between two ports that do not meet;laylight netlistandlaylight lvssaw aconnectthat was not there. - Geometric connections need ports of the same
type: an optical port and an electrical port at the same position (a heater's waveguide end and its electrode) are no longer connected and reported as mismatched. - A parameter's default sees the parameters before it and global names only, so an instance named
stripno longer hides the cross-sectionstripincell C(xs = strip). - The literal
0stored where a size or angle is expected (l.append(0)into a[size]list, a typeddefine, an assignment, a parameter) is a zero of that dimension, sol[0] / l[1]is a number instead of failing at evaluation. - Point literals accept a trailing comma, like lists:
(1um, 0,). - The hierarchical design rule check reports what a flat check of the same layout reports. A violation found in a cell is checked again where the cell is placed, so a stub that abuts a child, a child's corner under the parent's pad and a gap that a sibling fills are no longer reported; a violation that holds at some placements only is reported at those. Width and space pairs and exact widths are re-checked this way; area, corner, notch and isolation rules not yet. Pairs between merged edges that the hierarchical check lost on gdsfactory GDS are found again.
- Concentric arcs drawn at exactly the minimum width are no longer reported at their end caps (24 such arcs gave 152 width violations).
- Tips sharper than the angle limit, such as the 45° ends of a wire corner and the tip of a taper, are reported. Shapes whose vertices are rounded to the grid when written (straights at angles other than multiples of 90°, polygons with computed vertices) get a rounding tolerance, so a 200 nm gap between two of them no longer measures 199.74 nm.
- A clockwise polygon is no longer read as a hole: a clockwise box outside its covering layer passed
inside, and a clockwise bar on a derived layer passedwidth. A hole that touches another polygon at a vertex belongs to the right polygon. A polygon that touches itself (a keyhole, gdsfactory's rectangular spiral) is merged before it is checked. laylight drcno longer stops with an index out of bounds on some rules between two layers.laylight lymand the viewer's Marker Explorer report a truncated or corrupt.lymfile as an error instead of crashing or allocating what the file claims.
0.3.1 — 2026-10-15
Added
- GDS cell imports.
import "library.gds"exposes cells with valid DSL names;import "library.gds" cell "MMI$1" as MMIselects any cell, including a nested cell, with a local alias. Used cells keep their hierarchy, layers, arrays and Laylight metadata, with coordinates converted to the design's DBU. The language server completes GDS paths and cell names, navigates to imports and renames aliases. The browser compiler and language client accept binary GDS files asUint8Array, and the editor accepts them throughbinaryFiles. Unsupported geometry and instance transforms produce import errors; ordinary text labels are omitted with a warning. See Importing GDS Cells. - Design rule checks.
define drc <name> { ... }writes a process's rules in Laylight:width,space(one layer, or between two),enclosure a in b,overlap,areaandradius, with limits that are ordinary expressions,severity/metric/messageproperties and optional names.laylight checkruns every deck after evaluation,laylight drcruns them alone (--deckto select,--report out.jsonfor every violation with coordinates, both edges, sources and timing), and the language server reports violations while you type. Each violation points at theshape ... as namestatement that drew the shape and, between instances, at theplacestatements. Cells are checked once however many times they are placed; the interactions between instances are checked only where they come within a rule's limit, and identical pairs of array members once. The checks know the shapes' primitives: an isolated ring at the minimum width passes by its parameter, the radius rule reads the tightest radius of a bend from the curve, and the edges of discretized curves carry a 1 DBU tolerance, so no violation comes from discretization alone.inside a in breports every part ofaoutsideb, through the hierarchy. Decks can define derived layers (define clad = slab - si, grow / shrink,.holes/.hulls/.extents, selections such as.not_inside(b)and filters such as.with_area(min, max)) and report them withempty;notch,isolated,length,angle,corner,gridanddensityrules,area <=, thesquaremetric,min_projection/max_projectionandangle_limitcover the rest of KLayout's common checks (seedocs/laylight-dsl/drc-gaps.mdfor what is left).laylight drcwrites marker files (--lym out.lym, a compact indexed binary of every violation, read back bylaylight lym), the layout with a marker layer per rule (--markers), checks GDS or IR files against the decks of a source file (--rules), and checks cells on all cores. On straight-line layouts the edge-pair results match KLayout's exactly;bench/drc/scores Laylight, KLayout, gdsfactory and gdstk on speed, scaling, missed violations and false positives against planted violations. - Blackboxes that survive other tools. A blackbox's record now also names the cell it was published as, its database unit, the signature scheme, what published it, and digests of each part of the interface and of each layer of the whitebox (record format 2; blackboxes published by 0.2.2 to 0.3.0 still read and verify). In GDS the record is kept in several places: the cell metadata, a record text on the
blackboxlayer whose string is the record (it survives tools that drop GDS properties), the outline code (the content signature drawn as squares in the arrow's shaft, which survives tools that drop texts), the pins, and properties on every reference to the blackbox. So a blackbox can still be unboxed after KLayout renames it to resolve a name clash, after its properties or texts are dropped, or after its marker layer is filtered out.unboxthen checks it against the blackbox its whitebox makes and warns. See Blackboxes. - Checks that say what differs. Verifying a blackbox (at
import, inunboxand with the newlaylight blackbox --verify <file>) names the parameter, attribute, marker, footprint or database unit that is not as published, shows outline and pin differences and where they are (comparing regions, so polygons that another tool re-cuts or reorders still match), and notes renames. Reading GDS reports blackboxes that were flattened into another cell, merged with or replaced by a cell of the same name, and copies of a record that disagree. A whitebox that does not match says on which layers its geometry differs. laylight unboxbuilds parametrized whiteboxes from source: each blackbox's source cell is built with the parameters the blackbox records, so the blackbox ofArmwithlength = 50um(Arm$…) is found incell Arm(length = 20um).
Changed
laylight blackboxrefuses to publish a blackbox whose metadata would not survive GDS and IR exactly, and then writes no files. The checks cover values longer than GDS's 126 bytes, text that is not printable ASCII, values that do not read back the same (such as areas), and too many properties for one GDS element. Before writing, it also reads the blackboxes back from GDS and IR in memory. The GDS writer likewise refuses to drop any of a blackbox's metadata, where other cells only get a warning.laylight unboxfails when a blackbox is left without a whitebox.--partialkeeps such blackboxes with a warning, for designs unboxed in steps. It also fails when a cell that is not a blackbox has shapes on theblackboxlayer (a flattened blackbox). Blackbox outlines now carry the outline code, so newly published blackboxes look speckled inside the arrow's shaft.
0.3.0 — 2026-10-10
Added
- Anonymous usage statistics. After each command (when
laylight lspstarts),laylightsends one small event totelemetry.photonstack.io: the command, the names of the options given, the kinds and sizes of its files, the run time and outcome, the version and the system. File names, contents, option values and identifiers are never sent, and the server keeps no IP address. The first run prints a notice and sends nothing, CI runs send nothing, andlaylight telemetry disable,LAYLIGHT_TELEMETRY=0orDO_NOT_TRACK=1turn it off.LAYLIGHT_TELEMETRY_DEBUG=1prints the event instead of sending it. See Telemetry. laylight lspruns the language server on stdin and stdout, so every editor with LSP support gets diagnostics (evaluation errors included), completion, hover with evaluated values, go to definition, references, rename, formatting, an outline and semantic highlighting; see Editor support. It replaces the separatelaylight-lspexecutable.- Completion by context. In
withclauses and calls the parameters of the primitive, cell or cross-section that are not given yet; the values of string parameters (profile = "…",ends,join, a marker'skindanddirection); import paths; units after a number; the clauses that can continue aplace,shapeorclonestatement; statement keywords at the start of a line; nothing in comments or where a new name is written. - The language server runs in the browser. Compiled to WebAssembly, it completes code as you type (or on Ctrl+Space) in the DSL playground and the Tour.
laylight netlistandlaylight lvsalso read Laylight IR (.lyir) and GDSII, such as the IR the Python library writes:laylight lvs chip.lyir --netlist ref.json. Connections between coincident ports are found again on reading, since GDSII keeps no connections and IR from elsewhere may record only the declared ones.
0.2.2 — 2026-10-08
Added
- The Python library is released with the command line.
pip install laylight==0.2.2installs the library and thelaylight-cliof the same version. Its devices andPlacernow build Laylight IR in Python: one cell per parameter set, named as the DSL names cells, ports asinput/outputmarkers and port-to-port placements as connections.layout.write("out.gds")compiles the IR withlaylight build, andlaylight.read()reads GDSII or IR back. KLayout is no longer needed; it stays optional (laylight[klayout]) for PNG previews and PCells. - Dummy fill.
--dummy <layer>[:<options>]onlaylight build,irandunboxfills the free space of a layer with square tiles as the layout is written, without changing the language or the IR. Tiles lie on a grid anchored at the top cell's origin, keepkeepoutaway from the layer's geometry, fromexcludelayers and from blackbox footprints, and stay inside the top cell's bounding box or the shapes of anarealayer, less amargin. Options set the tilesizeandspace, adatatypefor the tiles andstaggered rows. The tiles are written as arrays of one tile cell, so a million tiles take a few thousand array references. laylight buildandlaylight iralso read Laylight IR (.lyir) and GDSII, so an existing layout can be filled:laylight build chip.gds -o filled.gds --dummy si.
0.2.1 — 2026-10-07
Added
- Blackboxes.
laylight blackboxpublishes cells as blackboxes: the outline and ports of a cell without its geometry, as Laylight IR (-o cells.lyir) and GDSII (--gds). The outline is drawn on theblackboxlayer (254/0 unless the layer table names one) with an up arrow etched out of it, footed to the left so that rotated and mirrored placements show; every port gets a pin on the marker layer as wide as the port. Parameters, attributes and markers are kept. laylight unboxputs the real cells (whiteboxes) back in place of the blackboxes of a design. The design and the whiteboxes can be Laylight source, IR or GDSII, so a design received as GDS can be completed. Whiteboxes that contain blackboxes are unboxed in turn.- Signatures. Every blackbox records SHA-256 signatures of its whitebox's content and of its interface (name, parameters, attributes, markers, footprint). They are the same whether a cell comes from source, IR or GDS.
unboxtakes the whitebox whose content matches, reports whiteboxes that do not, and with--allow-revisionaccepts one whose geometry changed but whose interface did not. A blackbox edited after it was published is reported. - IR imports.
import "cells.lyir"reads Laylight IR, the output oflaylight irorlaylight blackbox, and its top cells can be placed like cells defined in source, so other projects can reuse cells without their source. The language server completes their markers and goes to their definitions.
0.2.0 — 2026-10-06
Added
- Cross-sections (
define xsection): the layers across a waveguide, drawn along the centerline ofpath,straight,arc,euler,sbend,bezier,ring,racetrackandtaper. Tapers pair the sections of two cross-sections by layer,min_radiusis checked on the exact curve, ports placed on waveguide ends carry their cross-section, and LVS reports connected ports whose cross-sections differ. - The
straightprimitive. - Statements in cell bodies.
define,for,if,placeandlayerblocks can be written directly in a cell, andlayerblocks insideforandif. - PyPI. The command line is published as the
laylight-clipackage:pip install laylight-cli,uv tool install laylight-cliorpipx install laylight-cli.
0.1.0 — 2026-10-06
The first release of the laylight command line, for Linux (x86-64 and ARM64, glibc 2.17 or later), macOS on Apple silicon and Windows (x86-64), with install scripts for each.
check,ir,build,decompile,netlist,lvs,fmtandparse: check, evaluate and compile Laylight files to GDSII, write and compare netlists, turn GDSII back into Laylight source, and format.- Boolean and morphological operations that run on all cores for large inputs.