Repository navigation
Treat Wasm Vector<T> layout as fixed - #135804
Merged
davidwrighton merged 2 commits intoOct 19, 2026
Merged
Conversation
Skip runtime-dependent vector layout checks on Wasm while retaining checks on native targets and for types outside the version bubble. Add cross-target compiler regressions for vectors, wrappers, and tuples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 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: @dotnet/crossgen-contrib |
davidwrighton
marked this pull request as ready for review
October 14, 2026 21:53
davidwrighton
requested review from
jtschuster and
tannergooding
and
a balanced review from Copilot
October 14, 2026 21:53
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The unconditional regression theory expects compiled vector methods on targets where their layout is indeterminate.
1 open finding
What changed in this PR
Treats Wasm32 Vector<T> layout as fixed in ReadyToRun compilation, avoiding redundant checks while preserving other targets’ behavior and version-bubble restrictions.
Changes:
- Recognizes Wasm32 vectors as fixed-layout types.
- Adds regular/composite regression cases for vectors, wrappers, and tuples.
- Documents the Wasm layout rule.
Builds and tests were not run during this review.
| File | Description |
|---|---|
| src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs | Adds the Wasm32 fixed-layout decision. |
| src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/Webcil/WasmSimdModule.cs | Adds vector tuple fixtures. |
| src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/R2RTestSuites.cs | Checks layout fixups across compilation modes. |
| docs/design/coreclr/botr/readytorun-format.md | Documents fixed Wasm vector layout. |
🧠 Review effort: Balanced
jkotas
reviewed
Oct 14, 2026
This was referenced Oct 15, 2026
Closed
Preserve the Vector<T> optimism policy in InstructionSetSupport and use it for fixed-layout decisions instead of special-casing Wasm. Cover fixed and optimistic configurations in regular and composite tests, and gate the tests on target vector support. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8f7879c0-2733-4f0e-a679-07cc5a1b6ad2
jkotas
approved these changes
Oct 19, 2026
jtschuster
approved these changes
Oct 19, 2026
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.

Description
Extract the independent Wasm vector-layout change from #135553 onto
main.Treat
System.Numerics.Vector<T>as having fixed layout on Wasm32, where its width is fixed at 128 bits. Avoid redundant runtime-dependent vector layout checks on that target. Containing types can also have fixed layout when their remaining layout is fixed within the version bubble.Other targets retain runtime-dependent vector layout checks, and ordinary version-bubble restrictions remain in place for containing types. Add regular/composite regression cases covering vectors, wrappers, and vector-containing tuples, and document the Wasm layout rule.
Source commit:
6a269adea70a2ea611bc2a3da78c43cdc08545c7. This PR does not include the separate canonical SIMD-root exclusion, two-phase compilation, direct calls, or the prolog/frame-identity changes.Historical size measurements
These matched before/after Wasm measurements were collected on the original development branch, not on this newly extracted/rebased PR. The recorded JIT hashes match between baseline and updated builds. Brotli used quality 11 and window 22.
These are historical size measurements, not throughput benchmarks or a guarantee of equivalent savings on current main.
Validation
git diff --check upstream/main...split/wasm-vector-layout— passed.This remains a draft; build and runtime validation on the independent branch are outstanding.
Note
This PR was prepared with GitHub Copilot.