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

IndexOutOfBoundsException generating CubingUSANationals2023 scrambles #837

Open
timreyn opened this issue Jul 3, 2023 · 4 comments
Open

Comments

@timreyn
Copy link
Contributor

timreyn commented Jul 3, 2023

Actual (problem) behavior

When I try to generate scrambles for CubingUSANationals2023, I get an IndexOutOfBoundsException in WCIFScrambleMatcher.matchActivity (after all the scrambles are generated, but before they are downloadable). This initially happened when I selected the real number of scramble sets per event. I changed the scramble counts to 3x3r1=1, everything else=0 to make testing / debugging faster.

I've tried looking through the code to track down the issue, but the line numbers don't match up. I've also tried running locally to add more debugging, but have not been able to do so.

Expected behavior

No IndexOutOfBoundsException :)

Desktop (please complete the following information):

  • OS: Fedora
  • Browser including version [e.g. Chrome 76, Firefox 68] Chrome 114.0.5735.133 (Official Build) (64-bit)
  • TNoodle Version [e.g. 0.15.1] TNoodle-WCA-1.1.2.jar
  • Java version [e.g. Java 8]
$ java --version
openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7, mixed mode, sharing)

Screenshots [OPTIONAL]

image

Additional context [OPTIONAL]

I didn't realize that tnoodle matched activities with the schedule, and since I generated groups using new software it's possible the activity schema I made breaks an assumption in TNoodle. But I can't tell what that assumption is.

@timreyn
Copy link
Contributor Author

timreyn commented Jul 4, 2023

Thanks to @coder13 who figured out that this was because I had groups numbered 0 (this was special groups for people who are unable to compete during the regular time slots for religious reasons). I resolved it by changing those groups to a large positive number, rather than 0.

I had not realized that TNoodle is doing scramble matching, even to the level of matching scramble sets to groups.

@campos20
Copy link
Member

campos20 commented Jul 4, 2023

We should handle this better anyway. Giving this kind of exception doesn't seem the right way of doing it. Let's keep this issue open until we solve this in a better way

@gregorbg
Copy link
Member

Interestingly enough, we do have a safeguard that is supposed to catch these cases.
The only circumstance under which you can run into this error is when scrambleSetCount is not equal to scrambleSets.length in any Round. It would be necessary for me to see the actual WCIF from the point in time when this error was reported to further debug this issue.

@timreyn
Copy link
Contributor Author

timreyn commented Jul 13, 2023

@gregorbg I reproduced this behavior using BrooklineFavorites2023, by adding a group 0 to the schedule, which is currently visible in https://www.worldcubeassociation.org/api/v0/competitions/BrooklineFavorites2023/wcif/public:

{"id":12,"name":"3x3x3 Cube, Round 1","activityCode":"333-r1","startTime":"2023-09-03T17:00:00Z","endTime":"2023-09-03T18:15:00Z","childActivities":[{"id":25,"name":"Main 0","activityCode":"333-r1-g0","startTime":"2023-09-03T17:00:00Z","endTime":"2023-09-03T17:15:00Z","childActivities":[],"extensions":[]}],"extensions":[]},

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

No branches or pull requests

3 participants