Skip to content

[SYCL][E2E] refactor: drop vulkan_common dependencies from bindless image tests - #23047

Open
mianowski wants to merge 10 commits into
intel:syclfrom
mianowski:feat/URT-1271-drop-vulkan_common
Open

[SYCL][E2E] refactor: drop vulkan_common dependencies from bindless image tests#23047
mianowski wants to merge 10 commits into
intel:syclfrom
mianowski:feat/URT-1271-drop-vulkan_common

Conversation

@mianowski

@mianowski mianowski commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

@mianowski mianowski changed the title [E2E] chore: drop vulkan_common from bindless image tests [E2E] refactor: drop vulkan_common dependencies from bindless image tests Aug 28, 2026
@mianowski
mianowski marked this pull request as ready for review August 28, 2026 14:38
@mianowski
mianowski requested review from a team as code owners August 28, 2026 14:38
@mianowski
mianowski requested a review from 0x12CC August 28, 2026 14:38
@KornevNikita
KornevNikita requested a review from dyniols August 28, 2026 16:25

@KornevNikita KornevNikita left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CODEOWNERS change LGTM.

@mianowski

mianowski commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

@dyniols please review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@dyniols
dyniols requested a balanced review from Copilot September 1, 2026 11:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Comment on lines +704 to +716
inline VkImageMemoryBarrier createImageMemoryBarrier(VkImage image,
uint32_t mipLevels) {
VkImageMemoryBarrier barrier{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER};
barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.image = image;
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
barrier.subresourceRange.levelCount = mipLevels;
barrier.subresourceRange.layerCount = 1;
return barrier;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

Comment on lines +416 to +420
int main() {

if (vkutil::setupInstance() != VK_SUCCESS) {
std::cerr << "Instance setup failed!\n";
return EXIT_FAILURE;
}

sycl::device dev;

if (vkutil::setupDevice(dev) != VK_SUCCESS) {
std::cerr << "Device setup failed!\n";
return EXIT_FAILURE;
}

if (vkutil::setupCommandBuffers() != VK_SUCCESS) {
std::cerr << "Compute pipeline setup failed!\n";
return EXIT_FAILURE;
}

bool result_ok = run_tests();

if (vkutil::cleanup() != VK_SUCCESS) {
std::cerr << "Cleanup failed!\n";
return EXIT_FAILURE;
}
VulkanContext vkCtx = createVulkanContext();
bool result_ok = run_tests(vkCtx);
cleanupVulkanContext(vkCtx);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 306 to 309
VulkanContext vkCtx = createVulkanContext();
auto testPassed = runTest(vkCtx, syclDevice, {128, 128}, {16, 16});
cleanupVulkanContext(vkCtx);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +153 to +180
VkCommandPoolCreateInfo PoolInfo = {
VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO};
PoolInfo.queueFamilyIndex = VulkanCtx.queueFamilyIndex;
VkCommandPool Pool;
VK_CHECK(vkCreateCommandPool(VulkanCtx.device, &PoolInfo, nullptr, &Pool));
VkCommandBufferAllocateInfo CmdAllocInfo = {
VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO};
CmdAllocInfo.commandPool = Pool;
CmdAllocInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
CmdAllocInfo.commandBufferCount = 1;
VkCommandBuffer CommandBuffer;
VK_CHECK(vkAllocateCommandBuffers(VulkanCtx.device, &CmdAllocInfo,
&CommandBuffer));
VK_CHECK(vkBeginCommandBuffer(CommandBuffer, &Cbbi));
vkCmdCopyBuffer(CommandBuffer, VkImportedBuffer, StagingBuffer,
1 /*regionCount*/, &CopyRegion);
VK_CHECK_CALL(vkEndCommandBuffer(vk_transferCmdBuffers[0]));
VK_CHECK(vkEndCommandBuffer(CommandBuffer));

std::vector<VkPipelineStageFlags> Stages{VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT};

VkSubmitInfo Submission = {};
Submission.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
Submission.commandBufferCount = 1;
Submission.pCommandBuffers = &vk_transferCmdBuffers[0];
Submission.pCommandBuffers = &CommandBuffer;
Submission.pWaitDstStageMask = Stages.data();

VK_CHECK_CALL(vkQueueSubmit(vk_transfer_queue, 1 /*submitCount*/,
&Submission, VK_NULL_HANDLE /*fence*/));
VK_CHECK_CALL(vkQueueWaitIdle(vk_transfer_queue));
VK_CHECK(vkQueueSubmit(VulkanCtx.queue, 1, &Submission, VK_NULL_HANDLE));
VK_CHECK(vkQueueWaitIdle(VulkanCtx.queue));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// Use helper function to determine if data is accepted.
// For floats, use default accepted error variance.
if (!util::is_equal(outputVec[i], expected)) {
if (std::abs(outputVec[i] - expected) > 0.01f) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just bring over that utility routine? Or define a new one (occassionally_equal) ;-) ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dyniols

dyniols commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

I think we can remove the CommonUtils directory, as no other files will remain once vulkan_common.hpp is removed.

@mianowski

mianowski commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

I think we can remove the CommonUtils directory, as no other files will remain once vulkan_common.hpp is removed.

Git doesn't store folders, only files. So, once the last file from a folder is gone, the folder vanishes too

@mianowski
mianowski requested review from cperkinsintel and a balanced review from Copilot September 3, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Device selection can pair different Vulkan and SYCL GPUs, and one migrated test lacks exception-safe cleanup.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • Review effort level: Balanced

std::cerr << "Instance setup failed!\n";
VulkanContext VulkanCtx;
try {
VulkanCtx = createVulkanContext();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should restore UUID based selection in vulkan_setup.hpp. Specifically, instantiate the SYCL device once, pass it to createVulkanContext, and select the VkPhysicalDevice matching the SYCL device UUID.

However it doesn't have to be done in this PR because it will affect other vulkan interop tests and it could be done in another PR.

Your thoughts @cperkinsintel @0x12CC ?

Comment thread sycl/test-e2e/bindless_images/vulkan_interop/depth_format.cpp Outdated
Comment thread sycl/test-e2e/bindless_images/vulkan_interop/mipmaps.cpp Outdated
std::cerr << "Cleanup failed!\n";
return 7;
}
auto TestPassed = runTest(VulkanCtx, SyclDevice, MemorySizeBytes);
@dyniols
dyniols requested a balanced review from Copilot September 3, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Device matching reads an uninitialized handle, and SYCL cleanup failures can incorrectly produce a passing result.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment on lines +456 to +458
auto SyclDeviceUUID =
SyclDevice.get_info<sycl::ext::intel::info::device::uuid>();
for (VkPhysicalDevice device : devices) {
Comment on lines +231 to +235
} catch (const sycl::exception &e) {
std::cerr << "SYCL cleanup failed: " << e.what() << "\n";
} catch (...) {
std::cerr << "Unknown exception during SYCL cleanup.\n";
}

@dyniols dyniols left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great! Left a few minor comments and questions.

vkEnumeratePhysicalDevices(ctx.instance, &deviceCount, devices.data());
ctx.physicalDevice = devices[0];

if (!SyclDevice.has(sycl::aspect::ext_intel_device_info_uuid))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid bringing SYCL code into vulkan_setup.hpp?

For example we could pass SYCL device UUID rather than pass SYCL device to here:
https://github.com/triSYCL/sycl/blob/sycl/unified/master/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md#device-uuid

for (VkPhysicalDevice device : devices) {
VkPhysicalDeviceIDProperties idProperties{
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES};
VkPhysicalDeviceProperties2 properties{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider zero initializing the Vulkan structures to avoid uninitialized member fields.

vkFreeMemory(ctx.device, res.memory, nullptr);
}

inline VkCommandBuffer createCommandBuffer(VulkanContext &ctx,

@dyniols dyniols Sep 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using const VulkanContext &ctx if ctx isn't modified here.


inline VkCommandBuffer createCommandBuffer(VulkanContext &ctx,
VkCommandPool &pool) {
VkCommandPoolCreateInfo poolInfo{VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here zero initializing the Vulkan structures.

Comment on lines +737 to +740
vkDestroyCommandPool(ctx.device, pool, nullptr);
}

inline VkImageMemoryBarrier createImageMemoryBarrier(VkImage image,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is intended as a generic helper, should we expose VkImageLayout and VkAccessFlags as function parameters to make it more flexible?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's old change but we could do const sycl::exception &e.

@dyniols

dyniols commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Please add the [SYCL] tag to the PR title

@mianowski mianowski changed the title [E2E] refactor: drop vulkan_common dependencies from bindless image tests [SYCL][E2E] refactor: drop vulkan_common dependencies from bindless image tests Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop CommonUtils/vulkan_common.hpp from bindless images e2e tests and migrate to vulkan_setup.hpp

5 participants