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

Improved PB Chance Module #642

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Improved PB Chance Module #642

wants to merge 24 commits into from

Conversation

atw1020
Copy link

@atw1020 atw1020 commented Mar 1, 2023

Overview

About a month ago, I pitched an idea in the Livesplit discord (my discord is IDW#1024) of a method to more accurately calculate the chance of PB. This method allows so-called "Skill Curves" to be merged rather than using a binary search to find the percentile that the run must maintain. I've created a Sub-Module in the analysis module called statistical_pb_chance that computes the probability of getting a PB using the method I described. I considered removing the existing pb_chance module, but I thought that might cause chaos.

Benchmarks & Tests

When I initially suggested the idea, there were concerns about the performance. In particular, it was desired that computations take less than a millisecond such that LSO's frame rate would not be affected. To ensure this, I've added two benchmarks in "statistical_pb_chance.rs." For my code and on my computer, both of them are well under a millisecond:

  1. Calculating the CDF of a probability distribution or "skill curve": ~100 µs
  2. Merging two probability distributions or "skill curves" through the convolution Theorem: ~20 µs

When rendering a frame, it is only necessary to compute the CDF. The merging of skill curves can be done on a separate thread if necessary, and results are not required until a run is reset.

I've also implemented tests for all my proposed code.

Next Steps

  • Get proposed changes approved
  • Discuss whether the old "pb_chance" module should be entirely removed
  • Discuss whether more abstraction should be added to code to make it easier to use
  • Implement new pb_chance code into LSO web
  • Profit?

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.

None yet

1 participant