Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash Function Introduced to Produce Random Seeds to Enhance Default Carousel Randomness #9160

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

Jiatonglii22
Copy link

Closes #8986

[Feature]
Follow up on #8966 where randomness for carousels is generated on an hourly or daily basis. Modifications hope to accommodate for when a custom seed for a random carousel is not specified, in which case a random seed will be generated using a hash function on the carousel params. This is to prevent shared content orders for carousels on the same page.

Technical

  • New parameter 'carousel_param's is added to function process_user_sort and params of the query are passed in when the function is called
  • A Hash function is introduced in the SearchScheme class. It is an FNV-1a hash algorithm, commonly known for being simple and efficient, which is the main reason I picked it as the hash function is to generate random seeds.
  • When a random order is specified but a custom seed is not introduced, the hash function computes a hash value that is then appended to the sort (only the first few letters), which will then become the random seed for the carousel.
  • Most of the existing implementation is untouched

Testing

  • Simple performance testing in the test_works.py which ensures that the hash function can generate hash values of large numbers of queries without taking too long.

Screenshot

Stakeholders

@RayBB @cdrini

Jiatonglii22 and others added 24 commits April 20, 2024 18:37
…ed a simple hash function to create a random seed for each carousel
Added no params within test_hash_peformance
@Jiatonglii22 Jiatonglii22 marked this pull request as draft April 26, 2024 15:38
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.

Enhance Default Carousel Randomness for Unique Display Across Multiple Carousels
2 participants