Skip to content

Lower V4 local annotations from semantic HIR facts - #94

Draft
OttoApocalypse69 wants to merge 4 commits into
refactor/v4-mir-build-splitfrom
refactor/v4-no-syntax-local-annotations
Draft

Lower V4 local annotations from semantic HIR facts#94
OttoApocalypse69 wants to merge 4 commits into
refactor/v4-mir-build-splitfrom
refactor/v4-no-syntax-local-annotations

Conversation

@OttoApocalypse69

Copy link
Copy Markdown
Member

What changed

  • store task-local declared type text and exact statement/type spans in HIR
  • expose HIR-backed TY adapters and make freak_mir_build consume those semantic facts for local declarations
  • bump the HIR component snapshot to v4 with local-annotation records, strict slot/owner/span validation, and atomic restore rejection
  • pin the six remaining, unrelated MIR type-text reconstruction callers as an explicit shrinking allowlist
  • cover fixed pilots, tuple/list destructuring, fixed arrays, invalid annotation arity, restore, and adversarial schema variants

Ownership boundary

HIR owns declaration syntax facts once; TY owns canonicalization and diagnostics; freak_mir_build consumes TY. MIR still uses body tokens for CFG, patterns, places, and expression boundaries. This is one vertical boundary slice, not the entire No-Syntax-Past-HIR cleanup.

Validation

  • independent exact-head review of 47c77abaeebfdf28e4e10c41d5f4665398fce838: APPROVE, no P0-P3
  • seven-smoke annotation/alias/MIR/Meiya/LLVM regression batch: pass
  • serialized check_v4.py --fast: all 248 fixtures pass, 3,662 flattened statements, 42.8 MB peak retained, CHECK_EXIT=0
  • python -u -m py_compile src/compiler/v4/check_v4.py: pass
  • python -u -m freakc audit-conformance: pass
  • parser/typecheck: 21 crates, zero diagnostics
  • diff and conflict hygiene: pass

Stack and conservative boundary

This draft is stacked on refactor/v4-mir-build-split / PR #92. The next recommended semantic family is ordinary task declared return annotations; call-site and pattern syntax remain later slices. GitHub CI and automated review are pending.

- Store task-local declaration annotation types and spans in HIR/TY
- Lower annotated pilot declarations without reconstructing type text in MIR
- Add fixed, tuple, list, snapshot, diagnostic, and Meiya coverage
- Validate versioned HIR annotation snapshot ownership and slots
- Guard the exact remaining MIR build type-text consumers
- Document and test atomic malformed-snapshot rejection
Reject malformed ownership and slot variants before restore.
Guard HIR and TY accessors against syntax reconstruction.
Keep negative lowering checks live after snapshot truncation.
@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: fee9d1a7-d9ef-45e2-8c19-ec281726b438

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