Where do you allocate `sample_mask` now? I can't find it in your changes.