gdsdiff 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gdsdiff/__init__.py +148 -0
- gdsdiff/__main__.py +7 -0
- gdsdiff/_environment.py +12 -0
- gdsdiff/_version.py +34 -0
- gdsdiff/acceptance_evidence.py +530 -0
- gdsdiff/api.py +2955 -0
- gdsdiff/backends/__init__.py +26 -0
- gdsdiff/backends/base.py +77 -0
- gdsdiff/backends/boundary_loop_ctypes.py +191 -0
- gdsdiff/backends/cpu.py +20 -0
- gdsdiff/backends/cpu_ctypes.py +255 -0
- gdsdiff/backends/cuda.py +40 -0
- gdsdiff/backends/cuda_ctypes.py +1297 -0
- gdsdiff/backends/exact.py +424 -0
- gdsdiff/backends/geometry_ctypes.py +252 -0
- gdsdiff/backends/identity.py +53 -0
- gdsdiff/backends/metal.py +198 -0
- gdsdiff/backends/metal_ctypes.py +866 -0
- gdsdiff/backends/polygon_extract_ctypes.py +233 -0
- gdsdiff/backends/structural_ctypes.py +130 -0
- gdsdiff/boundary_loops.py +616 -0
- gdsdiff/cache.py +544 -0
- gdsdiff/canonicalize.py +176 -0
- gdsdiff/cli.py +352 -0
- gdsdiff/config.py +257 -0
- gdsdiff/cuda_setup.py +174 -0
- gdsdiff/design_history.py +65 -0
- gdsdiff/diagnostics.py +42 -0
- gdsdiff/diff_gds.py +66 -0
- gdsdiff/exact_diff_markdown.py +979 -0
- gdsdiff/exact_oracle.py +649 -0
- gdsdiff/extract.py +376 -0
- gdsdiff/gds_metadata.py +43 -0
- gdsdiff/geometry.py +112 -0
- gdsdiff/grid.py +143 -0
- gdsdiff/hierarchy.py +215 -0
- gdsdiff/hierarchy_extract.py +263 -0
- gdsdiff/inventory.py +153 -0
- gdsdiff/multiprocessing_support.py +39 -0
- gdsdiff/native.py +135 -0
- gdsdiff/native_cache.py +265 -0
- gdsdiff/native_src/cpu_prefilter.cpp +349 -0
- gdsdiff/native_src/gds_boundary_loops.cpp +505 -0
- gdsdiff/native_src/gds_geometry_scan.cpp +601 -0
- gdsdiff/native_src/gds_polygon_extract.cpp +594 -0
- gdsdiff/native_src/gds_structural_scan.cpp +335 -0
- gdsdiff/native_src/gdsdiff/CMakeLists.txt +74 -0
- gdsdiff/native_src/gdsdiff/core.cpp +191 -0
- gdsdiff/native_src/gdsdiff/core.hpp +96 -0
- gdsdiff/native_src/gdsdiff/cuda_assignment.cu +304 -0
- gdsdiff/native_src/gdsdiff/cuda_assignment.cuh +33 -0
- gdsdiff/native_src/gdsdiff/cuda_candidates.cu +133 -0
- gdsdiff/native_src/gdsdiff/cuda_candidates.cuh +17 -0
- gdsdiff/native_src/gdsdiff/cuda_ctypes.cu +4528 -0
- gdsdiff/native_src/gdsdiff/cuda_memory.cu +194 -0
- gdsdiff/native_src/gdsdiff/cuda_memory.cuh +34 -0
- gdsdiff/native_src/gdsdiff/metal_ctypes.mm +2791 -0
- gdsdiff/native_src/gdsdiff/python_bindings.cpp +21 -0
- gdsdiff/native_src/gdsdiff/test_core.cpp +93 -0
- gdsdiff/native_src/gdsdiff/test_cuda_assignment.cu +109 -0
- gdsdiff/native_src/gdsdiff/test_cuda_candidates.cu +94 -0
- gdsdiff/native_src/gdsdiff/test_cuda_memory.cu +97 -0
- gdsdiff/policy.py +305 -0
- gdsdiff/polygon_components.py +860 -0
- gdsdiff/profiles.py +152 -0
- gdsdiff/py.typed +1 -0
- gdsdiff/rect_coverage.py +384 -0
- gdsdiff/report.py +354 -0
- gdsdiff/schemas/gdsdiff_report-v1.schema.json +92 -0
- gdsdiff/semantics.py +75 -0
- gdsdiff/source_edge_diff.py +1120 -0
- gdsdiff/spatial.py +71 -0
- gdsdiff/structural_guard.py +161 -0
- gdsdiff/surplus_coverage.py +255 -0
- gdsdiff/synthetic_suite.py +1643 -0
- gdsdiff/templates.py +709 -0
- gdsdiff/tiling.py +153 -0
- gdsdiff/windowed_exact.py +270 -0
- gdsdiff/windows.py +184 -0
- gdsdiff-0.1.0.dist-info/METADATA +135 -0
- gdsdiff-0.1.0.dist-info/RECORD +85 -0
- gdsdiff-0.1.0.dist-info/WHEEL +5 -0
- gdsdiff-0.1.0.dist-info/entry_points.txt +4 -0
- gdsdiff-0.1.0.dist-info/licenses/LICENSE +674 -0
- gdsdiff-0.1.0.dist-info/top_level.txt +1 -0
gdsdiff/__init__.py
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"""GPU-assisted GDS geometry comparison tools."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from importlib import import_module
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
_EXPORT_MODULES = {
|
|
8
|
+
"__version__": "._version",
|
|
9
|
+
"AllowedRegion": ".config",
|
|
10
|
+
"AssemblyProfile": ".profiles",
|
|
11
|
+
"Backend": ".semantics",
|
|
12
|
+
"CandidateWindow": ".windows",
|
|
13
|
+
"CellIdentity": ".hierarchy",
|
|
14
|
+
"CanonicalRecord": ".canonicalize",
|
|
15
|
+
"ClassifiedComponent": ".policy",
|
|
16
|
+
"CompareConfig": ".config",
|
|
17
|
+
"CompareReport": ".report",
|
|
18
|
+
"CompareRunResult": ".api",
|
|
19
|
+
"CompareStatus": ".semantics",
|
|
20
|
+
"CudaPreparationError": ".cuda_setup",
|
|
21
|
+
"CudaPreparationReport": ".cuda_setup",
|
|
22
|
+
"CudaToolchainReport": ".cuda_setup",
|
|
23
|
+
"CombinedProfileSummary": ".profiles",
|
|
24
|
+
"ComponentSummary": ".report",
|
|
25
|
+
"CpuTilePrefilterResult": ".tiling",
|
|
26
|
+
"DesignHistoryEntry": ".design_history",
|
|
27
|
+
"DifferenceDirection": ".semantics",
|
|
28
|
+
"DiffFragment": ".exact_oracle",
|
|
29
|
+
"DiffGdsWriteResult": ".diff_gds",
|
|
30
|
+
"EvidenceEngine": ".semantics",
|
|
31
|
+
"ExactDiffMarkdownWriteResult": ".exact_diff_markdown",
|
|
32
|
+
"ExactLayerTask": ".exact_oracle",
|
|
33
|
+
"ExactOracleResult": ".exact_oracle",
|
|
34
|
+
"ExtractionResult": ".extract",
|
|
35
|
+
"ExtractionStats": ".extract",
|
|
36
|
+
"FailurePolicy": ".semantics",
|
|
37
|
+
"GdsInventory": ".inventory",
|
|
38
|
+
"GdsMetadata": ".gds_metadata",
|
|
39
|
+
"GridResolution": ".grid",
|
|
40
|
+
"GridSpec": ".config",
|
|
41
|
+
"HierarchyCompareResult": ".hierarchy",
|
|
42
|
+
"InternResult": ".canonicalize",
|
|
43
|
+
"LayerExactDiff": ".exact_oracle",
|
|
44
|
+
"LayerPolicyResult": ".policy",
|
|
45
|
+
"LayerReport": ".report",
|
|
46
|
+
"LayerSpec": ".config",
|
|
47
|
+
"LayerTable": ".geometry",
|
|
48
|
+
"NativeCapabilities": ".native",
|
|
49
|
+
"OversizedPolygon": ".tiling",
|
|
50
|
+
"PathPolicy": ".semantics",
|
|
51
|
+
"PolicyClassificationResult": ".policy",
|
|
52
|
+
"PolygonBuffer": ".geometry",
|
|
53
|
+
"PolygonInventoryDelta": ".exact_diff_markdown",
|
|
54
|
+
"PolygonInventoryRecord": ".exact_diff_markdown",
|
|
55
|
+
"ProfileCheck": ".profiles",
|
|
56
|
+
"ProfileResult": ".profiles",
|
|
57
|
+
"ADVERSARIAL_SYNTHETIC_CASES": ".synthetic_suite",
|
|
58
|
+
"BASE_SYNTHETIC_CASES": ".synthetic_suite",
|
|
59
|
+
"RecordInventory": ".inventory",
|
|
60
|
+
"ReferenceChange": ".hierarchy",
|
|
61
|
+
"SelectedLayerPresence": ".inventory",
|
|
62
|
+
"SpatialIndex": ".spatial",
|
|
63
|
+
"SCALE_PROFILES": ".synthetic_suite",
|
|
64
|
+
"SYNTHETIC_CASES": ".synthetic_suite",
|
|
65
|
+
"ScaleProfile": ".synthetic_suite",
|
|
66
|
+
"TileConfig": ".tiling",
|
|
67
|
+
"TileKey": ".tiling",
|
|
68
|
+
"TemplateExtractionResult": ".templates",
|
|
69
|
+
"TemplateFindResult": ".templates",
|
|
70
|
+
"SyntheticBenchmarkRun": ".synthetic_suite",
|
|
71
|
+
"SyntheticCaseBuild": ".synthetic_suite",
|
|
72
|
+
"SyntheticCaseDefinition": ".synthetic_suite",
|
|
73
|
+
"SyntheticCaseRecord": ".synthetic_suite",
|
|
74
|
+
"SyntheticEdit": ".synthetic_suite",
|
|
75
|
+
"WindowConfig": ".windows",
|
|
76
|
+
"WindowedExactFailure": ".windowed_exact",
|
|
77
|
+
"WindowedExactResult": ".windowed_exact",
|
|
78
|
+
"WindowedHierarchyExtractionResult": ".hierarchy_extract",
|
|
79
|
+
"WindowedHierarchyStats": ".hierarchy_extract",
|
|
80
|
+
"CUDA_ARCH_ENV": ".native",
|
|
81
|
+
"bbox_tile_range": ".tiling",
|
|
82
|
+
"bbox_union": ".spatial",
|
|
83
|
+
"bboxes_intersect": ".spatial",
|
|
84
|
+
"build_candidate_windows": ".windows",
|
|
85
|
+
"build_layer_reports": ".report",
|
|
86
|
+
"benchmark_synthetic_records": ".synthetic_suite",
|
|
87
|
+
"backend_diagnostics": ".diagnostics",
|
|
88
|
+
"build_polygon_inventory_delta": ".exact_diff_markdown",
|
|
89
|
+
"build_polygon_inventory_delta_from_record_delta": ".exact_diff_markdown",
|
|
90
|
+
"build_synthetic_suite": ".synthetic_suite",
|
|
91
|
+
"canonical_cell_identity": ".hierarchy",
|
|
92
|
+
"canonicalize_polygon": ".canonicalize",
|
|
93
|
+
"check_assembly_profile": ".profiles",
|
|
94
|
+
"classify_exact_differences": ".policy",
|
|
95
|
+
"combined_profile_summary": ".profiles",
|
|
96
|
+
"compare_gds_files": ".api",
|
|
97
|
+
"compare_gds_paths": ".api",
|
|
98
|
+
"compare_hierarchy": ".hierarchy",
|
|
99
|
+
"discover_native_capabilities": ".native",
|
|
100
|
+
"inspect_cuda_toolchain": ".cuda_setup",
|
|
101
|
+
"prepare_cuda": ".cuda_setup",
|
|
102
|
+
"exit_code_for_status": ".semantics",
|
|
103
|
+
"expand_bbox": ".spatial",
|
|
104
|
+
"extract_gds_polygons": ".extract",
|
|
105
|
+
"extract_template": ".templates",
|
|
106
|
+
"extract_hierarchy_window": ".hierarchy_extract",
|
|
107
|
+
"extract_hierarchy_window_from_gds": ".hierarchy_extract",
|
|
108
|
+
"floor_div": ".tiling",
|
|
109
|
+
"find_template": ".templates",
|
|
110
|
+
"format_twice_area": ".exact_oracle",
|
|
111
|
+
"intern_polygons": ".canonicalize",
|
|
112
|
+
"inventory_gds": ".inventory",
|
|
113
|
+
"native_build_fingerprint": ".native_cache",
|
|
114
|
+
"parse_layer_selector": ".config",
|
|
115
|
+
"parse_allowed_region": ".config",
|
|
116
|
+
"parse_allowed_whole_layer": ".config",
|
|
117
|
+
"read_gds_metadata": ".gds_metadata",
|
|
118
|
+
"render_design_history_entry": ".design_history",
|
|
119
|
+
"render_exact_diff_markdown": ".exact_diff_markdown",
|
|
120
|
+
"resolve_comparison_grid": ".grid",
|
|
121
|
+
"resolve_selected_layers": ".inventory",
|
|
122
|
+
"run_cpu_tile_prefilter": ".tiling",
|
|
123
|
+
"run_full_exact_oracle": ".exact_oracle",
|
|
124
|
+
"run_windowed_exact_oracle": ".windowed_exact",
|
|
125
|
+
"snap_to_grid": ".grid",
|
|
126
|
+
"validate_int64_coordinate": ".grid",
|
|
127
|
+
"validate_report_dict": ".report",
|
|
128
|
+
"validate_synthetic_case_with_cpu_oracle": ".synthetic_suite",
|
|
129
|
+
"write_diff_gds": ".diff_gds",
|
|
130
|
+
"write_benchmark_summary": ".synthetic_suite",
|
|
131
|
+
"write_exact_diff_markdown": ".exact_diff_markdown",
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
__all__ = sorted(_EXPORT_MODULES)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def __getattr__(name: str) -> Any:
|
|
138
|
+
module_name = _EXPORT_MODULES.get(name)
|
|
139
|
+
if module_name is None:
|
|
140
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
141
|
+
module = import_module(module_name, __name__)
|
|
142
|
+
value = getattr(module, name)
|
|
143
|
+
globals()[name] = value
|
|
144
|
+
return value
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def __dir__() -> list[str]:
|
|
148
|
+
return sorted((*globals(), *__all__))
|
gdsdiff/__main__.py
ADDED
gdsdiff/_environment.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def get_environment(primary: str, legacy: str, default: str | None = None) -> str | None:
|
|
7
|
+
"""Read a branded setting while honoring the 0.1.x legacy fallback."""
|
|
8
|
+
|
|
9
|
+
value = os.environ.get(primary)
|
|
10
|
+
if value is not None:
|
|
11
|
+
return value
|
|
12
|
+
return os.environ.get(legacy, default)
|
gdsdiff/_version.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _installed_distribution_version(distribution_name: str, fallback: str) -> str:
|
|
8
|
+
"""Read an unpacked wheel's version without importing metadata machinery."""
|
|
9
|
+
|
|
10
|
+
normalized_name = distribution_name.lower().replace("-", "_").replace(".", "_")
|
|
11
|
+
for entry in sys.path:
|
|
12
|
+
root = Path(entry or ".")
|
|
13
|
+
if not root.is_dir():
|
|
14
|
+
continue
|
|
15
|
+
try:
|
|
16
|
+
candidates = root.glob(f"{normalized_name}-*.dist-info/METADATA")
|
|
17
|
+
for metadata_path in candidates:
|
|
18
|
+
metadata_name = None
|
|
19
|
+
metadata_version = None
|
|
20
|
+
for line in metadata_path.read_text(encoding="utf-8").splitlines():
|
|
21
|
+
if line.startswith("Name: "):
|
|
22
|
+
metadata_name = line[6:].strip().lower().replace("-", "_").replace(".", "_")
|
|
23
|
+
elif line.startswith("Version: "):
|
|
24
|
+
metadata_version = line[9:].strip()
|
|
25
|
+
if metadata_name is not None and metadata_version is not None:
|
|
26
|
+
break
|
|
27
|
+
if metadata_name == normalized_name and metadata_version:
|
|
28
|
+
return metadata_version
|
|
29
|
+
except (OSError, UnicodeError):
|
|
30
|
+
continue
|
|
31
|
+
return fallback
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
__version__ = _installed_distribution_version("gdsdiff", "0.1.0")
|