Skip to content

test(syntax): pin SCFM equation content per-axiom, and per colour (#317) - #386

Merged
tsondru merged 6 commits into
mainfrom
audit/G11-T2
Sep 1, 2026
Merged

test(syntax): pin SCFM equation content per-axiom, and per colour (#317)#386
tsondru merged 6 commits into
mainfrom
audit/G11-T2

Conversation

@tsondru

@tsondru tsondru commented Sep 1, 2026

Copy link
Copy Markdown
Member

SCFM equation content was unpinned — closes #317.

Diff

git diff --stat main..HEAD (base 27be055): 3 files changed, 195 insertions(+), 2 deletions(-).

  • catgraph-syntax/tests/frobenius.rs: +130/−1 (a scfm_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 returned Vec at length 9, left cargo nextest run -p catgraph-syntax at 131/131 green — every existing consuming assertion (laws.len()==9, mk(lhs)==mk(rhs), eq_mod==Some(true), the 18/10 hypergraph_presentation counts) is satisfied by any true parallel pair, not the specific named axiom.

Fix, per axiom (all nine): a literal d=2 MatKron image golden (shared across the five slots the algebra makes coincide — {2,5,9} all identity(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, in 5151976'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_kron and CospanFunctor pinned to agree on all nine axioms at each of Hue::A/Hue::B (previously validated only at the trivial () colour), plus a [B, A] mixed-colour braid pin — the boundary to_mat_kron's braid had no prior test at (the pre-existing per_colour_dimensions covered only [A, B]).

Review

Six rounds via rust-v2:falsifying-reviewer (commits 5151976f32c4b1; round 4 landed mid-branch, after which the branch was rebased onto main 27be055, 3 unrelated commits, none touching catgraph-syntax — all SHAs below are the post-rebase ones on the pushed branch, git log --oneline main..HEAD):

  • R1 (against 5151976, the implementation commit): 2 important (I1 — a test name claimed to_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.
  • R2 (delta on 30b12ec): 1 blocking (a comment claiming the braid assertion is caught "here and nowhere else in the suite" was refuted — per_colour_dimensions also catches the same perturbation) + 2 important/minor. Cut the false clause; tightened a count assertion to a literal 9 matching its message. → f0f6f53.
  • R3 (delta on 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, since zip drops it). Added the CHANGELOG bullet; restored the upper-bound check as a second assertion. → fff2be3.
  • R4 (delta on 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 to CospanFunctor when only to_mat_kron is 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.
  • R5 (delta on 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.
  • R6 (delta on 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-fast run.

Gates

All run with --manifest-path <wt>/Cargo.toml --target-dir /tmp/cargo/catgraph-syntax against f32c4b1:

  • 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.pyall references agree on 0.16.0.

No production code changed — tests/frobenius.rs, tests/colored_frobenius.rs (new tests + one rename), and CHANGELOG.md.

Follow-up filed, out of #317's stated scope (not colour-specific): #384to_mat_kron's Tensor-arm factor order is unpinned anywhere in the workspace (swapping fm.kron(&gm)gm.kron(&fm) leaves 2140/2140 tests green).

Closes #317.

@tsondru
tsondru merged commit 9e9afea into main Sep 1, 2026
6 checks passed
@tsondru
tsondru deleted the audit/G11-T2 branch September 1, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

syntax: scfm_equations content unpinned — deleting the left-unitality axiom leaves 136/136 green, zero warnings

1 participant