Supporter Racing Analysis Tool

MoDuL's Pit Guru

A next-generation Torn racing analysis workspace built from Lap Recorder's lessons, with a public race player, PostgreSQL-backed history, and a v2.3.4 userscript with resilient Prediction car images.

Description

MoDuL's Pit Guru is the next racing project in the hub's supporter line. Its direction is to understand the race while it is happening, not only store what happened after the fact.

The userscript, public race player, and PostgreSQL-backed persistence layer are now live. The build centers on live timing, driver gaps, track-aware sectors, speed and G estimates, safer preview controls, and post-race records grounded in Torn racingData.

Latest updates

Public race player

The public race player is live and can load saved races and replay analysis from the hosted Pit Guru service.

Hosted persistence

The hosted API and player now persist Pit Guru data in PostgreSQL, with pooled connections and backend-aware health checks.

Prediction car images repaired

v2.3.4 loads hosted Pit Guru car assets first, retries Torn's item image when needed, and removes broken-image glyphs cleanly.

Large race performance

Large custom races now let you choose how many drivers are drawn around the focused driver instead of drawing every driver row at once.

Visible background work

Driver Intel sync and hosted race uploads now notify you when they are cached, pending, complete, or failed.

Prediction balance

RS is now the strongest prior; same-track lap times matter at every distance, while frozen forecast errors supply only a bounded correction.

Replay upload improvements

Compact replay uploads pack driver timing data and reuse canonical track segment definitions stored once per track.

What this project is aiming for

Live race analysis

Switch between timing-focused modes such as gaps, sectors, pace, and post-race summary without leaving the current Torn race page.

Safer result visibility

Keep pre-finish result previews behind an explicit setting so the default experience respects the live visual race instead of spoiling it.

Telemetry-style estimates

Use track distance and current-page race timing data to estimate speed, G, and rhythm in a way that is useful without pretending to be official vehicle telemetry.

Lap Recorder lessons carried forward

Records, exports, replay handling, and layout lessons are being carried into a cleaner race-analysis foundation instead of being rebuilt blindly.

Supporter Access

Install Pit Guru v2.3.4, then follow the first-run guided setup to verify your Torn account using a public Torn API key. The key is used only for verification and is never saved in the Pit Guru database.

Race external player:

Every verified account can analyse one race as a demo.
For supporter licensing, join the MoDuL's Hub Discord and run /buylicense in any server channel.

Live infrastructure

  • The public race player loads saved races and replay analysis from the hosted service.
  • Production race, driver, track, garage, fuel, prediction, and replay data is persisted in PostgreSQL.
  • SQLite remains available as a rollback/local fallback while the hosted deployment receives wider testing.

Preview

Interface Screenshots

Preview the race player, live timing workspace, and post-race analysis layout.

Development log

Changelog

This page tracks the current userscript build, public player, hosted persistence work, and export examples.

Current status - July 30, 2026
  • The public race player is now live at pp-api.sokin.xyz/pit-guru/.
  • The hosted API and player now persist Pit Guru data in PostgreSQL, with pooled connections and backend-aware health checks.
  • The public Settings panel has been cleaned up to keep normal user controls front and centre.
  • Performance presets now update every Performance & Scan Timers control, and the timer textboxes use Pit Guru theme styling.
  • Hosted API calls, account verification, player race checks, and race uploads now retry transient failures with exponential backoff.
  • Repeated hosted read calls use a short TTL cache.
  • Hosted session storage is standardized on RT_TORN_MPG_HOSTED_SESSION, with legacy RT_TORN_LTL_HOSTED_SESSION cleanup.
  • The pre-race countdown now occupies the racingData status line, while Past Races uses a scoped title and compact help button.
  • The public proxy now accepts full racingData analysis payloads, and destructive Records deletion requires an admin token.
  • The v2.3.4 userscript repairs car images in Predictions and Past Races with hosted assets, a Torn fallback, and clean failure handling.
  • The v2.3.3 userscript opens Records Race IDs directly in the configured Pit Guru Player instead of returning to Torn.
  • The v2.3.2 userscript uses Torn's visible custom lap count for current-race metadata and race length, and improves predictions with skill, same-track lap pace, field-normalized finishes, and bounded signed-error learning.
  • v2.2.4 added pgPerformanceCleanSlate() for reproducible cold-cache tests without deleting credentials, licence/session state, settings, or layout.
  • v2.2.3 fixed duplicate racingData capture, repeated empty pre-race builds, duplicate interval decoding, and direct timer-driven full rendering.
  • HTML report export now stays disabled until the live race has finished or the page is a replay, preventing early full-result report generation.
  • Completed-race HTML reports now include a Race Overview, Full Race Data table, start/finish deltas, final gaps, sector summaries, lead stats, speed, G, and consistency.
  • Same-race page refresh now warm-restores cached heavy-race data and then validates fresh Torn racingData before suppressing expensive rebuilds.
  • Phase 6-7 adds bounded persistent cache cleanup, capped heavy-race IndexedDB storage, page lifecycle cleanup, final validation, and refreshed hosted install artifacts.
  • Phase 3-5 of the performance rewrite adds normalized race indexes, cached replay frame rows, bounded telemetry prefix stats, sector snapshots, and shared frame-state render paths.
  • Phase 0-2 of the performance rewrite adds render/build profiling, bounded race-data caches, render coalescing, replay-state foundations, and worker-backed heavy-race lead/sector aggregates.
  • Live overtake counting now advances incrementally instead of recalculating from race start on every update.
  • Predictions stays stable after racingData is captured, including when the shared renderer passes elapsed-time refresh arguments.
  • Big Race Mode now stores raw racingData once per race/signature in IndexedDB and stores compact processed summaries separately.
  • Heavy summary generation uses a Web Worker when available, and Driver Intel profile cache entries deduplicate by driverId.
  • Finished or cached Big Races pause the join-race MutationObserver path after Pit Guru has the data.
  • The main Pit Guru window and detached Records pop-out now resize from an explicit Pit Guru grip instead of browser-native CSS resizing.
  • Floating-window resize handling now treats the right and bottom resize edges as resize gestures, preventing snap-back after moving the window left.
  • The public player now has gap-aware commentary, a saved-race dropdown, duplicate upload checks, and smoother replay loading from cached racingData.
  • Large custom races now expose a Settings control for the focused driver window, avoiding full 100-driver table redraws while keeping full race data internally.
  • Driver Intel sync and hosted race uploads now show visible notifications for cached, pending, complete, and failed states.
  • Predictions now blend RS, global race record, experience, track/car history, and risk with confidence weighting so thin track history does not dominate.
  • Compact replay uploads pack driver timing data and reuse canonical track segment definitions stored once per track.
v1.8.9 - New-race Player readiness
  • New races now open on Predictions while Player stays locked until replay-ready racingData arrives, then highlights yellow for 10 seconds.
  • The userscript now carries an explicit copyright and All Rights Reserved notice.
v1.8.8 - Userscript page matching
  • Replaced the regular-expression racing-page include with a normal URL glob, removing the userscript-manager performance warning while retaining racingData replay support.
v1.8.7 - First-run setup and guided tour
  • Compare the selected enlisted-car instance against a second garage car.
  • Mirrored stat bars and directional differences cover performance, surface indices, race history, mileage, worth, upgrades, points, and fuel economy.
v1.8.4 - Replay and large-field stability
  • Fixed racingData replay URLs, official-event Auto-clear, race-transition metadata flicker, and large-field analysis hot paths.
  • Verified accounts save player settings in PostgreSQL without saving the public Torn API key.
  • Inactive accounts receive one race as a demo; active access is reported with its expiration time.
  • Recent saved exports show the ongoing analysis iteration across multiple tracks instead of a single early prototype branch.
  • The current build direction still includes race-analysis modes, preview gating, smoothing, track metadata, and migration-aware foundations from Lap Recorder.
  • The goal remains a stronger analysis-first racing tool rather than another lap-capture clone.
Release direction
  • Use only race data already delivered to the currently viewed Torn page.
  • Keep result previews gated by default until the race finishes, unless the user explicitly enables preview mode.
  • Carry forward useful local records and export ideas only where they still serve the new race-analysis core.