Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions MotionMark/developer.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ <h3>Adjusting the test complexity:</h3>
<label>Target frame rate: <input type="number" id="frame-rate" value="60"> FPS</label>
</li>
<li>
<label>Score profile:
<select name="score-profile" id="score-profile">
<option value="slope">Slope</option>
<option value="flat">Flat</option>
</select>
</label>
</li>
<li>
<h3>Time measurement method:</h3>
<ul>
<li><label><input name="time-measurement" type="radio" value="performance" checked> <code>performance.now()</code> (if available)</label></li>
Expand Down Expand Up @@ -147,6 +155,14 @@ <h1>MotionMark score</h1>
</div>
<div>version <span class="version"></span></div>
<p class="score" onclick="benchmarkController.showDebugInfo()"></p>
<div class="score-profile">
<label>Score profile:
<select id="results-score-profile" onchange="benchmarkController.changeScoreProfile(this.value)">
<option value="slope">Slope</option>
<option value="flat">Flat</option>
</select>
</label>
</div>
<p class="confidence"></p>
<div id="results-tables" class="table-container">
<div>
Expand All @@ -168,6 +184,14 @@ <h1>MotionMark score</h1>
<button onclick="benchmarkController.showResults()">&lt; Results</button>
<h1>Graph:</h1>
<p class="score">&nbsp;</p>
<div class="score-profile">
<label>Score profile:
<select id="graph-score-profile" onchange="benchmarkController.changeScoreProfile(this.value)">
<option value="slope">Slope</option>
<option value="flat">Flat</option>
</select>
</label>
</div>
<p class="confidence">&nbsp;</p>
</header>
<nav>
Expand Down
40 changes: 40 additions & 0 deletions MotionMark/resources/debug-runner/debug-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,15 @@ class DebugBenchmarkController extends BenchmarkController {
const confidence = ((scoreCalculator.scoreLowerBound / score - 1) * 100).toFixed(2) +
"% / +" + ((scoreCalculator.scoreUpperBound / score - 1) * 100).toFixed(2) + "%";
const fps = scoreCalculator._systemFrameRate;

const resultsScoreProfileSelector = document.getElementById("results-score-profile");
if (resultsScoreProfileSelector)
resultsScoreProfileSelector.value = scoreCalculator.scoreProfile;

const graphScoreProfileSelector = document.getElementById("graph-score-profile");
if (graphScoreProfileSelector)
graphScoreProfileSelector.value = scoreCalculator.scoreProfile;

sectionsManager.setSectionVersion("results", scoreCalculator.version);
sectionsManager.setSectionScore("results", score.toFixed(2), confidence, fps);
sectionsManager.populateTable("results-header", Headers.testName, scoreCalculator);
Expand All @@ -720,10 +729,41 @@ class DebugBenchmarkController extends BenchmarkController {

showTestGraph(testName, testResult, testData)
{
this._currentGraphParams = {
testName: testName,
testResult: testResult,
testData: testData
};
sectionsManager.setSectionHeader("test-graph", testName);
sectionsManager.showSection("test-graph", true);
this.graphController.updateGraphData(testResult, testData, this.runnerClient.scoreCalculator.options);
}

reloadCurrentGraph() {
if (!this._currentGraphParams)
return;

const scoreCalculator = this.runnerClient.scoreCalculator;
const testData = this._currentGraphParams.testData;
const testName = this._currentGraphParams.testName;

// find the updated testResult from scoreCalculator
let updatedTestResult = null;
scoreCalculator.results.forEach(iteration => {
for (let suiteName in iteration[Strings.json.results.tests]) {
const suite = iteration[Strings.json.results.tests][suiteName];
if (suite[testName]) {
updatedTestResult = suite[testName];
return;
}
}
});

if (updatedTestResult) {
this._currentGraphParams.testResult = updatedTestResult;
this.showTestGraph(testName, updatedTestResult, testData);
}
}
}

window.benchmarkControllerClass = DebugBenchmarkController;
Expand Down
31 changes: 30 additions & 1 deletion MotionMark/resources/runner/motionmark.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ body {
cursor: default;

-webkit-user-select: none;
user-select: none;
}

body.showing-intro,
Expand Down Expand Up @@ -152,6 +153,7 @@ section .body p {
max-width: 60vw;

-webkit-user-select: text;
user-select: text;
cursor: text;
}

Expand Down Expand Up @@ -428,6 +430,7 @@ body.large .frame-container {

#results .body {
-webkit-user-select: text;
user-select: text;
}

#results .score-container {
Expand Down Expand Up @@ -460,6 +463,24 @@ body.large .frame-container {
padding-bottom: .3em;
}

#results .score-profile,
#test-graph .score-profile {
font-size: 0.8em;
margin-top: 0.5em;
margin-bottom: 1em;
}

#results .score-profile label,
#test-graph .score-profile label {
display: block;
}

#results .score-profile select,
#test-graph .score-profile select {
font-family: inherit;
font-size: inherit;
margin-left: 0.5em;
}
#results table {
border-spacing: 0;
margin: 0;
Expand Down Expand Up @@ -541,10 +562,11 @@ body.large .detail .large {
background: hsla(0, 0%, 100%, 0.9);
}

@supports (-webkit-backdrop-filter: blur(10px)) {
@supports (-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px)) {
#overlay {
background: hsla(0, 0%, 100%, 0.7);
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
}
}

Expand All @@ -566,10 +588,17 @@ body.large .detail .large {

font-size: 12px;
-webkit-user-select: text;
user-select: text;
cursor: text;

max-height: 250px;

border: 1px solid hsla(0, 0%, 0%, 0.1);
padding: 1em;
}

#load-results-button {
margin-left: 1em;
min-width: auto;
font-size: 0.8em;
}
18 changes: 18 additions & 0 deletions MotionMark/resources/runner/motionmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class BenchmarkRunnerClient {
class SectionsManager {
showSection(sectionIdentifier, pushState)
{
this.currentSectionIdentifier = sectionIdentifier;
var sections = document.querySelectorAll("main > section");
for (var i = 0; i < sections.length; ++i) {
document.body.classList.remove("showing-" + sections[i].id);
Expand Down Expand Up @@ -313,6 +314,15 @@ class BenchmarkController {
const score = scoreCalculator.score;
const confidence = "±" + (Statistics.largestDeviationPercentage(scoreCalculator.scoreLowerBound, score, scoreCalculator.scoreUpperBound) * 100).toFixed(2) + "%";
const fps = scoreCalculator.targetFrameRate;

const resultsScoreProfileSelector = document.getElementById("results-score-profile");
if (resultsScoreProfileSelector)
resultsScoreProfileSelector.value = scoreCalculator.scoreProfile;

const graphScoreProfileSelector = document.getElementById("graph-score-profile");
if (graphScoreProfileSelector)
graphScoreProfileSelector.value = scoreCalculator.scoreProfile;

sectionsManager.setSectionVersion("results", scoreCalculator.version);
sectionsManager.setSectionScore("results", score.toFixed(2), confidence, fps);
sectionsManager.populateTable("results-header", Headers.testName, scoreCalculator);
Expand All @@ -321,6 +331,14 @@ class BenchmarkController {
sectionsManager.showSection("results", true);
}

changeScoreProfile(profile) {
this.runnerClient.scoreCalculator.recompute(profile);
if (sectionsManager.currentSectionIdentifier == "test-graph" && this.reloadCurrentGraph)
this.reloadCurrentGraph();
else
this.showResults();
}

handleKeyPress(event)
{
switch (event.charCode)
Expand Down
49 changes: 31 additions & 18 deletions MotionMark/resources/runner/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ class ScoreCalculator {
this._runData.runs.push(suitesSamplers);
}

recompute(profile) {
this._preferredProfile = profile;
this._processData();
}

get scoreProfile() {
return this._preferredProfile || "slope";
}

_processData()
{
this._results = {};
Expand All @@ -132,11 +141,9 @@ class ScoreCalculator {
suitesResult[suiteName] = suiteResult;

for (var testName in suiteData) {
if (!suiteData[testName][Strings.json.result])
this.calculateScore(suiteData[testName]);
this.calculateScore(suiteData[testName]);

suiteResult[testName] = suiteData[testName][Strings.json.result];
delete suiteData[testName][Strings.json.result];

testsScores.push(suiteResult[testName][Strings.json.score]);
testsLowerBoundScores.push(suiteResult[testName][Strings.json.scoreLowerBound]);
Expand Down Expand Up @@ -168,8 +175,8 @@ class ScoreCalculator {
function findRegression(series, profile) {
const minIndex = Math.round(.025 * series.length);
const maxIndex = Math.round(.975 * (series.length - 1));
const minComplexity = series.getFieldInDatum(minIndex, complexityKey);
const maxComplexity = series.getFieldInDatum(maxIndex, complexityKey);
let minComplexity = series.getFieldInDatum(minIndex, complexityKey);
let maxComplexity = series.getFieldInDatum(maxIndex, complexityKey);

if (Math.abs(maxComplexity - minComplexity) < 20 && maxIndex - minIndex < 20) {
minIndex = 0;
Expand Down Expand Up @@ -206,24 +213,30 @@ class ScoreCalculator {
});

const isRampController = this._runData.options[Strings.json.controller] == "ramp";
let predominantProfile = "";
let predominantProfile = this._preferredProfile || "";
if (isRampController) {
var profiles = {};
data[Strings.json.controller].forEach(function(regression) {
if (regression[Strings.json.regressions.profile]) {
var profile = regression[Strings.json.regressions.profile];
profiles[profile] = (profiles[profile] || 0) + 1;
}
});
if (!predominantProfile) {
var profiles = {};
data[Strings.json.controller].forEach(function (regression) {
if (regression[Strings.json.regressions.profile]) {
var profile = regression[Strings.json.regressions.profile];
profiles[profile] = (profiles[profile] || 0) + 1;
}
});

var maxProfileCount = 0;
for (var profile in profiles) {
if (profiles[profile] > maxProfileCount) {
predominantProfile = profile;
maxProfileCount = profiles[profile];
var maxProfileCount = 0;
for (var profile in profiles) {
if (profiles[profile] > maxProfileCount) {
predominantProfile = profile;
maxProfileCount = profiles[profile];
}
}
}
data[Strings.json.controller].forEach(function (regression) {
regression[Strings.json.regressions.profile] = predominantProfile;
});
}
this._preferredProfile = predominantProfile;

const regressionResult = findRegression(samples[complexityKey], predominantProfile);
const calculation = regressionResult.regression;
Expand Down