Skip to content

Commit

Permalink
[Categorical search] Revert persistent proto and re-enable ranking
Browse files Browse the repository at this point in the history
This was causing a mysterious CFI-related crash which I'm having
trouble finding the root cause of. This CL does a soft revert of the
persistent proto class, because it won't git revert cleanly.

At the same time, I've re-enabled some amount of ranking, in particular
the result removal class.

Also:
- I've kept the API changes so if, in future, we figure out the cause
  then we don't need to change callsites.
- I've updated the histogram and enums as appropriate. The kNoop value
  has never been reported in metrics [1] so this is a non-meaningful
  change to the histogram definition.

[1] https://uma.googleplex.com/histograms/index.html?sid=0d816d3c94a657cd09aeffa0db9ed537

Bug: 1274853
Change-Id: If967bd5db47373cdaf1eb0fa3c117214131b43f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3320779
Reviewed-by: Rachel Wong <wrong@chromium.org>
Commit-Queue: Tony Yeoman <tby@chromium.org>
Cr-Commit-Position: refs/heads/main@{#949965}
  • Loading branch information
tby authored and Chromium LUCI CQ committed Dec 9, 2021
1 parent 013282c commit 36a0b95
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 424 deletions.
27 changes: 26 additions & 1 deletion chrome/browser/ui/app_list/search/ranking/ranker_delegate.cc
Expand Up @@ -15,9 +15,34 @@
#include "chrome/browser/ui/app_list/search/util/score_normalizer.pb.h"

namespace app_list {
namespace {

// A standard write delay used for protos without time-sensitive writes. This is
// intended to be slightly longer than the longest conceivable latency for a
// search.
constexpr base::TimeDelta kStandardWriteDelay = base::Seconds(3);

// No write delay for protos with time-sensitive writes.
constexpr base::TimeDelta kNoWriteDelay = base::Seconds(0);

} // namespace

RankerDelegate::RankerDelegate(Profile* profile, SearchController* controller) {
// TODO(crbug.com/1274853): Ranking removed due to stability concerns.
const auto state_dir = RankerStateDirectory(profile);

// Main result and category ranking.
AddRanker(std::make_unique<ScoreNormalizingRanker>(
PersistentProto<ScoreNormalizerProto>(
state_dir.AppendASCII("score_norm.pb"), kStandardWriteDelay)));

// Result post-processing.
AddRanker(std::make_unique<TopMatchRanker>());
AddRanker(std::make_unique<FilteringRanker>());

// Result removal.
AddRanker(std::make_unique<RemovedResultsRanker>(
PersistentProto<RemovedResultsProto>(
state_dir.AppendASCII("removed_results.pb"), kNoWriteDelay)));
}

RankerDelegate::~RankerDelegate() {}
Expand Down

0 comments on commit 36a0b95

Please sign in to comment.