Repository navigation
Allow pulls of multiplicity up to N, and a channel that uses them - #1
Open
jotabulacios wants to merge 22 commits into
Open
jotabulacios wants to merge 22 commits into
jotabulacios wants to merge 22 commits into
Conversation
… interaction count. A table that answers k identical lookups with one row pulls the facts it relies on with multiplicity k. Field-sum balance alone does not match such pulls with a push: (p - 1) / 2 pulls of multiplicity 2 and one pull of 1 sum to p with no push. With fewer than p / N interactions it does: if no interaction pushes a message, its balance is -S with 1 <= S <= length * N < p. Interaction.PullUpTo / PushUpTo, MatchedUpTo and BalancedUpTo state this, and LogUpBalanced.matchedUpTo proves it. Balance gets pullBound (default 1) and matchedUpTo_of_balanced, which takes the same fits premise as balancedInteractions_of_balanced; Balance.logUpUpTo N puts length * N < p into fits. RawChannel.ConsistentUpTo N is consistency under BalancedUpTo N, and every Consistent channel has it. Sound ensembles, partial balance and the VM theorem use ConsistentUpTo balance.pullBound, so with N = 1 nothing changes. Balance.multiset's proof moves to MultisetBalanced.balancedInteractions to reuse it.
A pull of multiplicity 1..N gets the channel's guarantee, an active push owes it, and a pull requires its multiplicity to be 0 or 1..N. The channel is ConsistentUpTo N, so a sound ensemble can finish it under a balance check with pullBound at least N, such as Balance.logUpUpTo N. pullUpTo and emitUpTo are the circuit operations. The interactions they emit are opaque definitions with circuit_norm lemmas, so that simp does not unfold the message first, and RawChannel.eq_false_of_name_ne tells channels apart by name without unfolding them.
… balance. Channel.counted_not_consistent gives the counterexample that justifies ConsistentUpTo: two pulls of a message the channel does not guarantee, one of multiplicity N and one of multiplicity 1, and nothing pushed. BalancedInteractions holds on that list, because exists_push_of_pull only has to match pulls of multiplicity 1 and reads the pull of N as an Interaction.Push, while the count condition is vacuous since N is neither 0 nor 1. The counted channel reads both as pulls and hands the guarantee to the pull of 1, which is false. Without this the library cannot answer why RawChannel.Consistent is not enough and why MatchedUpTo, BalancedUpTo and Balance.pullBound exist. The statement is over a general field; all the counterexample needs is 2 <= N < ringChar F, which makes N distinct from both 0 and 1.
Balance.logUp, Balance.logUpUpTo and Balance.multiset are plain defs, so instance search, which runs at reducible transparency, cannot project pullBound out of them. A user of a SoundEnsemble over Balance.logUpUpTo N therefore had to write show channel.ConsistentUpTo N by hand before the ConsistentUpTo instance of a counted channel would be found. Balance.logUp_pullBound, Balance.logUpUpTo_pullBound and Balance.multiset_pullBound are rfl lemmas tagged simp and circuit_norm, so the goal normalises to the concrete bound first. The example in CountedChannel.lean guards this: without the lemma, infer_instance on ConsistentUpTo (Balance.logUpUpTo N).pullBound fails.
…iles again. Adding matchedUpTo_of_balanced to Balance without a default broke every existing definition of a Balance, although for the default pullBound = 1 the field is just BalancedInteractions.matchedUpTo_one applied to balancedInteractions_of_balanced. A default has to work around how Lean elaborates them. A term default is elaborated once with pullBound still abstract, so matchedUpTo_one does not typecheck; a tactic default is elaborated per instance, against the real pullBound, but without the earlier fields in scope, so it cannot name balancedInteractions_of_balanced. Handing the conclusion of balancedInteractions_of_balanced to matchedUpTo_of_balanced as an extra premise makes the tactic form work, and costs the two checks that prove the field themselves nothing, since they ignore it. Balance.balancedUpTo_of_balanced passes the weaker balance it already computes. Setting pullBound := N for N > 1 and omitting the field is a type error, as intended, not a silently wrong default. Balance.multiset now relies on the default.
SoundChannels took the bound N first and the tables second, while Air.Flat.Ensemble.SoundChannels takes the ensemble first and N second, as dot notation forces it to. The two now agree: subject, bound, finished channels. Only the definition and its six call sites change; nothing else about the property moves.
…o guarantees. Rebasing these commits onto current main crosses a2ff3c4, "Complete the vector eval normal form", which changed where `eval` sits in a `ProvableType` goal. The two lemmas about a counted pull's guarantee and a counted push's requirement were written against the old shape and called `ProvableType.fromElements_eval_toElements`, which no longer fires: the goal now reads `fromElements (toElements (eval env msg))`, with the eval already inside, so the plain `ProvableType.fromElements_toElements` is what closes it. The linter said so before the error did, reporting the simp argument as unused. No statement changes, only the two simp calls that prove them.
…it keeps its callers. Allowing counted pulls made both proofs need `BalancedUpTo balance.pullBound` where they used to need `BalancedInteractions`, and each inlined the derivation as the same lambda over the ensemble's channels. That left `balancedChannels_of_balanced` and `BalancedChannels` without users, and the step they name duplicated in two files. `BalancedChannel` and `BalancedChannels` now take the bound, the lemma concludes `BalancedChannels balance.pullBound`, and both proofs call it again.
… and fix two docstrings. `Interaction.PullUpTo` and `PushUpTo` inlined the same existential that `Channel.CountUpTo` defines, and the counted channel's `ConsistentUpTo` instance relied on the two being definitionally equal to build a `PullUpTo` from a `CountUpTo`. `CountUpTo` now lives next to the interaction predicates that use it, with `countUpTo_one_iff` in place of `exists_le_one_iff`, so that bridge is stated rather than coincidental. `Balance.multiset` goes back to its inline `Balanced` field: extracting `MultisetBalanced` was not needed for counted pulls, and the default `matchedUpTo_of_balanced` does not depend on the field being named. Both docstrings said "fewer than `p / N` interactions"; the hypothesis is `interactions.length * N < ringChar F`, which is not the same bound.
…ject the new interactions. Every other layer states its `N = 1` coincidence — `pullUpTo_one_iff`, `pushUpTo_one_iff`, `matchedUpTo_one`, `logUp_pullBound` — but nothing said that `Channel.counted 1` is `Channel.toRaw`. `counted_one_guarantees` and `counted_one_requirements` state it field by field, which is the conservativity a reader checks first. `pulledUpTo` and `emittedUpTo` had `circuit_norm` projections for `channel` and `direction` but not for `mult` and `msg`, so simp could not reduce either, unlike the `pulled`/`pushed` family they mirror.
Nothing in `Clean/Examples/` used `Channel.counted`, so the API had no in-tree consumer and its ergonomics were untested. `CountedBytes` is the smallest honest use: a provider that pushes a byte as often as it is pulled, and a consumer that needs the same fact once or twice and pulls it once with that multiplicity. The consumer's constraint on its count is the point. It is what discharges the pull's requirement `count = 0 ∨ CountUpTo 2 count`, and `counted_not_consistent` is why a row that could claim any multiplicity would make the channel unsound.
…ished. `SoundEnsemble.markFinished` takes `[channel.ConsistentUpTo balance.pullBound]` as an instance argument. The counted channel's instance ties that bound to the channel's own `N`, so synthesis has to see `(Balance.logUpUpTo N).pullBound` as `N`. It cannot unfold a plain `def`, and an instance argument leaves no place to `simp` first, so finishing a counted channel failed to elaborate. A plain channel was unaffected: its instance comes from `[Consistent] → ConsistentUpTo N` with `N` free, which matches an unreduced projection. `Balance.logUpUpTo` is now reducible, which is what synthesis needs. The `simp` step in the example above `counted_consistentUpTo_of_le` is no longer needed, and the lemma's docstring no longer claims to solve a problem that a `simp` lemma cannot reach.
`REVIEWERS.md` asks each underscore-separated part of a theorem name to correspond to a declaration or a standard logical word. The predicate is `Interaction.PullUpTo`, so the plural `pullsUpTo` named nothing.
It states a `CountUpTo` fact and sat in `namespace Channel`, where `CountUpTo` no longer lives, so it read as `Channel.countUpTo_of_val` about a root definition. Moving it leaves the lemma itself unchanged.
Nothing in `Clean/Examples/` used `Channel.counted`, so the API had no in-tree consumer: its ergonomics were untested, and the `pullBound` plumbing in `markFinished` and `tableSoundness_of_soundChannels` was reached by no example. `CountedSquares` is the smallest honest use. A squaring chip constrains `y = x * x` and pushes the pair as often as it is pulled; a consumer that needs the same square once or twice pulls it once with that multiplicity, and `tableSoundness` concludes for the assembled ensemble under `Balance.logUpUpTo 2`. The consumer's constraint on its count is the point: it discharges the pull's requirement `count = 0 ∨ CountUpTo 2 count`, which is what `counted_not_consistent` shows a row must not be free to skip. Generation is not exercised, and the file says so. A `SoundEnsemble` that is not a VM has no verifier in this version, so nothing creates the first interaction and the generator returns an empty witness.
`BalancedUpTo`, `Balance.logUpUpTo` and `RawChannel.ConsistentUpTo` each carry a bound that Clean's own definitions do not have, and nothing in the tree said what happens at bound one. A reader had to unfold three definitions to be convinced that a channel which does not count behaves exactly as it did before. `balancedUpTo_one_iff`, `Balance.logUpUpTo_one` and `consistentUpTo_one_iff` state it instead, so the claim that this generalizes Clean rather than replacing it is checked rather than asserted. `Balance.logUpUpTo` carries `count * N < ringChar F` in its `fits` field, where `Balance.logUp` only needs `count < ringChar F`. The factor reads like slack. `exists_logUpBalanced_not_matchedUpTo` shows it is not: once `ringChar F ≤ 2 * N`, two pulls whose multiplicities sum to the characteristic balance every message, the list is shorter than the characteristic, and no push occurs anywhere. Without the factor, `LogUpBalanced` would accept a balance that nothing ever pushed into. `Channel.counted_one_guarantees` and `counted_one_requirements` both state an `iff`, and `REVIEWERS.md` asks each part of a name to correspond to a declaration or a standard logical word. They are now `..._iff`. Neither is used outside its own docstring.
The module docstring said that generation never runs, and gave a reason that was never checked: that a `SoundEnsemble` which is not a VM has no verifier, so nothing creates the first interaction. Neither part held. The consumer was `.preallocated` with no `.multiplicity` cell, which `validateComponent` rejects outright, and an ensemble without a VM can seed itself: a preallocated component's rows exist before there is any demand, and a multiplicity cell starts at `0`, so an emit of `mult + 1` pushes once from every row. The provider is now the preallocated component, with four rows and that emit, and the consumer is demand-generated, one row per pushed square that nothing has pulled. The run reaches `constraintsHold`, `channelsBalanced` and `interactionsFit`. The `+ 1` is the seed and nothing more: it is field arithmetic rather than a count, so it says nothing about a row whose `mult` is `-1`, and soundness is indifferent either way, since pushing is what owes the guarantee. `x` and `y` are witness cells on both sides now. They were fixed columns on the consumer, and a fixed column is a value the verifier knows, so `y = x * x` held of the table whether or not the pull carried it, which is the one thing this example exists to show. `Clean/Examples/CountedSquaresWitnessGenerationTest.lean` pins the run, following the other `WitnessGenerationTest` modules: heights `[2, 4]` and the three checks. `heights` lists the tables in the ensemble's order, which `addTable` builds by prepending, so the consumer added last comes first.
`CountUpTo N mult` says that `mult` is named by a natural between `1` and `N`, and carries no hypothesis relating `N` to the field. In a small enough field two such naturals name the same element, so `CountUpTo 2 (0 : ZMod 2)` holds, and a reader meeting that case has no way to tell whether it was overlooked. It was not, and the docstring now says why the bound is not stated here. Carrying `N < ringChar F` in the definition would thread a condition on the field through every requirement, guarantee and proof that mentions a count, to exclude a case the balance check excludes already: `Balance.logUpUpTo N` fits an interaction count only when `count * N < ringChar F`, which over `ZMod 2` with `N = 2` leaves `count = 0`.
Five docstrings, no change to any proof. `exists_logUpBalanced_not_matchedUpTo` opened by calling the bound of `matchedUpTo` necessary and described the general case of many interactions, while its hypothesis `ringChar F ≤ 2 * N` confines it to fields no larger than `2 * N` and the list it builds has length `2`. It now states what it proves, and a closing paragraph says what it leaves out: `L` multiplicities in `[1, N]` reach every sum between `L` and `L * N`, so the same counterexample exists on `L` interactions in a field with `L ≤ ringChar F ≤ L * N`, and that version is not proved here. `countUpTo_of_val` had no stated purpose. It is the step from what a chip knows about its multiplicity, `mult ≠ 0` and `mult.val ≤ N`, to the requirement a counted pull owes, and it is stated over `ZMod p` because that is where `mult.val` exists. `Channel.counted` now documents the invariant behind the shared name: witness generation tallies interactions by channel name and the generation modes take the plain `Channel`, so a counted channel under a new name would stop generating rows, and an `Ensemble` admits at most one channel of a given name. `counted_consistentUpTo_of_le` says why it is a theorem rather than an instance, and what to do instead: supply it with `haveI` before `SoundEnsemble.markFinished`, whose consistency argument is an instance argument that leaves no place for a `simp` step. `CountedSquares` pointed at `Ensemble.tableSoundness_of_stagedOn`, which this branch does not define. The sentence now describes the finishing order it means without naming it.
`Balance.logUp` leaves `pullBound` at `1` and still wrote `matchedUpTo_of_balanced` out through `LogUpBalanced.matchedUpTo`, where the field's default proof `BalancedInteractions.matchedUpTo_one` already closes it. `Balance.multiset` beside it takes that default, so the two checks disagreed for no reason, and the claim that an existing check compiles untouched reads better when the main one is such a check. Nothing observable changes: the field is a `Prop`, so no user of `Balance.logUp` can depend on which proof stands there. `LogUpBalanced.matchedUpTo` keeps the caller it was written for, the bound of `Balance.logUpUpTo`.
Two docstrings, no change to any proof. `exists_logUpBalanced_not_matchedUpTo` said that `ringChar F ≤ 2 * N` confines the statement to fields no larger than `2 * N`. It bounds the characteristic, and a field of characteristic `p` may have `p ^ k` elements. The closing paragraph also gave the general shape as `L ≤ ringChar F ≤ L * N`; at `L = ringChar F` the list has length `ringChar F` and so no longer passes a bound on the length alone, which is what it has to pass to be a counterexample to that bound. The inequality is now strict. `Channel.counted` said that `channel.counted 2` and `channel.counted 3` are distinct `RawChannel`s. Over `ZMod 2` the two bounds describe the same multiplicities and the two values are equal, so they may denote different channels rather than must. The paragraph also read as if at most one of them could belong to an ensemble, which does not hold when they are equal; what `unique_channel_names` rules out is a second entry under a name that is already taken.
The consumer of the example had no padding row, so a demand table that fell short of its target height would have been padded with the generator's default of `0`. Away from characteristic `2` that does not satisfy the consumer's one constraint, `(count - 1) * (count - 2) = 0`. The component now carries a padding row that pulls, at multiplicity `1`, the one message the provider ever pushes. A padding row that interacts has to be answered, and the test now shows that it is. The existing run never pads, because its consumer table has two rows, so the new scenario builds the state directly: three consumer rows against four provider rows emitting six pushes between them, which balances, and whose consumer `ComponentState.targetHeight` asks for four. After `padAndBalance` the consumer holds four rows, the constraints, the balance and the interaction bound all hold, and the multiplicity of the provider row that `rowOf` maps the message to has risen from `2` to `3`, which is the push that covers the padding row's pull. Both scenarios go through the same `constraintsHold` and `channelsBalanced` as the existing run, by way of the tail of `generateValid`, rather than a restatement of them. The existing run is unchanged and still pins `[2, 4]`.
This was referenced Nov 19, 2026
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.
Why
A table that answers
kidentical lookups with one row pulls the facts it relies on withmultiplicity
k. This is the ordinary shape of an arithmetic chip, not a corner case: one thatsplits a result into two halves range-checks the limbs of both with the sum of the two
multiplicities, and with byte-sized limbs that sum reaches
2 * 255. Unrolling such a pull intokpulls of multiplicity one is always possible, sincekis fixed when the circuit is defined,but costs
kinteractions on a row where one would do.Today such a channel cannot be finished in a
SoundEnsemble: consistency rests onBalancedInteractions.exists_push_of_pull, which matches a pull only when its multiplicity is1,so a counted pull has no path to its guarantee.
This is not a gap in the proof. Under plain LogUp balance a counted channel really is unsound, and
Channel.counted_not_consistentbuilds the counterexample: a pull of multiplicityNand a pull ofmultiplicity
1, both of a message nobody pushes.BalancedInteractionsholds of that pair, sinceexists_push_of_pullcounts the pull ofNas a push of the message — its multiplicity is neither0nor1— and so matches the pull of1. The counted channel reads both as pulls and hands itsguarantee to the pull of
1, which is false. Matching counted pulls needs a stronger premise fromthe balance check, so the check has to say how high a multiplicity it covers.
Raising that bound is not free, and
exists_logUpBalanced_not_matchedUpTosays what it costs. OnceringChar F ≤ 2 * N, two pulls of multiplicitiesNandringChar F - Nsum to the characteristic:the field sums see a balanced list, its length stays below the characteristic, and nothing was
pushed anywhere. A bound on the interaction count alone, which is all
Balance.logUpasks, istherefore not enough once pulls may count, and this is why
Balance.logUpUpTo Nasks forcount * N < ringChar Fas well. The theorem shows the weaker condition insufficient; it does notclaim the stronger one is the weakest that works.
What
Balancegains two fields:pullBound : ℕ := 1— the largest pull multiplicity the check matches with a push.matchedUpTo_of_balanced, with a default proof forpullBound = 1(
BalancedInteractions.matchedUpTo_one). Every existing check compiles unchanged, and a checkthat raises
pullBoundwithout discharging the field gets a type error, not a wrong default.New in
Clean/Air/Balance.lean:Interaction.PullUpTo/PushUpTo,MatchedUpTo N,BalancedUpTo N, withof_perm,nil,mono.CountUpTo N mult, with a docstring that states its scope: it saysmultis named by a naturalbetween
1andN, and nothing about the field, soCountUpTo 2 (0 : ZMod 2)holds. The boundrelating
Nto the characteristic is not carried here, becauselogUpUpToalready excludes thecase.
LogUpBalanced.matchedUpTo: field-sum balance matches pulls of multiplicity up toNwheneverinteractions.length * N < ringChar F.exists_logUpBalanced_not_matchedUpTo: a bound on the interaction count alone is not enough, bythe counterexample above, which covers two interactions and so characteristics up to
2 * N.Balance.logUpUpTo N: LogUp withpullBound := N, whosefitsadditionally askscount * N < char F.RawChannel.ConsistentUpTo N, generalizingConsistent(which isConsistentUpTo 1).balancedUpTo_one_iff,Balance.logUpUpTo_oneandRawChannel.consistentUpTo_one_iff: at bound1each of the three new definitions is the one it generalizes, so an ensemble that does notcount keeps exactly the premise its soundness proofs had before.
@[simp, circuit_norm]pullBoundlemmas forlogUp,logUpUpToandmultiset, so thatsimpandcircuit_normcan reduce aConsistentUpTo balance.pullBoundgoal.Balance.logUpUpTois@[reducible].SoundEnsemble.markFinishedtakes[channel.ConsistentUpTo balance.pullBound]as an instance argument, and the counted channel'sinstance ties that bound to the channel's own
N, so synthesis has to see(logUpUpTo N).pullBoundasN. Asimplemma plays no part in synthesis, and an instanceargument leaves no place to run one, so without this finishing a counted channel does not
elaborate. A plain channel is unaffected: its instance comes from
[Consistent] → ConsistentUpTo NwithNfree.New file
Clean/Air/CountedChannel.lean:Channel.counted N channel—channelwith pulls of multiplicity up toN: a pull ofmultiplicity
1 ≤ k ≤ Ngets the guarantee, an active push owes it.pulledUpTo/emittedUpTointeractions with theircircuit_normlemmas.(channel.counted N).ConsistentUpTo Nas an instance,counted_consistentUpTo_of_lefor largerbounds,
counted_one_guarantees_iff/counted_one_requirements_iffat bound1, andcounted_not_consistentfor the counterexample above.New file
Clean/Examples/CountedSquares.lean: a squaring chip that constrainsy = x * xandpushes the pair, and a consumer that needs the same square once or twice and pulls it once with that
multiplicity. The consumer's constraint on its count is what discharges the pull's requirement
count = 0 ∨ CountUpTo 2 count. The two are assembled into aSoundEnsembleoverBalance.logUpUpTo 2, with the channel finished between them, andtableSoundnessconcludes forevery table of it.
New file
Clean/Examples/CountedSquaresWitnessGenerationTest.lean: the example generates, and thetest pins what it generates. Four preallocated provider rows exist before there is any demand, and a
multiplicity cell starts at
0, so an emit ofmult + 1seeds the channel with one push from each;two demand-generated consumer rows answer those four pushes at multiplicity
2. The test fixes theheights at
[2, 4]and that the witness satisfies the constraints, the balance check and itsinteraction bound, in the manner of the other
WitnessGenerationTestmodules.In
Clean/Air/FlatEnsemble.lean,EnsembleWitness.BalancedChannelandBalancedChannelstake thebound and state
BalancedUpToinstead ofBalancedInteractions, sobalancedChannels_of_balancedconcludesBalancedChannels balance.pullBound. That keeps theper-channel derivation named in one place rather than inlined at each proof that needs the stronger
form.
Ensemble.SoundChannelsandtableSoundness_of_soundChannelsnow take the pull bound; the in-treecall sites in
OrderedChannel.leanandVm.leanare updated.Compatibility
pullBounddefaults to1andmatchedUpTo_of_balancedhas a default proof, soBalance.logUp,Balance.multisetand any out-of-tree balance check keep working untouched.Five definitions take the bound as a new argument:
SoundChannels(both the one on a list oftables and
Ensemble.SoundChannels),PartialBalancedChannel, andEnsembleWitness.BalancedChannel/BalancedChannels. The last two also strengthen theirconclusion from
BalancedInteractionstoBalancedUpTo N;N = 1recovers the old contentthrough
BalancedInteractions.matchedUpTo_one.SoundEnsemble.markFinishedchanges its instance argument from[channel.Consistent]to[channel.ConsistentUpTo balance.pullBound]. A plain channel still finds it, through[Consistent] → ConsistentUpTo N.Checks
lake buildclean, zero warnings.lake build CleanTestspasses.sorry. Nonative_decidein the library: the single occurrence is theexampleof thegeneration test, as in the other
WitnessGenerationTestmodules.#print axiomsonCountedSquares.tableSoundnessand on the new theorems ofBalance.leanandCountedChannel.leanreports onlypropext,Classical.choiceandQuot.sound.scripts/check-consecutive-empty-lines.pypasses.Extraction
Balance.logUpUpTohas no path throughensembleToRust, which is typed to.logUp. The loweringitself never reads the balance —
ensembleToRustcallslower ensemble.ensemble— so this is asignature restriction rather than a missing translation. The stricter bound that
logUpUpTocarries,
interactions.length * N < ringChar F, is not surfaced anywhere in the extraction, sowidening the signature alone would be wrong:
backends/plonky3/src/generated_air.rsrejects anensemble whose interaction count reaches the field order, which is the
count < pofBalance.logUp, and has no counterpart for the factor ofN. How much that bound costs depends onthe field and on
N. The count it bounds is the number of interactions on one channel, not theheight of a trace: at
N = 510, a 64-bit field still allows around3.6 · 10^16interactions ona channel, while a 31-bit field allows around
4.2 · 10^6. The predicate is also uniform acrossthe ensemble:
Ensemble.interactionsFitappliesbalance.fitsto every channel, so a channelwhose pulls all have multiplicity
1is asked forcount * N < ringChar Ftoo. Generalizing thebackend, and letting the bound vary with the channel, are left as follow-up.
Open points
Channel.counted Nkeeps the underlying channel'sname, sochannel.toRaw,channel.counted 2andchannel.counted 3may denote differentRawChannels under one name,while
Ensembleidentifies channels by name. The sharing is load-bearing for witnessgeneration, which tallies interactions by channel name and whose
DemandModeandPreallocatedModetake the plainChannel; renaming the counted channel would silently stop itgenerating rows. The failure mode on the ensemble side is an opaque
Nodupgoal fromunique_channel_names, rather than unsoundness. The invariant is documented in the docstring ofChannel.counted; changing both sides is left as follow-up.