Skip to content

Commit 963933a

Browse files
fknorrPeterTh
authored andcommitted
Tooling: Track and verify CTS state
1 parent 27ca7a0 commit 963933a

File tree

2 files changed

+148
-0
lines changed

2 files changed

+148
-0
lines changed

ci/confirm_cts_state.py

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
"""
2+
Attempts building & running all CTS category targets in an existing build directory and compares
3+
their passing / failing with the info from `cts_state.csv`. If the two sources differ, reports
4+
their disparities and exits with a non-zero code.
5+
"""
6+
7+
from argparse import ArgumentParser
8+
from operator import itemgetter
9+
import os
10+
import subprocess
11+
import sys
12+
13+
import pandas as pd
14+
15+
parser = ArgumentParser()
16+
parser.add_argument('cts_root', type=str, help='SYCL-CTS repository path')
17+
parser.add_argument('cts_build_dir', type=str, help='SYCL-CTS + SimSYCL build directory')
18+
args = parser.parse_args()
19+
cts_root = os.path.realpath(args.cts_root)
20+
cts_build_dir = os.path.realpath(args.cts_build_dir)
21+
22+
state_file = pd.read_csv('ci/cts_state.csv', delimiter=';')
23+
tests_in_state_file = set(state_file['suite'])
24+
25+
tests_dir = os.path.join(cts_root, 'tests')
26+
tests_in_cts = set(t for t in os.listdir(tests_dir)
27+
if os.path.isdir(os.path.join(tests_dir, t))
28+
and t not in ['common', 'extension'])
29+
30+
n_build_failed = 0
31+
n_run_failed = 0
32+
n_passed = 0
33+
changed = []
34+
for test in sorted(tests_in_cts):
35+
status_in_state_file = state_file['status'][state_file['suite'] == test].values
36+
status_in_state_file = status_in_state_file[0] if status_in_state_file.size > 0 else 'not in list'
37+
if status_in_state_file == 'not applicable': continue
38+
39+
print('testing', test, end='... ', flush=True)
40+
r = subprocess.run(['cmake', '--build', cts_build_dir, '--target', f'test_{test}'],
41+
cwd=cts_root, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
42+
if r.returncode == 0:
43+
r = subprocess.run(os.path.join(cts_build_dir, 'bin', f'test_{test}'), cwd=cts_root,
44+
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
45+
if r.returncode == 0:
46+
status_now = 'passed'
47+
n_passed += 1
48+
else:
49+
status_now = 'run failed'
50+
n_run_failed += 1
51+
else:
52+
status_now = 'build failed'
53+
n_build_failed += 1
54+
55+
if status_now == status_in_state_file:
56+
print(status_now)
57+
else:
58+
print(f'{status_now}, but was {status_in_state_file}')
59+
changed.append((test, status_in_state_file, status_now))
60+
61+
print(f'\n{n_passed} passed, {n_run_failed} failed to run, {n_build_failed} failed to build')
62+
63+
for test in tests_in_state_file - tests_in_cts:
64+
status_in_state_file = state_file['status'][state_file['suite'] == test].values[0]
65+
changed.append((test, status_in_state_file, 'not in SYCL-CTS'))
66+
67+
if changed:
68+
print(f'\n{len(changed)} change(s) compared to cts_state.csv:')
69+
changed.sort(key=itemgetter(0))
70+
for test, status_in_state_file, status_now in changed:
71+
print(f' - {test}: {status_in_state_file} -> {status_now}')
72+
sys.exit(1)

ci/cts_state.csv

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
suite;status;reason
2+
accessor_basic;run failed;accessor implicit conversions
3+
accessor_generic;run failed;everything
4+
accessor_legacy;build failed;image targets, sycl::atomic NYI
5+
accessor_placeholder;run failed;conditions check (investigate)
6+
address_space;passed;
7+
atomic;build failed;deprecated atomic types (return values of accessor<atomic>::operator[])
8+
atomic_fence;passed;
9+
atomic_ref;passed;
10+
atomic_ref_stress;passed;
11+
bit_cast;passed;
12+
buffer;run failed;sub-buffers NYI
13+
context;passed;
14+
cuda_interop;not applicable;
15+
device;run failed;sub-devices NYI
16+
device_event;passed;
17+
device_selector;passed;
18+
error;passed;
19+
event;run failed;async_handler NYI, Limitation: no asynchronicity between application thread and host tasks
20+
exception_handling;build failed;sub-devices NYI
21+
exceptions;run failed;"async" error handling NYI
22+
full_feature_set;passed;
23+
function_objects;passed;
24+
group;passed;
25+
group_functions;run failed;group scan defective?
26+
handler;run failed;hierarchical parallel for requires known local range
27+
header;passed;
28+
hierarchical;passed;
29+
h_item;passed;
30+
host_accessor;run failed;reference semantics (copy equality), ...
31+
host_task;passed;
32+
id;passed;
33+
image;build failed;images NYI
34+
image_accessor;build failed;images NYI
35+
invoke;run failed;parallel_for 2D / 3D short-hands NYI
36+
is_device_copyable;passed;
37+
item;passed;
38+
kernel;build failed;kernel bundle global functions NYI
39+
kernel_args;build failed;samplers NYI
40+
kernel_bundle;build failed;device_image NYI, ...
41+
language;passed;
42+
local_accessor;run failed;reference semantics (copy equality), ...
43+
marray_arithmetic_assignment;passed;
44+
marray_arithmetic_binary;passed;
45+
marray_basic;passed;
46+
marray_bitwise;passed;
47+
marray_pre_post;passed;
48+
marray_relational;passed;
49+
math_builtin_api;build failed;math functions incomplete (only using std)
50+
multi_ptr;build failed;multi_ptr<legacy> == element* is ambiguous (incorrect in CTS / DPC++?)
51+
namespace;passed;
52+
nd_item;passed;
53+
nd_range;passed;
54+
opencl_interop;not applicable;
55+
optional_kernel_features;run failed;incorrect exception codes thrown (investigate)
56+
platform;passed;
57+
pointers;passed;
58+
property;passed;
59+
queue;passed;
60+
range;passed;
61+
reduction;build failed;reductions on `span` NYI
62+
sampler;build failed;samplers / images NYI
63+
scalars;passed;
64+
spec_constants;build failed;use_kernel_bundle() and associated checking NYI
65+
stream;build failed;sycl:stream NYI
66+
sub_group;passed;
67+
sycl_external;run failed;UBSan: reached an unreachable program point in kernel_between_aspects, Clang compiler bug?
68+
usm;passed;Limitation: SimSYCL cannot communicate from main thread to kernel through SHMEM
69+
vector_alias;passed;
70+
vector_api;run failed;convert() tests fail because rounding modes are NYI
71+
vector_constructors;passed;
72+
vector_deduction_guides;passed;
73+
vector_load_store;passed;
74+
vector_operators;passed;
75+
vector_swizzle_assignment;passed;
76+
vector_swizzles;passed;

0 commit comments

Comments
 (0)