Fix lack of encode-decode stability when writing out mania beatmaps with some key counts#37256
Merged
peppy merged 8 commits intoppy:masterfrom Apr 10, 2026
Merged
Fix lack of encode-decode stability when writing out mania beatmaps with some key counts#37256peppy merged 8 commits intoppy:masterfrom
peppy merged 8 commits intoppy:masterfrom
Conversation
…tness of all stable-supported key counts
Because I want to reuse `LegacyBeatmapEncoderTest`.
Just for my peace of mind.
…ith some key counts See https://www.desmos.com/calculator/a5yjpacvxa for visual explanation of change.
smoogipoo
previously approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #37232.
The actual fix is e959b20; everything else is window dressing / test harness to ensure I don't try and do a wrong change like #37251 did. I recommend reviewing commit-by-commit.
See this desmos for visual explanation of change, I think it does a better job at explaining this than any words I could type here.
Of note:
In the end this did only affect 14K but that should never be assumed when floating point is involved.
Test cases generated here were generated in stable manually.
Except for 11 / 13 / 15 / 17K which are not officially supported and which don't work in lazer due to orthogonal reasons (see comment added in this PR in
ManiaBeatmapConverter), decoding in lazer was always fine.My worry was that the old encoding method before this PR could potentially cause stable to move a note from one column to another but thankfully that is not the case. The old method of encoding columns as X positions does not cause issues wherein lazer reads them back differently than stable after encode.
I checked this by checking out
master, re-encoding all of the test stair-pattern nK beatmaps added in this PR onmaster, exporting that as compatibility, re-importing to stable, and cross-checking that the decoded beatmap is visually the same on lazer and on stable.This is important to check because if this wasn't the case, we'd potentially have cases of actual online beatmaps (remember that we have BSS now) wherein a beatmap plays differently on stable than on lazer due to notes moving between columns, and would need to screen for this being the case and potentially apply corrective / reconciliatory action.