[PR #125] fix: resolve race leaderboard position mismatch (#34) #156

Open
opened 2026-05-07 00:18:57 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/125
Author: @heytt-satra
Created: 12/25/2025
Status: 🔄 Open

Base: mainHead: fix/leaderboard-issue-34


📝 Commits (2)

  • 3209fb8 fix: resolve race leaderboard position mismatch (#34)
  • 7b9d2d6 fix: use official race results for final leaderboard positions

📊 Changes

4 files changed (+65 additions, -34 deletions)

View changed files

📝 main.py (+2 -1)
📝 src/arcade_replay.py (+2 -1)
📝 src/f1_data.py (+33 -1)
📝 src/interfaces/race_replay.py (+28 -31)

📄 Description

Description

Fixed a bug where the race leaderboard displayed incorrect positions at the end of the race.

The issue was caused by:

  1. Telemetry dist (race distance) resetting every lap instead of accumulating.
  2. Leaderboard sorting relying on visual projection which was less accurate than telemetry data.

Changes

  • src/f1_data.py: Updated _process_single_driver to correctly accumulate total_dist_so_far.
  • src/interfaces/race_replay.py: Updated sorting logic to use dist from telemetry.

Verification

Verified by running the 2025 Australia GP replay. The final leaderboard now matches official results.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/125 **Author:** [@heytt-satra](https://github.com/heytt-satra) **Created:** 12/25/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/leaderboard-issue-34` --- ### 📝 Commits (2) - [`3209fb8`](https://github.com/IAmTomShaw/f1-race-replay/commit/3209fb8287598b4065fbc510e7d6ea4c68891b9a) fix: resolve race leaderboard position mismatch (#34) - [`7b9d2d6`](https://github.com/IAmTomShaw/f1-race-replay/commit/7b9d2d6057b19b5d5b1704fa13abc40033b8a52c) fix: use official race results for final leaderboard positions ### 📊 Changes **4 files changed** (+65 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+2 -1) 📝 `src/arcade_replay.py` (+2 -1) 📝 `src/f1_data.py` (+33 -1) 📝 `src/interfaces/race_replay.py` (+28 -31) </details> ### 📄 Description ## Description Fixed a bug where the race leaderboard displayed incorrect positions at the end of the race. The issue was caused by: 1. Telemetry `dist` (race distance) resetting every lap instead of accumulating. 2. Leaderboard sorting relying on visual projection which was less accurate than telemetry data. ## Changes - **src/f1_data.py**: Updated `_process_single_driver` to correctly accumulate `total_dist_so_far`. - **src/interfaces/race_replay.py**: Updated sorting logic to use `dist` from telemetry. ## Verification Verified by running the 2025 Australia GP replay. The final leaderboard now matches official results. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#156
No description provided.