Stream: git-wasmtime

Topic: wasmtime / issue #5916 Cranelift: Interpreter returns the...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 21:28):

afonso360 opened issue #5916:

:wave: Hey,

.clif Test Case

test interpret
test run
target x86_64

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

     Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: interpret
FAIL ./lmao.clif: interpret

Caused by:
    Failed test: run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1, actual: 0
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: Interpreter (x86_64 host)

Extra Info

If anyone needs help looking into this, let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 21:28):

afonso360 labeled issue #5916:

:wave: Hey,

.clif Test Case

test interpret
test run
target x86_64

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

     Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: interpret
FAIL ./lmao.clif: interpret

Caused by:
    Failed test: run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1, actual: 0
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: Interpreter (x86_64 host)

Extra Info

If anyone needs help looking into this, let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 21:28):

afonso360 labeled issue #5916:

:wave: Hey,

.clif Test Case

test interpret
test run
target x86_64

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

     Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: interpret
FAIL ./lmao.clif: interpret

Caused by:
    Failed test: run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1, actual: 0
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: Interpreter (x86_64 host)

Extra Info

If anyone needs help looking into this, let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 21:29):

afonso360 labeled issue #5916:

:wave: Hey,

.clif Test Case

test interpret
test run
target x86_64

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

     Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: interpret
FAIL ./lmao.clif: interpret

Caused by:
    Failed test: run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1, actual: 0
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: Interpreter (x86_64 host)

Extra Info

If anyone needs help looking into this, let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 21:29):

afonso360 labeled issue #5916:

:wave: Hey,

.clif Test Case

test interpret
test run
target x86_64

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

     Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: interpret
FAIL ./lmao.clif: interpret

Caused by:
    Failed test: run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1, actual: 0
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: Interpreter (x86_64 host)

Extra Info

If anyone needs help looking into this, let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 21:29):

afonso360 edited issue #5916:

:wave: Hey,

.clif Test Case

test interpret

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

     Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: interpret
FAIL ./lmao.clif: interpret

Caused by:
    Failed test: run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1, actual: 0
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: Interpreter (x86_64 host)

Extra Info

If anyone needs help looking into this, let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 21:34):

afonso360 edited issue #5916:

:wave: Hey,

.clif Test Case

test interpret

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1

Steps to Reproduce

Expected Results

The test to pass

Actual Results

     Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: interpret
FAIL ./lmao.clif: interpret

Caused by:
    Failed test: run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1, actual: 0
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: Interpreter (x86_64 host)

Extra Info

If anyone needs help looking into this, let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Jun 01 2023 at 10:24):

ms140569 commented on issue #5916:

I like to take a look into it. Should I claim this somewhere/somehow?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 01 2023 at 11:22):

afonso360 commented on issue #5916:

Awesome! I think that comment is probably enough. Let me know if you run into any issues!

view this post on Zulip Wasmtime GitHub notifications bot (Jun 07 2023 at 14:17):

ms140569 commented on issue #5916:

I could reproduce this bug on aarch64 (apple) interpreter as well. The compiler for both linux x86_64 and aarch64 works just fine. I've doublechecked with this:

test compile

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0x00000000000000000000000000000000) == 0
; run: %a(0xffffffffffffffffffffffffffffff00) == 0
; run: %a(0x00ffffffffffffffffffffffffffffff) == 0
; run: %a(0xffffffffffffff00ffffffffffffffff) == 0
; run: %a(0x01010101010101010101010101010101) == 1
; run: %a(0xffffffffffffffffffffffffffffffff) == 1
; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1

; Kick this file off:
;  target/debug/clif-util run ~/prj/wasm/bug/vall-true-5916-compiler.clif

; The definition of vall_true:
;  from: cranelift/codegen/meta/src/shared/instructions.rs
;
; "Reduce a vector to a scalar boolean.
; Return a scalar boolean true if all lanes in ``i`` are non-zero, false otherwise."

The problem seems to be the AND operation in the interpreter here:

https://github.com/bytecodealliance/wasmtime/blob/b357b1b1e922a28990ed39cb8fe763add096de5c/cranelift/interpreter/src/step.rs#LL1046C82-L1046C85

I'll try to come up with a (performant) fix.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 11 2023 at 11:11):

afonso360 closed issue #5916:

:wave: Hey,

.clif Test Case

test interpret

function %a(i8x16) -> i8 {
block0(v0: i8x16):
    v20 = vall_true v0
    return v20
}

; run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1

Steps to Reproduce

Expected Results

The test to pass

Actual Results

     Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: interpret
FAIL ./lmao.clif: interpret

Caused by:
    Failed test: run: %a(0xe66021830506f2fffdfebfc8c8c8c8c8) == 1, actual: 0
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: Interpreter (x86_64 host)

Extra Info

If anyone needs help looking into this, let me know!


Last updated: Oct 23 2024 at 20:03 UTC