Skip to content

Enhance vkmark script to validate mailbox mode#133

Open
Abhishek-0412 wants to merge 1 commit intodevelopfrom
feature/vkmark_script_enhancement
Open

Enhance vkmark script to validate mailbox mode#133
Abhishek-0412 wants to merge 1 commit intodevelopfrom
feature/vkmark_script_enhancement

Conversation

@Abhishek-0412
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 26, 2026 13:55
@Abhishek-0412 Abhishek-0412 requested a review from a team as a code owner March 26, 2026 13:55
@github-actions
Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Vulkan vkmark benchmark integration to run and report scores for both fifo and mailbox present modes, with additional handling for RPI-specific runtime directory requirements.

Changes:

  • Add a helper in the vkmark test script to execute vkmark for a specified present mode and parse the reported score.
  • Update the test to run vkmark twice (fifo and mailbox) and print a summarized score block.
  • Extend Vulkanlib.py to support a configurable XDG_RUNTIME_DIR (e.g., /tmp for RPI) and parameterize execute_binary by present mode.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
framework/fileStore/testscriptsRDKV/integration/Vulkan/Vkmark_Benchmark_Score.py Adds mode-based vkmark execution, score parsing, reporting, and westeros cleanup.
framework/fileStore/Vulkanlib.py Adds runtime dir selection via model and makes execute_binary accept present_mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tdkTestObj = obj.createTestStep('set_prerequisites');
boxtype = obj.getDeviceBoxType();
if "RPI-Client" in boxtype:
tdkTestObj.addParameter("model", "RPI")
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

set_prerequisites now requires a model argument, but this script only sets the model parameter for RPI devices. For non-RPI box types this test step may raise a missing-argument error or behave unpredictably. Pass an explicit default model value for the non-RPI case (or update the library function to have a default).

Suggested change
tdkTestObj.addParameter("model", "RPI")
tdkTestObj.addParameter("model", "RPI")
else:
# Provide a default model value for non-RPI box types
tdkTestObj.addParameter("model", "GENERIC")

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +53
if not detail or "error" in detail.lower() or not match:
print ("FAILURE : Unable to obtain the Vkmark score in %s mode"%(mode))
tdkTestObj.setResultStatus("FAILURE")
return "FAILURE"
else:
score = match.group(1)
print(f"Vkmark Score Obtained in {mode} mode : {score}")
tdkTestObj.setResultStatus("SUCCESS")
return score
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

execute_vkmark returns the string "FAILURE" when it can't parse a score. Returning a sentinel string makes it easy for callers to accidentally treat it as a valid score. Prefer returning None/empty and/or raising/propagating failure via the test status so callers can reliably detect failure.

Copilot uses AI. Check for mistakes.
Comment on lines +81 to +82
print("SUCCESS : westeros cleanup successfull")
tdkTestObj.setResultStatus("SUCCESS")
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

The cleanup step runs kill -9 via execute_Cmnd_InDUT, but the script doesn't validate that the command actually succeeded (it doesn't check the test step result/details before reporting success). Use the step result/details to decide whether cleanup succeeded, and mark FAILURE if it didn't.

Suggested change
print("SUCCESS : westeros cleanup successfull")
tdkTestObj.setResultStatus("SUCCESS")
if details and "SUCCESS" in details.upper():
print("SUCCESS : westeros cleanup successfull")
tdkTestObj.setResultStatus("SUCCESS")
else:
print("FAILURE : westeros cleanup failed; details: %s" % details)
tdkTestObj.setResultStatus("FAILURE")

Copilot uses AI. Check for mistakes.
tdkTestObj.executeTestCase(expectedResult)
details = tdkTestObj.getResultDetails()

print("SUCCESS : westeros cleanup successfull")
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

Typo in user-facing output: "successfull" should be "successful".

Suggested change
print("SUCCESS : westeros cleanup successfull")
print("SUCCESS : westeros cleanup successful")

Copilot uses AI. Check for mistakes.
Comment on lines +186 to 190
def set_prerequisites(model):
print("\n[PRE-REQUISITE 1] : Setting environment variables and starting Westeros display")

# Step 1: Start Westeros in background

Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

Changing set_prerequisites to require model introduces a hard requirement on callers to always pass this parameter. Since non-RPI callers may omit it, this can break the test step invocation. Consider giving model a default (e.g., empty string / "GENERIC") and treating unknown/None as the non-RPI path.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +66
fifo_score = execute_vkmark(obj, "fifo")
mailbox_score = execute_vkmark(obj, "mailbox")
fifo_result = " FIFO SCORE = " + fifo_score
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

After collecting fifo_score/mailbox_score, the script proceeds to format/print them and later marks cleanup SUCCESS even if one of the score fetches failed. Add an explicit check (e.g., if either score indicates failure) to stop and mark the overall test as FAILURE.

Copilot uses AI. Check for mistakes.
Comment on lines +81 to +82
print("SUCCESS : westeros cleanup successfull")
tdkTestObj.setResultStatus("SUCCESS")
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

The script sets the cleanup step status to SUCCESS unconditionally, which can overwrite a prior FAILURE from score collection and make the overall run appear successful. Only set SUCCESS when the overall test criteria (including vkmark scores and cleanup) have actually passed.

Suggested change
print("SUCCESS : westeros cleanup successfull")
tdkTestObj.setResultStatus("SUCCESS")
if "SUCCESS" in details and fifo_score != "FAILURE" and mailbox_score != "FAILURE":
print("SUCCESS : westeros cleanup successful and vkmark scores collected")
tdkTestObj.setResultStatus("SUCCESS")
else:
print("FAILURE : westeros cleanup and/or vkmark score collection failed")
tdkTestObj.setResultStatus("FAILURE")

Copilot uses AI. Check for mistakes.
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