Repository navigation
DDIR: inputs by label, bound at load; remove import and bare input - #1105
Merged
Merged
Conversation
…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
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
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.
An input is now
input Norinput "name", and its label is its identity.importand bareinputare gone: a program no longer names the traces it reads, and a load binds its inputs to them instead.Language
importnow 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.load, the server'splan(which now takes the samelabel=traceoptions),ddir-plan --bind label=trace, and the diagnostics program (diag::bind_sources).0=prog::out); theinput<N>name is gone.query, and clients feed it by that label. Its demand outputs are nameddemand:<label>, asdemand:0forinput 0.Into<InputId>;server::evaluate_labelledfeeds inputs by label.Migration
import "P::a.b" : Sbecameinput "a_b" : S..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.store=store::store.Checks
cargo test --release -p interactive -p ddir-server: 403 passed.bench_txn.pyrun, one-off and maintained, completes.Left as is
unnamed_sum_imports_get_valid_declarationsis 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