Skip to content

P1-06: add typed MIR validation and scalar HIR lowering - #2

Merged
maikebing merged 1 commit into
codex/p1-05-generic-foundationfrom
codex/p1-06-typed-mir
Sep 17, 2026
Merged

maikebing merged 1 commit into
codex/p1-05-generic-foundationfrom
codex/p1-06-typed-mir

Conversation

@maikebing

Copy link
Copy Markdown
Member

P1-06 needs an explicit typed control-flow representation between P1-04 type checking and the later ownership/backend passes. This PR adds immutable MIR, bounded structural/type/CFG validation, deterministic formatting with source spans and HIR IDs, and opt-in scalar HIR lowering through SafeCoreMirLowering.Lower.

Lowering covers scalar locals, assignments, direct calls, branches, loops, early returns, loop values and short-circuit operators. Temporary reads preserve evaluation order across side effects. Unsupported constructs produce explicit diagnostics and failed lowering publishes no partial program. Validation covers unreachable blocks and malformed IDs/types as well as ordinary control-flow edges.

This PR is stacked on #1; review and merge #1 first. P1-06 remains 🚧 In progress. Aggregate/reference/pattern/closure lowering, definite initialization, ownership and executable backend integration remain subsequent work. The source gate retains P1-04's rejection of control-flow labels. See docs/typed-mir-profile.md and the paired roadmaps for the precise contract.

Validation: ✅ Release solution build with warnings treated as errors; ✅ 301/301 executable regression tests on the combined branch, including 12 MIR validation groups and 7 source-lowering groups with an independent bounded CFG interpreter; ✅ bilingual roadmap checks and git diff --check. Local validation used installed .NET SDK 10.0.401; the repository's 10.0.400 SDK pin remains unchanged. This batch makes no new runtime/AOT or rustc differential conformance claim.

@maikebing
maikebing merged commit de70f11 into codex/p1-05-generic-foundation Sep 17, 2026
2 checks passed
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