Spatiality and computer-vision perception
Forma treats space and perception as a two-plane boundary with one governed
door. The language (std::world::space) knows only qualitative spatial
relations — Region, Place, SpatialReferenceSystem, Representation,
SpatialContains/Overlaps/Adjacent/Disjoint with transitivity and
symmetry — and deliberately has no coordinates and no metric. All metric
computation (geometry, CRS transforms, camera homographies, neural object
detection, radar tracking) lives on the realization plane behind the MRS
provider boundary, and reaches the semantic world only as evidence admitted
through a bridge authorized by the resolved .fsl declaration itself.
SEMANTIC PLANE (.fsl) REALIZATION PLANE (MRS/providers)
Region, SRS, Representation geo / proj4rs / nalgebra / tract-onnx
SpatialContains, SpatialOverlaps, ... RegionRing, CrsSpec, homography, ONNX
qualitative, zero coordinates metric computation, digest-pinned
▲ │
└──────── ADMITTED OBSERVATION BRIDGE ─────────┘
ProviderEvidence != SemanticOutcome; the provider never
chooses the authority — the resolved declaration does
What the implementation covers:
| Capability | Mechanism | Where |
|---|---|---|
| Metric geometry | geo crate (and an external shapely/GEOS process as a substitute provider) | crates/spatial-perception-providers |
| CRS transforms | proj4rs, declared source/target (WGS84 → UTM 23S in the demo), no axis guessing | crates/spatial-perception-providers |
| Camera frames | ground-plane homography over a SHA-256-pinned calibration artifact | crates/spatial-perception-providers |
| Object detection | a separate OS process running real ONNX inference (tract-onnx, YOLOv8n/v5s, COCO-80, digest-pinned model and image) | crates/yard-perception-provider |
| Radar tracking | deterministic clustering → gated Kalman association → N-of-M initiation → scored correlation proposals with preserved ambiguity | crates/formasl-product-airspace |
| Projection | deterministic projection artifact with exact reverse correspondence (feature → SubjectRef → semantic referent) and a domain-rule-free map surface | crates/spatial-perception-providers, demo surface |
The non-collapse laws are the load-bearing part: detection != observation != claim, score != truth, bounding box != region, computed containment != SpatialContains, projection != source mutation, provider failure != semantic negative result. Each is protected by an executable hostile witness
(the perception suite runs 27 of them, including real ONNX inference and a
headless-browser surface witness).
Deep documentation (language level, realization contracts, perception, admission, projection, tutorial with executed transcripts, operations): docs/spatial/spatial-v0.1/. The airspace application that exercises the same machinery at product scale is documented in docs/applications/airspace-control/.