current-bench icon indicating copy to clipboard operation
current-bench copied to clipboard

Benchmarks page sometime goes blank while browsing result

Open hhugo opened this issue 7 months ago • 5 comments

Here is the error that pops up in the console when that happens.

vendor.bb0c18a4.js:23 Uncaught 
{RE_EXN_ID: 'Invalid_argument', _1: 'index out of bounds', Error: Error
    at Xf (https://bench.ci.dev/assets/vendor.bb0c18a4.js:32:118954)
    at https://bench.ci.…}
Error
: 
Error at Xf (https://bench.ci.dev/assets/vendor.bb0c18a4.js:32:118954) at https://bench.ci.dev/assets/index.253f21e9.js:1:85390 at https://bench.ci.dev/assets/vendor.bb0c18a4.js:32:141758 at dp (https://bench.ci.dev/assets/vendor.bb0c18a4.js:32:141775) at https://bench.ci.dev/assets/index.253f21e9.js:1:85365 at https://bench.ci.dev/assets/vendor.bb0c18a4.js:32:141758 at dp (https://bench.ci.dev/assets/vendor.bb0c18a4.js:32:141775) at Hl (https://bench.ci.dev/assets/index.253f21e9.js:1:85322) at https://bench.ci.dev/assets/index.253f21e9.js:1:88427 at cf (https://bench.ci.dev/assets/vendor.bb0c18a4.js:32:104569)
RE_EXN_ID
: 
"Invalid_argument"
_1
: 
"index out of bounds"

It currently happens while browsing down in https://bench.ci.dev/ocsigen/js_of_ocaml/branch/master/benchmark/Js_of_ocaml?worker=autumn&image=bench.Dockerfile. The behavior appears and disappears as new commits are pushed.

hhugo avatar Jul 22 '25 11:07 hhugo

Thanks for reporting the issue, @hhugo and apologies for the trouble! I'll try to take a look at it in the next week or so.

punchagan avatar Jul 24 '25 09:07 punchagan

The code seems to be written in rescript, is it available publicly ?

hhugo avatar Jul 24 '25 09:07 hhugo

The code seems to be written in rescript, is it available publicly ?

Yes, this (https://github.com/ocurrent/current-bench/) is the repository where the code lives. It's not the prettiest code, though...

punchagan avatar Jul 24 '25 10:07 punchagan

The page mentioned above now always goes blank when trying to display the "Fiat-Crypto" section. If I fold it, I can see the rest of the page.

hhugo avatar Jul 30 '25 11:07 hhugo

I think the issue is in makeDygraphData

  let n = data->Belt.Array.get(0)->Belt.Option.getWithDefault([])->Belt.Array.length

  // Data passed onto Dygraph looks like array<[idx, value1, value2, ..., stats1, stats2, ...]>
  Belt.Array.range(0, n - 1)->Belt.Array.map(idx =>
    Belt.Array.concatMany([[Obj.magic(idx)], data->Belt.Array.map(d => d[idx]), nullConstantSeries])

The code assumes that elements of data all have the same size.

In my problematic case, I have something like

[Array(81), Array(81), Array(80), Array(80), Array(81), Array(81), Array(81), Array(81), Array(81), Array(81), Array(81), Array(81), Array(81), Array(80), Array(80), Array(81), Array(81), Array(81), Array(81), Array(80), Array(81), Array(81)]   

We try to access the 80th element of all elements with data->Belt.Array.map(d => d[idx]) which fail with Invalid_argument.

hhugo avatar Jul 30 '25 11:07 hhugo