refactor[next]: rename Backend to Toolchain and align field names - #2741
Open
egparedes wants to merge 1 commit into
Open
refactor[next]: rename Backend to Toolchain and align field names#2741egparedes 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-2-toolchain-naming
branch
from
July 30, 2026 17:58
40c134b to
63713c3
Compare
Adopt the vocabulary ADR 0017 already defines: the root object that carries a program from DSL source to a runnable callable is the *toolchain*, not the *backend* (which is one of its two halves). Renamed: - `next.backend.Backend` -> `next.backend.Toolchain` - `Toolchain.transforms` -> `Toolchain.frontend` - `Toolchain.executor` -> `Toolchain.backend` - `otf.workflow.ConcreteArtifact` -> `otf.workflow.ProgramWithArgs` - `ProgramWithArgs.data` -> `ProgramWithArgs.definition` - `otf.stages.CompilableProgramDef` -> `otf.stages.CompilableProgram` - `gtx.typing.Backend` -> `gtx.typing.Toolchain` These are hard renames: no deprecation aliases are kept, so downstream has to move in this release rather than drift on a compatibility layer. An alias would have been partial anyway -- constructing with the old keyword names cannot be aliased on a dataclass without hand-writing `__init__` -- and a half-working compatibility layer is harder to act on than one loud break. Also resolves the `TODO(tehrengruber)` in `backend.py` asking for exactly this rename, and records the decision in a new ADR 0027, which partially supersedes ADR 0011 and refines ADR 0017. No behavior change. Fingerprints embed qualified class and field names, so the `ProgramWithArgs` rename rotates the two persistent translation-cache keys (gtfn, dace) once; `BUILD_CACHE_VERSION_ID` already rotates them on every release, so this only means one extra cache miss on upgrade. Claude-Session: https://claude.ai/code/session_01R8zRtFMhdJ8c96XJYCXkRk
egparedes
force-pushed
the
otf-split-2-toolchain-naming
branch
from
July 31, 2026 16:15
63713c3 to
5dfb78f
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
Third PR of the
otf-toolchain-splitstack (on top of #2737). Pure renaming — no behavior change.ADR 0017 already defines toolchain as "all the code components that work together to go from DSL code to an optimized, runnable python callable". The root object implementing exactly that is currently called
Backend, with its frontend half namedtransformsand its backend half namedexecutor— so "backend" means both the whole thing and one of its halves. This PR adopts the ADR's vocabulary, resolving the standingTODO(tehrengruber)inbackend.pythat asks for this rename.next.backend.Backendnext.backend.ToolchainToolchain.transformsToolchain.frontendToolchain.executorToolchain.backendotf.workflow.ConcreteArtifactotf.workflow.ProgramWithArgsProgramWithArgs.dataProgramWithArgs.definitionotf.stages.CompilableProgramDefotf.stages.CompilableProgramDeliberately not renamed here:
OTFCompileWorkflow→CompilePipeline(comes with the explicit__call__later in this stack),CompilationTask.executor(different vocabulary — the process-pool runner of ADR 0024), andstages.ConcreteProgramDef.No compatibility aliases
These are hard renames: the old names stop resolving in this release rather than lingering behind a deprecation layer, so downstream migrates once at a known point instead of drifting on a half-working shim. An alias layer would have been partial anyway — constructing with the old keyword names (
Toolchain(executor=…),ProgramWithArgs(data=…),GTFNBackendFactory(executor=…)) cannot be aliased on a dataclass without hand-writing__init__.Removed with no replacement alias:
backend.Backend,Toolchain.transforms,Toolchain.executor,otf.workflow.ConcreteArtifact,ProgramWithArgs.data,otf.stages.CompilableProgramDef, and the publicgtx.typing.Backend(nowgtx.typing.Toolchain) — the one documented public export affected.Other things worth a reviewer's eye
backend, a factory-boy class body declaringbackend = factory.LazyAttribute(...)would shadow thegt4py.next.backendmodule for any later lookup in that same class body.runners/gtfn.pyandrunners/dace/workflow/backend.pytherefore now import it asbackend as next_backend.ItirShim.definition→ItirShim.operator_def(ffront/foast_to_past.py): without this, the.data→.definitionrename would have producedself.definition.definition. No alias — it is an internal lowering detail.EmbeddedDummyBackend.executor→.backendintests/next_tests/definitions.py, keeping the test double on the new vocabulary rather than relying on the deprecation property.iterator/runtime.pynow names'gt4py.next.backend.Toolchain'.iterator/ARCHITECTURE.mdstill has### roundtrip.executor/### double_roundtrip.executorheadings. That document is already substantially stale (it cites abackend_executor.pyand afencil_processors/that no longer exist), so refreshing it belongs in its own change rather than being half-done here.Cache keys
fingerprinting.pyembeds fully-qualified class names and dataclass field names, so renamingConcreteArtifact/datarotates the keys of the two persistent translation caches (gtfn and dace).CachedStepalready mixesBUILD_CACHE_VERSION_ID(=gt4py.__version__, commit-bearing) into every key, so those keys rotate on every release anyway: the effect is one extra cache miss on upgrade, with no risk of stale hits.ADR
Adds ADR 0027 — Toolchain Naming and Pipeline Simplification, which partially supersedes ADR 0011 (its workflow-combinator framework and
otf.step_typesnaming) and refines ADR 0017 (whose term toolchain becomes the name of the root object). The ADR also records the pipeline and observability decisions implemented by the following PRs in this stack, and one-line back-pointers were added to 0011 and 0017.Requirements
https://claude.ai/code/session_01R8zRtFMhdJ8c96XJYCXkRk