Exact, evidence-oriented comparison of GDSII layout geometry
Project description
gdsdiff
gdsdiff compares the geometry and hierarchy of two GDSII layouts and emits
neutral, machine-readable evidence. It supports exact CPU verification by
default and can use optional CUDA or Apple Metal acceleration when a compatible
system toolchain and device are available.
The package is usable on CPU-only machines. CUDA, Metal, CMake, and compiler toolchains are runtime capabilities, not mandatory Python dependencies.
Install
python -m pip install gdsdiff
For local development from this checkout:
UV_PROJECT_ENVIRONMENT=.venv_wsl UV_LINK_MODE=copy uv sync --locked --extra dev
TMPDIR=/tmp .venv_wsl/bin/python -m pytest
Use a repository-local virtual environment: .venv_wsl on Windows 11 through
WSL, .venv_mac on macOS, and .venv on native Linux.
Command line
python -m gdsdiff before.gds after.gds --output-dir comparison
Exit codes are stable: 0 means the selected failure policy passed, 1 means
differences failed the policy, and 2 means the comparison could not produce
valid evidence. Reports use factual directions such as coverage_before_only
and coverage_after_only.
Python API
from gdsdiff import CompareConfig, compare_gds_files
result = compare_gds_files(
CompareConfig("before.gds", "after.gds", backend="cpu")
)
print(result.status, result.exit_code)
Polygon extraction is public so downstream tools such as ebeamtime can share
the same zero-copy PolygonBuffer representation:
from gdsdiff import extract_gds_polygons
extraction = extract_gds_polygons("layout.gds", layers="1:0,2:0")
print(extraction.buffer.polygon_count)
See docs/ for comparison semantics, report format, engine details, and
debugging guidance.
Optional acceleration
- CUDA requires an NVIDIA GPU, a compatible driver, and the CUDA toolkit with
nvccavailable. On WSL, install the Windows NVIDIA display driver and the WSL CUDA toolkit, never a Linux display driver.nvccis discovered fromPATH,CUDA_HOME,/usr/local/cuda, or/opt/cuda. - On-demand builds default to NVIDIA's
-arch=native:nvccdetects visible GPUs and emits native SASS without PTX. For cross-machine builds, setGDSDIFF_CUDA_ARCHITECTURESto comma-separated compute capabilities without decimals (for example,89,120). Targets and standardNVCC_*_FLAGSare included in the content-addressed cache key. - Metal requires Apple Silicon/macOS with the Xcode command-line tools.
- Missing or unusable accelerators fall back to CPU unless
require_gpu=Trueis explicitly requested.
Installation and import never compile GPU code. Inspect the CUDA toolchain with
gdsdiff.inspect_cuda_toolchain(), then build and verify the optional backend
with gdsdiff.prepare_cuda() or gdsdiff-prepare-cuda --json. Explicit
backend="cuda" use retains lazy preparation. Passive diagnostics and
discover_native_capabilities() report only already-prepared backends.
Native artifacts are stored in a private, content-addressed user cache keyed by source, compiler/toolkit identity, build flags, and native GPU identity. The optional geometry cache uses JSON plus non-executable NumPy arrays; legacy pickle cache entries are ignored and rebuilt.
License
GPL-3.0-only. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gdsdiff-0.1.0.tar.gz.
File metadata
- Download URL: gdsdiff-0.1.0.tar.gz
- Upload date:
- Size: 304.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a5f16a241b0e3797d027cdef2b20dd3c61128e27c7dd43e913285957605023e
|
|
| MD5 |
620a8766faaa18786f647300efa69c87
|
|
| BLAKE2b-256 |
e1e1d3b7b8eef25f41a5758f1f6c5d2988cf10c9649c4efe53a1fe370e66a476
|
Provenance
The following attestation bundles were made for gdsdiff-0.1.0.tar.gz:
Publisher:
release.yml on SandboChang/gdsdiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gdsdiff-0.1.0.tar.gz -
Subject digest:
1a5f16a241b0e3797d027cdef2b20dd3c61128e27c7dd43e913285957605023e - Sigstore transparency entry: 2190983420
- Sigstore integration time:
-
Permalink:
SandboChang/gdsdiff@6bdc0c7827b3535996e1487c41b0304325cc077d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SandboChang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6bdc0c7827b3535996e1487c41b0304325cc077d -
Trigger Event:
push
-
Statement type:
File details
Details for the file gdsdiff-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gdsdiff-0.1.0-py3-none-any.whl
- Upload date:
- Size: 275.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a561cf759639c515306d24568ff64ca148722bc4b0fa918326b8138e7b16c43
|
|
| MD5 |
e50cfcd6619bf06a4869fb1aebb6a758
|
|
| BLAKE2b-256 |
1617f5f8ae8b73d008988346096ea83d1f12f9ccee796a54c51beff8e7f51bde
|
Provenance
The following attestation bundles were made for gdsdiff-0.1.0-py3-none-any.whl:
Publisher:
release.yml on SandboChang/gdsdiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gdsdiff-0.1.0-py3-none-any.whl -
Subject digest:
0a561cf759639c515306d24568ff64ca148722bc4b0fa918326b8138e7b16c43 - Sigstore transparency entry: 2190983447
- Sigstore integration time:
-
Permalink:
SandboChang/gdsdiff@6bdc0c7827b3535996e1487c41b0304325cc077d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SandboChang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6bdc0c7827b3535996e1487c41b0304325cc077d -
Trigger Event:
push
-
Statement type: