Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sonatina assumed any two object arguments may overlap and that opaque calls and raw stores may write them. Fe's access rules say more: a `mut` parameter's place belongs to the call alone, and nothing writes a view or read effect's place during the call. Mark every object argument that is an access of its caller's place (a view, `mut` or effect parameter, or an access part of a product) `noalias`. Owned parameters stay unmarked, since their objects may be shared.
MIR classed a memory `*T` as a plain `usize` scalar, so codegen could not tell a pointer from an integer. Give it `ScalarRole::Pointer`. Allocations and `PtrOffsetBytes` produce it, `PtrEq` compares it as is, and only it converts to a memory `RawAddr`. The init ABI steps its buffers with `PtrOffsetBytes` instead of a checked word add; both offsets stay inside an allocation whose size was checked.
Native memory addresses were `i64`s, so every heap pointer passed to `free`, `memmove` or `write` went through `int_to_ptr`, and Sonatina saw no provenance. Lower memory pointers, raw addresses and native reference carriers as `*i8`, step them with `gep`, and convert through `ptr_to_int` only for comparisons, casts and range checks. Host externs take their pointer types from MIR, and the panic helpers address their buffers as pointers.
sbillig
force-pushed
the
native-memory-pointers
branch
from
October 29, 2026 16:31
b99019f to
f2f6b00
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Native memory addresses reach Sonatina as pointers, so its alias analysis can track them instead of treating every heap access as unknown.
*TScalarRole::Pointerinstead of a plainusize. Allocations andPtrOffsetBytesproduce it,PtrEqcompares it, and only it converts to a memoryRawAddr. The init ABI steps its buffers withPtrOffsetBytesinstead of a checked add.*i8, steps them withgep, and converts throughptr_to_intonly for comparisons, casts and range checks. Host externs take their pointer types from MIR, so the special case for declared host pointers goes away; sizes passed tomallocandmemmovestay integers.mutand view access parameters are markednoalias.Stacked on #1891.