Skip to content

DDIR: inputs by label, bound at load; remove import and bare input - #1105

Merged
frankmcsherry merged 5 commits into
master-nextfrom
ddir-inputs
Nov 21, 2026
Merged

frankmcsherry merged 5 commits into
master-nextfrom
ddir-inputs

Conversation

@frankmcsherry

@frankmcsherry frankmcsherry commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

An input is now input N or input "name", and its label is its identity.
import and bare input are gone: a program no longer names the traces it reads, and a load binds its inputs to them instead.

Language

  • An input's source in the IR is its label, and the server keeps a program's inputs by label: a named input has no position, and the order inputs are written in never matters.
  • A client's number finds only the input written with it; it never reaches a named input.
  • Writing a label again reads the same input, for names as well as numbers.
  • Numbered and named inputs may appear in one program.
  • import now fails with a message saying what to write instead; the keyword stays only for that message.

Binding

  • Program::bind(label, trace) is the one place inputs are bound. It refuses an input with no declared shape, so every input, fed or bound, declares its shape.
  • It is used by the server's load, the server's plan (which now takes the same label=trace options), ddir-plan --bind label=trace, and the diagnostics program (diag::bind_sources).
  • A numbered input binds by its digits (0=prog::out); the input<N> name is gone.
  • Explain labels its query input query, and clients feed it by that label. Its demand outputs are named demand:<label>, as demand:0 for input 0.
  • Install refuses a program with two outputs of one name, which IR built outside the language can have.
  • The server's feed, seal and load functions take any Into<InputId>; server::evaluate_labelled feeds inputs by label.

Migration

  • All 323 imports already declared their shapes, so each import "P::a.b" : S became input "a_b" : S.
  • The LDBC client binds each named input to the output of the same name (. written _) of the providers it is given: graph, plus the standing program for one-offs. All 41 authored plans, 41 generated plans and 14 one-offs bind.
  • The one-off splitter regenerates the converted files byte for byte; the graph-index generator writes named inputs; the txn bench binds store=store::store.
  • The reviewed plans change only in their source lines.

Checks

  • cargo test --release -p interactive -p ddir-server: 403 passed.
  • The tritemporal oracle sweep (ignored by default) passes.
  • The LDBC Python tests pass against the server: harness, updates, aggregates, top-k, memory profile, update stream, frames and cascade. The memory-profile and update-stream tests install plans through the new bindings.
  • A small bench_txn.py run, one-off and maintained, completes.

Left as is

  • The plan report still prints "Unresolved import" and "Imported histories", which describe the IR's trace sources.
  • unnamed_sum_imports_get_valid_declarations is deleted: it covered a bound trace with no declared shape, which can no longer occur.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H6wB4Gjwwivtq59LaFYbF5

…re input

An input's label, `input 0` or `input "edges"`, is its identity.
A numbered input sits at its number, and named inputs after the largest number in the order of names, so the order inputs are written in never matters.
Writing a label again reads the same input.
Bare `input` is gone, and so is `import`, which now fails with a message saying what to write instead.

A program no longer names the traces it reads: a load binds its inputs to them, as `load p from f.ddp edges=prod::edges`.
`Program::bind` does this in the library, refuses an input with no declared shape, and is used by the server's load and plan commands, `ddir-plan --bind`, and the diagnostics program (`diag::bind_sources`).
Explain labels its query input `query`.

Every program is migrated: each `import "P::a.b" : S` is now `input "a_b" : S`, and the LDBC client, the txn bench, the one-off splitter and the graph-index generator bind them.
The reviewed plans change only in their source lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6wB4Gjwwivtq59LaFYbF5
frankmcsherry and others added 4 commits November 20, 2026 20:48
Review: a client's number went straight to a slot, so `feed p 1` reached a named input that happened to sit at position 1, and adding another named input moved it.
The server and the catalog now look every label up, a number by its digits, so `1` only ever finds `input 1`.
`InputId::Position` is now `InputId::Number`, and `InputId::is_number` replaces four copies of the digit check.
Explain's query input is fed as `query`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6wB4Gjwwivtq59LaFYbF5
Review: named inputs had positions only to have positions, through a pass over the tokens and a placement rule that explain broke.
`Source::Input` now holds the input's label (`InputId`), and the server keeps each program's inputs by label, so nothing places a named input anywhere.
The pass over the tokens, the placement rule and explain's slot arithmetic are gone.
The server's feed, seal and load functions take any `Into<InputId>`, so a caller's `0` is the label `0`, and `"amounts"` a name.
`evaluate_labelled` feeds inputs by label, as the explain tests now feed `query`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6wB4Gjwwivtq59LaFYbF5
…rence

Review: explain named demand outputs `demand:input{n}` and `demand:{name}`, so `input 0` beside `input "input0"` gave two outputs of one name, and install panicked.
Each demand output is now `demand:<label>`, as `demand:0` for `input 0`, and labels are unique.
Install also refuses a program with two outputs of one name, which IR built outside the language can have.

The server's public input functions convert to an `InputId` once; everything below them takes `&InputId`, and the clones are gone.
`feed_columns_now`, which nothing called, is gone.
`InputId` lives in `scope_ir` beside `Source`, and the server re-exports it.
`list` prints inputs by label, as `[0, "rows"]`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6wB4Gjwwivtq59LaFYbF5
Review: ten input functions took `impl Into<InputId>` and four took `&InputId`, which needed two private copies (`stage_rows`, `now`) and a cloning `From<&InputId>`.
All of them now take `&InputId`; the copies and the `From` are gone, and test call sites write `&0.into()`.
The examples README's explain paragraph names the query input `query` and drops the stale `explain=<arity>` form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6wB4Gjwwivtq59LaFYbF5
@frankmcsherry
frankmcsherry merged commit 1f71181 into master-next Nov 21, 2026
7 checks passed
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