Skip to content

refactor: make runtime ABI IR explicit - #604

Draft
baszalmstra wants to merge 4 commits into
mainfrom
bas/explicit-abi-ir
Draft

refactor: make runtime ABI IR explicit#604
baszalmstra wants to merge 4 commits into
mainfrom
bas/explicit-abi-ir

Conversation

@baszalmstra

@baszalmstra baszalmstra commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Why

Reflection metadata was generated through a generic Rust-to-LLVM derive layer. That hid the ABI layout, made target-specific enum encoding hard to audit, and coupled codegen to a proc-macro crate unrelated to Mun semantics.

What

  • centralize runtime layouts and constants in AbiTypes and AbiBuilder
  • use TypeIdValue and TypeIdGlobal newtypes where LLVM values are easy to mix up
  • encode enum payloads with the target pointer width and byte order
  • remove the generic value wrappers and mun_codegen_macros
  • check size, alignment, and the loaded reflection result

Testing

  • pixi run check with RUSTFLAGS=-Dwarnings
  • pixi run cargo test -p mun_codegen abi_struct_sizes -- --nocapture
  • pixi run cargo test -p mun_codegen --test abi -- --nocapture

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.76031% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.29%. Comparing base (19111bc) to head (3d0a396).

Files with missing lines Patch % Lines
crates/mun_codegen/src/ir/types.rs 91.46% 45 Missing ⚠️
crates/mun_codegen/src/ir/types/test.rs 93.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
+ Coverage   86.74%   87.29%   +0.55%     
==========================================
  Files         263      253      -10     
  Lines       27007    26867     -140     
==========================================
+ Hits        23427    23454      +27     
+ Misses       3580     3413     -167     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@baszalmstra
baszalmstra marked this pull request as draft September 6, 2026 13:27
Base automatically changed from bas/modernize-dependencies to main September 6, 2026 15:29
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