refactor[next]: merge OTF definitions into stages, extract artifacts module - #2737
Open
egparedes wants to merge 1 commit into
Open
refactor[next]: merge OTF definitions into stages, extract artifacts module#2737egparedes wants to merge 1 commit into
egparedes wants to merge 1 commit into
Conversation
2 tasks
egparedes
marked this pull request as ready for review
July 30, 2026 17:58
egparedes
force-pushed
the
otf-split-1-stages-artifacts
branch
from
July 30, 2026 17:58
7af9fe4 to
4f33611
Compare
…module Restructure the `gt4py.next.otf` modules so that the DSL-aware and DSL-agnostic halves of the toolchain vocabulary live in separate modules, without renaming any class: - Merge `otf.definitions` into `otf.stages`: definition-stage TypeVars and aliases (`IRDefinitionT`, `ArgsDefinitionT`, `ConcreteProgramDef`, `CompilableProgramDef`) and the step contracts (`TranslationStep`, `CompilationStep`) now live in `stages`; `otf.definitions` is deleted. - Extract `otf.artifacts`: the DSL-agnostic artifact models (`ProgramSource`, `BindingSource`, `ExtensionSource`, `BuildSystemProject`, `ExecutableProgram`, `CompilationArtifact`) plus all code-spec classes (`otf.code_specs` is deleted) and `format_source` (moved from `binding.interface`, breaking the interface->code_specs import edge). - Move the `ConcreteArtifact` pair type from `otf.toolchain` to the DSL-neutral bottom module `otf.workflow`. - Drop the step-protocol base classes from `CPPCompiler`, `DaCeTranslator` and `DaCeCompiler`; the protocols are structural, so nothing changes for isinstance/fingerprint purposes (fingerprints use qualified names only). After this, `otf.compilation`, `otf.runners` and `otf.binding` no longer import any IR/frontend module. Breaking: `gt4py.next.otf.definitions` and `gt4py.next.otf.code_specs` are gone, and the names they held must be imported from `gt4py.next.otf.stages` and `gt4py.next.otf.artifacts` respectively; `otf.toolchain.ConcreteArtifact` moves to `otf.workflow.ConcreteArtifact`. No compatibility re-exports are left behind. Claude-Session: https://claude.ai/code/session_01R8zRtFMhdJ8c96XJYCXkRk
egparedes
force-pushed
the
otf-split-1-stages-artifacts
branch
from
July 31, 2026 16:15
4f33611 to
fa8a324
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Second PR of the
otf-toolchain-splitstack (on top of #2736). Pure module restructuring — no class is renamed, no behavior changes:otf.definitionsintootf.stages: the definition-stage TypeVars/aliases (IRDefinitionT,ArgsDefinitionT,ConcreteProgramDef,CompilableProgramDef) and the step contracts (TranslationStep,CompilationStep) now live instages, which becomes the single DSL-aware vocabulary module.otf/definitions.pyis deleted.otf.artifacts: the DSL-agnostic artifact models (ProgramSource,BindingSource,ExtensionSource,BuildSystemProject,ExecutableProgram,CompilationArtifact), all code-spec classes (otf/code_specs.pyis deleted), andformat_source(moved out ofbinding.interface, which removes theinterface -> code_specsimport edge and with it the last cycle risk in the bottom layer).ConcreteArtifactpair type fromotf.toolchainto the DSL-neutral bottom moduleotf.workflow, with no re-export left behind.CPPCompiler,DaCeTranslator, andDaCeCompiler— the step protocols are structural (Protocol), so subclassing them was never required; explicit mixin bases are kept where.replace()is actually used.Net effect:
otf.workflow,otf.artifacts,otf.compilation,otf.runners, andotf.bindingare now formally IR-free (no imports fromffront/iterator), preparing the later split ofotfinto toolchain core and build infrastructure. Persistent cache keys are unchanged for all cached steps (fingerprints use fully-qualified class names; no cached class moved).Breaking changes
No compatibility re-exports are left behind — a clean break rather than a deprecation period:
gt4py.next.otf.definitionsno longer exists; import those names fromgt4py.next.otf.stages.gt4py.next.otf.code_specsno longer exists; import the code-spec classes fromgt4py.next.otf.artifacts.otf.stages.<Name>— useotf.artifacts.<Name>.otf.toolchain.ConcreteArtifactmoves tootf.workflow.ConcreteArtifact.Requirements
https://claude.ai/code/session_01R8zRtFMhdJ8c96XJYCXkRk