bloqade.lanes.arch.geometry.ArchSpecGeometry
classArchSpecGeometry¶source
bloqade.lanes.arch.geometry.ArchSpecGeometry
Geometry-level query helper wrapping an ArchSpec.
class ArchSpecGeometry(arch_spec: 'ArchSpec | _RustArchSpec')Provides methods for retrieving coordinate grids, flat site lists, and bus descriptors from an architecture specification. Intended for downstream consumers who need geometry-level data without walking Rust zone objects directly.
Accepts either a Python ArchSpec or a
raw Rust _RustArchSpec object, so it can be constructed from either
layer of the stack.
Parameters
| Name | Type | Description |
|---|---|---|
arch_spec | 'ArchSpec | _RustArchSpec' |
methodget_zone_grid¶source
bloqade.lanes.arch.geometry.ArchSpecGeometry.get_zone_grid
def get_zone_grid(zone_id: int) -> GeoGridGet the coordinate grid for a zone as a bloqade.geometry.Grid.
Parameters
| Name | Type | Description |
|---|---|---|
zone_id | int | Zone index. |
Returns
(GeoGrid, GeoGrid)A ``bloqade.geometry.dialects.grid.Grid`` with the zone's x and y positions.
Raises
| Type | Description |
|---|---|
ValueError | If zone_id is out of range. |
methodget_all_sites¶source
bloqade.lanes.arch.geometry.ArchSpecGeometry.get_all_sites
def get_all_sites() -> list[tuple[float, float]]Get all site positions across all zones in canonical order.
Returns positions in zone-major order, with each zone flattened
in column-major grid order (x outer, y inner).
Each position is an (x, y) tuple.
Returns
list[tuple[float, float]]
methodget_available_buses¶source
bloqade.lanes.arch.geometry.ArchSpecGeometry.get_available_buses
def get_available_buses(zone_id: int) -> list[BusDescriptor]Enumerate all valid bus descriptors for a zone.
Parameters
| Name | Type | Description |
|---|---|---|
zone_id | int | Zone index. |
Returns
(list[BusDescriptor], list[BusDescriptor])List of ``BusDescriptor`` for each (bus_id, move_type, direction) combination that has at least one lane in this zone.
Raises
| Type | Description |
|---|---|
ValueError | If zone_id is out of range. |
methodget_grid_endpoints¶source
bloqade.lanes.arch.geometry.ArchSpecGeometry.get_grid_endpoints
Signature
def get_grid_endpoints(zone_id: int, bus_id: int, move_type: MoveType, direction: Direction) -> tuple[GeoGrid, GeoGrid]Get start and end grids for a bus move at full occupancy.
Returns two bloqade.geometry.Grid objects representing the
source and destination positions for all lanes in the specified
bus group.
Parameters
| Name | Type | Description |
|---|---|---|
zone_id | int | Zone index. |
bus_id | int | Bus index within the zone. |
move_type | MoveType | SITE or WORD. |
direction | Direction | FORWARD or BACKWARD. |
Returns
(GeoGrid, GeoGrid)``(src_grid, dst_grid)`` where each grid contains the physical positions of all source/destination sites for this bus.
Raises
| Type | Description |
|---|---|
ValueError | If zone_id or bus_id is out of range, or move_type is not SITE or WORD. |