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

Adjust clock usage in line with framework changes #24885

Merged
merged 30 commits into from
Oct 6, 2023

Conversation

peppy
Copy link
Member

@peppy peppy commented Sep 22, 2023

Very much a draft, PRing for visibility and because all tests pass and game behaves roughly as expected.

  • This removes four workarounds/hacks. Wow.
  • I've implemented this in the "lowest number of changes" way possible. I had another branch which tried to tidy things up more but it turned out too complex. Will save that for a follow-up.

Hacks removed which should be manually tested:

Except `FramedBeatmapClock`, which is the high-effort one.
The new implementation of `DecouplingClock` will not mutate the
underlying clock in any way (unless attempting to start it when
approaching from a negative time value).

This should be quite safe as a result.
This avoids it ever mutating the underlying track (aka attempting to start
it). Resolves the one caveat mentioned in
aeef92f.
It was causing issues with the new implementation.
This isn't required, but avoids creating a temporary `StopwatchClock`
and generally just makes debug easier with less state changes.
See inline comment for reasoning. It's a bit complicated.
@Theighlin
Copy link

Theighlin commented Sep 22, 2023

Something is not right with playback on some maps. Testing with both PRs up to date as of writing and local framework.

2023-09-22.15-39-20.mp4

https://osu.ppy.sh/beatmapsets/1601364#osu/3315708
https://osu.ppy.sh/beatmapsets/1841885#osu/3783209

@peppy
Copy link
Member Author

peppy commented Sep 22, 2023

Thanks, can reproduce. Of note, this doesn't happen when retrying.

@peppy
Copy link
Member Author

peppy commented Sep 22, 2023

As usual, this was a regression from an "innocent" code refactor. I've fixed this (framework side) and will push in a bit after I add test coverage.

@peppy
Copy link
Member Author

peppy commented Sep 22, 2023

@peppy peppy marked this pull request as ready for review September 22, 2023 16:34
@peppy
Copy link
Member Author

peppy commented Oct 4, 2023

Test failures look relevant here, I'll investigate.

@peppy peppy added the next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! label Oct 5, 2023
peppy and others added 4 commits October 6, 2023 16:43
I don't know what this test was trying to do, but it was wrong. Any
offset which is applied should be invisible to the clock's final
`CurrentTime` (and to the user).
@bdach bdach self-requested a review October 6, 2023 17:20
Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

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

I've read the diff somewhat carefully, tested the workarounds removed mentioned in the OP, playtested some more. I can't see a reason not to merge this at present.

I am heavily leaning on the test coverage, and won't pretend to rule out the possibility of future issues. But this seems to be pretty good as is.

@@ -110,6 +95,7 @@ protected override void LoadComplete()
userAudioOffset = config.GetBindable<double>(OsuSetting.AudioOffset);
userAudioOffset.BindValueChanged(offset => userGlobalOffsetClock.Offset = offset.NewValue, true);

// TODO: this doesn't update when using ChangeSource() to change beatmap.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This appears to be an observation about the current state of affairs made in passing, rather than a TODO added after realising something in this pull broke this, so I'm ignoring it.

@bdach bdach enabled auto-merge October 6, 2023 18:13
@bdach bdach disabled auto-merge October 6, 2023 18:43
@bdach bdach merged commit 0376329 into ppy:master Oct 6, 2023
14 of 16 checks passed
@peppy peppy deleted the clock-fix-attempt-2 branch October 10, 2023 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! size/L type:code-quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants