7 Commits

Author SHA1 Message Date
534d293be4 Fix remaining dual-rating issues in email templates
- Email chart: single unified ELO chart instead of separate singles/doubles
- Email leaderboard: single unified leaderboard
- Removed duplicate top_doubles query (was identical to top_singles anyway)
2026-02-26 12:51:35 -05:00
b174da3dc5 Add comprehensive test suite: 75 tests (ELO, DB, integration, handlers) 2026-02-26 12:47:51 -05:00
666589e18c Complete ELO system overhaul: unified charts, individual rating changes, about page
- Charts: Single unified ELO chart instead of separate singles/doubles
- Match history: Shows individual player rating changes (not just team)
- About page: Full explanation of rating system with examples
- Nav: Added About link, shortened button text for mobile
- Cleaned up unused variables
2026-02-26 12:33:38 -05:00
e6cc881a36 Complete unified ELO migration: home page explanation, single leaderboards, edit form 2026-02-26 12:28:02 -05:00
1116e36a00 Update daily summaries to show unified ELO change instead of separate singles/doubles 2026-02-26 12:24:48 -05:00
539c1c9d08 Update player list and profile pages to show unified ELO rating 2026-02-26 12:22:17 -05:00
9ae1bd37fd Refactor: Implement all four ELO system improvements
CHANGES:

1. Replace arbitrary margin bonus with per-point expected value
   - Replace tanh formula in score_weight.rs
   - New: performance = actual_points / total_points
   - Expected: P(point) = 1 / (1 + 10^((R_opp - R_self)/400))
   - Outcome now reflects actual performance vs expected

2. Fix RD-based distribution (backwards logic)
   - Changed weight from 1.0/rd² to rd²
   - Higher RD (uncertain) now gets more change
   - Lower RD (certain) gets less change
   - Follows correct Glicko-2 principle

3. Add new effective opponent calculation for doubles
   - New functions: calculate_effective_opponent_rating()
   - Formula: Eff_Opp = Opp1 + Opp2 - Teammate
   - Personalizes rating change by partner strength
   - Strong teammate → lower effective opponent
   - Weak teammate → higher effective opponent

4. Document unified rating consolidation (Phase 1)
   - Added REFACTORING_NOTES.md with full plan
   - Schema changes identified but deferred
   - Code is ready for single rating migration

All changes:
- Compile successfully (release build)
- Pass all 14 unit tests
- Backwards compatible with demo/example code updated
- Database backup available at pickleball.db.backup-20260226-105326
2026-02-26 10:58:10 -05:00