Skip to content

Conversation

@rossberg
Copy link
Member

@rossberg rossberg commented Nov 6, 2024

In preparation for merging the proposal to the wasm-3.0 branch, this PR fixes various smaller issues I discovered when going through the diffs for the merge.

Spec:

  • Removed unnecessary/mismatching lookup of table/memory type in execution prose
  • Added missing result type lookup in formal rule for table.size and memory.size
  • Fixed computation of -1 result value for table.grow and table.size to work for i64
  • Some fixes around specification of text format for inline elements/data shorthand
  • Fixed matching rules for tabletype/memtype to enforce same address type
  • Added an entry for the proposal to the Appendix’ changelog

Interpreter:

  • Fixed evaluation of v128 load/store instructions to work with i64
  • Reworked bulk operation execution to still reduce to well-typed instructions for i32
  • Added missing size check to table allocation
  • Various minor refactorings and clean-ups

Tests:

  • Added tests for size check in i64 table and memory type limits

@sbc100, PTAL. Feel free to upstream back to the repo as you see fit.

Also, it would be good if you could add some tests for SIMD load/stores on i64 memories, since those were broken in the interpreter.

@rossberg rossberg requested a review from sbc100 November 6, 2024 14:50
@sbc100
Copy link
Member

sbc100 commented Nov 6, 2024

Thanks @rossberg for looking into this. I had been meaning to ask you to go through some of the interpreter changes (since some of them I make while resolving conflicts and I think where unreviewed), but you beat me to it.

I do think for the sake of keeping the history of this proposal in one place it might me good to land these changes in the memory64 repo before merging. Is that what you mean by "Feel free to upstream back to the repo as you see fit"? I'm happy to do that.

Copy link
Contributor

@bvisness bvisness left a comment

Choose a reason for hiding this comment

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

All looks good to me!

5. Let :math:`\X{mem}` be the :ref:`memory instance <syntax-meminst>` :math:`S.\SMEMS[a]`.

6. Let :math:`\X{at}~\limits` be the :ref:`memory type <syntax-memtype>` :math:`\X{mem}.\MITYPE`.
6. Assert: due to :ref:`validation <valid-load-extend>`, a value of :ref:`adress type <syntax-addrtype>` :math:`\X{at}` is on the top of the stack.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: adress

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@rossberg
Copy link
Member Author

rossberg commented Nov 6, 2024

I do think for the sake of keeping the history of this proposal in one place it might me good to land these changes in the memory64 repo before merging. Is that what you mean by "Feel free to upstream back to the repo as you see fit"? I'm happy to do that.

Yes, sounds good!

sbc100 added a commit to WebAssembly/memory64 that referenced this pull request Nov 6, 2024
sbc100 added a commit to WebAssembly/memory64 that referenced this pull request Nov 6, 2024
Interpreter:

- Fixed evaluation of v128 load/store instructions to work with i64
- Reworked bulk operation execution to still reduce to well-typed instructions for i32
- Added missing size check to table allocation
- Various minor refactorings and clean-ups

Tests:

- Added tests for size check in i64 table and memory type limits

Split out from WebAssembly/spec#1839
sbc100 added a commit to WebAssembly/memory64 that referenced this pull request Nov 6, 2024
sbc100 added a commit to WebAssembly/memory64 that referenced this pull request Nov 6, 2024
- Removed unnecessary/mismatching lookup of table/memory type in execution prose
- Added missing result type lookup in formal rule for table.size and memory.size
- Fixed computation of -1 result value for table.grow and table.size to work for i64
- Some fixes around specification of text format for inline elements/data shorthand
- Fixed matching rules for tabletype/memtype to enforce same address type

Split out from WebAssembly/spec#1839
sbc100 added a commit to WebAssembly/memory64 that referenced this pull request Nov 6, 2024
Interpreter:

- Fixed evaluation of v128 load/store instructions to work with i64
- Reworked bulk operation execution to still reduce to well-typed instructions for i32
- Added missing size check to table allocation
- Various minor refactorings and clean-ups

Tests:

- Added tests for size check in i64 table and memory type limits

Split out from WebAssembly/spec#1839
@sbc100
Copy link
Member

sbc100 commented Nov 6, 2024

I think all these changes have now landed downstream in the memory64 repo

sbc100 added a commit to WebAssembly/memory64 that referenced this pull request Nov 6, 2024
Interpreter:

- Fixed evaluation of v128 load/store instructions to work with i64
- Reworked bulk operation execution to still reduce to well-typed instructions for i32
- Added missing size check to table allocation
- Various minor refactorings and clean-ups

Tests:

- Added tests for size check in i64 table and memory type limits

Split out from WebAssembly/spec#1839
@rossberg rossberg merged commit d7ba933 into wasm-3.0+addr64 Nov 7, 2024
@rossberg rossberg deleted the wasm-3.0+addr64.fixes branch September 26, 2025 08:29
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.

4 participants