Skip to content

About

RustEDA layout viewer: pure-Rust, GPU-accelerated GDSII/OASIS visualization for gigabyte-scale IC layouts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RustLayout — GPU-accelerated GDSII/OASIS viewer

Clean-room, 100% pure-Rust, GPU-accelerated GDSII / OASIS IC layout viewer & visual XOR diff toolkit.
120–400+ FPS Retina GPU rendering · Native multi-touch trackpad pinch-zoom · 0.048 ms zero-copy .rlay cache · Zero C/C++ FFI

Documentation · RustEDA Suite · Benchmarks · Architecture · Apache-2.0

RustLayout Signal Forge v2 desktop workbench rendering a real IHP SG13G2 128-Kbit SRAM + BIST GDSII macro at 532 FPS (1.88 ms/frame) with 32x32 GPU stipples, expanded cell hierarchy, layer properties, inspector, minimap, magnetic ruler, and desktop menu bar
Real silicon IHP SG13G2 128-Kbit SRAM + BIST macro (RM_IHPSG13_1P_2048x64_c2_bm_bist.gds) rendered in RustLayout on Apple Metal — live 532 FPS (1.88 ms/frame), 32×32 GPU stipple patterns, expanded cell hierarchy, shape inspector, minimap, and magnetic ruler.

Why RustLayout

Legacy IC layout viewers stall for seconds on multi-gigabyte tapeout files, drop frames on Retina displays, treat laptop trackpads like scroll-wheel mice, and carry heavy C++/Qt/Python stacks. RustLayout is built from scratch in 100% pure Rust (#![deny(unsafe_code)], zero C/C++ FFI) around modern wgpu GPU rendering and human-first desktop ergonomics:

  • Ultra-High-Performance GPU Rendering (120–400+ FPS on GB-Scale Chips): Vertex-pulled 16 B/rect storage slabs, 32-bit Hilbert spatial sorting, 128-byte 4-wide BvhNode4 with non-inflating density HLOD, native GPU SREF/AREF instancing, and per-layer RG8Unorm mask caching deliver 2.50–2.82 ms P50 (354–400 FPS) at Retina 3024×1964 on 1–2 GiB layouts, < 1.7 ms instant layer toggles, GPU pan tile-shift, and hard-capped LRU VRAM streaming (≤ 512 MiB even on 5 GiB reticles).
  • Native Multi-Touch Trackpad & Modern CAD Ergonomics: Built directly on winit + wgpu + egui_dock with cursor-anchored macOS trackpad pinch-to-zoom, buttery smooth two-finger pan/scroll with exponential camera damping, crisp HiDPI/Retina scaling, 0% idle CPU/GPU (ControlFlow::Wait), a full desktop menu bar (File, Edit, View, Layers, Tools, Diff, Window, Help) with native OS file/export dialogs, recent files, magnetic corner/midpoint/edge-snapping rulers, and familiar KLayout hotkeys (F, G, R, S, Z, 0..9, *, [/], Cmd/Ctrl+K).
  • 5–13× Faster Multi-Format Parsing & 0.048 ms Zero-Copy Reopen: Two-phase parallel pread GDSII ingestion (keeping peak RAM at 0.49×–0.61× file size), pure-Rust .gds.gz decompression, and a clean-room SEMI P39 OASIS (.oas) parser with parallel CBLOCK inflation and unexpanded AREF mapping. Save once to a 64-byte-aligned .rlay cache to reopen a 2 GiB chip in 0.048 ms and a 5 GiB chip in 0.184 ms.
  • Sub-Nanometer Precision & Real-Time 66.9 FPS GPU Visual XOR Diff: Camera-relative 16-bit integer-split WGSL vertex math achieves 1.00000 raw IoU at 100 nm zoom across ±500 mm wafers (±10⁹ DBU) with zero f32 jitter. Compare two tapeout revisions live on GPU (A \ B Copper, B \ A Mint) at 66.9 FPS on Retina 3K with exact 1-DBU perturbation jump-lists and --watch-focus <json> cross-probing from RustEDA, RustROAD, and RustSTA.
  • Full KLayout .lyp Fidelity & Safety by Construction: Parses and exports KLayout .lyp XML with 32×32 screen-space stipple bitmasks plus built-in open-PDK presets (SKY130A, IHP SG13G2, GF180MCU D). Verified 100% geometric parity vs. KLayout 0.30.13 across canonical fixtures and all three foundry PDKs, with zero panics across 800+ mutated GDS/OASIS fuzz cases.

Verified Performance vs. KLayout 0.30.13

All measurements come from paired quiet-host runs on Apple M6 (12 cores, 32 GiB RAM, Metal) committed in docs/benchmarks/receipt.json — see Benchmark Report for full methodology and tables.

Benchmark (paired quiet-host receipts) Size RustLayout KLayout 0.30.13 RustLayout delta
sky130_fd_sc_hd.gds cold parse & RSS 4.0 MiB 2.23 ms / 24.0 MiB 7.26 ms / 348.3 MiB 3.26× faster, 14.5× less RAM
soc_100mb.gds cold parse 100 MiB 17.49 ms 104.30 ms 5.96× faster
curvilinear_500mb.gds cold parse 512 MiB 148.83 ms 1,888.86 ms 12.69× faster
hier_sram_1gb.gds cold parse & RSS 1.0 GiB 143.26 ms / 604.5 MiB (0.59×) 1,137.39 ms / 933.8 MiB 7.94× faster, 35% less RAM
flat_fill_2gb.gds cold parse & RSS 2.0 GiB 276.25 ms / 1,247.9 MiB (0.61×) 2,438.02 ms / 1,558.5 MiB 8.83× faster, 20% less RAM
mega_5gb.gds cold parse & RSS 5.0 GiB 1,414.19 ms / 2,497.0 MiB (0.49×) 6,523.98 ms / 3,580.9 MiB 4.61× faster, 30% less RAM
flat_fill_2gb warm .rlay mmap reopen 555 MiB 0.048 ms — Instant zero-copy reopen
flat_fill_2gb headless 4K (3840×2160) PNG 2.0 GiB 0.814 s cold / 0.073 s warm 7.355 s 9.03× cold / 101.2× warm
flat_fill_2gb 600-frame Retina (3024×1964) 2.0 GiB 2.82 ms P50 (354 FPS) / 8.37 ms P95 — 1.53 ms layer toggle · 137 MiB VRAM
hier_sram_1gb 600-frame Retina (3024×1964) 1.0 GiB 2.50 ms P50 (400 FPS) / 8.56 ms P95 — 1.64 ms layer toggle · 73 MiB VRAM
mega_5gb 1,000-frame Retina (512 MiB cap) 5.0 GiB 1.25 ms P50 (800 FPS) / 1.93 ms P95 — Strictly ≤ 512 MiB VRAM
soc_100mb Retina GPU Visual XOR Diff 100 MiB 14.95 ms P50 (66.9 FPS) — 1-DBU exact perturbation detection

Architecture & Pipeline

RustLayout pipeline: GDSII, gzipped GDSII, SEMI P39 OASIS and zero-copy RLAY inputs indexed into Hilbert 4-wide BVH trees and rendered by wgpu with HLOD, mask caching, and real-time GPU XOR diff
Crate Responsibility
rustlayout-core Exact i32/i64 DBU geometry, D4/affine transforms, IBM excess-64 real8, camera decomposition, ResourceLimits, LayoutError.
rustlayout-gds Parallel pread/mmap GDSII parser, .gds.gz decompression, clean-room SEMI P39 OASIS parser (CBLOCK parallel inflate, unexpanded AREFs), cyclic DAG guard.
rustlayout-db SoA geometry arenas, 32-bit Hilbert spatial sorting, 128-byte 4-wide BvhNode4 HLOD, O(1) AREF frustum clamping, hierarchical picker, .rlay mmap cache.
rustlayout-style KLayout .lyp XML reader/writer, 32×32 GPU stipple catalog, Signal Forge v2 & open-PDK presets (SKY130A, IHP SG13G2, GF180MCU D).
rustlayout-render GUI-agnostic wgpu engine (headless PNG & embeddable via GpuContext::from_external), 16-bit integer-split WGSL shaders, compute culler, LRU VRAM pool, per-layer mask cache, pan tile-shift, XOR diff.
rustlayout-app winit + wgpu + egui + egui_dock Signal Forge v2 desktop workbench: menu bar, native file dialogs, trackpad pinch-zoom, 100k+ virtualized cell tree, magnetic rulers, bookmarks, --watch-focus cross-probing.
rustlayout-cli Unified rustlayout CLI (view, info, query, cache, render, diff, bench, png-iou) with rusteda.v1 JSON output.
rustlayout-benchgen Deterministic canonical, hostile-fuzz, and multi-GB synthetic GDSII stress suite generator.

See Architecture for the full design breakdown.


Quick Start

# Build optimized release binary (Rust 1.100+, Metal / Vulkan / DX12)
cargo build --release -p rustlayout-cli

# Launch the interactive Signal Forge v2 desktop workbench
./target/release/rustlayout view chip.gds --preset sky130a
./target/release/rustlayout view chip.oas --lyp sky130A.lyp --diff ref.oas --watch-focus focus.json

# Or open empty and use File > Open Layout (Cmd/Ctrl+O) or drag-and-drop
./target/release/rustlayout view

Headless CLI & Agent Automation

# Inspect GDSII / .gds.gz / OASIS / .rlay metadata as rusteda.v1 JSON
./target/release/rustlayout info chip.gds --json

# Build a zero-copy .rlay spatial cache for < 1 ms subsequent opens
./target/release/rustlayout cache build chip.gds --out chip.rlay --json

# Headless 4K PNG export (exact geometry or HLOD-accelerated)
./target/release/rustlayout render chip.gds --out chip_4k.png --width 3840 --height 2160 --preset sky130a

# Headless GPU Visual XOR Diff (A \ B Copper, B \ A Mint)
./target/release/rustlayout diff rev_a.gds rev_b.gds --out xor.png --width 2048 --height 2048 --json

# Scripted Retina 3024x1964 GPU flythrough & layer-toggle benchmark
./target/release/rustlayout bench chip.rlay --frames 600 --width 3024 --height 1964 --max-vram-mib 512 --json

Scope & Current Limits

  • Read-only inspection, rendering & diff toolkit: RustLayout currently focuses on ultra-fast viewing, hierarchical picking, magnetic measurement, headless rendering, .lyp editing/export, .rlay caching, and real-time GPU XOR diff. Interactive polygon editing, GDSII/OASIS streamout modification, and DRC/LVS rule-deck execution remain outside current scope.
  • Dense curvilinear polygon streaming: On the 512 MiB curvilinear_500mb stress test (all 32-vertex curves), chunked lazy triangulation holds peak VRAM within the 1,024 MiB cap (892 MiB) at 16.22 ms P50 (62 FPS), slower than rectangular metal/SRAM workloads (2.50–2.82 ms P50) while triangulation warms up.
  • Benchmark host scope: Headline GPU and parse timings in docs/benchmarks/receipt.json were measured on a single Apple M6 (Metal) quiet host; Linux Vulkan/DX12 throughput scales with adapter bandwidth and driver support.

License

Apache-2.0 — see LICENSE. External reference tools (KLayout) and open PDK layouts retain their own licenses and are used strictly as black-box verification inputs.

About

RustEDA layout viewer: pure-Rust, GPU-accelerated GDSII/OASIS visualization for gigabyte-scale IC layouts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages