-
Notifications
You must be signed in to change notification settings - Fork 40
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
Value stack tag mismatch with the fast interpreter #271
Comments
Thanks, I'll take a look at this soon. |
Looks like it was overwriting a register while decoding an unused part of a reference type local. With this change, the test program fails later with a failed cast (which I hope is right! :-)) |
Well, looking at the diff between the traces of the slow and fast interpreter, it seems there is also an off by one error somewhere :) --- ok.txt 2025-02-04 04:04:29.420647490 +0100
+++ bug.txt 2025-02-04 04:04:18.412609428 +0100
@@ -115698,21188 +115698,15 @@
+67: local.get[2]
+69: local.get[4]
+71: select[(ref eq)]
+ +74: i32.div_s
+75: local.tee[1]
+77: call[func=24]
+3: local.get[0]
+5: ref.cast[i31]
- +8: i31.get_s
- +10: local.tee[1]
- +12: i32.const[0]
[...]
+<wasm func #117> +65
+ <wasm func "entry_point"> +1
+ <wasm func "caml_main"> +11
+ <wasm func "toplevel"> +936
+ <wasm func "create$1"> +77
+ <wasm func "caml_create_bytes"> +5
+ !trap[FAILED_CAST] |
Oh, yes, I see now the fast interpreter does not decode value types in select properly (https://github.com/titzer/wizard-engine/blob/master/src/engine/x86-64/X86_64Interpreter.v3#L1008). I'll see if I can get a fix in later today or tomorrow. |
See #277 . |
Looks like I fixed the interpreter but the JIT still fails with a value tag mismatch.
|
With #269, I still get an error with the fast interpreter on the attached program:
The slow interpreter seems to work fine (after providing a dummy implementation for the WASI function
random_get
):The text was updated successfully, but these errors were encountered: