Skip to content

Conversation

@chrisdickinson
Copy link
Contributor

the comp_pivot variables were occasionally being used before being initialized.
the tagged-to-i operation would bail because of NaN being introduced when they
were used.

To test this, I modified the "simple.js" example to work as follows:

var ndarray = require("ndarray")
var ndsort = require("../sort.js")
var unpack = require("ndarray-unpack")

var N = 100000;
var NX = 3;
var NY = 100;
var arrays = [];
//Create an array
for (var z = 0; z < N; ++z) { 
  var x = ndarray(new Float32Array(NY * NX), [NY, NX])

  for(var i=0; i<NY; ++i) {
    for(var j=0; j<NX; ++j) {
      x.set(i,j, Math.random())
    }
  }

  arrays.push(x);
}

//Sort x

for(var i = 0; i < N; ++i) {
  ndsort(arrays[i])
}

The remaining deopts appear to happen due to a combination of OSR and branching preventing full type collection. I roughly backported this patch to v0.10 node to diagnose this. You can apply my patch to a checkout of node v0.10 branch to get that info out of --code-comments.

Also, merry 🎄!

the comp_pivot variables were occasionally being used before being initialized.
the tagged-to-i operation would bail because of NaN being introduced when they
were used.
@mikolalysenko
Copy link
Member

Thanks! I'm gonna look into this and see if I can figure out what is going on.

mikolalysenko added a commit that referenced this pull request May 14, 2015
@mikolalysenko mikolalysenko merged commit ecd004b into scijs:master May 14, 2015
@mikolalysenko
Copy link
Member

Wow! I forgot I had this thing still open. Thank you so much for this!

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