test(applied): pin the Presentation depth-bound contract on both engines (#297) - #368
Merged
Conversation
…nes (#297) Closes #297. `eq_mod` returns `Ok(None)` when a side hits the bound — pinned under Structural (`A = A;A`, depth 4) and CC (depth 0), beside `Some(true)` / `Some(false)` on converging pairs of the same presentation; `normalize` pinned at depths 0, 1, 2 with `expr` written out. The two `A = B, B = A` tests converge in one pass (both equations chain inside `apply_user_equations`) and now assert `converged`, `expr`, `steps_taken`. The issue's production defect does not exist: on the exhausted path the loop runs exactly `rewrite_depth` times (measured 4 passes at depth 4), so `steps_taken: self.rewrite_depth` is the count; "8 iterations at depth 2" is a leaf count, not passes. Production diff 0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
#297) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #297. Taskmap G4-T1.
Premise probe (before briefing): the issue's production defect does not exist.
normalizeisfor step in 0..rewrite_depthwith no early exit other than the fixpointreturn, so reaching the exhausted arm means exactlyrewrite_depthpasses ran — measured with an instrumented copy: 4 passes at depth 4,steps_taken4. "8 iterations at depth 2" is a leaf count (A → A;Ahas 8 leaves after 3 passes), not loop passes. The reviewer independently confirmed no public-API observable can separate the exhausted-pathsteps_takenfrom the loop count. The issue's second claim was also wrong:presentation_structural_engine_returns_none_on_cyclic_overlapreturnedSome(true)and discarded it —A = B, B = Aconverges in one pass because both equations chain insideapply_user_equations.Shipped (production diff 0; tests + CHANGELOG):
eq_modpinned atOk(None)when a side hits the bound: Structural (A = A;A, depth 4) and CC (depth 0), each besideSome(true)/Some(false)on converging pairs of the same presentation.normalizepinned at depth 0 (converged false, steps 0, expr = input, with and without a matching equation) and at depths 1, 2 onA → A;Awithexprwritten out (A;A,(A;A);(A;A)).A = B, B = Atests renamed to what they check and assertconverged,expr,steps_taken(andeq_mod = Some(true)).Falsification (
-p catgraph-applied --no-fail-fast, impl + review, values in the messages):presentation/mod.rs)Ok(None)→Ok(Some(true))…returns_none_only_when_a_side_hits_the_bound(Some(true)vsNone)Ok(Some(false))…cc_engine_returns_none…steps_taken: rewrite_depth→+ 1/ →00..→0..=no_iterations_at_depth_zero,steps_taken_tracks_depth…(exprpin)apply_user_equationsreversedBvsA)converged: trueif after_smc == currentCoverage fact: the Structural
None, CCNone, and0..=perturbations are caught only by tests added here — zero pre-existing tests went red;0..=is invisible tosteps_taken(still 4) and caught only by the written-outexpr. Nulls recorded: the depth-0 fixture cannot separatesteps_taken: 0from the bound (both 0);paired_inverse…cannot separateafter_smcfromafter_user(both fixpoints on pass 1).Reviews: executing adversarial (0 blocking / 1 important / 4 minor — CHANGELOG rationale, doc comments carrying mechanism, a stale stub, one wording) all applied except: an
exprpin at depth 4 (a 16-leaf reassociated tree) — surfaced, not derived; the depth-1/2exprpins carry the count cross-check. Delta review of the applied edits (1 important / 2 minor: my trimmed doc comments dropped stated values —normalize(B ⊗ Id(0)) = (B, 2 steps), twoconvergedflags) → fix commit; every asserted value is now stated in its test's comment.Gates: applied 45 binaries / 673 / 0 / 15; clippy
-D warningson default, all features,--no-default-features; fmt; version-refs.🤖 Generated with Claude Code