Skip to content

feat[next]: Precompilation with static domains#2483

Draft
SF-N wants to merge 7 commits intoGridTools:mainfrom
SF-N:static_domain_precompilation
Draft

feat[next]: Precompilation with static domains#2483
SF-N wants to merge 7 commits intoGridTools:mainfrom
SF-N:static_domain_precompilation

Conversation

@SF-N
Copy link
Contributor

@SF-N SF-N commented Feb 17, 2026

Add the option to precompile a program with static domains. Previously this was only supported in JIT mode. Instead of providing the domain of each field argument (which is the format used internally) the user just supplies the range of each dimension which is the most common case. Later we can extend this so that different ranges can be supplied, e.g. for fields that are only defined on a subdomain.

program.compile(..., static_domains={Vertex: (0, num_vertices), Edge: (0, num_cells), ...})

Note that a consequence of this syntax is that it is not possible to have a parameter called static_domains and pass a static value to it.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for providing static domain ranges during ahead-of-time compilation so programs decorated with static_domains=True can be precompiled without needing runtime field instances.

Changes:

  • Extend CompiledProgramsPool.compile(...) to optionally construct FieldDomainDescriptor contexts from user-provided domain ranges.
  • Plumb a new static_domains argument through Program.compile(...) to the compiled-program pool.
  • Add an integration test covering precompilation with static domains for tuple arguments.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_compiled_program.py Adjusts compilation parametrization and adds a new test for precompiling with provided static domains.
src/gt4py/next/otf/compiled_program.py Builds FieldDomainDescriptor argument descriptors from provided static domain ranges during precompilation.
src/gt4py/next/ffront/decorator.py Forwards a new static_domains argument through the public compile() API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tehrengruber tehrengruber changed the title feat[next]: Add static_domains for pre-compilation feat[next]: Precompilation with static domains Feb 17, 2026
tehrengruber added a commit to tehrengruber/gt4py that referenced this pull request Feb 17, 2026
tehrengruber added a commit to tehrengruber/gt4py that referenced this pull request Feb 17, 2026
tehrengruber added a commit to tehrengruber/gt4py that referenced this pull request Feb 17, 2026
tehrengruber added a commit to tehrengruber/gt4py that referenced this pull request Feb 17, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Comments