Skip to content

core: include resolved platform in cache identity - #13911

Merged
sipsma merged 3 commits into
dagger:mainfrom
sipsma:default-platform-cache-identity-investigator-6c22455a
Aug 18, 2026
Merged

sipsma merged 3 commits into
dagger:mainfrom
sipsma:default-platform-cache-identity-investigator-6c22455a

Conversation

@sipsma

@sipsma sipsma commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

DagQL omitted optional arguments from call identity before resolvers applied engine defaults. Platform-dependent resolvers could therefore execute with a concrete engine platform while their cache identity represented only the abstract omission. The same problem affected ambient platform values that had no public argument at all.

This change makes the resolved platform part of the identities for:

  • Query.container
  • Query.defaultPlatform
  • Query.directory
  • Directory.dockerBuild, including both its target platform and the native build platform used by Dockerfile BUILDPLATFORM values

Implementation

container and the target-platform portion of dockerBuild use dynamic inputs to rewrite an omitted or null optional platform argument to the concrete engine platform before cache lookup. This also canonicalizes omission with an explicitly supplied native platform.

defaultPlatform and directory have no natural platform argument, so they use an implicit engineDefaultPlatform identity input. dockerBuild also carries that implicit input independently because its native build platform affects Dockerfile conversion even when the target platform is explicit.

The GraphQL schema is unchanged. Existing entries under the old incomplete identities are intentionally not reused. Explicit container(platform:) identities remain unchanged; default-dependent calls and dockerBuild calls receive corrected identities that partition by the relevant engine platform.

Telemetry goldens retain evidence that dynamic canonicalization supplied a platform argument, while normalizing only the actual test engine native value to linux/ARCH. Explicit non-native platform values and other platform-bearing calls remain literal, keeping the fixtures portable across amd64 and arm64 runners.

Validation

  • go test ./core/schema -count=1
  • go test ./dagql/idtui -run ^TestNormalizeTelemetryNativePlatform -count=1
  • Focused engine-dev test-telemetry run covering all 19 affected golden scenarios: 21 tests passed
  • git diff --check

The focused schema tests verify omitted/explicit-native canonicalization, explicit-null behavior, platform partitioning, and the implicit/dynamic identity wiring. The telemetry normalization test exercises synthetic amd64 and arm64 native values and verifies non-native and unrelated platform arguments are preserved.

@grouville
grouville self-requested a review August 17, 2026 22:37
@sipsma
sipsma force-pushed the default-platform-cache-identity-investigator-6c22455a branch from 570f659 to fd926c2 Compare August 18, 2026 02:43
@sipsma
sipsma merged commit 0637162 into dagger:main Aug 18, 2026
88 checks passed
marcosnils pushed a commit to marcosnils/dagger that referenced this pull request Aug 24, 2026
* core: include resolved platform in cache identity

Signed-off-by: Erik Sipsma <[email protected]>

* test: update platform identity telemetry goldens

Signed-off-by: Erik Sipsma <[email protected]>

* test: normalize native platform telemetry

Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Erik Sipsma <[email protected]>
(cherry picked from commit 0637162)
marcosnils pushed a commit to marcosnils/dagger that referenced this pull request Aug 24, 2026
* core: include resolved platform in cache identity

Signed-off-by: Erik Sipsma <[email protected]>

* test: update platform identity telemetry goldens

Signed-off-by: Erik Sipsma <[email protected]>

* test: normalize native platform telemetry

Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Erik Sipsma <[email protected]>
(cherry picked from commit 0637162)
marcosnils pushed a commit to marcosnils/dagger that referenced this pull request Aug 25, 2026
* core: include resolved platform in cache identity

Signed-off-by: Erik Sipsma <[email protected]>

* test: update platform identity telemetry goldens

Signed-off-by: Erik Sipsma <[email protected]>

* test: normalize native platform telemetry

Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Erik Sipsma <[email protected]>
(cherry picked from commit 0637162)
marcosnils pushed a commit that referenced this pull request Aug 25, 2026
* core: include resolved platform in cache identity

Signed-off-by: Erik Sipsma <[email protected]>

* test: update platform identity telemetry goldens

Signed-off-by: Erik Sipsma <[email protected]>

* test: normalize native platform telemetry

Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Erik Sipsma <[email protected]>
(cherry picked from commit 0637162)
sipsma added a commit that referenced this pull request Nov 9, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 10, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 10, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 10, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 11, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 11, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 11, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 11, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 12, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 13, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 14, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 25, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 25, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added a commit that referenced this pull request Nov 26, 2026
A module function's cache key was its module, the function, its
arguments and its cache policy. Its body can still depend on the
engine's default platform: by reading defaultPlatform, as dagger/go's
gomod.hostPlatform does, by creating a container without a platform,
or by running on the engine. Through the remote cache, an arm64 engine
was served the result an amd64 engine computed, such as an amd64
binary from dagger/go.

Every module function and constructor now carries the engine's default
platform as an implicit input, as the core fields that read it have
since #13911. The input moves from core/schema into core so module
functions can use it.

The Dang runtime needs no key of its own: it is not a cached result
but an in-memory value inside the engine, it reads no platform, and
Dang function calls are installed through the same module function
path. Compiled SDKs build their runtime container with container(),
which already carries the platform.

The cost: a module function's result is no longer shared between
engines of different architectures, even when it does not depend on
the platform, since the engine cannot tell which bodies read it. An
engine's platform never changes, so the local cache behaves as before,
though existing module function results miss once after the upgrade.

Signed-off-by: Erik Sipsma <[email protected]>
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.

2 participants