Repository navigation
fix(statistics): credit deaths from authoritative raw_snapshot counter - #21
Merged
Merged
Conversation
…unter The bulk full-run recalc reads the per-player death counter from the parser_events table, but full-run never re-persists parser_events from raw_snapshot (only the single-replay audit path does). ~90% of sg replays have 0 player_counter rows in parser_events while raw_snapshot carries the compact counters, so a death with no independent victim kill-row (null-killer / suicide / environmental, d>0) is dropped from both death paths — games are counted (built from raw_snapshot) but the death is lost. Verified on staging: sg deaths 282720 vs parser's own d>0 signal 293744 (legacy 297878); the gap ≈ sg null-killer+suicide death-events (nkd 6577 + su 6143). Fix: resolvedPlayers attaches counterDeaths from the authoritative raw_snapshot (artifact player.d/td); the service folds it into the per-replay scratch alongside the event paths. The one-life cap (foldCappedDeaths, <=1 death & <=1 by_teamkills per replay) is unchanged, so it is collapse-safe (no double-count) and by_teamkills<=total holds. Games, parser/OCAP contract, schema and API untouched. Clean extraction of the deaths fix only — the debug branch's unrelated Sentry revert is excluded. Needs ops:stats:recalculate post-deploy to materialize the numbers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root-caused by instrumentation: full-run recalc reads death counters from a stale
parser_eventstable (noplayer_counterrows for ~90% of sg replays); counter-only deaths (null-killer/suicide/env, no kill-row) dropped. Verified on staging: sg deaths 282720 vs parserd>0293744 (legacy 297878); gap ≈ nkd 6577 + su 6143. Fix reads counter from authoritativeraw_snapshot; one-life cap makes it collapse-safe. Clean of #20's Sentry revert. Post-merge needsops:stats:recalculate.