-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: prepare for 0.0.6 release #309
Merged
Conversation
This file contains 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
Release v0.0.1 (take 5): Initial release of the compiler and SDK crates
Previous to this commit, we were expecting the rodata segments to be encoded in a specific order, and placed on the advice stack before anything else. With this commit, we now simply expect to the advice map to contain each segment keyed by its commitment hash, which we then move to the advice stack on demand, and immediately pipe to memory. This means the order of the segments no longer matters, and the advice stack is not sensitive to codegen changes or other influences which might perturb the advice stack or otherwise disrupt our assumptions. It also sets the stage for us to be able to initialize rodata after a context switch, as at that point the advice stack will be in an unknown condition, and using the advice map gives us certainty that we can arrange to have exactly what we need on the advice stack, when we need it. Additionally, I've updated the `midenc debug` input config file, as well as the usage documentation to reflect this. The last related change to this, will be emitting the rodata segments to disk in a convenient form, so that when the compiler emits the program, it also emits the segments alongside it, making it convenient to run the debugger against that program (or via the VM directly).
This commit implements a basic package format for Miden programs and libraries, with the metadata needed to simplify using them together. The format is experimental, and can be changed at any time, however it does use a header that lets us identify whether a package was produced with the same specification or not. This also modifies the compiler and debugger to emit and consume, respectively, the package format as their primary artifact. The debugger uses this, for example, to initialize the VM with the necessary libraries and rodata segments required by the program. The package format is described using the structures in `codegen/masm/src/packaging/package.rs`, and is encoded using a tiny, but efficient binary format from the `bitcode` crate, using `serde` to facilitate the lowering of our high-level types to that format. This made it relatively straightforward to implement the format without having to mess around with the low-level byte representation. The `bitcode` crate is designed with stability in mind, though because we are using it via `serde`, the stability is subject to being violated if `serde` changes something that causes `bitcode` to serialize a type differently. For now, this is a non-issue, longer term we might want to actually implement `bitcode::{Encode, Decode}` for our types if we want to gain more stability.
Some recent changes caused the `midenc compile` command to emit no outputs when `--emit` was not provided. Also fixed: * Moved some unnecessary debug logs to trace level * Added more debug logging to the compiler to aid in troubleshooting * Fixed serialization of packages involving more complex inputs which were hitting an issue with fields marked as skippable via serde; this is not supported via bitcode, so those attributes were removed
It turns out we were assuming that Rust was laying out its memory using the default LLVM layout, but rustc actually specifies a larger shadow stack. We were not properly handling the defined memory in Wasm modules parsed by the frontend, and so we ended up incorrectly placing global variables and other data in the middle of memory that rust was using for either the shadow stack or static data. Because of the size of the shadow stack region reserved by Rust, this was not causing any corruption in our tests, but it was causing other assumptions to be invalid, and miscompilations were the result. This commit treats the Wasm memory for a parsed module as reserved for use by the code in that module, which causes midenc to place any global variables it defines after that region, and computes the start of the heap as immediately following any such data. It does so by propagating the page size and reserved number of pages through the IR and to the backend, taking that information into account as needed.
feat: introduce experimental packaging format
Implement memory intrinsics for storing double word (i64/u64)
chore: fix clippy warnings in tests
Release v0.0.4
Release v0.0.4 (take 2)
Release v0.0.5
docs: switch from mdbook to mkdocs
…ace-version chore: switch all crates to a single workspace version (0.0.5)
chore: clean up unused deps
chore: fix mkdocs warnings, move cargo-miden README to docs
docs: revisit/update documentation
bobbinth
approved these changes
Sep 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you! Not a review at all, but always good to see removal of almost 10 KLOCs :)
Definitely :). I'm hoping we can further simplify some things in upcoming releases, we'll see how it goes! |
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.
This PR merges our current
next
branch intomain
, which will make the documentation available for publishing. Subsequent to this PR, we'll publish 0.0.6 containing some recent fixes relied upon in the updated docs.@bobbinth @Dominik1999 I've added you as reviewers in case either of you are available still this afternoon/evening, and can approve this to keep things moving along. Otherwise, we'll probably have to put this off until Monday when @greenhat can get to it.