replay: the granule rounding reaches the places the tip added: the aside, and both GPU copies of a two-copy Managed buffer

The rounding commit was written before the aside and the two-copy Managed GPU copies took places;
they passed no granule and did not compile. The aside is the play's own (no recorded slack), a GPU
copy takes its buffer's recorded granule. Check follows.
This commit is contained in:
Anees Iqbal committed 2026-11-18 14:53:10 -08:00
1 parent 40e135c308
commit d62a2ee35b
2 files changed
+18 -11

No files matched your search

@@ -381,7 +381,8 @@ impl NewRuntime {
let completed = self.completed();
let (places, device) = (&mut self.places, &self.device);
self.asides.read_back(object, length, |length| {
let place = places.take(rt::MemoryClass::Shared, length, completed);
// The play's own aside: no recorded slack.
let place = places.take(rt::MemoryClass::Shared, length, granule(None), completed);
let place = place.map_err(failed(call))?;
let buffer = device.new_buffer(place.block, place.range.start, length, Some(0));
Ok((buffer.map_err(failed(call))?, place))
@@ -932,11 +932,12 @@ impl NewRuntime {
let shared = shared.map_err(failed(call))?;
write_into(&shared, 0, bytes)?;
let copied = bytes.len() as u64;
// The GPU copy, placed as a Private buffer of its length is.
let copy = (self
.places
.take(rt::MemoryClass::Private, length, completed))
.map_err(failed(call))?;
// The GPU copy, placed as a Private buffer of its length is, with the same slack.
let copy =
(self
.places
.take(rt::MemoryClass::Private, length, recorded, completed))
.map_err(failed(call))?;
let at = (copy.block, copy.range.start);
let managed =
(self.device).new_managed_buffer((block, start), Some(at), length, copied);
@@ -1555,11 +1556,16 @@ impl NewRuntime {
}
ManagedCopies::Two => {
let completed = self.completed();
let place =
(self
.places
.take(rt::MemoryClass::Private, length, completed))
.map_err(failed(call))?;
// The GPU copy keeps the slack the buffer had in the recording.
let recorded =
granule(call.answer("gpuAddress").and_then(Value::as_address));
let place = (self.places.take(
rt::MemoryClass::Private,
length,
recorded,
completed,
))
.map_err(failed(call))?;
let copy_at = (place.block, place.range.start);
copy = Some(place);
device.new_managed_buffer(