Skip to content

Commit 6f0e5f8

Browse files
committed
Merge remote-tracking branch 'upstream/master' into separate-functional
2 parents ee9b47a + e4d4650 commit 6f0e5f8

File tree

10 files changed

+77
-52
lines changed

10 files changed

+77
-52
lines changed

deps/k_release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.1.30
1+
7.1.33

flake.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
description = "A flake for the KEVM Semantics";
33

44
inputs = {
5-
k-framework.url = "github:runtimeverification/k/v7.1.30";
5+
k-framework.url = "github:runtimeverification/k/v7.1.33";
66
nixpkgs.follows = "k-framework/nixpkgs";
77
flake-utils.follows = "k-framework/flake-utils";
88
rv-utils.follows = "k-framework/rv-utils";
9-
pyk.url = "github:runtimeverification/k/v7.1.30?dir=pyk";
9+
pyk.url = "github:runtimeverification/k/v7.1.33?dir=pyk";
1010
nixpkgs-pyk.follows = "pyk/nixpkgs";
1111
poetry2nix.follows = "pyk/poetry2nix";
1212
blockchain-k-plugin = {

kevm-pyk/poetry.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kevm-pyk/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "kevm-pyk"
7-
version = "1.0.619"
7+
version = "1.0.622"
88
description = ""
99
authors = [
1010
"Runtime Verification, Inc. <[email protected]>",
@@ -13,7 +13,7 @@ authors = [
1313
[tool.poetry.dependencies]
1414
python = "^3.10"
1515
pathos = "*"
16-
kframework = "7.1.30"
16+
kframework = "7.1.33"
1717
tomlkit = "^0.11.6"
1818

1919
[tool.poetry.group.dev.dependencies]

kevm-pyk/src/kevm_pyk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
if TYPE_CHECKING:
66
from typing import Final
77

8-
VERSION: Final = '1.0.619'
8+
VERSION: Final = '1.0.622'

kevm-pyk/src/kevm_pyk/kompile.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def kevm_kompile(
6262
debug: bool = False,
6363
verbose: bool = False,
6464
type_inference_mode: str | TypeInferenceMode | None = None,
65+
ignore_warnings: Iterable[str] = (),
6566
) -> Path:
6667
if plugin_dir is None:
6768
plugin_dir = kdist.get('evm-semantics.plugin')
@@ -84,6 +85,7 @@ def kevm_kompile(
8485
debug=debug,
8586
verbose=verbose,
8687
type_inference_mode=type_inference_mode,
88+
ignore_warnings=ignore_warnings,
8789
)
8890

8991

@@ -105,6 +107,7 @@ def run_kompile(
105107
debug: bool = False,
106108
verbose: bool = False,
107109
type_inference_mode: str | TypeInferenceMode | None = None,
110+
ignore_warnings: Iterable[str] = (),
108111
) -> Path:
109112
if type_inference_mode is None:
110113
type_inference_mode = TypeInferenceMode.SIMPLESUB
@@ -137,7 +140,11 @@ def run_kompile(
137140
enable_llvm_debug=enable_llvm_debug,
138141
)
139142
return kompile(
140-
output_dir=output_dir, debug=debug, verbose=verbose, type_inference_mode=type_inference_mode
143+
output_dir=output_dir,
144+
debug=debug,
145+
verbose=verbose,
146+
type_inference_mode=type_inference_mode,
147+
ignore_warnings=ignore_warnings,
141148
)
142149

143150
case KompileTarget.MAUDE:
@@ -155,7 +162,11 @@ def _kompile_maude() -> None:
155162

156163
def _kompile_haskell() -> None:
157164
kompile_haskell(
158-
output_dir=output_dir, debug=debug, verbose=verbose, type_inference_mode=type_inference_mode
165+
output_dir=output_dir,
166+
debug=debug,
167+
verbose=verbose,
168+
type_inference_mode=type_inference_mode,
169+
ignore_warnings=ignore_warnings,
159170
)
160171

161172
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
@@ -189,11 +200,16 @@ def _kompile_llvm() -> None:
189200
debug=debug,
190201
verbose=verbose,
191202
type_inference_mode=type_inference_mode,
203+
ignore_warnings=ignore_warnings,
192204
)
193205

194206
def _kompile_haskell() -> None:
195207
kompile_haskell(
196-
output_dir=output_dir, debug=debug, verbose=verbose, type_inference_mode=type_inference_mode
208+
output_dir=output_dir,
209+
debug=debug,
210+
verbose=verbose,
211+
type_inference_mode=type_inference_mode,
212+
ignore_warnings=ignore_warnings,
197213
)
198214

199215
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:

kevm-pyk/src/tests/integration/test_conformance.py

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from __future__ import annotations
22

3+
import csv
34
import json
45
import logging
56
import sys
7+
from pathlib import Path
68
from typing import TYPE_CHECKING
79

810
import pytest
@@ -16,7 +18,6 @@
1618
from ..utils import REPO_ROOT
1719

1820
if TYPE_CHECKING:
19-
from pathlib import Path
2021
from typing import Final
2122

2223
from pyk.kore.syntax import Pattern
@@ -33,11 +34,17 @@
3334

3435

3536
def _test(gst_file: Path, schedule: str, mode: str, chainid: int, usegas: bool) -> None:
37+
skipped_gst_tests = SKIPPED_TESTS.get(gst_file, [])
38+
if '*' in skipped_gst_tests:
39+
pytest.skip()
40+
3641
with gst_file.open() as f:
3742
gst_data = json.load(f)
3843

3944
for test_name, test in gst_data.items():
4045
_LOGGER.info(f'Running test: {gst_file} - {test_name}')
46+
if test_name in skipped_gst_tests:
47+
continue
4148
res = interpret({test_name: test}, schedule, mode, chainid, usegas, check=False)
4249
_assert_exit_code_zero(res)
4350

@@ -57,21 +64,27 @@ def _assert_exit_code_zero(pattern: Pattern) -> None:
5764
assert pretty == GOLDEN
5865

5966

60-
def _skipped_tests() -> set[Path]:
61-
def read_test_list(path: Path) -> list[Path]:
62-
return [REPO_ROOT / test_path for test_path in path.read_text().splitlines()]
67+
def _skipped_tests() -> dict[Path, list[str]]:
68+
slow_tests = read_csv_file(REPO_ROOT / 'tests/slow.llvm')
69+
failing_tests = read_csv_file(REPO_ROOT / 'tests/failing.llvm')
70+
skipped: dict[Path, list[str]] = {}
71+
for test_file, test in slow_tests + failing_tests:
72+
test_file = TEST_DIR / test_file
73+
skipped.setdefault(test_file, []).append(test)
74+
return skipped
75+
6376

64-
slow_tests = read_test_list(REPO_ROOT / 'tests/slow.llvm')
65-
failing_tests = read_test_list(REPO_ROOT / 'tests/failing.llvm')
66-
return set(slow_tests + failing_tests)
77+
def read_csv_file(csv_file: Path) -> tuple[tuple[Path, str], ...]:
78+
with csv_file.open(newline='') as file:
79+
reader = csv.reader(file)
80+
return tuple((Path(row[0]), row[1]) for row in reader)
6781

6882

6983
SKIPPED_TESTS: Final = _skipped_tests()
7084

7185
VM_TEST_DIR: Final = TEST_DIR / 'BlockchainTests/GeneralStateTests/VMTests'
72-
ALL_VM_TESTS: Final = tuple(VM_TEST_DIR.glob('*/*.json'))
73-
VM_TESTS: Final = tuple(test_file for test_file in ALL_VM_TESTS if test_file not in SKIPPED_TESTS)
74-
REST_VM_TESTS: Final = tuple(test_file for test_file in ALL_VM_TESTS if test_file in SKIPPED_TESTS)
86+
VM_TESTS: Final = tuple(VM_TEST_DIR.glob('*/*.json'))
87+
SKIPPED_VM_TESTS: Final = tuple(test_file for test_file in VM_TESTS if test_file in SKIPPED_TESTS)
7588

7689

7790
@pytest.mark.parametrize(
@@ -86,27 +99,23 @@ def test_vm(test_file: Path) -> None:
8699
@pytest.mark.skip(reason='failing / slow VM tests')
87100
@pytest.mark.parametrize(
88101
'test_file',
89-
REST_VM_TESTS,
90-
ids=[str(test_file.relative_to(VM_TEST_DIR)) for test_file in REST_VM_TESTS],
102+
SKIPPED_VM_TESTS,
103+
ids=[str(test_file.relative_to(VM_TEST_DIR)) for test_file in SKIPPED_VM_TESTS],
91104
)
92105
def test_rest_vm(test_file: Path) -> None:
93106
_test(test_file, 'DEFAULT', 'VMTESTS', 1, True)
94107

95108

96-
BCHAIN_TEST_DIR: Final = TEST_DIR / 'BlockchainTests/GeneralStateTests'
97-
ALL_BCHAIN_TESTS: Final = tuple(BCHAIN_TEST_DIR.glob('**/*.json'))
98-
BCHAIN_TESTS: Final = tuple(
99-
test_file for test_file in ALL_BCHAIN_TESTS if test_file not in (list(SKIPPED_TESTS) + list(ALL_VM_TESTS))
100-
)
101-
REST_BCHAIN_TESTS: Final = tuple(
102-
test_file for test_file in ALL_BCHAIN_TESTS if test_file in SKIPPED_TESTS and test_file not in ALL_VM_TESTS
103-
)
109+
ALL_TEST_DIR: Final = TEST_DIR / 'BlockchainTests/GeneralStateTests'
110+
ALL_TESTS: Final = tuple(ALL_TEST_DIR.glob('**/*.json'))
111+
BCHAIN_TESTS: Final = tuple(test_file for test_file in ALL_TESTS if test_file not in set(VM_TESTS))
112+
SKIPPED_BCHAIN_TESTS: Final = tuple(test_file for test_file in BCHAIN_TESTS if test_file in SKIPPED_TESTS)
104113

105114

106115
@pytest.mark.parametrize(
107116
'test_file',
108117
BCHAIN_TESTS,
109-
ids=[str(test_file.relative_to(TEST_DIR)) for test_file in BCHAIN_TESTS],
118+
ids=[str(test_file.relative_to(ALL_TEST_DIR)) for test_file in BCHAIN_TESTS],
110119
)
111120
def test_bchain(test_file: Path) -> None:
112121
_test(test_file, 'SHANGHAI', 'NORMAL', 1, True)
@@ -115,8 +124,8 @@ def test_bchain(test_file: Path) -> None:
115124
@pytest.mark.skip(reason='failing / slow blockchain tests')
116125
@pytest.mark.parametrize(
117126
'test_file',
118-
REST_BCHAIN_TESTS,
119-
ids=[str(test_file.relative_to(TEST_DIR)) for test_file in REST_BCHAIN_TESTS],
127+
SKIPPED_BCHAIN_TESTS,
128+
ids=[str(test_file.relative_to(ALL_TEST_DIR)) for test_file in SKIPPED_BCHAIN_TESTS],
120129
)
121130
def test_rest_bchain(test_file: Path) -> None:
122131
_test(test_file, 'SHANGHAI', 'NORMAL', 1, True)

package/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.619
1+
1.0.622

tests/slow.llvm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
tests/ethereum-tests/BlockchainTests/GeneralStateTests/VMTests/vmPerformance/loopMul.json
2-
tests/ethereum-tests/BlockchainTests/GeneralStateTests/VMTests/vmPerformance/loopExp.json
1+
BlockchainTests/GeneralStateTests/VMTests/vmPerformance/loopMul.json,*
2+
BlockchainTests/GeneralStateTests/VMTests/vmPerformance/loopExp.json,*

0 commit comments

Comments
 (0)