Efficient DRC
Why design rule checks struggle with curved layouts, and how Laylight checks them on the semantic geometry inside the compiler, pointing at the line of code, in a fraction of KLayout's time.
Design rule checking (DRC) verifies that a layout can be manufactured: features are wide enough, far enough apart, enclosed by the right margin, bent no tighter than the process allows. On Manhattan layouts this is routine. Photonic circuits are different: rings, bends, Euler curves, S-bends, tapers and grating arcs are everywhere, and that is where traditional DRC breaks down. Laylight runs its checks inside the compiler, on the geometry as it was written rather than as it was flattened, and that changes three things: what the checker knows, where it reports, and how fast it is.
Curves have no meaning in GDS
GDSII (and OASIS) store polygons and paths, nothing else. Every arc, bend or spline is written as a polygon whose vertices are snapped to the database grid. With a 1 nm grid and a chord error of at most 1 nm, a single ring of radius 10 µm already has about 450 vertices, and a photonic chip with thousands of rings, bends and routed waveguides carries millions of edges that are only a few tens of nanometers long. The DRC engine never sees an arc of radius 10 µm and width 500 nm; it sees those edges and has to rediscover the geometry from them.
This causes three kinds of trouble:
- False errors. A chord lies inside its arc, so along a bend the measured width and gap oscillate around the drawn value by up to the chord error. A waveguide drawn exactly at the minimum width, or a coupling gap drawn exactly at the minimum spacing, is reported as a violation at some vertices and not at others. Snapping vertices to the grid adds one-unit jogs and edges a hair off their angle, which come back as notches, acute angles or off-grid edges.
- Missed errors. The same oscillation works the other way: a gap that is slightly too small can measure as legal between two vertices. And a rule about the curve itself, such as a minimum bend radius, cannot be checked on short straight edges at all without reconstructing the curve.
- Slow runs. Width and spacing checks compare pairs of edges. Millions of tiny edges make curved layouts the slowest part of verification, and much of the result is noise.
In practice designers waive curved-geometry errors by the hundred, or relax the whole deck until they disappear: every limit lowered by a database unit or two, edge pairs skipped when they barely project onto each other. Every waiver is a place where a real violation can hide, and so is every relaxation, because a GDS file does not say which edges were curves: a tolerance that absorbs the chord error of a ring also absorbs a straight waveguide that is a nanometre too narrow. The benchmark below measures both. On rings, couplers, bends and rounded corners, between 39% and 99% of a raw polygon checker's reports are false positives. The relaxations remove them, each on some of these cases, and the strongest, a limit 2 DBU lower together with the projection filter, on all four. But where straight shapes come within 2 nm of a limit on the same layer as curves drawn at it, that setting misses 57% of the violations, and none of the settings reports every violation without false ones. A published refinement relaxes only the edge pairs that look like a discretized curve, those with a short edge or nearly parallel edges; it gets that case right, but misses every violation of straight features whose edges are short or converge, such as grating teeth and taper tips. Laylight reports exactly the planted violations in every case.
Checks on semantic geometry
A rule deck is part of the program (see Design Rules):
define drc soi {
width si >= 400nm
space si >= 200nm
space si, metal >= 1um # exclusion between layers
enclosure si in slab >= 300nm # the margin of an inclusion
inside si in slab # the inclusion itself: no si outside slab
area si >= 200nm * 200nm
radius si >= 5um # the bend radius of every curved primitive
}In Laylight, curved geometry is not a list of points: it is a primitive with parameters. An arc knows its radius, width and angle; a ring its centerline radius and width; an euler bend its curvature law; an sbend its profile. The compiler discretizes them only when it writes the layout, with a chord error it controls (at most one database unit by default), so it always knows both the intended geometry and how far each polygon edge may deviate from it. When it draws a ring with 10um, 500nm, it keeps what the polygon loses: the width is 500 nm, the radius of curvature is 10 µm, and every edge of the polygon lies within 2 nm of the circle it approximates (1 nm of chord error, and up to 0.7 nm more where a vertex is rounded to the grid). The checker uses all three:
- An isolated shape passes or fails a
widthrule by its exact width. No vertex of a ring drawn at the minimum width measures a hair too narrow, because no vertex is measured. - The
radiusrule compares the tightest radius of an Euler bend, S-bend, Bézier or arc, computed on the curve. A polygon-based checker cannot express this rule at all. - Where edges do have to be compared, the edges of a shape with discretized curves carry a tolerance of 2 DBU, those of a shape that only rounding moves (a straight turned by an odd angle, a polygon with computed vertices) 1 DBU, and an edge pair is measured against the limit less the tolerances of its two edges. The gap between a ring and its bus drawn exactly at the minimum spacing is not an error, and a gap 50 nm too small still is. A short chord also leans off its curve, so edges with a tolerance have to face each other a little more squarely before they count as facing: the end of an arc that meets its square cap is not an acute corner.
The edges of straight shapes carry no tolerance: there the checks are the classic edge-pair checks and give exactly KLayout's results, pair for pair, including a straight waveguide a single nanometre too narrow on the same layer as a ring at the limit. A polygon checker cannot make that distinction, because the file does not say which edges were curves; it has to relax every edge of the layer or none (measured below). The tolerance cuts both ways: a curved shape within 2 DBU of a limit (4 DBU between two curves) passes, a deviation that the written polygons cannot resolve anyway. The hierarchy is kept too: every cell is checked once, however many times it is placed, and two instances are only compared where they come within a rule's limit of each other. A violation found inside a cell is looked at again where the cell is placed only if other geometry comes near it (a stub abutting a pad of the parent, a gap a neighbour fills), so the report is the same as a check of the flattened layout.
The compiler applies such checks to every curve it generates even without a deck. An Euler bend whose tightest radius would fold its inner edge over is rejected with the exact radius, computed on the continuous curve:
error: invalid euler: the tightest radius of this Euler bend is 706.09nm, which must exceed half the width 1.5um
--> bend.lyl:7:9
|
7 | shape euler with 1um, 3um, 90deg as e
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^The same holds for S-bends and Bézier curves (curvature checked along the whole curve), arcs, rings and racetracks (width against radius), paths with rounded corners (the bend radius has to fit between the points) and the min_radius of a cross-section. Connectivity is checked on the same model: laylight check reports dangling ports and connected ports whose type or width disagree, and laylight lvs compares a cell with a reference netlist.
Errors at the line of code
A violation is a compiler diagnostic. It names the rule, the measured value and the position, and points at the statement that drew the shape; between instances it also points at the place statements:
error: drc soi.space_si: space 150nm < 200nm on si at (0.072um, 0.325um) in Resonator
--> resonator.lyl:9:45
|
9 | shape ring with 10um, 500nm as ring at (0, 10.65um)
| ^^^^
note: the other shape, `bus` is drawn here
--> resonator.lyl:8:40
|
8 | shape rect with 30um, 500nm as bus at (0, 0)
| ^^^laylight check runs the decks with everything else, laylight drc runs them alone and writes a JSON report, and the language server shows the violations in the editor as you type. There is no round trip through GDS, a separate rule deck and marker files that have to be mapped back to the code by hand.
Writing the deck
The same seven rules, written for each tool (bench/drc/decks), counted as the syntax benchmark counts: lines that hold code and tokens, without comments, blank lines and lines that only close a bracket.
define drc soi {
width si >= 400nm
space si >= 200nm
space si, metal >= 1um
enclosure si in slab >= 300nm
inside si in slab
area si >= 200nm * 200nm
radius si >= 5um
}# KLayout DRC script (.lydrc)
source($input)
report("SOI rules", $report)
si = input(1, 0)
slab = input(2, 0)
metal = input(10, 0)
si.width(0.4.um, euclidian).output("width", "si width < 400nm")
si.space(0.2.um, euclidian).output("space", "si space < 200nm")
si.separation(metal, 1.0.um, euclidian).output("space si metal", "si to metal < 1um")
slab.enclosing(si, 0.3.um, projection).output("enclosure", "slab encloses si by < 300nm")
(si - slab).output("inside", "si outside slab")
si.with_area(nil, 0.04).output("area", "si area < 0.04um^2")| Deck | Rules | Lines | Tokens | |
|---|---|---|---|---|
| Laylight (deck only) | 7 of 7 | 8 | 39 | the design's layer table is not repeated |
| Laylight (with its layer table) | 7 of 7 | 12 | 64 | |
| KLayout DRC script | 6 of 7 | 11 | 125 | no bend-radius rule |
| gdsfactory (Python) | 6 of 7 | 22 | 317 | no bend-radius rule |
| gdstk (Python) | 6 of 7 | 26 | 314 | no bend-radius rule; rules as morphology |
A Laylight rule is a line: the kind, the layers, the limit. Nothing names the input, the output or the report, because the deck is part of the program and its violations are the compiler's diagnostics; nothing restates the layers, because the deck sees the design's layer table; and nothing chooses a metric per rule, because the defaults are the common ones. The KLayout script is the most compact of the others and still carries three times the tokens for one rule fewer: every rule names its output category and message, the layers are declared again by GDS number, and the metric is spelled out. The gdsfactory script drives the same engine from Python, with report-database plumbing around every check; the gdstk script has to express each rule as the morphology that isolates its violations, where a width check becomes an erosion, a dilation and a difference. None of the three can write the bend-radius rule: a polygon file no longer knows which of its edges were a curve.
Measured against KLayout, gdsfactory and gdstk
The benchmark in bench/drc plants violations into generated layouts, so that every tool can be scored on more than its speed:
- Speed: the time of the checks (Laylight: after compilation, as the report measures it; the others: after reading the GDS, including building their regions), and the throughput in vertices of the checked layers per second.
- Scaling: each case runs at five sizes; the slope of the time over the size on logarithmic axes is the exponent of the algorithm. Linear scaling is
n^1.00. - Missed violations: planted violations that a tool does not report, as a fraction of all planted ones. The goal is zero.
- False positives: reports that lie outside every planted violation, as a fraction of all reports. The lower the better; a tool that reports a correct layout as broken scores badly here.
The opponents: KLayout 0.30's Region checks on the GDS, in flat mode and in deep (hierarchical) mode; gdsfactory 9.51, which has no checker of its own and exposes KLayout's through Component.get_region; and gdstk 1.0, which has no checker either, with the rules written as the morphological operations a geometry library offers (a width check is A − open(A, d/2), a spacing check close(A, d/2) − A, an enclosure A − erode(B, d)). gdstk and KLayout cannot express the radius rule. All tools run single-threaded; times are from one run per size on an Apple M3 Max that was not idle.
Every edge-pair check measures only edges that face each other at more than 100°, an angle limit of 80° (with angle_limit = 80deg in the Laylight deck, ignore_angle = 80 in KLayout's checks). At the default of 90°, the 83–85° corners at the wide end of a taper and the right angle where an arc meets a straight edge count as width violations of zero, on exact geometry as much as on polygons, which says nothing about curves. Corners sharper than 80° are still reported. gdstk's morphology has no notion of an angle.
Curved layouts are rarely checked against the raw limits, so KLayout's deep mode also runs with the usual workarounds for discretized curves, applied to every rule: the limit lowered by 1 or 2 database units (width(0.5.um - 1.dbu) in a DRC script), which tolerates vertex rounding and chord error; a projection filter that only measures edges projecting onto each other by at least ten database units or a tenth of the limit, whichever is larger (the checks' min_projection; the rule of thumb is Tanner's, from "Addressing MEMS Challenges", 2017), which skips the short chords of curves; and both together. The closest published method is Ruping Cao's selective tolerance (PhD thesis, École Centrale de Lyon, 2016, written for Calibre), implemented here as filters on KLayout's edge pairs: a pair with an edge shorter than 1 µm or with edges within 5° of parallel is taken for a discretized curve and only reported 3 nm below the limit, every other pair at the limit, and the radius rule is estimated from each polygon's bounding box. A second variant adds the thesis's facet filter, which drops pairs whose edges meet at 45° or more. The tables list all these variants under KLayout (deep), with their times; the charts leave them out to stay legible. Having fewer pairs to report, the relaxations run faster than the raw check, up to ten times where the filter skips nearly every pair (rounded corners).
Straight lines: the same answers, faster
| Tool | Largest (2M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 1.3 s | n^1.02 | 0% | 0% |
| KLayout (flat) | 6.1 s | n^1.02 | 0% | 0% |
| KLayout (deep) | 5.4 s | n^1.02 | 0% | 0% |
| └limit − 1 DBU | 5.4 s | n^1.02 | 0% | 0% |
| └limit − 2 DBU | 5.6 s | n^1.02 | 0% | 0% |
| └projection ≥ d/10 | 4.3 s | n^1.01 | 0% | 0% |
| └limit − 2 DBU, projection ≥ d/10 | 4.2 s | n^1.01 | 0% | 0% |
| └Cao's selective tolerance | 5.8 s | n^1.03 | 0% | 0% |
| └Cao's selective tolerance, facet filter | 5.8 s | n^1.02 | 0% | 0% |
| gdsfactory | 6.3 s | n^1.03 | 0% | 0% |
| gdstk | 180 s at 720k, then stopped | n^1.42 | 0% | 18% |
The Manhattan case is a field of rectangles with slab rings around them, a width, a spacing and an enclosure rule, and violations of each planted in known places. Every edge-pair tool finds exactly the planted violations; Laylight is the fastest and scales linearly. gdstk's morphology finds them too, but the offsets it needs grow faster than linearly with the layout.
| Tool | Largest (2M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 350 ms | n^1.04 | 0% | 0% |
| KLayout (flat) | 1.2 s | n^1.05 | 0% | 0% |
| KLayout (deep) | 730 ms | n^1.02 | 0% | 0% |
| └limit − 1 DBU | 750 ms | n^1.02 | 0% | 0% |
| └limit − 2 DBU | 740 ms | n^1.01 | 0% | 0% |
| └projection ≥ d/10 | 1.2 s | n^1.00 | 0% | 0% |
| └limit − 2 DBU, projection ≥ d/10 | 1.2 s | n^1.00 | 0% | 0% |
| └Cao's selective tolerance | 770 ms | n^1.02 | 0% | 0% |
| └Cao's selective tolerance, facet filter | 850 ms | n^1.03 | 0% | 0% |
| gdsfactory | 1.1 s | n^1.04 | 0% | 0% |
| gdstk | 19 s | n^1.15 | 0% | 0% |
Exclusion keeps a metal pad at least 1 µm from a waveguide (space si, metal), with pads planted too close.
| Tool | Largest (1.8M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 900 ms | n^1.05 | 0% | 0% |
| KLayout (flat) | 2 s | n^1.03 | 0% | 0% |
| KLayout (deep) | 2 s | n^1.03 | 0% | 0% |
| └limit − 1 DBU | 1.9 s | n^1.02 | 0% | 0% |
| └limit − 2 DBU | 2 s | n^1.03 | 0% | 0% |
| └projection ≥ d/10 | 2.3 s | n^1.01 | 0% | 0% |
| └limit − 2 DBU, projection ≥ d/10 | 2.3 s | n^1.03 | 0% | 0% |
| └Cao's selective tolerance | 2.1 s | n^1.03 | 0% | 0% |
| └Cao's selective tolerance, facet filter | 2 s | n^1.03 | 0% | 0% |
| gdsfactory | 1.9 s | n^1.03 | 0% | 0% |
| gdstk | 5.4 s | n^1.31 | 0% | 40% |
Inclusion asks that a waveguide lies inside its slab, completely (inside) and with a margin (enclosure), with slabs planted too tight, shifted so the waveguide sticks out, or missing.
| Tool | Largest (2M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 470 ms | n^1.03 | 0% | 0% |
| KLayout (flat) | 1.5 s | n^1.02 | 0% | 0% |
| KLayout (deep) | 1.4 s | n^1.02 | 0% | 0% |
| └limit − 1 DBU | 1.5 s | n^1.01 | 0% | 0% |
| └limit − 2 DBU | 1.4 s | n^1.00 | 0% | 0% |
| └projection ≥ d/10 | 1.4 s | n^1.00 | 0% | 0% |
| └limit − 2 DBU, projection ≥ d/10 | 1.4 s | n^1.01 | 0% | 0% |
| └Cao's selective tolerance | 1.4 s | n^1.00 | 0% | 0% |
| └Cao's selective tolerance, facet filter | 1.4 s | n^1.01 | 0% | 0% |
| gdsfactory | 1.6 s | n^1.03 | 0% | 0% |
| gdstk | 75 s at 320k, then stopped | n^1.63 | 0% | 31% |
Feature size checks the minimum width of rotated bars, tapers, crosses and necked polygons: shapes whose narrowest part is not a pair of axis-aligned edges. Every tool finds all the planted features, and the edge-pair checkers report nothing else: the corners of rotated bars, which rounding to the grid makes a fraction of a degree sharper than a right angle, and the 85° corners at the wide end of every taper are blunter than the angle limit. gdstk's morphology cuts those corners off and reports them (31% of its reports). Laylight knows the width of a taper and a bar from their parameters.
Curves: only the real violations
| Tool | Largest (4.5M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 3.3 s | n^1.01 | 0% | 0% |
| KLayout (flat) | 23 s | n^0.99 | 0% | 39% |
| KLayout (deep) | 23 s | n^0.99 | 0% | 39% |
| └limit − 1 DBU | 16 s | n^0.98 | 0% | 0% |
| └limit − 2 DBU | 16 s | n^0.97 | 0% | 0% |
| └projection ≥ d/10 | 14 s | n^0.98 | 0% | 44% |
| └limit − 2 DBU, projection ≥ d/10 | 10 s | n^0.97 | 0% | 0% |
| └Cao's selective tolerance | 25 s | n^0.99 | 0% | 0% |
| └Cao's selective tolerance, facet filter | 25 s | n^0.99 | 0% | 0% |
| gdsfactory | 24 s | n^0.99 | 0% | 39% |
| gdstk | 250 s at 720k, then stopped | n^2.07 | 0% | 97% |
Rings: half of them drawn exactly at the minimum width, half 50 nm below it. KLayout reports every ring, because the chords of a ring at the minimum width measure up to a nanometre too narrow; only the rings below the minimum are planted, so about half of its reports are false positives, and it needs a thousand edge pairs to say so per ring. Lowering the limit by 1 DBU removes all of them and still finds the planted rings, 50 nm below it; the projection filter alone does not, because the chords of a 10 µm ring are a few hundred nanometres long, far more than the 50 nm it skips. Cao's selective tolerance takes the chords for a curve and reports nothing false either. Laylight reads the width of each isolated ring and spends its time on the spacing check alone.
| Tool | Largest (4.6M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 3.3 s | n^1.02 | 0% | 0% |
| KLayout (flat) | 25 s | n^0.99 | 0% | 99% |
| KLayout (deep) | 24 s | n^0.99 | 0% | 99% |
| └limit − 1 DBU | 11 s | n^0.98 | 0% | 0% |
| └limit − 2 DBU | 11 s | n^1.00 | 0% | 0% |
| └projection ≥ d/10 | 13 s | n^0.96 | 0% | 99% |
| └limit − 2 DBU, projection ≥ d/10 | 5.4 s | n^0.96 | 0% | 0% |
| └Cao's selective tolerance | 26 s | n^0.98 | 0% | 0% |
| └Cao's selective tolerance, facet filter | 25 s | n^0.98 | 0% | 0% |
| gdsfactory | 26 s | n^0.99 | 0% | 99% |
| gdstk | 250 s at 730k, then stopped | n^2.00 | 0% | 99% |
Couplers: a ring over a bus with the gap at, below and above the minimum spacing, the ring drawn at the minimum width. Nearly all of KLayout's reports (99%) are the width of the rings, as in the previous case, and the planted gaps hide among them; the gaps drawn exactly at the minimum do not trip it, since the chords of the outer edge lie inside the circle, away from the bus. Lowering the limit by 1 DBU removes every false report here, and so does Cao's selective tolerance; with the projection filter alone, 99% remain.
| Tool | Largest (4.3M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 1 s | n^1.01 | 0% | 0% |
| KLayout (flat) | 18 s | n^0.99 | 0% | 55% |
| KLayout (deep) | 17 s | n^1.01 | 0% | 55% |
| └limit − 1 DBU | 10 s | n^1.00 | 0% | 2% |
| └limit − 2 DBU | 9.3 s | n^0.99 | 0% | 0% |
| └projection ≥ d/10 | 11 s | n^1.00 | 0% | 62% |
| └limit − 2 DBU, projection ≥ d/10 | 6.4 s | n^0.99 | 0% | 0% |
| └Cao's selective tolerance | 19 s | n^1.01 | 25% | 0% |
| └Cao's selective tolerance, facet filter | 19 s | n^1.01 | 25% | 0% |
| gdsfactory | 18 s | n^0.99 | 0% | 55% |
| gdstk | 24 s at 680k, then stopped | n^1.65 | 0% | 96% |
Bends: Euler bends, arcs and S-bends at and below the minimum width, with a bend-radius rule; the arcs that are too tight are found from their parameters. Lowering the limit by 1 DBU leaves 2% of false reports, where chord error and rounding take a bend more than a nanometre under its drawn width; 2 DBU removes them all, and the projection filter alone hardly any (62% of its reports are false). Cao's selective tolerance reports nothing false, but its bend radius, estimated from a polygon's bounding box, assumes a quarter circle: it reads the radius of the 180° arcs 60% too large and that of the Euler bends, whose curvature peaks mid-bend, 42% too large, and misses every planted radius violation, a quarter of all.
| Tool | Largest (2.3M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 1.1 s | n^1.03 | 0% | 0% |
| KLayout (flat) | 17 s | n^1.01 | 0% | 50% |
| KLayout (deep) | 17 s | n^1.01 | 0% | 50% |
| └limit − 1 DBU | 17 s | n^1.01 | 0% | 50% |
| └limit − 2 DBU | 17 s | n^1.01 | 0% | 50% |
| └projection ≥ d/10 | 1.7 s | n^1.00 | 0% | 0% |
| └limit − 2 DBU, projection ≥ d/10 | 1.6 s | n^0.99 | 0% | 0% |
| └Cao's selective tolerance | 18 s | n^1.01 | 0% | 48% |
| └Cao's selective tolerance, facet filter | 19 s | n^1.02 | 0% | 46% |
| gdsfactory | 17 s | n^1.00 | 0% | 50% |
| gdstk | 80 s at 830k, then stopped | n^1.43 | 0% | 50% |
Rounded corners: rectangles with 200 nm corner radii, at and below the minimum width. The rounded corners alone make a polygon checker report every rectangle, because the two corner arcs at an end face each other across the narrowing end, closer than the width; lowering the limit does not change that, and Cao's selective tolerance keeps nearly all of them. The projection filter removes every false report here: the chords of a 200 nm corner are about 40 nm long, shorter than the 50 nm it asks for. Laylight knows that the shape is a rectangle of its width with rounded corners.
| Tool | Largest (2.4M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 2.7 s | n^0.99 | — | — |
| KLayout (flat) | 91 s | n^1.00 | — | 100% |
| KLayout (deep) | 91 s | n^1.00 | — | 100% |
| └limit − 1 DBU | 74 s | n^0.99 | — | 100% |
| └limit − 2 DBU | 51 s | n^0.99 | — | 100% |
| └projection ≥ d/10 | 58 s | n^1.00 | — | 100% |
| └limit − 2 DBU, projection ≥ d/10 | 22 s | n^1.00 | — | — |
| └Cao's selective tolerance | 93 s | n^1.00 | — | 100% |
| └Cao's selective tolerance, facet filter | 92 s | n^1.00 | — | — |
| gdsfactory | 91 s | n^1.00 | — | 100% |
| gdstk | 39 s at 260k, then stopped | n^1.43 | — | 100% |
Cao's arcs are the test layout of Cao's thesis: 24 concentric 90° arcs, radii 2 µm to 48 µm, width and spacing both exactly 1 µm, n² copies of the set. Nothing is a violation, so every report is false. Lowering the limits by 2 DBU removes the chord error (1 DBU leaves the gaps between neighbouring arcs) but not the ends of the arcs, where the radial end and the last chords face each other closer than the width: 8,064 reports at the largest size, the same that Cao's selective tolerance leaves. Adding the projection filter to the lowered limit removes those, and so does Cao's facet filter. Laylight decides the edge pairs of a shape with each other by its exact width, so the ends of an arc at the limit are not a violation.
Straight and curved on one layer
Each relaxation works on some of the curved cases above, and the strongest on all of them, because there nothing straight comes near a limit: every planted violation is 50 nm or more below it, and every shape drawn at the limit is curved. A real layer does not keep them apart, and the mixed case does not either. Each site puts straight shapes and curves on one layer of one cell: a bar, a gap between two bars and an L of two merged bars, drawn at the limits or 1 or 2 nm below them, the size of a rounding slip in a parametric cell; and a ring, a 180° arc, an Euler bend, a ring over a bus, two concentric rings and a route of a straight, an arc and a straight, drawn at the limits or 50 nm below them. Everything below a limit is a planted violation.
| Tool | Largest (15M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 14 s | n^1.02 | 0% | 0% |
| KLayout (flat) | 160 s | n^1.00 | 0% | 75% |
| KLayout (deep) | 150 s | n^1.00 | 0% | 75% |
| └limit − 1 DBU | 110 s | n^1.00 | 29% | 10% |
| └limit − 2 DBU | 85 s | n^0.99 | 57% | 0% |
| └projection ≥ d/10 | 89 s | n^1.00 | 0% | 84% |
| └limit − 2 DBU, projection ≥ d/10 | 43 s | n^0.99 | 57% | 0% |
| └Cao's selective tolerance | 170 s | n^1.00 | 0% | 0% |
| └Cao's selective tolerance, facet filter | 160 s | n^1.00 | 0% | 0% |
| gdsfactory | 160 s | n^1.00 | 0% | 75% |
| gdstk | 180 s at 610k, then stopped | n^2.11 | 0% | 97% |
Without a tolerance, KLayout finds every violation among three times as many false reports (75% of its reports), from the curves drawn at the limits. Lowering every limit by 1 DBU removes most of those, but it misses the straight shapes 1 nm below (29% of the violations) and still reports curves (10% of its reports): the width of a 5 µm ring and the gap between two concentric rings measure up to 2 nm under the drawn value. Lowering the limits by 2 DBU reports nothing false and misses every straight violation (57%); the projection filter alone misses nothing and reports the chord error as before (84% false); both together report nothing false and miss 57%. A tolerance wide enough for the curves hides the straight violations within it, and one narrow enough for them reports the curves. Cao's selective tolerance gets this case right: the straight shapes here have long, parallel edges, which it does not take for curves. Laylight reports every planted violation and nothing else in less than a tenth of KLayout's time, because its tolerance follows the shape: the bars carry none and are measured exactly, the curves 2 DBU per edge.
Where guessing curves fails
| Tool | Largest (8.6M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 7.6 s | n^1.02 | 0% | 0% |
| KLayout (flat) | 80 s | n^0.99 | 0% | 99% |
| KLayout (deep) | 77 s | n^0.99 | 0% | 99% |
| └limit − 1 DBU | 50 s | n^0.98 | 33% | 94% |
| └limit − 2 DBU | 39 s | n^0.99 | 67% | 0% |
| └projection ≥ d/10 | 47 s | n^0.99 | 0% | 99% |
| └limit − 2 DBU, projection ≥ d/10 | 16 s | n^0.96 | 67% | 0% |
| └Cao's selective tolerance | 80 s | n^0.99 | 100% | — |
| └Cao's selective tolerance, facet filter | 80 s | n^0.99 | 100% | — |
| gdsfactory | 81 s | n^1.00 | 0% | 99% |
| gdstk | 90 s at 340k, then stopped | n^1.91 | 33% | 95% |
Short features are straight shapes that look like curves to a checker that judges by edges: a narrow tooth and a narrow slit in a subwavelength grating, a 900 nm stub, the gap between two 900 nm pads, a reverse taper whose sides converge at 4.6° with a tip too narrow, a waveguide approaching a bus at 2.3°, each 1, 2 or 3 nm below the 200 nm limit; on the same layer, two concentric rings and a ring over a bus are drawn exactly at the limits. KLayout reports the rings (99% of its reports are false). Lowering the limits by 1 DBU misses a third of the violations and still reports most of the rings; 2 DBU misses two thirds, with or without the projection filter. Cao's selective tolerance takes every edge shorter than 1 µm and every pair within 5° of parallel for a curve, relaxes them by 3 nm and misses every violation. Laylight knows that these are rectangles, polygons and linear tapers, which carry no tolerance, and reports exactly the planted violations.
Hierarchy: every cell once
| Tool | Largest (6.3M vertices) | Scaling | Missed | False positives |
|---|---|---|---|---|
| Laylight | 6.4 s | n^1.00 | — | — |
| KLayout (flat) | 53 s | n^1.00 | — | 100% |
| KLayout (deep) | 52 s | n^1.00 | — | 100% |
| └limit − 1 DBU | 42 s | n^0.99 | — | 100% |
| └limit − 2 DBU | 39 s | n^1.00 | — | — |
| └projection ≥ d/10 | 46 s | n^1.00 | — | 100% |
| └limit − 2 DBU, projection ≥ d/10 | 37 s | n^0.99 | — | — |
| └Cao's selective tolerance | 53 s | n^0.99 | — | — |
| └Cao's selective tolerance, facet filter | 54 s | n^1.00 | — | — |
| gdsfactory | 55 s | n^0.99 | — | 100% |
| gdstk | 160 s at 990k, then stopped | n^1.84 | — | 100% |
The sweep is the ring-resonator test chip of the geometry benchmark: n² devices, each with its own radius and gap, so every one is a distinct cell, and the deck finds no violations. KLayout's deep mode cannot reuse anything here, because no two cells are alike; Laylight checks each cell's own shapes once and the interactions between instances only near their boundaries. The width reports of the other tools are the waveguides drawn at the minimum width; lowering KLayout's limits by 2 DBU silences them, and so does Cao's selective tolerance; by 1 DBU or with the projection filter alone it does not.
Summary
Each cell: peak throughput (vertices per second), scaling exponent, missed violations, false positives, over the five sizes of the case; a dash where nothing was planted or nothing reported.
| Case | Laylight | KLayout flat | KLayout deep | gdsfactory | gdstk |
|---|---|---|---|---|---|
| manhattan | 1.6 M/s, n^1.01, 0%, 0% | 381 k/s, n^1.02, 0%, 0% | 407 k/s, n^1.02, 0%, 0% | 380 k/s, n^1.03, 0%, 0% | 19 k/s, n^1.42, 0%, 18% |
| exclusion | 6.9 M/s, n^1.04, 0%, 0% | 2.2 M/s, n^1.05, 0%, 0% | 3.1 M/s, n^1.02, 0%, 0% | 2.2 M/s, n^1.04, 0%, 0% | 207 k/s, n^1.15, 0%, 0% |
| inclusion | 2.7 M/s, n^1.03, 0%, 0% | 1.0 M/s, n^1.03, 0%, 0% | 1.0 M/s, n^1.03, 0%, 0% | 1.1 M/s, n^1.03, 0%, 0% | 1.4 M/s, n^1.31, 0%, 40% |
| feature | 5.2 M/s, n^1.02, 0%, 0% | 1.5 M/s, n^1.02, 0%, 0% | 1.5 M/s, n^1.02, 0%, 0% | 1.4 M/s, n^1.03, 0%, 0% | 20 k/s, n^1.63, 0%, 31% |
| rings | 1.6 M/s, n^1.01, 0%, 0% | 193 k/s, n^0.99, 0%, 39% | 197 k/s, n^0.99, 0%, 39% | 195 k/s, n^0.99, 0%, 39% | 56 k/s, n^2.07, 0%, 97% |
| couplers | 1.6 M/s, n^1.01, 0%, 0% | 181 k/s, n^0.99, 0%, 99% | 192 k/s, n^0.99, 0%, 99% | 177 k/s, n^0.99, 0%, 99% | 47 k/s, n^2.00, 0%, 99% |
| bends | 4.8 M/s, n^1.02, 0%, 0% | 241 k/s, n^0.99, 0%, 55% | 259 k/s, n^1.01, 0%, 55% | 243 k/s, n^0.99, 0%, 55% | 170 k/s, n^1.65, 0%, 96% |
| rounded | 2.3 M/s, n^1.01, 0%, 0% | 143 k/s, n^1.01, 0%, 50% | 149 k/s, n^1.01, 0%, 50% | 145 k/s, n^1.00, 0%, 50% | 61 k/s, n^1.43, 0%, 50% |
| mixed | 1.3 M/s, n^1.01, 0%, 0% | 97 k/s, n^1.00, 0%, 75% | 99 k/s, n^1.00, 0%, 75% | 97 k/s, n^1.00, 0%, 75% | 16 k/s, n^2.11, 0%, 97% |
| cao-arcs | 906 k/s, n^0.98, —, — | 26 k/s, n^1.00, —, 100% | 26 k/s, n^1.00, —, 100% | 26 k/s, n^1.00, —, 100% | 22 k/s, n^1.43, —, 100% |
| short-features | 1.3 M/s, n^1.02, 0%, 0% | 109 k/s, n^0.99, 0%, 99% | 112 k/s, n^0.99, 0%, 99% | 106 k/s, n^1.00, 0%, 99% | 13 k/s, n^1.91, 33%, 95% |
| sweep | 1.0 M/s, n^0.99, —, — | 120 k/s, n^1.00, —, 100% | 122 k/s, n^1.00, —, 100% | 117 k/s, n^0.99, —, 100% | 63 k/s, n^1.84, —, 100% |
KLayout's deep mode with the workarounds for curves and with Cao's selective tolerance, in the same format:
| Case | limit − 1 DBU | limit − 2 DBU | projection ≥ d/10 | limit − 2 DBU, projection ≥ d/10 | Cao | Cao, facet filter |
|---|---|---|---|---|---|---|
| manhattan | 409 k/s, n^1.02, 0%, 0% | 407 k/s, n^1.02, 0%, 0% | 512 k/s, n^1.01, 0%, 0% | 519 k/s, n^1.01, 0%, 0% | 392 k/s, n^1.03, 0%, 0% | 386 k/s, n^1.02, 0%, 0% |
| exclusion | 3.0 M/s, n^1.02, 0%, 0% | 2.9 M/s, n^1.01, 0%, 0% | 1.8 M/s, n^1.00, 0%, 0% | 1.7 M/s, n^1.00, 0%, 0% | 2.8 M/s, n^1.02, 0%, 0% | 2.7 M/s, n^1.03, 0%, 0% |
| inclusion | 1.0 M/s, n^1.02, 0%, 0% | 1.0 M/s, n^1.03, 0%, 0% | 865 k/s, n^1.01, 0%, 0% | 858 k/s, n^1.03, 0%, 0% | 992 k/s, n^1.03, 0%, 0% | 1.0 M/s, n^1.03, 0%, 0% |
| feature | 1.5 M/s, n^1.01, 0%, 0% | 1.5 M/s, n^1.00, 0%, 0% | 1.5 M/s, n^1.00, 0%, 0% | 1.5 M/s, n^1.01, 0%, 0% | 1.4 M/s, n^1.00, 0%, 0% | 1.5 M/s, n^1.01, 0%, 0% |
| rings | 278 k/s, n^0.98, 0%, 0% | 278 k/s, n^0.97, 0%, 0% | 318 k/s, n^0.98, 0%, 44% | 453 k/s, n^0.97, 0%, 0% | 182 k/s, n^0.99, 0%, 0% | 181 k/s, n^0.99, 0%, 0% |
| couplers | 402 k/s, n^0.98, 0%, 0% | 399 k/s, n^1.00, 0%, 0% | 360 k/s, n^0.96, 0%, 99% | 858 k/s, n^0.96, 0%, 0% | 181 k/s, n^0.98, 0%, 0% | 184 k/s, n^0.98, 0%, 0% |
| bends | 418 k/s, n^1.00, 0%, 2% | 459 k/s, n^0.99, 0%, 0% | 393 k/s, n^1.00, 0%, 62% | 671 k/s, n^0.99, 0%, 0% | 236 k/s, n^1.01, 25%, 0% | 240 k/s, n^1.01, 25%, 0% |
| rounded | 148 k/s, n^1.01, 0%, 50% | 149 k/s, n^1.01, 0%, 50% | 1.4 M/s, n^1.00, 0%, 0% | 1.5 M/s, n^0.99, 0%, 0% | 131 k/s, n^1.01, 0%, 48% | 136 k/s, n^1.02, 0%, 46% |
| mixed | 144 k/s, n^1.00, 29%, 10% | 179 k/s, n^0.99, 57%, 0% | 171 k/s, n^1.00, 0%, 84% | 357 k/s, n^0.99, 57%, 0% | 93 k/s, n^1.00, 0%, 0% | 93 k/s, n^1.00, 0%, 0% |
| cao-arcs | 32 k/s, n^0.99, —, 100% | 47 k/s, n^0.99, —, 100% | 42 k/s, n^1.00, —, 100% | 107 k/s, n^1.00, —, — | 26 k/s, n^1.00, —, 100% | 26 k/s, n^1.00, —, — |
| short-features | 172 k/s, n^0.98, 33%, 94% | 222 k/s, n^0.99, 67%, 0% | 188 k/s, n^0.99, 0%, 99% | 527 k/s, n^0.96, 67%, 0% | 108 k/s, n^0.99, 100%, — | 108 k/s, n^0.99, 100%, — |
| sweep | 151 k/s, n^0.99, —, 100% | 162 k/s, n^1.00, —, — | 140 k/s, n^1.00, —, 100% | 177 k/s, n^0.99, —, — | 119 k/s, n^0.99, —, — | 119 k/s, n^1.00, —, — |