Pre-allocated sampling buffers are max_batch_size (1024) elements large, but kernels
only write the first batch_size elements. sample_weights_ref() and sample_indices_ref()
returned the full 1024-element CudaSlice, causing:
- weight[16] == 0 (uninitialized elements beyond batch_size)
- assert_eq!(indices_host.len(), 10) failing with 1024
Fix: track last_batch_size in GpuReplayBuffer and return CudaView<'_, T> sliced to
last_batch_size from the two ref methods. Update all callers to pass &view to
memcpy_dtoh (CudaView implements DevicePtr so no other API changes needed).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>