Skip to content

Commit ec23baa

Browse files
committed
[GR-38700] Make Bytecode DSL the default.
PullRequest: graalpython/4133
2 parents 1c9713a + 2648c49 commit ec23baa

File tree

36 files changed

+384
-357
lines changed

36 files changed

+384
-357
lines changed

ci.jsonnet

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,17 @@
7575
local bench_task(bench=null, benchmarks=BENCHMARKS) = super.bench_task(bench=bench, benchmarks=benchmarks),
7676
local bisect_bench_task = self.bisect_bench_task,
7777

78-
local bytecode_dsl_env = task_spec({
78+
// Manual interpreter variants (DSL disabled)
79+
local manual_interpreter_env = task_spec({
7980
environment +: {
80-
BYTECODE_DSL_INTERPRETER: "true"
81+
BYTECODE_DSL_INTERPRETER: "false"
8182
},
8283
}),
83-
local bytecode_dsl_gate(name) = bytecode_dsl_env + task_spec({
84+
local manual_interpreter_gate(name) = manual_interpreter_env + task_spec({
8485
tags :: name,
8586
}),
86-
local bytecode_dsl_bench = bytecode_dsl_env + task_spec({
87-
name_suffix +:: ["bytecode-dsl"],
87+
local manual_interpreter_bench = manual_interpreter_env + task_spec({
88+
name_suffix +:: ["manual-interpreter"],
8889
}),
8990

9091
// -----------------------------------------------------------------------------------------------------------------
@@ -95,7 +96,6 @@
9596
local GPY_JVM21_STANDALONE = "graalpy-jvm21-standalone",
9697
local GPY_JVM_STANDALONE = "graalpy-jvm-standalone",
9798
local GPY_NATIVE_STANDALONE = "graalpy-native-standalone",
98-
local GPY_NATIVE_BYTECODE_DSL_STANDALONE = "graalpy-native-bc-dsl-standalone",
9999
local GPYEE_JVM_STANDALONE = "graalpy-ee-jvm-standalone",
100100
local GPYEE_NATIVE_STANDALONE = "graalpy-ee-native-standalone",
101101
local GRAAL_JDK_LATEST = "graal-jdk-latest",
@@ -116,7 +116,7 @@
116116
"darwin:aarch64:jdk-latest" : tier3 + provide(GPY_JVM_STANDALONE),
117117
"windows:amd64:jdk-latest" : tier3 + provide(GPY_JVM_STANDALONE),
118118
}),
119-
"python-unittest-bytecode-dsl": gpgate + platform_spec(no_jobs) + bytecode_dsl_gate("python-unittest") + platform_spec({
119+
"python-unittest-manual-interpreter": gpgate + platform_spec(no_jobs) + manual_interpreter_gate("python-unittest") + platform_spec({
120120
"linux:amd64:jdk-latest" : daily + t("01:00:00"),
121121
"linux:aarch64:jdk-latest" : daily + t("01:00:00"),
122122
"darwin:aarch64:jdk-latest" : daily + t("01:00:00"),
@@ -170,7 +170,7 @@
170170
"darwin:aarch64:jdk-latest" : tier3 + require(GRAAL_JDK_LATEST),
171171
"windows:amd64:jdk-latest" : tier3 + require(GRAAL_JDK_LATEST),
172172
}),
173-
"python-junit-bytecode-dsl": gpgate + platform_spec(no_jobs) + bytecode_dsl_gate("python-junit") + platform_spec({
173+
"python-junit-manual-interpreter": gpgate + platform_spec(no_jobs) + manual_interpreter_gate("python-junit") + platform_spec({
174174
"linux:amd64:jdk-latest" : tier3 + require(GRAAL_JDK_LATEST),
175175
}),
176176
"python-junit-maven": gpgate_maven + platform_spec(no_jobs) + platform_spec({
@@ -204,33 +204,21 @@
204204
],
205205
}),
206206
}),
207-
"python-pgo-profile-bytecode-dsl": gpgate_ee + bytecode_dsl_env + platform_spec(no_jobs) + platform_spec({
208-
"linux:amd64:jdk-latest" : post_merge + t("01:30:00") + task_spec({
209-
run: [["mx", "python-native-pgo"]],
210-
logs+: [
211-
"default-bytecode-dsl.iprof.gz",
212-
"default-bytecode-dsl.lcov",
213-
],
214-
}),
215-
}),
216207
"python-svm-unittest": gpgate + platform_spec(no_jobs) + platform_spec({
217208
"linux:amd64:jdk-latest" : tier2 + require(GPY_NATIVE_STANDALONE),
218209
"linux:aarch64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE),
219210
"darwin:aarch64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE),
220211
"windows:amd64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE) + batches(2),
221212
}),
222-
"python-svm-unittest-bytecode-dsl": gpgate + platform_spec(no_jobs) + bytecode_dsl_gate("python-svm-unittest") + platform_spec({
223-
"linux:amd64:jdk-latest" : tier2 + provide(GPY_NATIVE_BYTECODE_DSL_STANDALONE),
213+
"python-svm-unittest-manual-interpreter": gpgate + platform_spec(no_jobs) + manual_interpreter_gate("python-svm-unittest") + platform_spec({
214+
"linux:amd64:jdk-latest" : tier2,
224215
}),
225216
"python-tagged-unittest": gpgate + require(GPY_NATIVE_STANDALONE) + batches(TAGGED_UNITTESTS_SPLIT) + platform_spec(no_jobs) + platform_spec({
226217
"linux:amd64:jdk-latest" : tier2,
227218
"linux:aarch64:jdk-latest" : tier3,
228219
"darwin:aarch64:jdk-latest" : tier3,
229220
"windows:amd64:jdk-latest" : daily + t("02:00:00"),
230221
}),
231-
"python-tagged-unittest-bytecode-dsl": gpgate + require(GPY_NATIVE_BYTECODE_DSL_STANDALONE) + batches(TAGGED_UNITTESTS_SPLIT) + bytecode_dsl_gate("python-tagged-unittest") + platform_spec(no_jobs) + platform_spec({
232-
"linux:amd64:jdk-latest" : tier3,
233-
}),
234222
"python-graalvm": gpgate + platform_spec(no_jobs) + platform_spec({
235223
"linux:amd64:jdk-latest" : tier3 + require(GRAAL_JDK_LATEST),
236224
"linux:aarch64:jdk-latest" : tier3 + require(GRAAL_JDK_LATEST),
@@ -288,7 +276,6 @@
288276
},
289277

290278
local need_pgo = task_spec({runAfter: ["python-pgo-profile-post_merge-linux-amd64-jdk-latest"]}),
291-
local need_bc_pgo = task_spec({runAfter: ["python-pgo-profile-bytecode-dsl-post_merge-linux-amd64-jdk-latest"]}),
292279
local forks_warmup = forks("./mx.graalpython/warmup-fork-counts.json"),
293280
local forks_meso = forks("meso.json"),
294281
local raw_results = task_spec({
@@ -315,12 +302,6 @@
315302
"vm_name:pypy" : {"linux:amd64:jdk-latest" : on_demand + t("04:00:00")},
316303
}),
317304
for bench in ["micro", "meso", "macro"]
318-
} + {
319-
[bench + "-bytecode-dsl"]: bench_task(bench) + bytecode_dsl_bench + platform_spec(no_jobs) + bench_variants({
320-
"vm_name:graalvm_ee_default_bc_dsl" : {"linux:amd64:jdk-latest" : daily + t("08:00:00")},
321-
"vm_name:graalpython_enterprise_bc_dsl" : {"linux:amd64:jdk-latest" : daily + t("08:00:00")},
322-
}),
323-
for bench in ["micro", "meso", "macro"]
324305
} + {
325306
[bench]: bench_task(bench) + platform_spec(no_jobs) + bench_variants({
326307
"vm_name:graalvm_ce_default" : {"linux:amd64:jdk-latest" : on_demand + t("08:00:00")},
@@ -350,12 +331,6 @@
350331
"vm_name:cpython" : {"linux:amd64:jdk-latest" : weekly + t("02:00:00")},
351332
}),
352333
for bench in ["micro_small", "meso_small"]
353-
} + {
354-
[bench + "-bytecode-dsl"]: bench_task(bench) + bytecode_dsl_bench + platform_spec(no_jobs) + bench_variants({
355-
"vm_name:graalvm_ee_default_interpreter_bc_dsl" : {"linux:amd64:jdk-latest" : daily + t("04:00:00")},
356-
"vm_name:graalpython_enterprise_interpreter_bc_dsl" : {"linux:amd64:jdk-latest" : weekly + t("04:00:00")},
357-
}),
358-
for bench in ["micro_small", "meso_small"]
359334
} + {
360335
// benchmarks executed via Java embedding driver
361336
[bench]: bench_task(bench) + platform_spec(no_jobs) + bench_variants({
@@ -383,25 +358,13 @@
383358
"vm_name:pypy" : {"linux:amd64:jdk-latest" : on_demand + t("01:00:00")},
384359
}),
385360
for bench in ["warmup"]
386-
} + {
387-
[bench + "-bytecode-dsl"]: bench_task(bench) + bytecode_dsl_bench + platform_spec(no_jobs) + bench_variants({
388-
"vm_name:graalvm_ee_default_bc_dsl" : {"linux:amd64:jdk-latest" : on_demand + t("05:00:00") + forks_warmup},
389-
"vm_name:graalpython_enterprise_bc_dsl" : {"linux:amd64:jdk-latest" : on_demand + t("05:00:00") + forks_warmup},
390-
}),
391-
for bench in ["warmup"]
392361
} + {
393362
[bench]: bench_task(bench) + platform_spec(no_jobs) + bench_variants({
394363
"vm_name:graalvm_ee_default_interpreter" : {"linux:amd64:jdk-latest" : post_merge + t("02:00:00") + need_pgo},
395364
"vm_name:graalpython_enterprise_interpreter" : {"linux:amd64:jdk-latest" : weekly + t("02:00:00")},
396365
"vm_name:cpython" : {"linux:amd64:jdk-latest" : weekly + t("01:00:00")},
397366
}),
398367
for bench in ["heap", "micro_small_heap"]
399-
} + {
400-
[bench + "-bytecode-dsl"]: bench_task(bench) + bytecode_dsl_bench + platform_spec(no_jobs) + bench_variants({
401-
"vm_name:graalvm_ee_default_interpreter_bc_dsl" : {"linux:amd64:jdk-latest" : post_merge + t("02:00:00") + need_bc_pgo},
402-
"vm_name:graalpython_enterprise_interpreter_bc_dsl" : {"linux:amd64:jdk-latest" : weekly + t("02:00:00")},
403-
}),
404-
for bench in ["heap", "micro_small_heap"]
405368
} + {
406369
// interop benchmarks only for graalpython, weekly is enough
407370
[bench]: bench_task(bench) + platform_spec(no_jobs) + bench_variants({
@@ -427,12 +390,6 @@
427390
"vm_name:pypy_launcher" : {"linux:amd64:jdk-latest" : on_demand + t("08:00:00")},
428391
}),
429392
for bench in ["pyperformance"]
430-
} + {
431-
// Bytecode DSL benchmarks with community benchmark suites for external numbers
432-
[bench + "-bytecode-dsl"]: bench_task(bench, PY_BENCHMARKS) + bytecode_dsl_bench + platform_spec(no_jobs) + raw_results + bench_variants({
433-
"vm_name:graalvm_ee_default_bc_dsl" : {"linux:amd64:jdk-latest" : weekly + t("08:00:00")},
434-
}),
435-
for bench in ["pyperformance"]
436393
} + {
437394
// benchmarks with community benchmark suites for external numbers
438395
[bench]: bench_task(bench, PY_BENCHMARKS) + platform_spec(no_jobs) + raw_results + bench_variants({

ci/constants.libsonnet

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@
5757

5858
local PYVM_CONFIG = {
5959
default: "default",
60-
default_bc_dsl: "default-bc-dsl",
60+
default_manual: "default-manual",
6161
default_multi: "default-multi",
6262
interpreter: "interpreter",
63-
interpreter_bc_dsl: "interpreter-bc-dsl",
63+
interpreter_manual: "interpreter-manual",
6464
native_interpreter: "native-interpreter",
65-
native_interpreter_bc_dsl: "native-interpreter-bc-dsl",
65+
native_interpreter_manual: "native-interpreter-manual",
6666
interpreter_multi: "interpreter-multi",
6767
native_interpreter_multi: "native-interpreter-multi",
6868
default_multi_tier: "default-multi-tier",
6969
native: "native",
70-
native_bc_dsl: "native-bc-dsl",
70+
native_manual: "native-manual",
7171
native_multi: "native-multi",
7272
launcher: "launcher",
7373
panama: "panama",
@@ -128,25 +128,25 @@
128128
python_vm: PYVM.graalpython,
129129
python_vm_config: PYVM_CONFIG.default,
130130
},
131-
graalpython_bc_dsl: {
131+
graalpython_manual: {
132132
python_vm: PYVM.graalpython,
133-
python_vm_config: PYVM_CONFIG.default_bc_dsl,
133+
python_vm_config: PYVM_CONFIG.default_manual,
134134
},
135135
graalpython_interpreter: {
136136
python_vm: PYVM.graalpython,
137137
python_vm_config: PYVM_CONFIG.interpreter,
138138
},
139-
graalpython_interpreter_bc_dsl: {
139+
graalpython_interpreter_manual: {
140140
python_vm: PYVM.graalpython,
141-
python_vm_config: PYVM_CONFIG.interpreter_bc_dsl,
141+
python_vm_config: PYVM_CONFIG.interpreter_manual,
142142
},
143143
graalpython_native_interpreter: {
144144
python_vm: PYVM.graalpython,
145145
python_vm_config: PYVM_CONFIG.native_interpreter,
146146
},
147-
graalpython_native_interpreter_bc_dsl: {
147+
graalpython_native_interpreter_manual: {
148148
python_vm: PYVM.graalpython,
149-
python_vm_config: PYVM_CONFIG.native_interpreter_bc_dsl,
149+
python_vm_config: PYVM_CONFIG.native_interpreter_manual,
150150
},
151151
graalpython_multi: {
152152
python_vm: PYVM.graalpython,
@@ -168,9 +168,9 @@
168168
python_vm: PYVM.graalpython,
169169
python_vm_config: PYVM_CONFIG.native,
170170
},
171-
graalpython_native_bc_dsl: {
171+
graalpython_native_manual: {
172172
python_vm: PYVM.graalpython,
173-
python_vm_config: PYVM_CONFIG.native_bc_dsl,
173+
python_vm_config: PYVM_CONFIG.native_manual,
174174
},
175175
graalpython_native_multi: {
176176
python_vm: PYVM.graalpython,
@@ -209,26 +209,26 @@
209209
local VM = {
210210
// graalpy jvm standalones
211211
graalpython_core: PYTHON_VM.graalpython + JVM_VM.graaljdk_ce,
212-
graalpython_core_bc_dsl: PYTHON_VM.graalpython_bc_dsl + JVM_VM.graaljdk_ce,
212+
graalpython_core_manual: PYTHON_VM.graalpython_manual + JVM_VM.graaljdk_ce,
213213
graalpython_core_interpreter: PYTHON_VM.graalpython_interpreter + JVM_VM.graaljdk_ce,
214-
graalpython_core_interpreter_bc_dsl: PYTHON_VM.graalpython_interpreter_bc_dsl + JVM_VM.graaljdk_ce,
214+
graalpython_core_interpreter_manual: PYTHON_VM.graalpython_interpreter_manual + JVM_VM.graaljdk_ce,
215215
graalpython_core_multi: PYTHON_VM.graalpython_multi + JVM_VM.graaljdk_ce,
216216
graalpython_core_interpreter_multi: PYTHON_VM.graalpython_interpreter_multi + JVM_VM.graaljdk_ce,
217217
graalpython_core_multi_tier: PYTHON_VM.graalpython_multi_tier + JVM_VM.graaljdk_ce,
218218
graalpython_enterprise: PYTHON_VM.graalpython + JVM_VM.graaljdk_ee,
219-
graalpython_enterprise_bc_dsl: PYTHON_VM.graalpython_bc_dsl + JVM_VM.graaljdk_ee,
219+
graalpython_enterprise_manual: PYTHON_VM.graalpython_manual + JVM_VM.graaljdk_ee,
220220
graalpython_enterprise_multi: PYTHON_VM.graalpython_multi + JVM_VM.graaljdk_ee,
221221
graalpython_enterprise_multi_tier: PYTHON_VM.graalpython_multi_tier + JVM_VM.graaljdk_ee,
222222
graalpython_enterprise_interpreter: PYTHON_VM.graalpython_interpreter + JVM_VM.graaljdk_ee,
223-
graalpython_enterprise_interpreter_bc_dsl: PYTHON_VM.graalpython_interpreter_bc_dsl + JVM_VM.graaljdk_ee,
223+
graalpython_enterprise_interpreter_manual: PYTHON_VM.graalpython_interpreter_manual + JVM_VM.graaljdk_ee,
224224
graalpython_core_native: PYTHON_VM.graalpython_native + JVM_VM.graaljdk_ce,
225-
graalpython_core_native_bc_dsl: PYTHON_VM.graalpython_native_bc_dsl + JVM_VM.graaljdk_ce,
225+
graalpython_core_native_manual: PYTHON_VM.graalpython_native_manual + JVM_VM.graaljdk_ce,
226226
graalpython_core_native_interpreter: PYTHON_VM.graalpython_native_interpreter + JVM_VM.graaljdk_ce,
227-
graalpython_core_native_interpreter_bc_dsl: PYTHON_VM.graalpython_native_interpreter_bc_dsl + JVM_VM.graaljdk_ce,
227+
graalpython_core_native_interpreter_manual: PYTHON_VM.graalpython_native_interpreter_manual + JVM_VM.graaljdk_ce,
228228
graalpython_core_native_multi: PYTHON_VM.graalpython_native_multi + JVM_VM.graaljdk_ce,
229229
graalpython_core_native_interpreter_multi: PYTHON_VM.graalpython_native_interpreter_multi + JVM_VM.graaljdk_ce,
230230
graalpython_enterprise_native: PYTHON_VM.graalpython_native + JVM_VM.graaljdk_ee,
231-
graalpython_enterprise_native_bc_dsl: PYTHON_VM.graalpython_native_bc_dsl + JVM_VM.graaljdk_ee,
231+
graalpython_enterprise_native_manual: PYTHON_VM.graalpython_native_manual + JVM_VM.graaljdk_ee,
232232
graalpython_enterprise_native_multi: PYTHON_VM.graalpython_native_multi + JVM_VM.graaljdk_ee,
233233
graalpython_core_panama: PYTHON_VM.graalpython_panama + JVM_VM.graaljdk_ce,
234234
graalpython_enterprise_panama: PYTHON_VM.graalpython_panama + JVM_VM.graaljdk_ee,
@@ -237,9 +237,9 @@
237237
graalvm_ce_default: PYTHON_VM.graalpython + JVM_VM.graal_native_image_ce,
238238
graalvm_ce_default_interpreter: PYTHON_VM.graalpython_interpreter + JVM_VM.graal_native_image_ce,
239239
graalvm_ee_default: PYTHON_VM.graalpython + JVM_VM.graal_native_image_ee,
240-
graalvm_ee_default_bc_dsl: PYTHON_VM.graalpython_bc_dsl + JVM_VM.graal_native_image_ee,
240+
graalvm_ee_default_manual: PYTHON_VM.graalpython_manual + JVM_VM.graal_native_image_ee,
241241
graalvm_ee_default_interpreter: PYTHON_VM.graalpython_interpreter + JVM_VM.graal_native_image_ee,
242-
graalvm_ee_default_interpreter_bc_dsl: PYTHON_VM.graalpython_interpreter_bc_dsl + JVM_VM.graal_native_image_ee,
242+
graalvm_ee_default_interpreter_manual: PYTHON_VM.graalpython_interpreter_manual + JVM_VM.graal_native_image_ee,
243243
graalvm_ce_default_multi_tier: PYTHON_VM.graalpython_multi_tier + JVM_VM.graal_native_image_ce,
244244
graalvm_ee_default_multi_tier: PYTHON_VM.graalpython_multi_tier + JVM_VM.graal_native_image_ee,
245245

ci/python-gate.libsonnet

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
windows: {
159159
common: {
160160
PATH: "$MAVEN_HOME\\bin;$PATH",
161+
# Gradle: this feature doesn't work on all Windows CI machines
162+
GRADLE_OPTS: "-Dorg.gradle.vfs.watch=false",
161163
},
162164
amd64: {},
163165
aarch64: {},

graalpython/com.oracle.graal.python.test.integration/src/com/oracle/graal/python/test/integration/basic/HelloWorldTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
import org.graalvm.polyglot.Context;
3434
import org.graalvm.polyglot.Engine;
35+
import org.graalvm.polyglot.Value;
36+
import org.junit.Assert;
3537
import org.junit.Test;
3638

3739
import com.oracle.graal.python.test.integration.PythonTests;
@@ -50,6 +52,12 @@ public void helloworldAgain() {
5052
PythonTests.assertPrints("hello\n", source);
5153
}
5254

55+
@Test
56+
public void helloworldExpression() {
57+
Value value = PythonTests.eval("'hello world'");
58+
Assert.assertEquals("hello world", value.asString());
59+
}
60+
5361
@Test
5462
public void usesFrozenModules() {
5563
final ByteArrayOutputStream byteArray = new ByteArrayOutputStream();

0 commit comments

Comments
 (0)