Skip to content

Stop engagement-count store errors from zeroing For You rank features - #63

Closed
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/magellan-ranking-eng-counts-ff33
Closed

Stop engagement-count store errors from zeroing For You rank features#63
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/magellan-ranking-eng-counts-ff33

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner

Dragonfly Err in EngagementCountsHydrator was coerced to an empty HashMap. Every candidate then got Ok(CachedCounts::default()). CachedHydrator caches Ok for 60s. as_tweet_info unwrap_or(0) stamps Phoenix InputBuffer and Thompson sampling as if the post had no favs, replies, or views.

Proof

  • Entry: EngagementCountsHydrator::hydrate_from_client (get_engagement_counts)
  • Sink: PostCandidate::as_tweet_info -> Phoenix stamp_engagement_counts; AuthorColdStart Thompson (view_count_on_home, fav_count)
  • Break: unwrap_or_else empty map -> Ok(default) -> Moka insert
  • Viewer: a viral post ranks like a zero-engagement post for up to 60s after a store blip; the whole slate can collapse together
  • Twin: LanguageCodeHydrator and MediaInfoHydrator return Err on store error, so update_all skips and the cache does not store empties

This is not xai-org#171/xai-org#177 (notes). Not xai-org#172 (author diversity retweeter key). Not xai-org#173 (safemodel). Not xai-org#174 (UserCred). Not xai-org#175/xai-org#176 (cache mutual-follow / Phoenix rescore). Not xai-org#142 (empty Phoenix heads). Not #22 (cold-start thresholds). Not #21 (DPP missing embeddings).

Fix: on client Err, return Err for candidates that need a fetch. CachedHydrator does not insert. update_all leaves existing counts. Successful per-id misses stay Ok(default), same as a tweet with no row.

Tests cover store Err (no zero stamp), no cache poison, cached-post ineligible preserve, and successful miss unchanged.

cargo test cannot run here. Public dump has no Home Mixer manifest. Standalone rustc model of the stamp path passed 4/4.

Open in Web Open in Cursor 

CI agent and others added 19 commits August 14, 2026 20:55
in_network_ids is passed to the VF client without deduplication, while
oon_ids is deduped four lines below. retweeted_tweet_id is pushed for
every candidate that has one, so the same ID repeats once per retweet of
a given post — most often when that post is going viral.

Neither VfClient implementation dedupes its input: StratoVfClient builds
one call per element, and XaiVfClient chunks by XAI_VF_MAX_BATCH_SIZE, so
duplicates consume batch slots and can force an extra round trip.

Not a correctness issue — results collapse into a HashMap keyed by tweet
ID — but redundant work on the For You serving path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deduplicate in_network_ids before VF lookup
Dragonfly Err was coerced to an empty map, then Ok(default) counts.
CachedHydrator cached those zeros for 60s and Phoenix unwrap_or(0)
ranked the slate as if nobody engaged.

Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
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.

4 participants