mega mir redo#1404
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17ac59eacb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3afd41a74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33f491b0a1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Not a proper review but looks like the bountiful tests crash against this branch: This is against latest bountiful master |
shiiiiit |
|
The core/std abi changes were meant to be a separate pr that this one depends on. I'll see if I can split that out cleanly. (Though I guess I'm not sure if it's worthwhile, given that the old defunct mir code would need to be updated) |
|
@cburgdorf The deeper hardening to not panic when MIR lowering runs into this issue, but I'm going to defer that to a followup. |
I'll push up a bountiful pr with the required changes. Edit: fe-lang/bountiful#8 |
|
Ran rosetta-fe against this branch vs v26.0.1. Two compile failures
Every call shape hits it, not just chaining: Trait-method dispatch is affected too: rosetta-fe's Suspected spot: "runtime package has no root objects" on packages whose contract lives in a submodule re-exported from Moving Gas deltas on what still compiles
amm's hot paths down ~2%, governance uniformly up ~1-1.7%, erc20/escrow flat. Caveats: v26.0.1 baseline (master since is only docs work); had to exclude verifier/math/merkle/ec from the workspace to make |
Note: I haven't fully vetted this on the external test cases since rebasing, will do so in the morning.
The big change here is to split MIR into phases. SMIR -> NSMIR -> MIR -> Sonatina/Yul
SMIR ("semantic mir") - this is basically hir in cfg form. Used for const time function evaluation (and thus needs to live in the hir crate to avoid a dependency cycle between hir and mir). This allows us to cleanly expand const fn capabilities, and replaces the previous ugly hir-based implementation.
NSMIR (normalized) - includes concrete borrowing and place/origin information. Used for borrow checking and other diagnostics.
MIR - low-level, but backend neutral representation that's lowered into sonatina/yul. Includes concrete layouts, const/code regions, etc
(Aside: SMIR and NSMIR could maybe be collapsed together. NSMIR just derives a bunch of information that isn't relevant for ctfe)
This fixes a lot of tricky bugs we had previously due to sidecar info alongside the insufficient representation, and information being deduced/inferred in late stages because it wasn't propagated forward by earlier stages.
Unfortunately basically every snapshot has been updated. Name mangling that was previously done in the old MIR is now deferred to codegen, and yul currently uses a simple incremented suffix for conflicting names, which should be changed.
(Aside: I think we should consider replacing the big codegen snapshots with small targeted snapshots.)
TODO, here or in quick follow-up prs