f831d5bd2f9d691b795e4e55ebdc28004a3273fa
50
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
513d792675 |
REFUSALS: MadeBeforeRecovery's pooled buffers are those in memory the device allocated
A recovery now carries a pooled Shared or Managed buffer that lies in a block of the runtime's own pages, so the reach note names the pooled buffers left refused as those in memory the device allocated. docs/REFUSALS.md regenerated (scripts/refusal-surface/refusal_surface.py); no refusal changed. (cherry picked from commit b11909130479dbdb8c42c8d6c3950ffa1d9414ed) |
||
|
|
33675e87f1 |
Carry tests, and docs for what a recovery carries and leaves refused
New device tests (tests/device_recovery_carry.rs, under the CPU-ICD and GPU cfgs): - One recovery carries a Private buffer (same address, zero after) and a buffer in fresh pages. The fresh-page buffer keeps its contents pointer and bytes, and the host's writes through that pointer after the recovery reach the GPU's copy. It also carries a shared event: its value, its listener's notification and a GPU signal after the recovery. - A pooled Shared buffer stays refused, and the notice counts it. It keeps the lost VkDevice, which then holds no empty block and less memory than before the loss. Dropping it takes the line back to one live VkDevice. - Seven recoveries with a carried buffer and event in use between them end with one live VkDevice, and eight made. The device_recovery helpers are shared with the new file. Docs: RuntimeGap::MadeBeforeRecovery, the DeviceRecovered catalogue entry and its consequence (runtime and API.md), the runtime README's lost-device section, line.rs's module and recover_for_test docs, in_place.rs, the validation lane's docs and the refusal surface's reach mark now say what is carried and what stays refused. REFUSALS.md is regenerated in the next commit. Not yet built. (cherry picked from commit 68d68cdfbdbbac979e5097a8ad286416450790bf) |
||
|
|
80b581bee2 |
Dma-buf export: README, HOWTO, the API table and REFUSALS.md
The runtime README lists exported_as, export_memory_dma_buf and external_write_done beside the opaque-fd export; HOWTO gains a section on memory another API writes (a decoder's DRM_PRIME_2 frame), the old section 7 now 8. The API signatures table is re-blessed for MemoryExport, BufferDescriptor::exported_as, with_exported_as, the two Buffer calls, Problem::ExportedNoCopy and RuntimeGap::DmaBufExport, and REFUSALS.md is regenerated with the new gap's reach (none: a runtime extension). (cherry picked from commit 3988f9ec5921e8962708ce7735937c44836361a1) |
||
|
|
ec9706e6e3 |
Survive the loss of the VkDevice: the device is a line of generations
Metal's MTLDevice survives a GPU recovery; the runtime's device refused every call with DeviceLost from the first loss on, and the consumer ends its VM at the first refusal. Now a device the runtime made is a line of generations (device/line.rs), each a DeviceShared over its own VkDevice, and the first call that needs the device after a loss makes a new VkDevice of the same physical device, options, queue families and extensions. - Two kinds of handle. The program's device (and its clones) is a root handle: it holds the line, pins no generation, and every public Device call goes to the generation that serves (each public method forwards to its *_now body). Objects hold generation handles, so their Vulkan calls, drops included, reach their own VkDevice alone. A generation handle's check is one relaxed load of the line's generation (Device::generation_serves). - A draw pays nothing for it. A command buffer takes its generation once, as it is made (CommandBuffer::generation); its encoders' per-draw reaches (work counts, fresh-unwritten and alias records, sampler-slot changes, attachment read notices) read it there, not through a device handle's kind. A bind's device check is one compare of the cells the two handles hold, inlined, its refusal (Device::foreign) out of line. - The state machine (Live, Lost, Failed): the claiming call recovers, every other call waits (a notice past 10 s, waiting on); threads command buffers' completion depends on never wait. Recovery: the lost generation's command buffers in flight fail through its completion path, its queues drain under their locks, create_on makes the next VkDevice, the queues are retired. - Command-buffer answers, as a real loss is one more hang: the oldest incomplete batch's command buffer fails GpuHang (exact on one VkQueue; on two or more the queue whose oldest incomplete batch was submitted first, said so in the notice), counted against its queue so the second revokes it (AccessRevoked); the others GpuRecoveryVictim; one committed on the hang's queue before the recovery runs nothing and completes with no error; one made before and committed after fails GpuRecoveryVictim. One loss names one hang: a batch that went to the driver just before the loss and reached the lost device's completion after the loss took the pending batches fails with it, as a victim (its own wait need not fail: the test hook's VkDevice runs it), and no later failure of the lost device names a second hang. - Command queues survive: a queue is a root handle and a cell of its place on one generation (VkQueue, slots, pools, hangs), which a recovery retires and the next command buffer re-makes; label and GPU-error count go on. - Objects made before a recovery are refused where they meet the new VkDevice or need their lost one: RuntimeGap::MadeBeforeRecovery, at the 38 lost-device checks (Device::lost_refusal) and at every foreign-object check of one line (Device::foreign). DeviceLost stays for a device the consumer made. - Carried across generations: the address space, resource IDs and the passing holds a making waits out before it takes one, unique identifiers, counters and the announced notice kinds. - A device handle is an enum of the two kinds (24 bytes, was 16): the shadow merge's copy-back dispatch, which holds handles, is boxed (clippy's large_enum_variant). - Device::recover_for_test (public, documented) runs the whole path with no GPU fault; RuntimeGap::AdoptedDeviceRecovery on an adopted device. - Degradation::DeviceRecovered (device-recovered), announced at each recovery with the culprit and its time. WorkCounts::vk_devices_live, vk_devices_made, device_recoveries: two VkDevices while objects of the lost one live, one after. Docs: docs/API.md catalogue entry, the runtime README's device-loss section, FAST-PATHS known gap (a make whose own submission first meets the loss is refused DeviceLost), docs/REFUSALS.md regenerated (refusal_surface.py names a forwarded body's sites by its public method), api_signatures blessed. Tests: runtime_lane::device_recovery (hang and victims, command buffers on their way to the driver at a recovery, MadeBeforeRecovery and the VkDevice bound, revocation at the second hang, a command buffer made before fails as victim, all under the validation layer; a recovery that finds nothing of the queue scheduled names no hang, its command buffers victims), tests::device_recovery (the hold of the hang's queue between a loss and the recovery), detach_lost and the MoltenVK lost-device lanes updated to the recovery's answers. Verified: - lavapipe: runtime suite and touched validation tests 1850/1850, surface 19/19 (m3-max-5695, gem10, before the rebase onto |
||
|
|
02562d2a1e |
Make a shared event whose timeline semaphore another API imports, exported as an opaque fd
reims's ask 2: CUDA signals the event's semaphore on the GPU after a decode (cuSignalExternalSemaphoresAsync), and waits on it, where it now orders through the host. Device::new_exportable_shared_event() makes a shared event as new_shared_event does, its timeline semaphore made with VkExportSemaphoreCreateInfo naming VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT; SharedEvent::export_semaphore_fd() answers a new OwnedFd each call (vkGetSemaphoreFdKHR), the caller's to close. An event not made exportable is refused Invalid(Problem::NotExportable). The counter stays the signal index the interop hooks name: the importer waits for vk_wait's counter and signals only one reserve_vk_signal reserved; that call's contract now names an importer's signal beside the device's queues. The device decides structurally, once: it enables VK_KHR_external_semaphore_fd wherever listed (adopted: where its consumer enabled it), and asks vkGetPhysicalDeviceExternalSemaphoreProperties for a timeline semaphore: OPAQUE_FD exportable and among the compatible types. Lacking either, the making is refused NotImplemented(RuntimeGap::ExportableSemaphore), with its REFUSALS row. Lifetime (the event outlives every import and every signal and wait an importer submitted) and device loss (state lost for the imports; a device made again exports new semaphores) are in the call and module docs, interop.rs and the README. api_signatures blessed; exit_guard's KEEPERS lists exported_semaphore.rs. Test (device, src/tests/exported_semaphore.rs): the semaphore imported into a second VkDevice; a command buffer's signal of 5 reaches vk_wait(5)'s counter there; the second device's host signal of the counter reserved for 9 raises the event to 9 and releases a command buffer that waited for 9 and then filled a buffer. Unverified at this commit. (cherry picked from commit 525580c12be28e6efa0a06ab09cde1f736ebace7) |
||
|
|
ae0c6c7023 |
Make a buffer whose memory another API imports, exported as an opaque fd
reims's NVIDIA video lane writes each decoded picture into a runtime buffer with cuMemcpy2DAsync, so CUDA must import the buffer's memory (cuImportExternalMemory, cuExternalMemoryGetMappedBuffer); without it the pictures take a host-pages route of about 2.7 ms a 4K picture. Device::new_exportable_buffer(length, options) makes a buffer as new_buffer does, but in an allocation of its own made exportable as VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT: the VkBuffer names the handle type (VkExternalMemoryBufferCreateInfo) and has the device-address usage of its own; its memory (VkExportMemoryAllocateInfo) is a block of its own of the memory type its storage mode takes, the buffer's dedicated allocation where the device exports only so (DEDICATED_ONLY) or the driver prefers or requires it (VkMemoryDedicatedRequirements). It is never parked for reuse. Every other buffer keeps the pooled blocks and pays nothing. Buffer::export_memory_fd() answers ExportedMemory: a new OwnedFd each call (vkGetMemoryFdKHR), the caller's to close, the allocation's size, the buffer's offset and length in it, whether it is dedicated (CUDA's cudaExternalMemoryDedicated) and its memory type (a Vulkan import names it). A buffer not made exportable is refused Invalid(Problem::NotExportable). The device decides structurally, once, as it is made: it enables VK_KHR_external_memory_fd wherever listed (outside the vocabulary, as the dma-buf route's names, which enable it too; an adopted device where its consumer enabled it), and asks vkGetPhysicalDeviceExternalBufferProperties for a buffer of the runtime's usage: OPAQUE_FD exportable and among the compatible handle types. Lacking either, the making is refused NotImplemented(RuntimeGap::ExportableMemory), with its REFUSALS row. Docs: the module docs, the call docs, interop.rs and the runtime README state the lifetime rule (the buffer outlives every import) and the device-loss rule (contents lost for every import; a device made again exports new allocations, new descriptors). api_signatures blessed (new method x2, struct and fields, two variants). Test (device, src/tests/exported_memory.rs): a Shared buffer of a 4K NV12 picture's bytes, written by the host and a GPU fill, exported and imported into a second VkDevice of the same physical device (dedicated where exported so), read there; that device's writes read back by the runtime's blit. A refusal must come from a device that lists no extension or export. It prints the make cost of Shared and Private exportable buffers beside plain ones (medians of 8). Unverified at this commit. (cherry picked from commit fd6d775ef63e350ae1f550d6b2e7ef6af763d21f) |
||
|
|
c6e1d5a9fd |
Make a BC1 or BC4 texture over a surface's plane at an offset or pitch off 16
The runtime refused a BC texture over a plane of a surface with planes whose offset or bytesPerRow is off 16 bytes, as NotImplemented(SurfacePlaneShape). The M3 Max answers nil for every BC texture over a surface, so the x86 Macs are the reference (job m3-max-4779 on macbook-pro-2019: an AMD Radeon Pro 5300M and an Intel UHD 630 under macOS 26.7.1, surface_texture_envelope.m's bgraat8.bc1 at offset 8 and bgrarow264.bc1 at 264 bytes a row). Both GPUs' blits and samples take block row j at the plane's offset + j x bytesPerRow, with no rounding to 16. linear_plan::blocks_off_sixteen makes a BC texture of 8-byte blocks (BC1, BC4) at an offset and bytesPerRow that 8 divides, at least 16 bytes a row. Every BC plane now lies at the CPU's layout on the GPU too (plan_iosurface_plane's blocks flag): at multiples of 16 the two were already equal. The CPU calls take the plane's own offset, as the 5300M's getBytes does, while the UHD 630's getBytes and replaceRegion take a plane at offset 8 from byte 0. That difference is recorded in docs/API.md's accepted differences. BC4 was not measured off 16; it takes BC1's 8-byte block rows. BC textures of 16-byte blocks (BC2, BC3, BC5, BC6H, BC7) off 16, and 8-byte ones off 8 or under 16 bytes a row, stay refused. SurfacePlaneShape's doc names them, and so does its reach mark in REFUSALS.md. Tests: tests::linear_plan makes bgraat8.bc1, bgrarow264.bc1, BC4 at (8, 264) and BC1 at offset 40, with the GPU layout equal to the CPU's. It refuses BC3, BC5 and BC7 off 16, BC1 at offset 4 and at 260 bytes a row, and BC4 at 8 bytes a row. tests::surface_shapes (a device test) gains bgraat8.bc1, bgrarow264.bc1 and bgraat8.bc4 on every path. docs: linear_plan.rs's Block-compressed surfaces, the plane call, SurfacePlaneShape, BufferRefusal::PlaneShape, the FAST-PATHS known gaps and the API.md accepted differences. Regenerating REFUSALS.md changes only the reach mark. CONFORMANCE-COVERAGE.md and the API signatures are unchanged. (cherry picked from commit ff454bd8b269fff6abf590da85cd050862d539a9) |
||
|
|
88ddbf4f90 |
Keep a colour plane's texels past its surface in a tail of the texture's own
What. A colour texture of a plane of an IOSurface with planes (Buffer::new_texture_with_iosurface_plane) whose GPU or CPU rows run past the buffer standing for the surface is made. Its texels inside the surface are the buffer's bytes, as every texture over a buffer's are; its texels past it lie in a tail of the texture's own (Texels::past, the form |
||
|
|
803648acd8 |
Make a texture buffer over a buffer whose texels run past its length, those texels in a tail
What. Buffer::new_texture of a texture buffer whose texels run past
the buffer's length (inside Metal's allocation rule) is made instead
of returning NotImplemented(TexelsPastBufferLength), as a 2D texture
or array already is. Its texels inside the length are the buffer's
bytes; those past it lie in a tail of its own, a zeroed Shared buffer
the runtime owns, laid out from the functions' first byte (the offset
rounded down to 16, as Metal's kernels read a texture buffer).
- GPU: the texture buffer takes the staged form (StagedTextureBuffer,
announced): its bindings view the tail as their staging buffer. The
copy in takes the bytes inside the length from the buffer (none
where the texels lie wholly past it), the copy back gives only those
bytes back, and a Shared buffer's merge copies the current part from
and to the buffer and the tail apart (staged_bytes, which now names
a texture buffer's staging buffer as well as an image's, and
record_out, which copies the staging buffer's every byte).
- CPU and blits: as for 2D, each row split at the length
(Texels::past, whose rebase is now the tail's base, tail_base).
Only an IOSurface plane past its surface stays
NotImplemented(TexelsPastBufferLength); the gap's doc, its reach in
scripts/refusal-surface/reach.tsv, the StagedTextureBuffer catalogue
entry and docs/API.md's accepted difference say so.
Why. Plain Metal makes these: reims-vgpu's tbprobe on both x86 oracle
Macs (jobs m3-max-4019, 4046, 4152) and the M3 Max probe
(probes/texture_buffer_past_length.m, job m3-max-4617), whose paths
read and write the bytes past the length as one memory, as a 2D
texture's. The tail gives the 20000-byte buffer's answer for every
shape, as the 2D tail does.
Tests.
- tests/buffer_tail_device.rs: a texture buffer of 64 R32Uint texels
from 3968 of a 4096-byte buffer (32 past) and from 4096 (all past):
as made, after a kernel's write across the length (ob1_texel_buffer)
and after replace_region past it, a kernel, get_bytes and a blit
read alike; the buffer's words inside the length are written, every
other word and 16 buffers around it keep theirs.
- linear_plan unit rows: texture buffers past the length made.
- runtime_lane::buffer_textures: the texture buffer at 3968 is made.
- Conformance: buffer-tails-texture-buffer, 1024 R32Uint texels from
16384 of a 20000-byte buffer (904 inside): ob1_texel_buffer reads
and writes, getBytes, replaceRegion, blits from and into it, the
buffer's bytes; recorded on the M3 Max (3 runs, one outcome, every
site the model's answer).
Verified:
- M3 Max, macOS 27.0.1: the probe (m3-max-4617) and the recording
(m3-max-4640): buffer-tails-texture-buffer is made, announcing only
the staged-texture-buffer notice, and the 2D tail cases still are.
- gem10 (m3-max-4635): clippy of the runtime (all targets, all
features) and of runtime and validation under --cfg m2v_cpu_icd;
the runtime's unit tests (70 of 70); the runtime lane on lavapipe
(172 of 172, the new texture-buffer test among them); the
buffer_textures, texel_swizzles and degrade_notices validation lanes
(27 of 27).
- gem10 (m3-max-4662): rustdoc of runtime and conformance; the
conformance unit tests over the tails, refusal, catalogue and
accepted-difference rows (20 of 20); a lavapipe replay of the six
buffer-texture cases, all six announced as the ledger expects.
Clippy there named the shape test's two constant assertions, now
const blocks; clippy of runtime and conformance and those unit
tests again on this tree: m3-max-4688.
- Negative control (m3-max-4662): the runtime's sources at
|
||
|
|
867c7e506e |
Make BC, texture-buffer, 1D and one-slice array textures over surfaces
The surface probe (surface_texture_envelope, potluck m3-max-1581, -1596, -1598) measured which bytes textures over IOSurface planes reach on an AMD 5300M, an Intel UHD 630 and an M3 Max: - BC over a surface's rows (oracle_surftex 66, 67, 125, 131, 147, 148): both x86 GPUs' blits, Private ones too, and getBytes take block row j at the plane's offset + j x bytesPerRow; the UHD 630's replaceRegion too. The runtime makes BC1 to BC7 there as a shadow image whose copies move those block rows (Texels::blocks, block-aware plane_copy_regions and copy unit). Over a surface without planes Metal's texel-row height check is kept. - A texture buffer over a surface (35, 121, 129): contiguous from the plane's offset on the M3 and the 5300M. Over a planar surface it may run past a row. It now takes the descriptor's options, as a surface's other textures do. - A 1D texture whose row fits (116) and a 2D array of one slice (117, 127): the 2D texture's bytes on all three. Every other shape Metal makes over a planar surface's plane (wider rows, more levels, other types) has no one layout across the three GPUs and the CPU calls: refused NotImplemented(SurfacePlaneShape), where it was Invalid. Verified: not yet built (next commits fix forward). (cherry picked from commit a937933adfe5f451bd1d79e1605adb124c841dae) |
||
|
|
1e44dcf8da |
Drop the call of MSL's empty inline assembly at decode: asm sideeffect "", "" of void ()
What: decode drops a call whose callee is the inline assembly expression `asm sideeffect "",
""` at the call type `void ()`, the way it drops the markers: the call takes a record number
but no instruction. The match is structural and exact:
- the call type is `void ()`, not vararg, with no arguments;
- the template and the constraint string are empty (no operand, result or clobber);
- `sideeffect` is the only flag (no alignstack, inteldialect or unwind).
Any other inline assembly stays an indirect call through its constant. post_check refuses it
as InlineAsm by name where an entry reaches it.
Why: MSL accepts exactly one asm statement, an empty `asm("")` / `asm volatile("")`. A
template, an operand or a clobber is "illegal asm statement" (Metal 32023.922). That statement
always compiles to this call, attributes {convergent nounwind}. It assembles to no
instruction and names nothing it reads or writes. Its `sideeffect` only constrains Metal's
optimizers: they may not remove it or move a memory access across it, and a loop holding it
is kept. A shader generator writes it into loop bodies for that reason. No value a race-free
program computes depends on it. The decode-only refusal of the previous commit still ended
the consumer's VM, so the drop is what fixes their S1. Refusing it would refuse every
pipeline whose generator writes it.
The edge, documented in docs/API.md's accepted differences ("Inline assembly"): a racy spin
loop over plain (non-atomic) memory could tell the barrier is gone, and MSL's memory model
leaves that loop undefined. A loop with a visible effect runs every iteration either way.
The drop records no note and no degrade: it is no precision difference, no value changes.
Fixture: engine/kernel_inline_asm's asm_in_loop now stores every partial sum, the final sum
and its iteration count. The trip count comes from a buffer. All three entries translate.
REFUSALS.md is regenerated: InlineAsm's doc and its reach mark, now `none`, since only
hand-written AIR can hold another asm.
Verified (M3, macOS 27):
- engine_inline_asm, through both llvm-as and xcrun metal-as:
- asm_in_loop, asm_in_helper and asm_free translate, link and validate on all 19 committed
profiles;
- asm_in_loop on the CPU interpreter with n = 6 over 4 threads writes every expected word
in both scheduling orders: every iteration stored;
- synthetic modules with "nop", "~{memory}", an "=r" result, no sideeffect, and alignstack
each refuse as InlineAsm naming the expression; the empty one translates.
- Negative control: with the drop disabled, all three engine tests fail.
- metal2vulkan-air suite: 492 pass.
- metal2vulkan: the air_input, air_canon and air_abi sweeps and the api surface and
signatures checks pass. The text-shape sweep discounts the dropped call, as it does the
markers.
- clippy -D warnings in both configurations.
- Golden printout of kernel_inline_asm re-blessed: only that file.
Still owed a bless on development, new rows only:
- golden_hashes.tsv: the fixture's cells, all new;
- public_fixture_expectations_engine.tsv: 2 fixtures.
SEMANTICS_VERSION stays 1950, landing together with the previous commit.
(cherry picked from commit 53c6faaf4d2215fc3e629b39803f47979d71f765)
(cherry picked from commit f9361582833d1f5ca0c151d42d68e3cfa7e228af)
|
||
|
|
6e67fd2a08 |
Decode inline assembly constants; refuse a reached call of one as InlineAsm
What: the bitcode reader now decodes CONSTANTS_BLOCK record 30 (INLINEASM, LLVM 13+, which
names its function type) and the older spellings 18, 23 and 28 (typed by their pointer's
pointee) into a new constant, Const::InlineAsm, which keeps the template, the constraint
string and the four flags as written. A call through it stays Callee::Indirect. Canon's
post_check refuses such a call that an entry reaches as Unsupported(InlineAsm), not
implemented, naming the expression (`asm sideeffect "", ""`). An entry that reaches none
translates, even when other functions of its module call assembly.
- The verifier holds the constant to LLVM's rules: a `ptr` in address space 0, never another
constant's operand or a global's initializer, and only ever a call's callee.
- A record that does not fit its spelling is MalformedRecord: an undefined flag bit, a
function type that is none, a string past the record, a byte above 255, a trailing operand,
or an old spelling over an opaque pointer.
- Feature::InlineAsm is new in both crates (REFUSALS.md regenerated, reach mark `app`).
- The validation AIR writer spells the constant back.
- The constant interner charges the strings to the ledger.
Why: the consumer's sweep refused a whole render pipeline as `Constant { code: 30 }` (a
WebGPU deferred-rendering page in Safari), so the pass drew nothing. The record was refused
as it was read, so every entry of the module was lost, whether or not it called the assembly.
MSL accepts exactly one asm statement: an empty template with no operands and no clobbers.
`asm("nop")`, `asm volatile("" ::: "memory")` and `asm volatile("" : "+r"(x))` are all
"illegal asm statement" (Metal 32023.922). It always compiles to `call void asm sideeffect
"", ""()`, attributes `convergent nounwind`.
Fixture: engine/kernel_inline_asm, our own MSL, holds three entries.
- asm_in_loop: the statement in a loop body.
- asm_in_helper: the statement in a noinline helper.
- asm_free: no assembly of its own.
Its .ll and .air.ll are from scripts/regen-air-fixtures (LLVM 21), and its golden printout
is blessed (tests/air_input/kernel_inline_asm.txt, only that file changed).
Verified (M3, macOS 27):
- New reader tests: every spelling decodes, every malformed form is typed, and an aggregate
holding the asm fails verification.
- New engine tests, through both llvm-as and xcrun metal-as: asm_free translates, links and
validates on all 19 committed profiles; asm_in_loop and asm_in_helper refuse as InlineAsm by
name.
- Negative control: with record 30 refused as before, all four tests fail.
- metal2vulkan-air suite: 492 tests pass.
- metal2vulkan: the air_input, air_canon and air_abi sweeps and the api surface and
signatures checks pass.
- metal2vulkan-validation fixture, writer and audit tests: 74 pass.
- clippy -D warnings in both configurations, plain and --cfg m2v_gpu.
Tables owed a bless on development, new rows only:
- golden_hashes.tsv: 114 new cells, 3 entries x 19 profiles x 2 spellings.
- public_fixture_expectations_engine.tsv: 2 new fixtures.
SEMANTICS_VERSION 1950: refusals change class (Constant -> InlineAsm, or a translation).
api_signatures.tsv is blessed: additive (the InlineAsm struct and variants). A consumer that
matches Const or Feature exhaustively must add the new variants.
On the lane: SEMANTICS_VERSION is 1953 here, after the specialization folding's 1952.
(cherry picked from commit 8b418fbd6c)
(cherry picked from commit c8a7e910204a6cedad2b257a10cb095d83c213e3)
|
||
|
|
9613166920 |
Document the video plumbing; regenerate the refusal surface and the signatures table
- crates/metal2vulkan-runtime/README.md: the extra_queues option, the feature structures the
listed video extensions take, DeviceHandles' extra queues and the sharing rule for them, the
shared event's semaphore (signal-index counter, vk_wait, reserve_vk_signal), plane textures
over the consumer's VkImage and their refusal, and Buffer::vk_host_memory.
- docs/REFUSALS.md regenerated (python3 scripts/refusal-surface/refusal_surface.py) for
RuntimeGap::VkImagePlaneCopy and WrappedImageProblem::{Plane, PlaneFormat}; reach.tsv marks
the gap `none` (a runtime extension's path). 0 variants without a reach mark or a basis.
- crates/metal2vulkan/tests/api_signatures.tsv blessed: 28 added records (ExtraQueue,
VkEventWait, VkEventSignal, VkHostMemory, the new fields, methods and variants), none removed
or changed.
- The extra-queue device test prints the video features enabled through the runtime's own
query (listed_structures, listed_reported) and asserts each required one is on where its
extension is enabled.
docs/METAL-COVERAGE.md and docs/CONFORMANCE-COVERAGE.md check current.
(cherry picked from commit bb2a4c2c6101458026253461402ac463c1bcb323)
|
||
|
|
a8af53b32a |
Answer supportsPullModelInterpolation and refuse sample reads at custom positions
The runtime had no answer for supportsPullModelInterpolation (the M3 Max, a Radeon Pro 5300M and a UHD 630 answer 1), so the consumer passed none. - DeviceProperties::supports_pull_model_interpolation (Query:: PullModelInterpolation) answers yes where the compile layer lowers every interpolation function: DeviceProfile::interpolation_function_needs is empty (sampleRateShading, and MoltenVK's shaderSampleRateInterpolationFunctions), the same predicate the lowering refuses by. - A draw at custom sample positions through a pipeline whose fragment function reads an interpolant at a sample (GraphicsState::interpolates_at_sample) is refused NotImplemented(RuntimeGap::InterpolateAtSampleWithPositions) in settle_draw, which direct and indirect-command draws share: Vulkan takes no InterpolateAtSample in a pipeline made with custom sample locations (VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524), and Metal's answer there is not measured. Tests: - runtime tests::capabilities: every committed profile answers from the enabled features; every venue (moltenvk-m3, both lavapipe gates, 780M RADV, both ANV, RTX 5080) answers yes; vk12-floor no; moltenvk-m3 without the portability member no; every query answers on moltenvk-m3. - validation runtime_lane::pull_model_interpolation (--cfg m2v_gpu or m2v_cpu_icd): the probe's lane draws (one triangle of w 1, 2, 4 over 6x6, at 1 and 4 samples: center, centroid, each sample, sample_id, five offsets, the float2/float/half and half4 interpolants) against Metal's reading pull_model_interpolation_m3_max.txt, every sample's coverage equal; word for word where the profile takes MetalInterpolation, else within the device's interpolation plus the location Vulkan leaves to it; the offset pipelines alone record DeviceInterpolationOffset and require the device's origin property. A pm_sample draw at custom positions is refused; a pm_offset draw there runs. Verified on the M3 Max (MoltenVK 1.4.2, macOS 27.0.1) through the Mac GPU lock: 25 draws, 14 samples at 1x and 55 at 4x each, every word Metal's (most apart 0); the refusal and the offset draw at custom positions as stated. Negative control: the MoltenVK origin set to 1/2 put every offset draw 0.06 to 0.11 off Metal's. Not run on lavapipe here (no container runtime up); CI's lavapipe lane runs it. Runtime capabilities, degradation and families tests 47/47; clippy all features and --cfg m2v_gpu. (cherry picked from commit e9f45f7c85309ba6d1e6bc57f3b10fd47585893e) |
||
|
|
ef7a8d6f08 |
Lower Metal's pull-model interpolation (interpolant inputs)
A fragment function reading an `interpolant<T, P>` input through
interpolate_at_center, _centroid, _sample or _offset was refused as invalid
input (the AIR key air.interpolation_function was unknown), so a guest whose
device answers supportsPullModelInterpolation could not run one.
AIR: the key marks a fragment input `Sampling::Interpolant`, a device-space
handle (`AbiHandle::Interpolant`); `air.interpolate_{center,centroid,sample,
offset}_{perspective,no_perspective}.{f16,f32 x1..4}` parse as
`AirIntrinsic::Interpolate`, decided from the intrinsic family and the
metadata ABI, never names.
Lowering: the interpolant is a float Input variable of its form (NoPerspective
where not perspective), read only through its calls:
- center: as a center varying is read (its pixel-center form at more than
one sample where the device has one);
- centroid / sample / offset: GLSL.std.450 InterpolateAtCentroid,
InterpolateAtSample (index & (SampleCount - 1), Metal's i mod n) and
InterpolateAtOffset (offset moved to the device's origin and NClamped to
[minInterpolationOffset, maxInterpolationOffset], which Vulkan requires).
These need sampleRateShading (and MoltenVK's portability member): without
them the function is refused Unsupported(PullModelInterpolation).
- MoltenVK's SPIRV-Cross hands InterpolateAtOffset(v) to Metal as
interpolate_at_offset(v + 7/16): such a device gets the new
VkProperty::InterpolateAtOffsetFromSevenSixteenths and the module moves
the offset by 7/16 (a module annotation picks the property).
- An interpolant used any other way (a select of two) stays
NotImplemented(PullModelInterpolation); on RADV
(InterpolationNeedsTheWholeQuad) a sample or offset read after a discard
or outside the first block is refused; lavapipe refuses a multisampled
centroid read as it refuses a centroid varying.
- GraphicsState::interpolates_at_sample states a fragment stage that reads
at a sample (Vulkan takes no InterpolateAtSample with custom sample
locations); Sampling::Interpolant carries center/centroid/sample.
Metal measured on the M3 Max, macOS 27.0.1, with the new probe
probes/pull_model_interpolation.m over the owned fixture
pull_model_interpolants (cases origin, grid, samples, centroid, lane): an
offset is read from the pixel's corner as given, no range, no grid, NaN for
a non-finite one; sample i reads i mod n at Vulkan's standard positions;
centroid is the center when the pixel is covered whole, else the lowest
covered sample. The offset's range and grid are the device's:
PrecisionNote::DeviceInterpolationOffset (validation: Recorded), in
docs/API.md's catalogue and FAST-PATHS.md's device gaps; a centroid read
notes MultisamplePosition as a centroid varying does.
Verified: tests::engine_pull_model (309 pipelines over every committed
profile at 1 and 4 samples: instructions, mask's planned SampleCount,
origin, NClamp, note, property, L3; refusals on vk12-floor, RADV after a
discard, lavapipe centroid at 4x; pm_selected refused everywhere),
engine_multisample, engine_fragment, engine_coverage_loop, fast_paths,
api_tests, codec and cache tests, metal2vulkan-air abi/intrinsics tests and
api_surface; runtime degradation and catalogue tests; clippy all features.
Before: every pull_model_interpolants function failed InvalidInput
(Abi(UnknownKey)). Goldens: only new rows and the moltenvk-m3 profile hash
moved (its new property); inventory 24 new rows, 0 moved cells.
SEMANTICS_VERSION 1941 (refusals became translations), ARTIFACT_FORMAT_VERSION
481 (IoSampling, PrecisionNote, VkProperty and GraphicsState encodings).
(cherry picked from commit 70e01b4bd6f8a0d1421ae07ed710714fb4ce985b)
|
||
|
|
b5e18d8fb3 |
Document the nearest-width line route; name its cause in the notice
Follows the previous commit, which drew at the nearest width what neither line route draws. Its nearest width is Metal's drawn width: w', and 1/16 at w' = 0 (Metal draws 0 as 1/16, the width-0 commit this rebased onto), clamped into lineWidthRange where the device enables wideLines, else 1. - line_width.rs: module docs for the Nearest route and what still refuses (a strip's band whose segment list cannot be drawn; the band variant's forms the translator does not build). The lines-at-nearest-width notice's object names the edges or lines drawn, its reason the width drawn, lineWidthRange (or no wideLines) and the cause. - The runtime README's line widths, FAST-PATHS.md's wide_lines row (counter nearest_width_line_draws) and its known gap (what is drawn at the nearest width, announced, instead of refused), RUNTIME-PORTING's SetLineWidth row. - refusal_surface reach.tsv: gap WideLines now reaches only a strip's band list; feature WideLines only the translator's band forms. REFUSALS.md regenerated (gap::WideLines sites 5 -> 1, the runtime's Unsupported(WideLines) site gone). - api_signatures blessed: Degradation::LinesAtNearestWidth, WorkCounts::nearest_width_line_draws. - RUNTIME_VERSION 1715 (a refusal became a run, a new announcement); runtime-sources pin recomputed on this tree (pin-compute.py, which reproduces 9ada26c9fa's pin on that tree). Verified: refusal_surface.py --check exit 0; cargo nextest run -p metal2vulkan-runtime -p metal2vulkan --all-features -E 'test(/line_width|degradation|api_signatures|api_surface|refusal_surface|apple_only|error_kinds|draw_shape|call_checks/)' 27 passed; cargo clippy --workspace --all-targets --all-features -D warnings clean. (Carried to development from steelbrain/reims-graphics-kext 7aed54b621.) |
||
|
|
eb41a55e82 |
Draw every width Apple's setLineWidth: takes, as Metal draws it
RenderCommandEncoder::set_line_width refused every width but 1 (AppleOnly::LineWidth). Measured on the Apple M3 Max under macOS 27.0.1 (probes/line_widths.m): each encoder starts at 1 and the width holds across draws and pipeline states; Metal draws w' = floor(16 w) / 16 clamped to [0, 16] (NaN and negatives as 0, infinity as 16); at w' = 1 its ordinary diamond-exit lines; at every other w' Vulkan's non-strict parallelogram (major axis the larger extent, x on a tie; minor-axis edges through the endpoints, w' long and centred; ends not extended; centres inside, top-left ties; the width not rounded); at 0 exactly the pixel centres on the segment; one parallelogram per strip segment with no joins; triangles in fill mode Lines draw their edges so; at 4 samples every width is the parallelogram at the sample positions. The runtime (render/line_width.rs) keeps the quantized width in the encoder state and routes each draw at w' != 1: - the device's own lines (lineWidth w', no Bresenham mode) where it enables wideLines and w' lies in lineWidthRange above 0: exact where strictLines is unset, nonStrictWideLinesUseParallelogram set, w' > 1 and on lineWidthGranularity; elsewhere announced device-wide-lines under the default DevicePolicy::wide_lines = WideLinePolicy::Device, and the band under WideLinePolicy::Exact (exact_answers() selects it); - the pipeline's band variant otherwise (no wideLines, MoltenVK among them; w' outside the range; w' = 0 at half a width of 2^-subPixelPrecisionBits): cull none, the band's front face, fill mode, a PATCH_LIST of two points, viewport 0's half extent pushed with the half width; strips and loops listed as their segments (ListGap::WideLines), flat inputs under the last provoking vertex read from the list led by the last vertex, which covers the same pixels. Refused: Unsupported(WideLines) needing tessellationShader where neither route draws a line; NotImplemented(RuntimeGap::WideLines) for a triangle's edges or a mesh draw's lines the device's lines do not draw, an amplified band, a rate-mapped pass and an execution's commands. Counted: WorkCounts::device_wide_line_draws, line_band_draws. The lane test runtime_lane::line_widths draws the probe's cases through owned fixtures and compares every pixel with Metal's answers (line_widths_m3_max.txt, the probe's output), checks each wide draw took a route, and that every fragment is front-facing; its site WIDE_LINES holds the new kind in the lane's degrade-notice closure. Docs: FAST-PATHS.md's row for wide_lines and a known-gap bullet (edges and mesh lines on devices without wideLines, near-plane cuts, band fragments' inputs uncompared, width 1 on multisampled targets off MoltenVK); API.md's policy bullet and degrade catalogue; the runtime README's Line widths; RUNTIME-PORTING's row; REFUSALS.md regenerated (reach rows for feature and gap WideLines, apple LineWidth gone). Validation: the line limits the device description gained describe execution and are not compared in a profile's subset check; the generator's CORE_PROPERTIES and roadmap-2022's m2v_layer_presentation state them at the reader's absent values; opened_chains reblessed (one member more, wide_lines, on every device with it); golden_hashes' profile fingerprints reblessed (no output cell moved); api_signatures and api_surface name WideLinePolicy and LineBandState. RUNTIME_VERSION 1712; the runtime-sources pin rewritten. Verified on the M3 Max under MoltenVK 1.4.2 through maclock with the validation layer: runtime_lane::line_widths, 4 tests pass. Default and exact policies each: 102 cases, 100 matched pixel for pixel, 2 refused (the two fill-mode Lines cases at width 4, NotImplemented(WideLines)), 0 announced; 46 draws took the band, 0 the device's lines (MoltenVK has no wideLines). a_band_needs_tessellation (tessellationShader withheld: width 0 refused needing it, width 2 refused, width 1 matches) and the_lane_s_maps_tell_the_widths_apart pass. Negative control: the band widened by 1/16 of a pixel fails both runs at LANE lines 0.5. Also cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; nextest of metal2vulkan, -air, -runtime and -devtools (4954 run, the one failure the missing lane site, now declared), of metal2vulkan-validation (the failures the profile rules, chains and pin fixed here, rerun green) and of metal2vulkan-conformance (1007 pass). Not run: lavapipe, RADV, ANV and NVIDIA lanes, which take the device route. (Carried to development from steelbrain/reims-graphics-kext b16d03150c.) |
||
|
|
bf3ce3813c |
Read Core Image kernel libraries and split whole aggregate accesses
A Core Image kernel library (metal -fcikernel, metallib -cikernel) is a
metallib of file type 1 whose kernels (!air.ci) are listed as function
TYPE 5 over one shared module. The container refused the file type
(Unsupported LibraryKind(1)), so newLibraryWithData: failed where Metal
succeeds; the consumer's graphics-kext lane hit it on Core Image's own
helper library in a macOS 26 guest, so every Core Image path stopped
there.
What Metal answers, measured with kernels written from scratch on an M3
Max under macOS 27.0.1 (probe programs over Metal's API and objc's message
log of a CIColorKernel render):
- newLibraryWithData: takes it as MTLLibraryTypeExecutable; functionNames
is empty; the private externFunctionNames lists the kernels in the
reverse of the table's order (libraries of two and four kernels);
- newFunctionWithName:, newFunctionWithDescriptor: and the private
newExternFunctionWithName: make each kernel with functionType 4 (no SDK
enumerator; its description prints "Unknown"); newExternFunctionWithName:
answers as newFunctionWithName: for any library, a kernel of an
executable one included, and nil for a missing name;
- a compute pipeline made from an extern function fails ("Function tint
was not found in the module");
- Core Image fetches each kernel and its own helpers with
newExternFunctionWithName: and links them on the CPU, in Metal.framework's
base device class, into an ordinary executable library holding one
kernel, ciKernelMain, of which it builds a plain compute pipeline.
So now:
- container: file type 1 is read (executable; its functions may share one
bitcode range, hashed once, as a dynamic library's); TYPE 5 is the new
FunctionStage::Extern, no stage: the ABI cross-check refuses it as a
mismatch, Library::Function compiles it as no entry (EntryNotFound,
available 0). Unobserved file types stay LibraryKind refusals.
- FunctionType gains the private enumerator Extern = 4
(regen-metal-enums PRIVATE); reflection maps Extern to it.
- runtime Library: function_names leaves extern functions out;
extern_function_names (reverse table order) and
new_extern_function_with_name are new.
ciKernelMain itself was refused next: Lowering(Arith) at its first
load, `load [4 x <4 x float>], ptr addrspace(2)`, a whole array loaded
from the constant buffer and passed by value to a helper. Lowering reads
and writes buffer and threadgroup memory a scalar or vector at a time.
The new canon pass `aggregates` (after SCCP, beside the other expansions)
replaces each non-volatile, non-atomic load or store of a pointer-free
array or struct in device, constant or threadgroup memory by its members'
accesses in layout order (a getelementptr i8 at the member's distance, the
access's alignment lowered to what the distance allows, joined by
insertvalue or split by extractvalue), at most 256 members, 8 deep.
Thread memory, pointer-holding aggregates (handles), volatile accesses
and larger types stay whole as before. The same-type pointer bitcast
beside the load was never the problem (verified alone).
Public surface: metal2vulkan-air FunctionStage::Extern; metal2vulkan
FunctionStage::Extern and FunctionType::Extern; runtime
Library::extern_function_names and new_extern_function_with_name
(api_signatures blessed: 5 added, none changed or removed). devtools
gains core_image_metallib. The metal-enum generation now records the
macOS 27.2 SDK (the host's Xcode); no SDK value changed, only Extern was
added. LibraryKind's doc and reach note name what it refuses now.
No cache version moves: file type 1 and aggregate accesses outside thread
memory were refused before, so no key reached them, and
golden_hashes_match_the_table passes unchanged (every public fixture
assembled: this Mac's Xcode 27.2 now has its Metal toolchain). The
runtime-sources pin moves (runtime library.rs): re-pinned here to
23766690fd75227c5333e976bfc1fdfafa6ff78f43e0c5ba8fa5183574cd9371.
Verified (M3 Max, macOS 27.0.1):
- Metal versus this tree's runtime on MoltenVK: Core Image's linked
ciKernelMain for a tint color kernel and for a sampler kernel (both
from-scratch CI kernels; the linked libraries captured from Metal in
scratch and deleted after), same constant buffer, source texture and
sampler, 4x4 RGBA32Float target: byte-identical texels, the early-out
column untouched on both. The parent tree answers FALLBACK (Lowering
Arith) for both. Release CLI: 0.01-0.03 s, 11 MiB each.
- Release CLI, parent vs this tree, largest public fixtures
(hfb_filter_bank render pair, tns_mm_flags), three runs each:
0.12-0.13 s vs 0.12-0.16 s and 0.05-0.06 s vs 0.04-0.05 s, 27 MiB both
(runs beside a test suite; the same within noise).
- New tests: canon aggregates (split loads, stores with nested arrays and
lowered alignments, threadgroup; volatile, pointer-holding and
300-element aggregates stay whole), an engine test running a
ciKernelMain-shaped kernel on the CPU interpreter on three profiles,
core_image_libraries (container types, stages, shared hash, functionType
4, EntryNotFound), and a runtime device test on MoltenVK (names, extern
names, both lookups, pipeline refusal, an executable library's kernel
through the extern lookup). Negative controls: the split and execution
tests fail with the pass disabled; the library tests fail with file
type 1 refused.
- cargo nextest -p metal2vulkan -p metal2vulkan-air -p metal2vulkan-runtime
-p metal2vulkan-devtools --all-features: 4927 passed (golden hashes and
the metal-as fixture parts included); -p metal2vulkan-validation
-p metal2vulkan-conformance: 2369, all passed after the re-pin; doctests
ok; clippy --workspace --all-targets --all-features -D warnings and the
runtime's under --cfg m2v_gpu: clean; rustdoc -D warnings and
scripts/api-docs: clean; REFUSALS, METAL-COVERAGE and
CONFORMANCE-COVERAGE re-derived (MTLFunctionTypeExtern is listed as not
yet compared by a conformance case). Not run: a corpus translation
census, and the device suites beyond the new runtime test.
|
||
|
|
20287666c0 |
Blend extended-range attachments in the device's arithmetic; drop the 32-bit float Metal blend
Rule 1 (owner, 10-29): where the device has a native form, it is the only form.
An extended-range attachment's raw codes are something no blend unit reads, so the
shader still blends it (capability), inside the pixel interlock or over lavapipe's
input attachment. Its arithmetic used to be Metal's compiler's: lerps, common
factors, fusing by factor rank, half rounding at every step, a separate float4
model and computed-output tables. Now it is a blend unit's arithmetic: S*Fs op D*Fd
in float, in the order of the blend equation, with the source, second source and
blend color clamped to the form's range first (`extended_range::blend::native`).
- computed.rs is deleted. blend_color.rs keeps only the two source ranges.
- input_blend.rs and fetch.rs call native().
- The blend color is pushed as raw f32 bits (HalfBlendColor), so
PushField::BlendColor is gone.
- Every blended extended-range output that stores a channel now records
ExtendedRangeBlendSource (half) or ExtendedRangeFloatBlendSource (float).
- The refusals ConstantColorDifference, SrgbForm and FloatOutput are gone, as is
the fast-math DualSource refusal for extended range. Every factor, operation
and mask is built; only outputs other than four half or float lanes are
still refused (Output).
The 32-bit float storage-form blend (`Blend::float32`, `fetch::float32_blended`)
computed Metal's fused forms in float. Every committed profile except
roadmap-2022 and vk12-floor sets COLOR_ATTACHMENT_BLEND on R32/RG32/RGBA32_SFLOAT,
so that form copied Metal's bits where the device blends natively. It is removed:
- a fetched 32-bit float attachment takes the generic float blend
(UnmeasuredFetchBlend);
- one that is not fetched gets the device's blend after the pass splits.
The float4-output paths of the half/unorm8 model (Atom::Sf, Arith::Kept,
round_inner, Blend::float/narrow/takes_float) were dead after this and are pruned.
Removed:
- the Metal blend-table validation lane (extended_range_blend_table.rs)
- devtools xr_blends
- the xr_blend_table*.txt fixtures
- lower/arith/tests/blend32.rs
- the extended_range tests that pinned Metal's forms
Added:
- every_blend_is_the_devices_arithmetic: every form, 19 factors, 5 operations,
rotating masks and adversarial sources, bit-exact against a float model of
S*Fs op D*Fd
- every_blend_is_built_but_a_placeholder
Docs:
- FAST-PATHS: the "Metal's rounding per shape" fast row is removed. The
extended-range blend is now a device-gaps row with the two notes. The
32-bit float row and the interlock section are fixed.
- artifact.rs note docs and the API.md catalogue are rewritten.
- REFUSALS is regenerated, reach.tsv updated and api_signatures blessed
(removed ExtendedRangeBlend::{ConstantColorDifference, FloatOutput, SrgbForm},
PushField::BlendColor).
- Conformance: the two notes join replay::NATIVE_NOTES, and 16 Apple M3 Max
known-gaps rows hold the xr-blend add/premul sites the device's arithmetic
moves: one code, two at the sRGB premultiplied sites.
- SEMANTICS_VERSION 1923, ARTIFACT_FORMAT_VERSION 479.
Size: a premultiplied half4 fill into RGB10A8_2P_XR10 on moltenvk-m3 goes from
3275 to 1937 SPIR-V words (the blend itself from 2133 to 795). The float4 fill
goes from 3435 to 1951 words, and BGRA10_XR_sRGB premultiplied from 7992 to 6654.
Verified:
- metal2vulkan lib, touched modules: 511/511.
- Sabotage: rounding the source to half in native() fails
every_blend_is_the_devices_arithmetic; restored, it passes.
- clippy, plain and with --cfg m2v_gpu; rustdoc -D warnings.
- M3 Max conformance replay of 25 cases: half-output-blends-*,
blend-interaction-format-float32 and xr-blend-*-one-zero are justified; the 16
xr-blend add/premul sites are held by the new rows.
The replay exits 0 with the ledger held exactly. The conformance crate
passes 1007/1007, CONFORMANCE-COVERAGE is regenerated, and runtime
degradation/catalogue and api_signatures/api_surface/refusal_surface pass.
- M3 device tests (memcap + maclock, --cfg m2v_gpu): 11/11 of
runtime_lane::extended_range_blends and framebuffer_fetch::generic_blend.
The renamed blends_of_half_outputs_into_extended_range_texels asserts
Metal's bytes for one-zero and prints the 16 add/premul outputs the device's
arithmetic moves.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 808143ef80, then 18431ee908 (the re-pin).
|
||
|
|
bd3c50d741 |
Take the device's own Depth16 bias and its store of an extended-range, padded or bfloat attachment's untouched texels
The device's depth bias unit on every format, and the device's store of untouched texels in
place of the unused-bits load pass (deleted with its capture machinery); the NaN depth
discard documented as capability. SEMANTICS 1910, RUNTIME 1682.
One work packet, landed as 7 commit(s) (88bcfeaea8..6aec9db4e9 on archive/development-linear-2026-10-28-evening), in order:
* Take the device's depth bias on a Depth16Unorm depth
Rule 1: the device's depth bias is its native form, so it is the only one. A
constant bias (or a slope alone) on a Depth16Unorm depth was recorded through
VK_EXT_depth_bias_control's depthBiasExact as Metal's own rule, c + 1 units of
1/65535 for c of 0 or more and c - 1 below (one unit for a slope alone), in
depth (floatRepresentation) or in 2^-16. Now `metal::state::depth_bias` hands
Metal's constant to vkCmdSetDepthBias in the device's own unit r on every depth
format; Vulkan leaves a fixed-point format's r to the implementation, at most
2 x 2^-16 ("Depth Bias", primsrast.adoc).
Deleted, nothing reading them any more: `depth16_units`, `DepthBiasUnit` and
`DepthBias::unit`, the `depth_format` parameter of `depth_bias` and of the
runtime's `vk_depth_bias`; the runtime's vkCmdSetDepthBias2EXT path
(`DepthBiasCommand`, `depth_bias_command`, the record's pinned representation,
the device's command, its priming and `DEPTH_BIAS_CALLS`, the exit guard's and
recorder's `CmdSetDepthBias2`, `Logged::SetDepthBias2` and its thunk, so
`CommandsReplayed::cmd_set_depth_bias2` goes). VK_EXT_depth_bias_control is
still described but no longer consumed, so the core recommends enabling neither
it nor its three features.
RADV on the 780M no longer takes DriverDeviation::MetalDepth16BiasedStores: it
was measured through the exact unit. MoltenVK keeps it (it hands Metal its
constant, by construction). Elsewhere `unorm-depth-bias` announces the device's
bias; its cost text, docs/API.md's entry, the deviation and property docs and a
new FAST-PATHS device-gap row state it.
Tests: `metal::state::a_unorm_depth_bias_is_metals_constant_in_the_devices_unit`
(the constant as given on lavapipe, NVIDIA and MoltenVK, which have
depthBiasExact or not); the recommendation test leaves the extension and its
features out; the driver-facts test drops RADV's row; the exit-guard tests lose
the priming group and render_state.rs as a keeper of the device's functions.
api_signatures blessed (DepthBiasUnit, DepthBias::unit, depth_bias's signature);
the refusal surface is unchanged. Not bumped here: RUNTIME_VERSION (the versions
commit) and the runtime-sources pin (landing).
Verified: cargo clippy -p metal2vulkan -p metal2vulkan-runtime
-p metal2vulkan-validation --all-targets --all-features -D warnings; nextest of
metal::state, device::tests::{enables,driver_facts,profile}, tests::fast_paths,
api_surface, api_signatures, exit_guard, render_state, degradation_catalogue,
draw_shape_notices and ash_interop: 159 passed.
* Cite the spec that leaves a NaN fragment depth undefined, which makes its discard capability
The native-arithmetic audit asked whether `clamp_depth`'s discard of a positive NaN
depth, on every profile, emulates Metal where the device has a native form. It does
not: Vulkan defines no answer for such a depth. "Depth Clamping and Range
Adjustment" (fragops.adoc, 35.10.1): "If zf is not in the range [zmin, zmax],
then zf is undefined following this step", with or without depthClampEnable, and a
NaN lies in no range; only depthClampZeroOne, which no profile enables, keeps a
float depth unchanged (and then the comparison of a NaN would still pass ALWAYS
and NOT_EQUAL, where Metal's fails every test). So the discard stays, as
capability, and the comment says why, so a later audit does not re-raise it.
Docs only (a doc comment); no behaviour changes.
Verified: cargo fmt --all.
* Drop the cube's unmeasured gradient route from the anisotropic tests' profile comment
The route was deleted with the native cube gradients; the comment still named it as a second
home of the anisotropic emulation. Only a profile without samplerAnisotropy emulates it now.
Verified: comment only; git grep finds no other mention of the unmeasured gradient route.
* Keep the device's store of an extended-range, padded or bfloat attachment's untouched texels
What: a render pass that loads and stores a color attachment of an extended-range, padded
10-bit or bfloat format now keeps the bytes its draws do not write, the device's own load and
store (VK_ATTACHMENT_STORE_OP_STORE of a loaded attachment), on every device. The runtime no
longer reproduces Metal's tile store: the load pass that rewrote the texels' unused bits before
the pass (render/unused_bits_load.rs, bind::unused_bits_module), the capture replay that found
the tiles a pass's draws reach for it (render/capture.rs, bind::capture_assembly_module,
capture_settle_module, tile_reach_module, the translator's capture form
LoweringInputs/VariantKey::captured_positions, CaptureForm, RuntimeFact::CapturedPositions,
PushField/PushHole::CaptureAddress, Feature::TileReach, StatusBits::CAPTURED_REACH_UNMEASURED,
StatusReport::captured_reach_unmeasured) and the pipeline states' capture forms are deleted, with
ExtendedRange::load_code, Degradation::UnreachedTilesRewritten and the WorkCounts fields
unused_bits_load_passes, unused_bits_load_texels and capture_reach_*. Every draw in such a pass
announces extended-range-bits-kept, naming the attachments (render/tile_store.rs, the renamed
module); its catalogue entry, the FAST-PATHS device-gap row and the format docs state what
differs: the unused bits, BGRA10_XR's alpha clamp, a padded sRGB twin's table and a bfloat code
through half, which Metal's pass rewrites in each tile a draw reaches. snorm-minimum-kept and
shared-exponent-kept are unchanged (TileStoreIsMetals still says where the device's store is
Metal's).
The de-indexed and private list forms keep the index read the capture form shared
(PushField::CaptureIndexAddress, CaptureLayout, CapturedIndex); the binder's de-indexed draw no
longer goes through the capture draw, and the vertex function's strip restart return, which only
the capture form's layout could take (a de-indexed strip is NotImplemented(PrimitiveId)), is
gone.
Why: the owner's rule 1. The device has a native load and store; reproducing Metal's tile store
emulated Metal's bits where the device has a native form. The difference is recorded and
announced (rule 2).
Verified: cargo clippy -D warnings, all targets and features, over metal2vulkan,
metal2vulkan-runtime, metal2vulkan-validation and metal2vulkan-conformance, plain and with
--cfg m2v_gpu: clean. api_signatures blessed, REFUSALS.md regenerated. The test runs (translator
and runtime suites, the touched validation lanes on lavapipe and on the M3 Max's MoltenVK) follow
this commit and are reported with the lane.
* Bump the semantics and runtime versions for the device's tile store and depth bias
What: SEMANTICS_VERSION 1907 -> 1908 and RUNTIME_VERSION 1681 -> 1682.
Why: SEMANTICS_VERSION, because the translator's output changes under unchanged keys: the
de-indexed and private list vertex forms no longer carry the strip restart return, and the
capture form, its runtime fact and its push field are gone. RUNTIME_VERSION, because runs of
unchanged artifacts now do something else: a Depth16Unorm depth takes the device's depth bias
(no depthBiasExact or unit rescale), and a pass that loads an extended-range, padded or bfloat
attachment keeps its untouched texels' bytes (no unused-bits load pass, no capture replay) and
announces extended-range-bits-kept. ARTIFACT_FORMAT_VERSION stays: the codec tags variants by
name, and the removed ones (CaptureForm, PushField::CaptureAddress,
RuntimeFact::CapturedPositions) leave their tags unused, so an old entry holding one is a miss.
Verified: the constants alone change; the golden tables and the runtime-sources pin are
re-blessed at landing.
* Hold the lanes and the fact census to the device's store of untouched texels
What: three runtime lanes still expected Metal's tile store after 5e710fb988 made the device's
store the only form, and the mechanism test still counted the deleted
RuntimeFact::CapturedPositions.
- extended_range_blends::a_pass_of_extended_range_and_padded_colors_names_each_loaded_color:
the padded colors, which the function does not write, keep their bytes (all ones), where
Metal's pass leaves each word 0xffc0.
- extended_range_blends::a_fetched_two_plane_attachment_written_unblended_stores_metals_write:
color 2, loaded and unwritten, keeps its bytes, where Metal's pass zeroes its color words' top
two bits.
- extended_range_blend_table::a_memoryless_color_2_blends_as_a_stored_color_does: the stored
color 0's bands are compared with the unused bits as Metal's pass leaves them
(as_metal_leaves), the codes exactly, as the table's other passes already are.
- device::tests::mechanism: the variant census is 0..89 (MergedDraws takes the freed index).
Why: the lanes held the deleted exact form; the device's store is now the contract and
extended-range-bits-kept announces the difference.
Verified: on the M3 Max (MoltenVK, --cfg m2v_gpu, under maclock and memcap) the three lanes and
the rest of extended_range_blends pass (11 of 11, with waiter_submits, which failed once under a
load of 40 and passed on its rerun); on plain, device::tests::mechanism and tests::fast_paths
pass (12 of 12); clippy -D warnings clean, plain and --cfg m2v_gpu, over the four crates.
* Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
|
||
|
|
5d09f454b4 |
Make the mipmap compute filter a plain bilinear filter in float
One work packet, landed as 4 commits (87ed7f903a..1af72fc0d8 on archive/development-linear-2026-10-28), in order: * Make the mipmap compute filter a plain bilinear filter in float The owner's decision for generate_mipmaps: the device's blit chain is the answer wherever the device blit-filters the format, and a compute filter runs only where it cannot (extended-range formats, formats without blits or linear filtering). That filter is a plain bilinear (trilinear in 3D) filter at texel centres in float, not a model of Apple's datapath. bind::mipmap_filter keeps its planning, scratch layout and first-level fetch, and drops the exact machinery: the measured answer tables, the reciprocal and tail models, the soft-float arithmetic and MipmapRule. The kernel decodes each field to float (Metal's 8-bit sRGB and extended-range sRGB tables, the packed floats and RGB9E5 exactly), sums the taps a linear sampler takes at the texel centres in tap order with no contraction, and encodes to nearest even. It needs no 64-bit integers. cpu.rs is the same filter on the CPU, the kernel's reference. The runtime still names the removed items; it follows in the next commit. Verified: cargo nextest run -p metal2vulkan --all-features --lib -E 'test(/mipmap_filter/) | test(/owned_divisions/)', 9 passed: every kernel validates on every committed profile, and the kernel run in the SPIR-V interpreter equals the CPU filter byte for byte over 38 formats and 9 shapes (arrays, cube, 3D, strips) and over 39 fetched first levels. * Make generate_mipmaps the device's filter: its blits, else the compute filter The owner's decision for generate_mipmaps: the device's blit chain (vkCmdBlitImage, VK_FILTER_LINEAR) is the answer for every format its blits filter, and the compute filter only where they cannot. No refusal for accuracy; refusals stay for what cannot run or what Metal refuses. mipmap_plan::plan_mipmaps now plans Blits, Picks or Filter. A filtered format takes the blit chain where the image's format has BLIT_SRC, BLIT_DST and SAMPLED_IMAGE_FILTER_LINEAR and the image takes transfers; it takes the compute filter where they lack (an extended-range format, an 8-bit sRGB texture held as its UNORM twin, a format without blits or linear filtering) and the filter computes the format in an image of its bytes. Otherwise the refusal names what the blits lack. The 1D refusal is gone (Metal makes 1D textures of one level, which are left as they are). Removed: the per-format first-use check against mipmap_answers.txt (mipmap.rs keeps only the blit recorder), mipmap_answers.txt, MipmapVerdict and Device::mipmap_generation, metal_release::MIPMAP_RULE, the texture facts' check cache, new_runtime_texture (only the check used it), and the degradation kinds mipmaps-within-spread and mipmap-tie-rounding. One kind replaces them: device-filtered-mipmaps (precision), announced once per device on both paths. WorkCounts::mipmaps_filtered counts compute-filter chains; image_blits_recorded counts the chain's blits. The filter kernel now decodes normalized, sRGB-step and extended-range codes by a product with a reciprocal rounded once to f32 instead of a division, so every operation is one Vulkan has a device round correctly and the CPU model is the device's answer on a device keeping f32 subnormals. The validation lane mipmaps_exact becomes mipmap_chains: the blit chain (work counts, each halving level within a code of the float filter, announced), every format the filter computes (the device's blits or the filter, the filter's levels byte for byte the CPU's), an extended-range texture announced as the filter, the picks, and the in-place fetch. texture_blits' every-format lane prints each format's way. Docs: API.md's catalogue, FAST-PATHS.md (a device-gaps row; the BGRA4Unorm gap's text), the runtime README, REFUSALS.md regenerated, api_signatures blessed, api_surface's table. RUNTIME_VERSION 1665 -> 1666 (mipmap behaviour changed) and the runtime-sources pin. Verified: cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; rustdoc -D warnings for metal2vulkan and the runtime; the runtime's whole suite plus the translator's surface, fast paths, refusal and mipmap tests (1180 passed); the runtime-sources guard. On lavapipe (scripts/linux-gate, arm64, --cfg m2v_cpu_icd), 13 passed: mipmap_chains (5), texture_blits' every-format lane, read_through_views' mipmaps, memoryless_uses (4), rgbx_textures' refusals and degrade_notices' site list. There the blits made 29 of the 38 formats the filter computes (87 chains), the compute filter made R8Unorm_sRGB, RG8Unorm_sRGB, RG11B10Float, RGB9E5Float, BGR10A2Unorm and the four XR formats (27 chains), each the CPU's byte for byte, and device-filtered-mipmaps was announced once. * Hold the device's filtered mipmaps among the conformance suite's native notes generate_mipmaps is now the device's filter (its blit chain, else the compute filter) and announces device-filtered-mipmaps: the device's own filtering, which rule 1 names, so it joins replay::NATIVE_NOTES beside device-sampling. Values still compare field by field. Verified on the merged tree (5a1a62bb0e + the mipmap commits): clippy --workspace --all-targets --all-features clean; nextest -p metal2vulkan-conformance -p metal2vulkan-runtime: 2140 passed. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
1395addb47 |
Say what Metal leaves where a plane's GPU rows share bytes, and guard the copy that had no rule
The steps this packet landed as, in order: - Name BGRA4Unorm's packed-16 attachment and its color input in the API guide Content: the tree of `development` at ebd18b3408, unchanged. |
||
|
|
1366be1718 |
Read the problems a Problem forwards to, and hold each to a basis
The steps this packet landed as, in order: - Keep the quoted Metal messages out of rustdoc's link syntax - Record the runtime sources' hash after the sub-problem basis lines Content: the tree of `development` at 3ade9d9999, unchanged. |
||
|
|
cee7431132 |
Record, per refusal, why Metal is believed to refuse the input
The steps this packet landed as, in order: - Record the runtime sources' hash after the refusals' basis lines Content: the tree of `development` at 75f847189a, unchanged. |
||
|
|
ce22858836 |
Move the fill's empty pattern and the unstrided indirect buffer out of Invalid
Content: the tree of `development` at cac3120433, unchanged. |
||
|
|
7561e7bc4e |
Move the four refusals plain Metal takes out of Error::Invalid
The steps this packet landed as, in order: - Hold the off-four execution range to an offset inside its buffer Content: the tree of `development` at 15b0982f8c, unchanged. |
||
|
|
eab25ced7d |
Cite a refusal's sites by file and function, with no generation stamp
The steps this packet landed as, in order: - Say so when a conformance-coverage module is run as a command - Order the TOOLCHAIN fixture lines by byte value, not by the host's locale Content: the tree of `development` at b5a0b1378b, unchanged. |
||
|
|
a8cdfdf4b0 |
Take alphaToOneEnabled where the device offers alphaToOne
Content: the tree of `development` at d44e4aac04, unchanged. |
||
|
|
da148c3ff0 |
Take every MTLFunctionOptions word a function descriptor carries
The steps this packet landed as, in order: - Take an indirect command's buffer at or past the declared bind count - Re-derive the generated documents at the landing tip Content: the tree of `development` at dd2238827d, unchanged. |
||
|
|
1ab5ae7380 |
Move a 16-bit multisampled depth's samples by draws, as its codes
The steps this packet landed as, in order: - Say in the refusal surface what a 16-bit depth copy really waits on - Copy a multisampled 16-bit depth, which plain Metal copies exactly Content: the tree of `development` at 688b62deab, unchanged. |
||
|
|
a4c7613e3d |
Ask the device for the sample positions it is actually given
The steps this packet landed as, in order: - Ask the device for the sample positions it is actually given - Hold a rotated IOSurface texture's pitch to the texture's own row - Take a PVRTC whole level at any pitch Metal takes it at - Recompute the runtime sources pin on this base Content: the tree of `development` at 575917bf7b, unchanged. |
||
|
|
3d9d7c5885 |
Make the ledger hold a divergence and a venue, not refusals alone
The steps this packet landed as, in order: - Adopt the fragment quad's lavapipe divergence, scoped to that venue - Name the device's own gap where the vocabulary could not, and the notice in a notice-only difference - Pin the sparse sample-count chain as the device's gap, with lavapipe's measurement - Recompute the runtime-sources pin after the rebase Content: the tree of `development` at fb88ec8599, unchanged. |
||
|
|
b0b61ac179 |
Time a fault that later failing encoders follow as Metal's GPU reaches them
The steps this packet landed as, in order: - Stop a running predicated loop at the GPU's recovery from a fault or a hang - Resolve multisampled extended-range targets by Metal's measured rules - Run the emulation's indirect mesh draws with an object function Content: the tree of `development` at 60cf488339, unchanged. |
||
|
|
4da2c33f1a |
Zero a multisampled sparse texture's unmapped tiles by clears
The steps this packet landed as, in order: - Say whether the multisampled sparse lane ran on a sparse image - Answer per indirect command buffer whether its identifier is unmeasured - Bump the semantics, artifact format and runtime versions for the ninth stack - Pin the runtime sources of the ninth stack Content: the tree of `development` at 9e2387685c, unchanged. |
||
|
|
e69068885b |
Write a kernel's draw of a primitive type past Metal's five as points, as Metal's encoding does
The steps this packet landed as, in order: - Give the private-writes fixture its golden printout and inventory rows - Draw an indirect render command's private primitive types as the encoder's draws of them - Count an injected page fault or hang toward a queue's revocation, as the error it stands for - Drop a unit's ungated dispatches at its unbalanced first record, as Metal does Content: the tree of `development` at 8e08f4d248, unchanged. |
||
|
|
027451fc5f |
Revoke a queue at its second caused GPU error, as Metal does
The steps this packet landed as, in order: - Draw private types in a pulled list form where the indexed list differs from Metal Content: the tree of `development` at d3fc3a5794, unchanged. |
||
|
|
e323ba2f72 |
Run tile threadgroups of every even shape in Metal's thread layout
The steps this packet landed as, in order: - Read the coverage after the early depth test for [[sample_mask, post_depth_coverage]] - Copy a stencil view's texels by the CPU as plain Metal does - Give multisampled fragment imageblocks a block per sample, and test before writes a test may drop Content: the tree of `development` at becd3e74a9, unchanged. |
||
|
|
1400c9049f |
Resolve a NaN clear as Metal does in a pass whose draw calls draw nothing
The steps this packet landed as, in order: - Leave a resolve texture untouched where Metal's tile is not stored into its format - Take setDepthCleared, setStencilCleared and setVertexAmplificationMode as Metal does - Run the private alpha test in the fragment function as Metal tests it - Clamp depth comparison references as Metal's fragmentDepthCompareClampMask says - Take vertexAmplificationMode and explicitVisibilityGroupID as Metal does - Record no restricted depth range where the driver keeps depth values outside [0, 1] - Draw Metal's private logic operation: copy and no-op everywhere, the rest through logicOp - Leave the default alpha test and clamp mask out of the inputs encoding test's derived Debug - Clamp the reference of a depth comparison the shader makes under the clamp mask - Key each Vulkan logic operation's pipeline apart - Refuse a multisampled extended-range resolve naming its format and Metal's rule Content: the tree of `development` at 0231dbbd54, unchanged. |
||
|
|
766ba91b30 |
Keep a heap's two-plane array and mipmapped texture in the heap's bytes
The steps this packet landed as, in order: - Give the 3D two-plane heap texture test a Private descriptor - Lay a heap's depth and stencil textures out in Metal's tiles on MoltenVK - Answer Metal's heap size for PVRTC textures and tile them under 27.0.1 - Lay a heap's Depth32Float_Stencil8 texture out in Metal's two tiled planes - Make a host heap's uncompressed multisample texture in memory of its own - List the two-plane array fixture in the engine inventory, with its printout - Let the no-copy heap lane find a compressed texture's texels in Metal's tiles - Name the depth heap lane's aspect list type for clippy - Announce a device heap's textures whose bytes are not Metal's layout - Lay a heap's X32_Stencil8 texture out in a Stencil8 texture's tiles Content: the tree of `development` at b3c694ad82, unchanged. |
||
|
|
ee21fca2f4 |
Write Metal's bytes in texture fills and two-plane buffer blits
The steps this packet landed as, in order: - Hold RGB10A2Unorm_sRGB textures with Metal's conversions - Name the runtime's gap, not a missing feature, for fetch on interlock devices - Take clippy's forms in the RGB10A2Unorm_sRGB tests - Fill multisample textures' samples as Metal's private fills write them - Check fill units only for the formats the crate holds textures of - Hold a two-plane texture's bytes between rows, which Metal's buffer blits read back - Fill texture buffers as Metal does: bytes of the buffer, the pattern streamed - Drop the multisample fill from apple_only's refusals, which fills it - Meet the rows of a two-plane buffer blit into the texture in Metal's order - Announce narrow two-plane row meetings across groups of 32 rows as one of Metal's Content: the tree of `development` at 9d3447dec9, unchanged. |
||
|
|
c83dcdd384 |
Give the predication step ops that drop, hold and resume a range, and check a unit's end
The steps this packet landed as, in order: - Answer command predication as Metal does on an M3 Max under macOS 27.0.1 - Probe Metal's command predication from the validation crate's Metal platform - Wait for the predication probe's command buffers through the bounded wait - Name the record a predication block left open came from in its command buffer's failure - Refuse a run's first indirect dispatch of another dispatch type at Metal level 26.7 - Read an encodeEndDoWhile's word only where it closes a live DoWhile - Run command predication on devices without buffer device addresses - Nest predicated loops to any depth, their copies bounded by what they lay down - Read a predication word past its buffer as Metal reads it - Halt a predication unit where a loop runs past its copies - Name the lane's fixed loop case type, which clippy found too complex Content: the tree of `development` at ef8b74ec1b, unchanged. |
||
|
|
0d9e71903b |
Read VK_EXT_provoking_vertex: provokingVertexLast and provokingVertexModePerPipeline
The steps this packet landed as, in order: - Write the index rewrite pass's primitives in either provoking vertex order - Draw Apple's last provoking vertex: a last-vertex pipeline, else lists led by it - Test Apple's provoking vertex modes against Metal's on the device - Describe the provoking third way as pipeline-dependent; fix the table test - Check the last provoking vertex through a geometry stage; key its slice notice on stages - Test that executions keep the first vertex; scale the weights check by the values - Register rt6_provoking in the engine inventory and golden printouts - Add host_ab's provoking workload: flat-shaded draws at provoking vertex modes 0 and 1 - Add the index gather pass: one dispatch for a run of direct draws' lists - Gather direct indexed draws' lists in runs: one dispatch per run, not three per draw - Add the rotated-weights variant: Metal's barycentric weights from a rotated triangle - Count private lists' gathers under a last-vertex pipeline; take the open runs whole - Draw listed triangles' barycentric weights through the rotated-weights variant - Draw every provoking vertex mode past 1 the third way, its top bit set or not - Announce nothing for a provoking-mode draw that makes no primitive Content: the tree of `development` at 91b1df7b21, unchanged. |
||
|
|
9adc8a867a |
Draw Metal's private primitive types 5 to 8 as the lists Metal draws
The steps this packet landed as, in order: - Test the private primitive types' draws against Metal's lists on the device - Check the private draws through the weights' geometry stage too - Use is_multiple_of and as_chunks in the private lists - Fail a draw of primitive type 9 as Metal's GPU does - Give the private-types fixture its golden printout and inventory rows - Discard what a hang's queue schedules during it, and time the hang as measured - Regenerate REFUSALS for the type-9 runtime changes - Read Metal's quad primitive ID under private quads and quad strips - Read a type-9 hang's Scheduled at Metal's time, not at its held last batch - Schedule a hang's queue's command buffers from the hang's Scheduled on - Stop a hang's thread waiting on a failed command buffer; keep storage-form commits on their last batch - Hold a hang's joined command buffers behind a closure, so Rustdoc ends Content: the tree of `development` at 5441a97bda, unchanged. |
||
|
|
7b8ebc5b3e |
Use AtomicU64::try_update, the name fetch_update now has
The steps this packet landed as, in order: - Refuse buffer-texture copy layouts whose rows pass u64::MAX instead of wrapping - Wait without a deadline for a timeout past the host's clock, and test copies at the buffer's edge - Place a multisampled buffer copy's rows where plain Metal does, staging off-texel rows - Say that Metal copies the multisampled layouts the runtime still refuses - Count the rows a compressed-texture blit rewrites, and test a copy out off the texel Content: the tree of `development` at e5ff75b136, unchanged. |
||
|
|
7bc5866f45 |
Draw a multisampled 32-bit float depth copy, announced, where the driver's fragment depth is unmeasured
On a driver whose fragment depth is unmeasured, a multisampled Depth32Float copy is drawn and announced rather than refused. Folds in: - Draw a multisampled 32-bit float depth copy, announced, on a driver whose fragment depth is unmeasured Verified by each folded change's own checks; the tree this series ends on is the one verified at the tip on six GPUs, the CPU suites and lint (see the tables commit). |
||
|
|
930d746df7 |
Read ASTC, ETC2/EAC, PVRTC and 4:2:2 textures the device lacks through twins of Metal's decode
On a device without a texture's compressed or chroma format, the runtime now makes the texture and
reads it as Metal does. Before, such a texture was refused at its making (ASTC, ETC2/EAC) or at its
first read (PVRTC, 4:2:2, held for copies alone). The consumer's guest on the RTX 5080 stopped at
ASTC_8x8_LDR, PVRTC_RGB_2BPP and EAC_R11Unorm. NVIDIA, RADV and lavapipe have none of these formats,
and Vulkan's 4:2:2 formats need a sampler Y'CbCr conversion whose chroma reconstruction is the
implementation's.
What changes:
- The store. The blocks lie in a carrier image of the same block bytes and shape (a compressed
format the device copies: BC1, BC4, BC7, BC3, BC2, BC5, ETC2, EAC or ASTC 4x4; R8G8 for 4:2:2).
replace_region, get_bytes, blits, fills and texture copies move Metal's blocks unchanged.
- The twin. Reads go to a decoded twin holding Metal's decode, kept in step on the GPU as a BC
texture's twin is: a decode pass after a blit, a texture copy or a submitted CPU copy, and a CPU
decode on the device's decode thread after a host write. No write costs a GPU-to-CPU round trip.
A write's decode covers whole levels for PVRTC and whole rows for 4:2:2, whose texels read their
neighbours. A new texture's twin starts at the decode of zero blocks (magenta for ASTC's error
block), not at zeros.
- The decoders, our own, written from the Khronos ASTC specification, the Khronos Data Format
Specification's ETC2 and EAC chapters, and Metal's measured answers for PVRTC1 and 4:2:2:
bind::AstcDecode, EtcDecode, PvrtcDecode and ChromaDecode, with their GPU kernels
astc_decode_module, etc_decode_module, pvrtc_decode_module and chroma_decode_module on the block
decode's bindings (new api_surface rows, with AstcTexels, EtcTexels and DecodedTexelsPolicy).
- Metal's decode, matched: an ASTC LDR channel is (C >> 4) / 4095 of the 16-bit interpolated C;
an 8-bit ETC2/EAC channel c / 255, an 11-bit one c / 2047 (signed c / 1023); PVRTC upscales
colours A and B from the four block centres around a texel and blends them by its index; a 4:2:2
texel takes its own green, and red and blue (3c + n + 2) >> 2 of its pair and the pair beside it.
- sRGB forms. The ASTC, PVRTC and ETC2/EAC sRGB formats read their twin's codes raw through an
R8G8B8A8_UNORM view and decode them through Metal's table, as the 8-bit and BC sRGB formats do:
reads, nearest samples and gathers exact, with no precision notice. Linear samples keep the
device's sRGB filter (the exact sum under SamplingPolicy::Exact). A device that has the ASTC
block keeps its own sRGB decode. The linear PVRTC and 8-bit linear ETC2/EAC formats take BC1 to
BC3's Argb8 texel class, so under TexelConversionPolicy::Exact their reads are Metal's c / 255.
- The switch: DevicePolicy::decoded_texels, DecodedTexelsPolicy { Compact (default), Exact };
exact_answers() selects Exact. Compact holds an ASTC LDR twin in 8-bit codes nearest Metal's
12-bit value (at most 1/510 off) and an EAC 11-bit twin in the nearest 16-bit codes, announced
decoded-texel-precision. Exact holds their floats. PVRTC, the 8-bit ETC2/EAC formats, the ASTC
sRGB formats and 4:2:2 are exact under both. Tested by fast_paths; a FAST-PATHS row.
- Views in the other colour space. An ASTC texture viewed in its other colour space reads a second
twin, made at the first such view: Metal reads that view exactly as a texture of the view's
format over the same blocks, and the two forms widen endpoints apart, so one twin cannot serve
both. Its decodes are queued on the device and recorded by the next batch with work. Counted by
WorkCounts::second_twins, second_twin_checks and second_twin_decodes. PVRTC and 8-bit ETC2/EAC
views of the other colour space share the one twin.
- Copies between a compressed texture and an uncompressed one whose texel is the block's bytes
(BC1 or ETC2 with RG32Uint, BC7 or ASTC with RGBA32Uint) run with Metal's rule: every coordinate
in the destination's texels, a block per texel. They were refused as formats of different units.
- Notices: carried-decoded-twin (Performance) on every twinned texture; decoded-texel-precision
(Precision) only for an ASTC LDR or EAC 11-bit twin under Compact.
- Typed refusals: RuntimeGap::DecodedHeapTexture (a heap's ASTC texture, a sparse heap's carried
texture; the heap size query refuses alike); views of the ASTC HDR form, of another footprint or
PVRTC block, and of an EAC 11-bit format as its other signedness (Unsupported(TextureView));
copies between PVRTC and an uncompressed format, between two compressed formats of one block size
and different extents, and level or slice copies between compressed and uncompressed formats
(NotImplemented(Format)). A device with the native format keeps the direct path.
- Docs: the API.md catalogue entries, the FAST-PATHS decoded_texels row and known gaps, and the
module docs of astc.rs, etc.rs, pvrtc.rs, chroma_pairs.rs and decoded_twin.rs.
Why: Metal makes, reads and samples these textures on Apple GPUs, and the consumer's guest uses
them; the desktop Vulkan drivers have no such formats.
Verified:
- Metal's answers, probed on an M3 Max under macOS 27.0.1: ASTC (seeded random blocks, all 14
footprints, linear and sRGB, read as float and half) bit for bit, digests pinned by
seeded_blocks_read_as_metal_read_them; ETC2/EAC (4096 random blocks of each of the ten formats)
digests equal; PVRTC (all eight formats) every digest equal; 4:2:2 every read, sample and gather
bit for bit what an RGBA8Unorm texture of the decoded codes answers; the copy rule on every listed
pair both ways.
- On the CPU SPIR-V interpreter each GPU kernel writes the CPU decode on every texel: ASTC on every
footprint, linear and sRGB, Float and Unorm8, with blocks covering all 16 endpoint modes, every
partition count, dual plane and void extent; ETC on every decode and both texel forms; PVRTC on
every format. The kernels are valid on every committed profile.
- Runtime unit filters 63 passed and translator unit filters 183 passed (ETC2/EAC); the runtime's
unit suite 952 of 953 (the one failure the recorder's module-list test, fixed with the recorder).
- On lavapipe: chroma_pairs, pvrtc_textures, the mipmap, fill, buffer-texture and degrade-notice
lanes, 45 passed; format_copies, the whole module. A lavapipe batch caught PVRTC codes read one
ulp high under exact answers, fixed by the Argb8 class.
- clippy -D warnings (plain, m2v_gpu, m2v_cpu_icd) and rustdoc on ms01 and gem10.
|
||
|
|
0175289314 |
Batch the development-fast round: tessellation without tessellationShader, primitive ids, mesh tooling, color groups, the vk12 floor, runtime timing and teardown fixes
One commit of the 247 on development-fast (720ef1ce9a..9f46fdf80d), squashed at the user's request. Translator: - Tessellation on a device without tessellationShader: Metal's tessellator emitted as SPIR-V, a one-workgroup scan placing each patch's triangles in Metal's order, and the post-tessellation function as a plain vertex stage (EmulatedTessellationDraws; SEMANTICS 1739, ARTIFACT_FORMAT 419). - [[primitive_id]] on a device without geometry or tessellation shaders, as a flat varying the vertex function writes; indexed lists, lines and points drawn de-indexed (RuntimeGap::PrimitiveIdIndices). - Fragment functions of more colors than the device draws at once, compiled in color groups (PrecisionNote::ColorAttachmentGroups). - Object functions' threadgroup memory from the render encoder; a kernel's mesh draws from an indirect command buffer; mesh payload sizing. - The Vulkan 1.2 floor profile (vk12-floor) and the gates it needs; Metal 27.0.1 answers as the M3 Max. - Overflow tests in the runtime-built modules by the product's high word (NVIDIA's compiler fails the division form), guarded crate-wide by tests::owned_divisions. Runtime: - Color-group passes replayed per group over twin depth/stencil; snapshot and copy-back cost cuts. - Command buffers finish on the queue waiter that saw them; the waiter holds no device handle, so a program's drop after its wait is the device's last. - Every object an encoder was handed held until its command buffer completes; deallocator order and announcements. - Driver defects recorded and announced: ANV counts a visibility sample once per color output (visibility-count-per-color); MoltenVK fails pending work when memory that held a device-address buffer is freed, so freed memory waits for the work in flight (host-deallocator-delayed). - RenderCommandEncoder::set_object_threadgroup_memory_length; Visibility::counting(). Validation: mesh tooling (object, mesh and ICB-mesh cases on both executors), the authoring census closed, the queue storm judged in Metal's unit, load-robust exits and indirect-census bounds, and the golden hashes, printouts, fixture inventory and authored compile census blessed. Docs: FAST-PATHS.md trimmed to a ledger of what is true now; API.md's catalogue and accepted differences, REFUSALS.md and METAL-COVERAGE.md current. Verified on development-fast before the squash: the full suites on the RTX 5080, RTX 3090, RX 7900 XTX, Radeon 780M, Iris Xe, lavapipe and the M3 (MoltenVK and the Metal oracle), lint in every configuration, rustdoc, doc tests, packaging and public case qualification; the timing and teardown lanes x5 on every venue; the authoring-capability census 16656/16656 with 0 unresolved, the vk12-floor translation census at 6139 translated with the slowest row 794 ms and peak 126 MiB. The tree is development-fast's at 9f46fdf80d. |
||
|
|
3dd70970df |
Reach the execution status through a binding where the device addresses no buffer
The execution-status work packet: where the device addresses no buffer, the command buffer's status
words are reached through a binding the plan asks for (WriteSource::ExecutionStatus), bound by the
runtime and by both Vulkan executors, documented, with the refusal surface regenerated.
What: a stage that writes the command buffer's ExecutionStatus (an absent argument's read, a
seq_cst fence, an argument buffer's cubic-sampler test) reaches it by device address where the
device addresses buffers (bufferDeviceAddress and shaderInt64), as before, and elsewhere through
a set-0 storage buffer of its own: ResourceSlot { stage, Synthetic(ExecutionStatus), 0 }, a
storage word view the status words are written through. absent::state_status states the form;
the binding counts once in the stage's storage-buffer descriptors, so the per-stage limit check
in lower::select sees it. The ExecutionStatus fact's mechanism is SyntheticBinding on such a
device, PushConstant elsewhere. Profiles that address buffers produce the same modules as before.
Two needs, two answers past a limit (absent::StatusBinding):
- Required (an absent read, a fence): a stage past its storage-buffer limit with the binding is
refused as DescriptorCount, naming MaxPerStageDescriptorStorageBuffers.
- CubicMark (only the argument samplers' cubic test): absent::finish gives the binding back and
the stage states no cubic reach, as a fragment stage does. The mark is a may-need: only a cubic
sampler a command later lists in the argument buffer needs it, and that sampler then meets the
planner's typed refusal (SamplerBicubicFilter), so nothing is dropped silently. Refusing the
stage instead would refuse every stage near its limit that samples through an argument
buffer, cubic sampler or not, all of which compile today.
FunctionConstantArgument and SeqCstFence are now refused only where the stage lacks its stores
and atomics (a vertex or fragment stage without them), no longer for want of buffer addresses.
Why: on vk12-floor, vk12-bare, lunarg-desktop-baseline-2023, roadmap-2022 and swiftshader every
absent read and seq_cst fence was refused (on vk12-floor's census, 22 FunctionConstantArgument
and 9 SeqCstFence rows), though the device can write a storage buffer.
Tests: the absent-read, threadgroup, function-constant, seq_cst and atomics tests compile on
every profile and assert the status's reach per profile (testing::status_reach_on); a floor
interpreter run of device_fence_store binds the status by slot (word 0 is 42);
an_absent_reads_binding_counts_against_the_storage_buffer_limit (vk12-floor at its count less
one: DescriptorCount on MaxPerStageDescriptorStorageBuffers);
the_cubic_tests_binding_gives_way_to_the_storage_buffer_limit (lunarg, the limit lowered step by
step: the binding given back below the kernel's own count, every compile within the limit and
L3-valid); the kernel tests its argument samplers for a cubic filter on every heap profile.
Verified on msi-laptop (Linux, debug, LLVM 21) on this change with the binder, runtime and
validation commits that follow: clippy --workspace --all-targets --all-features -D warnings clean
by default, under --cfg m2v_cpu_icd and under --cfg m2v_gpu; rustdoc -D warnings clean; the
focused tests (engine_absent*, engine_seq_cst, engine_atomics, engine_dispatch, engine_handles,
engine_binder, engine_function_constant*, mechanism) 122/122; the metal2vulkan, air, runtime and
devtools suites 4592/4598, the 6 reds the table moves below.
Moves (blessed elsewhere, on macOS): public_fixture_expectations_engine.tsv, .ll rows, exactly 50
cells, 10 rows x the 5 profiles above, none on a profile that addresses buffers: 42 from
Unsupported{FunctionConstantArgument|SeqCstFence} to ok, and 8 to
NeedsInput{StorageTextureFormat} (absent_texture_reads_zero, fc_kernel_absent_resources,
fc_kernel_absent_sampler, fc_kernel_sampler_select on roadmap-2022 and vk12-bare: the next gate
there, which the refusal hid). golden_hashes.tsv: 104 cells, those 50 plus 54 hash changes, 18
argument-sampler rows (msf_runtime_samplers, tail_argument_samplers,
tail_argument_cube_gradient, unv_runtime_levels) on lunarg-desktop-baseline-2023, roadmap-2022
and swiftshader, which now test the cubic bit; no cell of a profile that addresses buffers.
Expected, not run here (metal-as needs macOS): the .air.ll rows of function_constant_interface
and rfs_absent_reads.
Plan the execution status's binding as WriteSource::ExecutionStatus:
What: a compute or render plan writes a stage's SyntheticBinding::ExecutionStatus binding as the
new WriteSource::ExecutionStatus: the command buffer's ExecutionStatus buffer, the one every
command of it writes, ExecutionStatus::BYTES bound. The bind module docs say how a command
reaches the status on each kind of device. WriteSource is #[non_exhaustive] and not encoded, so
neither the cache codec nor the api_surface table changes.
Why: the previous part binds the status on devices that address no buffer; the planner
refused such a binding as internal ("a compute binding ExecutionStatus").
Tests: a_seq_cst_fence_reaches_the_status_by_binding_or_address_as_the_device_allows runs
dispatch_builtins' device_fence_store through the binder harness on vk12-floor and
lunarg-desktop-baseline-2023 (one ExecutionStatus write, no status push hole) and moltenvk-m3
(the push hole, no write): each of the 24 threads increments StatusWord::SeqCstFences of the one
status (24), and the store after the fence lands (42).
Verified on msi-laptop (Linux, debug, LLVM 21) with the change's other commits: the test passes
among the 122 focused tests; clippy clean in the three cfgs; rustdoc -D warnings clean.
Bind the command buffer's status words where a plan asks for them:
What: the runtime's descriptor writer binds WriteSource::ExecutionStatus to the command buffer's
status words (command_buffer::State::status_words), the buffer whose address it pushes on a device
that addresses buffers, whole. The command buffer reads and reports it on completion as before.
Why: on a device that addresses no buffer a stage with an absent read, a seq_cst fence or an
argument-sampler cubic test now binds the status (the translator commit before); the runtime has
to bind the same buffer it reads.
Verified on msi-laptop (Linux, lavapipe, --cfg m2v_cpu_icd, debug) with the validation commit
that follows: runtime_lane::absent_reads, 3/3, on the device as it is (the status reached by
address), without shaderInt64 and restricted to vk12-floor by VK_LAYER_KHRONOS_profiles (both by
binding): each of rfs_absent_query, rfs_absent_read and rfs_absent_sampler reads zero at flag 1,
its command buffer completes with no error, and its status report states the absent read.
Bind the execution status in the Vulkan executors and prove the bound form on lavapipe:
What: the candidate executors (compute, its replays, render) hand plan_resources the status
buffer they already keep (Guest::status), and plan_resources binds WriteSource::ExecutionStatus
to it, ExecutionStatus::BYTES; device replay has none. runtime_lane::absent_reads checks, for
each of rfs_absent_query, rfs_absent_read and rfs_absent_sampler, the reach the executed pipeline
took (Ran's Reach: a SyntheticBinding::ExecutionStatus binding in its layout or the status
address in its push fields) at both flags, besides reading zero, the command buffer completing
and the report stating the absent read at flag 1. Three tests: the device as it is (address where
it addresses buffers, binding elsewhere), the device without shaderInt64 (binding), and the
device restricted to vk12-floor by VK_LAYER_KHRONOS_profiles (binding; it prints RESTRICTED and
skips visibly without the layer). device::lane_restriction (tests only) builds that restriction
for a committed profile stem, through the same restricting() runtime_restriction now uses.
Why: the translator now binds the status on devices that address no buffer; the executors must
bind it, and the evidence has to show the binding was the path that ran.
Verified on msi-laptop (Linux, lavapipe llvmpipe LLVM 23.1.1, --cfg m2v_cpu_icd, debug,
LP_NUM_THREADS=1): runtime_lane::absent_reads 3/3 with --no-capture: ABSENT-READ-COMPLETED
"reached Address" for the device as it is, "reached Binding" for the other two, RESTRICTED printed
for vk12-floor; clippy --workspace --all-targets --all-features -D warnings clean by default,
under --cfg m2v_cpu_icd and under --cfg m2v_gpu. The whole validation suites run after the
rebase onto the round.
Document the execution status's binding and regenerate the refusal surface:
What: docs/API.md section 5 says how a stage reaches the command buffer's ExecutionStatus (its
device address where the device addresses buffers, else a set-0 storage buffer of its own,
SyntheticBinding::ExecutionStatus, which counts against the stage's storage-buffer limits), and
what happens past a limit: an absent read or a fence is refused as DescriptorCount, and a stage
that would bind it only for the cubic test binds nothing, so the plan refuses a cubic sampler
listed beside it (SamplerBicubicFilter). Section 6's Status bullet says to bind the same status
buffer where a plan asks for WriteSource::ExecutionStatus. reach.tsv's SeqCstFence line now
reads "a seq_cst fence in a vertex or fragment stage without its stores and atomics".
docs/REFUSALS.md is regenerated at 43578ea93: FunctionConstantArgument and SeqCstFence no longer
list devices without buffer device addresses, and lose the sites that refused them; the rest of
the diff is the line moves since the table's last generation (f28f418da).
Verified on msi-laptop: scripts/refusal-surface/refusal_surface.py regenerates the table, then
--check and --missing-reach pass, at 43578ea93 with these docs.
Versions: SEMANTICS_VERSION 1696 -> 1698 and RUNTIME_VERSION 1203 -> 1204. SEMANTICS_VERSION moves:
absent reads and seq_cst fences compile where they were refused, and argument-sampler stages test
the cubic bit through the status. RUNTIME_VERSION moves: the status's binding is planned and bound.
ARTIFACT_FORMAT_VERSION stays: no encoded type or codec changed (WriteSource is not encoded;
SyntheticBinding::ExecutionStatus and Mechanism::SyntheticBinding already existed).
ENGINE_EXECUTOR_ABI stays: the executors bind WriteSource::ExecutionStatus only where a plan asks
for it, and no plan an earlier row recorded asks for it, so running those rows is unchanged.
crates/metal2vulkan-validation/runtime-sources.sha256 holds
d92b3692f9ec6dd09aa276901b3e5e2ca89520a9fe474835a57c7a22aeb4b85e, the hash of this tree's runtime
inputs (runtime-pin.py, which reproduces build.rs's). Version numbers quoted above are the values
the work's branch built with. Each part's Verified lines name the tree it ran at.
|
||
|
|
ecb80e019d |
Place heap textures needing up to 256 KiB alignment instead of refusing them
A heap's memory started at a multiple of 64 KiB of the runtime's block, and a
heap texture whose image needed a coarser alignment was refused
NotImplemented(HeapTextureAlignment), by heapTextureSizeAndAlign and
newTexture alike. On an RX 7900 XTX that refused nearly every depth texture a
program puts in a heap: four runtime-lane tests failed there on every run,
each with `alignment: 131072`, while the Radeon 780M in the same machine,
under the same driver, passed them.
Measured with a raw Vulkan probe on homelab-um780 (vkGetImageMemoryRequirements,
optimal tiling, attachment|sampled|transfer usage, 11 formats, sides 1 to
16384, 1/2/4/8 samples, one level or full mips), RADV under Mesa 26.0.8:
- RX 7900 XTX: 128 KiB for D16, D32F and D32FS8 images of 8 x 8 texels or
more; 256 KiB for multisample depth, stencil and color images from about
128 x 128 texels; single-sample color, storage and BC1 images at most
64 KiB. Nothing past 256 KiB.
- Radeon 780M: at most 64 KiB for every shape.
The base is now 256 KiB (HEAP_BASE_ALIGNMENT), the largest alignment measured.
The check moves into check_heap_base, which a GPU-free test can reach, and the
typed refusal stays for anything past the base. A heap over host pages
already starts at offset 0 of its own import, which meets any alignment.
Whole units of the base would have pushed the largest heaps past one
allocation: heap_size admits a heap up to maxMemoryAllocationSize in whole
16 KiB, and where that limit is no whole number of 256 KiB the largest heaps
asked more than the device allocates. RADV (4 GiB less 4 bytes) asked a 4 GiB
allocation for every heap from 4 GiB less 240 KiB, with a block's buffer of
addresses past maxBufferSize; MoltenVK (41,747,087,360 on the M3 Max,
9,534,832,640 on the M4, multiples of 128 KiB but not 256 KiB) would have
asked 128 KiB past the limit for its largest 128 KiB of sizes. So a buffer
past half a pooled block (32 MiB) now keeps its own size (buffer.rs's
`placed`). Such a buffer always takes a block of its own, where nothing
follows it; whole units exist only so the next placement in a pooled block
starts where the last ends. Buffers up to half a block still take whole
units, and half a block is a whole number of 256 KiB.
Cost: a heap of up to 32 MiB now starts at a multiple of 256 KiB of its pooled
block and takes whole 256 KiB units of it, up from 64 KiB units, so a small
heap can hold up to 240 KiB more of its block, on every device. A heap or
buffer past 32 MiB takes exactly its size, no longer rounded up. Programs see
no change where their images need 64 KiB or less. On the 7900 XTX the shapes
past 64 KiB now answer 128 or 256 KiB, are placed, and announce
heap-texture-larger-than-metal.
RUNTIME_VERSION 1179 -> 1181: heapTextureSizeAndAlign and newTexture answer
and refuse differently on such devices, heap buffers lie at other offsets in
the runtime's blocks, and every buffer and heap past half a pooled block
allocates its own size (WorkCounts::device_memory_allocated answers it).
runtime-sources.sha256 is re-pinned. docs/REFUSALS.md is regenerated, and the
reach mark's text says 256 KiB.
Tests:
- tests::heap::every_image_alignment_measured_fits_a_heap_s_base (GPU-free):
the measured alignments fit the base, and one past it is refused typed.
With the constant back at 64 KiB it fails (Err(NotImplemented(
HeapTextureAlignment { alignment: 131072 }))).
- tests::heap::the_largest_heap_asks_one_allocation_of_its_device (GPU-free):
every committed profile's largest heap asks at most one allocation and one
buffer. With `placed` rounding every size it fails on amd-780m-radv
(4,294,950,912 bytes asking 4294967296).
- runtime_lane::heaps::the_largest_heap_lies_in_one_allocation: where the
largest heap is at most 4 GiB, making it grows the runtime's memory by at
least its size and at most one allocation, with no validation message.
Without the size fix it failed on the 7900 XTX ("the largest heap,
4294950912 bytes, took 4294967296 bytes, past one allocation of
4294967292"). It reserves the memory without touching it: on Iris Xe a 4 GiB
heap took 0.04 s and a 53 MiB peak RSS; on lavapipe (debug) a 2 GiB heap
took 127 MiB.
Verified (release, --cfg m2v_gpu, one GPU pinned):
- The heap set (`test(/heap/) | test(/rebind/) | test(/no_copy/) |
test(/alias/)`, metal2vulkan-validation and metal2vulkan-runtime), before ->
after: RX 7900 XTX (RADV, Mesa 26.0.8) 176/180 -> 183/183 (the four
refusals pass); Radeon 780M (same host and Mesa), RTX 3090 and RTX 5080
Laptop (NVIDIA 615.71.09) and Iris Xe RPL-P (ANV, Mesa 26.2.4) 180/180 ->
183/183; lavapipe (--cfg m2v_cpu_icd, debug) 134/134. No kernel GPU
messages.
- Apple M3 Max (MoltenVK 1.4.1): the heap set plus `test(/buffer/)`. Every
failure fails identically at the base: heap_textures_answer_and_place_as_
metal_s_do, argument_buffer_intersection_table_is_encoded_at_reflected_field,
frees_while_the_gpu_is_busy_fail_no_command_buffer and
every_case_of_buffers_alone_runs_from_a_command_as_its_dispatch_2.
- Full GPU suites: RX 7900 XTX 3528/3531 and RTX 3090 3526/3531. Every
failure fails at the base or passes on rerun: on the XTX,
float_denormals_read_as_metal_reads_them and the two generated_executions
tests, which fail on the 780M too; on the 3090,
render_commands_and_render_states_run_as_the_executor_compiles_them and
the_runtime_probe_measures_the_test_device_consistently fail at the base,
and three timing tests pass on rerun.
- On the 7900 XTX, the heap lane's output shows answers and placements at
0x20000 and 0x40000 alignment and no HeapTextureAlignment.
- The runtime crate's GPU-free suite: 856/856. Clippy (workspace, all
targets, all features, and --cfg m2v_gpu) and rustdoc are clean,
refusal_surface.py --check passes, and the runtime-sources guard passes.
|
||
|
|
13b279df1b |
Squash 11203 commits of translator, runtime, and validation work
Rolls up everything since
|