Skip to content

fix(statistics): credit deaths from authoritative raw_snapshot counter - #21

Merged
Afgan0r merged 1 commit into
masterfrom
fix/deaths-counter-from-artifact
Jun 14, 2026
Merged

Afgan0r merged 1 commit into
masterfrom
fix/deaths-counter-from-artifact

Conversation

@Afgan0r

@Afgan0r Afgan0r commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Root-caused by instrumentation: full-run recalc reads death counters from a stale parser_events table (no player_counter rows for ~90% of sg replays); counter-only deaths (null-killer/suicide/env, no kill-row) dropped. Verified on staging: sg deaths 282720 vs parser d>0 293744 (legacy 297878); gap ≈ nkd 6577 + su 6143. Fix reads counter from authoritative raw_snapshot; one-life cap makes it collapse-safe. Clean of #20's Sentry revert. Post-merge needs ops:stats:recalculate.

…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>
@Afgan0r
Afgan0r merged commit e31b129 into master Jun 14, 2026
3 checks passed
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.

1 participant