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.compile of @photonstack/laylight-dsl-web read 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 build and 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-web compiles like compile and runs the program's define drc decks (all, or the ones named), returning the report laylight drc --report writes: 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 drc deck: 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). See docs/laylight-dsl/recover.md.
  • Old GDS as editable code. laylight decompile chip.gds --recover writes the disks, rings, single-arc bends and axis-aligned rounded rectangles that recovery recognizes as circle, ring, arc (placed at its start with its heading) and rect with corner_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) get segments, and a ring cut into two halves becomes one ring. It reports how many of the recognized shapes were written as primitives.
  • Port counts that follow the parameters. A marker's at also takes lists of points, and the marker section 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 of n waveguides in a list for one output marker, 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 .lyir input) 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 off checks the polygons as they are, --oblique-tol 1 gives the other straight edges at angles other than multiples of 45° a 1 DBU tolerance, --curve-tol N raises 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-report writes the recovery report.
  • laylight fmt indents a line that continues an unfinished statement (after a trailing comma or a binary operator, or before a clause such as with or at) 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 --top still 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 of spiral_archimedes, on the inner slab edge of ring_single_pn, and in the notch between the S-bends of splitter_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 by rotate) no longer records a connection between two ports that do not meet; laylight netlist and laylight lvs saw a connect that 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 strip no longer hides the cross-section strip in cell C(xs = strip).
  • The literal 0 stored where a size or angle is expected (l.append(0) into a [size] list, a typed define, an assignment, a parameter) is a zero of that dimension, so l[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 passed width. 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 drc no longer stops with an index out of bounds on some rules between two layers.
  • laylight lym and the viewer's Marker Explorer report a truncated or corrupt .lym file 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 MMI selects 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 as Uint8Array, and the editor accepts them through binaryFiles. 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, area and radius, with limits that are ordinary expressions, severity / metric / message properties and optional names. laylight check runs every deck after evaluation, laylight drc runs them alone (--deck to select, --report out.json for every violation with coordinates, both edges, sources and timing), and the language server reports violations while you type. Each violation points at the shape ... as name statement that drew the shape and, between instances, at the place statements. 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 b reports every part of a outside b, 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 with empty; notch, isolated, length, angle, corner, grid and density rules, area <=, the square metric, min_projection / max_projection and angle_limit cover the rest of KLayout's common checks (see docs/laylight-dsl/drc-gaps.md for what is left). laylight drc writes marker files (--lym out.lym, a compact indexed binary of every violation, read back by laylight 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 blackbox layer 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. unbox then checks it against the blackbox its whitebox makes and warns. See Blackboxes.
  • Checks that say what differs. Verifying a blackbox (at import, in unbox and with the new laylight 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 unbox builds parametrized whiteboxes from source: each blackbox's source cell is built with the parameters the blackbox records, so the blackbox of Arm with length = 50um (Arm$…) is found in cell Arm(length = 20um).

Changed

  • laylight blackbox refuses 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 unbox fails when a blackbox is left without a whitebox. --partial keeps such blackboxes with a warning, for designs unboxed in steps. It also fails when a cell that is not a blackbox has shapes on the blackbox layer (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 lsp starts), laylight sends one small event to telemetry.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, and laylight telemetry disable, LAYLIGHT_TELEMETRY=0 or DO_NOT_TRACK=1 turn it off. LAYLIGHT_TELEMETRY_DEBUG=1 prints the event instead of sending it. See Telemetry.
  • laylight lsp runs 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 separate laylight-lsp executable.
  • Completion by context. In with clauses 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's kind and direction); import paths; units after a number; the clauses that can continue a place, shape or clone statement; 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 netlist and laylight lvs also 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.2 installs the library and the laylight-cli of the same version. Its devices and Placer now build Laylight IR in Python: one cell per parameter set, named as the DSL names cells, ports as input / output markers and port-to-port placements as connections. layout.write("out.gds") compiles the IR with laylight build, and laylight.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>] on laylight build, ir and unbox fills 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, keep keepout away from the layer's geometry, from exclude layers and from blackbox footprints, and stay inside the top cell's bounding box or the shapes of an area layer, less a margin. Options set the tile size and space, a datatype for the tiles and staggered rows. The tiles are written as arrays of one tile cell, so a million tiles take a few thousand array references.
  • laylight build and laylight ir also 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 blackbox publishes 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 the blackbox layer (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 unbox puts 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. unbox takes the whitebox whose content matches, reports whiteboxes that do not, and with --allow-revision accepts 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 of laylight ir or laylight 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 of path, straight, arc, euler, sbend, bezier, ring, racetrack and taper. Tapers pair the sections of two cross-sections by layer, min_radius is checked on the exact curve, ports placed on waveguide ends carry their cross-section, and LVS reports connected ports whose cross-sections differ.
  • The straight primitive.
  • Statements in cell bodies. define, for, if, place and layer blocks can be written directly in a cell, and layer blocks inside for and if.
  • PyPI. The command line is published as the laylight-cli package: pip install laylight-cli, uv tool install laylight-cli or pipx 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, fmt and parse: 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.

On this page