Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2504216
personal/egparedes: connectivities as types — Cartesian axis dimensions
egparedes Oct 1, 2026
94d1726
personal/egparedes: connectivities as types — UGRID/SGRID alignment a…
egparedes Oct 1, 2026
e743269
personal/egparedes: connectivities as types — correctness pass after …
egparedes Oct 1, 2026
21e6b8f
personal/egparedes: connectivities as types — split the note into cor…
egparedes Oct 1, 2026
5df95ff
personal/egparedes: connectivities as types — a slide deck appendix
egparedes Oct 1, 2026
e7a73b1
Merge remote-tracking branch 'origin/main' into explain-staggered-con…
egparedes Oct 1, 2026
6a7fa94
personal/egparedes: connectivities as types — fix the deck's rendered…
egparedes Oct 1, 2026
40f538f
personal/egparedes: connectivities as types — address the Copilot review
egparedes Oct 1, 2026
80f9d04
personal/egparedes: connectivities as types — second Copilot pass
egparedes Oct 1, 2026
8e1a212
personal/egparedes: connectivities as types — lead the deck with the …
egparedes Oct 1, 2026
96caa0e
personal/egparedes: connectivities as types — resolve the implementat…
egparedes Oct 1, 2026
7137baf
personal/egparedes: connectivities as types — renumber the ADRs to 00…
egparedes Oct 1, 2026
8292eff
personal/egparedes: connectivities as types — sync with the implement…
egparedes Oct 1, 2026
7eb0d02
personal/egparedes: connectivities as types — refresh the deck's as-o…
egparedes Oct 1, 2026
606429a
personal/egparedes: connectivities as types — the kind fingerprint ho…
egparedes Oct 1, 2026
4583164
personal/egparedes: connectivities as types — split the two N2 leak s…
egparedes Oct 2, 2026
560d613
personal/egparedes: connectivities as types — fix the core/appendix d…
egparedes Oct 2, 2026
cd631ff
personal/egparedes: connectivities as types — three fixes the last co…
egparedes Oct 2, 2026
d0a0792
personal/egparedes: connectivities as types — cosmetic nits from the …
egparedes Oct 2, 2026
99c3989
personal/egparedes: connectivities as types — record the 0-based tabl…
egparedes Oct 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Work-in-progress proposals, organized by contributor.

- [[personal/egparedes/layered-architecture|A layered architecture for gt4py with enforced public/internal decoupling]] — keywords: architecture, layering, tach, modularity, public-api, semi-public, internal, packaging, dependencies, refactoring, infrastructure, over-engineering, otf, workflow, dsl, config, allocators, caching, fingerprint, compiled-program, process-pool, factory-boy, instrumentation, adr, jax, decoupling, migration, tech-debt
- [[personal/egparedes/otf-toolchain-split|Dissolving gt4py.next.otf into a toolchain core and DSL-agnostic build infrastructure]] — keywords: otf, toolchain, workflow, pipeline, refactoring, architecture, layering, modularity, backend, bindings, build-system, caching, runners, compiled-program, factory-boy, naming, observability, stage-inspection, adr, tach, tech-debt
- [[personal/egparedes/connectivities-as-types/connectivities-as-types|Connectivities as types: one declaration for offset, local dimension and provider key]] — keywords: type-system, type-checking, dimensions, local-dimensions, connectivities, offset-provider, unstructured, neighbor-sum, reduction, frontend, foast, gtir, embedded, gtfn, dace, nominal-types, dependent-types, metaclass, serialization, fingerprint, staggering, migration, adr, tech-debt, shared-local-dimensions, implemented
- [[personal/egparedes/discretization-independent-fd-syntax|A discretization-independent surface syntax for finite-difference computations]] — keywords: finite-difference, finite-volume, mesh-invariant, structured, unstructured, exterior-calculus, dec, mimetic, de-rham, location-typing, stencil, weight-generation, rbf-fd, gfdm, moment-matching, conservation, field-operators, icon, pace, pmap, fv3, ifs-fvm, arakawa-staggering, c-grid, d-grid, a-grid, dynamical-core, hevi, vertical-solve, elliptic-solve, mpdata, semi-implicit, miura, atlas, prior-art, dsl-design
- [[personal/egparedes/connectivities-as-types/connectivities-as-types|Connectivities as types: one declaration for offset, local dimension and provider key]] — keywords: type-system, type-checking, dimensions, local-dimensions, connectivities, offset-provider, unstructured, neighbor-sum, reduction, frontend, foast, gtir, embedded, gtfn, dace, nominal-types, dependent-types, metaclass, serialization, fingerprint, staggering, axis-dimensions, cw-complex, exterior-calculus, domain, dimension-kind, ugrid, sgrid, migration, adr, tech-debt, shared-local-dimensions, implemented
- [[personal/egparedes/discretization-independent-fd-syntax|A discretization-independent surface syntax for finite-difference computations]] — keywords: finite-difference, finite-volume, mesh-invariant, structured, unstructured, exterior-calculus, dec, mimetic, de-rham, cw-complex, location-typing, stencil, weight-generation, rbf-fd, gfdm, moment-matching, conservation, field-operators, icon, pace, pmap, fv3, ifs-fvm, arakawa-staggering, c-grid, d-grid, a-grid, dynamical-core, hevi, vertical-solve, elliptic-solve, mpdata, semi-implicit, miura, atlas, prior-art, dsl-design

<!-- Entry format (index only the main proposal; link appendices/implementations
from within the proposal document itself, not here):
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "Connectivities as types — alternatives considered"
author: egparedes
tags: [type-system, connectivities, local-dimensions, offset-provider, nominal-types]
created: 2026-10-01
status: draft
---

> **Appendix** to [[personal/egparedes/connectivities-as-types/connectivities-as-types|Connectivities as types]].
> The alternatives rejected on grounds other than the axis levels, which are in the
> [[personal/egparedes/connectivities-as-types/connectivities-as-types_staggering|staggering appendix]]. Each entry states the alternative, then why
> it loses.

## Alternatives

**Keep every concept; fix only which string wins.** Emit `FieldOffset.value`
instead of `foast.Name.id` in `foast_to_gtir`, validate `value == target[-1].value`
eagerly, extend the #1789 regression test. Two PRs, low risk — and the
`foast_to_gtir` part is a real bug, fixed regardless, in GridTools/gt4py#2898.
But it *enforces* the tangle rather than removing it; no concept goes away.

**A declaration object with a derived local dimension, keeping `Dimension`
instances.** Same shape as this proposal minus static typing and minus type
identity: `local_dim.value == name` by construction, provider keyed by the
declaration object. Superseded by building on dimensions as types instead:
once dimensions are classes, the nested-class form is both simpler and
statically meaningful.

**`(name, kind)` value equality with an interning registry** (the design of
[[shared/dimensions-as-types|dimensions as types]] and GridTools/gt4py#2844).
Keeps independently declared same-named dimensions interchangeable and
avoids the importability rule. Rejected because it decouples the Python
type's identity from the IR's, needs a registry plus `copyreg` plus a custom
fingerprint deconstructor to paper over that gap, and cannot give a nested
`V2E.Local` a unique name without further convention. See [[personal/egparedes/connectivities-as-types/connectivities-as-types#identity-is-the-qualified-python-name|Identity]].

**Integer type parameters for `max_neighbors`** (`LocalDimensionIndex[F: int, M: int]`).
Would need `Literal[6]` type arguments and `Final[F]` over a `TypeVar`;
checkers gain nothing. Class keywords instead.

**Data on the class** (`data: ConnectivityField | Unbound`). Process-global
mutable state; tests bind several meshes per process, and the compile cache
assumes the table travels separately from the type. Binding per call, keyed by
the class, keeps the invariant structural.

**`axis=V2E` as sugar.** Rejected for now; keep the local axis explicit.

**Static-only `max_neighbors` / `min_neighbors`.** Simplest, and correct for
fixed-arity meshes. Rejected as the *only* mode because it binds DSL source
to one mesh family (`fvm_nabla_setup.py` sizes `V2E` from the atlas mesh) and
because skip-value presence is configuration-dependent in ICON, so a static
`min_neighbors` forces either duplicate classes or always-on skip handling.
Declared counts stay available as a constraint; see [[personal/egparedes/connectivities-as-types/connectivities-as-types#binding-model|Binding model]].

**Owner-less local axes as non-LOCAL dimensions.** Rejected: they would
become domain dimensions with a range in every program domain and lose the
sparse storage treatment, changing ICON4Py's layout for `LsqUnkDim` fields.
Loading