Cla64.ai

Tournament Leaderboard - Bug Fixing podium, Python

Swapnil Sinha, 2nd with 85.8 points

Back to the podium

85.8/ 100

Problem solving
50 of 55 pointsBugs fixed: 45 of 45 (3 of 3)Next steps: 0 of 5 (0 of 2)Approach: 5 of 5
Coding
12.2 of 15 points
Verification
13.1 of 15 points
Communication
10.5 of 15 points

Problem solving

2 of 2

Coding

6½ of 8

Verification

7 of 8

Communication

2 of 3

How they worked

Ran the failing visible test, fixed best-score overwriting, tie ranks and half-point rounding in turn, then added regression tests for each report and a few extras.

Understanding
The candidate opened src/leaderboard.py and ran the visible tournament test, which failed with dev at 70 points instead of 75. They looked at the test and the code, and asked where the bonus logic lived. The assistant pointed them to _points() and to the rank logic in standings().
Plan
Before changing code, the candidate reasoned that record_game was overwriting the stored best score with each new game, and said the stored score should only be replaced when the new score is higher. They then turned to tied ranks and asked whether players on the same points share a rank.
Build
The candidate accepted the assistant's record_game edit first, which fixed the best-score overwrite. Rank fixes followed over several rounds: the candidate moved the rank increment, the assistant and candidate went back and forth on the jump size, and the final version adds the tied group's size after each points group. The rounding bug was handled by changing _points() to a half-up formula, and a top(n) guard for negative n was added. The candidate also wrote tests for each area.
Directing the AI
The candidate often asked the assistant for specific behaviour and data, such as the 50/70/60 scores and the 2-3-4-5 tie layout, but several requests were vague, such as 'ceil' and 'so fix it'. The candidate questioned the assistant's claim that ben should be 5, then the assistant reversed itself, and questioned the 88 expectation. The candidate also asked the assistant to stop comparing top() with standings()[:n], and the assistant agreed. The assistant's early claim that the 43 rounding test would fail was wrong, and the candidate did not catch that until the assistant corrected it.
Turning points
The visible test was first blocked by the best-score overwrite, which was fixed by the record_game edit. Next, the tie ranks were fixed after several rounds of trial and error, and the visible test passed at +15:45. The rounding report was only addressed later, when the candidate pushed back and the assistant changed _points() to a half-up formula.
Verification
The candidate ran the visible test and the full suite after each change, and the suite grew to twelve passing tests. The candidate wrote tests for the rank, best-score, bonus, and top(n) behaviour. The negative-n test failed before its fix at +34:40 and passed at +35:34. The 43-point rounding test does not catch the original bug, and no run against the original code was shown.
Finish
The visible test and all candidate-written tests pass on the final code. The candidate fixed best-score overwriting, tie ranks and half-point rounding, and wrote tests for each report. The 43-point rounding test passes on the original code, so the rounding report is only covered by the 5-point test. No tests were written for the next steps, and the candidate did not answer the end-of-session question. A stronger approach would have checked each new test against the original code, and used the 2.5-bonus case to pin the rounding bug, rather than relying on the assistant's reasoning.