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

Replace unsafe casting in ManiaDifficultyCalculator with generic column count calculation #30026

Closed
wants to merge 3 commits into from

Conversation

Givikap120
Copy link
Contributor

This is a prerequisite for #29989 to work
Makes this function work with any generic IBeatmap, not only ManiaBeatmap

@bdach
Copy link
Collaborator

bdach commented Oct 3, 2024

!diffcalc
RULESET=mania

Copy link

github-actions bot commented Oct 3, 2024

@bdach
Copy link
Collaborator

bdach commented Oct 4, 2024

Well something ain't right here, since I'd expect the spreadsheet to be empty. And yet it's not.

@Givikap120
Copy link
Contributor Author

Well something ain't right here, since I'd expect the spreadsheet to be empty. And yet it's not.

Hmmm, very weird
I personally checked around 100 maps (including both converts and og maps) and they were matching
I will look into this

@Givikap120
Copy link
Contributor Author

Givikap120 commented Oct 4, 2024

Well something ain't right here, since I'd expect the spreadsheet to be empty. And yet it's not.

Checked in the latest lazer - the output is the same as this branch
This looks like problem with lazer in general

https://osu.ppy.sh/scores/2211726688

image
image

@Givikap120
Copy link
Contributor Author

@smoogipoo can you run mania sheet on master branch?

@bdach
Copy link
Collaborator

bdach commented Oct 4, 2024

The spreadsheet generated above is against master branch...? What are you hoping to achieve with that?

@Givikap120
Copy link
Contributor Author

The spreadsheet generated above is against master branch...? What are you hoping to achieve with that?

both master lazer and master osu-tools output value the same as this branch (39pp)
when sheet claims that master value is 43pp

@Givikap120
Copy link
Contributor Author

Givikap120 commented Oct 4, 2024

Also, I found out that this change breaks osu-tools
Reason - LegacyBeatmapConversionDifficultyInfo.FromBeatmapInfo
This function takes ObjectCount from BeatmapInfo. This is intentionally used instead of FromBeatmap because latter will produce incorrect results as passed Beatmap is already converted, changing object count
But, in osu-tools (and potentially in some other places) - ObjectCount in BeatmapInfo is not populated, breaking the function

Text above makes me not so sure about this change anymore. The potential fix I see is passing not converted beatmap into CreateSkills function.

var skills = CreateSkills(Beatmap, playableMods, clockRate);
var skills = CreateSkills(beatmap.Beatmap, playableMods, clockRate);
Copy link
Contributor

@smoogipoo smoogipoo Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct - it will reference the original beatmap, not the post-mod or even mania-converted one.

@smoogipoo
Copy link
Contributor

See review above. Current code is very intentional, and I'm not sure you'll be able to resolve the review without a total rewrite of this PR/if at all.

@smoogipoo smoogipoo closed this Oct 7, 2024
@Givikap120
Copy link
Contributor Author

See review above. Current code is very intentional, and I'm not sure you'll be able to resolve the review without a total rewrite of this PR/if at all.

This PR was needed for correct functioning of IDifficultyCalculatorBeatmap because it failed a cast
but if this way of fixing isn't acceptable - I can add IBeatmap IDifficultyCalculatorBeatmap.BaseBeatmap method
I just thought that this way would be better

@smoogipoo
Copy link
Contributor

!diffcalc
RULESET=mania

@smoogipoo
Copy link
Contributor

I think you might be able to get away with storing the IWorkingBeatmap from the constructor, local to ManiaDifficultyCalculator.

I looked back on this PR because I also don't understand why the values changed and may indicate something going wrong in osu-difficulty-calculator, which would be a must-fix for next release.

@Givikap120
Copy link
Contributor Author

I think you might be able to get away with storing the IWorkingBeatmap from the constructor, local to ManiaDifficultyCalculator.

I looked back on this PR because I also don't understand why the values changed and may indicate something going wrong in osu-difficulty-calculator, which would be a must-fix for next release.

I assume that it's because mania have merged but not deployed changes for a while now

@smoogipoo
Copy link
Contributor

The comparison is against master, so that's not relevant.

@Givikap120
Copy link
Contributor Author

Givikap120 commented Oct 7, 2024

The comparison is against master, so that's not relevant.

well idk how it's comparison against master if my lazer release client show values in line with this PR instead of master
you can try downloading this score - https://osu.ppy.sh/scores/2211726688
and comparing values on lazer client to values shown in the sheet

@smoogipoo
Copy link
Contributor

smoogipoo commented Oct 7, 2024

I already said I don't know why it's broken... And why I'm doing my own investigation.

I'm only telling you how things work and have worked since the very beginning with the sheet generator.

REGARDLESS of that, this PR cannot pass. It will guaranteed break at least catch with only a glance at the code.

Copy link

github-actions bot commented Oct 8, 2024

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

Successfully merging this pull request may close these issues.

4 participants