---
# System prepended metadata

title: Complete definition and validation of the GTScript execution model
tags: [cycle 2]

---

# Complete definition and validation of the GTScript execution model

###### tags: `cycle 2`

## Assigned

to Felix, Anton, full cycle

## Overview

GTScript [parallel model](https://github.com/GridTools/concepts/blob/master/GTScript-Parallel-model.md) is partially defined but not yet complete. It is specially important to define the expected behavior for the computation of the horizontal extents in the stencils. This project aims to complete the definition, and verify it empirically implementing and validating an appropriate set of relevant examples (from typical simple cases to convoluted corner cases).

The formal semantics of the model are not well defined and often the different backends implement different semantics. Some of the semantics are inherited from GridTools and also share the same conceptual weaknesses or undefined behavior.

Recently, many projects hit undefined corner cases (for example during backend development) and extensions (like horizontal regions, halo exchanges) are hard to tackle. Well-defined semantics should avoid undefined behavior, and clarify to backend developers which optimizations are valid, and last but not least, give the users the ability to have a clear understanding of the model, by giving a formal description.


## Goals

- Understand the semantics and limitations of the current parallel model.
- Define the method for the computation of the horizontal domains in both horizontal (parallel) and vertical (solver-like) stencils.
- Solve issues related to the GT-like extended compute domains.
- Provide a good model for composability of stencils (calling stencils from stencils etc.).
- Define a list of stencils to test the model, implement them with GT4Py and add CI tests to validate the implementation.
- Re-examine and clarify the current limitations regarding reads with horizontal offsets after writes to the same field inside a stencil.

#### Non-Goals

- Any kind of performance optimization.
- Adding new features to the DSL (e.g. control-flow part).


## Appetite

- Full cycle


## Solution

#### Parallel model definition

Several people involved in the discussion part to define the complete semantics of the DSL syntax and its expansion in the internal representation of the execution model.

#### Implementation and validation of test cases

1-2 developers working in the implementation and validation.

