rt: a texture over a buffer in an imported block is the counted copy, on every device
replay's census C: the window server (b3) makes 425 textures over its no-copy buffers, and every no-copy buffer is now an import, so refusing them (Gap::TextureOverBuffer in d335594515) would refuse the window server's textures. They take rt's existing copy form instead: an image of its own, which the device copies the buffer's bytes into before the submissions that use it and back after a command writes it, counted in Metrics::over_copies. The buffer stays the import itself. The runtime makes no image in imported memory. Such an image would be made for the import's handle (VUID-vkBindImageMemory-memory-02728), so in the undefined layout (VUID-VkImageCreateInfo-pNext-01443). An acquire from VK_QUEUE_FAMILY_FOREIGN_EXT is not used: it needs a matching release (7.7.6), which host writes do not make (host memory imported by its address is shared with the host as host access), and it leaves an aliasing resource's contents undefined (7.7.6). Whether an in-place form exists stays open with the planner until the copy's cost is measured. - check_over answers the copy for a buffer in an imported block; Gap::TextureOverBuffer's doc goes back to its old cases; new_texture's doc and the README say how such a texture is made, and the README records it as a known gap. - Tests: the import device tests run on every platform (host memory from std::alloc; the shared-file mapping test unix-only), so the Windows UHD leg runs them. A texture over imported host memory is copied on every device, reads the host's own bytes, its writes reach the host, and both copies count in over_copies. - REFUSALS regenerated for the import limits (the rebase took development's at d335594515). Verified: nothing yet; the check job and the device legs follow.
This commit is contained in:
1 parent
d29a50fbcb
commit
feec58e2f5
5 files changed
+215
-63
No files matched your search
@@ -358,8 +358,10 @@ counts against the device's allocations; `Gauges::imports` counts those live. Th
|
||||
until its last handle and its last buffer, command buffer or upload are gone; then the block-maker
|
||||
thread frees its memory, which ends the import, and runs `release`, Metal's deallocator, after it
|
||||
(at teardown, on the thread that tears down). Neither `BlockMappings` hook runs for an imported
|
||||
block. A texture over a buffer in an imported block is `Gap::TextureOverBuffer`: an image bound to
|
||||
imported memory must be made for its handle, which the runtime does not do.
|
||||
block. A texture over a buffer in an imported block is the counted copy of a texture over a
|
||||
buffer: an image of its own, which the device copies the buffer's bytes into before the
|
||||
submissions that use it and back after a command writes it (`Metrics::over_copies`); the buffer
|
||||
stays the import itself.
|
||||
|
||||
### Known gaps of memory blocks
|
||||
|
||||
@@ -380,6 +382,10 @@ imported memory must be made for its handle, which the runtime does not do.
|
||||
arguments) or of the index size (indexed draws), which documented Metal does not allow, its
|
||||
pointer being page-aligned. The consumer places every other buffer at an aligned byte. Such a
|
||||
buffer is still made and its other uses run; only the dispatch or draw is refused.
|
||||
- A texture over a buffer in an imported block is the counted copy of a texture over a buffer on
|
||||
every device (`Metrics::over_copies`): its bytes are copied into an image of its own before the
|
||||
submissions that use it, and back after a command writes it. The runtime makes no image in
|
||||
imported memory.
|
||||
- On the NVIDIA cards we measured in Thunderbolt enclosures, freeing host-visible memory takes
|
||||
about 1.1 ms per MiB and holds any submit of the same process for its length; on an internal
|
||||
NVIDIA card the same free takes about 0.5 ms per 16 MiB. rt frees one idle allocation at a time,
|
||||
|
||||
@@ -903,12 +903,10 @@ pub enum Gap {
|
||||
},
|
||||
/// A texture over a buffer ([`Buffer::new_texture`](crate::Buffer::new_texture)) the runtime
|
||||
/// does not make: other than 2D of one level, sample and slice; of a format of other than
|
||||
/// one color texel an element; whose first texel in the bytes shaders reach is not a whole
|
||||
/// number of texels in, which no copy addresses; or over a buffer in an imported block, whose
|
||||
/// memory no image made without its handle may be bound to.
|
||||
/// one color texel an element; or whose first texel in the bytes shaders reach is not a whole
|
||||
/// number of texels in, which no copy addresses.
|
||||
///
|
||||
/// Basis: ours (the in-place linear image and the copy form take one 2D color image, and
|
||||
/// neither an image of an imported handle).
|
||||
/// Basis: ours (the in-place linear image and the copy form take one 2D color image).
|
||||
TextureOverBuffer {
|
||||
/// The texture's pixel format.
|
||||
pixel_format: PixelFormat,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//! Imports: the two type rules, and under a device cfg, on every device of the cfg's kind, that
|
||||
//! host memory is imported into the first host-visible, host-coherent type its query offers, that
|
||||
//! a GPU write reaches it and its release runs only once its memory is freed, that an ordinary
|
||||
//! Shared allocation succeeds after an import of a shared mapping of a file (which RADV refuses
|
||||
//! at the import), that an import counts against the device's allocations, and that a dma-buf is
|
||||
//! imported where its first offered type is host-visible and host-coherent and refused at the
|
||||
//! query, with nothing imported, everywhere else.
|
||||
//! a GPU write reaches it and its release runs only once its memory is freed, that a texture over
|
||||
//! a buffer in an imported block is read and written by blits through the counted copy, that an
|
||||
//! ordinary Shared allocation succeeds after an import of a shared mapping of a file (which RADV
|
||||
//! refuses at the import), that an import counts against the device's allocations, and that a
|
||||
//! dma-buf is imported where its first offered type is host-visible and host-coherent and refused
|
||||
//! at the query, with nothing imported, everywhere else.
|
||||
|
||||
use crate::import::host_type;
|
||||
|
||||
@@ -54,13 +55,17 @@ fn host_memory_takes_the_first_coherent_listed_type_offered() {
|
||||
assert_eq!(host_type(0, 0xff, 0xff), None);
|
||||
}
|
||||
|
||||
/// On unix, where the tests map host memory themselves.
|
||||
#[cfg(all(unix, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
#[cfg(any(m2v_gpu, m2v_cpu_icd))]
|
||||
mod on_device {
|
||||
use crate::memory::Release;
|
||||
use crate::tests::command::on_device::{each_device, finished};
|
||||
use crate::tests::devices_of_the_cfgs_kind;
|
||||
use crate::{Device, DeviceOptions, Error, ImportHandle, Limit, MemoryClass};
|
||||
use crate::{
|
||||
BufferLayout, Device, DeviceOptions, Error, ImportHandle, IndexClass, Limit, MemoryClass,
|
||||
PixelFormat, Region, StorageMode, TextureDescriptor, TexturePlace, TextureType,
|
||||
TextureUsage,
|
||||
};
|
||||
use std::alloc::Layout;
|
||||
use std::ptr::NonNull;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
@@ -78,37 +83,22 @@ mod on_device {
|
||||
}
|
||||
}
|
||||
|
||||
/// `len` bytes of fresh anonymous memory at a multiple of `alignment`, each byte its offset
|
||||
/// times 7; and the mapping to unmap, its address and length.
|
||||
fn anonymous(len: u64, alignment: u64) -> (NonNull<u8>, (usize, usize)) {
|
||||
let whole = (len + alignment) as usize;
|
||||
// SAFETY: a new private mapping, which nothing else uses.
|
||||
let base = unsafe {
|
||||
libc::mmap(
|
||||
std::ptr::null_mut(),
|
||||
whole,
|
||||
libc::PROT_READ | libc::PROT_WRITE,
|
||||
libc::MAP_PRIVATE | libc::MAP_ANONYMOUS,
|
||||
-1,
|
||||
0,
|
||||
)
|
||||
};
|
||||
assert_ne!(base, libc::MAP_FAILED, "an anonymous mapping");
|
||||
let start = (base as u64).next_multiple_of(alignment) as usize;
|
||||
let pointer = NonNull::new(start as *mut u8).expect("a mapping's address");
|
||||
/// `len` bytes of host memory of the test's own at a multiple of `alignment`, each byte its
|
||||
/// offset times 7, and the allocation to free.
|
||||
fn host_memory(len: u64, alignment: u64) -> (NonNull<u8>, (NonNull<u8>, Layout)) {
|
||||
let layout = Layout::from_size_align(len as usize, alignment as usize).expect("a layout");
|
||||
// SAFETY: the layout's size is not zero.
|
||||
let pointer = NonNull::new(unsafe { std::alloc::alloc(layout) }).expect("an allocation");
|
||||
for at in 0..len as usize {
|
||||
// SAFETY: `at` is inside the mapping.
|
||||
// SAFETY: `at` is inside the allocation.
|
||||
unsafe { pointer.add(at).write((at * 7) as u8) };
|
||||
}
|
||||
(pointer, (base as usize, whole))
|
||||
(pointer, (pointer, layout))
|
||||
}
|
||||
|
||||
fn unmap((address, len): (usize, usize)) {
|
||||
// SAFETY: a mapping the test made, which nothing uses any more.
|
||||
assert_eq!(
|
||||
unsafe { libc::munmap(address as *mut libc::c_void, len) },
|
||||
0
|
||||
);
|
||||
fn free((pointer, layout): (NonNull<u8>, Layout)) {
|
||||
// SAFETY: an allocation of `layout` the test made, which nothing uses any more.
|
||||
unsafe { std::alloc::dealloc(pointer.as_ptr(), layout) };
|
||||
}
|
||||
|
||||
/// A release that sets a flag, and the flag.
|
||||
@@ -128,7 +118,7 @@ mod on_device {
|
||||
each_device("import_host_memory", |name, _, device| {
|
||||
let counters = device.counters();
|
||||
let Some((_, alignment)) = device.core().imports.host.as_ref() else {
|
||||
let (pointer, mapping) = anonymous(64 << 10, 4096);
|
||||
let (pointer, mapping) = host_memory(64 << 10, 4096);
|
||||
let (release, _) = releasing();
|
||||
// SAFETY: the memory is the test's, mapped until it unmaps it below.
|
||||
match unsafe { device.import_host_memory(pointer, 64 << 10, release) } {
|
||||
@@ -137,13 +127,13 @@ mod on_device {
|
||||
})) => {}
|
||||
other => panic!("{name}: {other:?}"),
|
||||
}
|
||||
unmap(mapping);
|
||||
free(mapping);
|
||||
println!("import: {name}: imports no host memory, refused typed");
|
||||
return;
|
||||
};
|
||||
let alignment = *alignment;
|
||||
let len = (64u64 << 10).next_multiple_of(alignment);
|
||||
let (pointer, mapping) = anonymous(len, alignment);
|
||||
let (pointer, mapping) = host_memory(len, alignment);
|
||||
let before = counters.gauges();
|
||||
let (release, released) = releasing();
|
||||
// SAFETY: the memory is the test's, mapped until it unmaps it after the release.
|
||||
@@ -193,7 +183,7 @@ mod on_device {
|
||||
wait_until("the release", || released.load(Ordering::SeqCst));
|
||||
let after = counters.gauges();
|
||||
assert_eq!((after.imports, after.blocks), (0, held - 1), "{name}");
|
||||
unmap(mapping);
|
||||
free(mapping);
|
||||
println!(
|
||||
"import: {name}: host memory imported into type {memory_type} (device-local \
|
||||
{device_local}), written by the GPU, released after its free"
|
||||
@@ -201,10 +191,159 @@ mod on_device {
|
||||
});
|
||||
}
|
||||
|
||||
/// A texture over a buffer in an imported block of host memory, read and written by shaders,
|
||||
/// is the counted copy on every device: a blit's read of it into a Shared buffer finds the
|
||||
/// host's rows, a blit's write to it reaches the host's memory, and the copies between the
|
||||
/// buffer and its image count in `Metrics::over_copies`.
|
||||
#[test]
|
||||
fn every_device_makes_a_texture_over_an_imported_buffer() {
|
||||
each_device("import_texture", |name, _, device| {
|
||||
const WIDTH: u32 = 64;
|
||||
const HEIGHT: u32 = 8;
|
||||
let Some((_, alignment)) = device.core().imports.host.as_ref() else {
|
||||
println!("import: {name}: imports no host memory");
|
||||
return;
|
||||
};
|
||||
let alignment = *alignment;
|
||||
let row = u64::from(WIDTH) * 4;
|
||||
let rows = u64::from(HEIGHT);
|
||||
let answer = (device.minimum_linear_texture_alignment(PixelFormat::RGBA8Unorm))
|
||||
.unwrap_or_else(|error| panic!("{name}: {error}"));
|
||||
let pitch = row.next_multiple_of(answer);
|
||||
let len = (pitch * rows).next_multiple_of(alignment);
|
||||
let (pointer, mapping) = host_memory(len, alignment);
|
||||
let (release, released) = releasing();
|
||||
// SAFETY: the memory is the test's, mapped until it unmaps it after the release.
|
||||
let (block, memory_type) = unsafe { device.import_host_memory(pointer, len, release) }
|
||||
.unwrap_or_else(|error| panic!("{name}: an import: {error}"));
|
||||
let buffer = (device.new_buffer(block.id, 0, len, None)).expect("a buffer");
|
||||
let first = IndexClass::Texture.range().start;
|
||||
(device.grant_indices(IndexClass::Texture, first, 1)).expect("a grant");
|
||||
let mut d =
|
||||
TextureDescriptor::new(TextureType::Type2D, PixelFormat::RGBA8Unorm, WIDTH, HEIGHT);
|
||||
d.usage = TextureUsage::SHADER_READ | TextureUsage::SHADER_WRITE;
|
||||
let texture = (buffer.new_texture(&d, Some(first), 0, pitch))
|
||||
.unwrap_or_else(|error| panic!("{name}: a texture over the import: {error}"));
|
||||
assert_eq!(
|
||||
texture.descriptor().storage_mode,
|
||||
StorageMode::Shared,
|
||||
"{name}"
|
||||
);
|
||||
assert!(texture.copied_over().is_some(), "{name}: copied");
|
||||
let copies = || device.counters().metrics().over_copies;
|
||||
let before = copies();
|
||||
// The host's rows, as the image's texels.
|
||||
let host = |at: u64| {
|
||||
// SAFETY: `at` is inside the imported memory, which the test still maps.
|
||||
unsafe { pointer.add(at as usize).read_volatile() }
|
||||
};
|
||||
let packed = |byte: &dyn Fn(u64) -> u8| -> Vec<u8> {
|
||||
(0..rows)
|
||||
.flat_map(|y| (0..row).map(move |x| (y, x)))
|
||||
.map(|(y, x)| byte(y * pitch + x))
|
||||
.collect()
|
||||
};
|
||||
let queue = device.new_command_queue(4).expect("a queue");
|
||||
|
||||
// Read: a blit of the image into a Shared buffer finds the host's rows.
|
||||
let out_block = (device.take_block(MemoryClass::Shared, row * rows))
|
||||
.unwrap_or_else(|error| panic!("{name}: {error}"));
|
||||
let out = (device.new_buffer(out_block.id, 0, row * rows, Some(0))).expect("a buffer");
|
||||
let command_buffer = queue.command_buffer().expect("a command buffer");
|
||||
let mut encoder = command_buffer.blit_command_encoder().expect("an encoder");
|
||||
let layout = BufferLayout {
|
||||
offset: 0,
|
||||
bytes_per_row: row,
|
||||
bytes_per_image: 0,
|
||||
};
|
||||
encoder
|
||||
.copy_from_texture_to_buffer(
|
||||
&texture,
|
||||
TexturePlace::default(),
|
||||
[WIDTH, HEIGHT, 1],
|
||||
&out,
|
||||
layout,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("{name}: {error}"));
|
||||
encoder.end_encoding();
|
||||
command_buffer.commit().expect("a commit");
|
||||
finished(name, &command_buffer);
|
||||
assert_eq!(command_buffer.error(), None, "{name}");
|
||||
let contents = out.contents().expect("Shared");
|
||||
// SAFETY: the buffer's bytes, which no command writes any more.
|
||||
let read =
|
||||
unsafe { std::slice::from_raw_parts(contents.as_ptr(), (row * rows) as usize) };
|
||||
let written: Vec<u8> = (0..rows)
|
||||
.flat_map(|y| (0..row).map(move |x| ((y * pitch + x) * 7) as u8))
|
||||
.collect();
|
||||
assert!(
|
||||
read == written.as_slice() && packed(&host) == written,
|
||||
"{name}: the image read the host's bytes"
|
||||
);
|
||||
let copied_in = copies();
|
||||
assert!(copied_in > before, "{name}: the bytes copied in, counted");
|
||||
|
||||
// Write: a blit from a plain texture reaches the host's memory.
|
||||
let mut plain_d = d;
|
||||
plain_d.usage = TextureUsage::RENDER_TARGET;
|
||||
plain_d.storage_mode = StorageMode::Shared;
|
||||
let plain = (device.new_texture(&plain_d, None))
|
||||
.unwrap_or_else(|error| panic!("{name}: {error}"));
|
||||
let source: Vec<u8> = (0..row * rows).map(|i| (i % 241) as u8 ^ 0x3c).collect();
|
||||
let whole = Region {
|
||||
origin: [0; 3],
|
||||
size: [WIDTH, HEIGHT, 1],
|
||||
};
|
||||
(plain.replace_region(whole, 0, 0, &source, row, 0))
|
||||
.unwrap_or_else(|error| panic!("{name}: {error}"));
|
||||
let command_buffer = queue.command_buffer().expect("a command buffer");
|
||||
let mut encoder = command_buffer.blit_command_encoder().expect("an encoder");
|
||||
encoder
|
||||
.copy_from_texture(
|
||||
&plain,
|
||||
TexturePlace::default(),
|
||||
[WIDTH, HEIGHT, 1],
|
||||
&texture,
|
||||
TexturePlace::default(),
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("{name}: {error}"));
|
||||
encoder.end_encoding();
|
||||
command_buffer.commit().expect("a commit");
|
||||
finished(name, &command_buffer);
|
||||
assert_eq!(command_buffer.error(), None, "{name}");
|
||||
assert!(
|
||||
packed(&host) == source,
|
||||
"{name}: the write reached the host"
|
||||
);
|
||||
assert!(
|
||||
copies() > copied_in,
|
||||
"{name}: the image copied back, counted"
|
||||
);
|
||||
let counted = copies() - before;
|
||||
drop((
|
||||
command_buffer,
|
||||
queue,
|
||||
texture,
|
||||
plain,
|
||||
out,
|
||||
out_block,
|
||||
buffer,
|
||||
block,
|
||||
));
|
||||
wait_until("the release", || released.load(Ordering::SeqCst));
|
||||
free(mapping);
|
||||
println!(
|
||||
"import: {name}: a texture over imported host memory (type {memory_type}), \
|
||||
copied ({counted} copies counted), read and written"
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/// After an import of 64 KiB of a shared mapping of a file (the shape of a guest's RAM, which
|
||||
/// RADV refuses at the import), whatever its answer, an ordinary Shared allocation succeeds:
|
||||
/// a take of 32 MiB, past the pool's 16 MiB allocations, which makes its own. A refused
|
||||
/// import leaves the gauges as they were.
|
||||
#[cfg(unix)]
|
||||
#[test]
|
||||
fn every_device_allocates_shared_memory_after_an_import_of_a_shared_file_mapping() {
|
||||
each_device("import_shared_file", |name, _, device| {
|
||||
@@ -272,6 +411,7 @@ mod on_device {
|
||||
}
|
||||
|
||||
/// A file of `len` bytes in the OS temp dir, removed from the directory at once.
|
||||
#[cfg(unix)]
|
||||
fn tempfile(len: u64) -> std::fs::File {
|
||||
let path = std::env::temp_dir().join(format!("m2v-import-{}", std::process::id()));
|
||||
let file = std::fs::OpenOptions::new()
|
||||
@@ -309,8 +449,8 @@ mod on_device {
|
||||
counters.gauges().blocks == u64::from(MAX - 1)
|
||||
});
|
||||
let len = (64u64 << 10).next_multiple_of(alignment);
|
||||
let (first, first_mapping) = anonymous(len, alignment);
|
||||
let (second, second_mapping) = anonymous(len, alignment);
|
||||
let (first, first_mapping) = host_memory(len, alignment);
|
||||
let (second, second_mapping) = host_memory(len, alignment);
|
||||
let (release, first_released) = releasing();
|
||||
// SAFETY: the memory is the test's, mapped until it unmaps it after the release.
|
||||
let (block, _) = unsafe { device.import_host_memory(first, len, release) }
|
||||
@@ -327,8 +467,8 @@ mod on_device {
|
||||
wait_until("the release", || first_released.load(Ordering::SeqCst));
|
||||
assert!(!second_released.load(Ordering::SeqCst), "{name}");
|
||||
drop(device);
|
||||
unmap(first_mapping);
|
||||
unmap(second_mapping);
|
||||
free(first_mapping);
|
||||
free(second_mapping);
|
||||
println!("import: {name}: an import past the count refused");
|
||||
}
|
||||
}
|
||||
@@ -464,7 +604,7 @@ mod on_device {
|
||||
drop(shared);
|
||||
if let Some((_, alignment)) = device.core().imports.host.as_ref() {
|
||||
let len = LEN.next_multiple_of(*alignment);
|
||||
let (pointer, mapping) = anonymous(len, *alignment);
|
||||
let (pointer, mapping) = host_memory(len, *alignment);
|
||||
let (release, host_released) = releasing();
|
||||
// SAFETY: the memory is the test's, mapped until it unmaps it below.
|
||||
let (block, _) =
|
||||
@@ -472,7 +612,7 @@ mod on_device {
|
||||
.unwrap_or_else(|error| panic!("{name}: host memory: {error}"));
|
||||
drop(block);
|
||||
wait_until("the release", || host_released.load(Ordering::SeqCst));
|
||||
unmap(mapping);
|
||||
free(mapping);
|
||||
}
|
||||
println!(
|
||||
"import: {name}: a dma-buf refused at the query (offered {offered:#x}, \
|
||||
|
||||
@@ -1177,16 +1177,16 @@ fn check_over(
|
||||
return Err(gap());
|
||||
}
|
||||
let (block, copy) = buffer.held();
|
||||
// An imported block's memory takes no image made without its handle.
|
||||
if copy.is_none() && block.memory.imported {
|
||||
return Err(gap());
|
||||
}
|
||||
// Over an imported block, the copy: an image bound there would be made for the import's
|
||||
// handle, so in the undefined layout (VUID-VkImageCreateInfo-pNext-01443), and the runtime
|
||||
// makes no image in imported memory.
|
||||
let imported = copy.is_none() && block.memory.imported;
|
||||
let spilled = copy.is_none() && block.memory.spilled();
|
||||
let extent = linear_extent(core, shape, plan)
|
||||
.is_some_and(|max| d.width <= max.width && d.height <= max.height);
|
||||
let (linear, optimal) = core.format_features(plan.format);
|
||||
let features = linear.contains(optimal & kept_features(plan.usage));
|
||||
Ok(!spilled && extent && features)
|
||||
Ok(!imported && !spilled && extent && features)
|
||||
}
|
||||
|
||||
/// The format features an image of `usage` is used by, which a linear image is to keep where the
|
||||
@@ -3479,7 +3479,9 @@ impl Buffer {
|
||||
///
|
||||
/// Where the device's linear image does not take the texture (another pitch, an offset off
|
||||
/// its memory alignment, a format or usage its linear tiling lacks, memory that spilled, a
|
||||
/// render target whose advertised subresource passes its rows or the buffer), the
|
||||
/// render target whose advertised subresource passes its rows or the buffer), and over a
|
||||
/// buffer in an imported block (a no-copy buffer's, [`Device::import_host_memory`],
|
||||
/// [`Device::import_dma_buf`]), the
|
||||
/// texture is an optimal image of its own, which the device copies the bytes shaders reach
|
||||
/// into and back (`crate::over`): over a Shared buffer once a submission, over a Managed
|
||||
/// buffer's device copy only at Metal's Managed events. Each copy counts in
|
||||
|
||||
+12
-6
@@ -38,7 +38,7 @@ Columns:
|
||||
| What a call did wrong, in detail | 174 | 157 | 0 | 0 | 0 | 0 | 0 |
|
||||
| Devices below the new runtime's floor | 8 | 8 | 0 | 0 | 0 | 0 | 0 |
|
||||
| The new runtime's `Refusal` | 62 | 62 | 0 | 0 | 0 | 0 | 0 |
|
||||
| The new runtime's `Limit` | 10 | 10 | 0 | 0 | 0 | 0 | 0 |
|
||||
| The new runtime's `Limit` | 13 | 13 | 0 | 0 | 0 | 0 | 0 |
|
||||
| The new runtime's `Gap` | 25 | 25 | 0 | 0 | 0 | 0 | 0 |
|
||||
|
||||
## Totals by basis
|
||||
@@ -56,7 +56,7 @@ Columns:
|
||||
| What a call did wrong, in detail | 60 | 26 | 23 | 0 | 39 | 26 | 0 | 0 |
|
||||
| Devices below the new runtime's floor | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 |
|
||||
| The new runtime's `Refusal` | 19 | 16 | 0 | 0 | 27 | 0 | 0 | 0 |
|
||||
| The new runtime's `Limit` | 0 | 0 | 0 | 6 | 4 | 0 | 0 | 0 |
|
||||
| The new runtime's `Limit` | 0 | 0 | 0 | 9 | 4 | 0 | 0 | 0 |
|
||||
| The new runtime's `Gap` | 0 | 0 | 0 | 0 | 25 | 0 | 0 | 0 |
|
||||
|
||||
## 1. Translator and front-end refusals (`Unsupported`: a `Feature` and its `Needs`)
|
||||
@@ -683,8 +683,8 @@ Columns:
|
||||
|
||||
| Variant | What it blocks | Where | Basis | Sites | Reach |
|
||||
|---|---|---|---|---|---|
|
||||
| `BlockLen` | A block longer than one allocation and one buffer hold on the device (`Device::take_block` past `maxMemoryAllocationSize` or `maxBufferSize`) | at the device's limit | `device`: the device's `maxMemoryAllocationSize` and `maxBufferSize` | 1: `crates/metal2vulkan-rt/src/memory.rs (round)` | `-` |
|
||||
| `BlockIds` | A block after every block number has been used (`Device::take_block`) | every device (a public call's own check of its arguments) | `ours`: block numbers are 32 bits | 2: `crates/metal2vulkan-rt/src/memory.rs (make_allocation)`, `crates/metal2vulkan-rt/src/memory.rs (number)` | `-` |
|
||||
| `BlockLen` | A block longer than one allocation and one buffer hold on the device (`Device::take_block` past `maxMemoryAllocationSize` or `maxBufferSize`) | at the device's limit | `device`: the device's `maxMemoryAllocationSize` and `maxBufferSize` | 2: `crates/metal2vulkan-rt/src/import.rs (check_len)`, `crates/metal2vulkan-rt/src/memory.rs (round)` | `-` |
|
||||
| `BlockIds` | A block after every block number has been used (`Device::take_block`) | every device (a public call's own check of its arguments) | `ours`: block numbers are 32 bits | 2: `crates/metal2vulkan-rt/src/memory.rs (allocation_number)`, `crates/metal2vulkan-rt/src/memory.rs (number)` | `-` |
|
||||
| `ThreadgroupMemory` | A dispatch whose threadgroup memory, the kernel's own and the lengths set (each rounded up to 16 bytes), is past the device's... | at the device's limit | `device`: the device's `maxComputeSharedMemorySize` | 1: `crates/metal2vulkan-rt/src/encoder.rs (dispatch)` | `-` |
|
||||
| `BytesLength` | `setBytes` data longer than one parameter ring chunk | every device (a public call's own check of its arguments) | `ours`: a ring chunk is 64 KiB | 2: `crates/metal2vulkan-rt/src/encoder.rs (set_bytes)`, `crates/metal2vulkan-rt/src/render_encoder.rs (set_bytes)` | `-` |
|
||||
| `IndexRange` | A grant of no indices, or one past its class's range (`Device::grant_indices`, [`IndexClass::range`]) | every device (a public call's own check of its arguments) | `ours`: the descriptor arrays are 65,536 sampled and 65,536 storage textures, one index of both a texture's, and 4,000 samplers of each use, and index 0 is nil | 1: `crates/metal2vulkan-rt/src/arrays.rs (grant)` | `-` |
|
||||
@@ -692,6 +692,9 @@ Columns:
|
||||
| `DeviceSamplers` | A sampler state whose device samplers would take the device past its `maxSamplerAllocationCount`, less the sampler arrays' two defaults... | at the device's limit | `device`: the device's `maxSamplerAllocationCount` | 1: `crates/metal2vulkan-rt/src/sampler.rs (take)` | `-` |
|
||||
| `MemoryAllocations` | A `VkDeviceMemory` allocation past the device's `maxMemoryAllocationCount` live ones, refused before the driver is called | at the device's limit | `device`: the device's `maxMemoryAllocationCount` | 1: `crates/metal2vulkan-rt/src/memory.rs (allocate)` | `-` |
|
||||
| `AllocationNotMapped` | A take that no free range fits made an allocation that the consumer's `BlockMappings::map` did not map | every device (a public call's own check of its arguments) | `ours`: the consumer's hook gave the allocation no place in its own address range | 1: `crates/metal2vulkan-rt/src/memory.rs (own)` | `-` |
|
||||
| `NoImport` | An import of a handle the device does not take (`Device::import_dma_buf`, `Device::import_host_memory`) | at the device's limit | `device`: the device's extensions and its external buffer properties | 2: `crates/metal2vulkan-rt/src/import.rs (import_dma_buf)`, `crates/metal2vulkan-rt/src/import.rs (import_host_memory)` | `-` |
|
||||
| `ImportType` | An import whose handle's memory type query offers no type the import takes, so nothing is imported | at the device's limit | `device`: the handle's memory type query and the buffer's memory requirements | 2: `crates/metal2vulkan-rt/src/import.rs (import_dma_buf)`, `crates/metal2vulkan-rt/src/import.rs (import_host_memory)` | `-` |
|
||||
| `ImportAlignment` | An import of no bytes, or one whose address or length is not a multiple of `alignment` | at the device's limit | `device`: `minImportedHostPointerAlignment` and the buffer's memory requirements | 3: `crates/metal2vulkan-rt/src/import.rs (check_len)`, `crates/metal2vulkan-rt/src/import.rs (check_size)` (+1) | `-` |
|
||||
| `TextureSamples` | A multisample texture of a sample count the device does not make for its format, type and usage | at the device's limit | `device`: the image format query's `sampleCounts` | 1: `crates/metal2vulkan-rt/src/texture.rs (plan)` | `-` |
|
||||
|
||||
## 13. The new runtime's `Gap` (`Error::Unsupported(Gap)`)
|
||||
@@ -1276,8 +1279,8 @@ Each refusal's sites, with the function that builds it.
|
||||
- `rt:Refusal::ArgumentPlace`: `crates/metal2vulkan-rt/src/encoder.rs (dispatch_threadgroups_with_indirect_buffer)`; `crates/metal2vulkan-rt/src/render_encoder.rs (draw)`
|
||||
- `rt:Refusal::ViewportNotFinite`: `crates/metal2vulkan-rt/src/render_encoder.rs (set_viewport)`
|
||||
- `rt:Refusal::StencilAttachment`: `crates/metal2vulkan-rt/src/render_encoder.rs (draw)`
|
||||
- `rt:Limit::BlockLen`: `crates/metal2vulkan-rt/src/memory.rs (round)`
|
||||
- `rt:Limit::BlockIds`: `crates/metal2vulkan-rt/src/memory.rs (make_allocation)`; `crates/metal2vulkan-rt/src/memory.rs (number)`
|
||||
- `rt:Limit::BlockLen`: `crates/metal2vulkan-rt/src/import.rs (check_len)`; `crates/metal2vulkan-rt/src/memory.rs (round)`
|
||||
- `rt:Limit::BlockIds`: `crates/metal2vulkan-rt/src/memory.rs (allocation_number)`; `crates/metal2vulkan-rt/src/memory.rs (number)`
|
||||
- `rt:Limit::ThreadgroupMemory`: `crates/metal2vulkan-rt/src/encoder.rs (dispatch)`
|
||||
- `rt:Limit::BytesLength`: `crates/metal2vulkan-rt/src/encoder.rs (set_bytes)`; `crates/metal2vulkan-rt/src/render_encoder.rs (set_bytes)`
|
||||
- `rt:Limit::IndexRange`: `crates/metal2vulkan-rt/src/arrays.rs (grant)`
|
||||
@@ -1285,6 +1288,9 @@ Each refusal's sites, with the function that builds it.
|
||||
- `rt:Limit::DeviceSamplers`: `crates/metal2vulkan-rt/src/sampler.rs (take)`
|
||||
- `rt:Limit::MemoryAllocations`: `crates/metal2vulkan-rt/src/memory.rs (allocate)`
|
||||
- `rt:Limit::AllocationNotMapped`: `crates/metal2vulkan-rt/src/memory.rs (own)`
|
||||
- `rt:Limit::NoImport`: `crates/metal2vulkan-rt/src/import.rs (import_dma_buf)`; `crates/metal2vulkan-rt/src/import.rs (import_host_memory)`
|
||||
- `rt:Limit::ImportType`: `crates/metal2vulkan-rt/src/import.rs (import_dma_buf)`; `crates/metal2vulkan-rt/src/import.rs (import_host_memory)`
|
||||
- `rt:Limit::ImportAlignment`: `crates/metal2vulkan-rt/src/import.rs (check_len)`; `crates/metal2vulkan-rt/src/import.rs (check_size)`; `crates/metal2vulkan-rt/src/import.rs (import_host_memory)`
|
||||
- `rt:Limit::TextureSamples`: `crates/metal2vulkan-rt/src/texture.rs (plan)`
|
||||
- `rt:Gap::IndirectCommandBuffers`: `crates/metal2vulkan-rt/src/pipeline.rs (new_compute_pipeline_state)`; `crates/metal2vulkan-rt/src/render.rs (refuse)`
|
||||
- `rt:Gap::KernelInput`: `crates/metal2vulkan-rt/src/pipeline.rs (gap)`; `crates/metal2vulkan-rt/src/pipeline.rs (of)`
|
||||
|
||||
Reference in new issue
Block a user