Skip to content

Ensure partial failed replays are played to their end #33670

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

Merged
merged 2 commits into from
Jun 30, 2025

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Jun 12, 2025

Closes #24285.

This is not a perfect solution, as it is still possible for a replay to play beyond its end if the HP system doesn't fail it after it runs out of frames, but it's probably the best that can be done at this time.

Notably this removes existing F rank checks because they were really not reliable.

  • Scores coming from stable will never present F rank, because rank is not stored to the replay, and the lowest rank that can be produced by StandardisedScoreMigrationTools is D.

  • lazer scores set prior to Preserve score rank on lazer scores during encode/decode #28058 will present F rank as long as the user has kept them in their local database and never exported and reimported them, for the same reason as above (rank not stored to replay). Also there may have been mechanics changes since, so it's not impossible for the replay to fail before the user actually did even in this case.

  • lazer scores set after Preserve score rank on lazer scores during encode/decode #28058 could technically rely on F rank but making them rely on it is annoying for several reasons:

    • The PR in question didn't bump LegacyScoreEncoder.LATEST_VERSION, so any checks based on the replay version field would be half-reliable anyway.
    • Even after the above, the replay version is only stored to realm as TotalScoreVersion, which then gets bumped on score version upgrades. So it can't even be used from realm for any checks from that angle, you'd have to decode it from the score.
    • You could use ClientVersion because that's somewhat reliable, but that's stored as string, so you'd have to do some snipping to split off the -lazer suffix, then parse the version, then compare it. I started going through the motions of that before deciding that this is an edge case of an edge case and probably not worth spending time over the simple and obvious solution of just doing away with the rank check. Until I'm proven wrong, I guess.

Closes ppy#24285.

This is not a perfect solution, as it is still possible for a replay to
play *beyond* its end if the HP system doesn't fail it after it runs out
of frames, but it's probably the best that can be done at this time.

Notably this removes existing F rank checks because they were really not
reliable.

- Scores coming from stable will never present F rank, because rank is
  not stored to the replay, and the lowest rank that can be produced by
  `StandardisedScoreMigrationTools` is D.

- lazer scores set prior to ppy#28058 will
  present F rank as long as the user has kept them in their local
  database and never exported and reimported them, for the same reason
  as above (rank not stored to replay). Also there have been many
  mechanics changes since, so it's not impossible for the replay to fail
  *before* the user actually did even in this case.

- lazer scores set after ppy#28058 could
  technically rely on F rank but making them rely on it is annoying for
  several reasons:

  - The PR in question didn't bump `LegacyScoreEncoder.LATEST_VERSION`,
    so any checks based on the replay version field would be
    half-reliable anyway.

  - *Even after* the above, the replay version is only stored to realm
    as `TotalScoreVersion`, which *then gets bumped* on score version
    upgrades. So it can't even be used for any checks from that angle,
    you'd have to decode it from the score.

  - You *could* use `ClientVersion` because that's somewhat reliable,
    but that's stored *as string*, so you'd have to do some snipping to
    split off the `-lazer` suffix, then parse the version, then compare
    it. I started going through the motions of that before deciding that
    this is an edge case of an edge case and probably not worth spending
    time over the simple and obvious solution of just doing away with
    the rank check. Until I'm proven wrong, I guess.
@bdach bdach force-pushed the ensure-replays-are-played-to-end branch from 9147957 to 73a1f10 Compare June 13, 2025 07:21
Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

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

I think this is fine. Only thing I'm not sure about is autoplay being allowed to fail but I'm not so hung-up about it for it to be a blocker.

@peppy peppy merged commit 768d445 into ppy:master Jun 30, 2025
9 checks passed
@bdach bdach deleted the ensure-replays-are-played-to-end branch June 30, 2025 07:22
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.

Dying earlier than I actually failed in a failed replay
3 participants