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

Input format question: final newline? #140

Closed
mkfmnn opened this issue Dec 2, 2024 · 6 comments
Closed

Input format question: final newline? #140

mkfmnn opened this issue Dec 2, 2024 · 6 comments

Comments

@mkfmnn
Copy link

mkfmnn commented Dec 2, 2024

I saw my day1 solution panicked with an error in the parsing code when run by the GitHub action: https://github.com/CodSpeedHQ/Advent/actions/runs/12124386193/job/33802001005

I do know that my code made some assumptions about the input based on the input file that I got from the AoC website (for instance that each line consists of two 5 digit numbers separated by 3 spaces) which could have triggered the panic. However, looking at the leaderboard, the top submissions made similar assumptions.

I did successfully test my code against the rust-runner tool as described in the README. I think one thing that could have triggered the error in the code for me is if the input file supplied to the code when run in the GitHub action is missing the final newline on the last line. Could you confirm whether this is the case?

Looking through the runs I did find another one that looks like it could have failed for the same reason. A few successful solutions that I spot-checked don't seem to care about whether the final line is properly terminated or not (either because they use lines() to split the input, or because they hard-code that the input has exactly 1000 lines).

Thanks!

@mkfmnn
Copy link
Author

mkfmnn commented Dec 2, 2024

I made a minimal change that only makes my solution tolerant of missing newlines without any additional optimizations: mkfmnn/aoc2024-codspeed@a339d42

If you're willing to redo the day1 run for my repo, I'd really appreciate it 😄

@ThomAub
Copy link

ThomAub commented Dec 3, 2024

@adriencaccia
Copy link
Member

Hey, I am sorry that your solutions did not work because they expected the newline to be present, but for fairness to the other participants, we will not do re-runs for previous days.

Hopefully now that you know it, next runs will work better!

To determine your time, you can set up CodSpeed on your repo and bench your solutions.

@Dr-Emann
Copy link

Dr-Emann commented Dec 3, 2024

Per discord announcement

As discussed in a support issue, the input files we were using did not have an ending newline. This made them different from the official input files you can get when downloading them directly from the AoC website. We're very sorry about that and we definitely agree that we should comply with the official input format.

⚠️ Starting tomorrow (day 3), THERE WILL BE A TRAILING NEWLINE at the end of the input files. ⚠️
Thus, the format will be precisely the one of https://adventofcode.com/2024/day/3/input.

⁉️ If you had an issue with the missing newline in the input in today's or yesterday's run, please ensure you opened a support thread. We'll rerun the same commit initially picked up with an input containing the newline at the end.

@adriencaccia
Copy link
Member

Hey @mkfmnn, @ThomAub, as stated above, we reran your solutions on the same commits, and they worked 🥳
You are now ranked on https://codspeed.io/advent/day/1.

@ThomAub
Copy link

ThomAub commented Dec 4, 2024

Just below the points ! Thanks for the extra effort ❤️

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

4 participants