7edbf84c8fb61ba297139335d934209dda6641a0
304
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
445b720f78 |
identity: texture slots sampled through runtime sampler slots from set 1's sampler arrays
Under the identity domains a kernel samples a texture slot through a runtime sampler slot. The
texture is its class's set-1 element at the index of its pushed gpuResourceID, as a read's is.
The sampler is the element of a set-1 sampler array at the index of the sampler slot's pushed
gpuResourceID (SlotGuestBase of the sampler slot), joined to the texture by OpSampledImage. The
array is picked by the use: binding 2 for a plain sample, 3 for a depth comparison, 4 for a
texture of an integer format; 4,000 SAMPLER descriptors each, PARTIALLY_BOUND |
UPDATE_AFTER_BIND | UPDATE_UNUSED_WHILE_PENDING, every stage, the same set 1 for every pipeline.
The sampler's word (pixel coordinates, a nearest pixel sampler) is read from the ID's high word,
so no specialization constant and no SamplerReduction, SamplerCoordinates, CubicSampler or
ConstantLanes fact remains; every precision note is static. An integer write to a storage slot
without a format saturates to the channel widths the consumer pushes
(PushField::TextureIntegerChannels, a u32), with no fact.
Still refused as Unsupported{IdentityDomains}: constexpr samplers (next change: a pushed index),
an argument buffer's sampler, arrays of samplers, bicubic and anisotropy emulation, a slot's
minimum level.
Translation output changes only under the identity domains (Device::from_queries). Device::new
output is unchanged: golden_hashes_match_the_table passes at this tip (job m3-max-42189), with no
"changed under an unchanged key" and no "profile changed:" line.
For the runtime's side (the planner's three facts):
a. The runtime must dedupe device samplers by create info across the three arrays' uses.
Exhausting maxSamplerAllocationCount (4,000 on the 2080, 3090 and UHD 630; 32,768 on
lavapipe; 65,536 on the others) must be a typed refusal, with a fill-past-capacity test.
b. The update-after-bind limits for 65,536 sampled images, 4,096 storage images and 12,000
samplers hold on all nine profiles (the smallest is lavapipe's 1,015,808); the floor must
check them by query.
c. The count of cubic sampler descriptors is asked of the replay lane; if any exist it goes back
to the planner before step 5 closes.
SEMANTICS_VERSION 2161: identity-domain modules of sampling kernels and integer writes change.
Verified:
- m3-max-42094 (msi), this change on
|
||
|
|
fdc3fd3907 |
rt: threadgroups of partial SIMD groups run the kernel's emulated module, lowered on the reaper
A kernel whose tier runs each SIMD group as one subgroup (a pinned subgroup of 32, the device's own 32, or half of a 64-lane subgroup) runs only threadgroups of whole groups of that width. Such a state now has its emulated-SIMD-group variant (LoweringInputs::emulated_simdgroups), which the reaper lowers once new_compute_pipeline_state has returned, through the cache directory like every lowering (a refusal is kept too). A dispatch whose threadgroup is not whole groups runs that module at its own size; one that comes before the reaper is done waits for the lowering, which the reaper takes next (Reaper::hurry), counted as a first-use wait. Nothing translates on an encoding thread. A state made after quiesce, or whose lowering the reaper's end leaves, is marked not lowered (Error::Quiesced at such a dispatch). The emulated module's threadgroup memory is its arena (metal2vulkan::pipeline::arena_bytes, now public) holding the lengths set, the scratch of each SIMD group, and a vote word: the dispatch's total is checked against maxComputeSharedMemorySize (Limit::ThreadgroupMemory). ComputePipelineState::precision_notes returns the emulated module's notes too once it is lowered. Gap::PartialSimdgroups stays for a state with no emulated module: a kernel the consumer compiled, or one whose emulated variant the translator refuses. A ragged dispatchThreads grid at such a size is Gap::PartialThreadgroups: the partial-threadgroups variant does not take the emulated tier. |
||
|
|
d5a475f1a0 |
old-runtime regression fix: the stage bounds return to Device::new's ANV rows; the bound on every device is a fact of from_queries' profile
|
||
|
|
75b422338a |
identity: argument-buffer textures are the set-1 elements their resource IDs name
Under the identity domains an argument buffer's texture handle is the gpuResourceID its member
holds: the handle is the ID's index, the element of the class's set-1 array (0 is nil, the null
descriptor), with no handle table, no search and no descriptor. Where the shader checks a read
itself (no robustImageAccess2) the handle carries the word's missing-alpha bit (word bit 12) at
HANDLE_ALPHA_ONE, so the handle form is Lookup::Element or Lookup::Flagged{alpha} only.
The handle tables' variant forms are off under these domains (`texture::tabled`): reads of a
member of another numeric class, raw-texel decodes, storage conversions (red-blue, sRGB alias),
A8 alpha-in-red, unreadable-storage nulls, YCbCr write marks, and the HeapCrossClassNeutral,
HeapStorageReads and HeapResidency facts. A slot and a member of one class index one array, so
the class's volatility now merges the slots' uses with the groups'. The admission takes heap
groups whose declaration is their identity class with no plain, raw or cross classes; anything
else stays Unsupported{IdentityDomains}.
Translation output changes only under the identity domains: the default domains plan and emit
as before (no golden re-bless needed). SEMANTICS_VERSION 2153.
The test kernel `tex` gains an argument-buffer form (`texture_kernel(true)`), checked on
lavapipe, moltenvk-m3 and moltenvk-m3 without robustImageAccess2: same answers at the same
elements, set 0 empty, and the handle form Element or Flagged{alpha} as the profile checks reads.
Verified (this commit's tree, as 657e2245c2 on
|
||
|
|
4ac52bf082 |
rt: a kernel's threadgroup memory arguments come from its length constants
The device legs of the tile (m3-max-41638/41639/41640) refused every observing kernel with Gap::KernelInput: the runtime took a kernel's [[threadgroup(n)]] arguments from PipelineInterface::threadgroup, which the translator leaves empty, so a TgLength specialization found no argument. The arguments are now the TgLength constants the module specializes on, by their index. With threadgroup memory reaching a pipeline, a dispatch checks it: the kernel's static part (and a predicated walk's 4-byte vote word, RuntimeFact::PredicationVote, now accepted) plus each length set rounded up to 16 bytes must be within maxComputeSharedMemorySize, else the new Limit::ThreadgroupMemory, Metal's maxThreadgroupMemoryLength counterpart. The precise kernel's test found on the 780M and the XTX one word apart between a tile and the app's shape: a NaN/NaN division (0xffb86e83 / 0x7f9fc206) answers the first operand's payload in one pipeline and the second's in the other. The state carries NativeNanEncoding, so two NaNs are alike there; every other word must be equal. README: the threadgroup memory limit, and NVIDIA 615.71.09's sign-extended narrow clamped sum on GA10x (the planner's wording). REFUSALS.md and the API signatures regenerated. |
||
|
|
2930583b47 |
rt: the cache directory keeps lowered kernels and pipeline data
DeviceOptions::pipeline_cache_dir names a directory a device keeps two things in, for compute pipeline states. translations/ holds each lowering, named by its FunctionCompileKey (the kernel's AIR, entry, constants and linked functions, its lowering inputs, the profile fingerprint and the translator's semantics version), in the translator's self-checking encoding; a state reads a lowering there in place of lowering (Metrics::translations_loaded beside the new Metrics::translations), and a partial-threadgroups variant the translator refused is kept as a marker so it is not tried again. The files take at most 256 MiB, least recently used evicted first. pipelines-<uuid> holds the VkPipelineCache data, framed with a length and a checksum since the initial data must be exactly what vkGetPipelineCacheData returned; every VkPipeline is made through the device's cache, the reaper writes the data 10 seconds after a VkPipeline was made at most once per 10 seconds, and the device's end writes it a last time. Writes go through a temporary file renamed over the name; a file that does not check is a miss and nothing the cache does fails a call. The tile commit's README, refusal table and API signatures follow here: direct dispatches past maxComputeWorkGroupCount are split, and Gap::PartialThreadgroups names the variant refusals by the deciding queries. Tests: a store filled past its cap keeps the most recently used files within it, stores on one directory share files, and pipeline data cut short or flipped is a miss (host); a second device on the same directory lowers nothing at creation, reading all three lowerings, and the pipeline data file is there (device). Not yet compiled: the lint follows. |
||
|
|
576a7348bc |
translator: one stage bound on every device; the two stage-size workarounds go
A module whose entry weighs more than COMPILED_STAGE_WEIGHT (99,109, the heaviest stage measured to compile within host-sized memory, on ANV) is now handed to no driver, whatever its identity. A kernel that emulated its simdgroups only in place of the widest mode's pin (the subgroup size range decides it) is planned again keeping the pin, as before; every other module past the bound is refused with Feature::StageSize and a new Needs::StageBound, its symbol naming the weight and the bound. The refusal is permanent for the input on the device (its plan decides the weight), so it is not NotImplemented; validation reads it as the translator's own gap. DriverWorkaround::SerializedStageWrapsLargeModules and CompilerMemoryGrowsWithStageSize go, with ANV's identity entries for them and the serialized bound (786,432), which the single bound sits far below. Why: the workaround ladder takes one form for every device, the slowest compiler's; a device whose compiler would take a heavier stage is refused it, recorded in FAST-PATHS' known gaps. Measured before this change, with a scratch build that applied the bounds and the re-plan to every profile: the corpus on the Iris Xe's description without its identity refused nothing (largest planned module 91,399, job m3-max-41496), and RADV and NVIDIA nothing either; without maximal reconvergence 12 rows were refused, 6 distinct simdgroup-matrix modules of 198 to 285 products whose lockstep pairs force emulated simdgroups (jobs m3-max-41474, m3-max-41523). The owned fixture stage_bound/stage_bound_matrix (512 simdgroup matrix products beside a lockstep pair in divergent flow, our own MSL) has their structure: on the Iris Xe its emulated module weighs 123,307 and its pinned one 37,646; without maximal reconvergence it is refused at 123,308 (scratch weighing, job m3-max-41602). The new test the_stage_bound_fixture_keeps_the_pin_or_is_refused asserts both paths and that the re-planned kernel is under the bound. The old runtime's heap-trim test loses its long chain, now refused on every device; it asks for a trim where the making left more than the floor free (NVIDIA's compile never does under the bound, 189 MB at most measured). SEMANTICS_VERSION 2150; REFUSALS.md regenerated; the API table loses the two variants and gains Needs::StageBound. |
||
|
|
31c1161940 |
rt: SIMD groups at Metal's width, and robustImageAccess, at the floor
The floor requires Vulkan 1.3's subgroupSizeControl, computeFullSubgroups and robustImageAccess, enabled on every device; the translator's profile takes them through the enable set. Where a device lists compute in requiredSubgroupSizeStages with 32 between its sizes, the translator pins a kernel's SIMD groups to subgroups of 32 (the Direct tier); the compute pipeline state now takes such a kernel: each VkPipeline chains VkPipelineShaderStageRequiredSubgroupSizeCreateInfo where the tier pins a size (the translator pins only a stage the device lists, VUID-...-pNext-02755) and carries the stage's REQUIRE_FULL_SUBGROUPS. "A stage that pins a subgroup size" leaves Gap::KernelInput. A flattened tier's LocalSizeConstraint is supplied: a dispatch whose threadgroup is not whole SIMD groups is refused at the dispatch as the new Gap::PartialSimdgroups, since the emulated-SIMD-group variant is not built. With robustImageAccess on, the translator drops its image write and atomic guards on every device; robustImageAccess2, robustBufferAccess, robustBufferAccess2 and nullDescriptor stay off. Tests: the floor names each new missing feature; the translator's enable set holds robustImageAccess and none of a reported geometryShader, samplerMirrorClampToEdge or VK_EXT_robustness2 (host); every device's translator profile has robustImageAccess and none of robustImageAccess2, robustBufferAccess, robustBufferAccess2, nullDescriptor (device); and simd_float_products runs Direct, pinned at 32, wherever compute can pin 32, refusing a 16-thread threadgroup and answering Metal's products (device). REFUSALS.md and the API signatures regenerated. Verified: cargo fmt; the lint and the device legs follow. |
||
|
|
fa52012831 |
identity: texture slots are the set-1 elements their pushed resource IDs name
Under the identity domains a kernel's texture slots now lower. A slot's gpuResourceID is pushed as its PushField::SlotGuestBase (the index in the low word, the word in the high one). Its texture is the element at that index of one of set 1's two fixed arrays: binding 0, SAMPLED_IMAGE x 65,536, and binding 1, STORAGE_IMAGE x 4,096. Each is partially bound, updated after binding and while unused elements are pending, and seen by every stage, with the same layout for every pipeline (BindingSource::IdentityArray). Each image class the kernel declares (shape, numeric type and depth comparison, sampled, or storage without a format) is a variable of its descriptor type's binding. The slot binds no descriptor and declares no specialization constant: - is_null_texture answers whether the index is 0. Nil needs nothing else in the shader, since element 0 of each array is a null descriptor (the device test of |
||
|
|
ac4b2370f5 |
rt: the consumer names the core Vulkan features its own work needs
DeviceOptions::features takes ConsumerFeature values (SamplerYcbcrConversion for now). Device::new enables each one the device reports, once, in the consumer's order, and Device::features lists those enabled, so the consumer can refuse its own path. The runtime's own work and the translator read only the floor's features. No Metal counterpart. The floor test's device creation chains the maximal-reconvergence and subgroup-uniform-control-flow structures where their extensions are listed, as Device::new does (the device cfgs failed to compile without the fields). The consumer-extensions device test also expects the optional extensions the device lists, and asks for the feature twice. REFUSALS.md takes the renamed site of VulkanVersion (derive.rs derived). API signatures blessed. Verified: cargo fmt. Lint and device legs follow. |
||
|
|
136fb66907 |
metal2vulkan-rt: map the identity ABI's parameter block and grid region; translated-kernel device test
Identity steps 2 and 3 are on development: ArgumentTableAddress is the ring block's address in the window, fields placed in the ArgumentTable go to the block, and every dispatch reads Metal's grid from its pushed region (a zero grid for an indirect dispatch), with no MultiRegion constant to specialize. The README gains the pipeline states' section and its known gaps; REFUSALS.md and the API signature table are regenerated. |
||
|
|
5617449350 |
metal2vulkan-rt: the encoder's refusals in REFUSALS.md and its API in the surface table
Generated by refusal_surface.py and signatures.py --bless. Verified: the generators ran clean (0 variants without a reach mark or a basis). |
||
|
|
46e3215e55 |
identity: kernels over buffers lower under the identity domains
Under PointerDomain::Identity with HandleDomain::Identity every buffer slot of a kernel is its
device address used directly. Each slot is the Psb form, its address read from its own push
field, PushField::SlotGuestBase(slot): gpuAddress plus the bind offset, which under the identity
domains is the Vulkan device address. No root table is read, and no access is contained, as Metal
contains no device-address access (psb::prepare_at). Selection admits, under the identity domains,
only the plans lowered so far (select::identity_admits): a kernel whose push fields are its slot
addresses and its dispatch region, all in the push window, with no descriptor and every slot
addressed. Anything else is still Unsupported{IdentityDomains}, not implemented, now refused there
rather than for every function at analysis. SEMANTICS_VERSION 2146: a refusal under the identity
domains became a module.
The new tests (src/tests/engine_identity.rs):
- a1_bool_from_float under the identity domains on lavapipe and moltenvk-m3 has no descriptor,
no root table and three SlotGuestBase fields. It passes L3, and it computes the program's
answer on the CPU interpreter, with its buffers above 4 GiB at bind offsets 32, 16 and 4. It
writes nothing past its output, with its region pushed.
- a2_dynamic_texel_offset, which samples a texture, compiles under the default domains and is
refused under the identity ones.
Verified:
- m3-max-41149 (msi, check commit eeecc4492b, the same tree but for the test's region bytes):
clippy -p metal2vulkan --all-targets --all-features, rustdoc -D warnings, and nextest -p
metal2vulkan --all-features, 3664 of 3665. The one failure was this test, which met the kernel's
DispatchRegion field and did not fill it.
- m3-max-41195 (msi, a5dbfd408f, this tree): clippy and rustdoc; tests::engine_identity and the
domain pair test, 3 of 3.
- m3-max-41150 (msi, eeecc4492b): clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
|
||
|
|
94071f82a2 |
device: the identity pointer and handle domains, taken as a pair
The new runtime's form: pointers are device addresses used directly and a texture's or sampler's
handle is its gpuResourceID (docs/RESOURCE-ID.md). The variants come beside the old domains,
which stay until the cutover; nothing lowers under them yet.
- PointerDomain::Identity and HandleDomain::Identity.
- Device::new refuses one identity domain without the other (InvalidDescriptor) and the identity
domains on a device without bufferDeviceAddress and shaderInt64 (Unsupported{IdentityDomains},
naming both features as one alternative).
- A compile under the identity domains is Unsupported{IdentityDomains}, not implemented, at the
start of analysis, so no old form is ever emitted under them. Later steps lift it as the
lowering lands.
- The profile fingerprint covers the domains (tested).
- docs/API.md's policy section names the domains; docs/REFUSALS.md and the reach table carry the
new refusal; api_signatures regenerated.
Verified (this commit's tree, rebased with the ledger commit before it onto
|
||
|
|
077c9722e3 |
metal2vulkan-rt: command queues, command buffers and events on the submit and completion threads
Step (c) of the new runtime's compute core.
What:
- CommandQueue (newCommandQueueWithMaxCommandBufferCount:, its bound on uncompleted command
buffers), CommandBuffer (enqueue, commit, handlers, waits, status, error), Event and
SharedEvent (signaled_value, set_signaled_value, wait_until_signaled_value,
notify_listener).
- A command buffer records at once into segments split at event waits and signals. The submit
thread holds a segment whose waits are not met, and its queue behind it, while the segments
before it run (reims F1). A wait the host's value meets submits no semaphore wait; a GPU
signal not above the highest value submitted or set is left out, so the semaphore only rises.
- The completion thread retires by a progress semaphore, follows submitted event signals (a
listener runs at a mid-buffer signal, reims F2), runs handlers with no lock held, and is
woken through a host-signalled timeline semaphore only when a wait needs it.
- A command buffer keeps each block it uses until it retires. A zeroed Private buffer's fill is
an upload submitted ahead of every later commit, whose segments start with a barrier; each
segment ends with a barrier to the host.
- Device::quiesce(timeout) (F9), with every wait bounded, no join of a thread still running, no
thread-local that exit() tears down, idempotent, freeing nothing; unmap runs on the caller for
every block handed out, once (a handed set replaces the per-idle flag).
- The last handle dropped in a handler: the completion thread finishes the teardown itself (F8).
- CommandQueue::abandon (F14); a loss ends held work, in-flight work once the device is idle,
host waits on pending signals, and later commits, with DeviceLost { in_flight } (F13).
- Refusals Committed, OtherDevice, NoCommandBuffers with their basis; Error::Quiesced;
docs/REFUSALS.md and the API signature table regenerated; the README's contract.
Verified: cargo fmt; refusal_surface --check. The compile and device jobs follow.
|
||
|
|
4e8784ad14 |
refusal surface: the new runtime's own refusal enums, one section each
What: refusal_surface.py reads the new runtime's Error and makes a section of docs/REFUSALS.md for each variant whose payload is one enum the runtime declares: today Refused(Refusal) and Limit(Limit), and any family added later (a Gap included) without a list of names to keep. Each of their variants declares its basis, as Problem's do, and --check fails on one that does not. The translator's Limit section no longer counts rt's Limit sites. A rustdoc link [text](path) in a summary reads as its text; three existing rows lose a link the file could not follow. Why: AGENTS.md wants every new refusal in REFUSALS.md, and the scan of rt read the floor's Missing only, so EmptyBuffer, BufferPastBlock, BlockLen and BlockIds were missing. Their basis lines cite the M3 Max measurements the old runtime records for the same answers (newBufferWithLength:0 and a placement past the heap's end answer nil), the device's limits, and our 32-bit numbers. How verified: the script regenerates, --check and --selftest pass locally; the refusal_surface test runs in the compile job. |
||
|
|
374e29a988 |
metal2vulkan-rt: the floor's shader features, queue family, timestamps and memory types
The floor now also requires what the translator's shaders and the runtime's core need of every device: - shaderInt16, shaderInt8, storageBuffer16BitAccess (Vulkan 1.1 features, now read and enabled through Features::vulkan11), storageBuffer8BitAccess, scalarBlockLayout, vulkanMemoryModel and vulkanMemoryModelDeviceScope. The translator emits 8- and 16-bit access only in storage and physical storage buffers in practice (uniform views are u32 or uvec4, push fields are 32- or 64-bit), so the uniform and push-constant 8/16-bit features stay out; it does use device scope. - timestampComputeAndGraphics, and timestampValidBits of at least 36 on the first queue family with graphics and compute, which Capabilities names (queue_family). A device with no such family is Missing::QueueFamily. - a host-visible, host-coherent, host-cached memory type (Shared storage) and a device-local, host-visible, host-coherent one (the parameter ring), each usable by a buffer of BUFFER_USAGE: every Vulkan 1.3 buffer usage plus device addresses. Vulkan answers buffer memory types only for a created device, so check() finds a type with each set of flags and carries the memory properties, and memory_types(device, &capabilities) chooses the first usable type of each with vkGetDeviceBufferMemoryRequirements. Missing::MemoryType names the flags. Each shortfall is named in BelowFloor, with a unit case; the README's Floor section states every item and tests::floor holds it to the code. The device test now also creates each device with the floor's features and extensions and chooses its memory types on it. CI's lavapipe step (ci.yml and scripts/linux-gate-ci) runs the rt crate's device tests too. refusal_surface.py reads metal2vulkan-rt and writes the floor's Missing as section 10 of docs/REFUSALS.md; signatures.py pins metal2vulkan-rt's public surface in api_signatures.tsv. Verified: see the lane report (compile job, device legs on every lab GPU, lavapipe and the Windows UHD 630). |
||
|
|
f19c613fe1 |
RUNTIME 2489: A compute or render encoder's core is made in the box it lives in: one 3 KB copy per encoder fewer
EncoderCore (2984 bytes, -Zprint-type-sizes on msi) was built by value in EncoderCore::open, copied out of it in the returned Result, and copied again into its box (EncoderCore::boxed / boxed_in) by the compute and render opens: two 3 KB memcpys per encoder. A pinned LBR profile of a guest-shaped compute stream (dispatch_chain --host 400 --only encoders --dispatches 5 --groups 64 --states 3 --binds tex-moved, msi lavapipe) put libc copies under EncoderCore::open (~110 ns) and open_compute (~98 ns) per guest dispatch, one encoder each. EncoderCore::open_placed takes a place closure that puts the core where it lies, the box for compute (parked room or the device's spares) and render (spares), so the core moves once. open keeps the by-value form for the blit encoder (HeldCore). Nothing else changes: the same fields, the same order under the same lock, the same boxes. Test: tests::compute_parked::a_compute_encoder_core_lies_in_the_box_its_command_buffer_parked (three encoders of one command buffer find their core at one address; it pins where the core lies, not the copy count). RUNTIME_VERSION 2489. Verified: msi m3-max-38102: clippy -p metal2vulkan-runtime --all-targets --all-features -D warnings 0; lavapipe debug (cfg m2v_cpu_icd) compute, dispatch, encoder, tracker and render suites 190/190. Pinned interleaved A/B (msi lavapipe, release, taskset -c 0-7, 5 base/tip pairs, guest shape dispatch_chain --host 400 --only encoders --dispatches 5 --groups 64 --states 3 --binds tex-moved, --runs 30): the open call 640 -> 574 ns per guest dispatch (-66 ns); thread_cpu per dispatch within run-to-run noise (6137 vs 6240, range 5615-6681). Profile at the base (m3-max-38071, LBR): open copied the 2984-byte core out in its Result (~110 ns) and open_compute again into its box (~98 ns). |
||
|
|
45ebbdaa5e |
RUNTIME 2484: Copies between a texture's region and a surface's runs of guest RAM
A consumer that keeps an IOSurface's GPU copy as one optimal texture, on a host whose surface path copies by runs of guest RAM (copies_guest_ram: no view of the pages is made), needs the texture forms of the run copies, or its fill, upload and download go back through a view per block or a staging buffer. What: BlitCommandEncoder::copy_texture_from_host_ram(ram, runs, offset, bytes_per_row, size, texture, slice, level, origin) and copy_texture_to_host_ram(texture, slice, level, origin, size, ram, runs, offset, bytes_per_row), runtime extensions (Metal has none). `runs` is the surface's bytes in order (the shape the consumer's run copies pass today); offset and bytes_per_row are Metal's copyFromBuffer layout over those bytes. Each row's texels within a run and a chunk are one vkCmdCopyBufferToImage / vkCmdCopyImageToBuffer region straight on the chunk's import (bufferRowLength and bufferImageHeight 0; bufferOffset a multiple of the texel, VUID-vkCmdCopyImageToBuffer-srcImage-07975; the subresource bounds 07971/07972), with no staging buffer. A first-touch or CPU-only chunk goes through the existing StagedGather / StagedScatter, which now take a buffer or an image target. Hazard tracking, dirty-page reports, imports held to completion and the bytes outside the texels are as the buffer forms keep them. Refused as the buffer forms are, and with Invalid / Problem::HostRam for the texture's own cases (its doc extended); no new RuntimeGap, Degradation kind or WorkCounts field: the direct form shows in host_ram_copy_regions with no staged copy. replay.rs logs the call (HostRamTextureCopy); blit_texture.rs and blit_plan.rs helpers are shared (pub(super)). Runtime README and HOWTO document it; the signature table blessed (+2 methods); REFUSALS regenerated. RUNTIME_VERSION 2484. Verified: msi job m3-max-37991 (lavapipe, --cfg m2v_cpu_icd): clippy -p metal2vulkan-runtime --all-targets --all-features -D warnings 0; nextest host_ram_texture_device + host_ram_copy_device 39 passed. m3-max-37997: "HOST-RAM-TEXTURE llvmpipe: fill regions 250, dispatches 0, staged 0" (a 300x200 BGRA8 Private texture, rows at 1280 bytes from byte 48, one row across a chunk end); the staged test saw exactly one staged gather and one staged scatter. Plain and --cfg m2v_gpu clippy, rustdoc and the 780M and Iris runs follow on development. |
||
|
|
3619e37540 |
RUNTIME 2482: Texture::view_placement answers what a view would be, by the decision its making takes
The consumer will make an IOSurface plane's device cache one optimal Private texture, every texture over the plane a view of it, and needs to know before it makes a view whether the runtime would make it a Vulkan view of the image or a view shadow (which it sends to its own fallback instead). What: `Texture::view_placement(pixel_format)` answers `ViewPlacement` (`Image`, `ImageThroughSwizzle`, `Shadow(ViewShadowReason)`, `OverBytes`), or the error `new_texture_view` would refuse the view with. The decision is factored, not copied: `Texture::checked_view` holds the checks `view_as` ran inline (Metal's rules, rotation, X32, buffer slices, decoded twins), `Texture::view_hold` decides the storage (shared, through a swizzle, the viewed image, a shadow and why, storage over the bytes), and `Device::view_shadow_plan` / `shadow_plan` hold the shadow's refusals `image_shadow` checked while making. `view_as` and the query call the same three. `image_plan::views_missed` replaces `takes_views_of` and names why an image takes no view (another compatibility class, or not in its list); `Device::view_apart` replaces `image_takes_view` and puts the device's missing reinterpretation first; the `shadowed-texture-view` notice's reason now follows that reason (it chose by the texture's PixelFormatView usage before). Tests: `view_placement_device` (runtime, device cfgs) sweeps 10 texture formats x 5 usages x 24 view formats, checks the query moves no count and matches the view made (by `view_shadows`, `views_through_swizzle` and the handed-out image), and names the consumer's cases. `plane_device_cache` (validation lane): a 300x200 BGRA8Unorm Private texture round-trips between no-copy buffers at offset 48 and pitch 1232 with every other byte kept; a clear through its sRGB view then a copy through its own-format view in the next encoder, tracked and untracked with a fence, read the clear with no hazard under synchronization validation, and the unordered control is reported as a read after write. Documented in the runtime README; the signature table blessed (10 rows); REFUSALS regenerated. RUNTIME_VERSION 2482. Verified: msi job m3-max-37961 at c2f0c96d3c: clippy -p metal2vulkan-runtime -p metal2vulkan-validation --all-targets --all-features --cfg m2v_cpu_icd -D warnings 0; the lavapipe tests, plain and --cfg m2v_gpu clippy and rustdoc follow on development. The hazard tracker keys a view's uses on its image (texture.rs view_as shares the Arc<Image>; bound_use/image_use key on image.identity.key), so the order across views needed no fix. |
||
|
|
df87983bb7 |
RUNTIME 2463: Render draws: the restarted list and the error and notice makers out of line, cold
What: draw_resident's restarted-list arm (the index rewrite and gather requests, 205 source lines) is its own #[cold] #[inline(never)] method, restarted_list; Device::degrade, degrade_copied_pages, degrade_host_step, degrade_where and tell, and error.rs's vulkan, invalid, nil and internal are #[cold]. Same commands, barriers and answers; only where the code lies changes (draw_resident 130.7 -> 127.4 KB of machine code). Also folded: draw_costs gains a guest shape of a few render encoders with set_bytes and each thread's CPU a draw (17126bfe04), the encoding thread's own CPU apart from unnamed threads (afa24f4074), and --calls counting each call's cycles and cache misses (7249f6930b). Why: on a Zen 4 host a one-draw render pass ran at IPC 0.79 against 1.7 inside a long pass, the same on RADV and lavapipe (gem10, m3-max-36911/36975). The misses are instruction fetches: per pass about 8.3k L2 instruction misses against 1.2k data, over 806 distinct 4 KiB code pages (more than the L2 iTLB's 512), no function above 7.5% of them (m3-max-37017, -37041). This change is measured neutral (m3-max-37061, lavapipe, release: pass1 instructions 112,257 -> 112,123, L2 misses 10,590 -> 10,577; cycles within the node's noise) and kept as correct and neutral; the lever left is the layout of the path's code across pages, a build setting of the program. Verified: see the landing's check jobs. |
||
|
|
3de483d86f |
RUNTIME 2459: Joined completions: a command buffer marked to join the next groups under Exact
CommandBuffer::set_completion_joins_next marks a command buffer, before its commit, as one whose completion may be seen with the next one's. Under CompletionPolicy::Exact, on a device whose merge check holds and whose queues are not relayed, a marked command buffer's batches wait in the scheduler's group as every batch does under Grouped. The first batch of the VkQueue behind them that is not marked goes last in that group, which then goes at once (GroupEnd::Closed, WorkCounts::group_ends_closed), so it is seen complete at its own end and never held back. Its submission check runs with the marked ones' (check_heads), so they are found ready together. No group is kept past its pass under Exact (Alone::Unkept, WorkCounts::batches_held_alone_unkept): a kept group can reach the GPU after the work ahead of it ended, which would delay the unmarked one behind it. Everywhere else (Grouped, no merge, relayed queues, the encoder trail, batches that never group) the mark changes nothing. Why: on the Iris Xe, ANV on i915 lists every VkDeviceMemory in each execbuffer, about 170-190 us of driver time a vkQueueSubmit at the consumer's import count, and the consumer cuts each guest command buffer into about 12 parts committed under Exact, one kernel submission each. In its walk the GPU sat idle about 1.5 ms per waited guest buffer between parts already committed, behind a backlog of those calls. The consumer will mark every part but the last of a cut whose completion nothing observes. Grouped-completion's notice, docs/API.md's catalogue, FAST-PATHS row 38, the runtime README, CompletionPolicy::Exact's doc, api_signatures and REFUSALS say so. Tests: runtime_lane::joined_completions (marked parts group and a group is closed by the last; checked parts too; a no-op where the device's own check finds no merge; unmarked parts go alone; an unmarked command buffer is seen complete while the long one behind it still runs, the marked one before it complete by then), on lavapipe with the merge assumed. Joined completions: the cost table's length, and the order test's first work done before The conformance cost table's SHARED list holds 36 rows with batches_held_alone_unkept. In the order test the marked command buffer took the new buffers' first work, which no batch in a group takes, so it went alone and nothing grouped: the buffers' first work now runs before it. Verified: clippy and lavapipe lane job m3-max-36769 showed the failure (grouped 0 with grouping true); the rerun is the next job. Verified at 8e6c37c263: m3-max-36784 (msi) clippy --workspace --all-targets --all-features 0; m3-max-36785 (msi, lavapipe, --cfg m2v_cpu_icd) joined_completions + grouped_submissions + alone_batches 21/21 (marked parts under Exact with the merge: 7 command buffers in 2 submissions; unmarked: 7 submissions, 0 grouped; lavapipe's own merge check, not Holds: 0 grouped; an unmarked buffer is seen complete at its own end). The Iris merge check answers Holds (m3-max-36725: 9.6 us in one call of 4 against 26.4 us apart). Release-mode lavapipe, clippy --cfg m2v_gpu and m2v_cpu_icd and rustdoc run after the merge. |
||
|
|
8d617591f8 |
RUNTIME 2409: In-place textures over dma-buf pages: the image bound in the buffer's own import
A texture in place over a no-copy buffer's dma-buf pages no longer always asks the pages' source for a new dma-buf and a dedicated import of its own. Where the pages lie in one import dedicated to nothing (no sparse buffer over several imports, no import the driver made dedicated to the buffer), its DRM_FORMAT_MOD_LINEAR image whose plane lies at offset 0 at the texels' pitches is bound in that import at the texels' offset, beside the buffer (vkBindImageMemory's memoryOffset): no udmabuf, no import, no new GPU mapping. Every fact is asked of the driver: the image requires no dedicated allocation (VUID-vkBindImageMemory- image-01445), the format query takes dma-bufs for it outside one (not DEDICATED_ONLY), its alignment divides the offset (-None-10735), its size fits the pages' placement (-None-10737) and its memory types take the import's. An import dedicated to the buffer binds no image (-memory-10926): DmaBufPages now notes that. A new check class, PagesClass::DmaBufInImport (CHECK_VERSION 20), measures that image; the check's textures of each dma-buf class take that class's image alone (a thread-local of the class the check runs). texture/route.rs takes the new class where its verdicts take the texture, else DmaBuf's; a shadow waits on DmaBuf's verdict while both pend. Where the making refuses the image in the import, it falls back to today's image where DmaBuf's verdicts take it. A pending move re-routes the same way. Binding in the import reads it apart: it is kept imported for good, as an image in a pointer import's is. A rebind remakes such an image in the new pages' import by the same order. RADV requires a dedicated allocation of every such image, so its check leaves the new class unchecked and it never takes the route. New WorkCounts field: dma_buf_images_in_import. No new Degradation kind. The route-(b) device tests (parked images, plane offset, import cycles, a texture's residency) fail the new class's verdicts first, so they keep measuring today's image on any device. A new device test (tests/dma_buf_in_import.rs) counts the route and its negative control. Also: 4c3cbe2f1d and 37d2a750ce (the probe, dma_buf_linear_bind: a linear and a modifier image for dma-bufs bound in the pages' existing import, the dedicated answers, a re-import arm), 5a40c2ef7b (docs: API.md, HOWTO.md, FAST-PATHS.md, host_residency.rs module docs). Why: the owner asked how to remove the per-texture dma-buf. Probe answers (Mesa 26.2.6): RADV on the Radeon 780M refuses LINEAR images for dma-bufs (NOT_SUPPORTED x15) and requires a dedicated allocation of every DRM_FORMAT_MOD_LINEAR image (m3-max-34443), so there it never fires. ANV on the Iris Xe takes both images outside a dedicated allocation, bound in the existing import byte-exact; first use of an 84 MiB texture 1.37 -> 0.21 ms (m3-max-34453). Verified in the lane (m3-max-34571, gem10, at 5d5dee7901): clippy -D warnings -p metal2vulkan-runtime --all-targets --all-features, plain and m2v_cpu_icd. Still running when landed: the lavapipe in-place and dma-buf suites with the new count test (m3-max-34593), clippy m2v_gpu, PHOENIX, and the Iris count test with its negative control. API: adds the field WorkCounts::dma_buf_images_in_import (additive; api_signatures blessed in the lane). |
||
|
|
aa5511f61e |
SEMANTICS 2130 / RUNTIME 2406: 16x16x16 simdgroup matrix products: refused as their own feature, Metal's rule below Apple10
What: `air.simdgroup_matrix_16x16x16_[widening_]multiply_accumulate` is now refused in every stage
as `Unsupported{SimdgroupMatrix16x16x16, NotImplemented}` (a new `Feature`), ahead of the 8x8
lowering's kernel-only check. The runtime's `compile_error` answers it as Metal does:
`Needs::MetalGpuFamily(1010)` on a device that does not claim Apple10, `NotImplemented` on one
that does (as `IndirectRenderState`). The owned fixture engine/simd_matrix16 shrinks to one form
per class (float, half, widening signed int8), each with the four transpose-flag pairs, 12
kernels; the probe carries the M3's answer in its header.
Why: Metal itself refuses these products below Apple10. The M3 Max (macOS 27.0.1) refused every
pipeline of the fixture at creation, AGXMetalG15X_M1 code 3, "simdgroup_matrix<T,16,16x16>
operations are supported by GPUFamily10 and later" (job m3-max-34410). No device the runtime
presents claims Apple10: the family lists the "SIMD-scoped matrix multiply operations" row (from
Apple7), refused NotImplemented(SimdgroupMatrix) on every device, and the lod-bias row, a gap. So
the refusal is Metal's own answer, not a device gap: no FAST-PATHS known gap.
Tests: engine_simd_matrix::products_of_16x16x16_are_refused_as_their_own_feature (every
committed profile, the fixture's 12 kernels); runtime_lane::simd_matrix16 (the device's compute
pipeline creation answers MetalGpuFamily of Apple10). REFUSALS.md regenerated, api_signatures
blessed, reach mark added. The engine fixture expectation table and golden hashes take the
fixture's rows on development.
Also: f639b74288 adds the owned fixture (MSL we wrote, compiled by scripts/regen-air-fixtures) and
its Metal probe; 5dbfa3d3d5 imports AirLibrary in the runtime-lane test.
Verified in the lane: m3-max-34499 (msi, at 38d4694b12) clippy -D warnings for metal2vulkan, runtime
and validation (all targets and features) and 45/45 tests, incl. the new engine_simd_matrix test (12
kernels on every committed profile), the error tests, refusal_surface, api_signatures, api_surface;
m3-max-34514 (gem10, at 5dbfa3d3d5) clippy m2v_cpu_icd and runtime_lane::simd_matrix16 on lavapipe
(Needs::MetalGpuFamily(1010) for all 12). Clippy m2v_gpu (34516) still running when landed.
API: adds Feature::SimdgroupMatrix16x16x16 (additive; api_signatures blessed in the lane).
|
||
|
|
c2206c14b0 |
RUNTIME 2389: Device::import_shared_dma_buf imports a shared dma-buf ahead and keeps it while a handle lives
A runtime extension (Metal has none). A guest's buffers over pieces of one shared file of guest RAM were each imported as their own dma-buf import and freed with the buffer, so a compute loop that made and dropped no-copy buffers paid an import and a free per command buffer, and on RADV each import maps its pages at once (the next submission's CS waits for the page-table job). Device::import_shared_dma_buf(file, options) (unix) imports the whole dma-buf on the caller's thread, or joins the device's live import of it, and returns a SharedDmaBufImport; while a handle lives, the file's entry in the device's map keeps the import, so buffers over its pieces join it instead of importing again, and it is freed once its last buffer, heap and handle have gone (one kept import per file a live handle names, per generation). The class comes from `options` as a no-copy buffer's (Private, Memoryless and undefined options refused, Invalid StorageMode); the import takes the type a no-copy buffer of that class would get first, so pieces join it. Refusals use the existing kinds (Unsupported HostMemory, OutOfMemory). A device's recovery lets go of the lost generation's kept holds and seeds the new one's map, whose first buffer imports the file again; nothing is imported on the recovering thread. A device without a dma-buf importer keeps nothing (Debug: imported false). The handle imports whether or not the device's buffers over those pages take the dma-buf route: on a device that takes the pages' pointer it is one listed dma-buf a submission for nothing. WorkCounts::dma_buf_shared_imports_kept gauges the kept imports; the handle's import counts in dma_buf_imports. Docs: rustdoc, dma_buf.rs Shared files, HOWTO dma-buf section, the runtime README extensions and unix-only lists. REFUSALS.md: the StorageMode site moved to host_class, which the no-copy call and this one share. Public surface: Device::import_shared_dma_buf, SharedDmaBufImport (Send + Sync, consumer_auto_traits) and WorkCounts::dma_buf_shared_imports_kept, blessed in api_signatures.tsv. Verified: m3-max-33745 at the lane tip 856a1fabae: clippy plain, m2v_gpu, m2v_cpu_icd 0; rustdoc 0; lavapipe runtime suite 2836 passed. Device tests (lavapipe): three buffers made and dropped in turn take imports 1 / joined 3 with the handle, imports 3 / joined 0 without; a handle keeps a live buffer's import; recovery imports nothing and the next buffer's import stays kept; Private refused. Churn bench, PHOENIX (RADV 780M, release, interleaved, 450 command buffers an arm, a8f297bf11, the same code but the count): no handle 1 import + 1 free a command buffer, call median 820-907 us, GPU start median 3026-3037 us; handle kept 0 imports, 0 frees, 1 join, call median 25-69 us, GPU start median 104-145 us. |
||
|
|
ab139e4b6e |
RUNTIME 2366: Runtime FALLBACK repro bundle at a creation refusal (default-off diagnostic)
What: metal2vulkan-runtime writes the FALLBACK repro bundle the command line writes for its own failures when it refuses a library or pipeline creation, where METAL2VULKAN_REPRO_DIR names a directory (unset, nothing is written). - The CLI's bundle writer moves into the library as the hidden crate-root module metal2vulkan::repro (feature serde), shared by the binary and the runtime. A bundle's directory is named by its content (metal2vulkan-repro-<16 hex>), written under a temporary name and renamed, so an identical failure is written once, across threads, processes and runs. The CLI's own bundles keep their files (input, profile.json, the descriptor files, repro.sh, repro-command.txt, failure.txt); only the directory's name changed, so a bundle written before still replays. - The CLI takes --device FILE in place of --profile: the JSON of a DeviceDescription and DevicePolicy (ReproDevice), which builds the runtime's own compile device. - The runtime hooks each creation where its refusal returns: a library of a metallib, a function's lookup, every compute and tile state (ComputePipelineState/TileState::create_adding: creations, added binary functions, archive adds) and every render state (GraphicsState::create_reflecting). It bundles Unsupported, NotImplemented and Compile refusals but a cancelled compile and a name the library lacks (Metal's own nil); never Invalid/Nil/MetalError. The bundle holds the library's bytes, device.json, the request as the CLI's options and descriptor files, and failure.txt with the call, the refusal and what the command does not replay. That list comes from a full destructuring of the compute, tile and render descriptors (and the stage functions): a new descriptor field fails to compile in repro.rs until it is replayed or listed. - Bounded: at most 32 bundles and 256 MiB per process; past either nothing more is written and one line says so. Written on the refusing thread; the call returns the same refusal; a write failure is said once. Each bundle is named in one line through the device's message sink (id name metal2vulkan-repro). The runtime's metal2vulkan dependency gains serde. - Not bundled: mesh states (no CLI mesh path), a dispatch's or draw's later variant, driver VkPipeline makings, Metal-source libraries. Docs: env_vars registry, README CLI, docs/HOWTO.md section 4, the runtime README's Errors section, the CLI help. Tests: runtime CPU tests of the bounds (a tally with the seam's limits); a lavapipe/GPU device test (ob3_stage_input with no stage-input descriptor: one bundle with the expected parts and command, device.json rebuilding the runtime's compile device by profile fingerprint and answering the same refusal, none for a second identical refusal or a missing name, none without a directory); CLI tests replaying library-written runtime bundles (compute, and render with a vertex descriptor) through repro.sh to the same FALLBACK, and --device compiling what --profile does. Verified at ae56b195e9 (msi, m3-max-32986): metal2vulkan cli, api_surface and api_signatures 25 passed; runtime repro tests 9 passed; clippy -p metal2vulkan -p metal2vulkan-runtime all targets, all features 0. Lavapipe (m3-max-32978): repro_device writes one bundle that the CLI replays to the same refusal; a second identical refusal writes nothing. |
||
|
|
5ba7afd9d4 |
RUNTIME 2360: Shader cache: no default directory makes a memory-only device, never a failed one
With no caller directory and no home (USERPROFILE on Windows, HOME elsewhere), default_directory answered Err and CacheSetup::of turned it, and any failure to open the default path, into Error::ShaderCache, so every device creation and adoption failed. Metal never fails device creation over its shader cache, and the default is the runtime's choice, not the caller's (owner rule 2). - The Windows default is %LOCALAPPDATA%\metal2vulkan (the local application data folder, read from the environment; no new dependency). XDG_CACHE_HOME and USERPROFILE are no longer read there. - default_directory takes its environment as a closure (CacheSetup::of_in), so a test feeds its own without touching the process's. - Where the caller names no directory and the default does not exist or cannot be made or written, the device keeps its cache in memory alone: the Store has no directory, every lookup is absent, every write is refused with no filesystem call, the scans do nothing, and writers ask has_directory first so nothing is encoded for it (a translated function still is: its encoded length weighs it in the memo). The device says so once as it is made, as the existing degrade notice ShaderCacheEntryNotWritten naming why; each entry it does not write counts in write_failures. The driver's pipeline cache data is not read back, and the device checks' verdicts are not encoded. - A directory the caller names that cannot be used is still Error::ShaderCache. - Device::shader_cache_directory answers Option<&Path>: None for such a device. Docs: the shader_cache module docs, ShaderCacheOptions::directory, write_failures, Error::ShaderCache, the degradation's declaration and its docs/API.md entry, the runtime README (Windows default, error table), HOWTO, create.rs's list of environment variables. api_signatures re-blessed; docs/REFUSALS.md regenerated (a refusal's site function renamed). Tests: tests::shader_cache's default-directory and no-directory-store unit tests (plain gate), and the lavapipe/GPU device test shader_cache_no_directory: a device made with an empty environment and no caller directory is made, has no directory, makes four render states with two functions translated once, writes nothing, and its notice is heard once. Verified (msi): m3-max-32796 clippy plain 0, 67/67 shader_cache and degradation tests, api_signatures 0, clippy x86_64-pc-windows-gnullvm 0; m3-max-32797 (lavapipe) clippy m2v_cpu_icd 0, 61/61 shader_cache and in_place_check, including the no-directory device test. |
||
|
|
0ca24685d7 |
RUNTIME 2351: Textures over buffers: Metal's allocation bound counts the last texel, a heap's size and a no-copy buffer's pages
A texture over a buffer whose texels run past the length was answered nil where its rows' padding ended past the length rounded up to 16 KiB. The M3 Max (macOS 27.0.1, the consumer's limits runs, every buffer kind and length bisected) makes more: - A 2D texture and a texture buffer count to their last texel, not the last row's padding: a 2D R32Uint 64x64 from 256, rows 512 apart, over 20000 bytes is made with its last texel at 32768 (rows' end 33024); a texture buffer of 32768 R8Uint texels at a bytesPerRow of 36864 over 20000 bytes is made. Arrays keep their rounded slices' end. - A heap's buffer is bounded by the heap's size, counted from the buffer's start, whatever its length or place in the heap (4 MiB heap: made to 4194304, nil at 4194305). - A no-copy buffer is bounded by its pages: its pointer's offset in its 16 KiB page plus its length, rounded up to 16 KiB, from its start (16384 bytes starting 4096 short of a page's end: made to 32768). BufferFacts now carries the buffer's allocation (own, a heap's size, a no-copy buffer's page offset), filled from Buffer::heap, host_backing and contents; BufferFacts::allocation_end gives the bound. Buffers under 16 KiB keep no bound (the M3 Max answers nil past 128 KiB there, the x86 Macs make every end measured), and an array whose last texel lies inside the length is still made: no new refusal. Such a texture stays a copy, as before at the old bounds: a 2D texture or array is a shadow image whose copies in and back go through its tail (texture/route.rs Route::Past -> TextureShadowReason::PastLength, announced shadowed-texture), a texture buffer's functions view its tail (into_texture_buffer, staged-texture-buffer). The texels past the length live in the tail, zero when made; the caller's bytes past a no-copy buffer and a heap's other bytes are never read or written. Tests: tests::linear_plan::a_texture_ends_where_metal_s_allocation_of_its_buffer_does (each kind's and form's M3 boundary, made at it and nil one past; the made rows past the old bound fail before this change); device tests in buffer_tail_device (a heap's buffer to its 64 KiB heap's size, a no-copy buffer at page offset 12288 to 32768, a padded 2D texture to its last texel): made, every path reads and writes right, the buffer's CPU write inside the length is read through the texture, shadow copies counted, no other memory touched, one row more Metal's nil. docs/API.md's accepted difference, REFUSALS.md regenerated. Evidence (lane jobs, msi): m3-max-32369: clippy -p metal2vulkan-runtime --all-targets --all-features -D warnings 0; linear_plan|buffer_texture 34/34 incl. tests::linear_plan::a_texture_ends_where_metal_s_allocation_of_its_buffer_does (the M3's boundaries per kind and form, made at E, nil at E+1). m3-max-32370 (lavapipe): 13/13 buffer_tail_device + allocation tests incl. a heap's buffer to its heap's size, a no-copy buffer to its pages, a 2D texture whose last texel ends at the allocation: every path (get_bytes, blit, kernel) reads as made, writes coherent with the buffer's bytes inside the length (shadow copies counted: such textures are shadows / staged texture buffers through their tail), neighbours untouched, one row more Nil(PastAllocation). Negative control and the PHOENIX run follow in the lane. Lane commit: 263219d515. |
||
|
|
f851c07e52 |
SEMANTICS 2123 / RUNTIME 2349: Texture buffers past maxTexelBufferElements bound through views of their parts
Metal makes texture buffers of up to 2^28 texels on every Mac; one texel
buffer view holds at most the device's maxTexelBufferElements (2^27 on ANV
and lavapipe, 2^26 on MoltenVK), and the binding of a wider one was refused
(BindError::TexelBufferTooLarge).
The consumer now states with a texture buffer's binding the views its texels
take (BoundTexture::Buffer::parts, bind::texel_buffer_parts: 1 within the
limit), which its shape carries. A slot whose function only reads, writes,
updates by an atomic or asks the width of the texture buffer, on a device that
indexes texel buffer arrays NonUniform, states RuntimeFact::TexelBufferParts;
where the shape binds more than one part there, the plan asks for the parts
variant (VariantKey::texel_buffer_parts). Under it the slot is an array of
the parts' texel buffers: texel i is texel i - k*P of part
k = min(i / P, parts - 1), P the device's limit rounded down to its texel
buffer offset alignment (bind::part_texels), and the width (parts - 1) * P
plus the last part's. texel_ranges writes one range per part at its array
element (DescriptorRange::element), and the runtime views each.
Each part is the device's own view in the format one view takes, so a read
converts its texel as the one view does: no precision note. A texture buffer
one view holds keeps one view, no variant and its key. The families row
TextureBufferWidth is exact where the parts reach 2^28.
Still refused (TexelBufferTooLarge): a slot read through a sampler or used beyond read/write/atomic/width; a device
without NonUniform indexing of that kind of texel buffer array; formats with several texels a block. Argument-buffer
texture buffers past the limit stay the heap neutral (unnamed-texture-unviewable). New: WorkCounts::texel_buffer_parts_bound,
RuntimeFact::TexelBufferParts (appended), bind::part_texels / texel_buffer_parts, BoundTexture::Buffer.parts,
TextureShape::Buffer.parts (serde default 1), VariantKey/LoweringInputs.texel_buffer_parts (hashed only when non-empty),
DescriptorRange.element. SEMANTICS_VERSION bumped: input once refused now translates.
Evidence (lane jobs, msi): m3-max-32343 at 628264de17: clippy --workspace --all-features --all-targets -D warnings 0;
41 metal2vulkan tests incl. golden_hashes_match_the_table (every fixture's SPIR-V unchanged on every profile: one part is
byte-identical), the binder test (an under-limit slot: no parts entry, empty variant, layout counts 1), the interpreter
parts test (robust and unrobust), api_surface / api_signatures / refusal_surface; families::states_follow_their_sources;
lavapipe texture_buffer_width_device (R32Uint limit+64 texels: both sides of the limit and the last texel read and written,
past the end reads 0 and writes dropped, texel_buffer_parts_bound +3) and buffer_tail_device. Without the fix the device
test fails at bind: TexelBufferTooLarge{elements 134217792, limit 134217728} (m3-max-32140). ANV (2^27) is down; the XTX
(2^29) never parts.
Lane commits: 9fbf7d3c14, 7f7f3ad95e, 9a745ffb3c, 740e9e43dd, 628264de17.
|
||
|
|
b7053280de |
RUNTIME 2346: 4:2:2 textures over IOSurface planes: an image of their texels, decoded from the pairs in place
A GBGR422 or BGRG422 texture made over a buffer's bytes (Buffer::new_texture_with_iosurface_plane,
a CoreVideo 2vuy or yuvs plane, over a Shared buffer or a no-copy buffer's host pages) had no
decoded twin: twins are attached only to textures whose image is their own for good, so every
dispatch or draw that read or sampled it was refused, with a "needs R8G8B8A8_UNORM SampledImage"
line naming a format every device samples.
Such a texture is now an R8G8B8A8_UNORM image of its texels, the converted shadow a two-plane
YCbCr texture over planes already is (ShadowSource::Converted, its conversion now an enum of the
planes' and the pairs'): its copy in, before the first command of a command buffer that reads it
and after a command wrote the bytes, is one dispatch of the new bind::chroma_convert_module that
reads the pairs where they lie, at any byte of their VkBuffer, through one storage-buffer binding,
and writes Metal's texels (ChromaDecode, exact) through the image's R32_UINT view. Copies, blits
and CPU calls keep moving the plane's bytes. Where the device converts the pairs' format with
Metal's reconstruction (MoltenVK), the copy in is that conversion instead: the plane's rows copied
into the pairs' image, sampled through the conversion (chroma_sample_module) into a scratch,
copied into the image; announced decoded-texel-precision at the copy in's planning. The set binds
the buffer's VkBuffer, so the planning makes it again after a rebind gave the buffer another one,
and each command buffer holds the set it took. The placement query answers OtherShape. A plane
the window cannot take (past maxStorageBufferRange, a last word past the buffer, rows that share
bytes, texels past the buffer; with the device's conversion, a first byte or rows off 4 bytes)
keeps the carrier, its reads refused; FAST-PATHS records it as a known gap.
Per frame, per texture (w x h texels): before, no read ran at all; the texture was an R8G8_UNORM
carrier of the plane, 2 bytes a texel. Now no byte is copied: one dispatch reads the w*h*2 bytes
of pairs in place and writes w*h*4 bytes of texels (1920x1080: 4147200 read, 8294400 written).
Memory: one R8G8B8A8_UNORM image, w*h*4 bytes (1920x1080: 8294400), in the carrier's place; with
the device's conversion also the pairs' image (w*h*2) and the scratch (w*h*4), and per copy in a
w*h*2 copy in and a w*h*4 copy out. Announced carried-decoded-twin (an existing kind) with that
cost. No new Degradation kind, no new WorkCounts field.
A carrier's binding without a twin is now refused NotImplemented(Format) naming the texture's
format (pvrtc::holds_for_copies), not a need of the twin's view format.
Public surface: metal2vulkan::bind::{chroma_convert_module, ChromaConvertModule} added
(api_signatures.tsv blessed, api_surface table); docs/REFUSALS.md regenerated (one more
binding_view site of Format).
Tests: the in-place kernel against ChromaDecode's decode under the interpreter (both orders, first
bytes off a word, odd sizes, rows apart); a carrier's binding refusal (binding_view unit test);
a device test of both formats over a Shared buffer and over host pages reading Metal's measured
bar values (an Apple M3 Max, macOS 27.0.1) and Metal's decode of a random frame written on the
CPU before the next command buffer, OtherShape from the placement query, and the device's
conversion counted and announced where it converts. Verification jobs follow in the lane report.
Evidence (lane jobs): msi m3-max-32240 at 94f603bf35, --cfg m2v_cpu_icd on llvmpipe: 130/130 touched tests, clippy -D warnings 0;
the device test fails without the fix (placement not OtherShape, the read's dispatch refused). PHOENIX gem10 m3-max-32260
(archive m3-max-32241): all 4 cases (GBGR422/BGRG422 over a Shared buffer and over host pages) "Metal's texels, exact"
for the M3's measured bars and a random CPU-written frame; ycbcr_device, ycbcr_refresh, twin_reads 7/7. MoltenVK (device form)
run on the M3 follows.
Lane commits: 735234d5f4, d59f44baa6, 94f603bf35.
|
||
|
|
43bb61c60e |
RUNTIME 2344: Runtime: a command queue on the copy engine, and buffer copies merged into runs
Device::new_command_queue_for_copies() answers a CommandQueue whose command buffers submit to the device's copy engine (the staging queue's family of transfers alone), or None where the device has none to give (MoltenVK, lavapipe, RADV by default, a copy engine of one queue, an adopted device). Its VkQueue is the copy engine's third queue where it has one, else the fill queue's, whose submissions then take that QueueSlot's lock: NVIDIA's copy engine has two queues, staging's and fill's, and staging must wait for no work in flight. The slot is the last of the device's VkQueues, after presenting's; its family stays out of image sharing (buffers already share it as the staging queue's family, so no ownership transfer is recorded). Its command buffers take blit encoders alone, and of their commands buffer copies, fills and fences: other encoders and blit commands are refused (Invalid, Problem::CopyQueue(CopyQueueProblem::Encoder | Command)), as is a caller's VkBuffer not concurrent with the copy family (Buffer). A copy batch takes buffers' fills alone from first work. Barriers on its VkQueue name the copy family's reads (Barrier::record_reading), not the primary family's, which a family of transfers alone may not name beside ALL_COMMANDS (VUID-vkCmdPipelineBarrier-dstAccessMask-02816). A blit encoder's consecutive copy_from_buffer_to_buffer calls between the same two VkBuffers that its order needs no barrier between are recorded as one vkCmdCopyBuffer of many regions (copy_run.rs), on every queue; counted as WorkCounts::buffer_copies_merged. Batches on the copy slot are counted as WorkCounts::copy_queue_batches. Verified: not yet built (first build job follows). Also in this landing: - Copy queue: docs, and the device test's None answer checked against the device - Copy queue: keep the copy queue's place alive while the families are counted Evidence: lavapipe 425/425 (m3-max-32049), clippy m2v_cpu_icd and m2v_gpu -D warnings (32049, 32053); XTX m3-max-32073: default RADV answers None; RADV_PERFTEST=transfer_queue: 1 batch on the copy engine, 63 of 64 row copies merged, sync file signalled, bytes right, refusals typed, validation layer silent. The derived API table and docs/REFUSALS.md were re-derived on the merged tree (winport's #[cfg(unix)] gates landed beside copyq). |
||
|
|
ec0be064d0 |
RUNTIME 2342, SEMANTICS 2122: Texture buffers read through argument buffers sit in texel-buffer heap classes
A pipeline whose argument buffers hold texture buffers was refused with ArgumentBufferTextures (NotImplemented, no location): the translator's heap layout (lower/texture/slot.rs declare_heap) had no set-1 class for a texture_buffer member, so SPIRV-Cross-shaped tier-2 argument buffers (descriptor sets as [[buffer(n)]] structs with texture_buffer, texture2d and sampler members) could not be made, on any device. - Set 1 gains texel-buffer heap classes: UNIFORM_TEXEL_BUFFER for read, formatless STORAGE_TEXEL_BUFFER for read_write and write. The class follows the facts' texture type. - DescriptorCaps gains update_after_bind_uniform_texel_buffer and update_after_bind_storage_texel_buffer; where a device lacks them a typed needs_any_of names the missing features. Non-uniform texel-buffer indexing and the without-format read/write needs are checked as for images; link counts STORAGE_TEXEL_BUFFER with the images against the update-after-bind limits. - New public bind::heap::HeapElement::TexelBuffer(vk::Format). - The runtime writes each live texture buffer's texel view at its resource ID, with a neutral texel view at element 0; a gone texture buffer's Texels stay alive until its tickets clear. A texture buffer whose bytes cannot be viewed in place (staged, tail-viewed, offset off minTexelBufferOffsetAlignment, past maxTexelBufferElements, swizzled, or a non-direct format) reads the neutral and is announced through the existing UnnamedTextureUnviewable. No new Degradation kind. - docs/REFUSALS.md and api_signatures.tsv regenerated. Test: runtime_lane::argument_texel_buffers::a_texture_buffer_in_an_argument_buffer_is_read_in_both_stages (an owned fixture in SPIRV-Cross's shape): vertex and fragment read a texture_buffer member of a set-0 argument buffer, the fragment also samples a set-1 texture2d through the sampler beside it; every pixel must equal texel[1] + texel[4]*tint + albedo. Verified: lavapipe with the validation layer, m3-max-31658 at 6626eeaff3: pass. Control m3-max-31636 (the fixture and test at the base, without the fix): fails with exactly the ArgumentBufferTextures NotImplemented refusal. |
||
|
|
057b794f5b |
SEMANTICS 2115 / RUNTIME 2315: rate-mapped region copies record a box of regions per multi-draw
What: a draw through its region-copy variant recorded its regions 16 at a time (the device's
viewports). Each recording set 16 scissors, pushed its first region and stored DrawIndex as
ViewportIndex. On a guest frame the host step made about 4.7k such recordings a frame (Iris and
RTX 3090), while the GPU sat idle waiting for the step.
The variant's four clip distances already keep each copy to its region's pixels, as a fanned-out
copy's are kept; the per-region scissor only culled. Now:
- The vertex function draws region first + (DrawIndex / c)*nx + DrawIndex mod c from a pushed
box (PushField::RegionBox, renamed from RegionFirst, now [first, columns]).
- It stores 0 as ViewportIndex, the recording's one viewport, so it writes every output the base
variant wrote.
- The recording sets one viewport and its box's union scissor.
- A direct draw records a box as many regions at a time as one vkCmdDrawMultiEXT takes
(maxMultiDrawCount - 1), its rows in order. A run records one recording per box its bounds
reach; any other draw records the whole table in one or a few.
- Indirect draws keep one region a recording, under that region's scissor.
- The variant still needs shaderOutputViewportIndex and shaderDrawParameters; it no longer
needs multiViewport.
Exactness: a border between two regions of a recording holds no pixel centre and no sample at
Vulkan's standard sample locations (at least 1/16 px inside a pixel, up to 8 samples), while each
copy's clip distance there is zero up to rounding. A box is recorded one column (row) at a time:
- in a pass whose custom sample positions put a sample on a pixel's left (top) edge;
- on a device without standardSampleLocations;
- in a 16-sample pass.
See render/fan_out.rs, folds.
A box's recording and the recordings of each of its regions alone run one pipeline that writes
the same outputs. They differ only in their dynamic viewport and scissor values and the integer
region each draw selects (Vulkan's Invariance appendix, Rules 2 and 4). The agreement between the
encoder's region-copy vertex function and the host step's fan-out geometry stage stays the
existing FAST-PATHS known gap, checked by running: no new near-equivalent, no new accepted
difference.
SEMANTICS_VERSION 2115 (the variant's module and push layout); ARTIFACT_FORMAT_VERSION 523 (the
PushField tag); RUNTIME_VERSION 2315 (what a region-copy draw records). Docs: rate_mapped_pass.rs,
render/fan_out.rs, bind/fan_out.rs, the translator's region-copy plan and store, docs/API.md, and
the FAST-PATHS fan-out row and known gap. docs/REFUSALS.md regenerated unchanged; api_signatures
blessed. No new Degradation kind, no WorkCounts field.
Tests:
- render/fan_out/tests.rs: run boxes, box recordings, box scissors, the fold rule.
- tests::rate_mapped_region_boxes (device test): the same two passes drawn directly (boxes) and
indirectly (one region a recording, its own scissor), additively blended into RGBA16Float with
a ground plane, border-crossing slivers and off-screen and w-straddling triangles, then an
Equal pass, compared bit for bit, with the recordings counted.
Verified (lane ratemap2):
- msi m3-max-30288 at 9240cc0ea6: clippy -D warnings, all targets and features, plain, cpu_icd
and m2v_gpu, exit 0; rustdoc -D warnings exit 0; translator touched tests 226/226; runtime
33/33; lavapipe 13/13.
- rate_mapped_depth_equal: 0 failing pixels in every pairing under Exact and FanOut. Without
the ViewportIndex store, FanOut's mixed-route pairings had 2853 of 89483 (m3-max-30235).
- rate_mapped_region_boxes: direct 3 draws in 3 recordings against indirect 3 in 624, 0 texels
differ, Equal-pass mismatches [0, 0].
- Negative control (each clip distance widened by one pixel): rate_mapped_region_boxes fails,
25464 texels differ, Equal-pass mismatches [11019, 0].
- The Iris GPU-time A/B (ms01, m3-max-30315, exclusive) is running; the consumer's renderer run
at the next pin is the workload proof (rate_map_piece_gpu_nanos a frame on Iris).
Landing note: docs/API.md merged by hand with RUNTIME 2314's probe-parts sentence (both rewrote one
paragraph), and rate_mapped_pass.rs's Fan-out now says the probe runs in parts (RUNTIME 2314).
|
||
|
|
2960070096 |
SEMANTICS 2114 / RUNTIME 2307: write() through an argument buffer to a two-plane YCbCr texture stores or drops as the slot write does
An argument buffer's texture2d<float|half, write> of a two-plane YCbCr texture died at dispatch (its storage heap member was refused). Metal stores through a handle exactly what it stores through a slot (the M3 Max under macOS 27.0.1, measured by the consumer): nothing of YCBCR8_420_2P, both planes of the unpacked 4:4:4 formats byte for byte the slot's. - bind::heap: a storage class holds a texture whose writes Metal drops (metal::format::writes_dropped) as its neutral (Fit::Dropped), and a 4:4:4 texture whose writes Metal stores (ycbcr_writes_stored) through the R32G32B32A32_SFLOAT view of its write shadow; its table entry carries FLAG_YCBCR_WRITES (bit 15). A stage that reads the storage class (new RuntimeFact::HeapStorageReads, a PlanTimeCheck) refuses either texture it reaches there, Format / NotImplemented, as a slot that reads one is refused. - memory::handles: the search carries the flag into handle bit 29 (HANDLE_YCBCR_WRITES) under the stage's new SpecKey::HeapYCbCrWrites, a u32 constant the plan gives from the command's members (1 where a member it names is such a texture, usage writing). At 0 the carry mask, the element mask and the write's test are spec-constant folds, so a command naming no such texture runs the pipeline it ran before (the predicted bindings name none). - lower::texture: a float/half 4-lane 2D heap write selects (rgb, 1.0) where the handle carries the flag: the mark the write-back kernel reads (nonzero), in place of any member conversion. - runtime: the write shadow's image is MUTABLE_FORMAT with an R32G32B32A32_SFLOAT view where the device stores that format; the heap's float storage element is that view; a command making such a texture resident for writing names the shadow in its uses (its copies clear the marks and encode the marked texels into the planes), and the texture's own image only where it reads it too. Tests: src/tests/engine_heap_ycbcr_writes.rs (interpreter run at the constant's 0 and 1, plan values and one variant for every command naming no shadowed texture, the storage-read refusal); runtime_lane::ycbcr_argument_writes (500/503/507/523/527/542/545 through an argument buffer against the slot's bytes, and the pipeline count). REFUSALS.md regenerated; api_signatures blessed: two new variants of #[non_exhaustive] enums, nothing breaks for a consumer. Metal (M3 Max, macOS 27.0.1, m3-max-29643): argument-buffer writes are byte-identical to slot writes for 500/503/507/523/527. Verified (msi lavapipe, --cfg m2v_cpu_icd): m3-max-29859 clippy translator/runtime/validation 0, runtime 243/243, lavapipe lanes 75/75, translator 246/247 (a word bound the mark raised, fixed in ce01da189e); m3-max-29865 at ce01da189e clippy 0, translator 4/4, lavapipe 2/2: argument-buffer writes byte-equal to slot writes for all 7 formats (alpha-0 writes, so an unmarked write stores nothing); pipelines 1 after RGBA8/RGBA16Float/500 commands, 2 after the first 503 and still 2 after a second. |
||
|
|
9fa1fe4a7a |
SEMANTICS 2113 / RUNTIME 2305: write() and render into the _sRGB two-plane 4:4:4 twins (523, 527) store what Metal stores
write() (kernel and fragment) into YCBCR8_444_2P_sRGB (523) and YCBCR10_444_2P_sRGB (527) over a surface plane, and such a texture as a render attachment, were refused (the encoding unknown). Metal's bytes, measured on an M3 Max (macOS 27.0.1; 8 colours, kernel write, fragment write and Clear+Store over 444v/x444 surfaces), fit one reading exactly: each channel is sRGB-encoded first, then converted as the non-sRGB twins 503/507 convert (here BT.601 video range). Metal's own paths differ by one code on one 10-bit luma (kernel 696, pass 697). - metal::format: ycbcr_writes_stored and ycbcr_renders take 523/527; the 4:2:0 and 4:2:2 sRGB twins stay refused (unmeasured). - bind::ycbcr_write: one shape word, SRGB: per channel the pass's half (pass only), then lower::arith::pack::srgb_encode (the device's Pow), then the existing grid step and rows. The device's float curve is the conversion we implement (no sRGB view can store a matrix combination of encoded channels); no PrecisionNote: any difference is within Metal's own one-code spread. - A pass that Loads a twin is refused at its start, and a pipeline that blends into one at its attachment, both NotImplemented(Format) (Metal's load and blend of the twins unmeasured). REFUSALS.md regenerated (Format sites 124 -> 125). - CPU references ycbcr_write/ycbcr_store encode the twins by the same f32 steps. Verified (msi, lavapipe, m3-max-29687 at db17bcce16): clippy (metal2vulkan, runtime, validation, --cfg m2v_cpu_icd) 0; translator tests 13/13 (reference and interpreter give Metal's eight colours for 523/527); lavapipe 14/14 (lane ycbcr_srgb_twins: both planes against Metal's table for kernel, fragment and Clear+Store, one code allowed on the 10-bit luma only; load and blend refusals; the 503/507/542/545 tests unchanged). Negative control (SRGB word forced to 0, m3-max-29701): the CPU test and the kernel, fragment and pass tests fail on grey, (0.2,0.6,0.9) and (0.9,0.3,0.1). |
||
|
|
be62103f73 |
One state lock per encoder open and one per end
A compute encoder opened after another took its command buffer's state lock
7 times as it opened and 3 times as it ended (a debug count on lavapipe):
the protection check, settle_end's three takes, the open itself,
enter_predication and inherited_residency; end_predication,
note_scheduled_work and the end itself. About 17 ns each under perf, 118 ns
of a folded dispatch's open and 55 of its end on msi.
- EncoderCore::open checks the protection options (compute and render),
settles the last render encoder's end where one waits (CommandBuffer::
settled: the three takes only where something is there, else the lock it
holds), and runs the kind's own state work as a closure under its lock:
compute's enter_predication and State::inheriting, blit's protection
options.
- end_with_replay notes the scheduled work and, for a compute encoder whose
command buffer has no predication record, its unit's work under its own
lock. Captures::unpredicated tracks that: false at open where the command
buffer has a record, cleared by the encoder's own record, false for an
encoding again, so those keep end_predication's lock.
Tests: tests::encoder_state_locks (debug, device): a compute encoder and a
blit encoder opened after a compute encoder lock once at open and once at
end.
No behaviour changes (what a run answers, records and submits is the same), so RUNTIME_VERSION
stays 2304 and the runtime-sources pin alone moves.
Verified (msi, lavapipe): tests::encoder_state_locks 1 lock at open and 1 at end for compute and
blit (negative control with the base sources: compute 7/3, blit 5/2); touched runtime suites
156/156 (render_fold 13, encoder_fold 22, ...); validation predication and protection_options
18/18; clippy plain, m2v_gpu and m2v_cpu_icd 0; rustdoc 0. Release A/B (base
|
||
|
|
76855fc0ba |
SEMANTICS_VERSION 2106, ARTIFACT_FORMAT_VERSION 522, RUNTIME_VERSION 2256: GPU-written indirect command buffers that inherit the encoder's buffers run on the GPU; write routes reach the indirect command buffers of their own command kind
A GPU-encoded indirect command buffer whose records inherit the encoder's buffers took the host step: the render GPU form refused inherit_buffers (DrawReplayRule::InheritedBuffers) and the compute GPU form had no inherited-bytes path, so every frame read the records back and replayed them on the host (gameload's icb: 8,192 indexed draws, ~44 ms of host step a frame on the Iris against 0.29 ms natively). - Render (da75a4602f..f3745fd69c): a draw replay's variant takes the encoder's vertex and fragment buffers by index as its parent buffers, resolved to device addresses past the parent's record; inline bytes (set*Bytes) are planned at their slots; an unaddressed inherited buffer keeps the host step with its cause named (parent_entries refuses it rather than writing a zero entry). The executor's draw preprocess binds the encoder's vertex buffers. - Compute (7c148c3995..0a68ac5f15): a GPU-written buffer of dispatches that inherits the encoder's kernel buffers runs on the GPU the same way; the new fixture icb_inherited_dispatches (our MSL) and its golden. - Route kinds (2d9f4ac597..2e206952c2): every route of a command buffer joined every indirect command buffer it made resident for writing, so a compute ICB's writer (DISPATCH|RESET) refused the render ICB's GPU form in the same command buffer (DrawReplayRule::Operations): gameload -b's render ICB host-stepped although nothing refused its own shape. A write route now reaches only the ICBs of its command kind (render or compute); CommandWrites carries the kinds (ARTIFACT_FORMAT 522). - host-replayed-indirect-commands is announced once per cause instead of once per device (a660b2fe8d), naming the rule that keeps a pass from the GPU form, as copied-host-pages announces per reason; no new Degradation kind or WorkCounts field. Verified on the branch (steelbrain/icbinherit2 at a660b2fe8d): clippy plain, m2v_gpu and m2v_cpu_icd and rustdoc exit 0 (27886); runtime suite 1538/1539, the one failure the catalogue text RUNTIME 2253 already fixed on development (27884); lavapipe ICB and notice lanes 214/219 with render_inherited_buffers, compute_inherited_buffers, write_routes, written_commands and the beside test (inherited and own buffers: cold (8,8,0), warm (8,8,0,0), pixels as alone) passing, the 5 failures failing the same at the branch's base (27926, 27927); before route kinds the beside test fails as designed, (0,0,8) against (8,8,0) (27764); XTX 90/101 at 60c85035e3 (27853), the 11 failures fixture paths under msi's compile-time path only, all 11 passing on lavapipe (27807). |
||
|
|
1cf0e1910d |
RUNTIME 2255: cubes and BC rows over an IOSurface plane are made where the x86 Macs make them
reims's oracle_surftex found the Radeon Pro 5300M and the UHD 630 making three IOSurface-plane
shapes that the runtime refused:
- a Cube and a CubeArray over a plane of a surface with planes (cases 119, 188-191). These were
refused as Metal's own Invalid; the M3 Max asserts "carriesComplexTexture || numFaces == 1", the
arm64 envelope.
- BC1 64x64 over a 420v luma plane, whose rows of blocks are wider than the plane's row (case 187).
This was refused as NotImplemented(SurfacePlaneShape); the M3 answers nil.
An x86 guest was answered "made" while the host held no object for it. The x86 envelope is the x86
Macs', and they agree, so the runtime now makes them as those Macs lay them out. Measured with
surface_texture_envelope on both x86 GPUs (m3-max-27621, -27622).
Cubes: face k lies at the plane's offset + k x rows x bytesPerRow, rows bytesPerRow apart. The
planner (linear_plan.rs, faces_at_pitch) lays a colour cube or cube array over a plane, at an offset
and bytesPerRow that are multiples of 16, as a 2D array of its faces at that pitch, for the GPU
and the CPU alike. Faces past the buffer go in the texture's tail, announced as SurfaceTexelsTail,
as a 2D array's texels past it do. The image is cube-compatible, as every cube's is. Every other
cube over such a plane (another format, off 16, several levels, rows wider than the plane's) is
NotImplemented(SurfacePlaneShape) instead of Invalid. Over a surface without planes it stays
BufferTextureProblem::TextureType. The CPUs differ: the 5300M's getBytes and replaceRegion take
every face at the first's bytes, and the 630's take them one image on from the surface's byte 0.
The runtime's CPU calls take the GPUs' layout.
BC rows of 8-byte blocks wider than the plane's row keep to it, as the x86 Macs' blits do: the
blocks in the plane's row lie in place; the blocks past it read zero and their writes are dropped.
There is no tail storage: the shadow zeroes them at its first move, and blits, replace_region and
get_bytes clip to the kept columns. InPlaceRefusal::Rows's doc now also covers rows that hold fewer
of a BC texture's blocks than its row. No Degradation kind and no public item were added. docs/API.md
records two accepted differences: the CPU calls follow the GPUs' layout, and a cube's faces past
the plane's rows lie at the plane's pitch. linear_plan.rs, the RuntimeGap and BufferTextureProblem
docs, FAST-PATHS known gaps and REFUSALS.md (regenerated) are updated.
Verified (planerows, 97de630b9f on
|
||
|
|
2bd067d6c7 |
RUNTIME 2254: a command buffer's completion exports as a SYNC_FD sync file
A consumer that composites one GPU's frames on another vendor's GPU has to order the second
device's work after a runtime command buffer. The only semaphore export was
SharedEvent::export_semaphore_fd: a timeline semaphore as OPAQUE_FD, which Vulkan imports only on a
device with the same deviceUUID and driverUUID, so it cannot cross from NVIDIA to RADV. The consumer
waited on the CPU instead, about 3.5 ms a present on its window thread. A cross-driver handle needs
SYNC_FD, which only binary semaphores export.
New (unix only, no Metal counterpart):
- CommandBuffer::add_completion_sync_file(), before the commit: the command buffer's last batch
also signals a binary semaphore exportable as SYNC_FD, after its to-host barrier. That batch never
joins a submission group. A command buffer with no GPU work submits the signal alone, after its
queue's earlier work.
- CommandBuffer::export_completion_sync_file() -> Result<Option<OwnedFd>, Error>, after the
commit. It blocks only until the signalling batch's vkQueueSubmit has returned, never on the GPU.
None means the work already ended, or the driver answered -1; the importer imports -1 or skips
the wait.
- Spec: the export follows the signal's submission (VUID-03254), with copy transference. One export
per command buffer. Event::reserve_vk_signal's doc carries the contract for a reserved signal
that the batch waits on.
- The semaphore goes back to an idle pool of up to 8 per device once the command buffer completes
with its fd exported, and is released otherwise.
Where the host writes the caller's pages after the GPU work (a copied host buffer's merge back, or a
managed two-copy buffer's copy-out), no GPU signal can come after those writes. There the export
waits for completion and answers None, announced by a NEW Degradation: SyncFileAfterHostCopies
(sync-file-after-host-copies, performance). Also new: WorkCounts::sync_files_exported and
sync_files_after_host_copies; RuntimeGap::SyncFileExport, for a device without
VK_KHR_external_semaphore_fd or without binary SYNC_FD export (MoltenVK, an adopted device without
the extension); Problem::SyncFile(SyncFileProblem { Committed, NotCommitted, Exported }).
docs/API.md (catalogue entry), the runtime README, REFUSALS.md (regenerated), the reach table and
api_signatures are updated.
Verified (syncfile, 8f9caba0ae on
|
||
|
|
7e827c1b5e |
RUNTIME 2251: a two-plane YCbCr texture over IOSurface rows of codes that overlap is made, as Metal makes it
A two-plane YCbCr texture can sit over a plane of a surface with planes whose rows of codes are
wider than the planes' bytesPerRow (a texture wider than its plane, or a 10-bit format over 8-bit
rows). Metal makes it. The runtime refused it at creation: linear_plan's overlap_held answered
NotImplemented(OverlappingSurfaceRows), and the guest got nil. An arm64 guest's oracle run met
one: YCBCR8_420_2P 66x64 over plane 0 of a 64x64 '420v' (luma rows of 64 bytes).
Such a texture's texels are its conversion of the planes' bytes (ycbcr.rs), which reads every code
at the planes' rows, so rows that share bytes need no row rule. The refusal was written for a
plain plane's two-region shadow copies, which a converted texture never uses. overlap_held now
holds a two-plane YCbCr texture over a plane of a surface with planes, whatever its usage.
Still refused, now at use and with the precise gap NotImplemented(OverlappingSurfaceRows) (was
NotImplemented(Format)):
- a blit from a buffer into such a texture: Metal leaves no single row's bytes there (the
earlier row's at every shared byte of the 8-bit shape; 2047, then 1919, of 4032 for the 10-bit
one);
- a 4:4:4 texture's stored writes;
- a render pass whose rows of codes overlap (unmeasured).
Over a surface without planes it stays refused at creation (unmeasured). docs/FAST-PATHS.md's
known gaps, the RuntimeGap doc and REFUSALS.md (regenerated) say so. No Degradation kind, no public
item.
Metal's answer (probes/ycbcr_wide_code_rows.m, m3-max-27270, macOS 27.0.1, two processes a shape),
for the 66x64 8-bit shape and a 64x64 10-bit one:
- read() and the nearest sample of every texel equal the same texture over the same bytes laid
apart, bit for bit (0 of 4224 and 0 of 4096 texels differ);
- getBytes reads the luma rows at the pitch;
- replaceRegion writes them in order, the later row standing.
Verified (planerows, 5fdbf147d5 on
|
||
|
|
977c9da12f |
RUNTIME 2246: setTriangleFillMode: 2 (MTLTriangleFillModePoints, Apple-private) draws a triangle's vertices as points
Apple's GL renderer sends setTriangleFillMode:2 for glPolygonMode(GL_POINT) under its Intel and
Apple-silicon caps tables. The value is not in the public headers. Our TriangleFillMode had only
Fill and Lines, so the consumer's raw-value conversion failed and its host died. Measured on
Metal: an M3 Max and an Intel UHD 630 draw only a triangle's 3 vertex pixels (a Radeon Pro 5300M
fills it); our own probe on the M3 (m3-max-26811) draws 1-px points whether point_size is 4, 1 or
unwritten, culls them with CullMode Front, and draws them with Back.
Now TriangleFillMode::Points (2) exists. The generator (scripts/regen-metal-enums) takes a
PRIVATE line for it, with its evidence, and a PRIVATE_DOCS doc comment (metal_enum! accepts
variant attributes); generated.rs stays generated and `--check` passes. The runtime draws it as
VK_POLYGON_MODE_POINT. It needs fillModeNonSolid (refused otherwise:
Feature::TriangleFillPoints) and, on a portability-subset device, pointPolygons
(VkFeature::PointPolygons; MoltenVK withholds it, so it refuses Points). New degradation
TrianglePointSize ("triangle-point-size"): Vulkan sizes the points by the PointSize the vertex
function writes, where Metal draws 1 px. An ICB command still refuses set_triangle_fill_mode, as
before. New lane module runtime_lane::triangle_points.
Verified (fillpoints, 6b9927c402 on
|
||
|
|
b741f93b9e |
SEMANTICS 2098 / RUNTIME 2244: a rate-mapped pass's region-by-region draws copy each region in the vertex function, scissored, so Equal depth matches the fanned-out route
Under RateMapRegionPolicy::FanOut a draw was drawn two ways: fanned out (a geometry stage's copy of each triangle per region, window position a*x + b*w through one viewport), or region by region (each region through its own Vulkan viewport). The two rounded a vertex's window position differently, so a pass testing depth Equal against depth the other route stored failed along whole surfaces: the consumer's black blotches on lit surfaces in Apple's Modern Rendering sample on the RTX 3090. The depth-Equal repro left 44,666 of 89,483 pixels red on lavapipe whenever the prepass and the Equal pass took different routes; 0 under Exact or on one route. Now on a fanning device the region-by-region draws take a region-copy variant (RegionFanOut::RegionCopies), with no geometry stage. Its vertex function computes region RegionFirst + DrawIndex of the table, stores its position through the region's line and four clip distances by the one emitter the fan-out stage's copies use (pipeline::link::fan_out::region_copy: NoContraction arithmetic, Position and ClipDistance Invariant), and its draw index as ViewportIndex. Each recording sets as many viewports as one multi-draw takes, every one the fan-out's over the render area, with each region's scissor at its index (bind::fan_out::scissors), so off-region triangles are scissored, not clipped. The settle keys the pipeline with the same viewport count (fan_out::copy_viewports). The variant replaces the regions variant, so no pipeline is added per state. A device without multiViewport, shaderOutputViewportIndex and shaderDrawParameters keeps the per-region-viewport route (FAST-PATHS known gap). Exact is untouched. New: bind::fan_out::scissors, WorkCounts::rate_map_region_copy_draws and rate_map_region_copy_recordings, PushField::RegionFirst; cache codec variants (artifact format). Verified (blotch, steelbrain/blotch 1fd68a45c0..16d5c2404f): - lavapipe at 16d5c2404f: rate_mapped_depth_equal + rate_mapped_fan_out 4/4, 0 red in all 10 depth-Equal lines (mixed pairs included), 0 pipelines made at the host step; clippy CPUICD, GPU and plain 0; rustdoc 0. Translator suite at 8ad673ffba 3562/3563, the one failure golden_hashes (re-blessed on development). - 780M and XTX at 8ad673ffba (differs from the tip by the settle fix only): 0 red in all 10 lines. E->E GPU cold/warm: 780M 4.99/4.97 ms against Exact 1.68/1.65; XTX 1.14 ms/650 us against 569/265 us. Creation (shader cache off): 780M 1.32 ms/state (Exact 0.92), XTX 1.30 (Exact 0.68). - Owed: the same numbers at development's tip without this change (the GS fan-out), the clip-distance probe, and the 780M/XTX runs at 16d5c2404f. SEMANTICS_VERSION 2097 -> 2098, ARTIFACT_FORMAT_VERSION 518 -> 519, RUNTIME_VERSION 2243 -> 2244. |
||
|
|
20d04dbd5e |
RUNTIME 2242: an ICB's setters write through one batch, mostly without the lock; set_render_command and set_compute_command
An indirect command buffer's CPU setters, after RUNTIME 2238's dense table and one hold: every setter write now goes through one per-command batch (one storage pointer, one count of the writes made without the lock), written into in place rather than handing back a ~180-byte plan (which made a first form slower than before). The written flag (SEMANTICS 2097) is set in the one write helper, write_field, by the rule unchanged: every setter write sets it, a write of the reset record clears it. A draw, a dispatch, a set barrier and a cleared barrier the edits' summary already holds, like a buffer slot before, take no lock where the GPU may not have written the buffer, checked against an atomic mirror of the summary set under the lock; a pipeline state the command already names is set again with no lock and no CallHold (an atomic (id, serial, kind) mirror per command; a recovery's carry forgets it, so the next set redoes every check). New public calls IndirectCommandBuffer::set_render_command / set_compute_command (an index and a list of sets, no handle and no Arc clone; index and kind refusals at place 0) and the handle's set_each; borrowed RenderAt/ComputeAt views. docs/API.md says which setter writes take no lock; the carry docs say a write made without the lock does not wait for a carry (as buffer slots' did; a set racing a device recovery may write through the old mapping). Verified (icbset, f403b6e922 on |
||
|
|
4383b55aed |
SEMANTICS 2096: ANV: a stage heavier than the largest measured to compile in host-sized memory is refused, or keeps the widest pin
ANV's compiler takes memory that grows faster than the stage it compiles, inside the process that
creates the pipeline, well below the 2^20-object bound the serialized stage already keeps under.
Measured on the Iris Xe of RPL-P (Mesa 26.2.6), compute modules created cold through
vkCreateComputePipelines, the resident set sampled every second (job m3-max-26147): entry weights
73,814, 75,886 and 99,109 were created in 45 s, 47 s and 132 s at peaks of 1.76, 2.24 and
3.65 GiB; a module of entry weight 532,213 passed 16 GiB at 358 s without finishing. Job
m3-max-26086: a module of entry weight 796,525, its heap raw-texture arms dead, passed 20 GiB in
under two minutes. Both under the old bound (786,432) would have been handed to the driver: one
pipeline creation that can take a host's memory.
- DriverWorkaround::CompilerMemoryGrowsWithStageSize, keyed on ANV whatever its GPU and release
(device::derive), documented with those points.
- stage_bound: StageBounds holds both bounds (SERIALIZED_STAGE_WEIGHT 786,432;
COMPILED_STAGE_WEIGHT 99,109, the largest measured to compile, no margin below it as nothing
above it is measured to compile). emit keeps a module under every bound its profile's defects
set, with the same widest-pin retry; a refusal (StageSize, DriverDefect) names the serialized
stage's defect past 786,432 and the compiler's memory below it. The bound rises when a larger
compile is measured within host-sized memory.
- The test hooks (compile_bitcode_bounded, compile_stage_bounded) take StageBounds.
Docs: stage_bound's module docs and FAST-PATHS' known-gaps entry state both bounds with the
measured points only (weights, never names), and restate the serialized bound's figures in
entry_weight's units: the faulting stage 1,603,989 (0.683 objects per unit, was 1,565,083 and
0.70 by a count 2.4% lower), the other 21 stages' ratios as counted by that count, which ran 1.9
to 2.7% below entry_weight on the five modules both counted; the shader-object figure likewise
1,603,989. Feature::StageSize's docs and its reach line cover the memory bound; REFUSALS.md
regenerated. api_signatures.tsv blessed with the new variant (the bless also moves
scheduler_slice_rescues to the script's own order).
For a consumer on ANV: a module of entry weight past 99,109 and up to 786,432 that was handed to
the driver is now refused (Unsupported, Feature::StageSize,
Needs::DriverDefect(CompilerMemoryGrowsWithStageSize)) unless its pinned plan fits. Other drivers
are unchanged.
Tests:
- engine_simd_lockstep::a_kernel_past_the_stage_bound_keeps_the_widest_pin_or_is_refused covers
both defects: for each, under a bound the emulated module passes the kernel is planned again
pinned (exact at 32 lanes), under one its pinned module passes too it is refused naming that
defect, and past both the serialized stage's defect is named; RADV emits under every bound.
- engine_simd_lockstep::a_kernel_past_the_stage_bound_gets_one_answer_through_either_path on the
serialized bound through StageBounds.
- device::tests::profile::large_module_defects_are_keyed_on_anv includes the new workaround.
Verified, on msi, read from inside each job:
- m3-max-26184 (this change on
|
||
|
|
a2ac4433ca |
SEMANTICS 2094: One input, one answer: a compile past the stage bound is charged once, by either path
A kernel planned again past the stage bound (stage_bound::emit, WidestPin::Kept) ran plan_one a second time: decode, specialization, lockstep order, lowering inputs and memory analysis, all charged to the meter again. And Device::compile_function_from_entries charged nothing for an entry a creation had already specialized (StageEntries handed out an uncharged copy). So one input got two answers under one budget: compiled alone, a large kernel past the bound on the Iris Xe was refused LimitExceeded(WorkUnits); compiled from a creation's entries, Unsupported(StageSize). - stage_bound::emit analyzes the entry once (analyze_one, the part of plan_one before selection, kept as Analyzed) and only selects, emits and rolls again. What the dropped plan and module hold of the ledger is released, measured from before the selection. - Meter::measured runs work and states what it charged (Spent: work units, its ledger peak above where it began, the bytes it still holds); Meter::spend charges that to another meter, work units first, then the peak, keeping the held bytes. - StageEntries keeps each entry's, decode's and plain answer's Spent and charges it to every ask that finds them, so a found entry costs what making it cost. The object spares time, never budget: compile_function_from_entries charges what compile_function charges, unit for unit. For a consumer: Spent, Meter::measured and Meter::spend are new public items of metal2vulkan-air's budget module (api_signatures.tsv blessed); nothing was removed. A creation that shares a StageEntries is now charged its found entries' work units against each compile's budget, as a compile that shares nothing always was. Tests: - budget: spent_work_charges_another_meter_as_the_work_did (work, ledger and peak equal to the work itself; refused alike one unit under either cap). - engine_simd_lockstep: a_kernel_past_the_stage_bound_gets_one_answer_through_either_path. The pressured kernel under a bound its emulated module passes (planned again, Direct) and under one its pinned module passes too (StageSize): alone, from entries that make the entry and from entries that find it, the same answer and the same work units W; at exactly W both paths answer the bound's way, at W - 1 both are refused WorkUnits; the negative control, a meter also charged one more plan of the entry (what the plan made again used to charge), is refused WorkUnits at W. - library_entries_decode_once, stage_input_siblings: the work units through a shared decode or entry now equal the unshared compile's (they asserted fewer before); the decode counts still show the sharing. Also in this commit: crates/metal2vulkan-air/tests/api_surface.txt gains the four rate-map items |
||
|
|
c53ea4164e |
SEMANTICS 2091: on ANV, a stage past the serialized-object bound keeps the widest pin or is refused
Mesa's common pipeline runtime (vk_pipeline.c) serializes every compute stage into a precompiled shader and reads it back before compiling it. nir_serialize names each object by a 20-bit index (MAX_OBJECT_IDS 1<<20) checked only by an assert, so a release build wraps past 2^20 objects and the driver faults inside vkCreateComputePipelines. On Intel Iris this took a consumer's host process down on a large compute kernel (its translated stage: idx_table_len 1,096,128). DriverWorkaround::SerializedStageWrapsLargeModules (keyed on ANV) bounds the stage's weight at SERIALIZED_STAGE_WEIGHT = 786,432 instructions, every call counted as its callee's body. A module over the bound is never handed to the driver: a kernel that emulated its simdgroups only in place of the widest mode's pin compiles pinned to 32 lanes again (lower::simd::WidestPin::Kept), and any other is refused as Unsupported::driver_defect(Feature::StageSize, ..), where Metal compiles it. The gap is recorded in docs/FAST-PATHS.md's known gaps; REFUSALS regenerated, reach.tsv marks StageSize rare, api_signatures carries the two new variants. The bound's basis: 22 stages measured at 0.14-0.99 serialized objects per weight unit; 786,432 is 3/4 of 2^20 at the worst measured ratio of about 1. Verified: the crash reproduced live on ms01's Iris (job 25723) with both the consumer kernel and a synthetic 360k-FMA chain; test a_kernel_past_the_stage_bound_keeps_the_widest_pin_or_is_refused; checks job 25736 (msi): clippy on the workspace, rustdoc, the full metal2vulkan suite, green. Not yet verified: the consumer's Iris run at the next pin. SEMANTICS_VERSION 2090 -> 2091: translator output and refusals change on ANV. |
||
|
|
b31ce16c85 |
The uint2 rasterization-rate map overloads compile to Metal's decoder
A fragment shader's map_screen_to_physical_coordinates and
map_physical_to_screen_coordinates with uint2 arguments were refused
(Unsupported{RasterizationRateMap, NotImplemented} at the lowering of
Fragment::MapCoordinates). Canon now expands them beside the float2
overloads, reusing the float2 decoder:
- screen to physical: the float2 decoder at the pixel's centre (c + 1/2),
converted to uint saturating (a NaN to 0), the conversion the float2
index path already uses;
- physical to screen: the bits of the float (0 - offset) * reciprocal of
the entry of granule c >> 5 on the axis's to-screen table; the
coordinate's value within the granule is not read.
Both are Metal's answers as our probe rate_map_integer_overloads measured
them on an Apple M3 Max under macOS 27.0.1: 20,114 coordinates over four
maps (one of two layers), at each map's layers and two past them, every
one equal to these formulas. The arithmetic is float and the device's own
(owner rule 1); where a device's denormals differ from Metal's flushed
ones the existing PrecisionNote::DeviceDenormals reading applies, as for
the float2 decoder. The boundary byte of a table entry is compared on its
low seven bits, as Metal's decoder does (the probe's maps hit an entry
with the high bit set).
The decoder's Rust models gain shader_screen_to_physical_integer and
shader_physical_to_screen_integer. Lowering's MapCoordinates arm is now an
invariant error: canon compiles every overload before lowering.
Tests:
- bind::rate_map::apple_tests::metals_integer_answers: 1,561 of the M3's
answers (apple_integer_vectors.txt: Metal's answers to our probe on our
maps, no Apple binary) against the Rust models, each map's bytes
checked by sha-256;
- tests::engine_rate_map::integer: the fixture rate_map_integer (kernel
and fragment) compiles on every tested profile, robust and not, passes
L3 with no RasterizationRateMap note; the interpreter's answers equal
the decoder's arithmetic at every layer and two past, and Metal's on a
map's own layers; and the translated kernel's answers equal the M3's
recorded ones at all 587 recorded points of the maps' own layers, bit
for bit;
- the fixture's four expectation rows go from the refusal to ok on all
profiles; integer_rasterization_rate_maps_are_refused is removed.
docs/REFUSALS.md regenerated: the fragment select site leaves the
RasterizationRateMap sites.
|
||
|
|
76f5b1b53f |
SEMANTICS_VERSION 2088: a loop's AIR unroll request reaches its OpLoopMerge
The two commits before this one carry a loop's llvm.loop unroll metadata from the AIR latch to its SPIR-V OpLoopMerge: unroll.full and unroll.enable ask Unroll (clang's enable: fully where the trip count is known, partly otherwise, SPIR-V's "to the degree possible"), unroll.count N asks PartialCount N (SPIRV_VERSION 1.5 has it, held by a const assertion), unroll.disable asks DontUnroll, and a count of 0 or no request asks nothing. Metal's compiler honours the same requests; until now every OpLoopMerge carried None. It changes no answer, so it is not a speed-for-accuracy choice. Translator output changes (SEMANTICS). docs/REFUSALS.md follows a renamed site (structure_loops). Verified by imgleak's runs: engine_loop_unrolling, one test per form (5/5 at ba2b803e57, 25358); negative control with e7ea80f1bb's lower/view.rs, so no request is read: the four form tests fail (unroll_count [[0]] where [[256, 4]] is expected), the no-request test passes (25376). Before the rebase, clippy -p metal2vulkan all targets and features clean and 585/586 touched tests, the one failure golden_hashes on kernel_threadgroup_float_bbox_atomics (unroll(disable)) and engine/hnq_half_layer_composite (#pragma unroll), re-blessed at the next pin (25343). Cold creation (driver caches off) and GPU time of the SR conv kernel 199ed, read in place on um790, base |
||
|
|
10f2539a71 |
8-bit floats widen through the device's own type where it has one
Owner rule 1: where a device has a native 8-bit float type, its conversion is the only form.
VK_EXT_shader_float8's shaderFloat8 (the SPIR-V capability Float8EXT, SPV_EXT_float8) is now a
VkFeature the device enables and the profile reads (leaf.float8); the SPIR-V IR has
Type::Float8 { encoding } (OpTypeFloat 8 with its FPEncoding, from the regenerated grammar items),
and the interpreter reads OCP's E4M3 and E5M2.
The shared decode, narrow::fp8_to_f32, widens through the device's type where the layout names
one (Fp8Layout::on): each u32 lane bitcast to four 8-bit floats, the low byte's widened by
OpFConvert, so no 8-bit integer type is needed. f8e4m3fn and a tensor's e4m3 take Float8E4M3EXT,
f8e5m2 and a tensor's e5m2 Float8E5M2EXT; the IEEE-like f8e4m3 has no device encoding and keeps
the integer decode. Every site takes it: air.convert's 8-bit float sources, simdgroup-matrix fp8
cells, and matmul2d, whose expansion now widens each element by an air.convert of the tensor's
format (Fp8::TensorE4M3, Fp8::TensorE5M2: Metal's reading, qualified on the M3 Max, e4m3 with no
specials, e5m2's NaNs 0x7FC00000; never parsed from a name, built by Out::air_call). A device
without shaderFloat8 decodes with integers, as before.
Where a tensor's element widens natively the stage records PrecisionNote::NativeFloat8
(native-float8): the device's e4m3 reads 0x7F and 0xFF as NaN where Metal reads 480 and -480,
and an e5m2 NaN's bits are the device's. Validation classes it Unbounded; the conformance suite
lists it among the native notes; FAST-PATHS.md has its device-gap row and API.md its catalogue
entry. The other formats record none: Metal on Apple M3 does not compile them.
The refusal of a matmul2d of 8-bit floats on such a device (Entry::float8_products, the select
check) goes. REFUSALS.md and api_signatures.tsv regenerated.
Tests: matmul2d's fp8 fused sums on the RTX 50 profile (Float8EXT declared, the note recorded,
e4m3 NaN sums) beside MoltenVK, RADV and lavapipe (neither); air.convert widenings on the RTX 50
profile and lavapipe; simdgroup-matrix fp8 cells on the RTX 50 profile too. Not yet built here:
the build and these tests run next on the cluster.
|
||
|
|
1ace4b5c46 |
The pre-import placement test counts the asking thread's images; signatures and refusals
What: tests/host_pages_placement.rs reads ObjectChurn::vk_images_made_this_thread (the WorkCounts field it named does not exist); api_signatures.tsv blessed for Device::host_pages_texture_placement and Problem::HostPagesBacking; docs/REFUSALS.md regenerated. Why: the test did not compile (m3-max-24729); the public surface changed. Verified: pending the lavapipe run. |