Skip to content
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

IR documentation improvements and improve debug assert #10130

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

iwanders
Copy link
Contributor

Improvements discussed in #10118, fyi @cfallin.

Changes are two-fold, commits are split out.

In 681c8c8 adds a message to the debug assert stating the reason why the assert failed. Other asserts with string were capitalised, I tried to match it, reads like:

assertion `left == right` failed: Address width of 64 expected, got i32
  left: types::I32
 right: types::I64

Technically the type assignment and print isn't necessary, but I found it reads more clear than left and right only, though the fmt made it a multi-line :/

In c5f31de the size of the first and second argument is changed to 64 bits, as well as the v3 and v4, which hold the offset into the array, I also added one sentence above it pointing at the pointer size is assumed to be 64 bits for the conversion of the function to IR. I did the changes manually, confirmed the changes do not trigger the debug assert and verified the created symbol does work to calculate an average.

Meta suggestion: The PR template contains:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

That should really be linked in CONTRIBUTING.md as well, because I ended up looking at the commit history to figure out the commit message preference, only to discover that it'll be squashed anyway :D

…e#10118)

This adds additional information as to what is wrong when this assert is encountered.
…lliance#10118)

Most people using this example will likely be on 64 bit systems, so it makes
sense to target a system with 64 bit addressses with the example.
@iwanders iwanders requested a review from a team as a code owner January 28, 2025 00:57
@iwanders iwanders requested review from fitzgen and removed request for a team January 28, 2025 00:57
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cfallin cfallin enabled auto-merge January 28, 2025 01:02
@cfallin cfallin added this pull request to the merge queue Jan 28, 2025
Merged via the queue into bytecodealliance:main with commit cccc4e6 Jan 28, 2025
51 checks passed
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.

2 participants