Skip to content

docs[next]: examples for the gt4py.next user guide - #3032

Draft
egparedes wants to merge 1 commit into
mainfrom
docs-next-examples
Draft

egparedes wants to merge 1 commit into
mainfrom
docs-next-examples

Conversation

@egparedes

@egparedes egparedes commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follows #3024 (new gt4py.next user guide, already merged). Adds an Examples section to the gt4py.next subsite. The examples were part of #3024 and are split out here so that they can be reviewed separately.

Three complete, small applications, written from scratch as executed MyST notebooks (they are not taken from the workshop material):

Page Content
Horizontal diffusion Flux-limited fourth-order diffusion on a Cartesian grid, with concat_where for the boundaries
Implicit vertical diffusion Backward Euler step solved with a tridiagonal (Thomas) solver made of a forward and a backward scan operator
Operators on an unstructured mesh Gradient, divergence and Laplacian written with connectivities and neighbor reductions

Each example is checked against a NumPy reference, and the horizontal and unstructured ones are also run as a program compiled with gtx.gtfn_cpu and compared with embedded execution.

Other changes

  • The landing page, the quickstart and the welcome page card link to the new section.
  • docs/development/tools/documentation.md mentions the examples/ folder.

The pages are executed by the docs build and by the test_examples nox session, like the rest of the guide.

Requirements

  • All fixes and/or new features come with corresponding tests: the pages are executed in the docs build and by the test_examples session.
  • Important design decisions have been documented in the appropriate ADR inside the docs/development/ADRs/ folder: not applicable.

🤖 Written by an agent on my behalf.

@egparedes
egparedes added this pull request to stack #3025 November 23, 2026 11:50
@egparedes
egparedes force-pushed the docs-next-examples branch 2 times, most recently from c59ed3b to 563d0c4 Compare November 23, 2026 20:43
Base automatically changed from docs-next-user-guide to main November 23, 2026 21:22
Add an Examples section to the gt4py.next subsite with three complete,
small applications written as executed notebooks:

- Horizontal diffusion with flux limiting and concat_where boundaries.
- Implicit vertical diffusion with a tridiagonal solver built from two
  scan operators.
- Gradient, divergence and Laplacian operators on an unstructured mesh.

Each one is checked against a NumPy reference and also run as a compiled
program.
egparedes added a commit that referenced this pull request Nov 23, 2026
## Description

Follows #3023 (documentation site infrastructure, already merged).
Replaces the placeholder page of the `gt4py.next` subsite with new user
documentation, written from scratch as executed MyST notebooks: every
code cell runs when the site is built, so the outputs shown are the real
ones and a failing example fails the build.

The goal is a short and clear guide, not a complete reference:

| Section | Pages |
| --- | --- |
| Getting started | Landing page, quickstart |
| Data structures | Grids and fields (dimensions, domains, allocation,
unstructured meshes) |
| GT4Py DSL | Field operators, premap and neighbors (Cartesian,
unstructured, `concat_where`, staggered dimensions), scan operators,
programs |
| Execution | Executing GT4Py programs: embedded execution, compiled
backends (`dace_cpu`, `gtfn_cpu`), build cache, compiling in advance,
static parameters, static domains, short GPU note |

The worked examples (horizontal diffusion, implicit vertical diffusion,
operators on an unstructured mesh) are split out to #3032, stacked on
this PR, to be reviewed separately.

### Other changes

- `test_examples` nox session: runs every executable page of the
`gt4py.next` subsite, in any of its folders, including the landing page.
- The toolchain guides (`HackTheToolchain.md`, `WorkflowPatterns.md`)
move from `docs/user/next/advanced/` to
`docs/development/next/toolchain/`, since they are developer
documentation. They are still run by `test_examples`.
- The figures of the small unstructured mesh are generated by a script,
`docs/user/next/images/mesh_figures.py`, from the same tables used in
the pages.
- The `gt4py.cartesian` site is now titled "GT4Py Cartesian" instead of
"GT4Py (cartesian)".
- `Documentation` workflow: the site can also be deployed manually from
`main` (workflow dispatch with the `deploy` input), not only from a
release tag.
- The Sphinx configuration of the `gt4py.next` subsite drops the DaCe
SDFG viewer scripts which importing `dace` injects in the notebook
outputs, since they slowed down the loading of every page.
- Welcome page card and `docs/development/tools/documentation.md`
updated to describe the new content.

### Notes

- There is no API reference for `gt4py.next`: the docstrings of the
public API are not ready to be published yet.
- `concat_where` and staggered dimensions are documented and marked as
experimental.
- The GPU section is not executed in the build.
- Some cells hide warnings printed to stderr (`remove-stderr` tag).
#3022 removes those warnings in the library; the tags can be dropped
once it is merged.
- This content was previously part of #3005, where the first review
comments are.

## Requirements

- [x] All fixes and/or new features come with corresponding tests: the
pages are executed in the docs build and by the `test_examples` session.
- [ ] Important design decisions have been documented in the appropriate
ADR inside the [docs/development/ADRs/](docs/development/ADRs/README.md)
folder: not applicable.

🤖 Written by an agent on my behalf.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant