Files
metal2vulkan/docs
Anees Iqbal 52ee4de509 rt: a commit takes the Managed ranges named since the last, with commands or none
Before this change, a commit captured the Managed buffers' named ranges only if its command buffer
had commands. A command buffer with nothing for the GPU (no commands, or only dispatches the
runtime elides: a kernel that writes no memory, or a grid with no thread) took no submission. So
its copy-in waited for the next command buffer that did submit, and a program's "upload now"
commit uploaded nothing: the upload slid into its next, timed commit, and the wait on the
upload commit covered no copy.

Now every commit captures. In the submit thread, a command buffer with nothing for the GPU that a
copy-in waits for (Captured::waits_for: the oldest captured at or before its commit number, the
taker rule) leads a group as one with commands does. The copy-in becomes its submission, and it
completes after it. Elided dispatches stay elided. One with nothing named still takes no
submission.

Its other answers keep Metal's empty shape:
- It is scheduled as it joins, with its scheduled handlers run before the submission.
- It retires in flight order, with its completed handlers, Completed status and the wait.
- It writes no timestamp, so its GPU start and end are one time (command::retire's empty branch).
- The copy-in counts in runtime_command_buffers with its own timestamps.

This is within documented Metal: a named range may be taken at any commit after the naming. On an
AMD Radeon Pro 5300M, Metal takes it at the first commit whose encoder binds the buffer. The
runtime takes it at the same commit where that commit binds the buffer, an earlier one where it
binds nothing, and never a later one.

Docs: did_modify_range, the runtime README (the Managed section, the empty command buffer, GPU
times) and docs/API.md's accepted difference. The internal docs in capture.rs and submit.rs are
updated too.

Tests: the two device tests of the previous commit, and a host check of waits_for.
2026-11-21 01:49:57 -08:00
..