better support for variable batch size and sim len