glacials / splits-io

a speedrunning data store and analysis engine
https://splits.io
GNU Affero General Public License v3.0
133 stars 27 forks source link

[Bug?] Missed splits stat appears to be incorrect #191

Closed jhobz closed 9 years ago

jhobz commented 9 years ago

See https://splits.io/5af/stats and compare to https://splits.io/5af. Stats page claims 4 splits were missed but only 2 were. Could it be doubling due to segment length? Or perhaps could there be two splits that were undone and re-split over the course of the run?

glacials commented 9 years ago

Haha you give me too much credit, it was much sillier than that:

|    = split
---  = segment
x:xx = segment duration

run before reducing segments:
 seg1   seg2       seg3 seg4
-------|----------|----|--------|
 1:00   0:00       7:50 1:30

run after reducing segments:
 seg1   seg2 + seg3     seg4
-------|----------~----|--------|
 1:00   7:50            1:30
                  ^ missed split

Thanks for pointing it out, should be fixed now :stuck_out_tongue:

jhobz commented 9 years ago

Haha no worries, see you at SGDQ hopefully!

On Sat, Jul 25, 2015, 5:49 AM Ben Carlsson notifications@github.com wrote:

Haha you give me too much credit, it was much sillier than that:

  • There's a function that reduces a list of segments, with some amount of them having missed splits, into a condensed list of segments where each segment with a missed split is combined into the following segment:

| = split --- = segment x:xx = segment duration

run before reducing segments: seg1 seg2 seg3 seg4 -------|----------|----|--------| 1:00 0:00 7:50 1:30

run after reducing segments: seg1 seg2 + seg3 seg4 -------|----------~----|--------| 1:00 7:50 1:30 ^ missed split

  • To get the (incorrect) number of missed splits in a run, we were subtracting the list of segments this function produces from the list of original segments, expecting to get the list of segments whose splits were missed (seg2)
  • However the segment reducing function changes two segments per missed split -- the segment whose split was missed and the segment following it -- in order to get the resulting combined segment
  • This means that the result of (original segments) - (reduced segments) actually contains the segments on either side of each missed split, instead of just the segments preceding each missed split, making the size of this list two times the number of missed splits
  • That size is what we display on the stats page as the number of missed splits
  • Oops

Thanks for pointing it out, should be fixed now [image: :stuck_out_tongue:]

— Reply to this email directly or view it on GitHub https://github.com/glacials/splits-io/issues/191#issuecomment-124829192.