Skip to content

Commit 2dc80ba

Browse files
MImmesbergerclaude
andcommitted
GEP 10: describe the Layer-2 boundary check as equivalence, not dimensionality (S4)
The boundary check was upgraded (S4) from a dimensionality test to an equivalence test that divides out currency and a flow's reference period and requires the residuals to match — so a same-dimension level error such as a HECTARES column tagged m², or a YEARS input tagged in months, is rejected rather than silently mis-scaled. Update the Layer-2 table cell and prose, which still called it "the dimension check", to match the shipped behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1c6fe8d commit 2dc80ba

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

docs/geps/gep-10.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,11 @@ the error pointing the author at the per-axis declaration.
417417

418418
The checks run in two layers, both at build time:
419419

420-
| | **Layer 1 — DAG validity** | **Layer 2 — boundary** |
421-
| ------ | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
422-
| when | `fail_if` on the assembled environment | GEP-9 canonicalisation boundary |
423-
| input | none — synthetic `Quantity`s | the user's unit-annotated input tree |
424-
| checks | inferred body unit vs. declaration; producer↔consumer edges agree | tag currency → run currency; period vs. suffix; unknown token rejected; every tag's dimension vs. resolved unit |
420+
| | **Layer 1 — DAG validity** | **Layer 2 — boundary** |
421+
| ------ | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
422+
| when | `fail_if` on the assembled environment | GEP-9 canonicalisation boundary |
423+
| input | none — synthetic `Quantity`s | the user's unit-annotated input tree |
424+
| checks | inferred body unit vs. declaration; producer↔consumer edges agree | tag currency → run currency; period vs. suffix; unknown token rejected; every tag equivalent to its resolved unit (currency and flow period aside) |
425425

426426
#### Layer 1: the **dry-run** dimensionality check.
427427

@@ -531,12 +531,15 @@ another directly — which does not occur in the current system.
531531
**Layer 2** is offered through the unit-annotated input tree (a sibling of the ordinary
532532
input tree in which every leaf is a pint `Quantity`). When the mode is used **every**
533533
leaf must be tagged, including identifiers and other dimensionless columns (tagged
534-
`dimensionless`). The dimension check reads the extracted input units against the
535-
resolved environment units; it feeds no node, so it adds no back-edge to the boundary
536-
and needs no declared unit threaded through `processed_data`. Symmetrically, the
537-
**unit-annotated result tree** relabels each output leaf with its precise run-currency
538-
unit (`euro/month`, not the agnostic `CURRENCY_FLOW`) — pure naming, since results are
539-
already computed in the run currency.
534+
`dimensionless`). The boundary check requires each tagged input to be *equivalent* to
535+
its resolved environment unit once the two axes handled elsewhere — currency (converted
536+
by the strip path) and a flow's reference period (owned by the suffix guard) — are
537+
divided out, so a same-dimension level error such as a `HECTARES` column tagged `m²`, or
538+
a `YEARS` input tagged in months, is rejected rather than silently mis-scaled. It feeds
539+
no node, so it adds no back-edge to the boundary and needs no declared unit threaded
540+
through `processed_data`. Symmetrically, the **unit-annotated result tree** relabels
541+
each output leaf with its precise run-currency unit (`euro/month`, not the agnostic
542+
`CURRENCY_FLOW`) — pure naming, since results are already computed in the run currency.
540543

541544
(gep-10-auto)=
542545

0 commit comments

Comments
 (0)