Skip to content

[GR-67646] Improve Truffle CI gates and introduce tiers. #11945

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

Merged
merged 5 commits into from
Aug 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
306 changes: 154 additions & 152 deletions truffle/ci/ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@
local darwin_amd64 = common.darwin_amd64,
local darwin_aarch64 = common.darwin_aarch64,
local linux_amd64 = common.linux_amd64,
local linux_aarch64 = common.linux_aarch64,
local windows_amd64 = common.windows_amd64,

local winDevKit(jdk) =
devkits[
if jdk.jdk_version == 21
then "windows-jdk21"
else "windows-jdkLatest"
],

local truffle_common = {
setup+: [
["cd", "./truffle"],
],
targets: ["gate"],
timelimit: "30:00",
},

local guard = {
guard+: {
includes+: ["<graal>/sdk/**", "<graal>/truffle/**", "**.jsonnet"] + top_level_ci,
}
notify_groups:: ["truffle"],
},

local bench_common = {
Expand All @@ -35,33 +36,8 @@
]
},

local gate_lite(target) = truffle_common + {
name: target + '-truffle-lite-oraclejdk-' + self.jdk_name + '-' + self.os + '-' + self.arch,
run: [
["mx", "build"],
["mx", "unittest", "--verbose"],
],
targets: [target],
},

local sigtest = truffle_common + {
name: 'gate-truffle-sigtest-' + self.jdk_name,
run: [
["mx", "build"],
["mx", "sigtest", "--check", (if self.jdk_version == 21 then "all" else "bin")],
],
},

local graalVMCELatest = common.labsjdkLatest + common.deps.svm + {
mx_build_graalvm_cmd: ["mx", "-p", "../vm", "--env", "ce", "--native-images=lib:jvmcicompiler"],
run+: [
self.mx_build_graalvm_cmd + ["build"],
["set-export", "JAVA_HOME", self.mx_build_graalvm_cmd + ["--quiet", "--no-warning", "graalvm-home"]]
]
},

local simple_tool_maven_project_gate = truffle_common + {
name: 'gate-external-mvn-simpletool-' + self.jdk_name,
name: self.name_prefix + 'truffle-simpletool-maven-' + self.jdk_name + '-' + self.os + '-' + self.arch,
packages+: {
maven: "==3.3.9"
},
Expand All @@ -80,7 +56,7 @@
},

local simple_language_maven_project_gate = truffle_common + {
name: 'gate-external-mvn-simplelanguage-' + self.jdk_name,
name: self.name_prefix + 'truffle-simplelanguage-maven-' + self.jdk_name + '-' + self.os + '-' + self.arch,
packages+: {
maven: "==3.3.9",
ruby: "==3.0.2",
Expand All @@ -103,146 +79,172 @@
],
},

local truffle_jvm_gate = truffle_common + {
local truffle_common_gate = truffle_common + common.deps.eclipse + common.deps.jdt + common.deps.spotbugs {
components+: ["truffle"],
},

# this is only valid for gates that depend only on truffle files
# do not use for latest GraalVM builds
local guard = {
guard+: {
includes+: ["<graal>/sdk/**", "<graal>/truffle/**", "**.jsonnet"] + top_level_ci,
}
},

local truffle_style_gate = truffle_common_gate + guard + {
name: self.name_prefix + 'truffle-style-' + self.truffle_jdk_name + '-' + self.os + '-' + self.arch,
run+: [
['mx', '--no-jlinking', 'gate', '--no-warning-as-error', '--tags', 'build,truffle-jvm'],
["mx", "--strict-compliance", "gate", "--strict-mode", "--tag", "style,fullbuild,sigtest"],
],
notify_groups: ["truffle"],
components+: ["truffle"],
timelimit: '1:15:00',
name: 'gate-truffle-ce-jvm-' + self.jdk_name + '-linux-amd64',
},

# runs only truffle native unittests
local truffle_native_unittest_gate = truffle_common + {
gate_tag_suffix: '',
local truffle_test_full_gate = truffle_common_gate + guard + {
name: self.name_prefix + 'truffle-full-test-' + self.truffle_jdk_name + '-' + self.os + '-' + self.arch,
run+: [
['mx', '--no-jlinking', 'gate', '--no-warning-as-error', '--tags', 'build,unittest-native' + self.gate_tag_suffix],
["mx", "--strict-compliance", "gate", "--strict-mode", "--tag", "style,fullbuild,fulltest"]
],
},
local truffle_test_lite_gate= truffle_common_gate + guard + {
name: self.name_prefix + 'truffle-lite-test-' + self.truffle_jdk_name + '-' + self.os + '-' + self.arch,
run+: [
["mx", "--strict-compliance", "gate", "--strict-mode", "--tag", "build,test"],
],
notify_groups: ["truffle"],
components+: ["truffle"],
timelimit: '1:00:00',
name: 'gate-truffle-ce-native-unittest' + self.gate_tag_suffix + '-jvm-' + self.jdk_name + '-' + self.os + '-' + self.arch,
},

# runs native SL tests and truffle native unittests
local truffle_native_gate = truffle_common + {
gate_tag_suffix: '',
local truffle_test_super_lite_gate = truffle_common_gate + guard + {
name: self.name_prefix + 'truffle-super-lite-test-' + self.truffle_jdk_name + '-' + self.os + '-' + self.arch,
run+: [
['mx', '--no-jlinking', 'gate', '--no-warning-as-error', '--tags', 'build,truffle-native' + self.gate_tag_suffix],
["mx", "build"],
["mx", "unittest", "--verbose"],
],
notify_groups: ["truffle"],
components+: ["truffle"],
timelimit: '1:30:00',
name: 'gate-truffle-ce-native' + self.gate_tag_suffix + '-jvm-' + self.jdk_name + '-' + self.os + '-' + self.arch,
},

local truffle_gate = truffle_common + common.deps.eclipse + common.deps.jdt + common.deps.spotbugs {
name: 'gate-truffle-oraclejdk-' + self.jdk_name + '-' + self.os + '-' + self.arch,
# The `fulltest` tag includes all Truffle test gate tasks except those that require GraalVM.
run: [["mx", "--strict-compliance", "gate", "--strict-mode", "--tag"] + (if (self.os == 'windows') then ["style:0:6,fullbuild,fulltest"] else ["style,fullbuild,fulltest"])],
environment+: if self.os == 'windows' then {
ECLIPSE_EXE: "$ECLIPSE\\eclipse.exe",
} else {},
local truffle_coverage = truffle_common + common.deps.eclipse + common.deps.jdt + guard + {
name: self.name_prefix + 'truffle-coverage-' + self.truffle_jdk_name + '-' + self.os + '-' + self.arch,
run+: [
["mx", "--strict-compliance", "gate", "--strict-mode", "--jacoco-relativize-paths", "--jacoco-omit-src-gen", "--jacocout", "coverage", "--jacoco-format", "lcov", "--tags", "build,fulltest"],
],
teardown+: [
["mx", "sversions", "--print-repositories", "--json", "|", "coverage-uploader.py", "--associated-repos", "-"],
],
timelimit: "45:00",
},

local truffle_weekly = common.weekly + {notify_groups:: ["truffle"]},
local jmh_benchmark = bench_common + {
name: self.name_prefix + 'truffle-jmh-' + self.truffle_jdk_name + '-' + self.os + '-' + self.arch,
notify_groups:: ["truffle_bench"],
run+: [
["mx", "--kill-with-sigquit", "benchmark", "--results-file", "${BENCH_RESULTS_FILE_PATH}", "truffle:*", "--", "--", "org.graalvm.truffle.benchmark"],
],
timelimit: "3:00:00",
teardown: [
["bench-uploader.py", "${BENCH_RESULTS_FILE_PATH}"],
],
},

local jmh_benchmark_test = bench_common + guard + {
name: self.name_prefix + 'truffle-test-benchmarks-' + self.truffle_jdk_name + '-' + self.os + '-' + self.arch,
run+: [
["mx", "benchmark", "truffle:*", "--", "--jvm", "server", "--jvm-config", "graal-core", "--", "org.graalvm.truffle.benchmark", "-f", "1", "-wi", "1", "-w", "1", "-i", "1", "-r", "1"],
],
},

local tier1 = common.tier1 + {
name_prefix: "gate-",
timelimit: "0:30:00"
},
local tier2 = common.tier2 + {
name_prefix: "gate-",
timelimit: "01:00:00"
},
local tier3 = common.tier3 + {
name_prefix: "gate-",
timelimit: "01:15:00"
},
local daily = common.daily + {
name_prefix: "daily-",
timelimit: "04:00:00"
},
local weekly = common.weekly + {
name_prefix: "weekly-",
timelimit: "04:00:00"
},
local bench = common.weekly + {
name_prefix: "bench-",
timelimit: "04:00:00"
},

local jdk_21_oracle = common.oraclejdk21 + {truffle_jdk_name: "oraclejdk-21"},
local jdk_latest_oracle = common.oraclejdkLatest + {truffle_jdk_name: "oraclejdk-latest"},
local jdk_latest_labs = common.labsjdkLatestCE+ {truffle_jdk_name: "labsjdk-latest"},

local jdk_latest_graalvm_ce = jdk_latest_labs + common.deps.svm + {
truffle_jdk_name: "graalvm-ce-latest",
mx_build_graalvm_cmd: ["mx", "-p", "../vm", "--env", "ce", "--native-images=lib:jvmcicompiler"],
run+: [
self.mx_build_graalvm_cmd + ["build", "--force-javac"],
["set-export", "JAVA_HOME", self.mx_build_graalvm_cmd + ["--quiet", "--no-warning", "graalvm-home"]]
]
},

local test_jdks = [jdk_latest_oracle, jdk_21_oracle],
local graalvm_jdks = [jdk_latest_graalvm_ce],

local forEach(arr, fn) = std.flattenArrays([fn(x) for x in arr]),

local _builds = std.flattenArrays([

# Regular Truffle gates
[linux_amd64 + tier1 + jdk_latest_oracle + truffle_style_gate],

forEach(test_jdks, function(jdk)
[
linux_amd64 + jdk + sigtest + guard,
darwin_amd64 + jdk + truffle_weekly + gate_lite("daily") + guard,
darwin_aarch64 + jdk + truffle_weekly + gate_lite("gate") + guard,
] for jdk in [common.oraclejdk21, common.oraclejdkLatest]
]) +
[
# The simple_language_maven_project_gate uses native-image, so we must run on labsjdk rather than oraclejdk
linux_amd64 + common.graalvmee21 + simple_language_maven_project_gate,
linux_amd64 + graalVMCELatest + simple_language_maven_project_gate,
# The simple_tool_maven_project_gate builds compiler, so we must run on labsjdk rather than oraclejdk because of compiler module rename
linux_amd64 + common.graalvmee21 + simple_tool_maven_project_gate,
linux_amd64 + graalVMCELatest + simple_tool_maven_project_gate,
# Truffle JVM gate
linux_amd64 + common.graalvmee21 + truffle_jvm_gate,
# GR-65191
# linux_amd64 + common.oraclejdk24 + truffle_jvm_gate,
linux_amd64 + graalVMCELatest + truffle_jvm_gate,
# Truffle Native gate
linux_amd64 + common.graalvmee21 + truffle_native_gate,
linux_amd64 + common.graalvmee21 + truffle_native_gate + {
gate_tag_suffix: '-quickbuild'
},
linux_amd64 + graalVMCELatest + truffle_native_gate,
windows_amd64 + graalVMCELatest + devkits["windows-jdkLatest"] + truffle_native_unittest_gate,
linux_amd64 + graalVMCELatest + truffle_native_gate + {
gate_tag_suffix: '-quickbuild'
},
windows_amd64 + graalVMCELatest + devkits["windows-jdkLatest"] + truffle_native_unittest_gate + {
gate_tag_suffix: '-quickbuild'
},
linux_amd64 + tier2 + jdk + truffle_test_lite_gate,
linux_amd64 + tier3 + jdk + truffle_test_full_gate,

linux_amd64 + common.oraclejdk21 + truffle_gate + guard + {timelimit: "1:30:00"},
linux_amd64 + common.oraclejdkLatest + truffle_gate + guard + {environment+: {DISABLE_DSL_STATE_BITS_TESTS: "true"}},
linux_aarch64 + tier3 + jdk + truffle_test_lite_gate,
darwin_aarch64 + tier3 + jdk + truffle_test_lite_gate,
windows_amd64 + tier3 + jdk + truffle_test_lite_gate + winDevKit(jdk),

truffle_common + linux_amd64 + common.oraclejdkLatest + guard {
name: "gate-truffle-javadoc-" + self.jdk_name,
run: [
["mx", "build"],
["mx", "javadoc"],
],
},
# we do have very few resources for Darwin AMD64 so only run weekly
darwin_amd64 + weekly + jdk + truffle_test_lite_gate,
]
),

truffle_common + linux_amd64 + common.oraclejdk21 + guard {
name: "gate-truffle-slow-path-unittests",
run: [
["mx", "build", "-n", "-c", "-A-Atruffle.dsl.GenerateSlowPathOnly=true"],
# only those tests exercise meaningfully implemented nodes
# e.g. com.oracle.truffle.api.dsl.test uses nodes that intentionally produce
# different results from fast/slow path specializations to test their activation
["mx", "unittest", "com.oracle.truffle.api.test.polyglot", "com.oracle.truffle.nfi.test"],
],
},
# SimpleLanguage Maven Integration Test
forEach(graalvm_jdks, function(jdk)
[
linux_amd64 + tier3 + jdk + simple_language_maven_project_gate,

windows_amd64 + truffle_gate + common.oraclejdk21 + devkits["windows-jdk21"] + guard + {timelimit: "1:30:00"},
windows_amd64 + truffle_gate + common.oraclejdkLatest + devkits["windows-jdkLatest"] + guard + {timelimit: "1:00:00", environment+: {DISABLE_DSL_STATE_BITS_TESTS: "true"}},

truffle_common + linux_amd64 + common.oraclejdk21 + common.deps.eclipse + common.deps.jdt + guard + {
name: "weekly-truffle-coverage-21-linux-amd64",
run: [
["mx", "--strict-compliance", "gate", "--strict-mode", "--jacoco-relativize-paths", "--jacoco-omit-src-gen", "--jacocout", "coverage", "--jacoco-format", "lcov", "--tags", "build,fulltest"],
],
teardown+: [
["mx", "sversions", "--print-repositories", "--json", "|", "coverage-uploader.py", "--associated-repos", "-"],
],
targets: ["weekly"],
notify_groups:: ["truffle"],
timelimit: "45:00",
},
linux_aarch64 + weekly + jdk + simple_language_maven_project_gate,
darwin_amd64 + weekly + jdk + simple_language_maven_project_gate,
darwin_aarch64 + weekly + jdk + simple_language_maven_project_gate,

# BENCHMARKS

bench_hw.x52 + common.labsjdkLatestCE + bench_common + {
name: "bench-truffle-jmh-linux-amd64",
notify_groups:: ["truffle_bench"],
run: [
["mx", "--kill-with-sigquit", "benchmark", "--results-file", "${BENCH_RESULTS_FILE_PATH}", "truffle:*", "--", "--", "com.oracle.truffle"],
],
targets+: ["weekly"],
timelimit: "3:00:00",
teardown: [
["bench-uploader.py", "${BENCH_RESULTS_FILE_PATH}"],
],
},
# GR-68277 currently unsupported
# windows_amd64 + weekly + jdk + simple_language_maven_project_gate + winDevKit(jdk),
]
),

linux_amd64 + common.labsjdkLatestCE + bench_common + {
name: "gate-truffle-test-benchmarks",
run: [
["mx", "benchmark", "truffle:*", "--", "--jvm", "server", "--jvm-config", "graal-core", "--", "com.oracle.truffle", "-f", "1", "-wi", "1", "-w", "1", "-i", "1", "-r", "1"],
],
targets: ["gate"],
timelimit: "30:00",
},
],
# SimpleTool Maven Integration Test
forEach(graalvm_jdks, function(jdk)
[
linux_amd64 + tier3 + jdk + simple_tool_maven_project_gate,

linux_aarch64 + weekly + jdk + simple_tool_maven_project_gate,
darwin_amd64 + weekly + jdk + simple_tool_maven_project_gate,
darwin_aarch64 + weekly + jdk + simple_tool_maven_project_gate,

# GR-68277 currently unsupported
# windows_amd64 + weekly + jdk + simple_tool_maven_project_gate + winDevKit(jdk),
]
),

# Truffle Coverage
[linux_amd64 + weekly + jdk_21_oracle + truffle_coverage],

# Truffle Benchmarks
[linux_amd64 + tier3 + jdk_latest_labs + jmh_benchmark_test],
[bench_hw.x52 + bench + jdk_latest_labs + jmh_benchmark]
]),
builds: utils.add_defined_in(_builds, std.thisFile),
}
Loading
Loading