test(autodiff): cover repeat expansion and record the regression sweep - #137
Open
AlekseiChirkovVention wants to merge 2 commits into
Open
Conversation
The failure matrix and near-miss coverage already exist across the focused modules, and the collision tests seed a squatting node with a reserved identifier. None of them feeds a pass's own output back into it, which is the scenario an artifact expanded twice actually presents. Cover both passes: reapplied to their own output they are a clean no-op, and reapplied to an artifact that gained a fresh candidate they fail with the structural category naming the colliding identifier, leaving the input untouched. A corrupted artifact is never returned. These pass on the first run. The minter's collision check and the pass-through of unmatched nodes were built generically, so the behaviour was already correct; the tests exist because nothing had yet exercised this shape of input.
code-tc
approved these changes
Aug 28, 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.
Close the one coverage gap the earlier branches left, and record the regression sweep for the
whole series.
What this branch does not do
It was scoped to build the full failure matrix. Most of that matrix already existed, so it was
not rebuilt. An audit against the specification found every clause of the supported-reduction
predicate and every error category already covered by the focused modules — 21 parametrized
cases, each asserting the exact category, the offending node id, and the clause number, plus
every near-miss on the gradient path including all four wrong-divisor forms.
Duplicating that would have added maintenance cost and no coverage. The audit is reproduced in
the review thread rather than asserted, so the claim can be checked rather than trusted.
The gap that was real
No existing test fed an expansion pass its own output back into it. The collision tests
seeded a squatting node carrying a reserved identifier — adjacent, but not the same thing, and
not what a consumer composing passes would actually hit.
Six tests now cover literal repeat application for both passes:
structural error category naming the colliding identifier, and the input artifact is
asserted unchanged afterwards — a corrupted artifact is never returned.
These pass on the first run. The identifier minter's collision check and the pass-through of
unmatched nodes were built generically, so the behaviour was already correct; nothing had
exercised this shape of input. Review confirmed the tests are falsifiable by reading the
minter: removing the collision check flips them to failing rather than leaving them green.
Regression sweep
so it already covered the new module without change.
1146 passed, 9 failed, 1 skipped.
The 9 failures are environment-dependent and pre-existing, reported separately from this
work as the specification requires: seven require the unbuilt local backend, and two are style
guards on a file none of these branches touch. The count and composition are identical to the
baseline recorded at the first branch in this series, across roughly 1,150 tests — so nothing
in the eight branches regressed anything.
Known, deliberate exclusion
The cross-specification composition test is not here. It is conditional on a separate
feature that has no task directory yet, and it lands with that feature — normative in both
documents once both exist. Recorded at discovery, not overlooked.
Stack position
Stack position 8 of 8 — based on
docs/mean-expansion-public-surface.This is the tip of the series: it contains every branch below it, and task-level validation
runs here. Cannot merge into
mainbefore the seven branches below it.