test(syntax): pin SCFM equation content per-axiom, and per colour (#317) - #386
Merged
Conversation
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.
SCFM equation content was unpinned — closes #317.
Diff
git diff --stat main..HEAD(base27be055): 3 files changed, 195 insertions(+), 2 deletions(-).catgraph-syntax/tests/frobenius.rs: +130/−1 (ascfm_goldens()table +each_scfm_equation_matches_its_own_golden).catgraph-syntax/tests/colored_frobenius.rs: +59/−1 (both_functors_agree_on_the_nine_axioms_at_each_colour, renamed from…_decide_…).catgraph-syntax/CHANGELOG.md: +6.What changed
Confirmed by direct falsification before briefing: replacing
scfm_equations' equation #2 (left unitality) with a reflexive/duplicate pair, keeping the returnedVecat length 9, leftcargo nextest run -p catgraph-syntaxat 131/131 green — every existing consuming assertion (laws.len()==9,mk(lhs)==mk(rhs),eq_mod==Some(true), the 18/10hypergraph_presentationcounts) is satisfied by any true parallel pair, not the specific named axiom.Fix, per axiom (all nine): a literal
d=2MatKronimage golden (shared across the five slots the algebra makes coincide — {2,5,9} allidentity(2), {7,8} bothμ;δ) plus the printed concrete syntax of both sides (which does individuate every slot — confirmed in review). Per the implementer's own falsification table (18 duplicate/reflexive substitutions across the nine axioms, in5151976's dispatch report): a matrix-only golden, tried first, caught 4 of the 18; the syntax goldens caught all 18, which is why both are shipped.Per-colour:
to_mat_kronandCospanFunctorpinned to agree on all nine axioms at each ofHue::A/Hue::B(previously validated only at the trivial()colour), plus a[B, A]mixed-colour braid pin — the boundaryto_mat_kron's braid had no prior test at (the pre-existingper_colour_dimensionscovered only[A, B]).Review
Six rounds via
rust-v2:falsifying-reviewer(commits5151976→f32c4b1; round 4 landed mid-branch, after which the branch was rebased onto main27be055, 3 unrelated commits, none touchingcatgraph-syntax— all SHAs below are the post-rebase ones on the pushed branch,git log --oneline main..HEAD):5151976, the implementation commit): 2 important (I1 — a test name claimedto_mat_kron"decides", contradicting the crate's own rustdoc calling it a sound-but-incomplete semantic check; I2 — the new colour-loop test never reddened alone across 27 perturbations) + 4 minor (module-doc overclaim/scope, a doc misattached to the wrong item, a missing per-axiom comment, an unmessaged assertion). I1/M1-4 fixed directly; I2 required real construction (a mixed-colour witness), dispatched to the domain agent — which added aδ-image assertion and a braid-order assertion, then honestly flagged theδone as redundant under its own falsification (identical failure set with/without it). Cut theδhalf, kept the braid half. →30b12ec.30b12ec): 1 blocking (a comment claiming the braid assertion is caught "here and nowhere else in the suite" was refuted —per_colour_dimensionsalso catches the same perturbation) + 2 important/minor. Cut the false clause; tightened a count assertion to a literal9matching its message. →f0f6f53.f0f6f53): 1 important (no CHANGELOG entry, against repo precedent) + 1 minor (the tightened count assertion lost an upper-bound: a bogus 10th golden entry would now pass silently, sincezipdrops it). Added the CHANGELOG bullet; restored the upper-bound check as a second assertion. →fff2be3.fff2be3): 2 important, both in the new CHANGELOG bullet — it re-introduced the "own image" overclaim R1's I1 sibling had already scoped down in code, and credited the braid pin toCospanFunctorwhen onlyto_mat_kronis involved there. Rewrote the bullet; also cut an uncited rationale parenthetical. Branch rebased onto current main in the same pass (3 unrelated commits, confirmed non-overlapping). →b50da34.b50da34, post-rebase): 1 important — the braid clause's "mixed colour boundary" phrasing credited syntax: scfm_equations content unpinned — deleting the left-unitality axiom leaves 136/136 green, zero warnings #317 with coverage that already existed pre-syntax: scfm_equations content unpinned — deleting the left-unitality axiom leaves 136/136 green, zero warnings #317 at[A,B]; what's actually new is the reversed[B,A]boundary. Rewrote to name the boundary explicitly. →f32c4b1.f32c4b1): no blocking/important findings — the rewritten clause verified accurate (git grep 'braiding(3, 2)'at the pre-branch main SHA returns only the pre-existing[A,B]assert_ne!, none at[B,A]). One minor wording nuance noted by the reviewer as "not false as written" and left as-is — six rounds of substantive fixes is a reasonable stop point for a nuance the reviewer itself declined to press.Across all rounds: the original defect (#317's headline) is caught by exactly one test,
each_scfm_equation_matches_its_own_golden, in every reproduction, including a full-workspace--no-fail-fastrun.Gates
All run with
--manifest-path <wt>/Cargo.toml --target-dir /tmp/cargo/catgraph-syntaxagainstf32c4b1:cargo fmt --check— clean.cargo clippy -p catgraph-syntax --all-targets -- -D warnings— clean.RUSTDOCFLAGS="-D warnings" cargo doc -p catgraph-syntax --no-deps— clean.cargo nextest run -p catgraph-syntax— 133/133 passed.scripts/check_version_refs.py—all references agree on 0.16.0.No production code changed —
tests/frobenius.rs,tests/colored_frobenius.rs(new tests + one rename), andCHANGELOG.md.Follow-up filed, out of #317's stated scope (not colour-specific): #384 —
to_mat_kron'sTensor-arm factor order is unpinned anywhere in the workspace (swappingfm.kron(&gm)→gm.kron(&fm)leaves 2140/2140 tests green).Closes #317.