Skip to content

Commit b12542f

Browse files
Update tracetooltests and improve testing
We now exit replay with exit code 77 if we find a missing feature or extension to play nice with automated testing.
1 parent 4215077 commit b12542f

9 files changed

Lines changed: 23 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,15 +508,15 @@ function(layer_test test_name test_exe)
508508
add_test(NAME layer_test_${ARGV0}_replay COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lava-replay -V vulkan_${ARGV0}.vk)
509509
set_tests_properties(layer_test_${ARGV0}_replay PROPERTIES FIXTURES_REQUIRED ${ARGV0})
510510
add_test(NAME layer_test_${ARGV0}_replay_cpu COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lava-replay -C -V vulkan_${ARGV0}.vk)
511-
set_tests_properties(layer_test_${ARGV0}_replay_cpu PROPERTIES FIXTURES_REQUIRED ${ARGV0})
511+
set_tests_properties(layer_test_${ARGV0}_replay_cpu PROPERTIES FIXTURES_REQUIRED ${ARGV0} SKIP_RETURN_CODE 77)
512512
add_test(NAME layer_test_${ARGV0}_replay_blackhole COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lava-replay -V -B vulkan_${ARGV0}.vk)
513513
set_tests_properties(layer_test_${ARGV0}_replay_blackhole PROPERTIES FIXTURES_REQUIRED ${ARGV0})
514514
add_test(NAME layer_test_${ARGV0}_replay_blackhole_nonewsi COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lava-replay -V -B -w none vulkan_${ARGV0}.vk)
515515
set_tests_properties(layer_test_${ARGV0}_replay_blackhole_nonewsi PROPERTIES FIXTURES_REQUIRED ${ARGV0})
516516
add_test(NAME layer_test_${ARGV0}_replay_nonewsi COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lava-replay -V -w none vulkan_${ARGV0}.vk)
517517
set_tests_properties(layer_test_${ARGV0}_replay_nonewsi PROPERTIES FIXTURES_REQUIRED ${ARGV0})
518518
add_test(NAME layer_test_${ARGV0}_replay_from_simulation COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lava-replay -V vulkan_${ARGV0}_simulation.vk)
519-
set_tests_properties(layer_test_${ARGV0}_replay_from_simulation PROPERTIES FIXTURES_REQUIRED "${ARGV0}_simulation;${ARGV0}")
519+
set_tests_properties(layer_test_${ARGV0}_replay_from_simulation PROPERTIES FIXTURES_REQUIRED "${ARGV0}_simulation;${ARGV0}" SKIP_RETURN_CODE 77)
520520
endfunction()
521521

522522
layer_test(general general)
@@ -553,6 +553,7 @@ layer_test(thread_4_2 thread_4 -V 3 -S 100)
553553
layer_test(thread_4_3 thread_4 -V 2 -S 0)
554554
layer_test(compute_bda_sc compute_bda_sc)
555555
layer_test(compute_bda_pushconstant compute_bda_pushconstant)
556+
layer_test(compute_bda_pushconstant_4 compute_bda_pushconstant -V 4)
556557
layer_test(compute_bda_ubo compute_bda_ubo)
557558
layer_test(compute_bda_ubo_ssbo compute_bda_ubo --ssbo)
558559
layer_test(compute_bda_ubo_fb compute_bda_ubo --frame-boundary)
@@ -618,6 +619,7 @@ layer_test(pipeline_executable_properties pipeline_executable_properties)
618619
layer_test(extended_dynamic_state3 extended_dynamic_state3)
619620
#layer_test(push_descriptor)
620621
layer_test(host_image_copy host_image_copy)
622+
layer_test(host_image_copy_ext host_image_copy_ext)
621623
#layer_test(compute_aliasing compute_aliasing)
622624
layer_test(compute_bda_copying_address compute_bda_copying_address)
623625
layer_test(compute_descriptor_buffer compute_descriptor_buffer)
@@ -631,3 +633,7 @@ layer_test(tensors_1 tensors_1)
631633
layer_test(timeline_semaphore_1 timeline_semaphore_1)
632634
layer_test(trace_helpers trace_helpers)
633635
layer_test(updatedescriptor_1 updatedescriptor_1)
636+
layer_test(device_generated_commands_1 device_generated_commands_1)
637+
layer_test(nested_commandbuffers nested_commandbuffers)
638+
#layer_test(compute_shader_module_identifier compute_shader_module_identifier)
639+
layer_test(compute_shader_object compute_shader_object)

scripts/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,11 @@ def loadfunc(name, node, target, header):
14691469
z.do('if (reader.run)')
14701470
z.brace_begin()
14711471
z.do('retval = vkuSetupDevice(%s);' % (', '.join(call_list)))
1472+
z.do('if (retval == VK_ERROR_FEATURE_NOT_PRESENT || retval == VK_ERROR_EXTENSION_NOT_PRESENT)')
1473+
z.brace_begin()
1474+
z.do('reader.parent->exit_status = 77;')
1475+
z.do('reader.parent->finalize(true);') # this actually exits now, since we cancel our own thread
1476+
z.brace_end()
14721477
z.do('check_retval(stored_retval, retval);')
14731478
z.brace_end()
14741479
elif name == "vkGetFenceStatus": # wait for success to restore original synchronization when call was originally successful

scripts/vk_wrapper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ def print_wrapper_cpp(name):
214214
print('\tVkResult retval = wrap_vkCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice);', file=w)
215215
print('\tif (retval == VK_ERROR_FEATURE_NOT_PRESENT) print_feature_mismatch(physicalDevice, pCreateInfo);', file=w)
216216
print('\telse if (retval == VK_ERROR_EXTENSION_NOT_PRESENT) print_extension_mismatch(physicalDevice, pCreateInfo);', file=w)
217+
print('\tif (retval == VK_ERROR_FEATURE_NOT_PRESENT || retval == VK_ERROR_EXTENSION_NOT_PRESENT) { return retval; }', file=w) # handle properly later
217218
print('\tif (retval != VK_SUCCESS) ABORT("Failed to create device: %s", errorString(retval));', file=w)
218219
print('\tassert(*pDevice);', file=w)
219220
print('\tPFN_vkGetDeviceProcAddr gdpa = wrap_vkGetDeviceProcAddr;', file=w)

src/hardcode_write.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ static trackable* debug_object_trackable(trace_records& r, VkDebugReportObjectTy
3131
switch (type)
3232
{
3333
case VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT: return r.VkInstance_index.at((const VkInstance)object);
34-
case VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT: return r.VkPhysicalDevice_index.at((VkPhysicalDevice)object);
34+
case VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT:
35+
if (r.VkPhysicalDevice_index.contains((VkPhysicalDevice)object)) return r.VkPhysicalDevice_index.at((VkPhysicalDevice)object);
36+
else return nullptr;
3537
case VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT: return r.VkDevice_index.at((VkDevice)object);
3638
case VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT: return (p__virtualqueues) ? (trackable*)object : r.VkQueue_index.at((const VkQueue)object);
3739
case VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT: return r.VkDeviceMemory_index.at((const VkDeviceMemory)object);

src/read.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ void lava_reader::finalize(bool terminate)
139139
out["process_time"] = process_time;
140140
if (terminate)
141141
{
142+
if (p__debug_destination) fflush(p__debug_destination);
142143
for (auto& v : *thread_call_numbers) v = 0; // stop waiting threads from progressing
143144
for (unsigned i = 0; i < threads.size(); i++)
144145
{

src/read.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include <assert.h>
66
#include <atomic>
7-
#include <thread>
87
#include <cstdint>
98
#include <thread>
109
#include <list>
@@ -97,6 +96,9 @@ class lava_reader
9796
int stored_version_minor = 0;
9897
int stored_version_patch = 0;
9998

99+
/// Set our exit status here if we want to signal something special (eg a skip test value)
100+
std::atomic_int exit_status { 0 };
101+
100102
private:
101103
/// Start time of frame range
102104
std::atomic_uint64_t mStartTime{ 0 };

src/replay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,5 +307,5 @@ int main(int argc, char **argv)
307307
wsi_shutdown();
308308
vkuDestroyWrapper(library);
309309
if (p__debug_destination) fclose(p__debug_destination);
310-
return 0;
310+
return replayer.exit_status;
311311
}

src/vk_wrapper.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,4 @@ void print_feature_mismatch(VkPhysicalDevice physicalDevice, const VkDeviceCreat
154154
if (pEnabledFeatures->inheritedQueries == true && device_features.inheritedQueries == false) ILOG("\tinheritedQueries");
155155
// Check pNext feature structs
156156
print_pnext_feature_mismatches(physicalDevice, pCreateInfo);
157-
ABORT("Mismatched feature sets!");
158157
}

0 commit comments

Comments
 (0)