Skip to content

Add Crucible (Mesa CTS) Testing (New)#2461

Open
mckees wants to merge 8 commits intocanonical:mainfrom
mckees:crucible-mainline
Open

Add Crucible (Mesa CTS) Testing (New)#2461
mckees wants to merge 8 commits intocanonical:mainfrom
mckees:crucible-mainline

Conversation

@mckees
Copy link
Copy Markdown
Contributor

@mckees mckees commented Apr 14, 2026

Description

Crucible is a test suite for Mesa conformance.

Some notes in this PR:

  • This integration presented more issues around GPU selection than previous tests. We ran into the issue of prime-select preferences being ignored and forking threads crashing the test machine. We also found some places to improve the previous Vulkan testing because the vulkaninfo checks run in core tests before were not in the snap environment.
  • We also added some previously-requested refactoring work to pull common functions into a host_utils.py script

Resolved issues

Mesa is already tested by the Vulkan CTS testing, but Crucible is the testing developed specifically for Mesa, so it is a great tool to make sure that it is integrated properly from the perspective of the upstream developers.

Documentation

https://gitlab.freedesktop.org/mesa/crucible

Tests

  • Ran the classic and core test suites for Crucible
  • Ran the classic and core test suites for Vulkan CTS (shared elements between them make a regression more likely)

@mckees mckees requested review from a team and Hook25 April 14, 2026 08:06
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 94.16667% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.07%. Comparing base (06722a3) to head (011f38c).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/crucible_host.py 72.00% 11 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2461      +/-   ##
==========================================
+ Coverage   58.86%   59.07%   +0.20%     
==========================================
  Files         476      479       +3     
  Lines       48007    48229     +222     
  Branches     8570     8623      +53     
==========================================
+ Hits        28260    28490     +230     
+ Misses      18855    18840      -15     
- Partials      892      899       +7     
Flag Coverage Δ
checkbox-support 69.36% <100.00%> (+1.59%) ⬆️
provider-base 34.17% <75.43%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mckees
Copy link
Copy Markdown
Contributor Author

mckees commented Apr 14, 2026

At time of writing, the Vulkan Classic test plan will fail because this job is still running (meaning I cannot promote the snap with the needed changes):
https://github.com/canonical/vulkan-cts-snap/actions/runs/24387359316

This one has been a bit trickier to integrate than the past two, so I'm definitely looking for some feedback where folks see a need for additional polishing. I've been trying to leave our options open for non-amd64 hardware, but the crucible snap does not have a build for any other arch at the moment.

@mckees
Copy link
Copy Markdown
Contributor Author

mckees commented Apr 22, 2026

The vulkan snap has been updated, so the vulkan classic test plan will succeed.

Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

Consider the following

Comment thread providers/base/bin/crucible_host.py Outdated
#!/usr/bin/env python3
# This file is part of Checkbox.
#
# Copyright 2025 Canonical Ltd.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: lol

Suggested change
# Copyright 2025 Canonical Ltd.
# Copyright 2026 Canonical Ltd.

Comment thread providers/base/bin/crucible_host.py Outdated
Comment on lines +79 to +80
# NODEVICE_SELECT disables VK_LAYER_MESA_device_select — the layer
# requires GLIBC_ABI_GNU2_TLS, which the snap's core24 glibc lacks.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this a TODO to remove this on core26?

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.

Ideally, yes. The device selection via VK_LAYER_MESA_device_select fails if the snap has a different glibc version than the host, which I suspect could continue to be an issue in the future. For instance, if we need to test on 26.10 with core26, the same issue should come back

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if you want to import this, it must move to the checkbox_support module. Probably under helpers.

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 thread providers/base/bin/host_utils.py Outdated
Comment on lines +78 to +79
except (FileNotFoundError, OSError, subprocess.CalledProcessError):
return None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No, don't hide exceptions, rise them. You can group them all into a single one if you want.

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, converted everything to raise VulkanDetectionError

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok I don't want to write the same comment on the whole file. In python we don't return None as a special value to say error. Error = Exception. I don't like exceptions but that is how the language works.

Comment thread providers/base/bin/host_utils.py Outdated
Comment on lines +168 to +172
except OSError:
continue
except OSError:
pass
return None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

? I'm sure we can do better than this, 2 nested os errors? this is really hard to test/reason about

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.

Refactored to remove this pattern

Comment thread providers/base/bin/host_utils.py Outdated
Comment on lines +204 to +206
result.append(path)
except (OSError, ValueError):
result.append(path)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why would we add the path erroring to result? At least comment on this action if you have to do it

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.

A holdover from an earlier experiment when the correct path was not being added in the try block. Thanks for catching, I've changed it

Comment thread providers/base/bin/host_utils.py Outdated
Comment on lines +207 to +208
except OSError:
pass
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above, are we sure we need two nested os errors? Remember suppress exists and makes your life easier AND raising exceptions is actually idiomatic if you want to say somthing went wrong

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.

Changed

estimated_duration: 1s
command:
if vulkaninfo --summary 2>/dev/null | grep -q "PHYSICAL_DEVICE_TYPE_.*_GPU"; then
if env -u DISPLAY vulkan-cts.vulkaninfo --summary 2>&1 | grep "PHYSICAL_DEVICE_TYPE_.*_GPU"; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment why you env -u that variable. Also, weird to do this in bash considering we did everything else in python

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.

Added a comment to explain that this is for a more headless experience

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.

2 participants