Skip to content

Port points calculations to rust#190

Open
samayala22 wants to merge 26 commits into
KZGlobalTeam:masterfrom
samayala22:points
Open

Port points calculations to rust#190
samayala22 wants to merge 26 commits into
KZGlobalTeam:masterfrom
samayala22:points

Conversation

@samayala22

@samayala22 samayala22 commented May 9, 2026

Copy link
Copy Markdown

Ported all the points calculation logic to be in-process and in pure Rust.

  • CDF integration using Exp-Sinh method (semi-definite integrals)
  • fitting using reparametrized MLE objective function and optimized using differential evolution + nelder-mead polish

Validation was done in 2 phases:

  1. Verify SF function -> error around 0.03%
  2. Verify fitting process (RMSE + KS metrics) -> between 6% worse to 15% better fit quality

Avg point difference (excluding outliers due to sus outdated fitting data in the api): 30 (3% difference).

Comment thread crates/cs2kz/src/config/points.rs Outdated
Comment thread crates/cs2kz/src/points/calculator.rs Outdated
Comment thread crates/cs2kz/src/points/calculator.rs Outdated
Comment thread crates/cs2kz/src/points/calculator.rs Outdated
Comment thread crates/cs2kz/src/points/calculator.rs Outdated
Comment thread crates/nig/src/distribution.rs Outdated
Comment thread crates/nig/src/distribution.rs Outdated
Comment thread crates/nig/src/distribution.rs Outdated
Comment thread crates/nig/src/fitting.rs Outdated
Comment thread crates/nig/src/fitting.rs Outdated
Comment thread crates/cs2kz/src/points/daemon.rs Outdated
@samayala22 samayala22 marked this pull request as ready for review May 14, 2026 00:37
@samayala22 samayala22 requested a review from AlphaKeks May 14, 2026 00:38

@AlphaKeks AlphaKeks left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good now! Because there's new query macros, you'll have to run cargo sqlx prepare --workspace -- --all-features from the repo root to update the .sqlx/ directory. Those files are used for compile-time query checking when no actual database is available (such as in CI). After that I'll approve a CI run.

I'll also check this against the production dataset later tonight to make sure the results look similar enough, and that perf is good.

Comment thread crates/cs2kz/src/points/daemon.rs Outdated
Comment thread crates/nig/src/fitting.rs Outdated
Comment thread crates/nig/src/fitting.rs Outdated
@samayala22

Copy link
Copy Markdown
Author

Have you checked against the production dataset yet ?

@samayala22 samayala22 requested a review from AlphaKeks June 12, 2026 03:37
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

Successfully merging this pull request may close these issues.

2 participants