abba06ab441909a4c140ec6e94de15d826700ac1
417
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
fc9147534d |
Fetch a BGRA-order attachment through its RGBA twin without format-less reads
On a device that orders framebuffer fetch through the pixel interlock but has no shaderStorageImageReadWithoutFormat (ANV), a fetched BGRA8Unorm or BGR10A2Unorm color attachment was refused: SPIR-V names no image format for B8G8R8A8_UNORM or A2R10G10B10_UNORM_PACK32, so neither the typed nor the format-less declaration reached it. A guest pipeline of a fetched BGRA8Unorm color 0 beside an RGBA16Float color 1 was refused on the Iris Xe and aborted the consumer. What changed: - One public decision for the fetch storage view's format, StorageAttachmentUse::view_alias_of(format, profile) (the old uint_view_of took no profile). An 8-bit sRGB attachment keeps its unsigned-integer view. A BGRA-order format the device accesses without a format keeps its own format (RADV, NVIDIA, MoltenVK unchanged). One no declaration reaches takes its RGBA-order twin (R8G8B8A8_UNORM, A2B10G10R10_UNORM_PACK32) where the twin declares and stores. The compile layer (lower/fragment/fetch.rs) and the runtime (framebuffer_fetch::storage_view_format) both call it. - The fragment reads and writes such an attachment through the twin, exchanging red and blue in the shared read and write helpers (read_texel, metal_order), so every read, written value, kept channel and per-sample plane sees Metal's channel order. - The runtime makes the views: a BGRA8Unorm render target's free STORAGE candidate is made mutable to the twin (so ANV fetches it in place), and stand-ins and sample planes take the twin as their storage view. - StorageAttachmentUse::format_usages names the view's format (the one the storage image is bound in), not the attachment's. - Public rename: StorageAttachmentUse::uint_view and WriteSource::TileAttachment::uint_view become view_alias (serde keeps the old name as an alias), with StorageAttachmentUse::with_view_alias and view_alias_of. - The refusal names both routes where neither reaches (a BGR10A2Unorm attachment without shaderStorageImageExtendedFormats). The class, on a device without format-less storage reads: a fetch of a 16-bit packed attachment (B5G6R5Unorm, A1BGR5Unorm, ABGR4Unorm, BGR5A1Unorm) stays a typed FramebufferFetch refusal, and a read of an argument buffer's writable texture a typed ArgumentBufferTextures one; both are FAST-PATHS known gaps. Kernel slots, tile passes and the depth and stencil stand-ins already declare typed first. SEMANTICS_VERSION 1753, RUNTIME_VERSION 1313, runtime-sources pin recomputed. REFUSALS.md regenerated; docs/API.md says which view the storage form binds. Verified: - Metal (M3 Max, macOS 27.0.1, our own MSL probe under the Mac GPU lock): BGRA8Unorm and RGBA8Unorm targets, 1x and 4x, masks of every channel and of red and alpha, one to three fetch_ordered draws: every byte matches the model the device test checks (c read as c/255, halved, written as the exact product with 255 rounded to nearest). - ms01, Iris Xe (ANV, Mesa 26.2.4), release, --cfg m2v_gpu: runtime_lane::framebuffer_fetch::bgra passes with Metal's bytes in every case beside an RGBA16Float color 1 that keeps its clear. The BGRA8Unorm pipelines are made with view_alias R8G8B8A8_UNORM (4 pipelines); single-sampled targets are fetched in place (no storage form switch, no fetch-through-scratch notice), 4x through sample planes viewed in R8G8B8A8_UNORM. The fetch lane (runtime_lane::framebuffer_fetch::, 47 tests) and tests::srgb_fetch_images pass there too: 48 of 48. - ms01, debug: lower::fragment::fetch::tests (new: the twin on each of four ANV profiles for BGRA8Unorm and BGR10A2Unorm at 1x, in planes, under reads, writes and a red-and-blue mask; format-less profiles unchanged; both routes named; the refused class), engine_fragment::a_fetched_bgra_attachment_is_viewed_in_its_rgba_twin (the consumer's two-attachment shape on intel-irisxe-anv, 1x, 4x and a partial mask, the SPIR-V validated against the profile), with engine_fragment, engine_tile, cache::tests, pipeline::api_tests, pipeline::link::tests, fast_paths and api_surface: 217 of 217 pass. With the twin decision forced off, the five new translator tests fail, the consumer shape refused as on the Iris Xe (FramebufferFetch needs AnyOf([[ShaderStorageImageReadWithoutFormat]])). - clippy --workspace --all-targets --all-features -D warnings clean plain, with --cfg m2v_gpu and with --cfg m2v_cpu_icd. |
||
|
|
cc961dc744 |
Keep zero signs where an Exact answer needs them, and end a busy exit at once on Linux
One squash of development-fast d8546c940b..46649e335d (5 commits); the tree equals 46649e335d. - Exact float maths (FloatMathsPolicy::Exact off MoltenVK): a module whose checked product, checked OpFmaKHR or fma routine (Wide, Soft, HalfOdd) answers Metal's zero of its sign now declares SignedZeroInfNanPreserve at the routine's widths, or records DeviceSignedZeroInfNan where the device lacks the mode. A fast-math kernel declared no mode, so Vulkan let the device answer either zero sign: the RTX 3090 answered -0 where Metal answers +0. The default policy and MoltenVK are unchanged. - Exit on Linux (glibc): an exit while the driver still runs the runtime's work (a section, a making, or a CPU device's work) ends at once with the exit's status and one line on standard error, as Metal's exit does not wait; the exit handlers registered before the runtime's do not run in that case (docs/API.md, Process exit). An idle exit is unchanged; macOS keeps its waits. The exit lane test expects the new ending. - The exact golden hashes and the authored compile census re-blessed. Verified at 46649e335d (batch f10), all green: RTX 5080 7248/7248, RTX 3090 7248/7248, M3 7263/7263, Iris Xe, RX 7900 XTX and 780M 7248/7248 each, fuzz 8/8 on every venue; lavapipe 3823/3823, product 4824/4824, CPU validation 1331/1331; fmt, clippy (4 configurations), Rustdoc, packaging, qualification, refusals, the API reference check and doctests. |
||
|
|
20bd3793f3 |
Exact tiny products and fma, Metal's 16-bit blend zeros and new depth pattern, new notices, the ANV compiler-bound fallback, exit and barrier fixes
One squash of development-fast c66863112e..d8546c940b (27 commits); the tree equals d8546c940b. Exact float maths (FloatMathsPolicy::Exact only; the fast default is unchanged): - A tiny float product and OpFmaKHR flush to zero as Metal does; the native default announces the device's rounding first (float-tininess-after-rounding). The check is the compact form; its compile cost is recorded in docs/FAST-PATHS.md, and the check's own scaling multiply is NoContraction. Now Metal's: - A fetched 16-bit float blend's lone term takes Metal's zero under fast math (R16Float and RG16Float read alpha as 1). - A new Private Depth32Float or Depth32Float_Stencil8 target's NaN pattern is switched on at the pass that loads it; where the device's test is not Metal's it is announced (signed-depth-test), and a clamping device announces fresh-pattern-zeroed. - A render-target barrier from the fragment stage to an earlier stage orders the later passes' attachments. New notices for differences that were silent: unmeasured group speculation, an anisotropic sampler without mips (MoltenVK), a draw's attachment read in place, a sample level the device's arithmetic chooses (exact sampling off MoltenVK), and exact forms dropped to fit ANV's compiler. Crash and exit fixes: - ANV: a render pipeline whose largest stage passes 400,000 words under exact forms is retranslated with them dropped until it fits (ExactFormsOverCompilerLimit), instead of a SIGSEGV in Mesa's register allocator. - The exit hook sees a making that ends as it looks, and drains a CPU device's work at its first run only. Measurements: the commit hand-off cost on the Iris Xe; the M3 under macOS 27.0.1 places heap blocks and copies compressed textures as the M4 does. Tests fixed (heap-shadow fence, attachment-read routes, freed-memory thread, depth pattern per device class, the new kind's lane site) and the golden hashes, engine inventory and authored compile census blessed. Verified at d8546c940b (batch f7): RTX 5080, M3, Iris Xe, RX 7900 XTX and 780M green; lavapipe 3822/3822, product 4821/4821, CPU validation 1331/1331, fuzz, fmt, clippy (4 configurations), Rustdoc, packaging, qualification, refusals and the API reference check green; RTX 3090 7244/7245. Stress soaks of the runtime crate x2 clean on the 5080, XTX, 780M and Iris Xe. Known open: on the RTX 3090 an Exact checked OpFmaKHR can answer -0 where Metal answers +0 (the kernel's fast math declares no SignedZeroInfNanPreserve); the fix is in progress. Not yet run: consumer boots on this tree and the private-corpus translation census. |
||
|
|
29d3ebb22e |
Fix the consumer's first-move SIGBUS and deallocator fatal, restore the release door, announce the tessellator's triangle order
One commit of the 4 on development-fast (0175289314..c66863112e), squashed at the user's request:
the pin reims-vgpu tested clean.
Runtime:
- A texture's first move over host pages writes back only the bytes the move changed, and only
where the kernel says the process may write them (mach_vm_region on macOS, the maps query on
Linux). Before, it wrote back every kept byte: a SIGBUS on read-only pages on MoltenVK, and a
hang under QEMU, whose handler retried the store. A changed byte over pages the host cannot
write stays as the move left it, announced (unrestored-first-move-bytes; not observed on any
venue). WorkCounts::first_move_restored_bytes. HostMemory::new states the Linux contract that
imported pages stay writable.
- A no-copy buffer released while a submitted command buffer's live buffers' table lists its
pages runs its deallocator at the release when the caller gave a keep-alive, which keeps the
pages mapped until the import is freed. Only a release without one waits and announces
host-deallocator-delayed. Before, the keep-alive case was announced too, which the consumer
treats as fatal.
- Memory::free_then renamed release_then: it calls no Vulkan entry point, so the release door's
source scan holds again.
(RUNTIME_VERSION 1303.)
Translator: PrecisionNote::TessellationTriangleOrder, recorded on a pipeline drawn through the
device's tessellation stages where the tessellator is not Apple's
(DriverWorkaround::TessellatorNotMetals): a patch's triangle order, first corners and ring joins
are the device's. The emulation without tessellationShader draws Metal's order and records none.
(SEMANTICS 1740, ARTIFACT_FORMAT 420.)
Docs: API.md's catalogue, FAST-PATHS.md's known gaps, REFUSALS.md.
Verified on development-fast:
- the runtime crate and runtime_lane x3 on the RX 7900 XTX, Radeon 780M and RTX 3090 at
|
||
|
|
0175289314 |
Batch the development-fast round: tessellation without tessellationShader, primitive ids, mesh tooling, color groups, the vk12 floor, runtime timing and teardown fixes
One commit of the 247 on development-fast (720ef1ce9a..9f46fdf80d), squashed at the user's request. Translator: - Tessellation on a device without tessellationShader: Metal's tessellator emitted as SPIR-V, a one-workgroup scan placing each patch's triangles in Metal's order, and the post-tessellation function as a plain vertex stage (EmulatedTessellationDraws; SEMANTICS 1739, ARTIFACT_FORMAT 419). - [[primitive_id]] on a device without geometry or tessellation shaders, as a flat varying the vertex function writes; indexed lists, lines and points drawn de-indexed (RuntimeGap::PrimitiveIdIndices). - Fragment functions of more colors than the device draws at once, compiled in color groups (PrecisionNote::ColorAttachmentGroups). - Object functions' threadgroup memory from the render encoder; a kernel's mesh draws from an indirect command buffer; mesh payload sizing. - The Vulkan 1.2 floor profile (vk12-floor) and the gates it needs; Metal 27.0.1 answers as the M3 Max. - Overflow tests in the runtime-built modules by the product's high word (NVIDIA's compiler fails the division form), guarded crate-wide by tests::owned_divisions. Runtime: - Color-group passes replayed per group over twin depth/stencil; snapshot and copy-back cost cuts. - Command buffers finish on the queue waiter that saw them; the waiter holds no device handle, so a program's drop after its wait is the device's last. - Every object an encoder was handed held until its command buffer completes; deallocator order and announcements. - Driver defects recorded and announced: ANV counts a visibility sample once per color output (visibility-count-per-color); MoltenVK fails pending work when memory that held a device-address buffer is freed, so freed memory waits for the work in flight (host-deallocator-delayed). - RenderCommandEncoder::set_object_threadgroup_memory_length; Visibility::counting(). Validation: mesh tooling (object, mesh and ICB-mesh cases on both executors), the authoring census closed, the queue storm judged in Metal's unit, load-robust exits and indirect-census bounds, and the golden hashes, printouts, fixture inventory and authored compile census blessed. Docs: FAST-PATHS.md trimmed to a ledger of what is true now; API.md's catalogue and accepted differences, REFUSALS.md and METAL-COVERAGE.md current. Verified on development-fast before the squash: the full suites on the RTX 5080, RTX 3090, RX 7900 XTX, Radeon 780M, Iris Xe, lavapipe and the M3 (MoltenVK and the Metal oracle), lint in every configuration, rustdoc, doc tests, packaging and public case qualification; the timing and teardown lanes x5 on every venue; the authoring-capability census 16656/16656 with 0 unresolved, the vk12-floor translation census at 6139 translated with the slowest row 794 ms and peak 126 MiB. The tree is development-fast's at 9f46fdf80d. |
||
|
|
c05c380139 |
Match the M3 Max under macOS 27.0.1: measurements, profile, Metal rows and MoltenVK venue
The macOS 27 work packet: the M3 Max moved to macOS 27.0.1, where MoltenVK gives it the M4's deviceID. Its measurements, its MoltenVK profile, its Metal rows (now the C3 reference) and its MoltenVK venue rows are taken again, and the tests follow. Read Metal's NotMipmapped anisotropic footprint through MoltenVK at level 0: On macOS 27 Metal's anisotropic filter reads a sampler without a mip filter differently once its level clamp reaches 1/64: the runtime's NotMipmapped form (nearest mip, lod [0, 0.25]) handed MoltenVK an anisotropic footprint that was not Metal's NotMipmapped one, and the anisotropic lane failed on the M3 Max under macOS 27.0.1. Through Metal's own sampler (VkProperty::MetalSampler) with anisotropy and equal min and mag filters the sampler now clamps to [0, 0]: with equal filters the level has no filter left to choose, and Metal answers that sampler as NotMipmapped bit for bit. With filters that differ no clamp reads Metal's answer at maxAnisotropy 2 to 16; that stays a known gap in docs/FAST-PATHS.md. RUNTIME_VERSION moves (renumbered once for the composed batch): a run of an unchanged artifact samples differently. Verified: metal::sampler unit tests (24, including the new metals_own_anisotropic_sampler_reads_not_mipmapped_at_level_zero) at a release build; runtime_lane::anisotropic_filter::anisotropic_samples_answer_within_ their_bounds_of_metals passes on the M3 Max, macOS 27.0.1, MoltenVK 1.4.1 (it failed at the round's first composed tree and at |
||
|
|
dd5a19aea1 |
Alias a padded texture that only reads by default, the shadow behind PaddedReadsPolicy::Shadow
The padded-reads work packet (the owner's choice): a padded texture that is only read aliases the
buffer by default, under the same documented first-move gap as tight aliases, checked per driver;
the exact shadow stays behind PaddedReadsPolicy::Shadow, which exact_answers() selects.
What: a 2D texture (or array) over a buffer whose rows or slices lie with bytes between them, and
whose usage as Metal reports it holds no RenderTarget, ShaderWrite, ShaderAtomic or block writes
(Unknown reads as 0x17, so it stays a shadow; a swizzled texture reports ShaderRead |
PixelFormatView and reads), is now an image over the buffer's bytes at Metal's row pitch, as a
texture of packed rows is: the device's own linear image (PREINITIALIZED over ordinary memory, for
host allocations over a no-copy buffer), a DRM_FORMAT_MOD_LINEAR image at that pitch, or one over
a dma-buf of the pages. Its subresources may hold the bytes between its rows and its last row's
padding (to row_pitch x rows); a driver whose image reaches past that is refused as for packed rows
(lavapipe's height rounded up to 4). A render target or a texture a shader writes stays a shadow.
The rebind remakes the image under the same rule (AliasKind::Linear keeps it).
The switch: DevicePolicy.padded_reads, PaddedReadsPolicy::{Alias (default), Shadow};
DevicePolicy::exact_answers() selects Shadow, the runtime's shadow copied in before each use. It
is the runtime's alone: no ProfileFields carries it, so no profile fingerprint moves
(tests::fast_paths::the_runtime_s_padded_reads_choice_keys_no_profile) and SEMANTICS_VERSION
stays. The owner's ruling (relayed by reims-vgpu-orchestrator, 2026-10-14 15:55): "I'll take 1 &
2", (2) being this, "exact to the same standard as tight aliases", under 30c8b4bff8's first-move
known gap extended to the padding bytes, checked by the same per-driver lane check.
Why it is the same standard: the first move is the only layout transition a runtime image takes.
- Every image memory barrier the runtime records is a first move (texture/first_move.rs
FirstMove::barrier), a new image's own (storage_form.rs, host_copy.rs; never an alias), or a
caller-wrapped image's Transition (submit.rs via texture/wrapped.rs).
- The tracker's barriers are VkMemoryBarriers (tracker.rs Barrier::record), which transition no
layout.
- Blits into a texture copy in GENERAL: blit_texture.rs's vkCmdCopyBufferToImage and
vkCmdCopyImage. VUID-vkCmdCopyBufferToImage-dstImageLayout-01396 and
VUID-vkCmdCopyImage-dstImageLayout-01395 allow GENERAL; GENERAL "supports all types of device
access".
- "Each source region specified by pRegions is copied from the source buffer to the destination
region of the destination image". The Memory Model: "A memory operation must not affect memory
at a memory location not within its set of memory locations".
- Every descriptor names GENERAL (binding.rs, heap_sets.rs).
- A texture over a buffer has one level (linear_plan's MipmapLevelCount), so generate_mipmaps
leaves it, and optimize_contents_for_gpu_access records nothing.
- A texture without RenderTarget usage has no COLOR_ATTACHMENT usage. A pass renders it through a
stand-in, copied in GENERAL, so no load or store operation reaches its image.
How:
- linear_plan's padding() becomes holding(layout, usage, policy) -> Result<Holds, String>, with
Holds::{Texels, Padding}, Holds::fits (texels_alone, or the new padded_alone) and only_reads.
- aliases() takes the Holds. So do alias_image, dma_buf_alias_image (DmaBufTexels.alone),
host_alias_unbound, host_pitched_image, and the pointer and dma-buf rebinds.
- storage_over_buffer decides it once, from texture_usage (the effective usage), so the shadow's
reason no longer reads the raw descriptor's RenderTarget bit. The reason of a read-only texture
shadowed under the switch names PaddedReadsPolicy::Shadow.
- RUNTIME_VERSION 1211 (renumbered at compose); the runtime-sources pin is recomputed at this tree.
Docs:
- FAST-PATHS.md: a fast-defaults row (padded_reads = PaddedReadsPolicy::Alias/Shadow, ANV's 0.63
ms copy in per tile use and 135 vs 41 us making).
- FAST-PATHS.md: the padded-row shadow row now covers textures that render or that a shader
writes.
- FAST-PATHS.md: the first-move gap row now covers the bytes between rows, with the GENERAL anchors
in prose and the M3 Max probe's point (Metal never writes padding, even under concurrent CPU
writes).
- API.md's shadowed-texture entry, ShadowedTexture's rustdoc, HOWTO.md, interop.rs and dma_buf.rs.
- The refusal surface is unchanged (refusal_surface.py --check).
Verified so far:
- clippy -D warnings, all targets, all features, --cfg m2v_cpu_icd: clean (um780, Rust 1.98.1).
- cargo fmt --check: clean.
The unit and lane runs follow with the lane checks' commit.
Check per driver that a padded texture that only reads keeps every byte of its pages:
What: three lane tests in runtime_lane::pitched_surfaces, under PaddedReadsPolicy::Alias (the lane's
own devices take exact_answers, so Shadow), each over no-copy buffers of anonymous pages:
- a_texture_that_only_reads_keeps_every_byte_of_its_pages: a ShaderRead texture over each of the
11 layouts. Its first use is a fragment function's read through its image, before anything else
touches the pages: it must read the pages' texels, and every byte of the pages, the bytes between
the rows among them, must be unchanged. That is the image's first move, the known gap
|
||
|
|
3dd70970df |
Reach the execution status through a binding where the device addresses no buffer
The execution-status work packet: where the device addresses no buffer, the command buffer's status
words are reached through a binding the plan asks for (WriteSource::ExecutionStatus), bound by the
runtime and by both Vulkan executors, documented, with the refusal surface regenerated.
What: a stage that writes the command buffer's ExecutionStatus (an absent argument's read, a
seq_cst fence, an argument buffer's cubic-sampler test) reaches it by device address where the
device addresses buffers (bufferDeviceAddress and shaderInt64), as before, and elsewhere through
a set-0 storage buffer of its own: ResourceSlot { stage, Synthetic(ExecutionStatus), 0 }, a
storage word view the status words are written through. absent::state_status states the form;
the binding counts once in the stage's storage-buffer descriptors, so the per-stage limit check
in lower::select sees it. The ExecutionStatus fact's mechanism is SyntheticBinding on such a
device, PushConstant elsewhere. Profiles that address buffers produce the same modules as before.
Two needs, two answers past a limit (absent::StatusBinding):
- Required (an absent read, a fence): a stage past its storage-buffer limit with the binding is
refused as DescriptorCount, naming MaxPerStageDescriptorStorageBuffers.
- CubicMark (only the argument samplers' cubic test): absent::finish gives the binding back and
the stage states no cubic reach, as a fragment stage does. The mark is a may-need: only a cubic
sampler a command later lists in the argument buffer needs it, and that sampler then meets the
planner's typed refusal (SamplerBicubicFilter), so nothing is dropped silently. Refusing the
stage instead would refuse every stage near its limit that samples through an argument
buffer, cubic sampler or not, all of which compile today.
FunctionConstantArgument and SeqCstFence are now refused only where the stage lacks its stores
and atomics (a vertex or fragment stage without them), no longer for want of buffer addresses.
Why: on vk12-floor, vk12-bare, lunarg-desktop-baseline-2023, roadmap-2022 and swiftshader every
absent read and seq_cst fence was refused (on vk12-floor's census, 22 FunctionConstantArgument
and 9 SeqCstFence rows), though the device can write a storage buffer.
Tests: the absent-read, threadgroup, function-constant, seq_cst and atomics tests compile on
every profile and assert the status's reach per profile (testing::status_reach_on); a floor
interpreter run of device_fence_store binds the status by slot (word 0 is 42);
an_absent_reads_binding_counts_against_the_storage_buffer_limit (vk12-floor at its count less
one: DescriptorCount on MaxPerStageDescriptorStorageBuffers);
the_cubic_tests_binding_gives_way_to_the_storage_buffer_limit (lunarg, the limit lowered step by
step: the binding given back below the kernel's own count, every compile within the limit and
L3-valid); the kernel tests its argument samplers for a cubic filter on every heap profile.
Verified on msi-laptop (Linux, debug, LLVM 21) on this change with the binder, runtime and
validation commits that follow: clippy --workspace --all-targets --all-features -D warnings clean
by default, under --cfg m2v_cpu_icd and under --cfg m2v_gpu; rustdoc -D warnings clean; the
focused tests (engine_absent*, engine_seq_cst, engine_atomics, engine_dispatch, engine_handles,
engine_binder, engine_function_constant*, mechanism) 122/122; the metal2vulkan, air, runtime and
devtools suites 4592/4598, the 6 reds the table moves below.
Moves (blessed elsewhere, on macOS): public_fixture_expectations_engine.tsv, .ll rows, exactly 50
cells, 10 rows x the 5 profiles above, none on a profile that addresses buffers: 42 from
Unsupported{FunctionConstantArgument|SeqCstFence} to ok, and 8 to
NeedsInput{StorageTextureFormat} (absent_texture_reads_zero, fc_kernel_absent_resources,
fc_kernel_absent_sampler, fc_kernel_sampler_select on roadmap-2022 and vk12-bare: the next gate
there, which the refusal hid). golden_hashes.tsv: 104 cells, those 50 plus 54 hash changes, 18
argument-sampler rows (msf_runtime_samplers, tail_argument_samplers,
tail_argument_cube_gradient, unv_runtime_levels) on lunarg-desktop-baseline-2023, roadmap-2022
and swiftshader, which now test the cubic bit; no cell of a profile that addresses buffers.
Expected, not run here (metal-as needs macOS): the .air.ll rows of function_constant_interface
and rfs_absent_reads.
Plan the execution status's binding as WriteSource::ExecutionStatus:
What: a compute or render plan writes a stage's SyntheticBinding::ExecutionStatus binding as the
new WriteSource::ExecutionStatus: the command buffer's ExecutionStatus buffer, the one every
command of it writes, ExecutionStatus::BYTES bound. The bind module docs say how a command
reaches the status on each kind of device. WriteSource is #[non_exhaustive] and not encoded, so
neither the cache codec nor the api_surface table changes.
Why: the previous part binds the status on devices that address no buffer; the planner
refused such a binding as internal ("a compute binding ExecutionStatus").
Tests: a_seq_cst_fence_reaches_the_status_by_binding_or_address_as_the_device_allows runs
dispatch_builtins' device_fence_store through the binder harness on vk12-floor and
lunarg-desktop-baseline-2023 (one ExecutionStatus write, no status push hole) and moltenvk-m3
(the push hole, no write): each of the 24 threads increments StatusWord::SeqCstFences of the one
status (24), and the store after the fence lands (42).
Verified on msi-laptop (Linux, debug, LLVM 21) with the change's other commits: the test passes
among the 122 focused tests; clippy clean in the three cfgs; rustdoc -D warnings clean.
Bind the command buffer's status words where a plan asks for them:
What: the runtime's descriptor writer binds WriteSource::ExecutionStatus to the command buffer's
status words (command_buffer::State::status_words), the buffer whose address it pushes on a device
that addresses buffers, whole. The command buffer reads and reports it on completion as before.
Why: on a device that addresses no buffer a stage with an absent read, a seq_cst fence or an
argument-sampler cubic test now binds the status (the translator commit before); the runtime has
to bind the same buffer it reads.
Verified on msi-laptop (Linux, lavapipe, --cfg m2v_cpu_icd, debug) with the validation commit
that follows: runtime_lane::absent_reads, 3/3, on the device as it is (the status reached by
address), without shaderInt64 and restricted to vk12-floor by VK_LAYER_KHRONOS_profiles (both by
binding): each of rfs_absent_query, rfs_absent_read and rfs_absent_sampler reads zero at flag 1,
its command buffer completes with no error, and its status report states the absent read.
Bind the execution status in the Vulkan executors and prove the bound form on lavapipe:
What: the candidate executors (compute, its replays, render) hand plan_resources the status
buffer they already keep (Guest::status), and plan_resources binds WriteSource::ExecutionStatus
to it, ExecutionStatus::BYTES; device replay has none. runtime_lane::absent_reads checks, for
each of rfs_absent_query, rfs_absent_read and rfs_absent_sampler, the reach the executed pipeline
took (Ran's Reach: a SyntheticBinding::ExecutionStatus binding in its layout or the status
address in its push fields) at both flags, besides reading zero, the command buffer completing
and the report stating the absent read at flag 1. Three tests: the device as it is (address where
it addresses buffers, binding elsewhere), the device without shaderInt64 (binding), and the
device restricted to vk12-floor by VK_LAYER_KHRONOS_profiles (binding; it prints RESTRICTED and
skips visibly without the layer). device::lane_restriction (tests only) builds that restriction
for a committed profile stem, through the same restricting() runtime_restriction now uses.
Why: the translator now binds the status on devices that address no buffer; the executors must
bind it, and the evidence has to show the binding was the path that ran.
Verified on msi-laptop (Linux, lavapipe llvmpipe LLVM 23.1.1, --cfg m2v_cpu_icd, debug,
LP_NUM_THREADS=1): runtime_lane::absent_reads 3/3 with --no-capture: ABSENT-READ-COMPLETED
"reached Address" for the device as it is, "reached Binding" for the other two, RESTRICTED printed
for vk12-floor; clippy --workspace --all-targets --all-features -D warnings clean by default,
under --cfg m2v_cpu_icd and under --cfg m2v_gpu. The whole validation suites run after the
rebase onto the round.
Document the execution status's binding and regenerate the refusal surface:
What: docs/API.md section 5 says how a stage reaches the command buffer's ExecutionStatus (its
device address where the device addresses buffers, else a set-0 storage buffer of its own,
SyntheticBinding::ExecutionStatus, which counts against the stage's storage-buffer limits), and
what happens past a limit: an absent read or a fence is refused as DescriptorCount, and a stage
that would bind it only for the cubic test binds nothing, so the plan refuses a cubic sampler
listed beside it (SamplerBicubicFilter). Section 6's Status bullet says to bind the same status
buffer where a plan asks for WriteSource::ExecutionStatus. reach.tsv's SeqCstFence line now
reads "a seq_cst fence in a vertex or fragment stage without its stores and atomics".
docs/REFUSALS.md is regenerated at 43578ea93: FunctionConstantArgument and SeqCstFence no longer
list devices without buffer device addresses, and lose the sites that refused them; the rest of
the diff is the line moves since the table's last generation (f28f418da).
Verified on msi-laptop: scripts/refusal-surface/refusal_surface.py regenerates the table, then
--check and --missing-reach pass, at 43578ea93 with these docs.
Versions: SEMANTICS_VERSION 1696 -> 1698 and RUNTIME_VERSION 1203 -> 1204. SEMANTICS_VERSION moves:
absent reads and seq_cst fences compile where they were refused, and argument-sampler stages test
the cubic bit through the status. RUNTIME_VERSION moves: the status's binding is planned and bound.
ARTIFACT_FORMAT_VERSION stays: no encoded type or codec changed (WriteSource is not encoded;
SyntheticBinding::ExecutionStatus and Mechanism::SyntheticBinding already existed).
ENGINE_EXECUTOR_ABI stays: the executors bind WriteSource::ExecutionStatus only where a plan asks
for it, and no plan an earlier row recorded asks for it, so running those rows is unchanged.
crates/metal2vulkan-validation/runtime-sources.sha256 holds
d92b3692f9ec6dd09aa276901b3e5e2ca89520a9fe474835a57c7a22aeb4b85e, the hash of this tree's runtime
inputs (runtime-pin.py, which reproduces build.rs's). Version numbers quoted above are the values
the work's branch built with. Each part's Verified lines name the tree it ran at.
|
||
|
|
30c8b4bff8 |
Shadow a padded texture over a buffer exactly, and cut the shadow's cost
The padded-texture work packet. A texture over a buffer whose image would hold bytes that are not its texels is drawn through a shadow image with exact copies, since a render pass or a layout transition may write those bytes. Then the shadow's cost is cut, exactly: no copies for a pass that reaches no tile, a copy back bounded by the draws' scissors, and cost lines that show each part. Shadow a texture over a buffer whose image would hold bytes that are not its texels: A texture over a buffer is a linear (or DRM_FORMAT_MOD_LINEAR) image over the buffer's bytes only where every byte of the image's subresources is one of its texels: its rows lie one after another (or it has one), its slices likewise, and its last subresource ends at its texels' last byte or before. Anything else is the shadow, whose copies address the buffer's texels alone. The Metal texture over an MTLBuffer (MoltenVK) is exempt: every write through it is Metal's own. Why: Vulkan lets a render pass's load and store operations "read and write back any memory locations within the image subresource bound for that attachment" (renderpass.adoc, Load and Store Operations), and VkSubresourceLayout's size "includes any extra memory that is required based on rowPitch", so the bytes between padded rows lie inside the subresource. Metal leaves them as the program writes them. No query promises otherwise, so no image may alias padded rows. Bytes past every subresource stay allowed: Memory Aliasing bounds the bytes a write through an image affects to "those overlapped by the image subresources that were written". Measured on lavapipe (Mesa 26.2.4 llvmpipe, gem10) at the round's base: pitched_surfaces' 657x128/5312 RGBA16Float tile took lavapipe's own linear image (its pitch 660 texels rounded to 64 bytes is the lane's 5312), and a clear-blend-store pass rewrote 13 padding bytes in 13 rows (row 3 byte 5265 0x7c -> 0x7e: texels 657..659 of its 4-texel blocks read and written back, signaling NaNs quieted). The reliance predates |
||
|
|
07abdd4bd9 |
Fix the encoder review's findings: inherited thread hints, kept barrier lists, draw shapes
The encoder review's work packet: the handler threads' utilization floor no longer reaches the
threads they start, a draw state's used-resources shape is made once, a kept barrier list out of use
gives way to a new one, and a render state's helper threads start with the runtime's own.
Keep the handler threads' utilization floor out of the threads they start, and drop the dead QoS raise:
What: on Linux, exit_guard::run_at_user_interactive (the scheduler, the completion thread, each
VkQueue's waiter, the handler pool) now reads its own attributes with sched_getattr(2) and calls
sched_setattr(2) with the policy it read, without SCHED_FLAG_KEEP_POLICY, and with
SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_KEEP_PARAMS | SCHED_FLAG_UTIL_CLAMP_MIN, sched_util_min 1024.
The struct is exit_guard::SchedAttr, mutable across the call (a kernel whose struct is shorter writes
its size back before E2BIG), with SAFETY comments that say so. On macOS, raise_quality_of_service is
deleted, with its calls in exit_guard::spawn and spawn_scoped. Docs: spawn, spawn_user_interactive,
the Linux comment (the reset's effect on real-time policy and negative nice, the setting a handler
cannot clear, and the host-wide uclamp accounting the first call turns on until reboot), and the
public Handler, add_scheduled_handler and add_completed_handler (the handler threads'
user-interactive class on macOS, the floor on Linux, and that neither carries into a thread a
handler starts).
Why:
- With KEEP_POLICY the kernel keeps the thread's reset-on-fork setting and ignores RESET_ON_FORK
(__sched_setscheduler: policy < 0), so uclamp_fork gave every thread a boosted thread starts the
1024 floor for its life: the pipeline reaper a pipeline state's last release starts on a handler
thread (Program::drop -> PieceHolds::close -> Reaper::start), the notices thread, pool and
compile threads a program's call in a handler starts, a program's own thread made in a handler.
The policy is passed back as read, so SCHED_OTHER, SCHED_BATCH and SCHED_IDLE (a session
ananicy-cpp moved to SCHED_IDLE) stay as found; KEEP_PARAMS keeps nice, priority and slice.
- raise_quality_of_service never acted. A thread made by pthread_create with no QoS class in its
attributes starts at QOS_CLASS_DEFAULT (<sys/qos.h> line 83), std::thread sets only the stack size
(pthread_attr_init + pthread_attr_setstacksize), and every runtime thread runs it first thing on
such a thread, so its utility-or-background test never held. Its doc said a new thread takes its
creator's class, which is false. Under a process-wide clamp a new thread still reads DEFAULT and a
request for DEFAULT changes neither its class nor its priority, so it could not help there either.
Probe on this Mac (M3 Max, macOS 27.0.1 26A434, cc and rustc 1.98.1), a C program creating
threads with pthread_attr_init + setstacksize from creators at background, utility, default,
user-initiated and user-interactive, each new thread reading pthread_get_qos_class_np and
thread_info's pth_curpri/pth_priority/pth_maxpriority, then calling
pthread_set_qos_class_self_np(DEFAULT) and reading again:
plain: every new thread 0x15 (DEFAULT), pri 31/31/63, unchanged after
taskpolicy -c utility: every new thread 0x15, pri 20/20/20, unchanged after
taskpolicy -c background: every new thread 0x15, pri 4/4/4, unchanged after
taskpolicy -c maintenance: every new thread 0x15, pri 4/4/4, unchanged after
taskpolicy -b: every new thread 0x15, pri 4/4/4, unchanged after
taskpolicy -t 5 -l 5: every new thread 0x15, pri 31/31/63, unchanged after
taskpolicy -b -t 5 -l 5: every new thread 0x15, pri 4/4/4, unchanged after
and a Rust probe (std::thread::Builder::spawn from creators at each class, reading
qos_class_self): 0x15 from every creator, plain, under taskpolicy -c background and under
taskpolicy -b. The core of the C probe:
static void *child(void *start) {
qos_class_t c, after; int r;
pthread_get_qos_class_np(pthread_self(), &c, &r);
int before = pri(); /* thread_info(THREAD_EXTENDED_INFO) pth_curpri, pth_priority, pth_maxpriority */
int set = pthread_set_qos_class_self_np(QOS_CLASS_DEFAULT, 0);
pthread_get_qos_class_np(pthread_self(), &after, &r);
printf("creator %#x: new thread %#x pri %d; set DEFAULT rc %d -> %#x pri %d\n", ...);
}
for each start class: pthread_set_qos_class_self_np(start, 0); pthread_attr_init(&a);
pthread_attr_setstacksize(&a, 1 << 20); pthread_create(&t, &a, child, ...); pthread_join(t, 0);
- The handler threads' class and floor differ from a plain thread's, which the public items did
not say (AGENTS.md: name what differs from Metal).
Tests:
- tests::exit_guard::the_threads_that_take_command_buffers_to_their_handlers_run_with_the_
utilization_floor (new, Linux): from creator threads at SCHED_OTHER, SCHED_BATCH and SCHED_IDLE
(each it may enter; SCHED_IDLE required), the scheduler, completion, both waiters and two
handler-pool threads read their own sched_getattr: floor 1024, reset-on-fork set, the creator's
policy and nice; a thread each starts through exit_guard::spawn reads floor 0, no reset, the same
policy and nice. On a kernel that refuses the floor it expects none and that the kernel refuses
one the test asks for itself.
- tests::exit_guard::a_runtime_thread_starts_at_the_default_quality_of_service_whoever_started_it
(macOS, rewritten from a_runtime_thread_runs_at_no_lower_quality_of_service_than_the_default): a
plain and a runtime thread from a creator at each class both read DEFAULT. The user-interactive
test now expects the reaper at DEFAULT.
RUNTIME_VERSION stays: no run's results change. The runtime-sources pin moves in this branch's last
commit (on fleet/base this tree hashed to 3ef35b8d...).
Verified on homelab-um780 (Ryzen 7 7840HS, Linux 7.0.0-38-generic, CONFIG_UCLAMP_TASK=y, Rust
1.98.1, release, RUSTFLAGS='-Dwarnings --cfg m2v_cpu_icd'): cargo nextest run -p
metal2vulkan-runtime -E 'test(/exit_guard::/)': 30 of 30 passed; the new Linux test entered all
three policies (nice 5) and read floor 1024 on the six threads, 0 on their children. With the old
flags (KEEP_POLICY, no RESET_ON_FORK) restored it fails: a boosted thread reads reset false. The validation pin test passed with
3ef35b8d... on fleet/base. The macOS tests are not run here (routed to the Mac).
Make a draw state's used-resources shape once when finding its bind shape among the kept ones:
What: BindState::position_of_shape(shapes) answers where among `shapes` the state's shape is (the
first of which has_shape answers true), making the shape of the resources the state lists at most
once for all of them, and only where a shape's every other field matches; has_shape compares the
used resources last, after every field it compares in place. GraphicsState::kept_shape finds a
draw's shape among its state's latest settles through it. docs/API.md names it beside has_shape.
The crate's test allocator (constant_blob_footprint.rs) also counts allocations
(allocations_during).
Why: kept_shape called has_shape once per kept settle (up to four), under the settles' lock, and
each call made the used-resources map again where the state lists used resources (useResource:,
argument-buffer programs): up to four maps a draw where one does.
Test: tests::bind_shape_of::a_state_s_shape_is_found_among_many_with_its_used_resources_made_once:
a state listing 16 used resources against four shapes equal in every other field, its own last:
position_of_shape allocates as much as one has_shape, and has_shape one by one four times that; a
state listing none, or of another field, makes nothing.
Let a kept barrier list out of use give way to a new one:
What: once a VkQueue keeps LISTS (8) lists of barrier command buffers, a new list replaces the one
taken least lately among those no batch took in the last STALE (256) values of the queue's timeline
and whose command buffers all completed; that list's command buffers become spares, which later
recordings take before allocating. The kept pool is made with RESET_COMMAND_BUFFER, so a spare's
begin resets it. Lists all in use in turn replace none, as before. The choice is
QueueKept::take (Take::Kept, Take::Record, Take::Past), apart from the Vulkan calls in
KeptBarriers::take.
Why: the first 8 distinct lists a queue met kept their places for the device's life, so where a
program's first batches (uploads, first moves) filled them, every later per-frame list was recorded
by its batch, a command buffer begun per batch, for good: the work
|
||
|
|
0307fb8c9d |
Run every Linux CI step in the gate's container, and fix what the gate caught
The Linux gate's work packet: CI's Linux steps now run in the gate's own container, and the failures that run found are fixed: depth and stencil formats over a DRM_FORMAT_MOD_LINEAR image, test IR that LLVM 21 rejects, and a frame-cost check that allocated. Run every Linux step of ci.yml in the Linux gate's container: What: scripts/linux-gate-ci gains the three steps ci.yml's Linux job runs and it did not: "Clippy under each feature alone" (metal2vulkan with no feature and with serde, ash and cli each alone; metal2vulkan-runtime; metal2vulkan-air with no feature and with serde), "Build the new API's consumer reference" (scripts/api-docs) and "Package the published crates". Its "Test metal2vulkan" step now tests the packages ci.yml's does (metal2vulkan, -air, -runtime and -devtools), where it tested metal2vulkan alone. The steps run in ci.yml's order, each with the container's build share. Why: the script's header says every Linux run: step of ci.yml has one step here, and docs/VALIDATION.md presents the container as ci.yml's Linux job; a change that broke only a feature-alone build, the reference, packaging, or the AIR front end's, runtime's or dev tools' tests passed the container and failed CI. Verified: bash -n; the steps compared one by one with ci.yml at |
||
|
|
1cf79a9617 |
Make textures over surface buffers cheaper, laid at Metal's row pitch where drivers allow
A shadow of a texture over a buffer starts as the buffer's memory lies, instead of zeros that the copy-in then overwrites, and a format's linear-modifier features are asked of the driver once. A no-copy texture is laid at Metal's row pitch as a linear image over the buffer wherever the driver takes that explicit pitch, and a driver's refusal is remembered per exact image (up to 256). The lanes check textures at a browser's padded row pitches and say which pitches each driver takes. RUNTIME_VERSION 1186. Gain: a surface texture's shadow on ANV 1048 -> 135 us, RADV 484 -> 90 us. With the pitched images, every padded surface aliases on ANV with no shadow: a tile 1048 -> 41 us. Verified on the original branches: the runtime lanes on RADV, ANV and NVIDIA. Known open: pitched_surfaces::a_half_float_tile_reads_writes_and_renders_as_metal fails on lavapipe (a clear-blend-store pass writes a few padding bytes past the row), as it did on the original branch. This squashed commit was not re-tested on its own. |
||
|
|
2f3c6174f6 |
Keep a buffer's bytes under a texture a pass stores DontCare
A pass that does not store a color whose texture lies over a buffer now renders it into an image the texture keeps (a Load copies the buffer's texels in first; nothing is copied back), so the buffer keeps its bytes, as Metal does: measured on an M3 Max, every DontCare case kept the buffer's bytes, with or without a barrier between draws. On MoltenVK a pass that Metal receives whole keeps using Metal's own DontCare at no cost; only split or restarted passes use the kept image. New performance notice `dont-care-stand-in`, a `kept_bytes_passes` work count, a frame-cost shape whose layers are textures over buffers, and the cost recorded in docs/FAST-PATHS.md. RUNTIME_VERSION 1185. Gain: correct bytes where the old form wrote rendered or cleared texels into the buffer. Cost on ANV: a Load + DontCare pass about 10 us more; Clear + DontCare frames got cheaper (12.33 -> 11.18 ms). Verified on the original branch: the four focused lane modules, 35 of 35 on RADV, an RTX 3090, lavapipe and ANV, and its MoltenVK lanes on the M3 Max. This squashed commit was not re-tested on its own. |
||
|
|
bd21b102f5 |
Cut a draw's and a pass open's allocations
Compare a draw's graphics key in place, keep a drawing state's routing for the pass colors it last met, write descriptors from the stack and allocate the set in place, keep a draw's small lists on the stack, hold what a draw retains by reference in one entry per encoder, find a draw's bind shape among its state's settles, fill push bytes in place, bound coverage without allocating, gather named keys only once a draw reaches the resident set, compare viewport compensations as they come, list argument samplers again only where the device's changed, and keep each pass shape's compatible render pass on the device (up to 64 shapes). The frame-cost lane bounds a draw at 27 allocations and a pass open at 14. Gain: allocations per draw from 67.5 to 24.5 and per pass open from 18 to 13 on RADV, ANV and lavapipe. Frame CPU on ANV (Iris Xe), clean rounds: 5.66 -> 5.02 ms. Verified on the original branch: the runtime lanes, 1313 of 1313 on RADV, ANV and lavapipe. This squashed commit (with the wake fix under it) was not re-tested on its own. |
||
|
|
4b564766ec |
Sample extended-range textures through Metal's bicubic filter
A sample of a BGR10_XR, BGRA10_XR or RGB10A8_2P_XR10 texture (or an sRGB twin) through a constexpr bicubic sampler, or through a runtime sampler whose bound word states Cubic, was refused (NotImplemented(SamplerBicubicFilter) in the lowering, NotImplemented(Format) in the binder). It is now Metal's bicubic filter of the decoded texels, measured on an Apple M3 Max (macOS 26.7) through the owned fixture xr_bicubic: random codes of each of the six formats at 16x16, 7x5, 3x3, 2x6 and 1x1, 2,304 coordinates each (every texel's centre, then random ones up to 0.15 of the texture past its edges), through 12 kernels (a runtime Cubic sampler with float and half results; constexpr samplers under clamp to edge with float and half results, repeat, mirrored repeat, clamp to zero, the opaque-white and opaque-black borders, pixel coordinates, and an offset under clamp to edge and repeat): 3,317,760 lanes. What Metal does, and what the lowering now does: the footprint, weights, addressing, a mirrored axis and a level below four texels are the other formats' bicubic filter's, each tap the decoded texel or the border texel through the format's channels; a level below four texels sums as the extended-range linear filter (terms truncated); otherwise each tap's step is weighed by the product of Metal's weights and summed exactly (no term truncated, unlike the linear filter), the step rounded half up, clamped into the steps of the codes 0 and 1023 (a color lane's (0-384)/510 and (1023-384)/510, an sRGB twin's table steps, alpha [0, 1]), and divided by the grid exactly; a half result rounds as the linear filter's does. The clamp is applied to the rounded result, which equals clamping the step because each rounding is monotonic. Every lane but 4,050 matches that model; each of the 4,050 is one step from Metal's (1/8160 a color lane, 1/8192 an sRGB color lane, 1/4080 alpha), its exact sum within 0.014 of a step of a rounding tie that Metal rounds the other way. No model of Metal's datapath tried closes that residue, so the sample records PrecisionNote::BicubicFilterArithmetic, and docs/FAST-PATHS.md and docs/API.md say so. A bfloat or padded form's bicubic sample, a swizzled texture's and a gather through a bicubic sampler were not measured and are refused. How: select_extended takes the bicubic state of a constexpr sampler or of the slot's cubic-sampler variant (LoweringInputs::cubic_samplers) and plans Metal's bicubic filter; the extended sampler emits it through bicubic::filter with Texels::Extended, which fetches each tap's raw texel and decodes it, through the exact routines alone, then clamps. The binder takes a cubic word at an extended-range slot as the cubic-sampler variant's, and gives such a slot the neutral BicubicTexels value in the plan of the pipeline as compiled, which binds the neutral there (it refused the format before naming the variant: the device lane found that). SEMANTICS_VERSION 1693; RUNTIME_VERSION 1184, as a run of an existing artifact with a cubic sampler at an extended-range slot is no longer refused; the runtime-sources hash re-pinned. The table: xr_bicubic.tsv (2,067 samples of the probe's, per texture and kernel the middle texel's centre, four random coordinates, the first sample with a lane at a clamp bound and the first with a lane at a tie), shared through metal2vulkan_devtools::xr_bicubic with the probe's texture generator. Verified on homelab-gem10 (debug builds): - tests::engine_extended_range::bicubic, on the CPU interpreter on the lavapipe and MoltenVK-M3 profiles: every lane of the table through the same 12 kernels, compiled under the six forms' variants (the runtime ones under the cubic-sampler word the binder plans), is Metal's bits but the 136 lanes the table marks, each one step away; each compile validates and its estimate bounds it. A padded or bfloat form's bicubic sample, a swizzled texture's and a gather are refused as above (a two-plane gather as Format, under any sampler); on every committed profile the pipeline as compiled plans the variants with the XR texture and a Cubic sampler bound, and the variant's pipeline plans the same key. - runtime_lane::extended_range_bicubic (new): the 8,268 lanes on the Radeon 780M (RADV), the RTX 3090 and lavapipe, textures written as the probe wrote them: 0 differ from Metal (136 at a tie, one step away), and the state announces bicubic-filter-arithmetic. The extended_range_samples, two_plane_samples and two_plane_copies lanes, whose helpers this shares, pass on all three. - Release build, 12 kernels x 6 forms x 5 profiles (lavapipe, 780M, RTX 5080 Laptop, Arc ANV, MoltenVK-M3): 360 translations, mean 1.31 ms, slowest 1.97 ms (xrb_runtime, BGRA10_XR sRGB, 780M), budget ledger peak at most 935 KiB, process peak RSS 15.6 MB; the linear XR kernels take 0.81 ms on average. - clippy -D warnings (workspace, all features, all targets; validation also under m2v_gpu), rustdoc -D warnings and the doctests pass. Suites: metal2vulkan, -air, -runtime and -devtools 4,566 of 4,567, validation 1,293 of 1,293. The one failure is tests::golden_hashes, whose 380 stale cells are the two new fixtures' alone (smw_writers 7 and xr_bicubic 12 entries x 20 profiles), left to be blessed on development. |
||
|
|
11715e2a3f |
Import no-copy memory a driver refuses from the caller's dma-bufs
RADV imports host pointers through amdgpu userptr with ANONONLY, so it refuses MAP_SHARED memfd pages (QEMU's memory-backend-memfd guest RAM and views of it): every no-copy buffer, heap and rebind over them was refused, and a macOS guest could not boot on AMD. NVIDIA imports the same pages. What: - The five no-copy entry points (new_buffer_with_bytes_no_copy, both new_heap_with_bytes_no_copy calls, Buffer and Heap rebind_bytes_no_copy) take a HostMemory; HostMemory::with_dma_buf adds a retained DmaBufSource. - Where the pointer import is refused, and only there, on any device that lists VK_KHR_external_memory_fd and VK_EXT_external_memory_dma_buf, the runtime asks the source for dma-bufs of the window's pages (chunks cut at the device's sparse granule, sized by the caller within udmabuf's default limits) and binds one buffer over them: plain for one chunk, sparse for several (vkQueueBindSparse signalling queue 0's timeline; later work waits on it, no host wait). Every path that imported before is unchanged. - Textures over such pages get a dedicated DRM_FORMAT_MOD_LINEAR image import of their own pages where the driver takes the plane offset and row pitch (multiples of 256 on RADV), with 64-bit modifier features; elsewhere, or on a source error, the existing shadow path. - The extensions are enabled outside the compile profile: no device's enable set, fingerprint or ARTIFACT_FORMAT_VERSION changes. The translator crate is unchanged. - Imports free inside exit-guard sections; the source is never called with a runtime lock held. WorkCounts gains dma_buf_imports, dma_buf_sparse_buffers, dma_buf_images and dma_buf_image_fallbacks. Verified: - Product suites 4553/4553, validation suite 1289/1289, clippy in every configuration, rustdoc -D warnings, scripts/api-docs. - runtime_lane::dma_buf_imports and rebinds on RADV Mesa 26.2.4 (validation layer clean), the RTX 3090 and lavapipe (pointer imported, source never called), and dma_buf_imports on RADV Mesa 26.0.8. - reims-vgpu on the Radeon 780M (RADV 26.0.8, udmabuf at its defaults): a macOS 26 guest cold-boots to the desktop and runs Safari; 5,119 dma-buf requests, none refused. - 64 MiB on RADV 26.2.4, release: pointer import 187 us; one chunk 665 us; 16 chunks 16.9 ms, about half of it the refused pointer attempt. The old host-fence bind waited 1.26 s behind queue-0 work on RADV 26.0.8. |
||
|
|
13b279df1b |
Squash 11203 commits of translator, runtime, and validation work
Rolls up everything since
|