# Compatibility Contract

The kernel exists to prevent geometry-engine drift. A pure-Rust backend should
not be considered compatible with GEOS/JTS-style behavior until it satisfies the
operation contract below.

## Operation-Level Contract

Each operation case records:

- operation name
- input geometries in planar coordinates
- operation parameters
- reference output generated by the GEOS reference backend or a reviewed
  canonical fixture
- tolerance policy

The first operation targets are:

| Operation | Exactness policy |
| --- | --- |
| `polygon_area` | Absolute tolerance |
| `largest_polygon` | Exact component choice after canonicalization |
| `buffer_polygon` | Area tolerance plus topology checks |
| `line_buffer` | Area tolerance plus topology checks |
| `intersection` | Area tolerance plus canonical topology checks |
| `difference` | Area tolerance plus canonical topology checks |
| `line_polygon_intersections` | Point count exact, coordinate tolerance |

## Application-Level Validation

Operation-level similarity is not always enough for downstream applications.
Applications that depend on exact higher-level outputs should keep their own
validation data and acceptance criteria outside this package.

This repository should contain only generic geometry cases that are safe to
publish and useful across applications.

## Backend Promotion Rule

The default backend can change only when the candidate backend passes the
operation contract and does not weaken documented behavior. A smaller bundle or
faster runtime is not enough if it changes the public geometry semantics.
