Skip to content

docs(autodiff): separate the expansion namespace from addressing - #140

Open
AlekseiChirkovVention wants to merge 1 commit into
fix/expansion-artifact-guardsfrom
docs/expansion-namespace-boundary
Open

docs(autodiff): separate the expansion namespace from addressing#140
AlekseiChirkovVention wants to merge 1 commit into
fix/expansion-artifact-guardsfrom
docs/expansion-namespace-boundary

Conversation

@AlekseiChirkovVention

Copy link
Copy Markdown
Collaborator

Answers a review question on the expansion namespace by writing down the part that was true but
undocumented. Documentation only — no behaviour change, no test change.

The question

Review asked how the reserved exn/exv namespace relates to the broader one autodiff uses to
address trainable parameters and constants. The comment block said only that it is disjoint
from the tracer's and the transform's, which does not answer it.

What was missing

Minted identifiers name positions in an artifact, not addresses. A declared input's address
is the reference its name produces; its value id is minted separately. A parameter named
weights is value v0, so nothing a pass mints can shadow that name — the two are different
kinds of thing rather than two ranges of one namespace.

The seed is the one value id a caller supplies directly, which is exactly why the collision
check spans every identifier an artifact mentions — produced, read, declared as an input,
declared as an output or gradient — rather than only the ones it produces. It fails closed:

seed='exv0' -> malformed_derivative_ir: minted value id 'exv0' collides with a value id
               already present in the artifact; 'exv' is a reserved expansion namespace

A generated constant never becomes addressable. Expansion leaves both dependency-analysis
entry points reporting the same required_inputs and the same provenance vocabulary as before,
so a consumer binds exactly what it bound already. A constant is materialized by its handler
from its own descriptor, never bound like an input — the deliberate alternative to modelling
constants as free dependencies with a new provenance category, which would have forced every
consumer's bind_input to learn a category for a value it never asked for.

Why here rather than on the branch that was reviewed

The comment being asked about lives on an earlier branch in this series, with six branches
based on it. Amending it would force a rebase of all six for a documentation change. This lands
at the top of the stack instead and reads identically once the series merges.

Stack position

Stack position 10 of 10 — based on fix/expansion-artifact-guards.

Cannot merge into main before the nine branches below it.

The reserved namespace was documented only as disjoint from the tracer's and
the transform's, which leaves open how it relates to the way parameters and
constants are addressed. Two points answer that and neither was written down.

Minted identifiers name positions inside one artifact, not addresses. A
declared input's address is the reference its name produces, while its value id
is minted separately, so nothing a pass mints can shadow a parameter name. The
seed is the one value id a caller supplies directly, which is why the collision
check spans every identifier an artifact mentions rather than only those it
produces.

A generated constant never becomes addressable: dependency analysis reports the
same required inputs and the same provenance vocabulary after expansion as
before, and a constant is materialized by its handler from its own descriptor
rather than bound like an input.
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.

3 participants