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

List of unimplemented functionality for conformance tests #150

Open
ehildenb opened this issue Jul 16, 2019 · 9 comments
Open

List of unimplemented functionality for conformance tests #150

ehildenb opened this issue Jul 16, 2019 · 9 comments

Comments

@ehildenb
Copy link
Member

No description provided.

@ehildenb
Copy link
Member Author

Let's have a list here of the Wasm test-cases which demonstrate unimplemented functionality.

@QianyangPeng
Copy link
Contributor

binary module should be loaded correctly as a module. Refer to section V of Wasm semantics for details.

(module binary
  "\00asm" "\01\00\00\00"
  "\06\0a\01"                          ;; Global section with 1 entry
  "\7f\00"                             ;; i32, immutable
  "\41\ff\ff\ff\ff\7f"                 ;; i32.const -1
  "\0b"                                ;; end
)

#clearConfig

@QianyangPeng
Copy link
Contributor

Float numbers should be able to represented in hexfloat format.

(module
  (func (export "add") (param $x f64) (param $y f64) (result f64) (f64.add (local.get $x) (local.get $y)))
  (func (export "f64.no_contraction") (param $x f64) (param $y f64) (param $z f64) (result f64)
    (f64.add (f64.mul (local.get $x) (local.get $y)) (local.get $z)))
)

(assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1p-1)) (f64.const -0x1p-1))
(assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const 0x1.921fb54442d18p+2))(assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+3))
(assert_return (invoke "f64.no_contraction" (f64.const -0x1.9e87ce14273afp-103) (f64.const 0x1.2515ad31db63ep+664) (f64.const 0x1.868c6685e6185p+533)) (f64.const -0x1.da94885b11493p+561))

#clearConfig

@QianyangPeng
Copy link
Contributor

NaN float should be able to be initialized with a payload and the negative sign bit.

(module
  (func (export "add") (param $x f32) (param $y f32) (result f32) (f32.add (local.get $x) (local.get $y)))
  (func (export "min") (param $x f32) (param $y f32) (result f32) (f32.min (local.get $x) (local.get $y)))
  (func (export "copysign") (param $x f32) (param $y f32) (result f32) (f32.copysign (local.get $x) (local.get $y)))
)

(assert_return_canonical_nan (invoke "add" (f32.const -0.88) (f32.const -nan)))
(assert_return_arithmetic_nan (invoke "add" (f32.const -0.5) (f32.const -nan:0x200000)))
(assert_return_arithmetic_nan (invoke "min" (f32.const -0.5) (f32.const -nan:0x200000)))
(assert_return (invoke "copysign" (f32.const 0.123) (f32.const -nan)) (f32.const 0.123))

#clearConfig

@QianyangPeng
Copy link
Contributor

float and int should be able to be converted from one to the other, without changing the inner bit representation..

(module
  (func (export "i32.reinterpret_f32") (param $x f32) (result i32) (i32.reinterpret_f32 (local.get $x)))
  (func (export "i64.reinterpret_f64") (param $x f64) (result i64) (i64.reinterpret_f64 (local.get $x)))
)

(assert_return (invoke "i32.reinterpret_f32" (f32.const -nan)) (i32.const 0xffc00000))
(assert_return (invoke "i64.reinterpret_f64" (f64.const 3.14159265358979)) (i64.const 4614256656552045841))

#clearConfig

@QianyangPeng
Copy link
Contributor

---- END ----

@hjorthjort
Copy link
Contributor

There are tests that ensure that resources get exhausted that seem to be only for the reference interpreter. assert_exhaustion is not documented anywhere. I asked about it here: WebAssembly/spec#1060. The commit that introduced it (with modifications to the reference interpreter) is here: WebAssembly/spec@5236d50

Example:

(module
  (func $runaway (export "runaway") (call $runaway))
)

(assert_exhaustion (invoke "runaway") "call stack exhausted")

@hjorthjort
Copy link
Contributor

hjorthjort commented Sep 3, 2019

The reference test rely on a module called "spectest" and one called "test". These are modules of host functions from the embedder. We would need to supply it via the embedder, or ignore any test that relies on it.

We could also give an implementation of them in pure Wasm, ignoring the intended environment interactions, such as printing. For the purpose of the core tests, it is really only interesting how these modules modify the store in observable ways.

We could also do a sophisticated ignore of all spectest and test module imports: whatever they import, we taint it with some new value so that whenever it gets used, we throw a special exception. We already do this for functions. We could do the same thing (throw a special exception) for all the floating point operations, including conversion operations.

@hjorthjort
Copy link
Contributor

It's possible to supply a module as a wasm string list in the reference tests, like so:

(module quote "(func (drop (" "i32.const 0)))")

This is not part of the formal spec, however, and is only ever used to check that the parser reports malformedness.

@hjorthjort hjorthjort changed the title Make list for unimplemented functionality for performance tests List for unimplemented functionality for conformance tests Dec 12, 2019
@hjorthjort hjorthjort changed the title List for unimplemented functionality for conformance tests List of unimplemented functionality for conformance tests Dec 12, 2019
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