I think the error comes from here: `sample_mask` should indeed be initialized with zeroes. It is important in `PresortBestSplitter` (the one used by GBRT).