Introduce Pheon GDSII parsing and layout review tools

Implement native GDSII reading and writing with Arrow interchange, hierarchy
scans and selective cell loading. Validate numeric packing and array pitches,
and preserve normalized REAL8 encodings exactly within the supported range.

Add standalone dump, structural diff, hierarchy, layer-name annotation and Git
diff commands. Provide scoped text and JSON reports, deterministic comparison,
and record-preserving metadata edits.

Package the shared library and optional Python Arrow readers as pheon using
CFFI ABI mode and Python-independent platform wheels. Include locked source
builds, native API checks, cross-platform artifact workflows, documentation
and regression coverage. Require Rust 1.88 or newer and Python 3.11 or newer.

Validation: 87 native tests, 14 binding tests on Python 3.11/3.13/3.14,
and 71 installed companion integration tests pass. Full, scanned and selected
Arrow layouts match the previous schemas.
This commit is contained in:
Jan Petykiewicz 2026-11-16 16:21:21 -08:00
commit b3346b40a4
2 changed files with 12956 additions and 1 deletions

23
.github/workflows/ci.yml vendored Normal file
View 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

123
.github/workflows/packages.yml vendored Normal file
View file

@ -0,0 +1,123 @@
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_EXTRAS: arrow
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 pyarrow
- 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 cli-dist/
- uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.os }}
path: cli-dist/