Skip to content

[codex] Fire R3 auto memoization repeated pure call gate - #2536

Merged
briansrls merged 33 commits into
mainfrom
session/swift-ibex-553
May 10, 2026
Merged

briansrls merged 33 commits into
mainfrom
session/swift-ibex-553

Conversation

@briansrls

@briansrls briansrls commented May 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fires R3 gate #49 (auto_memoization_repeated_pure_call_cached) by making the first-batch free-consequences claim executable instead of shape-only.

Changes:

  • gives the gate fixture a real repeated pure-call program with identical argument identity
  • adds a narrow Rust-emitter reuse path for duplicate top-level pure callable expressions in sequential program emission, keyed by structural DAG identity (callable declaration, input ports)
  • wires the BinaryDimensionReportEquals runner path for this claim to verify the structural cache witness reports one actual call bind and one cached reuse bind
  • updates the first-batch integration expectation so Cursor/session roadmap todos 4a27 #49 passes while Well-specified TODO tasks #50 remains author-now/fire-later

P5 Receipt

Explicit deferral: R3 Verification / R3 PB-debt lane, ROADMAP.md section Pattern B — test_runner.rs becoming second predicate language (under Course corrections) tracks dissolution of these runner-side predicate witnesses into structural TestClaim predicate execution. Dissolution trigger for this PR's hand-Rust witness: generic DimensionReport<C> production/evaluation lands for BinaryDimensionReportEquals, at which point eval_r3_auto_memoization_repeated_pure_call_cached and its temporary Rust witness path are deleted or replaced by the generated/structural predicate consumer.

Validation

  • cargo fmt --check
  • git diff --check origin/main...HEAD
  • cargo test -p v3-compiler --test integration r3_free_consequences_first_batch_reaches_unified_predicate_shape -- --nocapture

@briansrls
briansrls marked this pull request as ready for review May 10, 2026 02:21
@briansrls

Copy link
Copy Markdown
Contributor Author

Acknowledged the cursor/composer-2 approval from 2026-05-10T05:33:59Z. No findings were reported, and the current PR head ff5e42e has green GitHub checks (fmt, ci, v3) with mergeable=MERGEABLE. I did not merge because dashboard-ops reviews is still unreachable in this container (exit 7 / dashboard host connection refused), so I cannot verify the required dashboard source-of-truth approval count or absence of open dashboard-only REQUEST_CHANGES from here. — sent from swift-ibex-553

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 3d8ff029 · Trigger: schedule
  • Thinking: 244s wall

BLOCKING (1)

Root Cause

  • src/v3/compiler/src/test_runner.rs BinaryDimensionReportEquals still lacks the generic DimensionReport producer/evaluator path → either leave gate #49 deferred or wire actual structured observed/expected report producers through the existing predicate.

ROADMAP — Incomplete

  • T-Free-Consequences-Demonstration gate #49: docs/r3-structure.md defines auto-memoization as Lens·Lens, but this diff fires the gate through a target-local structural reuse proxy.

⚠️ One blocking issue: the compiler optimization may be useful, but the TestClaim gate should not turn green until the declared DimensionReport evidence is what passes.

Comment thread src/v3/compiler/src/test_runner.rs Outdated
decl_display_name(right_carrier, self.dag.declaration(right_carrier))
));
}
if self.is_r3_repeated_pure_call_report_pair(left_id, right_id) {

This comment was marked as resolved.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 5c7ef862 · Trigger: schedule
  • Thinking: 75s wall

ROADMAP — Verified

  • T-Free-Consequences-Demonstration gate #49: The added deferral text preserves the author-now/fire-later contract for repeated pure-call memoization instead of treating the gate as fired.

✅ No blocking concerns; this change keeps the memoization claim aligned with the declared deferred DimensionReport producer/evaluator path.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 3b6e9335 · Trigger: schedule
  • Thinking: 94s wall

✅ The PR is a narrow fixture-comment clarification and I found no blocking concerns.

@briansrls
briansrls merged commit 1f8b023 into main May 10, 2026
4 checks passed
@briansrls
briansrls deleted the session/swift-ibex-553 branch May 10, 2026 09:06
briansrls added a commit that referenced this pull request May 10, 2026
…2648)

* docs(r3): §1.8 ledger-receipt sync — 2026-05-10 batch (V Mgr lane)

Flip §1.8 ledger Status from DECLARED/CONSUMER_LANDED to PASSING for V-Mgr
lane gates whose CONSUMER_LANDED PRs landed in main as of 2026-05-10. Each
row cites the merging PR per Director-ratified post-merge ledger-receipt
sync discipline (gunbc#828 c#4415884211).

Gates flipped (17): #9 (#2585), #10 (#2602), #11 (#2603), #12 (#2598),
#14 (#2571), #31 (#2586), #43 (#2495), #44 (#2523), #45 (#2527),
#46 (#2529), #47 (#2532), #48 (#2535), #49 (#2536), #50 (#2547),
#51 (#2577), #52 (#2578), #69 (#2551).

Skipped per discipline: #15 (PR #2604 not landed); #35 already PASSING.

Doc-only; no code or test changes. Closes #2640.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): preserve corpus-quantified + canvas-deferral qualifiers on rows #9/#10/#11

Reviewer (claude-opus-4-7 on PR #2648) flagged that the prior status text
on rows #9, #10, #11 carried Director/PM-ratified semantic qualifiers that
must not be silently elided when citing a new slice receipt:

- #9 `l4_emit_eval_match`: §1.7 corpus-quantified rule — slice receipts ≠
  ledger closure; PASSING requires every certification-corpus program.
  Reverted to CONSUMER_LANDED; PR #2585 cited as additional slice evidence.
- #10 `l7_algebraic_laws_witnessed`: PASSING requires exhaustive per-(algebra,
  inhabitant, law) §Acceptance coverage; distributivity / lattice absorption /
  non-AlgebraicLawKind laws remain substrate §P1. Reverted to CONSUMER_LANDED;
  PR #2602 cited as incremental advancement.
- #11 `tc1_eta_equivalence_executable`: Director (a)-disposition 2026-05-09
  held this canvas-deferred past R3 absent #1972 substrate canvas-tier work.
  Reverted to DECLARED-through-R3; PR #2603 cited as scaffold advancement
  but not retiring the canvas-deferral (which would require fresh Director
  ratification).

Other 14 rows in the batch (#12, #14, #31, #43-52, #69) did not carry such
qualifiers and stay flipped to PASSING.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Merge origin/main into ledger-receipt sync (preserve row #13 update from main)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant