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

panic (left != right) left: XMM3, right: XMM3' #3461

Closed
AurelienFT opened this issue Jan 5, 2023 · 9 comments
Closed

panic (left != right) left: XMM3, right: XMM3' #3461

AurelienFT opened this issue Jan 5, 2023 · 9 comments

Comments

@AurelienFT
Copy link

Describe the bug

I run a simple instance of WASM compiled using singlepass using the following features :

    const FEATURES: Features = Features {
        threads: false,
        reference_types: false,
        simd: false,           
        bulk_memory: true,     
        multi_value: false,   
        tail_call: false,      
        module_linking: false, 
        multi_memory: false,   
        memory64: false,      
        exceptions: false,
        relaxed_simd: false,
        extended_const: false,
    };

Steps to reproduce

I'm having an error on a VPS where I have this information about the CPU :

***@***.***:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 13
model name      : QEMU Virtual CPU version 2.5+
stepping        : 3
microcode       : 0x1000065
cpu MHz         : 1996.230
cache size      : 512 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 8
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm nopl cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes xsave rdrand hypervisor lahf_lm cmp_legacy abm 3dnowprefetch ssbd ibpb vmmcall arch_capabilities
bugs            : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 3992.46
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
...

Expected behavior

Run without error

Actual behavior

thread '' panicked at 'assertion failed: (left != right)
 left: XMM3,
 right: XMM3', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-3.1.0/src/emitter_x64.rs:1752:40

Additional context

I'm sorry I can't provide source that I'm using as it's part of a big project. I assume it's an error with the CPU architecture but if you can give me details it could be great.

@AurelienFT AurelienFT changed the title panic (left != right) left: XMM3, right: XMM3' panic (left != right) left: XMM3, right: XMM3 Jan 5, 2023
@AurelienFT AurelienFT changed the title panic (left != right) left: XMM3, right: XMM3 panic (left != right) left: XMM3, right: XMM3' Jan 5, 2023
@ptitSeb
Copy link
Contributor

ptitSeb commented Jan 5, 2023

It seems you are using the SSE42 only emiter. This emiter is still quite experiemental. What happens here is that an unexpected case of a 3-way that has not been succesfully reduced to a 2-way operators.
I can try to code some workaround, but without an easy way to reproduce it will be tricky.

@sydhds
Copy link

sydhds commented Jan 5, 2023

It seems you are using the SSE42 only emiter. This emiter is still quite experiemental. What happens here is that an unexpected case of a 3-way that has not been succesfully reduced to a 2-way operators. I can try to code some workaround, but without an easy way to reproduce it will be tricky.

Is this emitter (SSE42) a feature (that can be enabled or disabled)? Can we enable another emitter (one that have not this bug)?

@ptitSeb
Copy link
Contributor

ptitSeb commented Jan 5, 2023

You "select" SSE4.2 or AVX in function of you CPU capability.

In the mean time, I have create a branch with a potential fix: #3462 if you can try it, that would be great.

@AurelienFT
Copy link
Author

We will try to test it on our side and tell you if it change anything. Thanks for the fast answers

@sydhds
Copy link

sydhds commented Jan 9, 2023

You "select" SSE4.2 or AVX in function of you CPU capability.

In the mean time, I have create a branch with a potential fix: #3462 if you can try it, that would be great.

I've tested it and it fixes our issue! Thanks!

@ptitSeb I see there is another assert in sse_round_fn and the check is not there in avx_round_fn. Is there any reason for this? If not can I provide a patch?

@ptitSeb
Copy link
Contributor

ptitSeb commented Jan 9, 2023

no specific reason. You can provide a patch I'll gladly merge it.

@sydhds
Copy link

sydhds commented Jan 10, 2023

no specific reason. You can provide a patch I'll gladly merge it.

Not an expert with simd instructions but: #3465

@ptitSeb
Copy link
Contributor

ptitSeb commented Jan 16, 2023

I think this ticket can be closed now, right?

@sydhds
Copy link

sydhds commented Jan 17, 2023

I think this ticket can be closed now, right?

Yes

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

No branches or pull requests

3 participants