Open peppy opened 2 years ago
I'm not entirely sure what sort of feedback you want on this, if any, but storing default mod settings is fine.
I don't think we'll ever be able to store every mod combination, so we'll need some sort of process that enables both use of/caching to the database (for default settings) and inline/in-memory computation (for song select filtering on SR with non-default settings).
I think that filtering / sorting should use default settings as best effort, at least for now. For display purposes, I propose the WorkingBeatmap
level single-value cache for current settings.
Whether we will ever be able to sort or filter on settings adjusted values is something for a far future discussion I think.
Does that sounds okay?
Song select will need an async process as I mentioned in the past, but the idea is more that you should build in that direction/keep that in mind.
Not sure on the WorkingBeatmap
thing. WorkingBeatmap
s aren't tied to mods right now, and some components like the details graph in song select need two values (the default and the mod-applied one).
Put another way: I think we should only be caching values for the current settings/mod (for non-defaults), rather than persisting each settings changed value to memory cache.
Whether it’s stored in WorkingBeatmap
or somewhere else is something I’ll figure out, that just fits best with the invalidation flow I have at the moment.
I think we should only be caching values for the current settings/mod (for non-defaults), rather than persisting each settings changed value to memory cache.
I agree, only the defaults should be persisted anywhere (memory or otherwise).
I managed to add a method of invalidation via https://github.com/ppy/osu/pull/18835. I still believe we should be caching less to memory (non-default combinations, as agreed upon above) and more to realm, but this has become a lower priority issue so I'm removing from the roadmap.
In trying to update star ratings after an editor save (as part of https://github.com/ppy/osu/issues/18665), I ran into some issues which need further discussion before moving forward, to make sure everyone is on the same page.
The primary concern is that
BeatmapDifficultyCache
has no method of invalidation. Adding one is non-trivial as the cache is done on a struct withRuleset:Mod:Beatmap
combinations. When saving a beatmap we would want to invalidate all entries on a beatmap level.Looking for a solution to this, I was looking to move this cache to be at a realm
BeatmapInfo
level. I think this is something we all generally can agree on, but let me know if that's not the case. It would look something like this:We would not be able to cache every settings combination, so I'd propose that caching for default settings is a good place to be.
But this may still need to be accompanied by a stored value for the current mod/setting/ruleset combination to handle multiple components potentially requesting the difficulty at song select etc.
Potentially the current star rating could be cached in
WorkingBeatmap
to handle this case (as a bindable, replacing theGetBindableDifficulty
flow inBeatmapDifficultyCache
.If more context is required for the above, please have a read through my WIP branch for updating beatmaps after save.