Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Update to latest threads spectests
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga committed Jan 5, 2024
1 parent 52f5e22 commit f34e261
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 105 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ spectest_v2_testdata_dir := $(spectest_v2_dir)/testdata
spec_version_v2 := 1782235239ddebaf2cb079b00fdaa2d2c4dedba3
spectest_threads_dir := $(spectest_base_dir)/threads
spectest_threads_testdata_dir := $(spectest_threads_dir)/testdata
spec_version_threads := cc01bf0d17ba3fb1dc59fb7c5c725838aff18b50
# From https://github.com/WebAssembly/threads/tree/upstream-rebuild which has not been merged to main yet.
# It will likely be renamed to main in the future - https://github.com/WebAssembly/threads/issues/216.
spec_version_threads := 3635ca51a17e57e106988846c5b0e0cc48ac04fc

.PHONY: build.spectest
build.spectest:
Expand Down Expand Up @@ -174,9 +176,6 @@ build.spectest.threads:
@mkdir -p $(spectest_threads_testdata_dir)
@cd $(spectest_threads_testdata_dir) \
&& curl -sSL 'https://api.github.com/repos/WebAssembly/threads/contents/test/core?ref=$(spec_version_threads)' | jq -r '.[]| .download_url' | grep -E "atomic.wast" | xargs -Iurl curl -sJL url -O
# Fix broken CAS spectests
# https://github.com/WebAssembly/threads/issues/195#issuecomment-1318429506
@cd $(spectest_threads_testdata_dir) && patch < ../atomic.wast.patch
@cd $(spectest_threads_testdata_dir) && for f in `find . -name '*.wast'`; do \
wast2json --enable-threads --debug-names $$f; \
done
Expand Down
49 changes: 0 additions & 49 deletions internal/integration_test/spectest/threads/atomic.wast.patch

This file was deleted.

102 changes: 51 additions & 51 deletions internal/integration_test/spectest/threads/testdata/atomic.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,54 +276,54 @@
{"type": "assert_return", "line": 496, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]},
{"type": "assert_trap", "line": 499, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "65536"}, {"type": "i32", "value": "0"}]}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]},
{"type": "assert_trap", "line": 500, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "65531"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]},
{"type": "module", "line": 504, "filename": "atomic.3.wasm"},
{"type": "module", "line": 557, "filename": "atomic.4.wasm"},
{"type": "assert_return", "line": 561, "action": {"type": "invoke", "field": "fence", "args": []}, "expected": []},
{"type": "assert_invalid", "line": 564, "filename": "atomic.5.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 565, "filename": "atomic.6.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 566, "filename": "atomic.7.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 567, "filename": "atomic.8.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 568, "filename": "atomic.9.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 569, "filename": "atomic.10.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 570, "filename": "atomic.11.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 571, "filename": "atomic.12.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 572, "filename": "atomic.13.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 573, "filename": "atomic.14.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 574, "filename": "atomic.15.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 575, "filename": "atomic.16.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 576, "filename": "atomic.17.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 577, "filename": "atomic.18.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 578, "filename": "atomic.19.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 579, "filename": "atomic.20.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 580, "filename": "atomic.21.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 581, "filename": "atomic.22.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 582, "filename": "atomic.23.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 583, "filename": "atomic.24.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 584, "filename": "atomic.25.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 585, "filename": "atomic.26.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 586, "filename": "atomic.27.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 587, "filename": "atomic.28.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 588, "filename": "atomic.29.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 589, "filename": "atomic.30.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 590, "filename": "atomic.31.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 591, "filename": "atomic.32.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 592, "filename": "atomic.33.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 593, "filename": "atomic.34.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 594, "filename": "atomic.35.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 595, "filename": "atomic.36.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 596, "filename": "atomic.37.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 597, "filename": "atomic.38.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 598, "filename": "atomic.39.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 599, "filename": "atomic.40.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 600, "filename": "atomic.41.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 601, "filename": "atomic.42.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 602, "filename": "atomic.43.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 603, "filename": "atomic.44.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 604, "filename": "atomic.45.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 605, "filename": "atomic.46.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 606, "filename": "atomic.47.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 607, "filename": "atomic.48.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 608, "filename": "atomic.49.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 609, "filename": "atomic.50.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 610, "filename": "atomic.51.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 611, "filename": "atomic.52.wasm", "text": "unknown memory", "module_type": "binary"}]}
{"type": "module", "line": 503, "filename": "atomic.3.wasm"},
{"type": "module", "line": 556, "filename": "atomic.4.wasm"},
{"type": "assert_return", "line": 560, "action": {"type": "invoke", "field": "fence", "args": []}, "expected": []},
{"type": "assert_invalid", "line": 563, "filename": "atomic.5.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 564, "filename": "atomic.6.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 565, "filename": "atomic.7.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 566, "filename": "atomic.8.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 567, "filename": "atomic.9.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 568, "filename": "atomic.10.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 569, "filename": "atomic.11.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 570, "filename": "atomic.12.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 571, "filename": "atomic.13.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 572, "filename": "atomic.14.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 573, "filename": "atomic.15.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 574, "filename": "atomic.16.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 575, "filename": "atomic.17.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 576, "filename": "atomic.18.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 577, "filename": "atomic.19.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 578, "filename": "atomic.20.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 579, "filename": "atomic.21.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 580, "filename": "atomic.22.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 581, "filename": "atomic.23.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 582, "filename": "atomic.24.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 583, "filename": "atomic.25.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 584, "filename": "atomic.26.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 585, "filename": "atomic.27.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 586, "filename": "atomic.28.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 587, "filename": "atomic.29.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 588, "filename": "atomic.30.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 589, "filename": "atomic.31.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 590, "filename": "atomic.32.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 591, "filename": "atomic.33.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 592, "filename": "atomic.34.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 593, "filename": "atomic.35.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 594, "filename": "atomic.36.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 595, "filename": "atomic.37.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 596, "filename": "atomic.38.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 597, "filename": "atomic.39.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 598, "filename": "atomic.40.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 599, "filename": "atomic.41.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 600, "filename": "atomic.42.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 601, "filename": "atomic.43.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 602, "filename": "atomic.44.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 603, "filename": "atomic.45.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 604, "filename": "atomic.46.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 605, "filename": "atomic.47.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 606, "filename": "atomic.48.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 607, "filename": "atomic.49.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 608, "filename": "atomic.50.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 609, "filename": "atomic.51.wasm", "text": "unknown memory", "module_type": "binary"},
{"type": "assert_invalid", "line": 610, "filename": "atomic.52.wasm", "text": "unknown memory", "module_type": "binary"}]}
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@
(assert_trap (invoke "memory.atomic.notify" (i32.const 65536) (i32.const 0)) "out of bounds memory access")
(assert_trap (invoke "memory.atomic.notify" (i32.const 65531) (i32.const 0)) "unaligned atomic")


;; unshared memory is OK
(module
(memory 1 1)
Expand Down

0 comments on commit f34e261

Please sign in to comment.