From e8040426ea528be8a57d8af0325b79cbb0c2294a Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Thu, 5 Feb 2026 14:15:00 +0300 Subject: [PATCH 1/9] Add custom clang-tidy build type --- checker/plugins/cpp_clang_tidy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checker/plugins/cpp_clang_tidy.py b/checker/plugins/cpp_clang_tidy.py index c49fa840..b3f84769 100644 --- a/checker/plugins/cpp_clang_tidy.py +++ b/checker/plugins/cpp_clang_tidy.py @@ -1,6 +1,7 @@ from __future__ import annotations from pathlib import Path +from typing import Optional from checker.exceptions import PluginExecutionFailed from checker.plugins.cpp.blacklist import get_cpp_blacklist @@ -17,6 +18,7 @@ class Args(PluginABC.Args): reference_root: Path task_path: Path lint_patterns: list[str] + build_type: Optional[str] def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: ignore[override] lint_files = [] @@ -28,7 +30,7 @@ def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: i raise PluginExecutionFailed("No files") run_args = SafeRunScriptPlugin.Args( - origin=str(args.reference_root / "build-asan"), + origin=str(args.reference_root / (args.build_type if args.build_type is not None else "build-asan")), script=["clang-tidy-19", "-p", ".", "--use-color", "--quiet", *lint_files], paths_whitelist=[str(args.reference_root)], paths_blacklist=get_cpp_blacklist(args.reference_root), From bda09c12c3f7b4aa8a3293d9443bbf17247b073f Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Thu, 5 Feb 2026 14:15:15 +0300 Subject: [PATCH 2/9] Bump clang-tidy and clang-format versions --- checker/plugins/cpp_clang_format.py | 2 +- checker/plugins/cpp_clang_tidy.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/checker/plugins/cpp_clang_format.py b/checker/plugins/cpp_clang_format.py index 28a8f783..acc04e3a 100644 --- a/checker/plugins/cpp_clang_format.py +++ b/checker/plugins/cpp_clang_format.py @@ -32,7 +32,7 @@ def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: i "python3", "run-clang-format.py", "--clang-format-executable", - "clang-format-19", + "clang-format-20", "--color", "always", "-r", diff --git a/checker/plugins/cpp_clang_tidy.py b/checker/plugins/cpp_clang_tidy.py index b3f84769..dc0fc82c 100644 --- a/checker/plugins/cpp_clang_tidy.py +++ b/checker/plugins/cpp_clang_tidy.py @@ -31,7 +31,7 @@ def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: i run_args = SafeRunScriptPlugin.Args( origin=str(args.reference_root / (args.build_type if args.build_type is not None else "build-asan")), - script=["clang-tidy-19", "-p", ".", "--use-color", "--quiet", *lint_files], + script=["clang-tidy-20", "-p", ".", "--use-color", "--quiet", *lint_files], paths_whitelist=[str(args.reference_root)], paths_blacklist=get_cpp_blacklist(args.reference_root), ) From 3b2104810a763e360feb759d371822aefad22504 Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Thu, 5 Feb 2026 14:17:09 +0300 Subject: [PATCH 3/9] Refactor build type --- checker/plugins/cpp_clang_tidy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checker/plugins/cpp_clang_tidy.py b/checker/plugins/cpp_clang_tidy.py index dc0fc82c..b12c2a07 100644 --- a/checker/plugins/cpp_clang_tidy.py +++ b/checker/plugins/cpp_clang_tidy.py @@ -18,7 +18,7 @@ class Args(PluginABC.Args): reference_root: Path task_path: Path lint_patterns: list[str] - build_type: Optional[str] + build_type: str = "build-asan" def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: ignore[override] lint_files = [] @@ -30,7 +30,7 @@ def _run(self, args: Args, *, verbose: bool = False) -> PluginOutput: # type: i raise PluginExecutionFailed("No files") run_args = SafeRunScriptPlugin.Args( - origin=str(args.reference_root / (args.build_type if args.build_type is not None else "build-asan")), + origin=str(args.reference_root / args.build_type), script=["clang-tidy-20", "-p", ".", "--use-color", "--quiet", *lint_files], paths_whitelist=[str(args.reference_root)], paths_blacklist=get_cpp_blacklist(args.reference_root), From 29431f99c65a55b7e8117512ba970390edb03fb7 Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Thu, 5 Feb 2026 14:26:51 +0300 Subject: [PATCH 4/9] Add CUDA compute sanitizer support --- checker/plugins/cpp_run_tests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/checker/plugins/cpp_run_tests.py b/checker/plugins/cpp_run_tests.py index 84e95d3c..6dbbbfe0 100644 --- a/checker/plugins/cpp_run_tests.py +++ b/checker/plugins/cpp_run_tests.py @@ -26,6 +26,7 @@ class Args(PluginABC.Args): args: list[str] paths_whitelist: list[str] lock_network: bool = True + cuda_compute_sanitizer: bool = False @staticmethod def _get_sanitizers_env(args: Args, path: Path) -> dict[str, str]: @@ -51,7 +52,12 @@ def _run_tests(args: Args, tmp_dir: Path, build_dir: Path, target: str, verbose: paths_whitelist = [str(args.root / p) for p in args.paths_whitelist] run_args = SafeRunScriptPlugin.Args( origin=str(build_dir), - script=[ + script=( + ["compute-sanitizer", "--leak-check", "full", "--error-exitcode", "1"] + if args.cuda_compute_sanitizer + else [] + ) + + [ str(build_dir / target), "-r", f"console::out={tmp_dir / CppRunTestsPlugin._REPORT}::colour-mode=ansi", From 458da4769c92cfd8ef6532e362a53b0c7d18dd39 Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Thu, 5 Feb 2026 14:27:12 +0300 Subject: [PATCH 5/9] Add ability to set GPU for CUDA benchmarking --- checker/plugins/cpp_run_benchmarks.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/checker/plugins/cpp_run_benchmarks.py b/checker/plugins/cpp_run_benchmarks.py index 4f9269e4..41bc3012 100644 --- a/checker/plugins/cpp_run_benchmarks.py +++ b/checker/plugins/cpp_run_benchmarks.py @@ -1,5 +1,6 @@ from __future__ import annotations +import os import tempfile import xml.etree.ElementTree as ET from pathlib import Path @@ -22,6 +23,7 @@ class Args(PluginABC.Args): timeout: float args: list[str] benchmark_values: list[str] + env_whitelist: list[str] = list() @staticmethod def _print_logs(path: Path) -> None: @@ -80,6 +82,10 @@ def _check_results(args: Args, tree: ET.ElementTree[ET.Element[str]]) -> None: @staticmethod def _run_benchmarks(args: Args, tmp_dir: Path, build_dir: Path, target: str, verbose: bool) -> None: + # Dump the GPU device we use to benchmark CUDA code if one is set + if "CUDA_VISIBLE_DEVICES" in args.env_whitelist: + print_info(f"CUDA_VISIBLE_DEVICES is set to `{os.getenv('CUDA_VISIBLE_DEVICES')}`") + xml_path = tmp_dir / CppRunBenchmarksPlugin._REPORT_XML run_args = SafeRunScriptPlugin.Args( origin=str(build_dir), @@ -91,6 +97,7 @@ def _run_benchmarks(args: Args, tmp_dir: Path, build_dir: Path, target: str, ver f"console::out={tmp_dir / CppRunBenchmarksPlugin._REPORT}::colour-mode=ansi", *args.args, ], + env_whitelist=args.env_whitelist, timeout=args.timeout, ) try: From 9fef25c60a56cb5223180742375224963d9e28c0 Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Sun, 8 Feb 2026 15:24:04 +0000 Subject: [PATCH 6/9] CUDA_VISIBLE_DEVICES support for run_cpp_tests --- checker/plugins/cpp_run_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/checker/plugins/cpp_run_tests.py b/checker/plugins/cpp_run_tests.py index 6dbbbfe0..54bbaee6 100644 --- a/checker/plugins/cpp_run_tests.py +++ b/checker/plugins/cpp_run_tests.py @@ -27,6 +27,7 @@ class Args(PluginABC.Args): paths_whitelist: list[str] lock_network: bool = True cuda_compute_sanitizer: bool = False + env_whitelist: list[str] = list() @staticmethod def _get_sanitizers_env(args: Args, path: Path) -> dict[str, str]: @@ -48,6 +49,10 @@ def _print_logs(path: Path) -> None: @staticmethod def _run_tests(args: Args, tmp_dir: Path, build_dir: Path, target: str, verbose: bool) -> None: + # Dump the GPU device we use to test CUDA code if one is set + if "CUDA_VISIBLE_DEVICES" in args.env_whitelist: + print_info(f"CUDA_VISIBLE_DEVICES is set to `{os.getenv('CUDA_VISIBLE_DEVICES')}`") + env = CppRunTestsPlugin._get_sanitizers_env(args, tmp_dir) paths_whitelist = [str(args.root / p) for p in args.paths_whitelist] run_args = SafeRunScriptPlugin.Args( @@ -67,6 +72,7 @@ def _run_tests(args: Args, tmp_dir: Path, build_dir: Path, target: str, verbose: timeout=args.timeout, paths_whitelist=paths_whitelist, lock_network=args.lock_network, + env_whitelist=args.env_whitelist, ) try: SafeRunScriptPlugin()._run(run_args, verbose=verbose) From 3b0535e292deae0a63ae45cade8fe3f52dd6a260 Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Sun, 8 Feb 2026 15:30:29 +0000 Subject: [PATCH 7/9] Full sanitizer path --- checker/plugins/cpp_run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checker/plugins/cpp_run_tests.py b/checker/plugins/cpp_run_tests.py index 54bbaee6..9844eb62 100644 --- a/checker/plugins/cpp_run_tests.py +++ b/checker/plugins/cpp_run_tests.py @@ -58,7 +58,7 @@ def _run_tests(args: Args, tmp_dir: Path, build_dir: Path, target: str, verbose: run_args = SafeRunScriptPlugin.Args( origin=str(build_dir), script=( - ["compute-sanitizer", "--leak-check", "full", "--error-exitcode", "1"] + ["/usr/local/cuda/bin/compute-sanitizer", "--leak-check", "full", "--error-exitcode", "1"] if args.cuda_compute_sanitizer else [] ) From a1e8a9d9cbff832a0d70dbb5f6dba088bc3aa7d4 Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Sun, 8 Feb 2026 16:12:28 +0000 Subject: [PATCH 8/9] Missing import --- checker/plugins/cpp_run_tests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/checker/plugins/cpp_run_tests.py b/checker/plugins/cpp_run_tests.py index 9844eb62..965d6a1b 100644 --- a/checker/plugins/cpp_run_tests.py +++ b/checker/plugins/cpp_run_tests.py @@ -1,5 +1,6 @@ from __future__ import annotations +import os import tempfile from pathlib import Path From 20ef2a84394a4b4a4c2b5e81a83cfa2cfa451d96 Mon Sep 17 00:00:00 2001 From: Vyacheslav Zhdanovskiy Date: Sun, 8 Feb 2026 16:39:11 +0000 Subject: [PATCH 9/9] Remove unused import --- checker/plugins/cpp_clang_tidy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/checker/plugins/cpp_clang_tidy.py b/checker/plugins/cpp_clang_tidy.py index b12c2a07..0dffd945 100644 --- a/checker/plugins/cpp_clang_tidy.py +++ b/checker/plugins/cpp_clang_tidy.py @@ -1,7 +1,6 @@ from __future__ import annotations from pathlib import Path -from typing import Optional from checker.exceptions import PluginExecutionFailed from checker.plugins.cpp.blacklist import get_cpp_blacklist