Working draft · not stableSpecifications include planned features, not blanket implementation or proof claims.
Repository design note

Rendered from docs/labelled-dup-sup-v1.md. This note is not the language specification.

On this page

Labelled DUP/SUP profile labelled-dup-sup/1

Status: selected for the model-only #105 lane. This is an opt-in extension of the selected I64 interaction-net contract ngraph-net-i64/3; it does not change that contract's default backend or claim a Rust implementation.

The owner re-based #37 and this interaction-net family on the vendored OnixResearch/inets library on 2026-11-13. The prerequisite is recorded in the current #37 contract and issue decision. Inets supplies the generic strong-confluence, normal-form uniqueness, and reduction-bound theorems; this profile proves that its rule table is a well-formed INet.System, then instantiates those theorems.

Symbols and ports

Port 0 is principal; an agent with arity n has auxiliary ports 1..n.

SymbolArityMeaning
num v0wrapping I64 value, represented by BitVec 64
op2 k2first operand arrives at the principal; auxiliary 1 is the second operand; auxiliary 2 is the result continuation
op1 k a1first operand a is stored in the agent; the principal accepts the second operand; auxiliary 1 is the result continuation
dup2the unlabelled v3 fanout agent
dupL L2labelled fanout agent
sup L2labelled ordered alternative
era0eraser

L is a natural-number label. A net declares a finite duplicate-free label list; every dupL L and sup L must use a declared label. Labels are not inferred, renamed, or truncated. dup remains the v3 unlabelled agent; it is not an alias for dupL L. There is no implicit dup ⋈ sup rule: an unsupported active pair is stuck, and complete read-back will refuse it rather than publish a partial value.

Rule table

Each row has its mirrored orientation as required by INet.System.rule_symm. Auxiliaries are listed in their agent-local order.

Active pairRight-hand side
dup ⋈ num v; dupL L ⋈ num vTwo num v agents, one on each fanout auxiliary.
dupL L ⋈ eraTwo era agents, one on each fanout auxiliary.
era ⋈ num vNo new agent.
era ⋈ sup MTwo era agents, one on each SUP auxiliary.
dupL L ⋈ sup LProjection: DUP auxiliary 1 joins SUP auxiliary 1; auxiliary 2 joins auxiliary 2.
dupL L ⋈ sup M, L ≠ MCommute and nest: the old DUP auxiliaries lead to two new sup M principals. The old SUP auxiliaries lead to new dupL L principals. The first new SUP's auxiliary 1/2 receive copy 1 from the DUPs of the old SUP's auxiliary 1/2; the second new SUP's auxiliary 1/2 receive copy 2.
op2 k ⋈ num aOne op1 k a; its principal joins the old op2 auxiliary 1 and its auxiliary 1 joins the old op2 auxiliary 2, as in v3.
op1 k a ⋈ num bOne num (k a b); its principal joins the old op1 auxiliary 1. add, sub, and mul wrap modulo 2^64; sub is first minus second; eq is 1 exactly when the operands are equal, otherwise 0.
op2 k ⋈ sup LOP-SUP distribution: a new sup L principal joins old op2 auxiliary 2 (the result continuation); a new dupL L principal joins old auxiliary 1 (the other operand); the old SUP auxiliaries join the principals of two op2 k copies; the DUP copies join those copies' auxiliary 1 ports; the copies' auxiliary 2 ports join the new SUP auxiliaries 1 and 2, respectively.
op1 k a ⋈ sup LOP-SUP distribution: a new sup L principal joins the old op1 auxiliary 1; the old SUP auxiliaries join the principals of two op1 k a copies; the copies' auxiliary 1 result ports join the new SUP auxiliaries 1 and 2, respectively.

Every other pair is unruled. The arithmetic rule table is the v3 table; sup_free_rule_table_exact proves it is unchanged on SUP-free symbol pairs, including the label-insensitive scalar fanout rules for dupL.

Validation and observation

NobleFoundation.NetLabelled.validate combines inets' executable structural check with a duplicate-free declared label list, label membership for every labelled agent, and these frozen caps:

LimitValueEnforced by
Declared labels per net16validate
Agents64validate
Stored directed wire entries192validate; XNet.ofWires stores both directions
Ordered free/boundary ports16validate
Rewrite steps supplied to one observation256observe
SUP nesting depth along a value-tree path8validateTree and bounded read-back fuel
Collapsed scalar values across the complete boundary256validateReadback

The limits were frozen before any measurements; no performance or runtime measurement is claimed. There is no host request, allocator, or scratch-memory implementation in this Lean model, so those runtime quantities are not represented as measured or enforced bytes.

A completed normal form is read from its entire ordered free-port list. Each root must lead through principal ports to num or recursively to a sup L whose two auxiliary ports produce the left and right trees. readback is fuel-bounded; cycles, excessive nesting, unsupported agents, and incomplete paths refuse. observe also requires the input validator, the rewrite cap, a complete tree for every boundary port, and a total represented-agent count equal to the normal form's agent count; this refuses hidden normal-form agents. validateTree checks declared labels, depth, and per-tree collapse size; validateReadback checks boundary and aggregate collapse caps.

Ordered collapse is defined by:

collapse(num v)       = [v]
collapse(sup L a b)    = collapse(a) ++ collapse(b)

Thus the label controls interaction, while observation preserves the tree's left-to-right branch order and ignores labels when producing scalar results. opSupFixture checks add 2 over sup 7{3,5} collapses to [5,7]; op2SupFixture checks add over sup 7{3,5} with the other operand 10 collapses to [13,15].

Selected multi-root contract (#135): per-root collapse only

Decision: option (a). The existing API promises a complete ordered list of per-root trees from observe, and per-root scalar alternatives from collapseObserve. It makes no joint observation claim about several roots. There is no joint-collapse API, output-tuple enumeration, product/independence guarantee, joint-to-marginal projection theorem, or probabilistic interpretation. Issue #135 step 3 is conditional on option (b) and is not selected here.

observe retains labels in each tree. collapseObserve then maps collapse over the roots separately: labels are erased, branch order and repeated scalar values are retained, and no relation between different roots' choices is returned. These lists are marginals in the nondeterministic sense, not weighted distributions. In particular, [[3,7],[3,7]] does not specify whether simultaneous outputs are (3,3) and (7,7) or the four Cartesian-product tuples. Neither alignment by list position nor a Cartesian product is part of this contract.

The two outputs of differentLabelFixture both carry label 5; they are not independent under later interaction. OP2-SUP duplicates the other operand with the encountered label, and an equal-label DUP/SUP projects matching branches. The same correlation occurs when separately constructed sibling SUPs meet: equal labels, not a shared origin, control that interaction. The following are kernel-checked finite examples, not universal joint-semantics results:

ExampleChecked resultTheorem
Different-label duplication, two rootsPer-root alternatives [[3,7],[3,7]]different_label_fixture_marginals
Two separately built SUP 5 rootsSame labelled trees and per-root alternativesseparate_sup_roots_labelled_result, separate_sup_roots_marginals
corrAdd: DUP 4 copies SUP 5 {3,7}, then adds its copiesOne root with alternatives [6,14], not [6,10,10,14]corr_add_ordered_collapse
Two separately built SUP 5 {3,7} operands, then addedOne root with alternatives [6,14]separate_sup_add_ordered_collapse
Nested SUP 7 (SUP 7 1 2) 3, added to SUP 7 10 20One root with alternatives [11,12,23]nested_equal_add_ordered_collapse
Input/tree acceptance of those finite examplesAll four nets and the nested equal-label tree validatecorrelation_fixtures_validate, nested_equal_tree_validates

Nested equal labels are allowed within the unchanged depth/size limits. The retained result 12 rules out interpreting all occurrences of label 7 as one global bit: that interpretation would select either 1 with 10 or 3 with 20, omitting 2 with 10. We do not replace that failed interpretation with an unproved path-fresh joint semantics.

Unsupported: step-4 joint compositionality. The two addition results above are checked, but they do not prove that addition maps over a joint observation of the pre-addition roots. Per-root collapse has no output-tuple relation to map over; choosing a Cartesian product would incorrectly introduce 10 in these examples. Reopen only with an explicitly selected joint semantics, a treatment of nested equal labels consistent with the rules (or a reviewed admission change), and kernel-checked composition and projection obligations. This is not a missing theorem of the selected per-root contract.

Unsupported: preservation of no nested equal labels (step 5). No invariant or counterexample is established here for reduction from an input with no nested equal labels. The nested fixture starts with nesting and therefore does not settle that preservation question; validation itself does not enforce the premise. Reopen with a precise net/path predicate and either a rule-by-rule preservation proof or a validated, kernel-checked reduction counterexample.

Trust boundary

Proofs are checked by the pinned Lean 4.35 kernel against the byte-pinned vendored proofs/inets/InteractionNets.lean (provenance in proofs/inets/UPSTREAM.json) and this module. The generic inets results establish strong confluence for well-formed nets over this system, uniqueness of normal forms when reached, and the conditional reduction bound. They do not prove termination for every input, a source compiler, graph-to-net correspondence, Rust/Wasm behavior, allocator/scratch limits, or runtime scheduling. HVM3 INTERS.md is prior art for the labelled table only; its WIP status and all external performance claims are not Noble evidence.

The runtime arm remains gated on #37's Rust backend decision and on #105's own runtime evidence. This model does not enable a backend or widen #37's admitted source subset.