Overhaul optimize-baselines to support virtual suites correctly

Desktop / Chromium - Robert Ma [chromium.org] - 6 November 2017 22:10 EST

The original algorithm treated the virtual and non-virtual fallback paths rather independently and optimized them separately, which missed the chance to optimize virtual baselines duplicate with non-virtual fallbacks. This CL keeps the core idea, but adds steps to "patch" the
virtual subtree to make it self-contained before optimizing it, and to "unpatch" the virtual subtree afterwards.

This CL also:
- fixes the existing unit tests themselves and adds a few more cases the previous implementation would fail;
- renames a few methods and variables to make the terminologies consistent;
- hugely improves documentation (docstrings and comments);
- fixes a bug in expected_filename in Base Port where return_default argument was not always honored for virtual tests.

Bug: 767356 Change-Id: I3221a39ab30d30a876f332776ba216c93d4f46c1 Reviewed-on: https://chromium-review.googlesource.com/747322 Commit-Queue: Robert Ma

be8619c0886e Overhaul optimize-baselines to support virtual suites correctly
.../webkitpy/common/checkout/baseline_optimizer.py | 295 ++++++++++++++-------
.../common/checkout/baseline_optimizer_unittest.py | 173 +++++++++---
.../Scripts/webkitpy/layout_tests/port/base.py | 8 +-
.../webkitpy/tool/commands/optimize_baselines.py | 9 +-
4 files changed, 335 insertions(+), 150 deletions(-)

Upstream: git.chromium.org

  • Share