Skip to main content

Overview

Scorers compute prediction scores and ranking signals for candidates. They run sequentially after filtering, allowing each scorer to see the results of previous scorers. Scorers update candidate fields with computed scores.

Scorer Trait

The Scorer trait defines the interface for scoring candidates:
candidate-pipeline/scorer.rs
The score method must return candidates in the same order as the input. The returned vector must have the same length. Dropping or reordering candidates is not allowed - use a filter instead.
fn(&self, &Q) -> bool
Optional gating logic to conditionally enable/disable the scorer based on query parameters
async fn(&self, &Q, &[C]) -> Result<Vec<C>, String>
The main scoring method. Returns scored candidates with prediction fields populated.
fn(&self, &mut C, C)
Updates a single candidate with scored fields. Only copy fields this scorer is responsible for.
fn(&self) -> &'static str
Returns the scorer name for logging and metrics. Auto-generated from the type name by default.

Phoenix Scorer

The Phoenix scorer calls the Phoenix prediction service to compute engagement probabilities:
home-mixer/scorers/phoenix_scorer.rs

Phoenix Scorer Features

  • Calls Phoenix prediction service with user action sequence
  • Computes engagement probabilities (like, reply, retweet, etc.)
  • Handles retweets by looking up scores for the original tweet
  • Includes timestamp and request ID for debugging
  • Gracefully degrades if prediction fails (returns candidates unscored)

Phoenix Scores

The Phoenix scorer populates these engagement prediction fields:
Option<f64>
Probability the user will like the tweet
Option<f64>
Probability the user will reply to the tweet
Option<f64>
Probability the user will retweet the tweet
Option<f64>
Probability the user will expand photos
Option<f64>
Probability the user will click the tweet
Option<f64>
Probability the user will click the author’s profile
Option<f64>
Probability the user will watch a video (Video Quality View)
Option<f64>
Probability the user will share the tweet
Option<f64>
Probability the user will dwell on the tweet
Option<f64>
Expected dwell time in seconds (continuous action)
Option<f64>
Probability the user will mark “not interested” (negative signal)
Option<f64>
Probability the user will block the author (negative signal)
Option<f64>
Probability the user will mute the author (negative signal)
Option<f64>
Probability the user will report the tweet (negative signal)

Weighted Scorer

The Weighted scorer combines Phoenix scores into a single ranking score:
home-mixer/scorers/weighted_scorer.rs

Weighted Scorer Features

  • Combines multiple engagement scores into a single ranking score
  • Applies configurable weights to each engagement type
  • Conditionally applies VQV weight based on video duration
  • Includes negative signals (blocks, reports, not interested)
  • Normalizes scores for consistent ranking
The Weighted scorer is the final ranking signal used by the selector to sort candidates. It combines positive engagement signals (likes, retweets) with negative signals (blocks, reports) to produce a single score.

Available Scorers

The home-mixer service includes these scorers:

PhoenixScorer

Computes ML-based engagement predictions

WeightedScorer

Combines scores with configurable weights

OONScorer

Out-of-network specific scoring adjustments

AuthorDiversityScorer

Scores based on author diversity

Sequential Execution

Scorers run sequentially, allowing each scorer to see previous scores:
candidate-pipeline/candidate_pipeline.rs
If a scorer fails or returns mismatched length, the error is logged and candidates remain unscored. This ensures partial failures don’t break the pipeline.

Error Handling

If a scorer fails or returns mismatched length, the error is logged and candidates remain unmodified. The pipeline continues with the existing scores.

Best Practices

The scored vector must match the input order and length:
Only update fields this scorer is responsible for:
If scoring fails, return candidates unchanged instead of erroring:
Batch external calls to minimize RPC overhead:

Score Composition

Scorers typically run in this order:
1

Phoenix Scorer

Computes ML-based engagement predictions for all candidates
2

Weighted Scorer

Combines Phoenix scores into a single ranking score using configurable weights
3

Diversity Scorer

Applies diversity adjustments to promote variety in results

Score Normalization

The weighted scorer includes normalization to handle negative scores:
home-mixer/scorers/weighted_scorer.rs
Negative signals (blocks, reports) have negative weights, which can make the combined score negative. The offset ensures all final scores are positive for ranking.

Pipeline Framework

Understand the overall pipeline execution flow

Phoenix Prediction

Deep dive into Phoenix prediction system

Filters

Filter candidates before scoring

Ranking

Learn about the ranking algorithm