Fix flaky GCN tests (#4693)

fix: flaky tests due to uninitialized values
fix: segfault during teardown while running gcn tests

fix: vulkan validation error by enabling shaderFloat16 in GCN runner
This commit is contained in:
Al Jibran
2026-07-13 11:48:35 +05:30
committed by GitHub
parent cf3bb346bf
commit 3aef2190ca
4 changed files with 13 additions and 2 deletions

View File

@@ -136,6 +136,11 @@ std::expected<Runner*, ErrorInfo> Runner::instance() {
return g_runner.get();
}
void Runner::DestroyInstance() {
std::lock_guard lock{g_runner_mutex};
g_runner.reset();
}
std::expected<void, ErrorInfo> Runner::initialize() {
VULKAN_HPP_DEFAULT_DISPATCHER.init();
@@ -223,6 +228,7 @@ std::expected<void, ErrorInfo> Runner::initialize() {
vk::PhysicalDeviceVulkan12Features v12_feat{
.pNext = &v11_feat,
.uniformAndStorageBuffer8BitAccess = VK_TRUE,
.shaderFloat16 = VK_TRUE,
.shaderInt8 = VK_TRUE,
};
vk::PhysicalDeviceFeatures phys_feat{

View File

@@ -42,6 +42,7 @@ struct ErrorInfo {
class Runner {
public:
static std::expected<Runner*, ErrorInfo> instance();
static void DestroyInstance();
std::expected<void, ErrorInfo> run_raw(
std::span<const std::uint32_t> spirv,

View File

@@ -1266,7 +1266,7 @@ private:
u64 src2 : 9;
u64 omod : 2;
u64 neg : 3;
} i;
} i{};
static_assert(sizeof(VOP3Internal) == sizeof(u64));
};
@@ -1345,7 +1345,7 @@ private:
u64 src2 : 9;
u64 op_sel_hi01 : 2;
u64 neg : 3;
} i;
} i{};
static_assert(sizeof(VOP3PInternal) == sizeof(u64));
};

View File

@@ -15,6 +15,10 @@ protected:
void SetUp() override {}
void TearDown() override {}
static void TearDownTestSuite() {
gcn_test::Runner::DestroyInstance();
}
};
struct F32x2 {