Architecture & Engineering Design
The shape packing engine utilizes a decoupled, high-throughput architecture splitting execution between Python orchestration and Rust numerical optimization.
System Architecture Diagram
graph TD
A["Python Agent Orchestrator<br/>(src/shape_packing/)"] --> B["Rust Solver Backend<br/>(packer_rs)"]
A --> C["Python Optimization<br/>(scipy basinhopping)"]
B --> D["Rigorous Verification Engine<br/>(SAT Overlap & Boundary Checks)"]
C --> D
D --> E["Site Data & Dashboard<br/>(Astro Dashboard Data)"]
style A fill:#111827,stroke:#0284c7,stroke-width:1.5px,color:#f8fafc
style B fill:#111827,stroke:#38bdf8,stroke-width:1.5px,color:#f8fafc
style C fill:#111827,stroke:#818cf8,stroke-width:1.5px,color:#f8fafc
style D fill:#111827,stroke:#10b981,stroke-width:1.5px,color:#f8fafc
style E fill:#111827,stroke:#f59e0b,stroke-width:1.5px,color:#f8fafc
Key Components
- Agent Loop (
agent_loop.py): Selects candidate problems based on priority queue rankings and status gaps. - Rust Solver (
packer_rs): Executes 10,000 to 100,000 random starts per second for non-overlapping polygon placements. - Verification Layer (
verify_solution.py): Enforces float tolerances ($10^-5$ precision) using Separating Axis Theorem (SAT). - Site Builder (
build_site_data.py): Aggregates solutions and benchmark status into JSON artifacts at build time.