Skip to content

FlutterBench results model and placeholder data - #14168

Open
ericwindmill wants to merge 3 commits into
mainfrom
fb/1-model
Open

ericwindmill wants to merge 3 commits into
mainfrom
fb/1-model

Conversation

@ericwindmill

@ericwindmill ericwindmill commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Description of what this PR is changing or adding, and why:

First PR in the FlutterBench leaderboard stack for flutter.dev. This PR doesn't make any visual changes.

This PR adds some dummy JSON files needed to build, and their Dart models

Presubmit checklist

  • If you are unwilling, or unable, to sign the CLA, even for a tiny, one-word PR, please file an issue instead of a PR.
  • If this PR is not meant to land until a future stable release, mark it as draft with an explanation.
  • This PR follows the Google Developer Documentation Style Guidelines—for example, it doesn't use i.e. or e.g., and it avoids I and we (first-person pronouns).
  • This PR uses semantic line breaks
    of 80 characters or fewer.

@ericwindmill ericwindmill mentioned this pull request Dec 4, 2026
4 tasks done

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces dataset tasks, benchmark results, and Dart models/utilities for parsing and formatting FlutterBench metrics, along with comprehensive unit tests. The review feedback highlights two key improvements in bench_format.dart: first, updating formatScoreWithSd to fall back to displaying just the mean when the standard deviation is null; second, using !delta.isNegative instead of delta >= 0.0 in formatDelta to prevent double-sign formatting issues with negative zero (-0.0). Additionally, corresponding test cases should be added to verify these behaviors.

Comment on lines +24 to +28
String formatScoreWithSd(double? mean, double? sd) {
if (mean == null || sd == null) return missingValue;
return '${(mean * 100).toStringAsFixed(1)}% ± '
'${(sd * 100).toStringAsFixed(1)}%';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

If sd is null but mean is not null, formatScoreWithSd currently returns missingValue (—), which hides the average score entirely. We can improve this by returning just the formatted mean when standard deviation is unavailable.

String formatScoreWithSd(double? mean, double? sd) {
  if (mean == null) return missingValue;
  if (sd == null) return formatPercent(mean);
  return '${(mean * 100).toStringAsFixed(1)}% ± '
      '${(sd * 100).toStringAsFixed(1)}%';
}
References
  1. Report an issue only if the change introduces or worsens it, it's of medium severity or higher, and you can state its concrete consequence. (link)

Comment on lines +50 to +54
String formatDelta(double? delta, {String suffix = '%', int decimals = 1}) {
if (delta == null) return missingValue;
final prefix = delta >= 0.0 ? '+' : '';
return '$prefix${delta.toStringAsFixed(decimals)}$suffix';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using delta >= 0.0 can lead to formatting bugs with negative zero (-0.0), where -0.0 >= 0.0 evaluates to true in Dart, resulting in a prefix of + and a formatted string of +-0.0%. Using !delta.isNegative correctly handles negative zero and avoids double-sign formatting issues.

String formatDelta(double? delta, {String suffix = '%', int decimals = 1}) {
  if (delta == null) return missingValue;
  final prefix = !delta.isNegative ? '+' : '';
  return '$prefix${delta.toStringAsFixed(decimals)}$suffix';
}
References
  1. Report an issue only if the change introduces or worsens it, it's of medium severity or higher, and you can state its concrete consequence. (link)

@flutter-website-bot

flutter-website-bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Staged preview of the updated flutter.dev site (updated for commit 1f3a60c):

https://flutter-dev-230821--www-pr14168-fb-1-model-8qia1g3n.web.app

@ericwindmill
ericwindmill added this pull request to stack #14173 December 4, 2026 20:29

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.

This is purposefully nulled/zeroed out results.

@ericwindmill ericwindmill Dec 4, 2026 •

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.

This is fake/partial data. It will change to real data when the time comes.

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