RUNTIME 2459: Joined completions: a command buffer marked to join the next groups under Exact
CommandBuffer::set_completion_joins_next marks a command buffer, before its commit, as one whose completion may be seen with the next one's. Under CompletionPolicy::Exact, on a device whose merge check holds and whose queues are not relayed, a marked command buffer's batches wait in the scheduler's group as every batch does under Grouped. The first batch of the VkQueue behind them that is not marked goes last in that group, which then goes at once (GroupEnd::Closed, WorkCounts::group_ends_closed), so it is seen complete at its own end and never held back. Its submission check runs with the marked ones' (check_heads), so they are found ready together. No group is kept past its pass under Exact (Alone::Unkept, WorkCounts::batches_held_alone_unkept): a kept group can reach the GPU after the work ahead of it ended, which would delay the unmarked one behind it. Everywhere else (Grouped, no merge, relayed queues, the encoder trail, batches that never group) the mark changes nothing. Why: on the Iris Xe, ANV on i915 lists every VkDeviceMemory in each execbuffer, about 170-190 us of driver time a vkQueueSubmit at the consumer's import count, and the consumer cuts each guest command buffer into about 12 parts committed under Exact, one kernel submission each. In its walk the GPU sat idle about 1.5 ms per waited guest buffer between parts already committed, behind a backlog of those calls. The consumer will mark every part but the last of a cut whose completion nothing observes. Grouped-completion's notice, docs/API.md's catalogue, FAST-PATHS row 38, the runtime README, CompletionPolicy::Exact's doc, api_signatures and REFUSALS say so. Tests: runtime_lane::joined_completions (marked parts group and a group is closed by the last; checked parts too; a no-op where the device's own check finds no merge; unmarked parts go alone; an unmarked command buffer is seen complete while the long one behind it still runs, the marked one before it complete by then), on lavapipe with the merge assumed. Joined completions: the cost table's length, and the order test's first work done before The conformance cost table's SHARED list holds 36 rows with batches_held_alone_unkept. In the order test the marked command buffer took the new buffers' first work, which no batch in a group takes, so it went alone and nothing grouped: the buffers' first work now runs before it. Verified: clippy and lavapipe lane job m3-max-36769 showed the failure (grouped 0 with grouping true); the rerun is the next job. Verified at 8e6c37c263: m3-max-36784 (msi) clippy --workspace --all-targets --all-features 0; m3-max-36785 (msi, lavapipe, --cfg m2v_cpu_icd) joined_completions + grouped_submissions + alone_batches 21/21 (marked parts under Exact with the merge: 7 command buffers in 2 submissions; unmarked: 7 submissions, 0 grouped; lavapipe's own merge check, not Holds: 0 grouped; an unmarked buffer is seen complete at its own end). The Iris merge check answers Holds (m3-max-36725: 9.6 us in one call of 4 against 26.4 us apart). Release-mode lavapipe, clippy --cfg m2v_gpu and m2v_cpu_icd and rustdoc run after the merge.
This commit is contained in:
1 parent
03e5c2fd24
commit
3de483d86f
20 files changed
+561
-66
No files matched your search
@@ -718,7 +718,7 @@ pub fn monotone(name: &str) -> Option<&'static str> {
|
||||
/// truncated and it reran. The other read the counters behind its own movements and found every one
|
||||
/// of them process-shared. Neither symptom could be read off a single run, which is the property
|
||||
/// that makes this class worth naming rather than discovering again.
|
||||
const SHARED: [(&str, &str); 35] = [
|
||||
const SHARED: [(&str, &str); 36] = [
|
||||
// `work_counts.rs`: "every batch, by how far its queue's work ran behind its submission".
|
||||
// Four buckets of one histogram, and which bucket a batch lands in is decided by how fast the
|
||||
// GPU drained what was submitted before it, earlier cases included. The sum is the case's own
|
||||
@@ -757,6 +757,7 @@ const SHARED: [(&str, &str); 35] = [
|
||||
("batches_held_alone_kept", QUEUE_DEPTH),
|
||||
("batches_held_alone_sent_by_next", QUEUE_DEPTH),
|
||||
("batches_held_alone_other", QUEUE_DEPTH),
|
||||
("batches_held_alone_unkept", QUEUE_DEPTH),
|
||||
// "found a submission holding its place in the submissions' order and waited until that
|
||||
// submission was made", on a device that cannot write heap sets while a command buffer binding
|
||||
// them is pending. Whether a registration finds a submission holding the order is a race with
|
||||
|
||||
@@ -688,6 +688,18 @@ Calls Metal does not have, for a consumer that emulates a Metal device:
|
||||
that one, as Metal's completion follows the GPU's). It must be short and never
|
||||
block; a wait in it for what has not happened is refused
|
||||
(`DeadlockCause::CompletionSeenHandler`).
|
||||
- `CommandBuffer::set_completion_joins_next` marks a command buffer, before its commit, as one
|
||||
whose completion may be seen with the next one's: under `CompletionPolicy::Exact`, on a device
|
||||
whose submissions merge (`Device::submissions_merge`) and whose queues' failures are not relayed,
|
||||
its batches may wait in the scheduler's group as every batch does under
|
||||
`CompletionPolicy::Grouped`, so up to four batches of one `VkQueue` found ready together in one
|
||||
pass go in one kernel submission, the first command buffer behind them that is not marked going
|
||||
last in it and seen complete at its own end. The marked one is seen complete, and its event
|
||||
signals reached, once the last of that submission completed (late by the GPU time of at most
|
||||
three batches after it); the submission checks of the batches right behind it run with its own;
|
||||
no group is kept past its pass under `Exact`, and an unmarked command buffer is never held back
|
||||
for one. Announced `grouped-completion` once. A no-op elsewhere: under `Grouped`, on a device
|
||||
whose check did not find the merge, and for a batch that never groups. No Metal counterpart.
|
||||
- `CommandBuffer::commit_and_submit` commits as `commit` does, then submits on the calling thread
|
||||
where no other submission pass is under way: the ready command buffers in commit order, this
|
||||
one among them, each needing no host step and no switch of a storage form, up to the pass's
|
||||
|
||||
@@ -1680,6 +1680,7 @@ impl Gpu for Runtime {
|
||||
("group_ends_drained", c.group_ends_drained),
|
||||
("group_ends_checks", c.group_ends_checks),
|
||||
("group_ends_held", c.group_ends_held),
|
||||
("group_ends_closed", c.group_ends_closed),
|
||||
("batches_with_none_pending", c.batches_with_none_pending),
|
||||
("batches_with_one_pending", c.batches_with_one_pending),
|
||||
(
|
||||
|
||||
@@ -11,6 +11,14 @@
|
||||
//! submits. Each command buffer of a group is exact on every driver by Vulkan's own rules (the
|
||||
//! bullets below), so the check decides only where grouping pays.
|
||||
//!
|
||||
//! - **Marked under `CompletionPolicy::Exact`.** Under `Exact`, a batch waits here only where
|
||||
//! its command buffer is marked to join the next ([`CommandBuffer::set_completion_joins_next`]);
|
||||
//! the first batch of its `VkQueue` found ready behind such batches in the same pass that is not
|
||||
//! marked may go last in their group (`CommandBufferShared::closes_groups`), and the group then
|
||||
//! goes at once (`GroupEnd::Closed`), that batch's own signals ending it, so it is seen complete
|
||||
//! at its own end and held back for nothing. No group is kept past its pass under `Exact`
|
||||
//! ([`Group::keeps`], `Alone::Unkept`): a kept group may reach the GPU after the work ahead of
|
||||
//! it ended, which would make the unmarked batch behind it complete later.
|
||||
//! - **What waits.** A batch the scheduler submits waits here, submitted by nothing yet, where it
|
||||
//! signals nothing but its queue's timeline and its events' semaphores: no binary semaphore,
|
||||
//! no fence; binds no sparse update; does no first work; moves none of the caller's wrapped
|
||||
@@ -125,10 +133,10 @@
|
||||
//! (`runtime_lane::frame_costs`, `a_frame_s_commits_allocate_within_their_bound`).
|
||||
|
||||
use super::submit::Submission;
|
||||
use super::{submission_error, CommandBufferShared};
|
||||
use super::{submission_error, CommandBuffer, CommandBufferShared};
|
||||
use crate::degradation::{Degradation, NoticesFor};
|
||||
use crate::device::relay::Relayed;
|
||||
use crate::error::CommandBufferError;
|
||||
use crate::error::{invalid, CommandBufferError, Error, Problem};
|
||||
use crate::exit_guard::{self, Call};
|
||||
use crate::gpu_time;
|
||||
use crate::submit_failure::{submit_failed, try_lock, Carried, Failed, TypeFlags};
|
||||
@@ -157,25 +165,113 @@ const BATCH_INFOS: usize = 2;
|
||||
/// held, and for the batch after them its first work's beside its own.
|
||||
const MOST_INFOS: usize = GROUP_BATCHES * BATCH_INFOS + 1 + BATCH_INFOS;
|
||||
|
||||
/// Whether `device`'s batches on `VkQueue` `queue` may wait in a group: its policy groups them,
|
||||
/// its check found a submission that signals nothing merged into the next (the module docs),
|
||||
/// the queue's failures are not relayed (each relayed batch takes a fence, `device/relay.rs`),
|
||||
/// and its encoder trail is off (`encoder_trail.rs`: each batch goes alone).
|
||||
pub(crate) fn groups(device: &Device, queue: usize) -> bool {
|
||||
device.compile_device().policy().completion == CompletionPolicy::Grouped
|
||||
&& device.submissions_merge_now()
|
||||
/// Whether `device`'s batches on `VkQueue` `queue` may go to the driver in one kernel submission
|
||||
/// at all: its check found a submission that signals nothing merged into the next (the module
|
||||
/// docs), the queue's failures are not relayed (each relayed batch takes a fence,
|
||||
/// `device/relay.rs`), and its encoder trail is off (`encoder_trail.rs`: each batch goes alone).
|
||||
pub(crate) fn merges(device: &Device, queue: usize) -> bool {
|
||||
device.submissions_merge_now()
|
||||
&& device.shared().flights(queue).is_none()
|
||||
// The encoder trail submits each batch alone (`encoder_trail.rs`).
|
||||
&& !device.shared().encoder_trail
|
||||
}
|
||||
|
||||
/// Whether every batch of `device`'s on `VkQueue` `queue` may wait in a group: its policy groups
|
||||
/// them (`CompletionPolicy::Grouped`) and they merge ([`merges`]). Under `CompletionPolicy::Exact`
|
||||
/// only a command buffer marked to join the next may (`CommandBufferShared::groups`).
|
||||
pub(crate) fn groups(device: &Device, queue: usize) -> bool {
|
||||
device.compile_device().policy().completion == CompletionPolicy::Grouped
|
||||
&& merges(device, queue)
|
||||
}
|
||||
|
||||
impl CommandBuffer {
|
||||
/// Mark the command buffer's completion as joining the next one's: a runtime extension, no
|
||||
/// Metal call (the crate's README, "Runtime extensions"). Metal has no counterpart; it reports
|
||||
/// each command buffer complete at its own end. Under `CompletionPolicy::Exact`, on a device
|
||||
/// whose batches merge (the device's check found one `vkQueueSubmit` of `VkSubmitInfo`s that
|
||||
/// signal nothing to cost about one of its submissions, `Device::submissions_merge`; its
|
||||
/// queue's failures not relayed), a batch of a marked command buffer may wait in the
|
||||
/// scheduler's group as `CompletionPolicy::Grouped` lets every batch wait
|
||||
/// (`command_buffer/group.rs`): up to four batches of one `VkQueue` found ready together go
|
||||
/// in one kernel submission, only the last signalling. A batch of a command buffer not
|
||||
/// marked never waits in a group, and is never held back for one: it may go last in the
|
||||
/// group held before it, in the same pass and the same call, which then goes at once, and it
|
||||
/// is seen complete at its own end, as alone. No group is kept past the pass that found it
|
||||
/// under `Exact` (`CompletionPolicy::Grouped` keeps one while earlier work of its queue
|
||||
/// runs), so no marked batch waits for later work to be committed.
|
||||
///
|
||||
/// What it delays: the marked command buffer is seen complete (its status, completed
|
||||
/// handlers and waits), and the event values it signals are reached, once the last batch of
|
||||
/// its kernel submission completed: late by the GPU time of the batches after it there, at
|
||||
/// most three, never early and in commit order. Its submission waits for the next batch of
|
||||
/// its queue found ready in the same pass of the scheduler, at most that pass. The
|
||||
/// submission checks of the batches right behind it, the first one not marked among them, run
|
||||
/// with its own, before its submission, so that they are found ready together; each still
|
||||
/// runs once, in commit order, before its own batch's submission. Its commands, barriers and
|
||||
/// GPU times are unchanged. The device announces `Degradation::GroupedCompletion` once, at its
|
||||
/// first such submission.
|
||||
///
|
||||
/// It changes nothing where it cannot apply: under `CompletionPolicy::Grouped`, which groups
|
||||
/// every batch already; on a device whose check did not find submissions merged, has not
|
||||
/// answered, or relays its queues' failures (MoltenVK); with the encoder trail on; and for a
|
||||
/// batch that groups in no case (it signals or waits for a binary semaphore, takes a fence,
|
||||
/// binds a sparse update, does first work, or is an unshared queue's on a `VkQueue` other
|
||||
/// queues' work is held back for it). Counted: `WorkCounts::grouped_submissions`,
|
||||
/// `WorkCounts::batches_grouped`, `WorkCounts::group_ends_closed` and kin.
|
||||
///
|
||||
/// Refused, changing nothing, once the command buffer is committed (`Invalid`,
|
||||
/// `Problem::AlreadyCommitted`).
|
||||
pub fn set_completion_joins_next(&self, joins: bool) -> Result<(), Error> {
|
||||
let state = self.state();
|
||||
if state.enqueued() || state.committing {
|
||||
return Err(invalid(
|
||||
"set_completion_joins_next",
|
||||
Problem::AlreadyCommitted,
|
||||
));
|
||||
}
|
||||
match joins {
|
||||
true => self.0.group_hold.fetch_or(JOINS_NEXT, Ordering::SeqCst),
|
||||
false => self.0.group_hold.fetch_and(!JOINS_NEXT, Ordering::SeqCst),
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl CommandBufferShared {
|
||||
/// Whether its batches may wait in a group ([`groups`]): never an unshared queue's on a
|
||||
/// `VkQueue` other queues' work is held back from (the module docs).
|
||||
/// Whether its batches may wait in a group: every batch where its queue's batches group
|
||||
/// ([`groups`]), and under `CompletionPolicy::Exact` those of a command buffer marked to join
|
||||
/// the next where they merge ([`merges`], [`CommandBuffer::set_completion_joins_next`]); never
|
||||
/// an unshared queue's on a `VkQueue` other queues' work is held back from (the module docs).
|
||||
pub(crate) fn groups(&self) -> bool {
|
||||
let queue = self.queue.vk_queue();
|
||||
groups(&self.device, queue)
|
||||
&& !(self.queue.unshared() && self.device.holds_back_for_unshared(queue))
|
||||
let may = match self.joins_next() {
|
||||
true => merges(&self.device, queue),
|
||||
false => groups(&self.device, queue),
|
||||
};
|
||||
may && self.not_held_apart(queue)
|
||||
}
|
||||
|
||||
/// Whether a batch of it that waits in no group ([`groups`](Self::groups)) may still go last
|
||||
/// in the group held before it on its `VkQueue`, which then goes at once: its batches merge
|
||||
/// ([`merges`]), and it is no unshared queue's on a `VkQueue` other queues' work is held back
|
||||
/// from. So under `CompletionPolicy::Exact` the command buffer right behind marked ones goes
|
||||
/// in their kernel submission, seen complete at its own end
|
||||
/// ([`CommandBuffer::set_completion_joins_next`]).
|
||||
pub(crate) fn closes_groups(&self) -> bool {
|
||||
let queue = self.queue.vk_queue();
|
||||
merges(&self.device, queue) && self.not_held_apart(queue)
|
||||
}
|
||||
|
||||
/// Whether it is not an unshared queue's on `VkQueue` `queue` while other queues' work is held
|
||||
/// back there for it, whose batches never wait in a group (the module docs).
|
||||
fn not_held_apart(&self, queue: usize) -> bool {
|
||||
!(self.queue.unshared() && self.device.holds_back_for_unshared(queue))
|
||||
}
|
||||
|
||||
/// Whether it is marked to join the next ([`CommandBuffer::set_completion_joins_next`]): set
|
||||
/// before its commit, read after it.
|
||||
fn joins_next(&self) -> bool {
|
||||
self.group_hold.load(Ordering::SeqCst) & JOINS_NEXT != 0
|
||||
}
|
||||
|
||||
/// Whether a committing thread submits a batch of it that may wait in a group
|
||||
@@ -250,6 +346,10 @@ const IN_GROUP: u8 = 1;
|
||||
/// A command buffer's `group_hold` bit: a thread waits for its completion.
|
||||
const WAITED_FOR: u8 = 2;
|
||||
|
||||
/// A command buffer's `group_hold` bit: it is marked to join the next
|
||||
/// ([`CommandBuffer::set_completion_joins_next`]).
|
||||
const JOINS_NEXT: u8 = 4;
|
||||
|
||||
/// Whether a batch of expected run `run` (nanoseconds; `None` where its queue has none yet) may
|
||||
/// join batches whose expected runs sum to `held`: its run is known and the sum stays within
|
||||
/// [`GROUP_RUN`] (the module docs, "Bounded by its expected run").
|
||||
@@ -280,6 +380,9 @@ pub(crate) enum GroupEnd {
|
||||
Checks,
|
||||
/// The pass found none ready, the rest held for events, gates, binary semaphores or decodes.
|
||||
Held,
|
||||
/// A batch of a command buffer not marked to join the next went last in it under
|
||||
/// `CompletionPolicy::Exact` ([`CommandBuffer::set_completion_joins_next`]): it goes at once.
|
||||
Closed,
|
||||
}
|
||||
|
||||
/// Why a batch on a `VkQueue` whose batches group ([`groups`]) went in a kernel submission of its
|
||||
@@ -331,11 +434,15 @@ pub(crate) enum Alone {
|
||||
SentByNext,
|
||||
/// Held; a switch of storage forms rides on it, or the device was lost.
|
||||
Other,
|
||||
/// Held, of a command buffer marked to join the next under `CompletionPolicy::Exact`
|
||||
/// ([`CommandBuffer::set_completion_joins_next`]); the pass found no batch ready, and no
|
||||
/// group is kept under `Exact`.
|
||||
Unkept,
|
||||
}
|
||||
|
||||
impl Alone {
|
||||
/// How many there are, for the counters' array.
|
||||
pub(crate) const COUNT: usize = 18;
|
||||
pub(crate) const COUNT: usize = 19;
|
||||
}
|
||||
|
||||
/// One `VkSubmitInfo`'s lists, kept with their room from batch to batch.
|
||||
@@ -393,6 +500,9 @@ pub(crate) struct Group {
|
||||
members: Vec<Member>,
|
||||
/// It stayed held past a pass for the work its queue ran ([`keeps`](Group::keeps)).
|
||||
kept: bool,
|
||||
/// Its last batch held is of a command buffer not marked to join the next, under
|
||||
/// `CompletionPolicy::Exact` ([`closed`](Group::closed)).
|
||||
closed: bool,
|
||||
/// The completed values `queue` waited for before the first batch held: put back where the
|
||||
/// group's submission fails.
|
||||
waited: Vec<u64>,
|
||||
@@ -466,6 +576,13 @@ impl Group {
|
||||
self.members.len() >= GROUP_BATCHES
|
||||
}
|
||||
|
||||
/// Whether its last batch held is of a command buffer that waits in no group, which went last
|
||||
/// in it ([`CommandBufferShared::closes_groups`]): the scheduler submits it at once, so that
|
||||
/// batch is held back for nothing.
|
||||
pub(crate) fn closed(&self) -> bool {
|
||||
self.closed
|
||||
}
|
||||
|
||||
/// A batch on `VkQueue` `queue` is held, before its submission changes the scheduler's
|
||||
/// state: `waited` is what `queue` waited for so far, put back where the group's submission
|
||||
/// fails. Its lists come once its changes are made ([`hold`](Group::hold)).
|
||||
@@ -486,8 +603,9 @@ impl Group {
|
||||
infos: &[InfoParts<'_>],
|
||||
buffers: usize,
|
||||
submission: Submission,
|
||||
run: u64,
|
||||
(run, closes): (u64, bool),
|
||||
) {
|
||||
self.closed = closes;
|
||||
for (semaphore, index) in submission.event_signals() {
|
||||
match self.events.iter_mut().find(|(held, ..)| *held == semaphore) {
|
||||
Some((_, lowest, highest)) => {
|
||||
@@ -540,6 +658,11 @@ impl Group {
|
||||
{
|
||||
return Err(Alone::Other);
|
||||
}
|
||||
// Under `Exact` its batches are of command buffers marked to join the next, which wait for
|
||||
// no later commit (`CommandBuffer::set_completion_joins_next`).
|
||||
if device.compile_device().policy().completion != CompletionPolicy::Grouped {
|
||||
return Err(Alone::Unkept);
|
||||
}
|
||||
if device.holds_back_for_unshared(self.queue) {
|
||||
return Err(Alone::UnsharedHold);
|
||||
}
|
||||
@@ -620,6 +743,7 @@ impl Group {
|
||||
let count = self.members.len();
|
||||
let alone = after.is_none();
|
||||
self.kept = false;
|
||||
self.closed = false;
|
||||
let held_value = self.members[count - 1].submission.value();
|
||||
// The held batches' end: each event's semaphore to the highest index a batch held
|
||||
// signals it to, then the queue's timeline to the last one's value. It ends the
|
||||
|
||||
@@ -475,6 +475,15 @@ impl CommandBufferShared {
|
||||
// nothing changed, for the group to go first. Its event signals ride to the group's end;
|
||||
// a wait for an event a batch held signals, which only that end meets, goes after it.
|
||||
let met = (event_waits.iter()).any(|&wait| scheduler.group.meets(wait));
|
||||
// Whether it may wait in a group, or else go last in the one held on its `VkQueue`, which
|
||||
// then goes at once: under `CompletionPolicy::Exact`, a command buffer not marked to join
|
||||
// the next behind marked ones (`CommandBuffer::set_completion_joins_next`), seen complete
|
||||
// at its own end.
|
||||
let holds = self.groups();
|
||||
let closes = !holds
|
||||
&& scheduler.group.holds()
|
||||
&& scheduler.group.queue() == queue
|
||||
&& self.closes_groups();
|
||||
// A batch whose work a segment cut into pieces goes in a submission of its own, whose
|
||||
// pieces are `VkSubmitInfo`s of their own (below).
|
||||
let pieced = (state.recorded[state.batch_range(index)].iter())
|
||||
@@ -489,7 +498,7 @@ impl CommandBufferShared {
|
||||
(state.recorded[state.batch_range(index)].iter())
|
||||
.any(|recorded| !recorded.sparse.is_empty())
|
||||
};
|
||||
if !self.groups() {
|
||||
if !holds && !closes {
|
||||
Some(Alone::Unshared)
|
||||
} else if !sync.binary_waits.is_empty() {
|
||||
Some(Alone::BinaryWait)
|
||||
@@ -514,7 +523,7 @@ impl CommandBufferShared {
|
||||
// Where its `VkQueue`'s batches group at all, why it goes alone if it goes with no group
|
||||
// held: what refuses it, or its run, else first work or a wrapped image (found below),
|
||||
// else a committing thread's submission (`WorkCounts::batches_alone_unshared` and kin).
|
||||
let counts_alone = super::group::groups(device, queue);
|
||||
let counts_alone = super::group::groups(device, queue) || holds;
|
||||
let alone_for = refused.or(match run {
|
||||
None => Some(Alone::RunUnknown),
|
||||
Some(_) if !fits => Some(Alone::RunLong),
|
||||
@@ -1718,7 +1727,7 @@ impl CommandBufferShared {
|
||||
};
|
||||
scheduler
|
||||
.group
|
||||
.hold(parts, buffers, submission, run.unwrap_or(0));
|
||||
.hold(parts, buffers, submission, (run.unwrap_or(0), closes));
|
||||
Ok(Submitting::Grouped)
|
||||
}
|
||||
|
||||
|
||||
@@ -2225,7 +2225,9 @@ degradations! {
|
||||
/// driver in one `vkQueueSubmit`, only the last signalling its queue's timeline and their
|
||||
/// events (`CompletionPolicy::Grouped`, the default, on a driver whose queue
|
||||
/// merges a submission that signals nothing into the next one: Mesa's drivers;
|
||||
/// `command_buffer/group.rs`): one kernel submission for up to four batches. Announced
|
||||
/// `command_buffer/group.rs`; under `CompletionPolicy::Exact`, batches of command buffers
|
||||
/// marked to join the next, `CommandBuffer::set_completion_joins_next`, and the batch
|
||||
/// found ready behind them): one kernel submission for up to four batches. Announced
|
||||
/// once per device, on the scheduler's thread, as the first such submission is made,
|
||||
/// whatever `DeviceOptions::announce_each` says: no program call or host step meets it.
|
||||
GroupedCompletion = "grouped-completion", Precision,
|
||||
@@ -2238,7 +2240,10 @@ degradations! {
|
||||
submission checks of the batches behind \
|
||||
a queue's next one run with its own, before the batch before them is submitted; \
|
||||
their commands, barriers and GPU times are unchanged; CompletionPolicy::Exact \
|
||||
submits and checks each batch alone";
|
||||
submits and checks each batch alone but those of a command buffer marked to join \
|
||||
the next (CommandBuffer::set_completion_joins_next), which go with the batches \
|
||||
found ready behind them in the same pass, the last of those seen complete at its \
|
||||
own end";
|
||||
/// A command buffer's completion sync file (`CommandBuffer::export_completion_sync_file`)
|
||||
/// whose command buffer's completion writes the caller's pages on the host after its GPU
|
||||
/// work: the merge back of a copied host buffer its commands may have written
|
||||
|
||||
@@ -176,7 +176,10 @@
|
||||
//! the thread for it), it fills, a later batch sends it, or a thread waits for one of its command
|
||||
//! buffers (`Group::keeps`). The submission checks of up to three batches right behind a line's
|
||||
//! head that goes run with the head's ([`check_heads`]), so a line of checked batches is found
|
||||
//! ready together.
|
||||
//! ready together. Under `CompletionPolicy::Exact` only the batches of command buffers marked to
|
||||
//! join the next (`CommandBuffer::set_completion_joins_next`) are held so, the first batch behind
|
||||
//! them that is not goes last in their group, which then goes at once, and no group is kept past
|
||||
//! its pass.
|
||||
//! - **Idle, it sleeps until it is woken.** The thread wakes on a commit, a host signal or a
|
||||
//! stop, each of which marks its state under its lock and notifies it where it sleeps
|
||||
//! ([`Inbox::post`], [`Scheduler::waker`], `Scheduler::stop`). With no batch held in its order
|
||||
@@ -2154,6 +2157,12 @@ fn submit_ready(
|
||||
if state.group.full() {
|
||||
let full = (GroupEnd::Full, Alone::Other);
|
||||
submit_group(state, (spent, settled), handlers, full)?;
|
||||
} else if state.group.closed() {
|
||||
// A command buffer not marked to join the next went last in it under
|
||||
// `CompletionPolicy::Exact`: held back for nothing
|
||||
// (`CommandBuffer::set_completion_joins_next`).
|
||||
let closed = (GroupEnd::Closed, Alone::Other);
|
||||
submit_group(state, (spent, settled), handlers, closed)?;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -3126,7 +3135,10 @@ type Work = (Hold<CommandBufferShared>, usize);
|
||||
/// runs, as those behind it would run on this thread meanwhile) are looked at too, at most
|
||||
/// [`GROUP_BATCHES`] less one and none committed after another line's batch
|
||||
/// ([`Order::leading_mut`]), each that goes taking its checks to `left` likewise: so the next pass
|
||||
/// finds them ready together. Each check still runs in commit order before its own batch's
|
||||
/// finds them ready together. Under `CompletionPolicy::Exact`, where the head is of a command
|
||||
/// buffer marked to join the next (`CommandBuffer::set_completion_joins_next`), the first batch
|
||||
/// behind it that waits in no group is looked at too, as one that may go last in its group, and
|
||||
/// none after it. Each check still runs in commit order before its own batch's
|
||||
/// submission, within the pass before it, where a head's alone runs after the batch before it
|
||||
/// was submitted.
|
||||
fn check_heads(state: &mut State, behind: &[u64], left: &mut Left<Work>, awaits: &Awaits) -> bool {
|
||||
@@ -3147,14 +3159,21 @@ fn check_heads(state: &mut State, behind: &[u64], left: &mut Left<Work>, awaits:
|
||||
&& event_waits(held).is_some_and(|waits| waits.is_empty())
|
||||
};
|
||||
if !head {
|
||||
if !goes(held) {
|
||||
// Under `CompletionPolicy::Exact`, a batch that waits in no group behind one that does
|
||||
// (a command buffer marked to join the next) may go last in its group
|
||||
// (`CommandBufferShared::closes_groups`): checked with it, and none after it.
|
||||
let closes = otherwise_ready
|
||||
&& !held.buffer.groups()
|
||||
&& held.buffer.closes_groups()
|
||||
&& event_waits(held).is_some_and(|waits| waits.is_empty());
|
||||
if !goes(held) && !closes {
|
||||
return false;
|
||||
}
|
||||
if due {
|
||||
held.checks_taken = Some(Taken::Left);
|
||||
left.push(Kind::Check, (held.buffer.hold(), held.index));
|
||||
}
|
||||
return true;
|
||||
return !closes;
|
||||
}
|
||||
count_waits_held(held);
|
||||
if !held.checked || !otherwise_ready || !due {
|
||||
|
||||
@@ -216,7 +216,7 @@ fn queue_times_are_noted_in_the_order_of_a_queue_s_submissions_and_only_where_as
|
||||
}
|
||||
|
||||
/// The groups of batches held for one kernel submission `device` sent so far, each counted once
|
||||
/// by what sent it (`WorkCounts::group_ends_full` and the seven after it).
|
||||
/// by what sent it (`WorkCounts::group_ends_full` and the eight after it).
|
||||
fn groups_ended(device: &Device) -> u64 {
|
||||
let counts = device.work_counts();
|
||||
counts.group_ends_full
|
||||
@@ -227,6 +227,7 @@ fn groups_ended(device: &Device) -> u64 {
|
||||
+ counts.group_ends_drained
|
||||
+ counts.group_ends_checks
|
||||
+ counts.group_ends_held
|
||||
+ counts.group_ends_closed
|
||||
}
|
||||
|
||||
/// Commit a fill of `target` on `queue`, held [`HELD`] in its submission's first work's take where
|
||||
|
||||
@@ -305,7 +305,7 @@ pub(crate) struct Counters {
|
||||
grouped_submissions: AtomicU64,
|
||||
batches_grouped: AtomicU64,
|
||||
/// By `GroupEnd`, in its order.
|
||||
group_ends: [AtomicU64; 8],
|
||||
group_ends: [AtomicU64; 9],
|
||||
texture_faces_made: AtomicU64,
|
||||
attached_read_swaps: AtomicU64,
|
||||
attached_read_swap_reads: AtomicU64,
|
||||
@@ -7890,9 +7890,10 @@ pub struct WorkCounts {
|
||||
pub grouped_submissions: u64,
|
||||
/// The batches those calls submitted.
|
||||
pub batches_grouped: u64,
|
||||
/// Groups of batches held for one kernel submission (`CompletionPolicy::Grouped`) that went
|
||||
/// holding the most they may (four), each group counted once by what sent it; with the seven
|
||||
/// fields after this one, every group. Their spread says why a device's groups hold fewer.
|
||||
/// Groups of batches held for one kernel submission (`CompletionPolicy::Grouped`, or command
|
||||
/// buffers marked to join the next under `CompletionPolicy::Exact`) that went holding the most
|
||||
/// they may (four), each group counted once by what sent it; with the eight fields after this
|
||||
/// one, every group. Their spread says why a device's groups hold fewer.
|
||||
pub group_ends_full: u64,
|
||||
/// Groups that went before a batch that waits for an event value a batch they held signals,
|
||||
/// which only the group's end meets, or in the call of a batch that waits for anything else
|
||||
@@ -7919,6 +7920,10 @@ pub struct WorkCounts {
|
||||
/// Groups that went when the scheduler found no batch ready, the rest held for events'
|
||||
/// values, host steps' gates, binary semaphores or texture decodes.
|
||||
pub group_ends_held: u64,
|
||||
/// Groups that went at once as a batch of a command buffer not marked to join the next went
|
||||
/// last in them, under `CompletionPolicy::Exact` (`CommandBuffer::set_completion_joins_next`):
|
||||
/// the marked command buffers' batches before it, and it seen complete at its own end.
|
||||
pub group_ends_closed: u64,
|
||||
/// Batches submitted (each held in a group counted as it is held) while no earlier batch of
|
||||
/// their `VkQueue` was pending: every one submitted before them the host had seen complete
|
||||
/// (their queue's timeline at their values), as of the completed value the hazard tracker took
|
||||
@@ -7932,10 +7937,11 @@ pub struct WorkCounts {
|
||||
/// Batches submitted while four or more earlier batches of their `VkQueue` were pending.
|
||||
pub batches_with_four_or_more_pending: u64,
|
||||
/// Batches on a `VkQueue` whose batches may wait in a group (`CompletionPolicy::Grouped`, on
|
||||
/// a device whose submissions merge) that went in a kernel submission of their own, with no
|
||||
/// a device whose submissions merge; under `CompletionPolicy::Exact` those of command buffers
|
||||
/// marked to join the next) that went in a kernel submission of their own, with no
|
||||
/// group held, because their command queue is unshared (`Device::new_command_queue_unshared`)
|
||||
/// and the `VkQueue` holds other queues' work back for it (`UnsharedIsolationPolicy::Bounded`):
|
||||
/// such a batch never waits in a group. With the seventeen fields after this one and
|
||||
/// such a batch never waits in a group. With the eighteen fields after this one and
|
||||
/// `batches_grouped`, every batch such a `VkQueue` took with GPU work: each counted once, by
|
||||
/// the first reason in their order, so the spread says why a device's batches did not group.
|
||||
/// A batch counted here is refused before it could be held, whether or not a group was held:
|
||||
@@ -7992,6 +7998,10 @@ pub struct WorkCounts {
|
||||
/// Batches held alone whose group went because a switch of storage forms rode on it, or the
|
||||
/// device was lost.
|
||||
pub batches_held_alone_other: u64,
|
||||
/// Batches of command buffers marked to join the next (`CommandBuffer::set_completion_joins_next`)
|
||||
/// held alone under `CompletionPolicy::Exact`, whose group went as the scheduler found no batch
|
||||
/// ready: no group is kept under `Exact`, so no marked batch waits for a later commit.
|
||||
pub batches_held_alone_unkept: u64,
|
||||
/// Batches of command queues made with `Device::new_command_queue_unshared` submitted, or
|
||||
/// held in a group, under either `CompletionPolicy` and on every device: beside the total of
|
||||
/// `batches_with_none_pending` and its three siblings, the share of the device's batches its
|
||||
@@ -12376,6 +12386,7 @@ impl Device {
|
||||
group_ends_drained: group_end(GroupEnd::Drained),
|
||||
group_ends_checks: group_end(GroupEnd::Checks),
|
||||
group_ends_held: group_end(GroupEnd::Held),
|
||||
group_ends_closed: group_end(GroupEnd::Closed),
|
||||
batches_with_none_pending: pending(0),
|
||||
batches_with_one_pending: pending(1),
|
||||
batches_with_two_or_three_pending: pending(2),
|
||||
@@ -12398,6 +12409,7 @@ impl Device {
|
||||
batches_held_alone_kept: alone(Alone::Kept),
|
||||
batches_held_alone_sent_by_next: alone(Alone::SentByNext),
|
||||
batches_held_alone_other: alone(Alone::Other),
|
||||
batches_held_alone_unkept: alone(Alone::Unkept),
|
||||
batches_of_unshared_queues: (counters.batches_of_unshared_queues)
|
||||
.load(Ordering::Relaxed),
|
||||
groups_kept_pending: counters.groups_kept_pending.load(Ordering::Relaxed),
|
||||
|
||||
@@ -627,6 +627,8 @@ mod interlocked_draw_order;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod interlocked_primitive_order;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod joined_completions;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod keep_alives;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod kept_apart;
|
||||
|
||||
@@ -44,8 +44,8 @@ use std::sync::{Arc, Mutex};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
/// The reasons, in the order of the runtime's `Alone`: the ten of batches found with no group
|
||||
/// held, then the eight of batches held in a group that went holding them alone.
|
||||
const REASONS: [&str; 18] = [
|
||||
/// held, then the nine of batches held in a group that went holding them alone.
|
||||
const REASONS: [&str; 19] = [
|
||||
"unshared",
|
||||
"binary-wait",
|
||||
"binary-signal",
|
||||
@@ -64,6 +64,7 @@ const REASONS: [&str; 18] = [
|
||||
"held:kept",
|
||||
"held:sent-by-next",
|
||||
"held:other",
|
||||
"held:unkept",
|
||||
];
|
||||
|
||||
/// The places in [`REASONS`] the test reads.
|
||||
@@ -76,7 +77,7 @@ const UNSHARED_HOLD: usize = 11;
|
||||
const WAITED_FOR: usize = 14;
|
||||
|
||||
/// The counts of [`REASONS`], in their order.
|
||||
fn alone(counts: &WorkCounts) -> [u64; 18] {
|
||||
fn alone(counts: &WorkCounts) -> [u64; 19] {
|
||||
[
|
||||
counts.batches_alone_unshared,
|
||||
counts.batches_alone_binary_waits,
|
||||
@@ -96,6 +97,7 @@ fn alone(counts: &WorkCounts) -> [u64; 18] {
|
||||
counts.batches_held_alone_kept,
|
||||
counts.batches_held_alone_sent_by_next,
|
||||
counts.batches_held_alone_other,
|
||||
counts.batches_held_alone_unkept,
|
||||
]
|
||||
}
|
||||
|
||||
@@ -103,7 +105,7 @@ fn alone(counts: &WorkCounts) -> [u64; 18] {
|
||||
/// batches, and, for a failure's report, the batches submitted or held (every batch with GPU
|
||||
/// work, by how far its queue ran behind), those grouped, those at commit, the command buffers
|
||||
/// taken with no submission, and the kernel submissions.
|
||||
fn moved(device: &Device, before: &WorkCounts) -> ([u64; 18], u64, String) {
|
||||
fn moved(device: &Device, before: &WorkCounts) -> ([u64; 19], u64, String) {
|
||||
let after = device.work_counts();
|
||||
let (was, now) = (alone(before), alone(&after));
|
||||
let since = |count: fn(&WorkCounts) -> u64| count(&after) - count(before);
|
||||
@@ -129,7 +131,7 @@ fn moved(device: &Device, before: &WorkCounts) -> ([u64; 18], u64, String) {
|
||||
|
||||
/// The one reason `counts` holds, its place in [`REASONS`]: none where it holds none, and a
|
||||
/// failure where it holds more than one batch.
|
||||
fn only(counts: &[u64; 18], what: &str) -> Option<usize> {
|
||||
fn only(counts: &[u64; 19], what: &str) -> Option<usize> {
|
||||
assert!(
|
||||
counts.iter().sum::<u64>() <= 1,
|
||||
"{what}: counted more than once: {}",
|
||||
@@ -139,7 +141,7 @@ fn only(counts: &[u64; 18], what: &str) -> Option<usize> {
|
||||
}
|
||||
|
||||
/// `counts` by name, the reasons that moved.
|
||||
fn named(counts: &[u64; 18]) -> String {
|
||||
fn named(counts: &[u64; 19]) -> String {
|
||||
let moved: Vec<String> = (REASONS.iter().zip(counts))
|
||||
.filter(|(_, &count)| count > 0)
|
||||
.map(|(name, count)| format!("{name} {count}"))
|
||||
|
||||
@@ -2463,7 +2463,8 @@ fn a_frame_s_passes_and_commits_begin_their_command_buffers_within_their_bound()
|
||||
+ begun(|c| c.group_ends_long)
|
||||
+ begun(|c| c.group_ends_drained)
|
||||
+ begun(|c| c.group_ends_checks)
|
||||
+ begun(|c| c.group_ends_held);
|
||||
+ begun(|c| c.group_ends_held)
|
||||
+ begun(|c| c.group_ends_closed);
|
||||
let (kept, sent) = (
|
||||
begun(|c| c.groups_kept_pending),
|
||||
begun(|c| c.groups_sent_for_waits),
|
||||
|
||||
@@ -87,9 +87,9 @@ pub(super) const GROUPED: [Degradation; 1] = [Degradation::GroupedCompletion];
|
||||
|
||||
/// The groups that went between `before` and `after`, by what sent them: full, before a wait for
|
||||
/// a held signal, before a batch apart, with first work, drained, for checks or steps left, held
|
||||
/// back, before a batch of unknown or too long an expected run (`WorkCounts::group_ends_full` and
|
||||
/// kin).
|
||||
fn group_ends(before: &WorkCounts, after: &WorkCounts) -> [u64; 8] {
|
||||
/// back, before a batch of unknown or too long an expected run, closed by a command buffer not
|
||||
/// marked to join the next (`WorkCounts::group_ends_full` and kin).
|
||||
fn group_ends(before: &WorkCounts, after: &WorkCounts) -> [u64; 9] {
|
||||
let ends = |counts: &WorkCounts| {
|
||||
[
|
||||
counts.group_ends_full,
|
||||
@@ -100,6 +100,7 @@ fn group_ends(before: &WorkCounts, after: &WorkCounts) -> [u64; 8] {
|
||||
counts.group_ends_checks,
|
||||
counts.group_ends_held,
|
||||
counts.group_ends_long,
|
||||
counts.group_ends_closed,
|
||||
]
|
||||
};
|
||||
let (before, after) = (ends(before), ends(after));
|
||||
@@ -180,7 +181,7 @@ pub(super) fn warm(device: &metal2vulkan_runtime::Device, queue: &CommandQueue)
|
||||
const WARM_RUNS: usize = 6;
|
||||
|
||||
/// The bytes of a host-visible buffer.
|
||||
fn bytes_of(buffer: &Buffer) -> Vec<u8> {
|
||||
pub(super) fn bytes_of(buffer: &Buffer) -> Vec<u8> {
|
||||
let contents = buffer.contents().expect("a host-visible buffer");
|
||||
// SAFETY: the buffer holds `length` bytes at `contents`, alive with the buffer, and no command
|
||||
// buffer uses them while they are read.
|
||||
@@ -190,7 +191,7 @@ fn bytes_of(buffer: &Buffer) -> Vec<u8> {
|
||||
/// The module docs' run under `completion`, each command buffer `checked` or not: the
|
||||
/// `vkQueueSubmit` calls that held several batches, the batches they held, the kernel submissions
|
||||
/// in all, the grouped-completion notices, and whether the device groups its batches ([`groups`]).
|
||||
fn run(completion: CompletionPolicy, checked: bool) -> (u64, u64, u64, usize, bool, [u64; 8]) {
|
||||
fn run(completion: CompletionPolicy, checked: bool) -> (u64, u64, u64, usize, bool, [u64; 9]) {
|
||||
let messages = Messages::default();
|
||||
let cache = ScratchCache::new().unwrap();
|
||||
let (grouped, batches, submissions, grouping, ends) = {
|
||||
@@ -303,7 +304,7 @@ fn grouped_where_merging(checked: bool) {
|
||||
"groups by what sent them {ends:?}, {grouped} calls"
|
||||
);
|
||||
} else {
|
||||
assert_eq!((grouped, batches, heard, ends), (0, 0, 0, [0; 8]));
|
||||
assert_eq!((grouped, batches, heard, ends), (0, 0, 0, [0; 9]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,7 +410,7 @@ fn completions_wake_the_scheduler_only_once_a_head_may_go() {
|
||||
fn the_exact_completion_submits_each_batch_alone() {
|
||||
for checked in [false, true] {
|
||||
let (grouped, batches, submissions, heard, _, ends) = run(CompletionPolicy::Exact, checked);
|
||||
assert_eq!((grouped, batches, heard, ends), (0, 0, 0, [0; 8]));
|
||||
assert_eq!((grouped, batches, heard, ends), (0, 0, 0, [0; 9]));
|
||||
assert!(submissions >= BATCHES as u64, "{submissions} calls");
|
||||
}
|
||||
}
|
||||
@@ -439,7 +440,7 @@ struct Scenario {
|
||||
/// Whether the device groups its batches ([`groups`]).
|
||||
grouping: bool,
|
||||
/// The groups by what sent them ([`group_ends`]).
|
||||
ends: [u64; 8],
|
||||
ends: [u64; 9],
|
||||
/// The event waits found met as the scheduler took their batches
|
||||
/// (`WorkCounts::event_waits_met`), the first step's wait for the gate among them.
|
||||
met: u64,
|
||||
@@ -585,10 +586,10 @@ fn both_policies(steps: &[Step], last: u64, waits: bool) {
|
||||
"groups by what sent them {ends:?}: none before a wait"
|
||||
);
|
||||
} else {
|
||||
assert_eq!((grouped, ends), (0, [0; 8]));
|
||||
assert_eq!((grouped, ends), (0, [0; 9]));
|
||||
}
|
||||
let run = event_scenario(CompletionPolicy::Exact, steps, last);
|
||||
assert_eq!((run.grouped, run.batches, run.ends), (0, 0, [0; 8]));
|
||||
assert_eq!((run.grouped, run.batches, run.ends), (0, 0, [0; 9]));
|
||||
}
|
||||
|
||||
/// Command buffers that each signal `E` with the next value ride in groups, `E`'s signals moved to
|
||||
@@ -705,10 +706,10 @@ fn a_command_buffer_that_waits_leads_its_group() {
|
||||
"groups by what sent them {ends:?}, {met} event waits met (the gate's among them): a \
|
||||
command buffer that waits for a value not seen complete joined a group"
|
||||
),
|
||||
false => assert_eq!(ends, [0; 8]),
|
||||
false => assert_eq!(ends, [0; 9]),
|
||||
}
|
||||
let run = event_scenario(CompletionPolicy::Exact, &steps, 1);
|
||||
assert_eq!((run.grouped, run.batches, run.ends), (0, 0, [0; 8]));
|
||||
assert_eq!((run.grouped, run.batches, run.ends), (0, 0, [0; 9]));
|
||||
}
|
||||
|
||||
/// The bytes each command buffer of `grouped_completion_delays` fills: about 0.1 to 0.2 ms of the
|
||||
@@ -1124,7 +1125,7 @@ struct Behind {
|
||||
/// `A` still ran as the wait for the last sent its group, where it did.
|
||||
a_ran_at_send: bool,
|
||||
/// The groups by what sent them ([`group_ends`]).
|
||||
ends: [u64; 8],
|
||||
ends: [u64; 9],
|
||||
/// The submission checks run.
|
||||
checks: u64,
|
||||
}
|
||||
@@ -1365,7 +1366,7 @@ fn held_behind_running_work(carried: Carried) {
|
||||
} else {
|
||||
assert_eq!(
|
||||
(seen.kept, seen.sent, seen.ends),
|
||||
(0, 0, [0; 8]),
|
||||
(0, 0, [0; 9]),
|
||||
"{seen:?}"
|
||||
);
|
||||
}
|
||||
@@ -1382,7 +1383,7 @@ fn the_exact_completion_keeps_no_group_behind_running_work() {
|
||||
}
|
||||
assert_eq!(
|
||||
(seen.kept, seen.sent, seen.ends),
|
||||
(0, 0, [0; 8]),
|
||||
(0, 0, [0; 9]),
|
||||
"{seen:?}"
|
||||
);
|
||||
}
|
||||
@@ -1410,7 +1411,7 @@ struct HandlerWait {
|
||||
reached: bool,
|
||||
waited: std::time::Duration,
|
||||
/// The groups by what sent them, from `Y`'s commit on ([`group_ends`]).
|
||||
ends: [u64; 8],
|
||||
ends: [u64; 9],
|
||||
/// What the device counted since `A`'s commit, once `A` was taken in, `B` scheduled and `X`
|
||||
/// scheduled.
|
||||
steps: [StepCounts; 3],
|
||||
@@ -1432,7 +1433,7 @@ struct StepCounts {
|
||||
/// more.
|
||||
pending: [u64; 3],
|
||||
/// The groups by what sent them ([`group_ends`]).
|
||||
ends: [u64; 8],
|
||||
ends: [u64; 9],
|
||||
}
|
||||
|
||||
impl StepCounts {
|
||||
@@ -1701,7 +1702,7 @@ struct KeptSignalWait {
|
||||
/// From `X`'s completed handler to `Y`'s.
|
||||
y_after_x: Option<std::time::Duration>,
|
||||
/// The groups from `Y`'s take-in by what sent them ([`group_ends`]).
|
||||
ends: [u64; 8],
|
||||
ends: [u64; 9],
|
||||
}
|
||||
|
||||
/// Two long command buffers `A` then `B` on one queue, of `stretch` times the fills the
|
||||
@@ -1887,7 +1888,7 @@ fn a_shared_event_wait_for_a_kept_group_s_signal_ends_at_the_next_completion_tur
|
||||
if !seen.grouping {
|
||||
assert_eq!(
|
||||
(seen.kept, seen.ends),
|
||||
(0, [0; 8]),
|
||||
(0, [0; 9]),
|
||||
"a group on a device that groups none: {seen:?}"
|
||||
);
|
||||
} else if seen.shared {
|
||||
|
||||
@@ -0,0 +1,296 @@
|
||||
//! Device tests of command buffers marked to join the next under `CompletionPolicy::Exact`
|
||||
//! (`CommandBuffer::set_completion_joins_next`, the runtime's `command_buffer/group.rs`), on the
|
||||
//! device the cfg selects, under the validation layer and the lane's exact completion.
|
||||
//!
|
||||
//! Shaped like a consumer's command buffer cut into parts: [`PARTS`] command buffers committed on
|
||||
//! one queue, the first waiting for an event the host raises once every one was taken in, each a
|
||||
//! fill of a buffer of its own, every one but the last marked, each with a submission check where
|
||||
//! `checked` (the consumer checks every command buffer). Let go together, on a device whose
|
||||
//! batches merge ([`groups`]: its merge check holds, here assumed with
|
||||
//! `DeviceOptions::assume_submissions_merge`, and its queues' failures are not relayed), the marked
|
||||
//! ones wait in the scheduler's group and the last goes last in one of them, which then goes at
|
||||
//! once (`WorkCounts::group_ends_closed`): fewer kernel submissions than command buffers,
|
||||
//! `grouped-completion` announced once. With none marked, or on a device whose check finds no merge
|
||||
//! (lavapipe's, unassumed), each goes alone and nothing is announced. Either way every command
|
||||
//! buffer completes with its own fill, each check runs once in commit order, and the layer reports
|
||||
//! nothing.
|
||||
//!
|
||||
//! An unmarked command buffer is never seen complete late ([`an_unmarked_command_buffer_is_seen_complete_at_its_own_end`]):
|
||||
//! a marked `M`, an unmarked `U` and then `L`, [`LONG_FILLS`] large fills, let go together. `U`
|
||||
//! goes last in `M`'s group, so its completed handler runs while `L` still runs on the GPU; were `U`
|
||||
//! held before `L` in a group, it would be seen complete only once `L` completed. `M`, seen complete
|
||||
//! with its group's last, has completed by the time `U`'s handler runs, and before `L` completes.
|
||||
|
||||
use super::degrade_notices::counts;
|
||||
use super::grouped_submissions::{bytes_of, groups, taken_in, warm, GROUPED};
|
||||
use super::{layer_reported_nothing_at_all, validated_device_with, Messages, ScratchCache, WAIT};
|
||||
use crate::gpu::TEST_DEVICE;
|
||||
use metal2vulkan_runtime::{
|
||||
Buffer, CommandBuffer, CommandBufferStatus, EventRef, ResourceOptions, WorkCounts,
|
||||
};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
/// The parts of the cut command buffer: two groups of at most four, the second closed by the last.
|
||||
const PARTS: usize = 7;
|
||||
|
||||
/// The bytes each part fills.
|
||||
const BYTES: u64 = 4096;
|
||||
|
||||
/// The large fills `L` runs, each of [`LONG_BYTES`]: many milliseconds of GPU work on every lane
|
||||
/// device, so `U`'s completion is seen well before `L`'s end.
|
||||
const LONG_FILLS: usize = 16;
|
||||
const LONG_BYTES: u64 = 64 << 20;
|
||||
|
||||
/// What a run moved: the `vkQueueSubmit` calls that held several batches, the batches they held,
|
||||
/// the kernel submissions in all, the groups an unmarked batch closed, the grouped-completion
|
||||
/// notices, and whether the device groups marked batches ([`groups`]).
|
||||
#[derive(Debug)]
|
||||
struct Moved {
|
||||
grouped: u64,
|
||||
batches: u64,
|
||||
submissions: u64,
|
||||
closed: u64,
|
||||
unkept: u64,
|
||||
heard: usize,
|
||||
grouping: bool,
|
||||
}
|
||||
|
||||
impl Moved {
|
||||
fn of(before: &WorkCounts, after: &WorkCounts, heard: usize, grouping: bool) -> Moved {
|
||||
Moved {
|
||||
grouped: after.grouped_submissions - before.grouped_submissions,
|
||||
batches: after.batches_grouped - before.batches_grouped,
|
||||
submissions: after.queue_submissions - before.queue_submissions,
|
||||
closed: after.group_ends_closed - before.group_ends_closed,
|
||||
unkept: after.batches_held_alone_unkept - before.batches_held_alone_unkept,
|
||||
heard,
|
||||
grouping,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The module docs' parts, every one but the last marked where `marked`, each checked where
|
||||
/// `checked`, on a device whose merge check is `assumed` to hold or measured.
|
||||
fn parts(marked: bool, checked: bool, assumed: bool) -> Moved {
|
||||
let messages = Messages::default();
|
||||
let cache = ScratchCache::new().unwrap();
|
||||
let (before, after, grouping) = {
|
||||
let device = validated_device_with(TEST_DEVICE, &messages, cache.path(), |options| {
|
||||
options.assume_submissions_merge = assumed;
|
||||
})
|
||||
.unwrap();
|
||||
let grouping = groups(&device);
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
warm(&device, &queue);
|
||||
let gate = device.new_shared_event().unwrap();
|
||||
let buffers: Vec<Buffer> = (0..PARTS)
|
||||
.map(|_| device.new_buffer(BYTES, ResourceOptions::shared()).unwrap())
|
||||
.collect();
|
||||
let before = device.work_counts();
|
||||
let checks = Arc::new(Mutex::new(Vec::new()));
|
||||
let committed: Vec<CommandBuffer> = (buffers.iter().enumerate())
|
||||
.map(|(at, buffer)| {
|
||||
let command_buffer = queue.command_buffer().unwrap();
|
||||
command_buffer
|
||||
.set_completion_joins_next(marked && at + 1 < PARTS)
|
||||
.unwrap();
|
||||
if checked {
|
||||
let checks = Arc::clone(&checks);
|
||||
command_buffer
|
||||
.set_submission_check(Arc::new(move |_| {
|
||||
checks.lock().unwrap().push(at);
|
||||
None
|
||||
}))
|
||||
.unwrap();
|
||||
}
|
||||
if at == 0 {
|
||||
command_buffer
|
||||
.encode_wait_for_event(EventRef::from(&gate), 1)
|
||||
.unwrap();
|
||||
}
|
||||
let mut blit = command_buffer.blit_command_encoder().unwrap();
|
||||
blit.fill_buffer(buffer, 0..BYTES, at as u8 + 1).unwrap();
|
||||
blit.end_encoding().unwrap();
|
||||
command_buffer.commit().unwrap();
|
||||
assert!(
|
||||
command_buffer.set_completion_joins_next(true).is_err(),
|
||||
"part {at} marked once committed"
|
||||
);
|
||||
command_buffer
|
||||
})
|
||||
.collect();
|
||||
taken_in(&device);
|
||||
gate.set_signaled_value(1);
|
||||
for (at, command_buffer) in committed.iter().enumerate() {
|
||||
command_buffer.wait_until_completed_for(WAIT).unwrap();
|
||||
assert_eq!(command_buffer.error(), None, "part {at}");
|
||||
assert_eq!(command_buffer.status(), CommandBufferStatus::Completed);
|
||||
}
|
||||
for (at, buffer) in buffers.iter().enumerate() {
|
||||
let wrong = (bytes_of(buffer).iter())
|
||||
.filter(|&&byte| byte != at as u8 + 1)
|
||||
.count();
|
||||
assert_eq!(wrong, 0, "part {at}: bytes off its fill");
|
||||
}
|
||||
let ran = checks.lock().unwrap().clone();
|
||||
let expected: Vec<usize> = (0..PARTS).filter(|_| checked).collect();
|
||||
assert_eq!(ran, expected, "the checks that ran, in order");
|
||||
(before, device.work_counts(), grouping)
|
||||
};
|
||||
let notices = counts(&messages.take_notices());
|
||||
let [heard] = GROUPED.map(|kind| notices.get(&kind).copied().unwrap_or(0));
|
||||
layer_reported_nothing_at_all(&messages);
|
||||
let moved = Moved::of(&before, &after, heard, grouping);
|
||||
eprintln!(
|
||||
"JOINED marked {marked}, checked {checked}, merge assumed {assumed}: {moved:?} for {PARTS} \
|
||||
command buffers"
|
||||
);
|
||||
moved
|
||||
}
|
||||
|
||||
/// Marked parts group where the device's batches merge, the last unmarked one closing a group;
|
||||
/// elsewhere each goes alone.
|
||||
fn grouped_where_merging(checked: bool, assumed: bool) {
|
||||
let moved = parts(true, checked, assumed);
|
||||
if moved.grouping {
|
||||
assert!(moved.grouped >= 1, "{moved:?}: no grouped call");
|
||||
assert!(moved.batches >= 3, "{moved:?}: too few batches grouped");
|
||||
assert!(moved.submissions < PARTS as u64, "{moved:?}: no call saved");
|
||||
assert!(moved.closed >= 1, "{moved:?}: no group closed by the last");
|
||||
assert_eq!(moved.heard, 1, "{moved:?}: grouped-completion notices");
|
||||
} else {
|
||||
assert_eq!(
|
||||
(moved.grouped, moved.batches, moved.closed, moved.heard),
|
||||
(0, 0, 0, 0),
|
||||
"{moved:?}"
|
||||
);
|
||||
assert_eq!(moved.submissions, PARTS as u64, "{moved:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// The module docs' parts, marked, unchecked, the merge assumed: they group.
|
||||
#[test]
|
||||
fn marked_parts_go_in_fewer_kernel_submissions() {
|
||||
grouped_where_merging(false, true);
|
||||
}
|
||||
|
||||
/// The same with a submission check on each part: the checks of the parts right behind a marked
|
||||
/// head run with its own, each once, in commit order, so they are found ready together.
|
||||
#[test]
|
||||
fn checked_marked_parts_go_in_fewer_kernel_submissions() {
|
||||
grouped_where_merging(true, true);
|
||||
}
|
||||
|
||||
/// The same on the device's own merge check: a no-op where it finds no merge (lavapipe).
|
||||
#[test]
|
||||
fn marked_parts_group_only_where_the_device_s_check_finds_the_merge() {
|
||||
grouped_where_merging(true, false);
|
||||
}
|
||||
|
||||
/// With no part marked, under the exact completion, each goes alone: nothing grouped, nothing
|
||||
/// announced, one kernel submission each.
|
||||
#[test]
|
||||
fn unmarked_parts_go_alone_under_the_exact_completion() {
|
||||
let moved = parts(false, true, true);
|
||||
assert_eq!(
|
||||
(
|
||||
moved.grouped,
|
||||
moved.batches,
|
||||
moved.closed,
|
||||
moved.unkept,
|
||||
moved.heard
|
||||
),
|
||||
(0, 0, 0, 0, 0),
|
||||
"{moved:?}"
|
||||
);
|
||||
assert_eq!(moved.submissions, PARTS as u64, "{moved:?}");
|
||||
}
|
||||
|
||||
/// The module docs' `M`, `U` and `L`: `U`'s completion is seen while `L` still runs, `M`'s by then
|
||||
/// too, and `M` and `U` went in one kernel submission where the device groups.
|
||||
#[test]
|
||||
fn an_unmarked_command_buffer_is_seen_complete_at_its_own_end() {
|
||||
let messages = Messages::default();
|
||||
let cache = ScratchCache::new().unwrap();
|
||||
let (moved, seen) = {
|
||||
let device = validated_device_with(TEST_DEVICE, &messages, cache.path(), |options| {
|
||||
options.assume_submissions_merge = true;
|
||||
})
|
||||
.unwrap();
|
||||
let grouping = groups(&device);
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
warm(&device, &queue);
|
||||
let gate = device.new_shared_event().unwrap();
|
||||
let small = device.new_buffer(BYTES, ResourceOptions::shared()).unwrap();
|
||||
let large = device
|
||||
.new_buffer(LONG_BYTES, ResourceOptions::private())
|
||||
.unwrap();
|
||||
// Their first work (`texture/first_move.rs`) done before: a batch that takes it waits in no
|
||||
// group.
|
||||
let first = queue.command_buffer().unwrap();
|
||||
let mut blit = first.blit_command_encoder().unwrap();
|
||||
blit.fill_buffer(&small, 0..BYTES, 0).unwrap();
|
||||
blit.fill_buffer(&large, 0..LONG_BYTES, 0).unwrap();
|
||||
blit.end_encoding().unwrap();
|
||||
first.commit().unwrap();
|
||||
first.wait_until_completed_for(WAIT).unwrap();
|
||||
let before = device.work_counts();
|
||||
let fill = |command_buffer: &CommandBuffer, value: u8| {
|
||||
let mut blit = command_buffer.blit_command_encoder().unwrap();
|
||||
blit.fill_buffer(&small, 0..BYTES, value).unwrap();
|
||||
blit.end_encoding().unwrap();
|
||||
};
|
||||
let marked = queue.command_buffer().unwrap();
|
||||
marked.set_completion_joins_next(true).unwrap();
|
||||
marked
|
||||
.encode_wait_for_event(EventRef::from(&gate), 1)
|
||||
.unwrap();
|
||||
fill(&marked, 1);
|
||||
let unmarked = queue.command_buffer().unwrap();
|
||||
fill(&unmarked, 2);
|
||||
let long = queue.command_buffer().unwrap();
|
||||
let mut blit = long.blit_command_encoder().unwrap();
|
||||
for at in 0..LONG_FILLS {
|
||||
blit.fill_buffer(&large, 0..LONG_BYTES, at as u8).unwrap();
|
||||
}
|
||||
blit.end_encoding().unwrap();
|
||||
// At `U`'s completed handler: whether `M` and `L` read `Completed`.
|
||||
let seen = Arc::new(Mutex::new(None));
|
||||
{
|
||||
let (seen, marked, long) = (Arc::clone(&seen), marked.clone(), long.clone());
|
||||
unmarked
|
||||
.add_completed_handler(Box::new(move |_: &CommandBuffer| {
|
||||
let done = |command_buffer: &CommandBuffer| {
|
||||
command_buffer.status() == CommandBufferStatus::Completed
|
||||
};
|
||||
*seen.lock().unwrap() = Some((done(&marked), done(&long)));
|
||||
}))
|
||||
.unwrap();
|
||||
}
|
||||
for command_buffer in [&marked, &unmarked, &long] {
|
||||
command_buffer.commit().unwrap();
|
||||
}
|
||||
taken_in(&device);
|
||||
gate.set_signaled_value(1);
|
||||
for command_buffer in [&marked, &unmarked, &long] {
|
||||
command_buffer.wait_until_completed_for(WAIT).unwrap();
|
||||
assert_eq!(command_buffer.error(), None);
|
||||
}
|
||||
assert!(bytes_of(&small).iter().all(|&byte| byte == 2));
|
||||
let after = device.work_counts();
|
||||
let seen = *seen.lock().unwrap();
|
||||
(Moved::of(&before, &after, 0, grouping), seen)
|
||||
};
|
||||
layer_reported_nothing_at_all(&messages);
|
||||
eprintln!("JOINED-ORDER {moved:?}; at U's completed handler (M, L) completed: {seen:?}");
|
||||
assert_eq!(
|
||||
seen,
|
||||
Some((true, false)),
|
||||
"at U's completed handler, M complete and L still running"
|
||||
);
|
||||
if moved.grouping {
|
||||
assert!(moved.grouped >= 1 && moved.closed >= 1, "{moved:?}");
|
||||
} else {
|
||||
assert_eq!((moved.grouped, moved.closed), (0, 0), "{moved:?}");
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -94,7 +94,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 524;
|
||||
/// changes no behaviour, and then updates that hash alone with the commit saying why, or changes
|
||||
/// behaviour and also bumps this version. The commit that bumps it says what changed; this comment
|
||||
/// keeps no history.
|
||||
pub const RUNTIME_VERSION: u32 = 2458;
|
||||
pub const RUNTIME_VERSION: u32 = 2459;
|
||||
|
||||
/// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex,
|
||||
/// of the manifest, the build script, and exactly the files the crate roots' module tree compiles
|
||||
|
||||
@@ -377,7 +377,9 @@ pub enum CompletionPolicy {
|
||||
Grouped,
|
||||
/// Each batch in a submission of its own that signals its own values, so each command buffer
|
||||
/// is seen complete, and its event signals land, at its own end, as Metal's are; each batch's
|
||||
/// submission checks run once the batch before it was submitted.
|
||||
/// submission checks run once the batch before it was submitted. The runtime's
|
||||
/// `CommandBuffer::set_completion_joins_next` lets a command buffer the program marks group as
|
||||
/// under `Grouped`, the first one behind it not marked going last in its submission.
|
||||
Exact,
|
||||
}
|
||||
|
||||
|
||||
@@ -2774,6 +2774,7 @@ field metal2vulkan-runtime::WorkCounts.batches_held_alone_kept pub batches_held_
|
||||
field metal2vulkan-runtime::WorkCounts.batches_held_alone_one_pending pub batches_held_alone_one_pending: u64
|
||||
field metal2vulkan-runtime::WorkCounts.batches_held_alone_other pub batches_held_alone_other: u64
|
||||
field metal2vulkan-runtime::WorkCounts.batches_held_alone_sent_by_next pub batches_held_alone_sent_by_next: u64
|
||||
field metal2vulkan-runtime::WorkCounts.batches_held_alone_unkept pub batches_held_alone_unkept: u64
|
||||
field metal2vulkan-runtime::WorkCounts.batches_held_alone_unshared_hold pub batches_held_alone_unshared_hold: u64
|
||||
field metal2vulkan-runtime::WorkCounts.batches_held_alone_waited_for pub batches_held_alone_waited_for: u64
|
||||
field metal2vulkan-runtime::WorkCounts.batches_held_for_another_queue pub batches_held_for_another_queue: u64
|
||||
@@ -3138,6 +3139,7 @@ field metal2vulkan-runtime::WorkCounts.gpu_pool_leases_peak pub gpu_pool_leases_
|
||||
field metal2vulkan-runtime::WorkCounts.graphics_pipelines_looked_up pub graphics_pipelines_looked_up: u64
|
||||
field metal2vulkan-runtime::WorkCounts.group_ends_apart pub group_ends_apart: u64
|
||||
field metal2vulkan-runtime::WorkCounts.group_ends_checks pub group_ends_checks: u64
|
||||
field metal2vulkan-runtime::WorkCounts.group_ends_closed pub group_ends_closed: u64
|
||||
field metal2vulkan-runtime::WorkCounts.group_ends_drained pub group_ends_drained: u64
|
||||
field metal2vulkan-runtime::WorkCounts.group_ends_first_work pub group_ends_first_work: u64
|
||||
field metal2vulkan-runtime::WorkCounts.group_ends_full pub group_ends_full: u64
|
||||
@@ -8709,6 +8711,7 @@ method metal2vulkan-runtime::CommandBuffer::queue_head_time pub fn queue_head_ti
|
||||
method metal2vulkan-runtime::CommandBuffer::refusal pub fn refusal(&self) -> Option<Error>
|
||||
method metal2vulkan-runtime::CommandBuffer::render_command_encoder pub fn render_command_encoder(&self, descriptor: &RenderPassDescriptor) -> Result<RenderCommandEncoder, Error>
|
||||
method metal2vulkan-runtime::CommandBuffer::resource_state_command_encoder pub fn resource_state_command_encoder(&self) -> Result<ResourceStateCommandEncoder, Error>
|
||||
method metal2vulkan-runtime::CommandBuffer::set_completion_joins_next pub fn set_completion_joins_next(&self, joins: bool) -> Result<(), Error>
|
||||
method metal2vulkan-runtime::CommandBuffer::set_label pub fn set_label(&self, label: &str)
|
||||
method metal2vulkan-runtime::CommandBuffer::set_protection_options pub fn set_protection_options(&self, options: u64) -> Result<(), Error>
|
||||
method metal2vulkan-runtime::CommandBuffer::set_submission_check pub fn set_submission_check(&self, check: SubmissionCheck) -> Result<(), Error>
|
||||
|
||||
|
Can't render this file because it is too large.
|
+7
-3
@@ -4087,8 +4087,10 @@ bound.
|
||||
buffers committed on one queue that the scheduler found ready together, or held while two or more
|
||||
earlier submissions of their queue ran, went to the driver in one `vkQueueSubmit`, only the last
|
||||
signalling its queue's timeline and their events (`CompletionPolicy::Grouped`, the default, on a
|
||||
driver whose queue merges a submission that signals nothing into the next one: Mesa's drivers):
|
||||
one kernel submission for up to four batches, where each kernel submission costs CPU time for
|
||||
driver whose queue merges a submission that signals nothing into the next one: Mesa's drivers;
|
||||
under `CompletionPolicy::Exact`, batches of command buffers marked to join the next,
|
||||
`CommandBuffer::set_completion_joins_next`, and the batch found ready behind them): one kernel
|
||||
submission for up to four batches, where each kernel submission costs CPU time for
|
||||
every `VkDeviceMemory` of the device. Announced once per device, on the scheduler's thread. Cost:
|
||||
each command buffer of the submission but the last is seen complete (its status, completed
|
||||
handlers and waits), and the event values it signals are reached, once the last completed, late by
|
||||
@@ -4097,7 +4099,9 @@ bound.
|
||||
those and its own start on the GPU, at most a completion turn's reaction and its vkQueueSubmit;
|
||||
and the submission checks of the batches behind a queue's next one run with its own, before the
|
||||
batch before them is submitted; their commands, barriers and GPU times are unchanged;
|
||||
`CompletionPolicy::Exact` submits and checks each batch alone.
|
||||
`CompletionPolicy::Exact` submits and checks each batch alone but those of a command buffer
|
||||
marked to join the next (`CommandBuffer::set_completion_joins_next`), which go with the batches
|
||||
found ready behind them in the same pass, the last of those seen complete at its own end.
|
||||
- `metal2vulkan-degrade-sync-file-after-host-copies` (performance). `SyncFileAfterHostCopies`: A
|
||||
command buffer's completion sync file (`CommandBuffer::export_completion_sync_file`) whose
|
||||
command buffer's completion writes the caller's pages on the host after its GPU work: the merge
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ three consumer pipelines: A2X (`a2x-s4`, `a2x-s96`), Xgc14 (`xgc14-bgra8`) and X
|
||||
| A blend into a packed 16-bit attachment the device renders through its word view (`A1BGR5Unorm`, `ABGR4Unorm` on the RTX 5080; `WordAttachment`), which the function computes in the interlocked storage form, reads the attachment's codes, where Metal's tile holds the pass's clear and each earlier blend's result as a `half`, finer; under fast math it also sums a few states otherwise than Metal. Every device rendering such an attachment. | The in-shader blend over the codes (no switch) | **Not built yet:** the extended-range attachments' `half` shadow (`render/extended_shadow.rs`, `VariantKey::extended_shadows`) taken by word attachments: the runtime's shadow start and end, its load of the codes and the clear's halves, and the word's shadowed variant in `lower::fragment::fetch`, for a single-sampled pass and a multisampled one (an extended-range color's shadow holds per sample, from the pass's clear). Fast math's regrouped sums have no model | One code: without fast math exact over a loaded attachment (the 2,891 states of the M3 sweep, every channel), under fast math 3,527 of 94,732,288 channels a code apart; after a clear or an earlier blend in the pass, a code apart where the two readings store different codes. `DeviceColorConversion` (`device-color-conversion`) | Not measured. Expected from the shadow's form: an `R16G16B16A16_SFLOAT` image of the pass's extent per such color (8 bytes a pixel, 16.6 MB at 1920x1080), set at the draw it starts by a fill or a load dispatch, and an 8-byte storage read and write per blended fragment inside the interlock beside the word's |
|
||||
| A heap's colour texture that Metal keeps losslessly compressed (`allowGPUOptimizedContents`, no `ShaderWrite`, `PixelFormatView` or `ShaderAtomic` usage, 16 texels or more a side), on a driver whose compressed images may keep their texels apart from the memory they are bound to (`DriverFact::CompressedImagesHideAliasedWrites`: ANV), is the driver's compressed optimal image, its compression and fast clears kept. A texture Metal keeps uncompressed takes the uncompressed image under either value. The runtime's choice: no pipeline differs. | `heap_compression = HeapCompressionPolicy::Compressed` | `heap_compression = HeapCompressionPolicy::Uncompressed`: an image the driver keeps uncompressed in the heap's bytes, as for a texture Metal keeps uncompressed: host-transfer usage where the device enabled `hostImageCopy` (`heap-texture-host-transfer`), else a linear image (`heap-texture-linear`), else the optimal one (`heap-texture-hides-aliased-writes`) | A write through a buffer or another texture over the texture's bytes may leave its texels as they were or change them otherwise than as written, where Metal's texture reads opaque magenta (`0xffff00ff`) in every texel of drawn content the write covers and the written bytes where it held only a clear; the texture's own writes may show in those bytes compressed. Within Metal's contract: Metal documents such a texture's layout as its own (`allowGPUOptimizedContents` lets it "adjust the private layout"), so no write through another view over its bytes has a defined result there either. `HeapTextureCompressed` (`heap-texture-compressed`), announced once per device where such a texture is made; `runtime_lane::heap_textures` | ANV (Iris Xe of RPL-P; `heap_textures::heap_compression_costs`), a 2048x2048 `RGBA8Unorm` render target in a `Private` placement heap: a pass that clears it 26.9 us against 676.2-676.5 us; a copy into another such texture 647.7-649.1 us against 673.9-693.2 us. The compressed image lies in the heap only where the heap's answer holds it (`heap_answers = HeapAnswerPolicy::Device`, the next row). This 2048x2048 texture's does not under either answer policy, so it takes the linear image under either compression value: a clear 963.5 us against 958.4 us under `heap_answers = HeapAnswerPolicy::Metal`, 955.3 us against 971.4 us under the default, the copy 488-496 us |
|
||||
| A heap texture whose image of the route the device takes for it needs more bytes or a coarser alignment of the heap than Metal's answer (each of a guest compositor's 22 heap shapes, `RGBA16Float` 2D arrays of one slice and 2D textures to 456x255: on ANV, whose compressed images align to 64 KiB; on the RTX 3090 at 1024; on the RX 7900 XTX at 256 to 64 KiB, where Metal answers 128 for each but the 299x299 array's 16 KiB): the size query (`heapTextureSizeAndAlign`) answers the larger of Metal's answer and that image's, and the texture lies in that image in the heap's bytes. A `Shared` texture's answer also holds the linear image a heap over host pages binds for it. Its alignment is the device's up to a heap's memory's own, 256 KiB, past which no image binds there (on the RX 7900 XTX, 128 KiB for a depth image and 256 KiB for a 4-sample render target past 128 texels a side). Where that image's alignment is past 256 KiB, or past both 4 KiB and the texture's size, the texture's image that a 4 KiB alignment holds takes its place (host-transfer usage, else linear), the answer that one's; else Metal's answer, as under the switch. A multisample texture takes it too and lies in its image in the heap's bytes, in the driver's layout of its samples, where under the switch it is a shadow of its samples in Metal's tiles (`heap_placed_targets`: a frame's 4-sample `RGBA16Float` and `Depth32Float` targets placed in a tracked `Private` heap). Metal's measured answers (4:2:2, one-plane YCbCr, two-plane extended-range, `X32_Stencil8`, `BlockWritesOnly` textures) and textures whose image lies in memory of its own keep Metal's answer. The runtime's choice: no pipeline differs. | `heap_answers = HeapAnswerPolicy::Device` | `heap_answers = HeapAnswerPolicy::Metal`: Metal's answer; the texture lies in an image that fits it (host-transfer usage, else linear: `heap-texture-host-transfer`, `heap-texture-linear`), else is a shadow of the heap's bytes in Metal's tiles, copied in before and out after the commands that use it (`shadowed-texture`) | A heap holds fewer such textures than Metal's: of the 22 shapes, the small arrays answer 4096 bytes where Metal answers 128 to 2176 (on ANV and the XTX; the XTX's 1x1 answers 256), and the 22 answers take 3769962 bytes of heaps placed one after another on ANV and 4155498 on the XTX, against Metal's 3656426 (`heap_texture_images`, `HEAP-COUNT`). A program that places a heap's resources by sizes of its own rather than the query's may overlap the texture with its neighbour; Metal's answer differs by GPU too (65536 on an AMD Radeon Pro 5300M, 4096 on an Intel UHD 630, 128 on an M3). `HeapTextureLargerThanMetal` (`heap-texture-larger-than-metal`), announced once per device; `tests::heap`, `tests::heap_placed_targets`, `heap_shadow_costs::heap_texture_images` | Of the 22 shapes made in heaps under the switch (`heap_texture_images`), on ANV (Iris Xe of RPL-P) 14 lie in an image put in place of their first one and 7 are shadows in Metal's tiles; on the RX 7900 XTX (RADV) 1 and 8, every other answer Metal's; under the default none on either. ANV (`heap_shadow_costs::heap_texture_shadow_costs`), a 1x1 `RGBA16Float` array held as a shadow: a frame that clears it and blits it 34.7 us in the heap against 8.2 us outside |
|
||||
| Batches of command buffers committed on one queue that the scheduler finds ready together (a backlog) go to the driver in one `vkQueueSubmit`, at most four and at most 16 ms of their queues' expected GPU runs summed (`GROUP_RUN`, `command_buffer/group.rs`: a kernel job that a timeout ends as a whole, as Linux's amdgpu ends one past 2 s by default, never carries more of the others' expected work than that), only the last signalling the queue's timeline, on a device whose own check finds a submission that signals nothing merged into the next (`submit_check.rs`, once per driver, release and kernel: one `vkQueueSubmit` of four empty infos against four calls of one, merged where the one costs at most 0.6 of the four; Mesa 26.2.6's RADV on the Radeon 780M, the RX 7900 XTX and the RX 550 at 0.33-0.38, ANV on the Iris Xe of RPL-P at 0.39, MoltenVK 1.4.2 on the M3 Max at 0.98; a device whose check has not answered, or that does not merge, takes the ungrouped form under either value of the switch): one kernel submission, where ANV on i915 lists every `VkDeviceMemory` in each (the consumer's guest drag on the Iris Xe: about 300 entries per execbuffer, 260 of them its host imports, at 112 to 128 execbuffers a frame). A batch's event signals ride to the group's end, which signals each event's semaphore to the highest index the batches held signal it to (an event's indices rise in commit order). A batch that signals a binary semaphore, takes a fence, binds a sparse update, does first work, names the caller's wrapped image, or waits for anything not seen complete (an event, another queue's work) goes alone, after the batches held: a batch with a wait leads a group, never joins one. Nor does an unshared queue's batch (`Device::new_command_queue_unshared`) on a `VkQueue` whose other queues' work is held back for it (`UnsharedIsolationPolicy::Bounded`, the default), and no group is kept there while earlier work runs (below): on RADV, ANV and lavapipe, whose one graphics `VkQueue` every command queue shares, a live unshared queue so keeps no group of any queue. Each batch on a `VkQueue` whose batches group that goes in a kernel submission of its own counts once by why (`WorkCounts::batches_alone_unshared` and kin), and `WorkCounts::batches_of_unshared_queues` counts the unshared queues' batches under either value. So does a batch whose queue's expected run is unknown (none of its batches seen complete yet) or would take the group past 16 ms (`WorkCounts::group_ends_long`), leading the next group where its own run is within the bound; a queue's expected GPU run follows its command buffers' own GPU times by their timestamps (raised at once by a longer one, halved toward a shorter one), which other `VkDevice`s' work on the GPU does not lengthen; with `DeviceOptions::gpu_times_from_host` it follows those host times, which hold other clients' work on the GPU too, so under contention there a queue's batches may stop grouping. So that checked command buffers (the consumer checks each) are found ready together, the submission checks of up to three batches right behind a line's head that goes run with the head's, in commit order, none committed after another queue's batch: such a check runs before the previous batch's `vkQueueSubmit` rather than after it, in the scheduler pass that submits its own batch. A pass that finds no batch ready sends the batches held, unless two or more earlier submissions of their `VkQueue` are not seen complete: the GPU runs those first in any case, so the batches stay held, and those committed meanwhile join them, until one submission is left in flight (a completion turn wakes the scheduler at its value), the group fills, a later batch sends it, a head waits for the GPU, or a thread waits for one of their command buffers' completion, which sends them at once; nor are they kept where the scheduler's thread runs next a submission handler of another queue's command buffer (one a pass that settled a switch of storage forms keeps; the thread hands every other pass's to the device's handler threads, where none holds its passes back): they go first, as Metal schedules a queue's command buffers whatever another queue's handler does (an M3 Max, probe `cross_queue_handler_waits`); a batch that ends a command buffer with a switch of storage forms riding on it, which settles by its submission's outcome, is never kept so. A batch a committing thread submits (`CommandBuffer::commit_and_submit`) goes alone where its `VkQueue` runs at most one earlier submission not seen complete, as the pass that held it would send the group at once; where two or more run it is left to the scheduler's thread, which holds it. A held batch that ends its command buffer is `Scheduled` as it is held, its submission handlers run first, then its scheduled handlers, and its kernel end time set, as an M3 Max schedules a command buffer committed behind running work 0.04 to 0.18 ms after its commit. The runtime's: no pipeline differs. | `completLine truncated
|
||||
| Batches of command buffers committed on one queue that the scheduler finds ready together (a backlog) go to the driver in one `vkQueueSubmit`, at most four and at most 16 ms of their queues' expected GPU runs summed (`GROUP_RUN`, `command_buffer/group.rs`: a kernel job that a timeout ends as a whole, as Linux's amdgpu ends one past 2 s by default, never carries more of the others' expected work than that), only the last signalling the queue's timeline, on a device whose own check finds a submission that signals nothing merged into the next (`submit_check.rs`, once per driver, release and kernel: one `vkQueueSubmit` of four empty infos against four calls of one, merged where the one costs at most 0.6 of the four; Mesa 26.2.6's RADV on the Radeon 780M, the RX 7900 XTX and the RX 550 at 0.33-0.38, ANV on the Iris Xe of RPL-P at 0.39, MoltenVK 1.4.2 on the M3 Max at 0.98; a device whose check has not answered, or that does not merge, takes the ungrouped form under either value of the switch): one kernel submission, where ANV on i915 lists every `VkDeviceMemory` in each (the consumer's guest drag on the Iris Xe: about 300 entries per execbuffer, 260 of them its host imports, at 112 to 128 execbuffers a frame). A batch's event signals ride to the group's end, which signals each event's semaphore to the highest index the batches held signal it to (an event's indices rise in commit order). A batch that signals a binary semaphore, takes a fence, binds a sparse update, does first work, names the caller's wrapped image, or waits for anything not seen complete (an event, another queue's work) goes alone, after the batches held: a batch with a wait leads a group, never joins one. Nor does an unshared queue's batch (`Device::new_command_queue_unshared`) on a `VkQueue` whose other queues' work is held back for it (`UnsharedIsolationPolicy::Bounded`, the default), and no group is kept there while earlier work runs (below): on RADV, ANV and lavapipe, whose one graphics `VkQueue` every command queue shares, a live unshared queue so keeps no group of any queue. Each batch on a `VkQueue` whose batches group that goes in a kernel submission of its own counts once by why (`WorkCounts::batches_alone_unshared` and kin), and `WorkCounts::batches_of_unshared_queues` counts the unshared queues' batches under either value. So does a batch whose queue's expected run is unknown (none of its batches seen complete yet) or would take the group past 16 ms (`WorkCounts::group_ends_long`), leading the next group where its own run is within the bound; a queue's expected GPU run follows its command buffers' own GPU times by their timestamps (raised at once by a longer one, halved toward a shorter one), which other `VkDevice`s' work on the GPU does not lengthen; with `DeviceOptions::gpu_times_from_host` it follows those host times, which hold other clients' work on the GPU too, so under contention there a queue's batches may stop grouping. So that checked command buffers (the consumer checks each) are found ready together, the submission checks of up to three batches right behind a line's head that goes run with the head's, in commit order, none committed after another queue's batch: such a check runs before the previous batch's `vkQueueSubmit` rather than after it, in the scheduler pass that submits its own batch. A pass that finds no batch ready sends the batches held, unless two or more earlier submissions of their `VkQueue` are not seen complete: the GPU runs those first in any case, so the batches stay held, and those committed meanwhile join them, until one submission is left in flight (a completion turn wakes the scheduler at its value), the group fills, a later batch sends it, a head waits for the GPU, or a thread waits for one of their command buffers' completion, which sends them at once; nor are they kept where the scheduler's thread runs next a submission handler of another queue's command buffer (one a pass that settled a switch of storage forms keeps; the thread hands every other pass's to the device's handler threads, where none holds its passes back): they go first, as Metal schedules a queue's command buffers whatever another queue's handler does (an M3 Max, probe `cross_queue_handler_waits`); a batch that ends a command buffer with a switch of storage forms riding on it, which settles by its submission's outcome, is never kept so. A batch a committing thread submits (`CommandBuffer::commit_and_submit`) goes alone where its `VkQueue` runs at most one earlier submission not seen complete, as the pass that held it would send the group at once; where two or more run it is left to the scheduler's thread, which holds it. A held batch that ends its command buffer is `Scheduled` as it is held, its submission handlers run first, then its scheduled handlers, and its kernel end time set, as an M3 Max schedules a command buffer committed behind running work 0.04 to 0.18 ms after its commit. The runtime's: no pipeline differs. | `completLine truncated
|
||||
| Batches of command buffers on one `VkQueue`, on a driver measured to start no kernel submission of a queue before the one before it completed (ANV, RADV and NVIDIA's; `batch_order.rs`), are ordered by their ends: each ends with a barrier ordering its work before every later command of its `VkQueue` (the exact form's end orders it before the host's reads and writes alone), so a batch that depends on an earlier one there begins with no barrier of its own, often no command buffer of barriers, and its first encoder's GPU start is written at the bottom of the pipe, once everything before it completed. Metal starts an independent command buffer committed behind running work while that work runs (an M3 Max under macOS 27.0.1, probe `gpustart`); those drivers ran two batches of independent work one after the other under every shape measured (no end barrier, the host's or the widened one; in one `vkQueueSubmit` or two, merged into one kernel submission or not), where two dispatches of one command buffer ran side by side. The runtime's: no pipeline differs. | `batch_order = BatchOrderPolicy::Ends` | `batch_order = BatchOrderPolicy::Exact`: a barrier for each dependency of a batch's work on an earlier batch's of its `VkQueue`, the end's barrier to the host's reads and writes alone, the GPU start written at the top of the pipe; every other driver takes it under either value | None: on those drivers each batch starts once the one before it completed under either value, so the work's order, its results and its GPU times are the same, and a batch's GPU start is the end of the work before it, when such a driver starts it. Not announced; `runtime_lane::commit_work` and `runtime_lane::gpu_times` test both values | UHD 770 (ANV, RPL-S), the consumer's frame shape over 520 host imports, 67 command buffers a frame, Grouped completion, the widened end barrier against the exact form (a probe build of each): with no fill ahead of each command buffer, 67.0 command buffers submitted a frame against 129.3-129.7, the GPU's span a frame 1.84-1.90 ms against 1.99-2.06 ms, a frame through completion 2.13-2.22 ms against 2.27-2.38 ms; with a 1 MiB fill ahead of each, 134.0 against 262.9, 8.03-8.22 ms against 8.32-8.42 ms, 9.00-9.15 ms against 9.25-9.36 ms. Radeon 780M (RADV, Mesa 26.0.8), this switch: with no fill, 67.0 against 128.9-129.0, a frame through completion 48.3-48.6 ms against 42.6-47.0 ms; with a 16 MiB fill committed at once, 134.0 against 251.0-251.1, 50.6-50.8 ms against 50.8-57.3 ms; committed every 1 ms, 134.0 against 249.7-250.2, 71.3-83.6 ms against 106.3-113.6 ms (each kernel submission there leaves about 2.5 ms of the GPU idle over 520 host imports, which sets these frames) |
|
||||
| Command queues on a device whose GPU idles when consecutive work comes from another `VkQueue` share `VkQueue`s by choice (`queue_share.rs`): the runtime's own self-check, not a `DriverFact` row, measures that idling once per driver, release and runtime on a thread of its own and keeps its verdict (`Idles`, `DoesNotIdle`, `Unchecked`) in the shader cache's directory, as the in-place check keeps its own (`queue_switch_check.rs`: 48.7 to 51.3 us a switch on the RTX 5080 Laptop GPU, NVIDIA 615.71.09, `Idles` above 20 us). A command queue that makes a command buffer while it holds no other uncompleted one moves onto the busy `VkQueue` of its family whose oldest batch has run under 0.5 ms, the most batches in flight first, so short command buffers of several queues run with no switch between them. A queue one of whose command buffers ran on the GPU for over 2 ms, by its own timestamps (not the host's view of how long it ran as its `VkQueue`'s oldest, which also holds its wait for the GPU to start it and the waiter's lateness to see it complete), or held its `VkQueue` for over 2 ms from the submission of a batch that waited on the GPU for another `VkQueue`'s work (an `MTLEvent`'s signal, the tracker's wait, new resources' first work) to its own GPU end, is long: no queue joins its `VkQueue` while it lives, and it moves once more, at its next idle point, to an idle `VkQueue` no long or unshared queue holds. A queue whose command buffers must never wait behind another queue's (a compositor's beside an application's) is made with `Device::new_command_queue_unshared`: it never moves and no queue joins its `VkQueue`. Under either value, as a queue is made, it takes the round robin's `VkQueue` the fewest live command queues hold, of those no unshared queue holds, in turn among equals, and an unshared queue one no command queue holds where one is free (one pass over the `VkQueue`s' counts; one that finds none shares the one the fewest hold, `WorkCounts::unshared_queues_sharing_a_vk_queue`). Presenting queues and a queue that lent its `VkQueue` (`with_vk_queue`) never move. Before the verdict, and where it is not `Idles` or there are no two `VkQueue`s of one family (MoltenVK, RADV, lavapipe), every queue keeps the `VkQueue` it took at its creation; so does every queue of a device whose command buffers write no GPU timestamps it reads (`gpu_times_from_host`, or a driver whose timestamps wait for every queue's), which does not share and is counted (`WorkCounts::queue_sharing_untimed`). The runtime's: no pipeline differs. | `queue_sharing = QueueSharingPolicy::Adaptive` | `queue_sharing = QueueSharingPolicy::PerQueue`: each command queue keeps the `VkQueue` it took at its creation (the fewest live queues' as above), and the check does not run | A command buffer waits behind the command buffers of the queues sharing its `VkQueue`, where Metal's queues wait for each other only inside one command. The residual stall: once per logical queue that goes long, for a queue that joined its `VkQueue` during its short phase, about one long command buffer's length: the command buffers committed behind that queue's first long one there wait for its whole length (and those behind its later ones while it holds work, until its next idle point). Measured on the RTX 5080 Laptop GPU beside an application that alternates draws with 30 ms command buffers: a shared compositor's commits at 4,800 a second had 64 completions over 10 ms, at most 26.4 to 30.1 ms, in each of 3 runs of each of two such shapes (one join each), against none over 10 ms under `PerQueue` in those 6 runs (at most 5.6 to 9.7 ms); with 2 ms of draws between long command buffers, none over 10 ms in 3 runs (at most 5.7 to 9.8 ms) against 7, 0 and 0 under `PerQueue` (at most 6.9 to 11.2 ms). On an unshared queue, 0 over 10 ms in every run. A command buffer's GPU start time includes the other queues' work before it. `QueueSharing` (`queue-sharing`), at the device's first join | Command buffers a second on the RTX 5080 Laptop GPU, one-draw command buffers, each thread its own queue, the default against `PerQueue`, runs after a lock hold's first: 8 threads with 3 in flight 50.7k to 54.7k against 27.4k to 28.0k (5 runs each); 8 threads with 1 in flight 47.0k to 50.1k against 13.9k to 14.3k (5); 2 threads with 3 in flight 28.0k to 53.7k against 21.4k to 28.0k (10 each, in turn, the default above `PerQueue` in each pair; no thread's queue marked long), and beside another process's 30 ms command buffers 5.1k to 6.7k against 4.0k to 4.1k (3 each; the host's view marked a thread's queue long in 1 of 3 runs, which then ran at `PerQueue`'s 4.1k); 2 threads with 1 in flight 16.9k to 20.7k against 10.1k to 11.5k (5); one thread over 16 queues in turn 21.7k to 43.3k against 10.2k to 11.1k, over 2,048 20.0k to 39.2k against 10.2k to 11.2k (4). Beside an application whose queue never shared with the compositor (isolation, 300 and 30 dispatches), both 0 over 10 ms |
|
||||
| A chain of `half` additions, subtractions and products on a device without `shaderFloat16` (vk12-floor, SwiftShader, Pascal; capability emulation: the module computes each in `float` and rounds it by the device's `OpQuantizeToF16`): an operation whose flags hold `contract` and `reassoc` and whose result only such operations read is held at `float` precision unrounded, so the chain rounds where a value leaves it (a store, an output, a conversion, a comparison, a call, a phi, a vector move, an operation without both flags), one quantize per exit instead of one per operation (`lower::arith::half_chain`). A device with `shaderFloat16` computes `half` alike under either value. | `half_chains = HalfChainPolicy::AtExits` | `half_chains = HalfChainPolicy::EachOperation`: every operation's result rounded to `half`, as the AIR computes it | The result may differ from the rounded operations' by the roundings the chain skips, each within half a unit in the last place of a `half` at its step, compounded along the chain; a value inside the chain past `half`'s range (65504) stays finite where the rounded operations reach infinity. Within the AIR's flags, which let a compiler regroup and fuse such operations. `FastMathRewrites` (`fast-math-rewrites`) | Not timed. Size on vk12-floor (the fixtures' SPIR-V words, the default against the accurate form): `hfb_filter_bank` 121,270 against 131,766 (1,024 quantizes against 2,464), `grd_half_many_samples` 82,019 against 84,627, `nan_half_fast` 9,808 against 9,832 |
|
||||
|
||||
+2
-2
@@ -338,7 +338,7 @@ Columns:
|
||||
| `EncoderOpen` | An encoder of this command buffer is open | every device (a public call's own check of its arguments) | `metal-measured`: an M4: plain Metal asserts "A command encoder is already encoding to this command buffer" | 2: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (commit_refusal)`, `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (queue_commit)` | `-` |
|
||||
| `ProtectedEncoder` | A compute or render encoder made, or a blit encoder's first command (`call` names the blit encoder), under protection options 1, 3 or 7... | every device (a public call's own check of its arguments) | `metal-measured`: an M3 Max, macOS 26.7: Metal's process ends, SIGABRT, as the consumer measured | 2: `crates/metal2vulkan-runtime/src/blit.rs (refuse_aborted)`, `crates/metal2vulkan-runtime/src/command_buffer/protection.rs (refuse_protected)` | `-` |
|
||||
| `EncoderAbandoned` | An encoder of this command buffer was dropped without `end_encoding` | every device (a public call's own check of its arguments) | `metal-documented`: Metal asserts "Command encoder released without endEncoding" | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (commit_refusal)` | `-` |
|
||||
| `AlreadyCommitted` | The command buffer was already committed | every device (a public call's own check of its arguments) | `metal-documented`: Metal asserts "commit an already committed command buffer" | 4: `crates/metal2vulkan-runtime/src/command_buffer/checks.rs (set_submission_check)`, `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (commit_refusal)` (+2) | `-` |
|
||||
| `AlreadyCommitted` | The command buffer was already committed | every device (a public call's own check of its arguments) | `metal-documented`: Metal asserts "commit an already committed command buffer" | 5: `crates/metal2vulkan-runtime/src/command_buffer/checks.rs (set_submission_check)`, `crates/metal2vulkan-runtime/src/command_buffer/group.rs (set_completion_joins_next)` (+3) | `-` |
|
||||
| `ScheduledSignalAfterCompletion` | A scheduled signal encoded once the command buffer completed, or failed (status `Error`) (`CommandBuffer::encode_signal_event_scheduled`) | every device (a public call's own check of its arguments) | `metal-measured`: an M3 Max, macOS 27.0.1: a segmentation fault in 10 of 15 runs, as the consumer measured | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (encode_signal_event_scheduled)` | `-` |
|
||||
| `ForeignObject` | An object made by another device | every device (a public call's own check of its arguments) | `unknown`: Metal's answer for an object another device made is unmeasured | 1: `crates/metal2vulkan-runtime/src/device/line.rs (foreign)` | `-` |
|
||||
| `DmaBuf` | Dma-bufs a `DmaBufSource` returned (a runtime extension | every device (a public call's own check of its arguments) | `ours`: a runtime extension's own contract: Metal imports no dma-buf | 3: `crates/metal2vulkan-runtime/src/dma_buf.rs (import_from_source)`, `crates/metal2vulkan-runtime/src/dma_buf.rs (ram_runs_as_dma_buf)` (+1) | `-` |
|
||||
@@ -840,7 +840,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `invalid::EncoderOpen`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (commit_refusal)`; `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (queue_commit)`
|
||||
- `invalid::ProtectedEncoder`: `crates/metal2vulkan-runtime/src/blit.rs (refuse_aborted)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs (refuse_protected)`
|
||||
- `invalid::EncoderAbandoned`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (commit_refusal)`
|
||||
- `invalid::AlreadyCommitted`: `crates/metal2vulkan-runtime/src/command_buffer/checks.rs (set_submission_check)`; `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (commit_refusal)`; `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (encode_signal_event_scheduled)`; `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (refusal)`
|
||||
- `invalid::AlreadyCommitted`: `crates/metal2vulkan-runtime/src/command_buffer/checks.rs (set_submission_check)`; `crates/metal2vulkan-runtime/src/command_buffer/group.rs (set_completion_joins_next)`; `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (commit_refusal)`; `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (encode_signal_event_scheduled)`; `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (refusal)`
|
||||
- `invalid::ScheduledSignalAfterCompletion`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (encode_signal_event_scheduled)`
|
||||
- `invalid::ForeignObject`: `crates/metal2vulkan-runtime/src/device/line.rs (foreign)`
|
||||
- `invalid::DmaBuf`: `crates/metal2vulkan-runtime/src/dma_buf.rs (import_from_source)`; `crates/metal2vulkan-runtime/src/dma_buf.rs (ram_runs_as_dma_buf)`; `crates/metal2vulkan-runtime/src/dma_buf.rs (ram_span_as_dma_buf)`
|
||||
|
||||
Reference in new issue
Block a user