osu icon indicating copy to clipboard operation
osu copied to clipboard

Replace error functions in DifficultyCalculationUtils with good-enough approximations

Open Natelytle opened this issue 6 months ago • 4 comments

For an acceptable loss in precision, we can speed up the error function implementations by around 5x. This affects both standard and taiko, as both modes use DifficultyCalculationUtils.Erf for their accuracy scaling. In standard, this necessitates a change to the maximum tested precision, however taiko's calculation is not precision-sensitive and is therefore fine without any changes.

This massively speeds up the standard performance calculator, by around 2x.

Old: image New: image

Erf approximation delta visualization: https://www.desmos.com/calculator/lyg8opgpej

ErfInv approximation delta visualization: https://www.desmos.com/calculator/npbyvxpwtw

Natelytle avatar Jun 15 '25 19:06 Natelytle

!diffcalc RULESET=osu OSU_A=https://github.com/ppy/osu/tree/pp-dev OSU_B=https://github.com/ppy/osu/pull/33717 SCORE_PROCESSOR_A=https://github.com/tsunyoku/osu-queue-score-statistics/tree/add-hd-so-to-relevant-legacy-mods SCORE_PROCESSOR_B=https://github.com/tsunyoku/osu-queue-score-statistics/tree/add-hd-so-to-relevant-legacy-mods

tsunyoku avatar Jun 17 '25 09:06 tsunyoku

!diffcalc RULESET=taiko OSU_A=https://github.com/ppy/osu/tree/pp-dev OSU_B=https://github.com/ppy/osu/pull/33717

tsunyoku avatar Jun 17 '25 09:06 tsunyoku

Target: https://github.com/ppy/osu/pull/33717 Spreadsheet: https://docs.google.com/spreadsheets/d/1VvdZ4z5X424U0o7rFtvEd_fQqZ_pzDis9NOzrhJnv3M/edit

github-actions[bot] avatar Jun 17 '25 22:06 github-actions[bot]

Target: https://github.com/ppy/osu/pull/33717 Spreadsheet: https://docs.google.com/spreadsheets/d/1Ujsxvmw7YIxo1ZiZg6Rtcx3mE6Hi1Nk3UHyeFCICNuo/edit

github-actions[bot] avatar Jun 17 '25 23:06 github-actions[bot]