Skip to content

refactor[next]: rename Backend to Toolchain and restructure artifact loading - #2741

Open
egparedes wants to merge 1 commit into
otf-split-1b-plain-buildersfrom
otf-split-2-toolchain-naming
Open

refactor[next]: rename Backend to Toolchain and restructure artifact loading#2741
egparedes wants to merge 1 commit into
otf-split-1b-plain-buildersfrom
otf-split-2-toolchain-naming

Conversation

@egparedes

@egparedes egparedes commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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
  • ffront.foast_to_past.ItirShim.definition -> ItirShim.operator_def,
    freeing the name for the renamed ProgramWithArgs field it now wraps

Beyond the renames, this restructures how artifacts are loaded.
Backend.load_artifact() was an overridable method, so a toolchain needing
backend-specific runtime data in the loaded program subclassed the root object
(ADR 0027's dace external-workspace path did exactly that). It becomes
Toolchain.loading, a plain step field defaulting to artifacts.load_artifact,
so customization is composition-time like the other three fields. The
DaCeBackend subclass is therefore deleted and run_dace_* are plain
Toolchain instances carrying a DaCeLoadingStep; the public path to the
workspace moves from backend.external_workspace to
backend.loading.external_workspace. This also keeps subclassing off the load
path, which matters because per ADR 0024 a toolchain that customizes compile
is opaque to the process-pool runner.

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 0029, which partially supersedes
ADR 0011 and refines ADR 0017.

Programs compile and run exactly as before. Fingerprints embed qualified class
and field names, so the ProgramWithArgs rename rotates the two persistent
translation-cache keys (gtfn, dace); this is the second such rotation in the
stack, after the module move that created otf.workflow.ConcreteArtifact.
Each is a cold rebuild rather than a stale hit because the key itself changes
-- entries written under the old name are simply never looked up. On top of
that, BUILD_CACHE_VERSION_ID (the gt4py version) already rotates these keys
at every release, so the cost is nothing extra for anyone crossing a release
boundary. The two rotations collapse into one if the stack lands in a single
release.

@egparedes
egparedes marked this pull request as ready for review July 30, 2026 17:58
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from 40c134b to 63713c3 Compare July 30, 2026 17:58
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from 63713c3 to 5dfb78f Compare July 31, 2026 16:15
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from 5dfb78f to ef9785b Compare August 17, 2026 15:07
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from ef9785b to 70b9425 Compare August 20, 2026 16:17
@egparedes
egparedes changed the base branch from otf-split-1-stages-artifacts to otf-split-1b-plain-builders August 20, 2026 16:21
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from 70b9425 to ee68592 Compare August 20, 2026 16:52
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch 2 times, most recently from 49edc24 to a78e837 Compare August 26, 2026 11:05
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from a78e837 to f743ebd Compare August 28, 2026 13:06
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from f743ebd to 4fced1e Compare August 28, 2026 13:09
@egparedes egparedes changed the title refactor[next]: rename Backend to Toolchain and align field names refactor[next]: rename Backend to Toolchain and restructure artifact loading Aug 28, 2026
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from 4fced1e to 41da37c Compare September 1, 2026 18:30
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from 41da37c to 247de77 Compare September 9, 2026 16:34
…loading

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`
- `ffront.foast_to_past.ItirShim.definition` -> `ItirShim.operator_def`,
  freeing the name for the renamed `ProgramWithArgs` field it now wraps

Beyond the renames, this restructures how artifacts are loaded.
`Backend.load_artifact()` was an overridable method, so a toolchain needing
backend-specific runtime data in the loaded program subclassed the root object
(ADR 0027's dace external-workspace path did exactly that). It becomes
`Toolchain.loading`, a plain step field defaulting to `artifacts.load_artifact`,
so customization is composition-time like the other three fields. The
`DaCeBackend` subclass is therefore deleted and `run_dace_*` are plain
`Toolchain` instances carrying a `DaCeLoadingStep`; the public path to the
workspace moves from `backend.external_workspace` to
`backend.loading.external_workspace`. This also keeps subclassing off the load
path, which matters because per ADR 0024 a toolchain that customizes `compile`
is opaque to the process-pool runner.

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 0029, which partially supersedes
ADR 0011 and refines ADR 0017.

Programs compile and run exactly as before. Fingerprints embed qualified class
and field names, so the `ProgramWithArgs` rename rotates the two persistent
translation-cache keys (gtfn, dace); this is the second such rotation in the
stack, after the module move that created `otf.workflow.ConcreteArtifact`.
Each is a cold rebuild rather than a stale hit because the key itself changes
-- entries written under the old name are simply never looked up. On top of
that, `BUILD_CACHE_VERSION_ID` (the gt4py version) already rotates these keys
at every release, so the cost is nothing extra for anyone crossing a release
boundary. The two rotations collapse into one if the stack lands in a single
release.
@egparedes
egparedes force-pushed the otf-split-2-toolchain-naming branch from 247de77 to 0e18073 Compare September 9, 2026 16:51
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