get_sample_slice uses integer max_val