Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetstream: Adding a workload to execute the #1102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scojac01
Copy link
Contributor

@scojac01 scojac01 commented Jun 4, 2020

jetstream suite of browser based tests.

Comment on lines 29 to 38
tests = ['3d-cube-SP', '3d-raytrace-SP', 'acorn-wtb', 'ai-astar', 'Air', 'async-fs', 'Babylon', 'babylon-wtb',
'base64-SP', 'Basic', 'bomb-workers', 'Box2D', 'cdjs', 'chai-wtb', 'coffeescript-wtb', 'crypto',
'crypto-aes-SP', 'crypto-md5-SP', 'crypto-sha1-SP', 'date-format-tofte-SP', 'date-format-xparb-SP', 'delta-blue',
'earley-boyer', 'espree-wtb', 'first-inspector-code-load', 'FlightPlanner', 'float-mm.c', 'gaussian-blur',
'gbemu', 'hash-map', 'jshint-wtb', 'json-parse-inspector',
'json-stringify-inspector', 'lebab-wtb', 'mandreel', 'ML', 'multi-inspector-code-load', 'n-body-SP',
'navier-stokes', 'octane-code-load', 'octane-zlib', 'OfflineAssembler', 'pdfjs', 'prepack-wtb', 'raytrace',
'regex-dna-SP', 'regexp', 'richards', 'segmentation',
'splay', 'stanford-crypto-aes', 'stanford-crypto-pbkdf2', 'stanford-crypto-sha256', 'string-unpack-code-SP',
'tagcloud-SP', 'typescript', 'uglify-js-wtb', 'UniPoker']
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these be organized a bit more uniformly?

context.add_metric(test_name, result, 'score', lower_is_better=False)
else:
raise WorkloadError('score {} cannot be found'.format(regex))

Copy link
Contributor

Choose a reason for hiding this comment

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

pylint: W293 blank line contains whitespace

Comment on lines 67 to 68
self.target.execute("uiautomator dump")
self.target.pull('/sdcard/window_dump.xml', os.path.join(context.output_directory, 'screenDump.xml'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can an explicit path using target.working_directory be passed to these commands?

Comment on lines 67 to 68
self.target.execute("uiautomator dump")
self.target.pull('/sdcard/window_dump.xml', os.path.join(context.output_directory, 'screenDump.xml'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Also out of curiosity have you found this is a more reliable method of extracting the scores rather than performing this from the java side?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We tried originally with the standard way of IDing and logging in the java side but it was constantly missing elements when we looped through it. This method is the most reliable for this workload.

Comment on lines 19 to 21
from wa.framework.exception import ValidationError, WorkloadError
from wa.utils.types import list_of_strs
from wa.utils.misc import unique
Copy link
Contributor

Choose a reason for hiding this comment

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

Except for WorkloadError are these unused imports?

pressEnter();
}

public void clearTabs() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it becoming a common function, s it worth adding it as a clearChromeTabs function to BaseUiAutomation?


def __init__(self, target, **kwargs):
super(Jetstream, self).__init__(target, **kwargs)
self.gui.timeout = 1500
Copy link
Contributor

Choose a reason for hiding this comment

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

On my device this timeout was reached. (took ~33 mins to complete). Can this be raised to be greater then the timeout from the java side?

Copy link
Contributor

@marcbonnici marcbonnici left a comment

Choose a reason for hiding this comment

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

And can the commit message be updated?

Copy link
Contributor

@marcbonnici marcbonnici left a comment

Choose a reason for hiding this comment

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

Can the commit message title be fixed to fit on a single line?

Pylint fixes: https://travis-ci.org/github/ARM-software/workload-automation/builds/695014614

Comment on lines 106 to 105
/*public void clearTabs() throws Exception {
UiObject tabselector =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/tab_switcher_button")
.className("android.widget.ImageButton"));
if (!tabselector.exists()){
return;
}
tabselector.click();
UiObject menu =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/menu_button")
.className("android.widget.ImageButton"));
menu.click();
UiObject closetabs =
mDevice.findObject(new UiSelector().textContains("Close all tabs"));
if (closetabs.exists()){
closetabs.click();
}
}*/
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented code.

Comment on lines 62 to 67
self.target.execute('uiautomator dump')
self.target.pull(os.path.join('/sdcard/window_dump.xml'), os.path.join(context.output_directory, 'screenDump.xml'))

Copy link
Contributor

Choose a reason for hiding this comment

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

Can an explicit path using target.working_directory be passed to these commands to prevent relying on defaults?

@robF8 robF8 force-pushed the robf-jetstream branch from f29f6d5 to a8a6bf6 Compare July 8, 2020 13:06
Jetstream is a browser based benchmark.

This workload executes the full suite of Jetstream
tests and also includes the addition of the clearChromeTabs
function to the base ui automation class.
@robF8 robF8 force-pushed the robf-jetstream branch from a8a6bf6 to 4b1c446 Compare July 8, 2020 13:23
@robF8
Copy link
Contributor

robF8 commented Jul 8, 2020

  • Updated commit message to be one liner
  • Removed commented code
  • Added explicit path for xml dump
  • Fixed pylint errors
  • Fixed pep8 errors

Comment on lines +78 to +81
UiObject scores =
mDevice.findObject(new UiSelector().resourceId("result-summary"));
scores.waitForExists(2100000);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe allow for the runtime of the benchmark to be configurable as the timeout is still hit on my device.
Also the results screen should be checked for here and raise the appropriate error otherwise the error about a missing score is misleading when the workload just hasn't finished yet.

Comment on lines +74 to +87
total_score_match = total_score_regex.search(xml_str)
if total_score_match:
total_score = float(total_score_match.group(1))
context.add_metric('jetstream', total_score, 'score', lower_is_better=False)
else:
raise WorkloadError('Total score for jetstream could not be found')
for regex in self.regex_tests:
match = regex.search(xml_str)
if match:
result = float(match.group(1))
test_name = match.group(2)
context.add_metric(test_name, result, 'score', lower_is_better=False)
else:
raise WorkloadError('score {} cannot be found'.format(regex))
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not need to be within the with statement.

Comment on lines +51 to +60
for test in self.tests:
formatted_string = 'text="([\d.]+)" resource-id="results-cell-({})-score"'.format(test)
self.regex_tests.append(re.compile(formatted_string))
# Add regex for tests with annoyingly different resource id's
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(gcc-loops-wasm)"'))
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(HashSet-wasm)"'))
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(quicksort-wasm)"'))
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(richards-wasm)"'))
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="wasm-score-id(tsf-wasm)"'))
self.regex_tests.append(re.compile(r'text="([\d.]+)" resource-id="(wsl)-score-score"'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a particular reason for all the tests to be specified explicitly? The workload doesn't seem to be configurable which tests are ran and looking at the code there appears to be 3 unique patterns for matching results so would it not be easier to match on the "generic" patterns?

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.

3 participants