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

Fix Threads/Imports Tests #3154

Closed
ptitSeb opened this issue Aug 31, 2022 · 2 comments
Closed

Fix Threads/Imports Tests #3154

ptitSeb opened this issue Aug 31, 2022 · 2 comments
Labels
bug Something isn't working priority-medium Medium priority issue
Milestone

Comments

@ptitSeb
Copy link
Contributor

ptitSeb commented Aug 31, 2022

Describe the bug

On the feat_sharedmemory branch, the wast test threads/imports is failling.
The faillure is:

Error: Failed directives on tests/wast/spec/proposals/threads/imports.wast:
  • assert_invalid: expected "multiple tables", got "instantiation failed with: constant expression required" (309:1)
  • assert_invalid: expected "multiple tables", got "instantiation failed with: constant expression required" (313:1)
  • expected module to fail to build (317:1)
  • instantiation failed with: Error while importing "spectest"."shared_memory": unknown import. Expected Memory(MemoryType { minimum: 1 pages, maximum: Some(2 pages), shared: true }) (499:1)
  • assert_unlinkable: expected incompatible import type, got instantiation failed with: Error while importing "spectest"."shared_memory": unknown import. Expected Memory(MemoryType { minimum: 1 pages, maximum: Some(2 pages), shared: false }) (501:1)

Technically, the sub-tests are failling as expected, but the error message is a generic one instead of a specific one.

@ptitSeb ptitSeb added the bug Something isn't working label Aug 31, 2022
@ptitSeb ptitSeb added this to the v3.x milestone Aug 31, 2022
@ptitSeb ptitSeb mentioned this issue Aug 31, 2022
11 tasks
@syrusakbary syrusakbary added the priority-medium Medium priority issue label Sep 6, 2022
@syrusakbary
Copy link
Member

syrusakbary commented Oct 10, 2022

For the error:

  • instantiation failed with: Error while importing "spectest"."shared_memory": unknown import. Expected Memory(MemoryType { minimum: 1 pages, maximum: Some(2 pages), shared: true }) (499:1)

It seems we need to add a new shared_memory in the spectest runner:

https://github.com/wasmerio/wasmer/blob/master/tests/lib/wast/src/spectest.rs#L32-L46

So the linked code becomes:

    let shared_memory = ...
    imports! {
        "spectest" => {
            "print" => print,
            "print_i32" => print_i32,
            "print_i64" => print_i64,
            "print_f32" => print_f32,
            "print_f64" => print_f64,
            "print_i32_f32" => print_i32_f32,
            "print_f64_f64" => print_f64_f64,
            "global_i32" => global_i32,
            "global_i64" => global_i64,
            "global_f32" => global_f32,
            "global_f64" => global_f64,
            "table" => table,
            "memory" => memory,
            "shared_memory" => shared_memory,
        },
    }

@ptitSeb ptitSeb modified the milestones: v3.x, v3.1 Nov 16, 2022
bors bot added a commit that referenced this issue Nov 29, 2022
3153: SharedMemory & Atomics r=ptitSeb a=ptitSeb

# Description
Enabled SharedMemory and the Atomics extension proposal

- [x] Enable Atomic extension by default
- [x] Fix "imports" tests #3154
- [x] Add function for memory.atomic.wait32, memory.atomic.wait64 and memory.atomic.notify opcodes #3155
- [x] Add support for the new wait/notify opcodes in Cranelift compiler #3156 
- [x] Add support for the new wait/notify opcodes in LLVM compiler #3157
- [x] Add support for atomic access opcodes in AArch64/Singlepass compiler #3159
- [x] Add support for the new wait/notify opcodes in Singlepass compiler #3158
- [x] Fix Atomic issues on x86_64 Singlepass compiler not related to Wait/Notify opcodes #3161
- [x] Fix Atomic issues on Cranelift compiler not related to Wait/Notify opcodes #3162
- [x] Fix Atomic issues on LLVM compiler not related to Wait/Notify opcodes #3163
- [x] Fix the ticket #3167 on Cranelift

For #3304 

Co-authored-by: John Sharratt's Shared Account <[email protected]>
Co-authored-by: ptitSeb <[email protected]>
Co-authored-by: Syrus Akbary <[email protected]>
@ptitSeb
Copy link
Contributor Author

ptitSeb commented Dec 6, 2022

Merged

@ptitSeb ptitSeb closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants