Repository navigation
Align NativeAOT Vector<T> to 16 bytes on WASM - #135948
Merged
MichalStrehovsky merged 1 commit intoOct 16, 2026
Merged
MichalStrehovsky merged 1 commit into
MichalStrehovsky merged 1 commit into
Conversation
Use the alignment required by the v128 ABI instead of preserving the 8-byte metadata alignment. Leave other architectures unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a6f3a617-acae-4f4f-95d3-20b2a0bac43c
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
tannergooding
approved these changes
Oct 16, 2026
tannergooding
left a comment
Member
There was a problem hiding this comment.
Looks correct for WASM. Left a question above though because this seems like possibly a gap for other types or architectures as well
This was referenced Oct 16, 2026
Closed
MichalStrehovsky
enabled auto-merge (squash)
October 16, 2026 22:43
Member
Author
|
/ba-g widespread mutex failures; this change is not covered by CI |
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.
Summary
Give NativeAOT
System.Numerics.Vector<T>the 16-byte alignment required by its WASMv128ABI.The metadata layout contains two
ulongfields, giving alignment 8. NativeAOT adjusts the vector size for the target but previously retained that metadata alignment. Shared WASM ABI lowering consequently asserts that the 16-byte vector must be 16-byte aligned.Override the field alignment on WASM only. Keep the ABI assertion and preserve other architectures' layouts. This matches the earlier crossgen2/VM correction in #131328, which did not update NativeAOT's separate layout algorithm.
Validation
On the combined local NativeAOT WASI bringup tree, including other unmerged enablement:
WasmLowering.IsWasmV128Typealignment assertion..\build.cmd clr.tools -rc Checked -lc Release -os wasi -arch wasmpassed after the fix..\src\tests\build.cmd nativeaot checked tree nativeaot wasm wasicompiled and linked both affected projects. The tree still failed on the existingUnitTestslowering assertion; C math ABI warnings remain.This branch contains only this cherry-picked commit from
main; it was not built independently. The affected vector tests were not executed.Note
This PR description was generated by GitHub Copilot.