Skip to content

refactor: make heap projections explicit - #606

Draft
baszalmstra wants to merge 2 commits into
bas/typed-codegen-valuesfrom
bas/place-projections
Draft

refactor: make heap projections explicit#606
baszalmstra wants to merge 2 commits into
bas/typed-codegen-valuesfrom
bas/place-projections

Conversation

@baszalmstra

Copy link
Copy Markdown
Collaborator

Why

Heap references and arrays recovered their pointee types by inspecting LLVM pointer element types. Opaque pointers remove that information, and unchecked wrapper construction let the wrong pointer depth travel until a later load or GEP failed.

What

  • store the object or array aggregate type beside each runtime handle
  • return typed PlaceValues from heap, field, and array projections
  • remove unchecked constructors and all get_element_type calls from codegen
  • route field and element loads and stores through typed places

Testing

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

@baszalmstra
baszalmstra marked this pull request as draft September 6, 2026 13:28
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.40260% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.14%. Comparing base (bd9624a) to head (c65a8f3).

Files with missing lines Patch % Lines
crates/mun_codegen/src/ir/body.rs 97.84% 2 Missing ⚠️
crates/mun_codegen/src/ir/array.rs 96.66% 1 Missing ⚠️
crates/mun_codegen/src/ir/reference.rs 94.11% 1 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           bas/typed-codegen-values     #606      +/-   ##
============================================================
- Coverage                     87.32%   87.14%   -0.19%     
============================================================
  Files                           254      254              
  Lines                         26933    26887      -46     
============================================================
- Hits                          23520    23430      -90     
- Misses                         3413     3457      +44     

☔ 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 force-pushed the bas/place-projections branch 2 times, most recently from 674c577 to 36492b2 Compare September 6, 2026 14:27
@baszalmstra
baszalmstra force-pushed the bas/place-projections branch from 36492b2 to c65a8f3 Compare 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