Skip to content

[Code Review] A Few Small Improvements in ranking_scorer.rs & param.rsΒ #196

Description

@SB2318

Hi team! πŸ‘‹

Really appreciate the transparency of open-sourcing this. While reading through the code, I spotted a few small things that could be worth tidying up. Happy to send a PR for any of these if helpful!


1. param.rs β€” File appears truncated at the end

The last param!() call for OonWeightFactor seems to be missing its closing );. Just want to flag it in case it was a publish artifact.


2. ranking_scorer.rs β€” "pdwell" key in applied_weights_map may be pointing to the wrong field

It currently maps to self.post_unexplored. I think it was meant to map to self.cont_dwell_time β€” happy to double-check and fix if confirmed.


3. ranking_scorer.rs β€” Negative-action weights have no sign convention guard

Since negative_sum negates the block/report/mute weights, a small debug_assert! or comment clarifying that these params are expected as positive magnitudes would help prevent accidental misconfiguration down the line.


4. param.rs β€” ShadowTrafficPhoenixClusterRates typed as Vec<String>

Since these are numeric traffic rates (similar to the f64 typed ShadowTrafficDefaultPercent), changing this to Vec<f64> would give a bit more type safety and avoid manual parsing at call-sites.


5. ranking_scorer.rs β€” bidirectional_boost_eligible may want to cover quote-tweets too

Replies and retweets are excluded from the boost β€” wondering if quote-tweets (quoted_tweet_id) should follow the same logic for consistency. If intentional, a short comment would make the design decision clearer.


Thanks for your time β€” feel free to close if any of these are already on your radar! πŸ™

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions