Skip to content

Fixes for maximum stage complexity calculation #90

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions MotionMark/tests/resources/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,11 @@ class RampController extends Controller {
var nextTierComplexity = Math.max(Math.round(Math.pow(10, this._tier)), currentComplexity + 1);
stage.tune(nextTierComplexity - currentComplexity);

// If the next tier complexity couldn't be set, we've reached the maximum capacity for the test
if (stage.complexity() != nextTierComplexity) {
this._maximumStageComplexity = stage.complexity();
}

// Some tests may be unable to go beyond a certain capacity. If so, don't keep moving up tiers
if (stage.complexity() - currentComplexity > 0 || nextTierComplexity == 1) {
this._tierStartTimestamp = timestamp;
Expand Down Expand Up @@ -520,6 +525,12 @@ class RampController extends Controller {
// If the browser is capable of handling the most complex version of the test, use that
this._maximumComplexity = currentComplexity;
}

if (this._maximumStageComplexity) {
// If we reached the maximum stage complexity, set the maximum such
// that the stage complexity is in the middle of the ramp.
this._maximumComplexity = Math.round(this._maximumStageComplexity * 1.25);
}

this._possibleMaximumComplexity = this._maximumComplexity;

Expand Down Expand Up @@ -616,6 +627,12 @@ class RampController extends Controller {
this._maximumComplexity = Math.max(Math.round(.8 * this._maximumComplexity), this._minimumComplexity + 5);
}

if (this._maximumStageComplexity) {
// If we reached the maximum stage complexity, set the maximum such
// that the stage complexity is in the middle of the ramp.
this._maximumComplexity = Math.min(Math.round(this._maximumStageComplexity * 1.25), this._maximumComplexity);
}

// Next ramp
stage.tune(this._maximumComplexity - stage.complexity());
this._rampDidWarmup = false;
Expand Down