Compare commits
76 changed files with 17223 additions and 1207 deletions
23
.github/workflows/ci.yml
vendored
Normal file
23
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
name: Native checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
rust:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
rust: ['1.88.0', stable]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- run: rustup toolchain install ${{ matrix.rust }} --profile minimal
|
||||||
|
- run: cargo +${{ matrix.rust }} test --locked
|
||||||
|
- run: cargo +${{ matrix.rust }} test --locked --release
|
||||||
122
.github/workflows/packages.yml
vendored
Normal file
122
.github/workflows/packages.yml
vendored
Normal file
|
|
@ -0,0 +1,122 @@
|
||||||
|
name: Package artifacts
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
tags: ['v*']
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sdist:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-python@v6
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- run: python -m pip install build
|
||||||
|
- run: python -m build --sdist
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: source
|
||||||
|
path: dist/*.tar.gz
|
||||||
|
|
||||||
|
wheels:
|
||||||
|
needs: sdist
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-15, windows-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: source
|
||||||
|
path: source-dist
|
||||||
|
- name: Unpack the source release
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir source-build
|
||||||
|
tar -xzf source-dist/*.tar.gz -C source-build --strip-components=1
|
||||||
|
- name: Build and repair Python-independent wheels from the sdist
|
||||||
|
uses: pypa/cibuildwheel@v4.3.5
|
||||||
|
with:
|
||||||
|
package-dir: source-build
|
||||||
|
env:
|
||||||
|
CIBW_BUILD: cp311-*
|
||||||
|
CIBW_SKIP: '*-musllinux_* *-win32'
|
||||||
|
CIBW_ARCHS: native
|
||||||
|
CIBW_ENVIRONMENT_LINUX: 'CARGO_HOME=/tmp/pheon-cargo RUSTUP_HOME=/tmp/pheon-rustup PATH=/tmp/pheon-cargo/bin:$PATH'
|
||||||
|
CIBW_BEFORE_ALL_LINUX: 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable'
|
||||||
|
CIBW_TEST_COMMAND: 'python -I {project}/tools/check_installed.py'
|
||||||
|
- name: Check wheel ABI tags
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
from pathlib import Path
|
||||||
|
wheels = list(Path('wheelhouse').glob('*.whl'))
|
||||||
|
assert wheels
|
||||||
|
assert all('-py3-none-' in p.name for p in wheels), wheels
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheel-${{ matrix.os }}
|
||||||
|
path: wheelhouse/*.whl
|
||||||
|
|
||||||
|
same-wheel:
|
||||||
|
needs: wheels
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-15, windows-latest]
|
||||||
|
python: ['3.11', '3.12', '3.13', '3.14']
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: actions/setup-python@v6
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheel-${{ matrix.os }}
|
||||||
|
path: wheelhouse
|
||||||
|
- name: Install the same artifact on another Python version
|
||||||
|
shell: bash
|
||||||
|
run: python -m pip install wheelhouse/*.whl
|
||||||
|
- run: python -I tools/check_installed.py
|
||||||
|
|
||||||
|
cli:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-15, windows-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- run: cargo test --release --locked
|
||||||
|
- run: cargo build --release --locked --bin pheon
|
||||||
|
- name: Assemble standalone CLI artifact
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir cli-dist
|
||||||
|
if [ "$RUNNER_OS" = Windows ]; then
|
||||||
|
cp target/release/pheon.exe cli-dist/
|
||||||
|
else
|
||||||
|
cp target/release/pheon cli-dist/
|
||||||
|
fi
|
||||||
|
cp LICENSE.md README.md cli-dist/
|
||||||
|
cp -R contrib docs cli-dist/
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: cli-${{ matrix.os }}
|
||||||
|
path: cli-dist/
|
||||||
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -1,6 +1,12 @@
|
||||||
/target/
|
/target/
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
|
||||||
|
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
|
__pycache__/
|
||||||
|
/build/
|
||||||
|
/dist/
|
||||||
|
/.cache/
|
||||||
|
/.venv/
|
||||||
|
/*.egg-info/
|
||||||
|
|
|
||||||
664
Cargo.lock
generated
Normal file
664
Cargo.lock
generated
Normal file
|
|
@ -0,0 +1,664 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "adler2"
|
||||||
|
version = "2.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ahash"
|
||||||
|
version = "0.8.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"const-random",
|
||||||
|
"getrandom",
|
||||||
|
"once_cell",
|
||||||
|
"version_check",
|
||||||
|
"zerocopy",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "android-tzdata"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "android_system_properties"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrow-array"
|
||||||
|
version = "54.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a12fcdb3f1d03f69d3ec26ac67645a8fe3f878d77b5ebb0b15d64a116c212985"
|
||||||
|
dependencies = [
|
||||||
|
"ahash",
|
||||||
|
"arrow-buffer",
|
||||||
|
"arrow-data",
|
||||||
|
"arrow-schema",
|
||||||
|
"chrono",
|
||||||
|
"half",
|
||||||
|
"hashbrown",
|
||||||
|
"num",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrow-buffer"
|
||||||
|
version = "54.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "263f4801ff1839ef53ebd06f99a56cecd1dbaf314ec893d93168e2e860e0291c"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"half",
|
||||||
|
"num",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrow-data"
|
||||||
|
version = "54.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "61cfdd7d99b4ff618f167e548b2411e5dd2c98c0ddebedd7df433d34c20a4429"
|
||||||
|
dependencies = [
|
||||||
|
"arrow-buffer",
|
||||||
|
"arrow-schema",
|
||||||
|
"half",
|
||||||
|
"num",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrow-schema"
|
||||||
|
version = "54.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "39cfaf5e440be44db5413b75b72c2a87c1f8f0627117d110264048f2969b99e9"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "autocfg"
|
||||||
|
version = "1.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "2.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bumpalo"
|
||||||
|
version = "3.17.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bytes"
|
||||||
|
version = "1.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.2.19"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362"
|
||||||
|
dependencies = [
|
||||||
|
"shlex",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg-if"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "chrono"
|
||||||
|
version = "0.4.40"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c"
|
||||||
|
dependencies = [
|
||||||
|
"android-tzdata",
|
||||||
|
"iana-time-zone",
|
||||||
|
"num-traits",
|
||||||
|
"windows-link 0.1.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const-random"
|
||||||
|
version = "0.1.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359"
|
||||||
|
dependencies = [
|
||||||
|
"const-random-macro",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const-random-macro"
|
||||||
|
version = "0.1.16"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom",
|
||||||
|
"once_cell",
|
||||||
|
"tiny-keccak",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "core-foundation-sys"
|
||||||
|
version = "0.8.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crc32fast"
|
||||||
|
version = "1.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crunchy"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "flate2"
|
||||||
|
version = "1.1.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"
|
||||||
|
dependencies = [
|
||||||
|
"crc32fast",
|
||||||
|
"miniz_oxide",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "getrandom"
|
||||||
|
version = "0.2.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
"wasi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "half"
|
||||||
|
version = "2.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"crunchy",
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hashbrown"
|
||||||
|
version = "0.15.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "iana-time-zone"
|
||||||
|
version = "0.1.63"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8"
|
||||||
|
dependencies = [
|
||||||
|
"android_system_properties",
|
||||||
|
"core-foundation-sys",
|
||||||
|
"iana-time-zone-haiku",
|
||||||
|
"js-sys",
|
||||||
|
"log",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"windows-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "iana-time-zone-haiku"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itoa"
|
||||||
|
version = "1.0.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "js-sys"
|
||||||
|
version = "0.3.77"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libc"
|
||||||
|
version = "0.2.172"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libm"
|
||||||
|
version = "0.2.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "log"
|
||||||
|
version = "0.4.27"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memchr"
|
||||||
|
version = "2.7.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "miniz_oxide"
|
||||||
|
version = "0.8.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
|
||||||
|
dependencies = [
|
||||||
|
"adler2",
|
||||||
|
"simd-adler32",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
|
||||||
|
dependencies = [
|
||||||
|
"num-bigint",
|
||||||
|
"num-complex",
|
||||||
|
"num-integer",
|
||||||
|
"num-iter",
|
||||||
|
"num-rational",
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-bigint"
|
||||||
|
version = "0.4.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
|
||||||
|
dependencies = [
|
||||||
|
"num-integer",
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-complex"
|
||||||
|
version = "0.4.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
||||||
|
dependencies = [
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-integer"
|
||||||
|
version = "0.1.46"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
|
||||||
|
dependencies = [
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-iter"
|
||||||
|
version = "0.1.45"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
"num-integer",
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-rational"
|
||||||
|
version = "0.4.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
|
||||||
|
dependencies = [
|
||||||
|
"num-bigint",
|
||||||
|
"num-integer",
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-traits"
|
||||||
|
version = "0.2.19"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
"libm",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "once_cell"
|
||||||
|
version = "1.21.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pheon"
|
||||||
|
version = "0.3.0"
|
||||||
|
dependencies = [
|
||||||
|
"arrow-array",
|
||||||
|
"arrow-schema",
|
||||||
|
"flate2",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"termcolor",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.95"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.40"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustversion"
|
||||||
|
version = "1.0.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ryu"
|
||||||
|
version = "1.0.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde"
|
||||||
|
version = "1.0.219"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
|
||||||
|
dependencies = [
|
||||||
|
"serde_derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_derive"
|
||||||
|
version = "1.0.219"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_json"
|
||||||
|
version = "1.0.140"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
|
||||||
|
dependencies = [
|
||||||
|
"itoa",
|
||||||
|
"memchr",
|
||||||
|
"ryu",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "shlex"
|
||||||
|
version = "1.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "simd-adler32"
|
||||||
|
version = "0.3.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "2.0.100"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "termcolor"
|
||||||
|
version = "1.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
|
||||||
|
dependencies = [
|
||||||
|
"winapi-util",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tiny-keccak"
|
||||||
|
version = "2.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
|
||||||
|
dependencies = [
|
||||||
|
"crunchy",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "version_check"
|
||||||
|
version = "0.9.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasi"
|
||||||
|
version = "0.11.0+wasi-snapshot-preview1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen"
|
||||||
|
version = "0.2.100"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"once_cell",
|
||||||
|
"rustversion",
|
||||||
|
"wasm-bindgen-macro",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-backend"
|
||||||
|
version = "0.2.100"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
|
||||||
|
dependencies = [
|
||||||
|
"bumpalo",
|
||||||
|
"log",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro"
|
||||||
|
version = "0.2.100"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"wasm-bindgen-macro-support",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro-support"
|
||||||
|
version = "0.2.100"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-backend",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-shared"
|
||||||
|
version = "0.2.100"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-util"
|
||||||
|
version = "0.1.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||||
|
dependencies = [
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-core"
|
||||||
|
version = "0.61.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
|
||||||
|
dependencies = [
|
||||||
|
"windows-implement",
|
||||||
|
"windows-interface",
|
||||||
|
"windows-link 0.1.1",
|
||||||
|
"windows-result",
|
||||||
|
"windows-strings",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-implement"
|
||||||
|
version = "0.60.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-interface"
|
||||||
|
version = "0.59.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-link"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-link"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-result"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.1.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-strings"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.1.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.61.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.2.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zerocopy"
|
||||||
|
version = "0.7.35"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
|
||||||
|
dependencies = [
|
||||||
|
"zerocopy-derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zerocopy-derive"
|
||||||
|
version = "0.7.35"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
29
Cargo.toml
29
Cargo.toml
|
|
@ -1,9 +1,28 @@
|
||||||
[package]
|
[package]
|
||||||
name = "rs-klamath"
|
name = "pheon"
|
||||||
version = "0.1.0"
|
version = "0.3.0"
|
||||||
authors = ["jan <jan@mpxd.net>"]
|
authors = ["jan <jan@mpxd.net>"]
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
|
rust-version = "1.88"
|
||||||
|
description = "GDSII parsing, Arrow interchange, and structural layout review"
|
||||||
|
license = "GPL-3.0-only"
|
||||||
|
readme = "README.md"
|
||||||
|
repository = "https://mpxd.net/code/jan/pheon"
|
||||||
|
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "pheon"
|
||||||
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
byteorder = "^1"
|
arrow-array = {version = "^54", features = ["ffi"]}
|
||||||
#nom = "^7"
|
arrow-schema = "^54"
|
||||||
|
flate2 = "1"
|
||||||
|
serde = "1"
|
||||||
|
serde_json = "1"
|
||||||
|
termcolor = "1.4"
|
||||||
|
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
lto = true
|
||||||
|
|
|
||||||
595
LICENSE.md
Normal file
595
LICENSE.md
Normal file
|
|
@ -0,0 +1,595 @@
|
||||||
|
GNU General Public License
|
||||||
|
==========================
|
||||||
|
|
||||||
|
_Version 3, 29 June 2007_
|
||||||
|
_Copyright © 2007 Free Software Foundation, Inc. <<http://fsf.org/>>_
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||||
|
document, but changing it is not allowed.
|
||||||
|
|
||||||
|
## Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for software and other
|
||||||
|
kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed to take away
|
||||||
|
your freedom to share and change the works. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change all versions of a
|
||||||
|
program--to make sure it remains free software for all its users. We, the Free
|
||||||
|
Software Foundation, use the GNU General Public License for most of our software; it
|
||||||
|
applies also to any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not price. Our General
|
||||||
|
Public Licenses are designed to make sure that you have the freedom to distribute
|
||||||
|
copies of free software (and charge for them if you wish), that you receive source
|
||||||
|
code or can get it if you want it, that you can change the software or use pieces of
|
||||||
|
it in new free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you these rights or
|
||||||
|
asking you to surrender the rights. Therefore, you have certain responsibilities if
|
||||||
|
you distribute copies of the software, or if you modify it: responsibilities to
|
||||||
|
respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether gratis or for a fee,
|
||||||
|
you must pass on to the recipients the same freedoms that you received. You must make
|
||||||
|
sure that they, too, receive or can get the source code. And you must show them these
|
||||||
|
terms so they know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps: **(1)** assert
|
||||||
|
copyright on the software, and **(2)** offer you this License giving you legal permission
|
||||||
|
to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains that there is
|
||||||
|
no warranty for this free software. For both users' and authors' sake, the GPL
|
||||||
|
requires that modified versions be marked as changed, so that their problems will not
|
||||||
|
be attributed erroneously to authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run modified versions of
|
||||||
|
the software inside them, although the manufacturer can do so. This is fundamentally
|
||||||
|
incompatible with the aim of protecting users' freedom to change the software. The
|
||||||
|
systematic pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we have designed
|
||||||
|
this version of the GPL to prohibit the practice for those products. If such problems
|
||||||
|
arise substantially in other domains, we stand ready to extend this provision to
|
||||||
|
those domains in future versions of the GPL, as needed to protect the freedom of
|
||||||
|
users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents. States should
|
||||||
|
not allow patents to restrict development and use of software on general-purpose
|
||||||
|
computers, but in those that do, we wish to avoid the special danger that patents
|
||||||
|
applied to a free program could make it effectively proprietary. To prevent this, the
|
||||||
|
GPL assures that patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and modification follow.
|
||||||
|
|
||||||
|
## TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
### 0. Definitions
|
||||||
|
|
||||||
|
“This License” refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
“Copyright” also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
“The Program” refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as “you”. “Licensees” and
|
||||||
|
“recipients” may be individuals or organizations.
|
||||||
|
|
||||||
|
To “modify” a work means to copy from or adapt all or part of the work in
|
||||||
|
a fashion requiring copyright permission, other than the making of an exact copy. The
|
||||||
|
resulting work is called a “modified version” of the earlier work or a
|
||||||
|
work “based on” the earlier work.
|
||||||
|
|
||||||
|
A “covered work” means either the unmodified Program or a work based on
|
||||||
|
the Program.
|
||||||
|
|
||||||
|
To “propagate” a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for infringement under
|
||||||
|
applicable copyright law, except executing it on a computer or modifying a private
|
||||||
|
copy. Propagation includes copying, distribution (with or without modification),
|
||||||
|
making available to the public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To “convey” a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through a computer
|
||||||
|
network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays “Appropriate Legal Notices” to the
|
||||||
|
extent that it includes a convenient and prominently visible feature that **(1)**
|
||||||
|
displays an appropriate copyright notice, and **(2)** tells the user that there is no
|
||||||
|
warranty for the work (except to the extent that warranties are provided), that
|
||||||
|
licensees may convey the work under this License, and how to view a copy of this
|
||||||
|
License. If the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
### 1. Source Code
|
||||||
|
|
||||||
|
The “source code” for a work means the preferred form of the work for
|
||||||
|
making modifications to it. “Object code” means any non-source form of a
|
||||||
|
work.
|
||||||
|
|
||||||
|
A “Standard Interface” means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of interfaces
|
||||||
|
specified for a particular programming language, one that is widely used among
|
||||||
|
developers working in that language.
|
||||||
|
|
||||||
|
The “System Libraries” of an executable work include anything, other than
|
||||||
|
the work as a whole, that **(a)** is included in the normal form of packaging a Major
|
||||||
|
Component, but which is not part of that Major Component, and **(b)** serves only to
|
||||||
|
enable use of the work with that Major Component, or to implement a Standard
|
||||||
|
Interface for which an implementation is available to the public in source code form.
|
||||||
|
A “Major Component”, in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system (if any) on which
|
||||||
|
the executable work runs, or a compiler used to produce the work, or an object code
|
||||||
|
interpreter used to run it.
|
||||||
|
|
||||||
|
The “Corresponding Source” for a work in object code form means all the
|
||||||
|
source code needed to generate, install, and (for an executable work) run the object
|
||||||
|
code and to modify the work, including scripts to control those activities. However,
|
||||||
|
it does not include the work's System Libraries, or general-purpose tools or
|
||||||
|
generally available free programs which are used unmodified in performing those
|
||||||
|
activities but which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for the work, and
|
||||||
|
the source code for shared libraries and dynamically linked subprograms that the work
|
||||||
|
is specifically designed to require, such as by intimate data communication or
|
||||||
|
control flow between those subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users can regenerate
|
||||||
|
automatically from other parts of the Corresponding Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that same work.
|
||||||
|
|
||||||
|
### 2. Basic Permissions
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of copyright on the
|
||||||
|
Program, and are irrevocable provided the stated conditions are met. This License
|
||||||
|
explicitly affirms your unlimited permission to run the unmodified Program. The
|
||||||
|
output from running a covered work is covered by this License only if the output,
|
||||||
|
given its content, constitutes a covered work. This License acknowledges your rights
|
||||||
|
of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not convey, without
|
||||||
|
conditions so long as your license otherwise remains in force. You may convey covered
|
||||||
|
works to others for the sole purpose of having them make modifications exclusively
|
||||||
|
for you, or provide you with facilities for running those works, provided that you
|
||||||
|
comply with the terms of this License in conveying all material for which you do not
|
||||||
|
control copyright. Those thus making or running the covered works for you must do so
|
||||||
|
exclusively on your behalf, under your direction and control, on terms that prohibit
|
||||||
|
them from making any copies of your copyrighted material outside their relationship
|
||||||
|
with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under the conditions
|
||||||
|
stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||||
|
|
||||||
|
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological measure under any
|
||||||
|
applicable law fulfilling obligations under article 11 of the WIPO copyright treaty
|
||||||
|
adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention
|
||||||
|
of such measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid circumvention of
|
||||||
|
technological measures to the extent such circumvention is effected by exercising
|
||||||
|
rights under this License with respect to the covered work, and you disclaim any
|
||||||
|
intention to limit operation or modification of the work as a means of enforcing,
|
||||||
|
against the work's users, your or third parties' legal rights to forbid circumvention
|
||||||
|
of technological measures.
|
||||||
|
|
||||||
|
### 4. Conveying Verbatim Copies
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you receive it, in any
|
||||||
|
medium, provided that you conspicuously and appropriately publish on each copy an
|
||||||
|
appropriate copyright notice; keep intact all notices stating that this License and
|
||||||
|
any non-permissive terms added in accord with section 7 apply to the code; keep
|
||||||
|
intact all notices of the absence of any warranty; and give all recipients a copy of
|
||||||
|
this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey, and you may offer
|
||||||
|
support or warranty protection for a fee.
|
||||||
|
|
||||||
|
### 5. Conveying Modified Source Versions
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to produce it from
|
||||||
|
the Program, in the form of source code under the terms of section 4, provided that
|
||||||
|
you also meet all of these conditions:
|
||||||
|
|
||||||
|
* **a)** The work must carry prominent notices stating that you modified it, and giving a
|
||||||
|
relevant date.
|
||||||
|
* **b)** The work must carry prominent notices stating that it is released under this
|
||||||
|
License and any conditions added under section 7. This requirement modifies the
|
||||||
|
requirement in section 4 to “keep intact all notices”.
|
||||||
|
* **c)** You must license the entire work, as a whole, under this License to anyone who
|
||||||
|
comes into possession of a copy. This License will therefore apply, along with any
|
||||||
|
applicable section 7 additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no permission to license the
|
||||||
|
work in any other way, but it does not invalidate such permission if you have
|
||||||
|
separately received it.
|
||||||
|
* **d)** If the work has interactive user interfaces, each must display Appropriate Legal
|
||||||
|
Notices; however, if the Program has interactive interfaces that do not display
|
||||||
|
Appropriate Legal Notices, your work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent works, which are
|
||||||
|
not by their nature extensions of the covered work, and which are not combined with
|
||||||
|
it such as to form a larger program, in or on a volume of a storage or distribution
|
||||||
|
medium, is called an “aggregate” if the compilation and its resulting
|
||||||
|
copyright are not used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work in an aggregate
|
||||||
|
does not cause this License to apply to the other parts of the aggregate.
|
||||||
|
|
||||||
|
### 6. Conveying Non-Source Forms
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms of sections 4 and
|
||||||
|
5, provided that you also convey the machine-readable Corresponding Source under the
|
||||||
|
terms of this License, in one of these ways:
|
||||||
|
|
||||||
|
* **a)** Convey the object code in, or embodied in, a physical product (including a
|
||||||
|
physical distribution medium), accompanied by the Corresponding Source fixed on a
|
||||||
|
durable physical medium customarily used for software interchange.
|
||||||
|
* **b)** Convey the object code in, or embodied in, a physical product (including a
|
||||||
|
physical distribution medium), accompanied by a written offer, valid for at least
|
||||||
|
three years and valid for as long as you offer spare parts or customer support for
|
||||||
|
that product model, to give anyone who possesses the object code either **(1)** a copy of
|
||||||
|
the Corresponding Source for all the software in the product that is covered by this
|
||||||
|
License, on a durable physical medium customarily used for software interchange, for
|
||||||
|
a price no more than your reasonable cost of physically performing this conveying of
|
||||||
|
source, or **(2)** access to copy the Corresponding Source from a network server at no
|
||||||
|
charge.
|
||||||
|
* **c)** Convey individual copies of the object code with a copy of the written offer to
|
||||||
|
provide the Corresponding Source. This alternative is allowed only occasionally and
|
||||||
|
noncommercially, and only if you received the object code with such an offer, in
|
||||||
|
accord with subsection 6b.
|
||||||
|
* **d)** Convey the object code by offering access from a designated place (gratis or for
|
||||||
|
a charge), and offer equivalent access to the Corresponding Source in the same way
|
||||||
|
through the same place at no further charge. You need not require recipients to copy
|
||||||
|
the Corresponding Source along with the object code. If the place to copy the object
|
||||||
|
code is a network server, the Corresponding Source may be on a different server
|
||||||
|
(operated by you or a third party) that supports equivalent copying facilities,
|
||||||
|
provided you maintain clear directions next to the object code saying where to find
|
||||||
|
the Corresponding Source. Regardless of what server hosts the Corresponding Source,
|
||||||
|
you remain obligated to ensure that it is available for as long as needed to satisfy
|
||||||
|
these requirements.
|
||||||
|
* **e)** Convey the object code using peer-to-peer transmission, provided you inform
|
||||||
|
other peers where the object code and Corresponding Source of the work are being
|
||||||
|
offered to the general public at no charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded from the
|
||||||
|
Corresponding Source as a System Library, need not be included in conveying the
|
||||||
|
object code work.
|
||||||
|
|
||||||
|
A “User Product” is either **(1)** a “consumer product”, which
|
||||||
|
means any tangible personal property which is normally used for personal, family, or
|
||||||
|
household purposes, or **(2)** anything designed or sold for incorporation into a
|
||||||
|
dwelling. In determining whether a product is a consumer product, doubtful cases
|
||||||
|
shall be resolved in favor of coverage. For a particular product received by a
|
||||||
|
particular user, “normally used” refers to a typical or common use of
|
||||||
|
that class of product, regardless of the status of the particular user or of the way
|
||||||
|
in which the particular user actually uses, or expects or is expected to use, the
|
||||||
|
product. A product is a consumer product regardless of whether the product has
|
||||||
|
substantial commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
“Installation Information” for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install and execute
|
||||||
|
modified versions of a covered work in that User Product from a modified version of
|
||||||
|
its Corresponding Source. The information must suffice to ensure that the continued
|
||||||
|
functioning of the modified object code is in no case prevented or interfered with
|
||||||
|
solely because modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or specifically for
|
||||||
|
use in, a User Product, and the conveying occurs as part of a transaction in which
|
||||||
|
the right of possession and use of the User Product is transferred to the recipient
|
||||||
|
in perpetuity or for a fixed term (regardless of how the transaction is
|
||||||
|
characterized), the Corresponding Source conveyed under this section must be
|
||||||
|
accompanied by the Installation Information. But this requirement does not apply if
|
||||||
|
neither you nor any third party retains the ability to install modified object code
|
||||||
|
on the User Product (for example, the work has been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a requirement to
|
||||||
|
continue to provide support service, warranty, or updates for a work that has been
|
||||||
|
modified or installed by the recipient, or for the User Product in which it has been
|
||||||
|
modified or installed. Access to a network may be denied when the modification itself
|
||||||
|
materially and adversely affects the operation of the network or violates the rules
|
||||||
|
and protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided, in accord with
|
||||||
|
this section must be in a format that is publicly documented (and with an
|
||||||
|
implementation available to the public in source code form), and must require no
|
||||||
|
special password or key for unpacking, reading or copying.
|
||||||
|
|
||||||
|
### 7. Additional Terms
|
||||||
|
|
||||||
|
“Additional permissions” are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions. Additional
|
||||||
|
permissions that are applicable to the entire Program shall be treated as though they
|
||||||
|
were included in this License, to the extent that they are valid under applicable
|
||||||
|
law. If additional permissions apply only to part of the Program, that part may be
|
||||||
|
used separately under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option remove any
|
||||||
|
additional permissions from that copy, or from any part of it. (Additional
|
||||||
|
permissions may be written to require their own removal in certain cases when you
|
||||||
|
modify the work.) You may place additional permissions on material, added by you to a
|
||||||
|
covered work, for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you add to a
|
||||||
|
covered work, you may (if authorized by the copyright holders of that material)
|
||||||
|
supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
* **a)** Disclaiming warranty or limiting liability differently from the terms of
|
||||||
|
sections 15 and 16 of this License; or
|
||||||
|
* **b)** Requiring preservation of specified reasonable legal notices or author
|
||||||
|
attributions in that material or in the Appropriate Legal Notices displayed by works
|
||||||
|
containing it; or
|
||||||
|
* **c)** Prohibiting misrepresentation of the origin of that material, or requiring that
|
||||||
|
modified versions of such material be marked in reasonable ways as different from the
|
||||||
|
original version; or
|
||||||
|
* **d)** Limiting the use for publicity purposes of names of licensors or authors of the
|
||||||
|
material; or
|
||||||
|
* **e)** Declining to grant rights under trademark law for use of some trade names,
|
||||||
|
trademarks, or service marks; or
|
||||||
|
* **f)** Requiring indemnification of licensors and authors of that material by anyone
|
||||||
|
who conveys the material (or modified versions of it) with contractual assumptions of
|
||||||
|
liability to the recipient, for any liability that these contractual assumptions
|
||||||
|
directly impose on those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered “further
|
||||||
|
restrictions” within the meaning of section 10. If the Program as you received
|
||||||
|
it, or any part of it, contains a notice stating that it is governed by this License
|
||||||
|
along with a term that is a further restriction, you may remove that term. If a
|
||||||
|
license document contains a further restriction but permits relicensing or conveying
|
||||||
|
under this License, you may add to a covered work material governed by the terms of
|
||||||
|
that license document, provided that the further restriction does not survive such
|
||||||
|
relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you must place, in
|
||||||
|
the relevant source files, a statement of the additional terms that apply to those
|
||||||
|
files, or a notice indicating where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the form of a
|
||||||
|
separately written license, or stated as exceptions; the above requirements apply
|
||||||
|
either way.
|
||||||
|
|
||||||
|
### 8. Termination
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly provided under
|
||||||
|
this License. Any attempt otherwise to propagate or modify it is void, and will
|
||||||
|
automatically terminate your rights under this License (including any patent licenses
|
||||||
|
granted under the third paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your license from a
|
||||||
|
particular copyright holder is reinstated **(a)** provisionally, unless and until the
|
||||||
|
copyright holder explicitly and finally terminates your license, and **(b)** permanently,
|
||||||
|
if the copyright holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is reinstated permanently
|
||||||
|
if the copyright holder notifies you of the violation by some reasonable means, this
|
||||||
|
is the first time you have received notice of violation of this License (for any
|
||||||
|
work) from that copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the licenses of
|
||||||
|
parties who have received copies or rights from you under this License. If your
|
||||||
|
rights have been terminated and not permanently reinstated, you do not qualify to
|
||||||
|
receive new licenses for the same material under section 10.
|
||||||
|
|
||||||
|
### 9. Acceptance Not Required for Having Copies
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or run a copy of the
|
||||||
|
Program. Ancillary propagation of a covered work occurring solely as a consequence of
|
||||||
|
using peer-to-peer transmission to receive a copy likewise does not require
|
||||||
|
acceptance. However, nothing other than this License grants you permission to
|
||||||
|
propagate or modify any covered work. These actions infringe copyright if you do not
|
||||||
|
accept this License. Therefore, by modifying or propagating a covered work, you
|
||||||
|
indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
### 10. Automatic Licensing of Downstream Recipients
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically receives a license
|
||||||
|
from the original licensors, to run, modify and propagate that work, subject to this
|
||||||
|
License. You are not responsible for enforcing compliance by third parties with this
|
||||||
|
License.
|
||||||
|
|
||||||
|
An “entity transaction” is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an organization, or
|
||||||
|
merging organizations. If propagation of a covered work results from an entity
|
||||||
|
transaction, each party to that transaction who receives a copy of the work also
|
||||||
|
receives whatever licenses to the work the party's predecessor in interest had or
|
||||||
|
could give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if the predecessor
|
||||||
|
has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the rights granted or
|
||||||
|
affirmed under this License. For example, you may not impose a license fee, royalty,
|
||||||
|
or other charge for exercise of rights granted under this License, and you may not
|
||||||
|
initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging
|
||||||
|
that any patent claim is infringed by making, using, selling, offering for sale, or
|
||||||
|
importing the Program or any portion of it.
|
||||||
|
|
||||||
|
### 11. Patents
|
||||||
|
|
||||||
|
A “contributor” is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The work thus
|
||||||
|
licensed is called the contributor's “contributor version”.
|
||||||
|
|
||||||
|
A contributor's “essential patent claims” are all patent claims owned or
|
||||||
|
controlled by the contributor, whether already acquired or hereafter acquired, that
|
||||||
|
would be infringed by some manner, permitted by this License, of making, using, or
|
||||||
|
selling its contributor version, but do not include claims that would be infringed
|
||||||
|
only as a consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, “control” includes the right to grant patent
|
||||||
|
sublicenses in a manner consistent with the requirements of this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license
|
||||||
|
under the contributor's essential patent claims, to make, use, sell, offer for sale,
|
||||||
|
import and otherwise run, modify and propagate the contents of its contributor
|
||||||
|
version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a “patent license” is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent (such as an
|
||||||
|
express permission to practice a patent or covenant not to sue for patent
|
||||||
|
infringement). To “grant” such a patent license to a party means to make
|
||||||
|
such an agreement or commitment not to enforce a patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license, and the
|
||||||
|
Corresponding Source of the work is not available for anyone to copy, free of charge
|
||||||
|
and under the terms of this License, through a publicly available network server or
|
||||||
|
other readily accessible means, then you must either **(1)** cause the Corresponding
|
||||||
|
Source to be so available, or **(2)** arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or **(3)** arrange, in a manner consistent with
|
||||||
|
the requirements of this License, to extend the patent license to downstream
|
||||||
|
recipients. “Knowingly relying” means you have actual knowledge that, but
|
||||||
|
for the patent license, your conveying the covered work in a country, or your
|
||||||
|
recipient's use of the covered work in a country, would infringe one or more
|
||||||
|
identifiable patents in that country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or arrangement, you
|
||||||
|
convey, or propagate by procuring conveyance of, a covered work, and grant a patent
|
||||||
|
license to some of the parties receiving the covered work authorizing them to use,
|
||||||
|
propagate, modify or convey a specific copy of the covered work, then the patent
|
||||||
|
license you grant is automatically extended to all recipients of the covered work and
|
||||||
|
works based on it.
|
||||||
|
|
||||||
|
A patent license is “discriminatory” if it does not include within the
|
||||||
|
scope of its coverage, prohibits the exercise of, or is conditioned on the
|
||||||
|
non-exercise of one or more of the rights that are specifically granted under this
|
||||||
|
License. You may not convey a covered work if you are a party to an arrangement with
|
||||||
|
a third party that is in the business of distributing software, under which you make
|
||||||
|
payment to the third party based on the extent of your activity of conveying the
|
||||||
|
work, and under which the third party grants, to any of the parties who would receive
|
||||||
|
the covered work from you, a discriminatory patent license **(a)** in connection with
|
||||||
|
copies of the covered work conveyed by you (or copies made from those copies), or **(b)**
|
||||||
|
primarily for and in connection with specific products or compilations that contain
|
||||||
|
the covered work, unless you entered into that arrangement, or that patent license
|
||||||
|
was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting any implied
|
||||||
|
license or other defenses to infringement that may otherwise be available to you
|
||||||
|
under applicable patent law.
|
||||||
|
|
||||||
|
### 12. No Surrender of Others' Freedom
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or otherwise)
|
||||||
|
that contradict the conditions of this License, they do not excuse you from the
|
||||||
|
conditions of this License. If you cannot convey a covered work so as to satisfy
|
||||||
|
simultaneously your obligations under this License and any other pertinent
|
||||||
|
obligations, then as a consequence you may not convey it at all. For example, if you
|
||||||
|
agree to terms that obligate you to collect a royalty for further conveying from
|
||||||
|
those to whom you convey the Program, the only way you could satisfy both those terms
|
||||||
|
and this License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
### 13. Use with the GNU Affero General Public License
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have permission to link or
|
||||||
|
combine any covered work with a work licensed under version 3 of the GNU Affero
|
||||||
|
General Public License into a single combined work, and to convey the resulting work.
|
||||||
|
The terms of this License will continue to apply to the part which is the covered
|
||||||
|
work, but the special requirements of the GNU Affero General Public License, section
|
||||||
|
13, concerning interaction through a network will apply to the combination as such.
|
||||||
|
|
||||||
|
### 14. Revised Versions of this License
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of the GNU
|
||||||
|
General Public License from time to time. Such new versions will be similar in spirit
|
||||||
|
to the present version, but may differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program specifies that
|
||||||
|
a certain numbered version of the GNU General Public License “or any later
|
||||||
|
version” applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that numbered version or of any later version published by the
|
||||||
|
Free Software Foundation. If the Program does not specify a version number of the GNU
|
||||||
|
General Public License, you may choose any version ever published by the Free
|
||||||
|
Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future versions of the GNU
|
||||||
|
General Public License can be used, that proxy's public statement of acceptance of a
|
||||||
|
version permanently authorizes you to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different permissions. However, no
|
||||||
|
additional obligations are imposed on any author or copyright holder as a result of
|
||||||
|
your choosing to follow a later version.
|
||||||
|
|
||||||
|
### 15. Disclaimer of Warranty
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||||
|
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
|
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
|
||||||
|
QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||||
|
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
### 16. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
|
||||||
|
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
|
||||||
|
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
|
||||||
|
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||||
|
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE
|
||||||
|
OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
|
||||||
|
WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
### 17. Interpretation of Sections 15 and 16
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided above cannot be
|
||||||
|
given local legal effect according to their terms, reviewing courts shall apply local
|
||||||
|
law that most closely approximates an absolute waiver of all civil liability in
|
||||||
|
connection with the Program, unless a warranty or assumption of liability accompanies
|
||||||
|
a copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
_END OF TERMS AND CONDITIONS_
|
||||||
|
|
||||||
|
## How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest possible use to
|
||||||
|
the public, the best way to achieve this is to make it free software which everyone
|
||||||
|
can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest to attach them
|
||||||
|
to the start of each source file to most effectively state the exclusion of warranty;
|
||||||
|
and each file should have at least the “copyright” line and a pointer to
|
||||||
|
where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type 'show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w` and `show c` should show the appropriate parts of
|
||||||
|
the General Public License. Of course, your program's commands might be different;
|
||||||
|
for a GUI interface, you would use an “about box”.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school, if any, to
|
||||||
|
sign a “copyright disclaimer” for the program, if necessary. For more
|
||||||
|
information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<<http://www.gnu.org/licenses/>>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may consider it
|
||||||
|
more useful to permit linking proprietary applications with the library. If this is
|
||||||
|
what you want to do, use the GNU Lesser General Public License instead of this
|
||||||
|
License. But first, please read
|
||||||
|
<<http://www.gnu.org/philosophy/why-not-lgpl.html>>.
|
||||||
7
MANIFEST.in
Normal file
7
MANIFEST.in
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
include Cargo.toml Cargo.lock rust-toolchain.toml README.md LICENSE.md
|
||||||
|
recursive-include src *.rs
|
||||||
|
recursive-include pheon *.py *.h py.typed
|
||||||
|
recursive-include tests *.rs *.py *.json *.txt *.mmd
|
||||||
|
recursive-include docs *.md *.json
|
||||||
|
recursive-include contrib *
|
||||||
|
recursive-include tools *.py
|
||||||
67
README.md
Normal file
67
README.md
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
# Pheon
|
||||||
|
|
||||||
|
Pheon reads GDSII layouts into Apache Arrow and provides command-line tools for
|
||||||
|
inspecting and comparing layout revisions. It is written in Rust, with Python
|
||||||
|
bindings and a C API.
|
||||||
|
|
||||||
|
- Inspect cells, records, and reference hierarchies.
|
||||||
|
- Compare layout objects, with text or JSON reports and Git integration.
|
||||||
|
- Read geometry into Arrow, or scan the hierarchy before loading selected cells.
|
||||||
|
|
||||||
|
Comparisons ignore timestamps and element order while preserving duplicates and
|
||||||
|
other object details. They compare object fields and coordinates exactly; see the
|
||||||
|
[comparison rules][comparison] for supported normalization and limits.
|
||||||
|
|
||||||
|
## Try the command-line tools
|
||||||
|
|
||||||
|
Install the CLI [from crates.io][crate] with Rust 1.88 or newer.
|
||||||
|
Use your own GDSII paths in the examples.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo install pheon --locked
|
||||||
|
pheon dump chip.gds
|
||||||
|
pheon diff before.gds after.gds
|
||||||
|
pheon hierarchy chip.gds --format mermaid
|
||||||
|
```
|
||||||
|
|
||||||
|
`diff` returns 0 for equality, 1 for differences, and 2 for invalid or incomplete
|
||||||
|
comparisons. Start with the [CLI guide][cli], then set up
|
||||||
|
[Git integration][git] if you review layouts in a repository.
|
||||||
|
|
||||||
|
## Read layouts in Python
|
||||||
|
|
||||||
|
Install the Python package [from PyPI][pypi] with Python 3.11 or newer.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python -m pip install pheon
|
||||||
|
```
|
||||||
|
|
||||||
|
Run this example from a directory containing `chip.gds`.
|
||||||
|
|
||||||
|
```python
|
||||||
|
from pheon import arrow
|
||||||
|
|
||||||
|
layout = arrow.read_path("chip.gds")
|
||||||
|
print(layout.field("lib_name")[0].as_py())
|
||||||
|
```
|
||||||
|
|
||||||
|
The Python package installs PyArrow. See the [Python guide][python] for source
|
||||||
|
installs and selected reads, and the [Arrow reference][arrow] for the returned data.
|
||||||
|
|
||||||
|
## Learn more
|
||||||
|
|
||||||
|
Browse the [documentation][docs] for layer names, native integration,
|
||||||
|
JSON reports, development, and releases. For writing, Pheon provides low-level
|
||||||
|
GDSII record helpers in Rust.
|
||||||
|
|
||||||
|
Licensed under [GPL-3.0-only][license].
|
||||||
|
|
||||||
|
[arrow]: https://mpxd.net/code/jan/pheon/src/branch/master/docs/arrow-schema.md
|
||||||
|
[cli]: https://mpxd.net/code/jan/pheon/src/branch/master/docs/cli.md
|
||||||
|
[comparison]: https://mpxd.net/code/jan/pheon/src/branch/master/docs/comparison.md
|
||||||
|
[crate]: https://crates.io/crates/pheon
|
||||||
|
[docs]: https://mpxd.net/code/jan/pheon/src/branch/master/docs/index.md
|
||||||
|
[git]: https://mpxd.net/code/jan/pheon/src/branch/master/docs/git.md
|
||||||
|
[license]: https://mpxd.net/code/jan/pheon/src/branch/master/LICENSE.md
|
||||||
|
[pypi]: https://pypi.org/project/pheon/
|
||||||
|
[python]: https://mpxd.net/code/jan/pheon/src/branch/master/docs/python.md
|
||||||
71
contrib/gds-corpus.toml
Normal file
71
contrib/gds-corpus.toml
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
# Pinned GDSII test inputs. Each digest covers the original upstream bytes.
|
||||||
|
|
||||||
|
[gdstk]
|
||||||
|
repo = "heitzmann/gdstk"
|
||||||
|
revision = "1099be134da34d4afd9e5fb1f4f0dbae9ef4c17a"
|
||||||
|
license = "BSL-1.0"
|
||||||
|
license_sha256 = "beb8e42e9d6b4284e03304d05a81a0755200a965fc8d0a5e0aea1e84cf805d6e"
|
||||||
|
|
||||||
|
[gdstk.layouts]
|
||||||
|
"tests/proof_lib.gds" = "af7b95ed191ebe32438c0f0cb5ed824ba2a98673cfa9ce6f1a9ff5a827c3dbf7"
|
||||||
|
|
||||||
|
[gdsfactory]
|
||||||
|
repo = "gdsfactory/gdsfactory"
|
||||||
|
revision = "7407836dd5d872c704fc06f38562a2ffc88049dc"
|
||||||
|
license = "MIT"
|
||||||
|
license_sha256 = "cdace89991b496bd052909790d00ece97feab566afd964d0883d2c0605462b5b"
|
||||||
|
|
||||||
|
[gdsfactory.layouts]
|
||||||
|
"tests/gds/alphabet_3top_cells.gds" = "09b75d5bfeb0051e4972a4d9fc26df5d342604f7ed2a0994376cd7c77e929019"
|
||||||
|
"tests/gds/big_rect.gds" = "de71342365dc4bd84dbb03307537b7ca2b4dffab98efdf88713cc451e44e6ac2"
|
||||||
|
"tests/gds/mmi1x2.gds" = "e12e81a9d5b9dc8463cce05915f567bc7174f848a52c7e092dc8a602819dafa0"
|
||||||
|
"tests/gds/mzi2x2.gds" = "49499f13c888de137eb26342c45ea379d9ea2ecd82fc990780d38fa014002d38"
|
||||||
|
"tests/gds/small_rect.gds" = "345480096d17bc724ae32cc0f42bd915a39c6e64806b43054d687755afd5faba"
|
||||||
|
"tests/gds/straight.gds" = "dc5e971b5be91864895870ef70a5ae959bd52dab5971caa0dcfc9aa6e13fa40d"
|
||||||
|
|
||||||
|
[klayout]
|
||||||
|
repo = "KLayout/klayout"
|
||||||
|
revision = "53911acd6dfaa113c188d11d20b2ae290aa60a6b"
|
||||||
|
license = "GPL-3.0 (upstream LICENSE)"
|
||||||
|
license_sha256 = "589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2"
|
||||||
|
|
||||||
|
[klayout.layouts]
|
||||||
|
"samples/lvs/ringo.gds" = "f24d4d11ac7941021d0b0c15d8b32ced1c6735cbd4da68de1482830ca45be3bd"
|
||||||
|
"testdata/drc/texts.gds" = "ee8ddf7de65ebccf9772fd98cb5d45313e353f8a3455d162611320885061f907"
|
||||||
|
"testdata/algo/deep_texts_l1.gds" = "253d24491a097102a729ef7f101c9b7acf7684c4a90c16d212ac91d9087e3b4d"
|
||||||
|
"testdata/gds/arefs.gds" = "fadde330ade22d0e8b92e4040377dcccb6e7a572d9d69df6b3fa722a2bfbcdcd"
|
||||||
|
"testdata/gds/arefs_skew.gds" = "a681a47cd1d2d74b881d0ab10c3d6fd6c9674c819cf39c077936a4328511b1ae"
|
||||||
|
"testdata/gds/arefs_skew2.gds" = "363dd2650b4a3011cbe33a6d8febccc77b22dd9b7563f087029a1c5afbe2ae94"
|
||||||
|
"testdata/gds/basic_instances.gds" = "6ccfffd590c159a5ab450c8eed826afb8e1d68c9ae2f85ec089ab21c0b40ec1b"
|
||||||
|
"testdata/gds/issue-1353.gds" = "f0e9cbe2b0582d766b3e6e1737617865ca5e74dc525f7bc2872e09ffe6a82482"
|
||||||
|
"testdata/gds/issue_1835.gds" = "b2d78e8ed4f43e63738857c7aa81606c8ccc5ca0910e3d4e4569c058415d9171"
|
||||||
|
"testdata/gds/issue_893.gds" = "30a2bf58ea8ae5b36f6df67c5d5221bc257e916b985bc1e7a74cf19ba244eff8"
|
||||||
|
"testdata/gds/issue_893_au.gds" = "e33cbc5ae2a3f3e9779f6c1cbaf89762c33644c76836c96445e887820dd4eab6"
|
||||||
|
"testdata/gds/t166_au.gds.gz" = "bd5f0eda73cf13daae77d61eb2a2d9376f2752e66cd458307cfee0e4d5b5ea57"
|
||||||
|
|
||||||
|
[sky130]
|
||||||
|
repo = "google/skywater-pdk-libs-sky130_fd_sc_hd"
|
||||||
|
revision = "ac7fb61f06e6470b94e8afdf7c25268f62fbd7b1"
|
||||||
|
license = "Apache-2.0"
|
||||||
|
license_sha256 = "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
|
||||||
|
|
||||||
|
[sky130.layouts]
|
||||||
|
"cells/inv/sky130_fd_sc_hd__inv_1.gds" = "18a9cfa399957c7c7b5fc75175e03fc921d56ecc6b8de8fae34ba301bb7914c4"
|
||||||
|
"cells/inv/sky130_fd_sc_hd__inv_4.gds" = "1e0fb091a3e4583297e7124d68542e4f29ee6d1f711e80dcb41fc1ed8465c0ce"
|
||||||
|
"cells/nand2/sky130_fd_sc_hd__nand2_1.gds" = "4e7fa6255df901f59151791d6e8ff4c421b63c1ea3822d6d5d25b48221782a3a"
|
||||||
|
"cells/dfxtp/sky130_fd_sc_hd__dfxtp_1.gds" = "2b0eaaeedd5b7b2c359942098aee0cef69387108e02e10bc09940680e4cc7ec3"
|
||||||
|
"cells/tapvpwrvgnd/sky130_fd_sc_hd__tapvpwrvgnd_1.gds" = "642f8841345c7c09ec910fe7893ae803ab760606adfab65229e2aedb055005a5"
|
||||||
|
"cells/fill/sky130_fd_sc_hd__fill_1.gds" = "9f718b6252a027fc769c2e4298c182e1c4ee3b160fefcd6acf7d947d5c6c3453"
|
||||||
|
|
||||||
|
[ihp]
|
||||||
|
repo = "IHP-GmbH/IHP-Open-PDK"
|
||||||
|
revision = "e73adb4045731ddec21634146d536380057f6a26"
|
||||||
|
license = "Apache-2.0"
|
||||||
|
license_sha256 = "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4"
|
||||||
|
|
||||||
|
[ihp.layouts]
|
||||||
|
"ihp-sg13g2/libs.ref/sg13g2_pr/gds/sg13g2_pr.gds" = "3c640413b455354da11ec4db01c25f165489bcfd4cdec0f79559a9f78331ab42"
|
||||||
|
"ihp-sg13g2/libs.ref/sg13g2_stdcell/gds/sg13g2_stdcell.gds" = "ab9f2802c78935d4463093c24860f9d3f244057a839179fb19fc0243a18cf3f4"
|
||||||
|
"ihp-sg13g2/libs.ref/sg13g2_sram/gds/RM_IHPSG13_1P_1024x16_c2_bm_bist.gds" = "1ed0af3f9cc3a3455f4c0beb08394502a875dda3c54bc03123357e397b26e929"
|
||||||
|
"ihp-sg13g2/libs.qa/drc/devices/sg13g2_qacells.gds" = "21d8b2663ba15fa4c99752ad7a030f486043ba17950236bee8dc483e64c948b2"
|
||||||
|
"ihp-sg13g2/libs.qa/drc/special/sg13g2_stdcell_abutment.gds" = "e125bd8e6bf8976f41bf29fb761c28559064b50571289da98c148684676e1728"
|
||||||
5
contrib/git/attributes
Normal file
5
contrib/git/attributes
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Add these lines to the layout repository's .gitattributes.
|
||||||
|
*.gds diff=pheon
|
||||||
|
|
||||||
|
# For canonical textconv instead, replace the line above with:
|
||||||
|
# *.gds diff=pheon-text
|
||||||
10
contrib/git/config
Normal file
10
contrib/git/config
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Include this file from Git config after installing pheon on PATH.
|
||||||
|
[diff "pheon"]
|
||||||
|
command = pheon git-diff --hierarchy ascii --
|
||||||
|
binary = true
|
||||||
|
trustExitCode = false
|
||||||
|
|
||||||
|
[diff "pheon-text"]
|
||||||
|
textconv = pheon dump
|
||||||
|
binary = true
|
||||||
|
cachetextconv = true
|
||||||
1
contrib/wheels/manylinux-image.txt
Normal file
1
contrib/wheels/manylinux-image.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
quay.io/pypa/manylinux_2_28_x86_64@sha256:e0adf18521ad35192df733a6c62d35df7801957d24e0470238aacecfab2188a3
|
||||||
133
docs/arrow-schema.md
Normal file
133
docs/arrow-schema.md
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
# Arrow layout reference
|
||||||
|
|
||||||
|
This reference is for consumers of Pheon's Arrow readers. Each result is a
|
||||||
|
one-row `StructArray` representing a GDSII library. The
|
||||||
|
[Python guide](python.md) shows how to obtain and access it.
|
||||||
|
|
||||||
|
Geometry fields named `layer` are **indices into the result's `layers` table**.
|
||||||
|
Reference `target` and cell `id` values index its `cell_names` table. Resolve IDs
|
||||||
|
using tables from the same result; a selected read can assign different IDs.
|
||||||
|
|
||||||
|
`pheon_arrow_schema_version()` currently returns 1 for all layouts below.
|
||||||
|
Consumers of the [C API](native-api.md) must check both this application schema
|
||||||
|
version and the separate C API version.
|
||||||
|
|
||||||
|
## Full library
|
||||||
|
|
||||||
|
| Field | Arrow type | Meaning |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `meters_per_db_unit` | Float64 | Database unit size in meters. |
|
||||||
|
| `user_units_per_db_unit` | Float64 | User units per database unit. |
|
||||||
|
| `lib_name` | Utf8 | Library name. |
|
||||||
|
| `mod_time`, `acc_time` | FixedSizeList(Int16, 6) | Modification/access time: year, month, day, hour, minute, second. |
|
||||||
|
| `cells` | List(Cell) | Cell records. |
|
||||||
|
| `cell_names` | List(Utf8) | Names indexed by cell ID, including targets without cell definitions. |
|
||||||
|
| `layers` | List(UInt32) | Packed layer/type pairs indexed by layer ID. |
|
||||||
|
|
||||||
|
### Cell
|
||||||
|
|
||||||
|
| Field | Arrow type | Meaning |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `id` | UInt32 | Index into `cell_names`. |
|
||||||
|
| `file_offset` | UInt64 | Byte offset immediately after STRNAME, before the first element or ENDSTR. |
|
||||||
|
| `srefs`, `arefs` | List(SRef), List(ARef) | References without properties. |
|
||||||
|
| `sref_props`, `aref_props` | List(SRefProp), List(ARefProp) | References with properties. |
|
||||||
|
| `rect_batches` | List(RectBatch) | Optimized rectangular boundaries. |
|
||||||
|
| `boundary_batches` | List(BoundaryBatch) | Other boundaries without properties. |
|
||||||
|
| `boundary_props` | List(BoundaryProp) | Boundaries with properties. |
|
||||||
|
| `paths` | List(Path) | Paths. |
|
||||||
|
| `nodes`, `boxes` | List(BoxNode) | Node and box elements. |
|
||||||
|
| `texts` | List(Text) | Text labels. |
|
||||||
|
|
||||||
|
## Hierarchy scan and selected reads
|
||||||
|
|
||||||
|
Scans return the same metadata and `cell_names`, omit `layers`, and replace
|
||||||
|
`cells` with these records:
|
||||||
|
|
||||||
|
| Field | Arrow type | Meaning |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `id` | UInt32 | Index into this result's `cell_names`. |
|
||||||
|
| `struct_start_offset` | UInt64 | Inclusive offset of BGNSTR. |
|
||||||
|
| `struct_end_offset` | UInt64 | Exclusive offset after ENDSTR. |
|
||||||
|
| `refs` | List(ScanRef) | References sorted by target ID, with properties omitted. |
|
||||||
|
|
||||||
|
ScanRef has ARef's fields below. An SREF uses zero basis vectors and counts
|
||||||
|
`(1, 1)`. Geometry and text are skipped without decoding.
|
||||||
|
|
||||||
|
Pass complete half-open cell ranges to `read_selected_library` in Rust or
|
||||||
|
`read_cells_bytes` in Python/C. The result uses the full library layout, with
|
||||||
|
cells in requested order. An empty selection returns metadata and empty lists.
|
||||||
|
Offsets always refer to the original uncompressed input. The Rust selected
|
||||||
|
reader returns the original input slice as its remainder.
|
||||||
|
|
||||||
|
## Packed values
|
||||||
|
|
||||||
|
| Value | Storage | Decoding |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Layer/type pair in `layers` | UInt32 | Layer in high 16 bits; datatype/texttype/boxtype/nodetype in low 16 bits. |
|
||||||
|
| Point or vector | UInt64 | Signed Int32 x in high 32 bits, signed Int32 y in low 32 bits. |
|
||||||
|
| Array counts | UInt32 | Columns in high 16 bits, rows in low 16 bits. |
|
||||||
|
|
||||||
|
Layer halves preserve the original 16-bit patterns; reinterpret them as signed
|
||||||
|
Int16 where an integration uses signed GDS layer values. Array counts originate
|
||||||
|
from positive Int16 values. Flattened coordinate lists below use `[x, y, ...]`
|
||||||
|
in integer database units.
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
| SRef field | Arrow type | Meaning |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `target` | UInt32 | Target cell ID. |
|
||||||
|
| `invert_y` | Boolean | Reflection flag. |
|
||||||
|
| `scale` | Float64 | Magnification. |
|
||||||
|
| `angle_rad` | Float64 | Rotation in radians. |
|
||||||
|
| `xy` | UInt64 | Packed origin. |
|
||||||
|
|
||||||
|
ARef adds `xy0` and `xy1` (UInt64 packed column/row increments) and `counts`
|
||||||
|
(UInt32). SRefProp and ARefProp add `properties: List(Property)`.
|
||||||
|
|
||||||
|
Array increments must be exact signed 32-bit integers. All Arrow readers reject
|
||||||
|
fractional or out-of-range endpoint/count division rather than rounding it.
|
||||||
|
One-placement AREFs can be normalized to SREFs. The review CLI retains original
|
||||||
|
endpoints and distinguishes SREF from AREF independently of this representation.
|
||||||
|
|
||||||
|
## Geometry and text
|
||||||
|
|
||||||
|
Every `layer` below is a UInt32 **table index**, not a packed pair.
|
||||||
|
|
||||||
|
| Type | Fields beyond `layer` |
|
||||||
|
| --- | --- |
|
||||||
|
| RectBatch | `rects: List(Int32)`, flattened `[min_x, min_y, max_x, max_y]` rectangles. |
|
||||||
|
| BoundaryBatch | `vertices: List(Int32)`; `vertex_offsets: List(UInt32)` gives each boundary's start in points, not scalar coordinates. |
|
||||||
|
| BoundaryProp | `vertices: List(Int32)`; `properties: List(Property)`. |
|
||||||
|
| BoxNode | `xy: List(Int32)`; `properties: List(Property)`. |
|
||||||
|
| Path | Fields below. |
|
||||||
|
| Text | Fields below. |
|
||||||
|
|
||||||
|
| Path field | Arrow type | Meaning |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `path_type` | Int16, nullable | Stored path type. |
|
||||||
|
| `extension_start`, `extension_end` | Int32, nullable | End extensions. |
|
||||||
|
| `width` | Int32, nullable | Null when WIDTH is absent. |
|
||||||
|
| `xy` | List(Int32) | Centerline coordinates. |
|
||||||
|
| `properties` | List(Property) | Element properties. |
|
||||||
|
|
||||||
|
| Text field | Arrow type | Meaning |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `presentation_horiz`, `presentation_vert`, `presentation_font` | UInt8, nullable | Presentation attributes. |
|
||||||
|
| `path_type` | Int16, nullable | Stored path type. |
|
||||||
|
| `width` | Int32, nullable | Stored width. |
|
||||||
|
| `invert_y` | Boolean, nullable | Reflection flag. |
|
||||||
|
| `mag` | Float64, nullable | Magnification. |
|
||||||
|
| `angle_deg` | Float64, nullable | Rotation in degrees. |
|
||||||
|
| `xy` | UInt64 | Packed position. |
|
||||||
|
| `string` | Utf8 | Label text. |
|
||||||
|
| `properties` | List(Property) | Element properties. |
|
||||||
|
|
||||||
|
Property contains `key: Int16` and `value: Utf8`. The reader preserves property
|
||||||
|
order and duplicates. Property-list fields are nullable in the schema; the
|
||||||
|
reader normally emits valid lists, including empty ones.
|
||||||
|
|
||||||
|
Geometry batching and reference normalization mean this layout is not a verbatim
|
||||||
|
record stream; use the [CLI's record dump](cli.md#inspect-a-layout) when original
|
||||||
|
records matter.
|
||||||
151
docs/cli.md
Normal file
151
docs/cli.md
Normal file
|
|
@ -0,0 +1,151 @@
|
||||||
|
# Command-line tools
|
||||||
|
|
||||||
|
Use `pheon` to inspect a GDSII file, compare revisions, or trace cell references.
|
||||||
|
The CLI recognizes gzip-compressed GDSII by its file header. Reported byte offsets
|
||||||
|
refer to the decompressed layout. The CLI runs independently of Python.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Install the CLI [from crates.io](https://crates.io/crates/pheon) with Rust 1.88
|
||||||
|
or newer.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo install pheon --locked
|
||||||
|
pheon --help
|
||||||
|
```
|
||||||
|
|
||||||
|
From a source checkout, install with `cargo install --path . --locked --bin pheon`
|
||||||
|
or build with `cargo build --release --locked --bin pheon` and run
|
||||||
|
`target/release/pheon` (`pheon.exe` on Windows).
|
||||||
|
|
||||||
|
## Inspect a layout
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pheon dump chip.gds
|
||||||
|
pheon dump chip.gds --records
|
||||||
|
pheon hierarchy chip.gds --format ascii --depth 4
|
||||||
|
pheon hierarchy chip.gds --format mermaid --top CHIP
|
||||||
|
```
|
||||||
|
|
||||||
|
`dump` lists objects by cell. A prefix such as `3x` counts copies of the same
|
||||||
|
normalized object within a cell. Coordinates are in database units. Rectangles
|
||||||
|
show two corners, and longer vertex lists wrap across lines. References show
|
||||||
|
the target and any array dimensions before the coordinates. Add `--records`
|
||||||
|
to inspect the original record sequence, including timestamps. In color
|
||||||
|
output, the object dump highlights cell headings and layer numbers, and the
|
||||||
|
record dump highlights record names.
|
||||||
|
|
||||||
|
`hierarchy` shows direct placement counts on references. `[subtree elided]`
|
||||||
|
marks a repeated cell whose children were skipped. Repeated leaves show
|
||||||
|
each parent's placement count without the marker. At the depth limit,
|
||||||
|
`[children omitted]` marks a cell with further descendants. Mermaid
|
||||||
|
output is diagram source for a Mermaid renderer.
|
||||||
|
|
||||||
|
## Compare revisions
|
||||||
|
|
||||||
|
Run `pheon diff before.gds after.gds` with your own files, or download these
|
||||||
|
small layouts from the pinned test corpus to try a comparison.
|
||||||
|
[small_rect.gds][small] · [big_rect.gds][big]
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pheon diff small_rect.gds big_rect.gds
|
||||||
|
```
|
||||||
|
|
||||||
|
The example exits with code 1 and shows one changed rectangle in `TOP`.
|
||||||
|
|
||||||
|
```text
|
||||||
|
Different
|
||||||
|
Cells:
|
||||||
|
* TOP
|
||||||
|
2/0: 1 rectangle changed
|
||||||
|
```
|
||||||
|
|
||||||
|
| Exit code | Meaning |
|
||||||
|
| --- | --- |
|
||||||
|
| 0 | Equal under the comparison rules and selected scope. |
|
||||||
|
| 1 | Differences found in a complete comparison. |
|
||||||
|
| 2 | Invalid input, a command error, or an incomplete comparison. |
|
||||||
|
|
||||||
|
A code of 1 is an expected comparison result. A code of 2 can accompany definite
|
||||||
|
differences, but equality cannot be established. Read the
|
||||||
|
[comparison rules](comparison.md) before relying on results in automation, and
|
||||||
|
the [JSON reference](diff-reports.md) to consume reports programmatically.
|
||||||
|
|
||||||
|
### Read the text report
|
||||||
|
|
||||||
|
The cell list marks additions with `+`, removals with `-`, and modifications
|
||||||
|
with `*`. Modified cells summarize shape changes by layer and repeated
|
||||||
|
references by target. A single move can show its displacement in database units.
|
||||||
|
Layer names appear inline or in a legend. Object rows use `~` for likely
|
||||||
|
replacements and `+` or `-` for unmatched additions and removals.
|
||||||
|
|
||||||
|
Use `--details` for individual objects, `--hierarchy ascii` for affected
|
||||||
|
parents, or `--format json` for machine-readable evidence.
|
||||||
|
|
||||||
|
`diff` and `dump` color supported terminals by default. Set `NO_COLOR`, use
|
||||||
|
`TERM=dumb`, or pass `--color=never` for plain text. Pass `--color=always` when
|
||||||
|
piping into `less -R`. JSON and Mermaid diagram source stay plain.
|
||||||
|
|
||||||
|
## Choose the comparison scope
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pheon diff before.gds after.gds --top CHIP --layer 1/0
|
||||||
|
pheon diff before.gds after.gds --cell RESONATOR
|
||||||
|
```
|
||||||
|
|
||||||
|
| Option | Compared content |
|
||||||
|
| --- | --- |
|
||||||
|
| `--top NAME` | The named cell and its reachable descendants in each revision. |
|
||||||
|
| `--cell NAME` | One cell, including its references, without its descendants. |
|
||||||
|
| `--layer L/T\|NAME` | Objects on the selected layer/type pair, plus references leading to that layer. |
|
||||||
|
|
||||||
|
Selectors combine: `--top CHIP --cell RESONATOR` selects that cell within CHIP's
|
||||||
|
subtree. A name absent from both revisions is an error; presence on only one
|
||||||
|
side is an addition or deletion. Layer selection omits cells irrelevant to that
|
||||||
|
layer, but library fields and metadata-version diagnostics remain relevant.
|
||||||
|
The complete input is parsed before scope selection, so malformed records
|
||||||
|
outside the scope still fail the command.
|
||||||
|
|
||||||
|
Both `--layer` and `--show-layer` accept exact, case-sensitive names from the
|
||||||
|
embedded metadata in either revision. If a name refers to several numeric pairs,
|
||||||
|
Pheon lists the choices. A valid numeric pair always selects that pair directly.
|
||||||
|
|
||||||
|
## Control report detail
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pheon diff before.gds after.gds --show-cell RESONATOR --show-layer WG
|
||||||
|
pheon diff before.gds after.gds --show-cell RESONATOR --details --max-changes 20
|
||||||
|
pheon diff before.gds after.gds --hierarchy mermaid --depth 4
|
||||||
|
```
|
||||||
|
|
||||||
|
`--show-cell` and `--show-layer` filter displayed changes without changing the
|
||||||
|
comparison, totals, or exit status. In text reports, `--show-layer` filters
|
||||||
|
object changes within modified cells and hides references without a numeric
|
||||||
|
layer. Added and removed cells appear as name-only entries outside the object
|
||||||
|
budget. Use `--show-cell` to filter those entries.
|
||||||
|
|
||||||
|
`--max-changes N` limits displayed object occurrences after filtering. Text
|
||||||
|
defaults to 100 occurrences and shows a replacement only when both objects fit
|
||||||
|
within the limit. Grouped rows count each object toward the limit. When a
|
||||||
|
layer filter selects one side of a layer-only replacement, that side appears as
|
||||||
|
an addition or removal. The omission line lists changes hidden by filters or the
|
||||||
|
limit. JSON has no default object limit and records omissions in
|
||||||
|
`report_selection`. See the [JSON reference](diff-reports.md) for the selection
|
||||||
|
counters.
|
||||||
|
|
||||||
|
`--details` shows individual object evidence inside modified cells in text
|
||||||
|
reports. Replacement rows include a nested `-` row for the old object and a
|
||||||
|
`+` row for the new object, with cell-local coordinates in database units,
|
||||||
|
retained fields, and properties.
|
||||||
|
|
||||||
|
The diff hierarchy shows changed cells, affected ancestors, and modified
|
||||||
|
references from both revisions. Counts are direct placements, including
|
||||||
|
symbolic array counts. ASCII folds straight chains of unchanged edges and can
|
||||||
|
omit terminal edges already explained by the cell list. `--depth` counts the
|
||||||
|
original edges. For the full graph within the comparison scope, use
|
||||||
|
`--format json --hierarchy graph` without `--depth`.
|
||||||
|
|
||||||
|
Next: configure [Git integration](git.md) or add [layer names](layer-names.md).
|
||||||
|
|
||||||
|
[small]: https://raw.githubusercontent.com/gdsfactory/gdsfactory/7407836dd5d872c704fc06f38562a2ffc88049dc/tests/gds/small_rect.gds
|
||||||
|
[big]: https://raw.githubusercontent.com/gdsfactory/gdsfactory/7407836dd5d872c704fc06f38562a2ffc88049dc/tests/gds/big_rect.gds
|
||||||
59
docs/comparison.md
Normal file
59
docs/comparison.md
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
# Comparison rules
|
||||||
|
|
||||||
|
Pheon compares GDSII objects using the `pheon-structural-v1` profile. Use it to
|
||||||
|
review exact layout changes while ignoring incidental ordering and timestamps.
|
||||||
|
The [CLI guide](cli.md) explains how to choose cells and layers.
|
||||||
|
|
||||||
|
## What counts as equal
|
||||||
|
|
||||||
|
Cells match by name and layers by numeric layer/type pair. By default, the
|
||||||
|
comparison includes the entire library.
|
||||||
|
|
||||||
|
Pheon ignores library and cell timestamps, cell order, element order, and
|
||||||
|
property order. Boundary and box rings are normalized for their starting vertex
|
||||||
|
and winding direction. Other vertices remain significant. Repeated objects and
|
||||||
|
properties are compared as multisets, so duplicates still count.
|
||||||
|
|
||||||
|
Other retained details compare exactly: paths, labels, reference transforms,
|
||||||
|
array endpoints and counts, properties, and flags. An explicitly stored default
|
||||||
|
is distinct from an omitted field. An SREF is distinct from a one-element AREF.
|
||||||
|
REAL8 encodings are retained, so differently encoded values can compare as
|
||||||
|
changed even when their decoded values agree.
|
||||||
|
|
||||||
|
Library fields, including UNITS, compare separately. Coordinates are not
|
||||||
|
rescaled to a shared grid. Cell renames are additions and deletions; Pheon does
|
||||||
|
not infer identity from similar content. It does not perform geometric Boolean
|
||||||
|
operations, XOR, or tolerance-based matching.
|
||||||
|
|
||||||
|
## Read change explanations
|
||||||
|
|
||||||
|
Pheon first pairs unmatched polygons, boxes, and paths that differ only in
|
||||||
|
layer or type, with exactly one candidate in each revision. It then checks the
|
||||||
|
remaining objects for unique matches by kind, layer, and bounds, followed by
|
||||||
|
kind and layer. Reference matching uses the target cell. Ambiguous candidates
|
||||||
|
are reported as separate removals and additions. These explanations apply to
|
||||||
|
the current report and preserve the underlying addition and removal counts.
|
||||||
|
|
||||||
|
Reported bounds are envelopes of stored coordinates in cell-local database
|
||||||
|
units. They exclude path width, rendered text size, and recursively transformed
|
||||||
|
reference geometry. Account for UNITS before interpreting a physical dimension
|
||||||
|
or movement.
|
||||||
|
|
||||||
|
Recognized [layer-name annotations](layer-names.md) are removed from ordinary
|
||||||
|
object comparison. Their name mapping compares separately, so a layer rename
|
||||||
|
appears once.
|
||||||
|
|
||||||
|
## Know when a result is incomplete
|
||||||
|
|
||||||
|
Unsupported records, future metadata versions, unresolved references, and
|
||||||
|
hierarchy cycles prevent a complete comparison. Pheon reports known differences
|
||||||
|
but returns 2 rather than claiming equality.
|
||||||
|
|
||||||
|
Scope can exclude a record known to belong to another layer. Unsupported
|
||||||
|
records whose layer is unknown can still make a layer-scoped comparison
|
||||||
|
incomplete. Library fields and future metadata diagnostics remain visible.
|
||||||
|
Malformed input fails before scope is applied.
|
||||||
|
|
||||||
|
For automation, check completeness as well as differences. The
|
||||||
|
[JSON report reference](diff-reports.md) describes the status fields and retained
|
||||||
|
evidence.
|
||||||
68
docs/development.md
Normal file
68
docs/development.md
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
# Development
|
||||||
|
|
||||||
|
The checkout selects stable Rust. The minimum supported compiler is 1.88.
|
||||||
|
Use the checked-in `Cargo.lock` and update dependencies explicitly with Cargo.
|
||||||
|
|
||||||
|
## Check a change
|
||||||
|
|
||||||
|
| Area | Start here | First check |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| GDSII parsing and Arrow reads | [`src/record.rs`](../src/record.rs), [`src/library.rs`](../src/library.rs) | `cargo test --locked --test parser_errors --test selective_reads` |
|
||||||
|
| Comparisons and CLI | [`src/review.rs`](../src/review.rs), [`src/review/`](../src/review/), [`src/bin/pheon.rs`](../src/bin/pheon.rs) | `cargo test --locked --test review` |
|
||||||
|
| Python and CFFI | [`pheon/`](../pheon/), [`src/lib.rs`](../src/lib.rs) | `python -I tools/check_installed.py` after installation |
|
||||||
|
|
||||||
|
Run `cargo test --locked` for the full Rust suite or `cargo test --release --locked`
|
||||||
|
for release builds. Set `RUSTUP_TOOLCHAIN=1.88.0` to check the minimum compiler.
|
||||||
|
|
||||||
|
## Test the Python package
|
||||||
|
|
||||||
|
Use Python 3.11 or newer and install into a virtual environment.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python3 -m venv .venv
|
||||||
|
. .venv/bin/activate
|
||||||
|
python -m pip install .
|
||||||
|
python -I tools/check_installed.py
|
||||||
|
```
|
||||||
|
|
||||||
|
To test a newly built shared library, set `PHEON_LIBRARY` to its absolute path
|
||||||
|
and run `python -m unittest discover -s tests/python` from the checkout. Clear
|
||||||
|
the override when checking the bundled library with `check_installed.py`.
|
||||||
|
|
||||||
|
## Check upstream layouts
|
||||||
|
|
||||||
|
The [GDSII corpus](../contrib/gds-corpus.toml) pins open-source fixtures and cell
|
||||||
|
libraries. Install Pheon in the virtual environment before running the corpus
|
||||||
|
check.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo build --release --locked --bin pheon
|
||||||
|
python -I tools/check_gds_corpus.py --fetch
|
||||||
|
```
|
||||||
|
|
||||||
|
The checker uses `curl` to cache layouts and license files in `.cache/gds-corpus/`
|
||||||
|
and verifies their SHA-256 digests. Omit `--fetch` to rerun offline. It checks
|
||||||
|
full reads, scans, selected reads, and CLI self-comparisons. It writes diagnostics
|
||||||
|
to `.cache/gds-corpus/report.json` and exits with status 1 if a check fails.
|
||||||
|
|
||||||
|
## Interfaces and reports
|
||||||
|
|
||||||
|
The CFFI declarations live in [`pheon/_ffi.h`](../pheon/_ffi.h). Keep them aligned
|
||||||
|
with the exported native functions. The C API version and
|
||||||
|
[Arrow layout version](arrow-schema.md) are independent of package releases and
|
||||||
|
the [JSON report schema](diff-reports.md).
|
||||||
|
|
||||||
|
Review tests cover comparison semantics, CLI behavior, symbolic array counts,
|
||||||
|
and versioned report goldens. To regenerate JSON goldens after deliberately
|
||||||
|
changing their contract:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
PHEON_UPDATE_REPORT_GOLDENS=1 cargo test --test review machine_reports_match_versioned_goldens
|
||||||
|
```
|
||||||
|
|
||||||
|
Inspect the resulting diff. Goldens normalize the producer version to `test`.
|
||||||
|
Use the [JSON Schema](diff-report-v1.schema.json) to check structure. Rust tests
|
||||||
|
verify links, totals, and agreement between the result and exit status.
|
||||||
|
|
||||||
|
See [building releases](releases.md) for source archives, wheels, and standalone
|
||||||
|
CLI artifacts.
|
||||||
206
docs/diff-report-v1.schema.json
Normal file
206
docs/diff-report-v1.schema.json
Normal file
|
|
@ -0,0 +1,206 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"title": "Pheon diff report version 1",
|
||||||
|
"description": "Structural comparison evidence, not a layout serialization. Unknown additional fields are permitted for compatible extensions.",
|
||||||
|
"type": "object",
|
||||||
|
"required": ["schema_version", "kind", "producer", "comparison_profile", "inputs", "scope", "coordinates", "status", "result", "exit_code", "summary", "report_selection", "layer_legend", "library_changes", "layer_name_changes", "cell_changes", "hierarchy", "diagnostics"],
|
||||||
|
"properties": {
|
||||||
|
"schema_version": {"const": 1},
|
||||||
|
"kind": {"const": "diff"},
|
||||||
|
"producer": {
|
||||||
|
"type": "object", "required": ["name", "version"],
|
||||||
|
"properties": {"name": {"const": "pheon"}, "version": {"type": "string"}}
|
||||||
|
},
|
||||||
|
"comparison_profile": {"type": "string"},
|
||||||
|
"inputs": {
|
||||||
|
"type": "object", "required": ["old", "new"],
|
||||||
|
"properties": {"old": {"$ref": "#/$defs/input"}, "new": {"$ref": "#/$defs/input"}}
|
||||||
|
},
|
||||||
|
"scope": {
|
||||||
|
"type": "object", "required": ["top", "cell", "layer"],
|
||||||
|
"properties": {"top": {"type": ["string", "null"]}, "cell": {"type": ["string", "null"]}, "layer": {"$ref": "#/$defs/nullableLayer"}}
|
||||||
|
},
|
||||||
|
"coordinates": {
|
||||||
|
"type": "object", "required": ["unit", "frame", "bounds"],
|
||||||
|
"properties": {"unit": {"const": "database_unit"}, "frame": {"const": "cell_local"}, "bounds": {"const": "coordinate_envelope"}}
|
||||||
|
},
|
||||||
|
"status": {"enum": ["complete", "incomplete", "failed"]},
|
||||||
|
"result": {"enum": ["equal", "different", "unknown"]},
|
||||||
|
"exit_code": {"enum": [0, 1, 2]},
|
||||||
|
"summary": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/summary"}]},
|
||||||
|
"report_selection": {"$ref": "#/$defs/selection"},
|
||||||
|
"layer_legend": {
|
||||||
|
"type": "array", "items": {
|
||||||
|
"type": "object", "required": ["layer", "name"],
|
||||||
|
"properties": {"layer": {"$ref": "#/$defs/layer"}, "name": {"type": "string"}}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"library_changes": {"type": "array", "items": {"$ref": "#/$defs/libraryChange"}},
|
||||||
|
"layer_name_changes": {
|
||||||
|
"type": "array", "items": {
|
||||||
|
"type": "object", "required": ["layer", "before", "after"],
|
||||||
|
"properties": {"layer": {"$ref": "#/$defs/layer"}, "before": {"type": ["string", "null"]}, "after": {"type": ["string", "null"]}}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cell_changes": {"type": "array", "items": {"$ref": "#/$defs/cellChange"}},
|
||||||
|
"hierarchy": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/graph"}]},
|
||||||
|
"diagnostics": {"type": "array", "items": {"$ref": "#/$defs/diagnostic"}}
|
||||||
|
},
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"if": {"properties": {"status": {"const": "complete"}}},
|
||||||
|
"then": {
|
||||||
|
"properties": {"result": {"enum": ["equal", "different"]}, "summary": {"$ref": "#/$defs/summary", "properties": {"counts": {"const": "exact"}}}, "diagnostics": {"maxItems": 0}},
|
||||||
|
"if": {"properties": {"result": {"const": "equal"}}},
|
||||||
|
"then": {"properties": {"exit_code": {"const": 0}}},
|
||||||
|
"else": {"properties": {"exit_code": {"const": 1}}}
|
||||||
|
},
|
||||||
|
"else": {"properties": {"exit_code": {"const": 2}, "diagnostics": {"minItems": 1}}}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"if": {"properties": {"status": {"const": "incomplete"}}},
|
||||||
|
"then": {"properties": {"result": {"enum": ["different", "unknown"]}, "summary": {"$ref": "#/$defs/summary", "properties": {"counts": {"const": "observed"}}}}}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"if": {"properties": {"status": {"const": "failed"}}},
|
||||||
|
"then": {"properties": {"result": {"const": "unknown"}, "summary": {"type": "null"}, "library_changes": {"maxItems": 0}, "layer_name_changes": {"maxItems": 0}, "cell_changes": {"maxItems": 0}, "hierarchy": {"type": "null"}}}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"$defs": {
|
||||||
|
"decimal": {"type": "string", "pattern": "^(0|[1-9][0-9]*)$"},
|
||||||
|
"hex": {"type": "string", "pattern": "^0x([0-9a-f]{2})*$"},
|
||||||
|
"uint16": {"type": "integer", "minimum": 0, "maximum": 65535},
|
||||||
|
"int32": {"type": "integer", "minimum": -2147483648, "maximum": 2147483647},
|
||||||
|
"layer": {
|
||||||
|
"type": "object", "required": ["number", "purpose"],
|
||||||
|
"properties": {"number": {"$ref": "#/$defs/uint16"}, "purpose": {"$ref": "#/$defs/uint16"}}
|
||||||
|
},
|
||||||
|
"nullableLayer": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/layer"}]},
|
||||||
|
"point": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"$ref": "#/$defs/int32"}},
|
||||||
|
"fields": {"type": "array", "items": {"$ref": "#/$defs/field"}},
|
||||||
|
"field": {
|
||||||
|
"type": "object", "required": ["tag", "name", "encoding", "value", "payload_hex"],
|
||||||
|
"properties": {
|
||||||
|
"tag": {"$ref": "#/$defs/uint16"}, "name": {"type": "string"},
|
||||||
|
"encoding": {"enum": ["xy", "uint16", "int16", "int32", "bits", "real8", "ascii", "none", "bytes"]},
|
||||||
|
"payload_hex": {"$ref": "#/$defs/hex"},
|
||||||
|
"value": {"type": ["array", "string", "null"]}
|
||||||
|
},
|
||||||
|
"allOf": [
|
||||||
|
{"if": {"properties": {"encoding": {"const": "xy"}}}, "then": {"properties": {"value": {"type": "array", "items": {"$ref": "#/$defs/point"}}}}},
|
||||||
|
{"if": {"properties": {"encoding": {"enum": ["uint16", "bits"]}}}, "then": {"properties": {"value": {"type": "array", "items": {"$ref": "#/$defs/uint16"}}}}},
|
||||||
|
{"if": {"properties": {"encoding": {"const": "int16"}}}, "then": {"properties": {"value": {"type": "array", "items": {"type": "integer", "minimum": -32768, "maximum": 32767}}}}},
|
||||||
|
{"if": {"properties": {"encoding": {"const": "int32"}}}, "then": {"properties": {"value": {"type": "array", "items": {"$ref": "#/$defs/int32"}}}}},
|
||||||
|
{"if": {"properties": {"encoding": {"const": "real8"}}}, "then": {"properties": {"value": {"type": "array", "items": {"type": ["number", "null"]}}}}},
|
||||||
|
{"if": {"properties": {"encoding": {"const": "ascii"}}}, "then": {"properties": {"value": {"type": ["string", "null"]}}}},
|
||||||
|
{"if": {"properties": {"encoding": {"enum": ["none", "bytes"]}}}, "then": {"properties": {"value": {"type": "null"}}}}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"input": {
|
||||||
|
"type": "object", "required": ["path", "path_encoded_hex", "present", "units"],
|
||||||
|
"properties": {
|
||||||
|
"path": {"type": ["string", "null"]},
|
||||||
|
"path_encoded_hex": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/hex"}]},
|
||||||
|
"present": {"type": ["boolean", "null"]},
|
||||||
|
"units": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/field"}]}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary": {
|
||||||
|
"type": "object", "required": ["counts", "changed_cells", "removed_objects", "added_objects", "layer_name_changes", "library_field_changes"],
|
||||||
|
"properties": {
|
||||||
|
"counts": {"enum": ["exact", "observed"]},
|
||||||
|
"changed_cells": {"$ref": "#/$defs/decimal"}, "removed_objects": {"$ref": "#/$defs/decimal"}, "added_objects": {"$ref": "#/$defs/decimal"},
|
||||||
|
"layer_name_changes": {"$ref": "#/$defs/decimal"}, "library_field_changes": {"$ref": "#/$defs/decimal"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"selection": {
|
||||||
|
"type": "object", "required": ["cell", "layer", "max_objects", "truncated", "filtered_cells", "filtered_objects", "limited_objects", "emitted_objects"],
|
||||||
|
"properties": {
|
||||||
|
"cell": {"type": ["string", "null"]}, "layer": {"$ref": "#/$defs/nullableLayer"},
|
||||||
|
"max_objects": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/decimal"}]}, "truncated": {"type": "boolean"},
|
||||||
|
"filtered_cells": {"$ref": "#/$defs/decimal"}, "filtered_objects": {"$ref": "#/$defs/decimal"},
|
||||||
|
"limited_objects": {"$ref": "#/$defs/decimal"}, "emitted_objects": {"$ref": "#/$defs/decimal"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraryChange": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "object", "required": ["field", "tag", "before", "after"],
|
||||||
|
"properties": {"field": {"const": "presence"}, "tag": {"type": "null"}, "before": {"type": "boolean"}, "after": {"type": "boolean"}}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object", "required": ["field", "tag", "before", "after"],
|
||||||
|
"properties": {"field": {"type": "string"}, "tag": {"$ref": "#/$defs/uint16"}, "before": {"$ref": "#/$defs/fields"}, "after": {"$ref": "#/$defs/fields"}}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"type": "object", "required": ["side", "byte_offset", "end_offset"],
|
||||||
|
"properties": {"side": {"enum": ["old", "new"]}, "byte_offset": {"$ref": "#/$defs/decimal"}, "end_offset": {"$ref": "#/$defs/decimal"}}
|
||||||
|
},
|
||||||
|
"property": {
|
||||||
|
"type": "object", "required": ["attribute", "value", "payload_hex"],
|
||||||
|
"properties": {"attribute": {"$ref": "#/$defs/uint16"}, "value": {"type": ["string", "null"]}, "payload_hex": {"$ref": "#/$defs/hex"}}
|
||||||
|
},
|
||||||
|
"object": {
|
||||||
|
"type": "object", "required": ["id", "kind", "tag", "source", "layer", "bounds", "target", "origin", "width", "counts", "fields", "properties"],
|
||||||
|
"properties": {
|
||||||
|
"id": {"type": "string"}, "kind": {"type": "string"}, "tag": {"$ref": "#/$defs/uint16"}, "source": {"$ref": "#/$defs/source"},
|
||||||
|
"layer": {"$ref": "#/$defs/nullableLayer"},
|
||||||
|
"bounds": {"oneOf": [{"type": "null"}, {"type": "array", "minItems": 4, "maxItems": 4, "items": {"$ref": "#/$defs/int32"}}]},
|
||||||
|
"target": {"type": ["string", "null"]}, "origin": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/point"}]},
|
||||||
|
"width": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/int32"}]},
|
||||||
|
"counts": {"oneOf": [{"type": "null"}, {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "integer", "minimum": 1, "maximum": 32767}}]},
|
||||||
|
"fields": {"$ref": "#/$defs/fields"}, "properties": {"type": "array", "items": {"$ref": "#/$defs/property"}}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"replacement": {
|
||||||
|
"type": "object", "required": ["removed", "added", "match_rule", "explanation", "field_changes", "properties_changed"],
|
||||||
|
"properties": {
|
||||||
|
"removed": {"type": "string"}, "added": {"type": "string"}, "match_rule": {"type": "string"}, "explanation": {"type": "string"}, "properties_changed": {"type": "boolean"},
|
||||||
|
"field_changes": {"type": "array", "items": {
|
||||||
|
"type": "object", "required": ["tag", "before", "after"],
|
||||||
|
"properties": {"tag": {"$ref": "#/$defs/uint16"}, "before": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/field"}]}, "after": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/field"}]}}
|
||||||
|
}}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cellSide": {
|
||||||
|
"oneOf": [{"type": "null"}, {
|
||||||
|
"type": "object", "required": ["byte_offset", "attributes"],
|
||||||
|
"properties": {"byte_offset": {"$ref": "#/$defs/decimal"}, "attributes": {"$ref": "#/$defs/fields"}}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"cellChange": {
|
||||||
|
"type": "object", "required": ["name", "before", "after", "attributes_changed", "removed", "added", "replacements"],
|
||||||
|
"properties": {
|
||||||
|
"name": {"type": "string"}, "before": {"$ref": "#/$defs/cellSide"}, "after": {"$ref": "#/$defs/cellSide"}, "attributes_changed": {"type": "boolean"},
|
||||||
|
"removed": {"type": "array", "items": {"$ref": "#/$defs/object"}}, "added": {"type": "array", "items": {"$ref": "#/$defs/object"}},
|
||||||
|
"replacements": {"type": "array", "items": {"$ref": "#/$defs/replacement"}}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"diagnostic": {
|
||||||
|
"type": "object", "required": ["code", "severity", "message", "side", "byte_offset", "cell", "layer", "target"],
|
||||||
|
"properties": {
|
||||||
|
"code": {"type": "string"}, "severity": {"const": "error"}, "message": {"type": "string"}, "side": {"enum": ["old", "new", null]},
|
||||||
|
"byte_offset": {"oneOf": [{"type": "null"}, {"$ref": "#/$defs/decimal"}]}, "cell": {"type": ["string", "null"]},
|
||||||
|
"layer": {"$ref": "#/$defs/nullableLayer"}, "target": {"type": ["string", "null"]}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"graph": {
|
||||||
|
"type": "object", "required": ["nodes", "edges"],
|
||||||
|
"properties": {
|
||||||
|
"nodes": {"type": "array", "items": {
|
||||||
|
"type": "object", "required": ["cell", "before", "after", "change"],
|
||||||
|
"properties": {
|
||||||
|
"cell": {"type": "string"}, "before": {"enum": ["included", "outside_scope", "unresolved", "absent"]}, "after": {"enum": ["included", "outside_scope", "unresolved", "absent"]},
|
||||||
|
"change": {"enum": ["direct", "affected", "unchanged"]}
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
"edges": {"type": "array", "items": {
|
||||||
|
"type": "object", "required": ["parent", "target", "before_count", "after_count", "reference_changed"],
|
||||||
|
"properties": {"parent": {"type": "string"}, "target": {"type": "string"}, "before_count": {"$ref": "#/$defs/decimal"}, "after_count": {"$ref": "#/$defs/decimal"}, "reference_changed": {"type": "boolean"}}
|
||||||
|
}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
131
docs/diff-reports.md
Normal file
131
docs/diff-reports.md
Normal file
|
|
@ -0,0 +1,131 @@
|
||||||
|
# JSON diff reports
|
||||||
|
|
||||||
|
Use JSON reports to automate layout review while retaining the evidence behind
|
||||||
|
a result. The [comparison rules](comparison.md) define equality; the
|
||||||
|
[version 1 JSON Schema](diff-report-v1.schema.json) defines every field.
|
||||||
|
A [complete example](https://mpxd.net/code/jan/pheon/src/branch/master/tests/golden/report-geometry.json) shows geometry changes.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pheon diff before.gds after.gds --format json > report.json
|
||||||
|
pheon diff before.gds after.gds --format json --hierarchy graph
|
||||||
|
pheon diff before.gds after.gds --format json --top CHIP --layer 1/0
|
||||||
|
```
|
||||||
|
|
||||||
|
`diff` writes one UTF-8 JSON document and a newline to stdout, including comparison
|
||||||
|
diagnostics. Output write failures go to stderr and return 2; interrupted output
|
||||||
|
is invalid. Other CLI commands retain text output.
|
||||||
|
|
||||||
|
## Check the result first
|
||||||
|
|
||||||
|
| `status` | `result` | Exit code | Meaning |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| `complete` | `equal` | 0 | Equal under the recorded profile and scope. |
|
||||||
|
| `complete` | `different` | 1 | Differences found. |
|
||||||
|
| `incomplete` | `different` | 2 | Definite differences, with comparison limitations. |
|
||||||
|
| `incomplete` | `unknown` | 2 | Equality cannot be established. |
|
||||||
|
| `failed` | `unknown` | 2 | No comparison result. |
|
||||||
|
|
||||||
|
A code of 1 is an expected result, including when saving a report. Unsupported
|
||||||
|
records, future metadata, unresolved references, and cycles make a comparison
|
||||||
|
incomplete. Malformed input, I/O errors, invalid scopes, and command errors fail.
|
||||||
|
|
||||||
|
`summary` covers the whole scoped comparison before display filters. Counts are
|
||||||
|
`exact` for complete results and `observed` for incomplete ones. Failed reports
|
||||||
|
have a null summary and empty change arrays. Replacement suggestions and affected
|
||||||
|
ancestors do not add to change counts.
|
||||||
|
|
||||||
|
## Scope and evidence selection
|
||||||
|
|
||||||
|
`scope` records `top`, `cell`, and numeric `layer` selectors; null means
|
||||||
|
unrestricted. The full input is parsed before scope selection.
|
||||||
|
|
||||||
|
`report_selection` records display-only cell/layer filters and `max_objects`.
|
||||||
|
JSON is unbounded by default. Explicit `--max-changes N` limits total emitted
|
||||||
|
removals plus additions, with removals first within each cell. Selection counters
|
||||||
|
`filtered_cells`, `filtered_objects`, `limited_objects`, and `emitted_objects`
|
||||||
|
explain omissions. `truncated` is true when filtering or limits omit evidence.
|
||||||
|
Library changes, layer-name changes, diagnostics, summaries, and the optional
|
||||||
|
graph remain. Replacement links appear only if both objects are emitted.
|
||||||
|
|
||||||
|
## Read values safely
|
||||||
|
|
||||||
|
Aggregate counts, limits, and byte offsets are unsigned decimal **strings** to
|
||||||
|
avoid JSON number precision loss. Coordinates, numeric tags, layer/type pairs,
|
||||||
|
widths, and array dimensions are bounded JSON numbers. Null means absent or
|
||||||
|
unavailable; zero and empty arrays remain meaningful values.
|
||||||
|
|
||||||
|
`inputs.old` and `inputs.new` record paths, presence, and UNITS. An absent revision
|
||||||
|
is distinct from an empty library. The Rust API supports absent Git revisions
|
||||||
|
with `Document::empty_like`. Failed reports may lack presence, units, or argument
|
||||||
|
context. Non-UTF-8 paths use null `path` and `path_encoded_hex`: `0x`-prefixed
|
||||||
|
platform-native Rust path bytes, not a portable filename encoding.
|
||||||
|
|
||||||
|
## Interpret changes
|
||||||
|
|
||||||
|
| Section | Evidence |
|
||||||
|
| --- | --- |
|
||||||
|
| `library_changes` | Typed before/after header fields, including unscaled UNITS. Presence changes use a null tag and boolean values. |
|
||||||
|
| `layer_name_changes` | Before/after names for numeric pairs `{ "number": 1, "purpose": 0 }`. |
|
||||||
|
| `layer_legend` | Unchanged names available in scope. Annotation labels do not also appear as object changes. |
|
||||||
|
| `cell_changes` | Name, nullable before/after cell records, attributes, removed/added objects, and replacement suggestions. A null side means absent; an existing empty cell still has a byte offset. |
|
||||||
|
|
||||||
|
Objects retain kind, numeric tag, layer, target, bounds, source side and half-open
|
||||||
|
byte range, typed fields, and a sorted property multiset including duplicates.
|
||||||
|
Convenience fields include origin, width, and reference dimensions. SREF counts
|
||||||
|
are `[1, 1]`; kind and retained fields still distinguish a one-element AREF.
|
||||||
|
|
||||||
|
Coordinates are cell-local database units. Bounds are stored-coordinate
|
||||||
|
envelopes, excluding stroke width, rendered text, and recursive target geometry.
|
||||||
|
Consider UNITS before deriving physical dimensions.
|
||||||
|
|
||||||
|
Fields contain `tag`, display `name`, `encoding`, decoded `value`, and
|
||||||
|
`payload_hex`. Numeric tags are authoritative. XY values are lists of points;
|
||||||
|
other numeric values are arrays. Unsupported encodings have null values and
|
||||||
|
preserved bytes. Invalid UTF-8 strings/properties have null decoded values;
|
||||||
|
hex preserves their bytes.
|
||||||
|
|
||||||
|
Evidence follows the comparison profile: boundary/box rings are canonicalized,
|
||||||
|
string padding is removed, and fields/properties are sorted. REAL8 encodings and
|
||||||
|
explicit defaults remain significant. For gzip inputs, source offsets locate
|
||||||
|
records in the decompressed layout.
|
||||||
|
|
||||||
|
Replacements link report-local removed/added IDs with `match_rule`,
|
||||||
|
`field_changes`, and `properties_changed`. The `unique_layer_change` rule
|
||||||
|
matches a unique polygon, box, or path on each side with identical retained
|
||||||
|
fields and properties outside the layer and datatype fields. The other rules
|
||||||
|
are `unique_kind_layer_bounds`, `unique_kind_layer`, and `unique_kind_target`.
|
||||||
|
Ambiguous candidates stay separate. Replacement IDs refer only to objects in
|
||||||
|
the current report. Explanation text is for display only.
|
||||||
|
|
||||||
|
## Diagnostics and hierarchy
|
||||||
|
|
||||||
|
Diagnostics provide `code`, `severity`, `message`, input side, byte offset, cell,
|
||||||
|
layer, and target; unknown context is null. Use codes and context for automation.
|
||||||
|
Fatal parser locations currently appear only in the human message, with null
|
||||||
|
structured offsets. Do not parse message wording.
|
||||||
|
|
||||||
|
Limitation codes are `unsupported_record`, `unsupported_metadata_version`,
|
||||||
|
`unresolved_reference`, `hierarchy_cycle`, and `scope_mismatch`. Failure codes are
|
||||||
|
`invalid_input`, `io_error`, `invalid_scope`, and `command_error`.
|
||||||
|
|
||||||
|
`--hierarchy graph` includes the full scoped union graph. By default, `hierarchy`
|
||||||
|
is null. JSON output rejects `--depth` with exit code 2. Nodes are keyed by name,
|
||||||
|
with per-side states `included`, `outside_scope`, `unresolved`, or `absent`, and
|
||||||
|
change states `direct`, `affected`, or `unchanged`.
|
||||||
|
Edges record parent, target, before/after direct placement counts, and changed
|
||||||
|
reference records. Array multiplicities are symbolic, not expanded or recursively
|
||||||
|
accumulated. Shared cells occur once and removed edges remain. The graph covers
|
||||||
|
the full comparison scope regardless of display filters and object limits.
|
||||||
|
|
||||||
|
## Versions
|
||||||
|
|
||||||
|
`schema_version` is 1, `comparison_profile` is `pheon-structural-v1`, and
|
||||||
|
`producer.name` is `pheon`. Structure, equality rules, and producer version evolve
|
||||||
|
independently. Understand the profile before interpreting equality. Consumers
|
||||||
|
should tolerate additional optional fields and unknown codes/rules without
|
||||||
|
assuming equality. Removed fields or changed meanings require a schema change.
|
||||||
|
|
||||||
|
Serialization is deterministic for identical inputs, paths, options, and producer
|
||||||
|
version. Sorted evidence retains duplicates. Reports have no generation timestamp
|
||||||
|
or required content fingerprint. See [development](development.md) for contract
|
||||||
|
tests and golden updates.
|
||||||
63
docs/git.md
Normal file
63
docs/git.md
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
# Git integration
|
||||||
|
|
||||||
|
Configure Git to show meaningful GDSII changes during review. Install the
|
||||||
|
[Pheon CLI](cli.md#install) first, then choose one of the following drivers.
|
||||||
|
Templates are also available in [contrib/git](../contrib/git/).
|
||||||
|
|
||||||
|
## Object comparison
|
||||||
|
|
||||||
|
Use the external driver for object-aware comparison and affected hierarchy.
|
||||||
|
Add this to your repository's `.gitattributes`:
|
||||||
|
|
||||||
|
```gitattributes
|
||||||
|
*.gds diff=pheon
|
||||||
|
```
|
||||||
|
|
||||||
|
Add this to `.git/config`, or use the same section in your user Git config:
|
||||||
|
|
||||||
|
```gitconfig
|
||||||
|
[diff "pheon"]
|
||||||
|
command = pheon git-diff --hierarchy ascii --
|
||||||
|
binary = true
|
||||||
|
trustExitCode = false
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run `git diff` as usual. The driver reads Git's temporary old and new files
|
||||||
|
and handles additions, deletions, and renames. The heading names the file and
|
||||||
|
indicates whether it was added or deleted. Keep the final `--` because Git appends
|
||||||
|
its path and revision arguments after it. Put Pheon options such as `--top CHIP`
|
||||||
|
or `--show-layer 1/0` before that marker.
|
||||||
|
|
||||||
|
The external driver also accepts `--color=always` before `--` to keep colors
|
||||||
|
when its output goes through a pager that supports ANSI colors.
|
||||||
|
|
||||||
|
For an existing `diff=layout` attribute, put the configuration under
|
||||||
|
`[diff "layout"]` instead. Attribute names only select a Git driver.
|
||||||
|
|
||||||
|
The external driver returns 0 after rendering either an equal or different
|
||||||
|
comparison, and nonzero for invalid or incomplete comparisons. For automation
|
||||||
|
that needs equality status, run `pheon diff OLD NEW` directly; it returns
|
||||||
|
0, 1, or 2 as described in the [CLI guide](cli.md).
|
||||||
|
|
||||||
|
## Normalized text comparison
|
||||||
|
|
||||||
|
Use text conversion when you want Git to compare normalized text dumps. Set
|
||||||
|
`.gitattributes` to:
|
||||||
|
|
||||||
|
```gitattributes
|
||||||
|
*.gds diff=pheon-text
|
||||||
|
```
|
||||||
|
|
||||||
|
Configure the driver:
|
||||||
|
|
||||||
|
```gitconfig
|
||||||
|
[diff "pheon-text"]
|
||||||
|
textconv = pheon dump
|
||||||
|
binary = true
|
||||||
|
cachetextconv = true
|
||||||
|
```
|
||||||
|
|
||||||
|
Git can cache converted text. Invalidate that cache when upgrading to a tool or
|
||||||
|
comparison profile that changes the dump format, or disable `cachetextconv`.
|
||||||
|
These diffs are for human review; they are not patches that can be applied to
|
||||||
|
GDSII files. See the [comparison rules](comparison.md) for normalization details.
|
||||||
19
docs/index.md
Normal file
19
docs/index.md
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Pheon documentation
|
||||||
|
|
||||||
|
Start with a guide for the task you want to perform.
|
||||||
|
|
||||||
|
| Task | Guide |
|
||||||
|
| --- | --- |
|
||||||
|
| Inspect layouts, compare revisions, or view hierarchy | [Command-line tools](cli.md) |
|
||||||
|
| Load geometry or selected cells in Python | [Python](python.md) |
|
||||||
|
| Review GDSII files with Git | [Git integration](git.md) |
|
||||||
|
| Add readable names to numeric layers | [Layer names](layer-names.md) |
|
||||||
|
| Understand what a comparison considers equal | [Comparison rules](comparison.md) |
|
||||||
|
|
||||||
|
For integrations, use the [Arrow layout reference](arrow-schema.md),
|
||||||
|
[Rust and C API guide](native-api.md), or [JSON report reference](diff-reports.md).
|
||||||
|
|
||||||
|
For contributors and maintainers, see [development](development.md) and
|
||||||
|
[building releases](releases.md).
|
||||||
|
|
||||||
|
Return to the [project introduction](../README.md).
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue