Skip to content

Conversation

@NebuPookins
Copy link

I've been getting some assertion failures like:

[FATAL]: nri.hand_counts[left_hand] + nri.hand_counts[right_hand] == nri.row_count

which I think might be related to PumpItUp charts. I don't fully understand what the hand_counts logic is doing. But in the meantime, I've updated the assertion message to print out some more info. In particular, I made it print out the name of the file that's triggering the assertion failure. This required adding an extra parameter to several methods so that the filename is passed up the call chain.

The new error message looks like this:

[FATAL]: Hand count mismatch detected!
  File: /Songs/StepMix 2 Winners/V1 (for SM and PiU)/V1 (for SM).sm
  Keycount: 5
  Row notes (binary): 00000000000000000000000000000100
  Row count: 1
  Left hand count: 0
  Right hand count: 0
  Left hand mask: 00000000000000000000000000000011
  Right hand mask: 00000000000000000000000000011000
  All columns without middle: 00000000000000000000000000011011
  Row time: 0.579151
  Interval: 1, Row: 0
  Expected: 0 == 1

The main benefit of this is that now that we have a filename, it's possible to inspect the file to see what may have gone wrong. So far, every instance I've seen of triggering this assertion failure seems to be related to having a PumpItUp Chart.

@poco0317
Copy link
Member

poco0317 commented Aug 2, 2025

This change isn't acceptable because it's making a breaking API change. Without the additional string parameter, it would be fine. However, this pr is more of a report of an actual programming problem. So I went ahead and fixed it: 164bd55

@NebuPookins
Copy link
Author

Thanks for the fix.

I wasn't aware that this API is "public". Are there external third parties that call into these APIs?

@poco0317
Copy link
Member

poco0317 commented Aug 3, 2025

Everything behind define PHPCALC is used as a standalone version of the calc for php c bindings. The MinaSDCalc signature is used for a java interface for another website implementation here https://github.com/poco0317/calc-jni as well as other unauthorized duplicate minacalc repos for rust/c++ use in other projects

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants