Skip to content

refactor(v4): split MIR construction from representation - #92

Draft
OttoApocalypse69 wants to merge 2 commits into
fix/v4-post-merge-contract-hardeningfrom
refactor/v4-mir-build-split
Draft

refactor(v4): split MIR construction from representation#92
OttoApocalypse69 wants to merge 2 commits into
fix/v4-post-merge-contract-hardeningfrom
refactor/v4-mir-build-split

Conversation

@OttoApocalypse69

Copy link
Copy Markdown
Member

What changed

  • Split V4 MIR into freak_mir for persistent Built-MIR representation, validation, and snapshot v5, and freak_mir_build for HIR+TY-to-MIR construction policy and request-scoped scratch.
  • Preserve all 610 original MIR tasks, public v4_mir_lower_ty, allocation order, query/driver/editor/snapshot behavior, and byte-identical snapshot/restore task bodies.
  • Move Meiya-specific returned-loan interpretation into freak_borrowck; borrowck and LLVM no longer call builder-owned tasks.
  • Add architecture guards for downstream builder consumption and an exact shrinking allowlist for transitional syntax dependencies.

Why this boundary

freak_mir owns the stable Built-MIR data model. freak_mir_build owns source-facing lowering policy. This is the mechanical predecessor for No-Syntax-Past-HIR slices and freak_mir_transform; it deliberately does not redesign MIR or version snapshot v5.

Validation

Exact head: 5928d4ad685fe47053b8cb10f9c717f31ee3599b
Base: fix/v4-post-merge-contract-hardening@d26e2e79be8883eabdaf26ad71af6d59b0e7236b (#91)

  • Python compilation and conformance audit pass.
  • 20 focused executable smokes pass.
  • check_v4.py --fast: all 247 fixtures, 3,618 statements, 39.5 MB peak, exit 0.
  • Clean immutable diff.
  • Independent exact-head review: APPROVE, no P0-P3 findings.

Pending

Current-head CI and automated review on this stacked draft PR.

Conservative boundaries

  • Transitional lexer/parser/token dependencies in freak_mir_build are documented and exactly pinned for later shrinkage.
  • Meiya derives returned-loan call provenance from Built MIR plus TY facts; persisting it requires a deliberate versioned snapshot slice.
  • Pre-existing token-facing editor helpers remain a separate tooling-boundary slice.

- Move HIR and TY lowering into freak_mir_build
- Keep Built-MIR storage and snapshot v5 in freak_mir
- Guard crate order and update conformance audit routing
- Move representation-only local lookups into freak_mir

- Keep return-loan interpretation in Meiya over canonical TY queries

- Guard downstream calls and transitional syntax dependencies
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b43a6ea-c968-432c-8695-2306cb170200

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

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