2ef8af3abe5b9d3e347cb53fcc83393455e8a0bb
339
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
97afeae593 |
Kept room: the runtime's own buffers' pools first, the exportable ones only while they lie there
keep_room kept room in every kept pool in the order Buffers, FdBuffers, Images, whatever kind of block the runtime's own buffers took. On a device near its count of allocations the plain Buffers pool's block spent the last allocation the program's buffer, placed in the FdBuffers pool once the device's in-place verdicts were known, then needed: tests::host_ram_device::the_ahead_thread_leaves_the_allocation_limit_to_the_objects made no buffer (Vulkan -10) on RADV PHOENIX at 97f92139dd, where the base made one. Device::keep_room now asks which kind the runtime's own buffers take (Memory::own_buffers of Device::fd_blocks_taken, the verdicts as fd_blocks_checked reads them, counting nothing and starting no check), and keep_room keeps that kind's pools first and the FdBuffers pools only when that kind is FdBuffers. The FAST-PATHS row on exportable blocks says so. Verification: the failing test and the runtime gpucfg suite on RADV PHOENIX follow. (cherry picked from commit 916073fc374888e44f203e7f1c00abbf55497af5) |
||
|
|
33f1fecac1 |
fd blocks: a buffer's making starts no in-place check
The full runtime gpucfg suite on PHOENIX at e03275c440 (job 11224, release) had 16 failures in completion_here, draw_again, host_residency, teardown_threads, waiter_submits and pointer_residency. The fd set itself passed 3/3. The failing tests count device-wide state (recorded commands, host-import residency, threads at teardown, completions). With this branch the first buffer a device made asked fd_blocks_checked, which went through in_place_verdict and started the in-place check in the background wherever its verdicts were pending: on every program's first run on a driver, and in every test with a fresh shader cache. The check's own buffers, imports and command buffers then ran among the program's, as tests::recycle showed exactly (472 vs 490-505 recycled under load). fd_blocks_checked now reads the verdicts without starting the check. The runtime's own buffers lie in exportable blocks once the verdicts are known: from the check's record as the device is made, or once a check that a texture over host pages or Device::settle_in_place_checks started has answered. Until then they lie in plain blocks, counted fd_blocks_awaited, as before. The recycle tests' settle (3297613ce2's) is removed: it would now start a check the tests have no use for. Docs: - in_place.rs, memory.rs, WorkCounts::fd_blocks_awaited and the bench's arm doc say who starts the check. - The FAST-PATHS Private row drops the unsettled-runtime numbers (taken while a buffer started the check): until the verdicts are known the blocks are plain, as the base's. The settled numbers stand. Verification is pending: the full suite at this tip and at development, side by side on PHOENIX. (cherry picked from commit 289b04fae4ce20bed3b2ebe92e6b693e7d4a8e0b) |
||
|
|
cd3676b4f3 |
FAST-PATHS: the Private row's runtime numbers at the split
From the bench at 73312dc63e on gem10 (RADV PHOENIX, '1002:15bf!', job 10985), two runs of each runtime arm against the base binary: base 13/12 turnarounds of 8 ms or more quiet and 103/17 fragmented (slowest 40.4/49.0 ms, 350/311 ms of kernel-lock wait); tip fresh 1/1 quiet (3 plain blocks made while the first check was pending) and 0/0 fragmented (21/24 ms waited); tip settled 0/0 in both phases (4/10 ms waited). Verified: docs only. (cherry picked from commit e5816df55531a25ec0730d82e962f87e9cc17f52) |
||
|
|
829a68129b |
FAST-PATHS: the Private row names the split by padding, the first turnaround and what stays plain
The heading and body say buffers that declare their padding unobserved keep plain blocks and why (a DRM_FORMAT_MOD_LINEAR image over exportable memory needs a dedicated allocation on RADV); the made-before arm's 57.0 ms first turnaround against 2.4 to 8.1 ms with 64 exportable blocks held (reclaim-10514/10615); what still makes plain blocks (WorkCounts::plain_buffer_blocks_made) and the second pool's held block; the planes over an unobserved buffer take the conversion image as before. The RUNTIME_ARMS placeholder is gone; the runtime arms' numbers follow once the bench at the split has run. Verified: docs only. (cherry picked from commit 3619d8e8783039e8568afc4c0e75fb9b943bfd76) |
||
|
|
5e020e43bd |
fd blocks: buffers that declare their padding unobserved stay in plain blocks
A texture over a buffer whose rows lie apart is in place only where the buffer declares its padding unobserved, and there, over a plain block, it may take a DRM_FORMAT_MOD_LINEAR image at Metal's pitch, which RADV makes for exportable memory only as a dedicated allocation. The placement test at b48d8fae41 counted 15276 such textures lost over exportable blocks for padding-unobserved buffers and 0 for padding-kept ones. So the split: - BufferDescriptor's padding_unobserved reaches the placement (Made, buffer_of_length, NewBufferOf::Unobserved): such a buffer lies in a plain block (Holds::Buffers) wherever; every other buffer of the runtime's buffer path lies where the device's own buffers do. - The recycler's BufferMaking keys on the block kind, so a parked buffer in an exportable block is never handed to a padding-unobserved one. - fd_blocks_cover's second guard asks what a padding-kept texture can take: rows one after another at a multiple of 16 bytes where the device's own linear image lies otherwise, at every width of linear_alignment::WIDTHS, every backed format and usage; any DRM_FORMAT_MOD_LINEAR image of its own memory made there refuses the blocks. The linear layout comparison runs at every width too. - WorkCounts::plain_buffer_blocks_made counts plain blocks of buffers, beside fd_buffer_blocks_made, so a lane can read the share of block makes on each side; the bench prints it. - The placement test tries rows rounded to 16 too, makes the program's buffer through new_buffer_with_descriptor for each padding, asserts where it lies, and asserts 0 lost for both kinds. The nv12 test checks a padding-unobserved picture lies in a plain block while a parked exportable one of its making exists. - Docs: memory.rs, in_place_check.rs, the FAST-PATHS in-place row, the descriptor field and the runtime README. Verified: cargo fmt only; builds and device tests are dispatched next. (cherry picked from commit 6e5c80ac3caaa2ad26c0456ecfc0801bca4ccd42) |
||
|
|
005a54ea8d |
fd blocks: opaque fd only, every image there the device's linear image, behind a cover check
RADV PHOENIX asks a dedicated allocation of a DRM_FORMAT_MOD_LINEAR image made for an opaque fd or a dma-buf (requiresDedicatedAllocation=1 for formats 9/16/37/44/64/97, m3-max-10880), and its image format query takes a dma-buf for no linear-tiling image: the dma-buf blocks of 6798cf39a2 held no texture at all (all 1824 in-place layouts of the placement test lost, m3-max-10884), and the FdBlocks check made nothing. The one image such a block can hold there is the device's linear image made for an opaque fd, and over a plain block's buffer no texture took a DRM_FORMAT_MOD_LINEAR image at Metal's pitch (0 of 1824 over 20736 layouts): the driver takes no explicit pitch but its own. So the blocks are exportable as an opaque fd again (FD_BLOCKS_HANDLE), every texture over such a buffer the linear image made for it, gated on the FdBlocks first-move verdict, and no pitched image there. Guards, from documented queries and made-and-released images, never a driver name: - memory::fd_image_types, at device assembly: per memory type of the system heap, kept where a 64x4 linear image made for an opaque fd (R8, RG8, RGBA8, RGBA16F; format query exportable and not dedicated-only first) takes it wherever the plain linear image does, and not asking a dedicated allocation; the memory log names the kept types and why the others stay plain. - Device::fd_blocks_cover (texture/fd_blocks_cover.rs), in the check's FdBlocks class: for every backed pixel format and the read, write and render usages, the opaque-fd linear image wherever the plain one is made, laid out the same (pitch, offset, size, alignment, types); and no DRM_FORMAT_MOD_LINEAR image of the device's own memory at a pitch other than its linear image's (probed at +256 and twice it). Else the class is unmade (lasting, so recorded), fd_blocks_take refuses, and the memory log says why. Removed: the dma-buf block path, Device::modifier_takes_linear, the probe-then-DRM linear slot, pooled_pitched_image's class parameter. CHECK_VERSION 16. Verified: nothing yet. (cherry picked from commit 0b59a1700f0911b1024f83ed3be30f99fb5e23d8) |
||
|
|
cb6c971456 |
fd blocks: dma-buf only, every image there a DRM_FORMAT_MOD_LINEAR one
The validation layer on RADV PHOENIX reported VUID-VkExportMemoryAllocateInfo-handleTypes-09860 at every bind of a linear-tiling image into a block allocated exportable as opaque fd and dma-buf (32 reports over three exported_textures tests, m3-max-10768): the handle types of an allocation must be supported for the resources in it, and RADV's image format query takes a dma-buf for no image of linear tiling (ERROR_FORMAT_NOT_SUPPORTED for formats 9, 16, 37, 44, 64, 97), while it takes an opaque fd for a DRM_FORMAT_MOD_LINEAR image only from a dedicated allocation (VUID-VkMemoryAllocateInfo-pNext-00639). No dual-handle block holds either image kind validly. So the blocks are dma-buf only (FD_BLOCKS_HANDLE), taken where the device exports a pooled dma-buf for both buffer usages and enables VK_EXT_image_drm_format_modifier. Every image there is a DRM_FORMAT_MOD_LINEAR one naming that handle type: where the device's linear image (made to be measured, never bound) lies on Metal's layout, one of that layout, gated as before on the FdBlocks first-move verdict for the texture's row ends and free of the pitched cost bound, as base's linear form is; else the pitched path at Metal's pitch under the FdBlocks verdicts. Both count as pooled pitched images. fd_blocks_take is unchanged. CHECK_VERSION 15, as the class's images changed. FdExport::compatible and Memory::fd_handles are gone. Verified: nothing yet; built on gem10 next. (cherry picked from commit 2b4919bd9e54635c7192b425bb740d9a77f57ec7) |
||
|
|
ecfe8dc225 |
reclaim bench: a 16 MiB system-heap arm, for the image pools' growth blocks
Verified: not yet built. (cherry picked from commit 5a97a25ce536f91d5d95840dd1d1afef1a66111c) |
||
|
|
6962de9cdc |
FAST-PATHS: the NVIDIA exit fault's known gap as the gap and its bound alone
A known gap states what is true now and one bound; the evidence stays here. A correction to d35c43feaf's message: the exit hunt stopped on the orchestrator's call, not the owner's word. The evidence behind the line (NVIDIA 615.71.09, RTX 5080 Laptop GPU, Linux): - exitcap-162601 (probe 7f851ced8c): 1 of 94 runtime children, each making a device on libtest's test thread and returning with it kept live, took SIGSEGV after their test passed. The faulting thread was an NVIDIA worker (libnvidia-eglcore into libnvidia-glvkspirv+0x363b2, address 0x18) named after the ended test thread, while the main thread ran libEGL_nvidia's exit handler (an ioctl in libnvidia-glsi). The runtime's 30-odd threads were all waiting, none in a section of the exit guard or a making. A consumer saw the same fault twice in a suite of about 1900 tests, in a test that keeps its device in a static. - nvexit, a Vulkan program without the runtime (an instance, the NVIDIA device, one compute pipeline, a return from main), beside the same 14-minute load of the runtime's device suite: 1550 runs, 0 faults. 1028 destroyed everything first (507 + 262 on the main thread, 259 on a thread joined before the return); 522 kept the device live (263 made on the main thread, 259 on a joined thread, whose two driver workers named after it still ran at the return). (cherry picked from commit be87171f9ecb74c3b695ceb9501cc4435144728f) |
||
|
|
31cef63d20 |
FAST-PATHS known gaps: NVIDIA's SIGSEGV in the exit of a process whose device is live
The exit hunt stops here, on the owner's word, with the cause not found. What is known:
- exitcap-162601 (probe 7f851ced8c): 1 of 94 runtime children took SIGSEGV after their test passed
with the device kept live. In the core the fault is in an NVIDIA worker (eglcore into
libnvidia-glvkspirv+0x363b2, address 0x18) named after the ended test thread, while the main
thread ran libEGL_nvidia's exit handler (an ioctl in glsi). The runtime's 30-odd threads were
all waiting, none in a section or a making.
- nvexit, a Vulkan program without the runtime (instance, NVIDIA device, one compute pipeline,
return from main), beside the same 14-minute load of the runtime's device suite:
- exitcrash-nvexit-201854: 507 with everything destroyed on the main thread, 0 faults;
- exitcrash-nvexit-203651: 262 destroyed and 263 kept live, on the main thread, 0 faults;
- exitcrash-nvexit-thread-230656: 259 destroyed and 259 kept live, made on a thread joined
before the return, whose driver workers (named after it) still ran at the return, 0 faults.
The line goes where a user of the runtime reads open gaps.
(cherry picked from commit 5c6971ade39abb0ec1a92ad1c2a8fe80e112951e)
|
||
|
|
051de6ce39 |
submit_stalls: the driver's stall is told by the thread's CPU time in the call, not its length
The 5080's submit_stalls_idle test failed in round 064's rt2 beside the runtime's device suite (idle_submits 0, submit_stalls_idle 0, submit_stalls_on_work 20) after passing alone. A probe of the queue's place (STALLPROBE counts and events, probe branch steelbrain/exitcrash-stallprobe 1227ec7423, entry exitcrash-stallprobe-225855) reproduced it 3 of 3 beside the suite and passed 2 of 2 alone: - The driver's stalls came every 1024 counted calls (calls 760 and 1784 in every run) and spent 1998 to 3880 us of the calling thread's CPU, within 0.5% of their length. - Beside the suite, 25 to 29 other calls a run took 1.3 to 40.8 ms but spent 8 to 884 us of CPU: waits. Each, taken as the stall while the place was unconfirmed, moved the place off the stalls (the second stall came 354 to 551 calls after the last wait), so no stall was ever due at an idle (idles_due 0) and every one fell on work. - The submit checks' uncounted uses forgot the place 114 times a run, alone and beside the suite, all within the device's first ~120 calls, before its first stall: not the cause. So a call is the driver's stall only where its thread spent STALL_NANOS of CPU in it (CLOCK_THREAD_CPUTIME_ID read before and after each timed signalling call, on a device whose driver has DriverFact::SignallingSubmitsStallEvery1024 alone; elsewhere nothing more is read and a call's length counts as before). The fact's own doc already names the cost as the submitting thread's CPU. Tests: calls_that_wait_long_beside_other_work_are_no_stall models the failing run (a wait of 1.5 ms every 250 to 410 calls, 15 in 5000): taken by length it gives the failure's counts exactly (20 on work, 0 idle, 0 empty); by CPU, 1 on work and every later stall idle. a_long_call_short_of_a_stall_is_none now also holds a 10 ms wait with under 1 ms of CPU to no stall. The device test's doc states its calls on the 5080 (about two periods, its batches merged), not five. FAST-PATHS' row says what a stall is. (cherry picked from commit 5c8295ac235da7492861bc255e7d53874bfaaac7) |
||
|
|
8bd103fc8e |
Record RADV's extrapolated perspective reads at a sample or offset as the device's answer
On the Radeon 780M (RADV, Mesa 26.2.6) runtime_lane::pull_model_interpolation read 1700 values off Metal's, up to about 1.0 in lane 3. The lowered pm_offset is straight-line code (a uniform offset, its move and clamp, InterpolateAtOffset per input), so no control flow is at fault. Every miss is a perspective input's read at a sample or an offset; the no-perspective inputs' same reads were Metal's. A model with the lane's own geometry gives the driver's form: the pixel center's value extrapolated along the quad's coarse derivatives, f(center) + (f(tr) - f(tl)) * dx + (f(bl) - f(tl)) * dy. It reproduced all 52 one-sample offset misses within 0.004 and all 1061 four-sample sample and sample_id misses within 0.005, where the fine-derivative form was up to 0.98 off. Metal's value plus that form's error (first-order less exact) matched each of RADV's within 0.2 of the lane's device bound. Vulkan states no precision for interpolation, so under rule 1 the device's interpolation is the answer: no form computes it otherwise. The fix records it. - DriverWorkaround::PerspectiveReadsExtrapolated, a measured row keyed on RADV (driver_facts::DEFECTS, no vendor), as InterpolationNeedsTheWholeQuad is. - PrecisionNote::ExtrapolatedInterpolation (extrapolated-interpolation). stage_io::plan records it structurally: an interpolant with the perspective qualifier read at a sample or an offset, or a perspective sample-qualified varying a looping function reads at each pass's sample (InterpolateAtSample), on a profile with that fact. A no-perspective read, the pixel-center form (offset 0), a center or centroid read and an absent interpolant record nothing. - The pull-model lane: on such a device each perspective lane read at a sample or an offset is held to the device bound of Metal's value plus the extrapolation's error, computed from the lane's geometry (extrapolation_error), and the pipelines that read so, and those alone, must record the note. - The engine tests over every committed profile assert the note where the RADV profile reads a perspective interpolant at a sample or offset, and nowhere else: pm_linear, a new fixture function reading the no-perspective interpolant alone at a sample and an offset, must not record it. The coverage-loop test asserts it for the looped perspective varyings on RADV. - docs/API.md's device-interpolation entry and docs/FAST-PATHS.md's row no longer cover RADV's sample and offset reads with the 1.5e-4 figure. The new entry and row state the form and the measured size. - SEMANTICS_VERSION 2000 (the RADV profile's pull-model and looping modules gain a note), ARTIFACT_FORMAT_VERSION 497 (the codec gains the note), api_signatures blessed. The refusal surface regenerated with no change. The fixture's AIR companions for pm_linear come in the next commit, from the regen script on the M3. The golden tables and the air_input snapshot are re-blessed on development. (cherry picked from commit f4eb92a9bc4c099f9020fde2c2da40580514ec20) |
||
|
|
ad451a5334 |
Scheduler: a held group never waits behind another queue's submission handlers
What. A pass that ends with batches held for one kernel submission keeps them held while their
VkQueue runs two or more earlier submissions (Group::keeps). It now sends them instead where a
submission handler the thread runs once its passes end (scheduler::round) is of a command
buffer of another logical queue (Metal command queue) than a batch held:
scheduler::holds_back_another_queue, over the round's handler list and the batches held with
their logical queues. The handlers of the held batches' own queue still keep the group held.
CommandBufferShared::logical_queue reads a command buffer's queue identity for it.
Why. A submission handler runs on the scheduler thread, and a held batch's handlers run as it
is held, before its group goes to the driver. Where two command queues share one VkQueue on a
driver that merges, a batch of one queue held and kept behind running work, and a batch of the
other queue with a handler that waits for the first one's completion joined the group: the
group stayed held until the handler returned, so the handler waited for work its own return let
go (the deallocator lane test on the Iris Xe hit it once, its handler waiting 60 s). Metal does
not do that: on an M3 Max under macOS 27.0.1 (probe cross_queue_handler_waits), a command
buffer's completed handler reached another queue's scheduled or completed handler that waited for
it in each of 30 runs, 7.6 to 9.3 ms after the wait began, b committed before a included. On one
queue it never did (the 5 s bound in each of 10 runs): Metal runs one queue's handlers one at a
time, so the runtime keeps the group there and promises nothing more than Metal.
Cost: a group mixing two queues' batches is no longer kept past a pass in which a submission
handler of one of them runs; it goes then, the batch that joined last included, in one
submission. Measured on a lane (frame_costs_over_imports, the guest's shape) in the runs that
verify this commit.
Docs: group.rs ("Kept while its queue runs earlier work", Group::keeps),
CommandBuffer::add_submission_handler ("Keep it short"), the runtime README's handler entry,
and FAST-PATHS.md's grouped-submission row.
Verified: cargo fmt. Build, clippy and runs (the previous commit's test, without and with this
change; the deallocator lane test as it was) are potluck jobs on the Iris Xe and the XTX.
(cherry picked from commit 8d04b2d15d3cb745363428fdc9acbbb9ca2eb868)
(cherry picked from commit 2cbd8a970905d931b7be39c92fbdd18d6024f62a)
|
||
|
|
de5a77cc06 |
Wide lines: no device's own lines are taken as Metal's parallelogram
RADV fails wide_lines_draw_metal_s_parallelograms and its exact-answers twin at the lane's "scattered lines width 2.5, fragments" map, 628 pixels where Metal's has 622: on the Radeon RX 7900 XTX (homelab-gem10-1, m3-max-10724) and on the 780M (homelab-um870-1, its only GPU, m3-max-10773), at this branch's base and at development alike. The runtime took RADV's lines as Metal's there, unannounced: RADV is the one driver of the committed profiles stating non-strict parallelogram lines (strictLines unset, nonStrictWideLinesUseParallelogram set), and 2.5 lies on its 1/8 granularity above 1, so the route was the device's lines under both policies. Cause, measured: a probe on the XTX (m3-max-10800, a scratch branch, never merged) drew each of the 48 scattered lines alone and printed its pixels. 21 of them lie a row or a column off Metal's parallelogram at an end: one more past the first vertex, one fewer before the last. A model of Metal's rule (endpoints on the 1/256 subpixel grid, the parallelogram whose minor-axis edges are w' long through them, the ends not extended, pixel centres by the top-left rule) reproduces Metal's map pixel for pixel; the XTX's ends fit no constant shift of it. Vulkan leaves where a non-strict wide line's ends fall to the implementation, and no driver is measured to place them as Metal does. Change: the device route has no exact form any more (render/line_width.rs route). Every draw the device's own lines take is announced device-wide-lines, the notice naming "parallelograms, whose ends and endpoints' snap the driver places as it draws them" where the width is on the grid above 1, and under WideLinePolicy::Exact (exact_answers) the band draws it wherever the device has tessellationShader. On RADV, widths above 1 on the 1/8 grid move from silent device lines to announced device lines under the default, and to the band under exact answers. No other profile changes route: lavapipe and NVIDIA (strict) and ANV (not stated as parallelograms) were announced already. Tests: the runtime's route table reads A or B where it read E for the three RADV profiles (Cell:: Exact removed). The validation lane drops LineFacts::draws_as_metal, and asserts per case that the draws of the device's own lines announce device-wide-lines one for one, which fails without this change on RADV (width 2.5 drawn by the device's lines with no notice); the edges test asserts the notice at each device-line draw. Docs: render/line_width.rs's module docs, DeviceWideLines' rustdoc and docs/API.md's entry and policy text, WideLinePolicy's and DevicePolicy::wide_lines' docs, the runtime README's route table (its "exactly Metal's" row folded into the announced one), docs/FAST-PATHS.md's row (no device's lines are taken as Metal's; the cost adds a row or a column at an end), docs/RUNTIME-PORTING.md's SetLineWidth row. The announced cost string is unchanged. Notices: one device-wide-lines per device (once per kind, unless announce_each names it) on a RADV run that draws wide lines only at widths above 1 on the 1/8 grid, where it announced nothing; a run that already drew a width below 1 or off the grid announced it already. Needs the runtime-sources pin and a RUNTIME_VERSION (the orchestrator's numbers). Verified: cargo fmt. The XTX, 780M, lavapipe and M3 runs follow through potluck. (cherry picked from commit be88ae03f199d5a485abcc546d0d52b181290e7b) |
||
|
|
81abe49dad |
Attached reads of the levels before the attached one read the texture's own image
A draw's sampled slot of a texture its render pass instance renders at level k (counted from the texture's own first level) took the texture's usage shadow, a whole copy of every level, even where its reads reach only levels before k. Such a slot now binds the texture's own image through a view of its levels 0..k, the same first level, so an explicit level of detail selects the same level, and names those levels in its uses (`binding::NarrowedSlots`): no copy is taken for it. The copy would hold the same texels: nothing the instance does writes those levels where the texture is an image of its own the bind reads in place (not sparse, no decoded twin, the sampled usage), no attachment of the instance is at them, no earlier draw wrote them since the instance's last barrier (a draw after one records into a new instance), and no write of the draw's own meets them (else every narrowed slot of the draw takes its copy, its uses made again). Which levels a read reaches is the translator's fact (`StageModule::level_reads`) through the samplers the draw binds: level-count and level-of-detail queries, computed fetch levels and samples without a sampler-bounded level keep the copy. A draw rebound works its narrowed slots out again and is rebound only where they are its kept draw's; a draw again binds as its kept draw did. WorkCounts: attached_read_slots_below becomes attached_read_slots_apart (the own image cannot serve them), attached_read_slots_written (something writes those levels) and attached_read_slots_narrowed. Verified: cargo fmt only; the build, clippy, a device test of an explicit read of level k - 1 while level k is attached and the touched suites follow as potluck jobs. (cherry picked from commit 7ba814a2e2f419643c2f9e68b9768709658cbe94) |
||
|
|
e67c617756 |
Visibility past an early-tests mask: announced where the device may count after the mask
runtime_lane::sample_coverage::the_sample_coverage_applies_after_the_fragment_function fails on
the Iris Xe (ANV, RPL-P) at its three early-tests draws: a full-screen draw of coverage 0.3
under psc_early counts 0 of 256 samples at 1 sample, 80 of 512 at 2 and 140 of 1024 at 4
(iris-B at
|
||
|
|
12f7267750 |
Depth comparisons record RestrictedDepthRange on every device without VK_EXT_depth_range_unrestricted, MoltenVK included
Without the extension Vulkan gives a depth image no value outside [0, 1]: a copy may take none (VUID-vkCmdCopyBufferToImage-pRegions-07931), and a render write is clamped to the viewport's depth range. MoltenVK's driver was measured to keep such values (DriverFact::DepthImageKeepsValuesOutsideUnitRange), and its depth comparisons required that property in place of the note; the owner's rule is never to rely on undocumented Vulkan behaviour, so the fact follows the extension and nothing else. With the extension a comparison records nothing already, so the fact, the VkProperty::DepthImageKeepsValuesOutsideUnitRange it derived and the texture plan's kept_depth_range are removed: depth_comparison records RestrictedDepthRange wherever the extension is not enabled (ANV, RADV, MoltenVK), a precision note, logged and never fatal. SEMANTICS_VERSION 1995: MoltenVK's comparing stages record the note and no longer require the property. The codec drops the variant by name (no format bump: a removed variant's tag stays unused). docs/API.md's restricted-depth-range entry, FAST-PATHS rows 79 and 80, the note's and the measurement table's docs, engine_depth_range's test (the note on MoltenVK too, no module requiring the extension), driver_facts' MoltenVK row and api_signatures (three variants) follow. The compare-clamp lane predicts restricted-depth-range by the extension alone again. Verification follows in the lane jobs; the golden tables and the authored compile census are re-blessed on development. (cherry picked from commit 90d231de945294c8428c05f79946f09bbb426819) |
||
|
|
afb53192f7 |
Depth uploads clamp on every device without VK_EXT_depth_range_unrestricted, MoltenVK included
Vulkan takes no copied depth outside [0, 1] without the extension (VUID-vkCmdCopyBufferToImage-pRegions-07931), and a driver measured to keep one (DriverFact::DepthImageKeepsValuesOutsideUnitRange, MoltenVK's) does not make the copy valid: the owner's rule is never to rely on undocumented Vulkan behaviour. MoltenVK 1.4.2 does not expose the extension, so ImageFacts::depth_clamps is now the extension's absence alone: MoltenVK's uploads (replace_region, blits from buffers, copies from colour textures, a heap's tiled copy in) clamp as ANV's do and announce restricted-depth-upload. The fact stays for the translator's depth comparisons (lower/texture/slot.rs depth_comparison, through VkProperty::DepthImageKeepsValuesOutsideUnitRange) and for the validation executor's own raw copies (candidate/platform/compute.rs). The lanes follow the rule (degrade_notices::clamps_depth_uploads, the heap lanes, texture_blits::depth_images_keep_what_their_drivers_claim, which checks the clamp where the device lacks the extension, and buffer_depth_samples). The combined-format blit lane counts apart the GPU-assisted check's reports at offsets off a depth's 4 bytes: layer 1.4.363 reads a D32_SFLOAT_S8_UINT depth aspect's buffer at 5 bytes a texel, where the spec lays it out as D32_SFLOAT's. Verification: Iris, lavapipe and the M3 lanes follow in their jobs. (cherry picked from commit 6dfbc9c0dd0b4b3690ce2824d16fb561afc51047) |
||
|
|
460a608d1b |
Depth uploads clamp into [0, 1] on devices that take no other: replace_region, blits from buffers, copies from colour textures
On a device without VK_EXT_depth_range_unrestricted whose driver is not measured to keep a depth outside [0, 1] (ImageFacts::depth_clamps, ANV on the Iris Xe), a copy into a D32_SFLOAT or D32_SFLOAT_S8_UINT depth plane took Metal's bytes as they are, which breaks VUID-vkCmdCopyBufferToImage-pRegions-07931 for any value outside [0, 1]. The heap's tiled copy-in already clamped (TiledLevelMove:: clamps_depth); every other upload now goes through the same clamp, on the bits: a NaN of either sign 1.0, -0.0 kept, other negatives 0, above 1.0 (+inf too) 1.0, the rest as they are, no denormal flushed. - Translator: bind::clamped_depth (the CPU rule) and bind::depth_clamp_module (DepthClampModule), an in-place clamp over a buffer's words in the extended-canonical kernel's shape (first, width, row and image pitches). The tiled kernel's clamp now shares the module's SPIR-V helper. - Runtime, depth_clamp.rs: clamps_depth (one test of format, aspect and device facts, which heap_tiled now uses too), the CPU clamp of packed bytes, and BlitCommandEncoder::clamp_depths / clamped_depth_copies: one dispatch a region (split into images or rows past the device's storage range or workgroup counts), each its own command so the tracker orders it between the copies. - replace_region clamps the packed bytes on the CPU before any route (a host copy, the staging queue, a submission), so no depth image holds a value outside [0, 1] that a later copy of its texels moves on. - A blit from a buffer into such a depth copies the regions' bytes into a scratch buffer, clamps them and copies from there; a plan that stages its rows clamps its staging buffer in place; a copy from a colour texture through the encoder's scratch clamps the scratch before the copy into the depth. - WorkCounts::depth_uploads_clamped counts each clamp. - restricted-depth-upload stays announced where it was; its doc, the replace_region message, docs/API.md, the blit and replace_region docs and the FAST-PATHS device-gap row say the upload clamps. - MoltenVK (DepthImageKeepsValuesOutsideUnitRange) and devices with the extension are untouched. Lanes, runtime_lane::depth_upload_clamps, under the validation layer's GPU-assisted buffer-copy check: replace_region, a blit from a buffer (as it is, through its plan's staging at an offset of 2, and into Depth32Float_Stencil8's depth) and a copy from an R32Float texture, each checking no VUID-07931, the clamp counted, and each texel read back clamped (or as written where the device keeps it). The heap lane now shares the lanes' device and message checks. Unit tests: the clamp rule, the kernel under the interpreter, the region splitting, the CPU clamp. api_signatures blessed (+16), api_surface table updated; REFUSALS.md unchanged on regeneration. Verified: not yet (Iris, lavapipe and Linux clippy are queued). (cherry picked from commit a63c3646dd5e3fad8b24e387c4adb0f94d635ac9) |
||
|
|
99453e91d8 |
Images bound over exported memory name its handle type; a check class per export handle
A texture over an exportable buffer (exported_memory.rs) was a PREINITIALIZED linear
image, or a DRM_FORMAT_MOD_LINEAR one, with no VkExternalMemoryImageCreateInfo, bound in
memory allocated with VkExportMemoryAllocateInfo: VUID-vkBindImageMemory-memory-02728
("it must include at least one of the handles set in
VkExternalMemoryImageCreateInfo::handleTypes"). RADV and NVIDIA tolerate it; the layer
does not.
What changed:
- memory.rs: Memory::bound_memory reads a placement's own record (the block's export,
import, own pages or read-only view, a guest RAM chunk's handle, a dma-buf import) and
answers the handle type an image bound there names: none for memory of no export, the
export's handle for a shared exported block, HOST_ALLOCATION or DMA_BUF for imports, and
no image for a buffer's dedicated allocation (VUID-vkBindImageMemory-memory-10926) or the
caller's memory. Buffer::bound_memory answers it for a buffer (a heap buffer's, its heap's).
- texture.rs alias_unbound decides the image from that record, not the route: over exported
memory the device's linear image made for the handle type (external_linear_image, the
former host_linear_image generalized), else the DRM_FORMAT_MOD_LINEAR one made for it
(ModifierMemory::Exported). Either is made UNDEFINED (VUID-VkImageCreateInfo-pNext-01443),
so its first move may discard the bytes, which only the device's check may vouch for.
- in_place.rs: two check classes, PagesClass::ExportedFd and ExportedDmaBuf. Their buffer
is an exportable Shared buffer of that handle type in a shared block; their textures take
the product's image. A texture over exported memory takes its image where the policy and
those verdicts pass for its accesses; before them it is a CheckPending shadow that moves
in place at the next quiet commit, as over the pooled memory (storage_form.rs now moves
any class over the runtime's own memory). No LinearCost bound there: another API writes
those bytes.
- The image format query (VkPhysicalDeviceExternalImageFormatInfo) must answer the handle
type exportable (importable for imports) without DEDICATED_ONLY, for the linear and the
DRM_FORMAT_MOD_LINEAR image alike; else the texture is a shadow, its notice naming the
query's refusal. A dedicated allocation keeps the shadow, its notice naming 10926.
- ycbcr_planes.rs: the two-plane image is PREINITIALIZED with no handle type, so it takes
only memory whose record says no export or import (KeptTexels::Memory elsewhere).
- in_place::CHECK_VERSION 12 -> 13: the record holds two more classes, so every driver's
check runs once more.
Checked and unchanged: heap.rs's images (heaps are never exported; over host pages they are
HOST_ALLOCATION images, over a copy in device memory a shadow or an Own linear image), the
in-place images over host pages and copies (HOST_ALLOCATION over imports, Own over device
copies), and the runtime's own images in Holds::Images/Buffers blocks.
The placement rule (in_place.rs, "The runtime's exported memory"): per texture (per plane),
the texels' offset in the memory (the buffer's first byte, or its aligned_byte, at a
multiple of 256 there, plus the texture's offset) must be a multiple of
VkMemoryRequirements::alignment from vkGetImageMemoryRequirements for the image made for the
handle type of the texture's format, extent and usage; vkGetImageSubresourceLayout of its
first subresource must answer offset 0 and Metal's rowPitch; its size must stay inside the
buffer. The linear image first, then the DRM_FORMAT_MOD_LINEAR one with its own alignment.
Test: tests/exported_textures.rs, an NV12 picture's R8 3840x2160 and RG8 1920x1080 planes at
32 and 8294432 of an exportable buffer laid with aligned_byte(32), opaque fd and dma-buf,
Private and Shared, under the validation layer: a shadow first, both moved in place after
settle_in_place_checks, readback equal, in place at once after, no layer message.
dma_buf_export settles the checks before its plane textures. Not yet run: this commit is
for the build and the device runs.
(cherry picked from commit 40872fbb4748cbd228c06c27dc0cd63ca2d0a5ec)
|
||
|
|
ee3f269fa3 |
Heap depth textures: the copy in clamps a 32-bit float depth into [0, 1] where the device takes no other
A heap's 32-bit float depth texture whose shadow copies the heap's bytes into its image went through vkCmdCopyBufferToImage with whatever float the bytes held. On a device without VK_EXT_depth_range_unrestricted that is invalid usage for a value outside [0, 1] (VUID-vkCmdCopyBufferToImage-pRegions-07931); ANV stored it clamped, and the runtime only announced it (restricted-depth-upload). The tiled texel kernel (metal2vulkan::bind) now clamps a level's elements on the way into the tight buffer where the level says so: - TiledLevelMove::clamps_depth, set with TiledLevelMove::clamping_depth; - the shape's level record grows to 14 words; - the clamp compares the word's bits, so no denormal is flushed: a negative value becomes 0.0, one above 1.0 (and +inf) becomes 1.0, a NaN of either sign becomes 1.0 (as nan_clear.rs clears a NaN depth), and -0.0 and every value inside [0, 1] keep their bits; - the move back is unchanged. HeapTiledCopies::new takes the image's format and marks the 4-byte depth planes' levels of a D32_SFLOAT or D32_SFLOAT_S8_UINT image where ImageFacts::depth_clamps holds: exactly where restricted-depth-upload is announced. MoltenVK, whose driver is measured to keep such values (DriverFact::DepthImageKeepsValuesOutsideUnitRange), keeps its copies as they were. The clamp is the device's own answer, so the notice stays and its text now says the copy in clamps. Tests: - bind::tiled_texels::tests::clamped_depths_move_into_the_image_inside_0_1, run through the CPU interpreter; - lane heap_textures::a_heap_depth_texture_s_copy_in_takes_no_depth_outside_0_1, which turns on the layer's GPU-assisted buffer-copy check (gpuav_buffer_copies), asserts no VUID-07931 message, and checks a blit reads the clamped values where the device clamps, else the bytes as they are. Docs: - the restricted-depth-upload declaration, docs/API.md's catalogue and its docs/FAST-PATHS.md device-gap row say the copy in clamps; - docs/FAST-PATHS.md's known gaps gain one entry: a heap texture Metal keeps uncompressed lies in its driver's layout where its image fits Metal's answer (heap-texture-untiled-layout); - api_signatures.tsv is blessed for the two new public items. Verification in the tip report. (cherry picked from commit de683c02ce08d337e8281dd752c2519f863bbe39) |
||
|
|
dae9923446 |
Heap refit docs: which textures an image in place serves, and what the shadows of Metal's tiles cost
HeapTextureHostTransfer and HeapTextureLinear (and docs/API.md's catalogue) say the refit takes an image of host-transfer usage only for a texture Metal compresses or whose layout is not modelled, and of one Metal keeps uncompressed only a linear image whose every element lies where Metal's tiles place it. docs/FAST-PATHS.md's costs record the shadow of Metal's tiles kept for every other such texture, with the 1x1 shadow's GPU time measured on the Iris Xe at RUNTIME_VERSION 1909 (35.9 us against 8.1 us a frame); the compositor's 3x3 to 10x10 shapes are not measured apart. (cherry picked from commit dc30f3c6c8768ab3780bad861bba9db1ad9f4b84) |
||
|
|
ec94c62dce |
heap depth textures: a merge's keep holds the heap's bytes, not the image's
A 2-slice Depth32Float 64x64 x2 multisample texture in a Shared placement heap on ANV (Iris Xe, RPL-P, Mesa 26.2.6) lost the samples a blit wrote into one slice: 16384 of 16384 were off Metal's tiles after the merge back, while a read straight from the image matched. The heap's bytes held 0xee before the blit. The copy in hands the image 0xeeeeeeee, a float outside [0, 1], which Vulkan leaves undefined in a depth image without VK_EXT_depth_range_unrestricted, and ANV stores 0.0. The merge's keep was moved out of the image (only drivers announced drawn-depth-copy kept the heap's bytes), so it held 0.0, and the merge kept the heap's 0xee in every byte of a written sample that equals 0.0's: a probe found 9155 0xee bytes left in the slice, the 9134 zero bytes of the samples plus 21 sample bytes that are 0xee, and no sample whole. Now a heap's tiled texture with a depth aspect, of any sample count, keeps the heap's bytes: the staging buffer its copy in filled where the keep follows it (WorkCounts::shadow_keeps_from_staging), else the heap's bytes themselves, and plans no moves out of the image for the keep. Every byte a command wrote is merged whatever the copy in changed; a value the copy in changed in a texel no command wrote is written back as stored, as a copy back writes it. That clamp is the device's: a heap's 32-bit float depth texture whose shadow copies the heap's bytes into its image now announces restricted-depth-upload as it is made, on a device without VK_EXT_depth_range_unrestricted whose driver is not measured to keep such a value (ANV; not MoltenVK, NVIDIA or lavapipe with the extension). Its declaration, docs/API.md's catalogue and a device-gap row in docs/FAST-PATHS.md say so. The measured drawn-depth-copy flag a multisample texture held for its keep is gone with its one reader; the announcement at making stays. heap_multisample_textures_keep_their_samples_in_metal_s_tiles now also checks, for each counted 32-bit float depth texture, restricted-depth-upload as it is made where the device clamps, and that a blit into one slice or aspect keeps from staging. Verification in the tip report. (cherry picked from commit 688e1dcc00ff67979833fdcbaf2f5484057e18a6) |
||
|
|
e106dbf2c7 |
FAST-PATHS: the 780M's later clips at one budget for its heaps made no allocation and took 122 and 119 ms
m3-max-9499 at 9bc836c2e9 on um790's Radeon 780M alone (RADV PHOENIX, MESA_VK_DEVICE_SELECT 1002:15bf!): tests::clip_bursts' later clips made 0 and 0 allocations (16 in the first) in 121.5 and 119.2 ms, against 4 each and 237/245 ms with the placements in the system heap and a budget per heap, and 132/126 ms with them device-local. The bullet said the unified budget keeps every block; it now carries the measurement. (cherry picked from commit f2e2063f1ff7050d7eeefd6ecdc26ace0c4bc29c) |
||
|
|
6be762136b |
Memory: with unified memory the heaps keep one budget of empty blocks
With the UMA placement, a Radeon 780M's Private placements take its 5.53 GiB system heap, whose eighth (707 MiB) kept all but 3 of a video clip's 16 blocks: each later clip made 4 again (tests::clip_bursts, m3-max-9454: [4, 4]) and took 237/245 ms to make against 132/126 ms with the placements device-local (m3-max-9448). With unified memory every heap is the same memory: the budget is now an eighth of all the heaps, at most KEPT_EMPTY_BYTES, and the empty blocks of every heap count against it, so the 780M keeps 2 GiB as one budget where it kept 707 MiB and 1414 MiB apart (2.1 GiB in all). Devices without unified memory keep a budget per heap as before. Tests: tests::memory::unified_memory_keeps_one_budget_for_its_heaps (the 780M's heaps, a discrete card's, one heap). FAST-PATHS: the kept-memory row's 780M figures, and the UMA row's clip-burst cost. Verified: not yet run; lavapipe and the 780M follow as potluck jobs. (cherry picked from commit 9bc836c2e9cac4b43b86380e4c53ee3a02133214) |
||
|
|
40a634d351 |
FAST-PATHS: unified memory's Private placements in the system heap first, and what they cost
The 780M runs before and after the placement (m3-max-9103 at the base, m3-max-9157 at the change, um790, RADV PHOENIX): copies of 256 MiB at 23.9/28.8 GB/s device-local against 28.5/29.0 GB/s in the system heap's type; a 259-tile scroll beside 1 GiB of another allocation's local memory at median frames 1.31/1.29 ms before and 1.87/1.30 ms after (frames 300 and 600), alone 2.87/4.87 ms before and 1.33/1.31 ms after; no amdgpu_bo_move eviction traced in either. Recorded under the costs of matching Metal: no cost measured, no switch, not announced. (cherry picked from commit 3d1f49072ca66c9976835da4df54773f50a7f283) |
||
|
|
8e1383b1b6 |
In-place check: an unchecked verdict whose cause lasts is kept; one that may pass is checked again
The previous commit kept every unchecked verdict out of the record, so a driver that truly lacks what a class needs (an extension, a feature, an import, a format or an image of the shape, such as lavapipe's DmaBuf and Pooled rows-in-lines, which RuntimeDriverDefect:: ExplicitPlaneRowsPastHeight refuses) would be checked again by every device. Such a cause is fixed for the driver's identity, as stable as a passed or failed verdict, so it is kept; only an unchecked verdict from a cause that can change between runs is kept unmeasured and checked again. - in_place_check::Unmade: the reason the check made no pages, pass or image, and whether its cause lasts. ClassPages::make, ExportedPages::make and Round::NotMade carry it. Lasting: no host import (VK_EXT_external_memory_host), no dma-buf images, export only as a dedicated allocation, no host-visible coherent type, no DRM_FORMAT_MOD_LINEAR images, and a placement answer the image's making decides before it binds (Refused Rows, Image, Pitch, Placement, DmaBuf; another route of the shape), and an error that is the device's gap or Metal's refusal (Error::Unsupported, Error::Invalid). May pass: pages, memory or mappings not made, an export failing, a no-copy buffer copied or imported otherwise on a device that imports host memory, an answer in place that only the bind refused (the dma-buf's import), detached or sourceless pages, the writer thread not started, a first move, pass or kernel's stores failing, the kernel's buffers refused, any other error (out of memory, a lost device, a Vulkan failure, the runtime's own gap). - check_class answers, by row ends, whether an unchecked verdict met a cause that may pass; run writes those verdicts pending in the record and the rest as given. encode writes the verdicts as given; decode reads every verdict byte (unchecked among them). - Notes say which cause it was, "(a cause that lasts, kept)" or "(a cause that may pass, checked again)": the first of each kind per class and access. - CHECK_VERSION stays 12 (the bump the previous commit made, not landed): a record of 11 may hold unchecked verdicts whose cause may pass, which no device takes now. - Tests: an_unchecked_verdict_is_checked_again_where_its_cause_may_pass_and_kept_where_it_lasts (device test, replacing the previous one: the pointer class's failed import is noted as a cause that may pass and checked again by the next device; every measured verdict is recalled, each unchecked one recalled unchecked or checked again; on a driver with ExplicitPlaneRowsPastHeight the DmaBuf reads of rows inside lines are recalled unchecked). The record round trip holds passed, failed, unchecked and pending verdicts. The in-place textures lane's record test takes measured <= recalled <= VERDICTS. narrow_writes_device and freed_memory read only the report's verdict lines, not the notes after them (20 narrow lines counted where 16 were due on lavapipe, job 9303). - Docs: in_place.rs, in_place_check.rs, WorkCounts::in_place_checks_recalled, settle_in_place_checks, docs/API.md, docs/FAST-PATHS.md (the in-place row). Verified: cargo fmt; builds and tests run as potluck jobs after this commit. (cherry picked from commit b420f97f56237fc0bf153691e9ac7e5a8e923386) |
||
|
|
aa188702ad |
In-place check: an unchecked verdict is no measurement, kept unmeasured and checked again
On the Iris Xe (ANV) reims' arm-s boots made 890 shadows over guest RAM imported as dma-bufs,
every one "the device's check made no image over host pages imported as dma-bufs" (Unchecked),
small ShaderRead textures at offset 0 on whole pages among them, where a fresh check of the
same driver passes the class's reads (
|
||
|
|
a3fb1283e6 |
FAST-PATHS: the first clip's allocations stay open, with their cause and why no block is made ahead
(cherry picked from commit 4d2833ae3d662006101e3be98bfba4c7da58603e) |
||
|
|
186d327fe7 |
Memory: kept blocks past their quiet period go within a second at the next creation call; FAST-PATHS records the kept memory
A kept empty block was looked at only when a release came in its own pool, so a pool whose resources stopped coming and going kept its blocks, up to its heap's budget, until its next release. The device's creation calls (keep_room) now also free every pool's kept blocks past KEPT_EMPTY_FOR, at most once every KEPT_SWEEP_EVERY (1 s): the memory is held at most about 11 s past a working set's dip wherever the program still makes resources. docs/FAST-PATHS.md, known gaps: the NVIDIA memory block row, with the bound (an eighth of a heap, at most 2 GiB, 10 s), what it holds per device, why it has no switch (no answer of Metal's changes), and the RTX 5080 measurement of tests::clip_bursts (poolwait-burst, NVIDIA 615.71.09, two runs each): clips 2 and 3 took 41 and 40 allocations and 89 to 102 ms with 2 to 5 commits held 1 ms or more (longest 8.8 to 9.4 ms) before, none and 64 to 71 ms with no commit held (longest 0.39 to 0.67 ms) after; a first clip 44 allocations before, 16 after. Not yet built: the sweep builds and runs next on lavapipe. (cherry picked from commit b31e221ee4cfba1861320e8c674a01ea83614013) |
||
|
|
48cfac5cb3 |
HostRam lists kept: the docs say the lists outlive their copies, with same-host numbers
HOWTO, the runtime README and FAST-PATHS still said a copy's lists were freed with its command buffer and that every copy pays its lists' imports. They now say each list is kept past its copy for the copies of the same pages after it (at most 64 MiB and 16 lists, released once no copy took one for 2 s), and they give the numbers. The numbers come from tests/host_ram_listed_bench.rs on the Radeon 780M of one host (um790, RADV, kernel 7.3.1). The kept tip was run with a timing probe that never lands, then again with the bound sabotaged to (0, 0), which keeps nothing, back to back. Medians are commit to completion, then encode: - A 5 MiB device cache filled again: 0.37 to 0.43 ms and 0.2 to 0.4 ms, against 3.0 to 3.2 ms and 0.7 to 1.0 ms with no list kept. Over an imported chunk it takes 0.37 to 0.40 ms and 0.12 to 0.14 ms. - A surface-shaped tile's download after its fill: 0.53 to 0.60 ms, against 4.0 to 4.2 ms. - A scattered tile's download: 0.46 to 0.50 ms, against 0.98 to 1.04 ms. - A copy that imports pays the lookup through the kept lists: 48 to 63 us for a surface tile, 250 to 290 us for 1,800 scattered runs against 16 lists. - The scroll's 24 visible tiles pass the 64 MiB bound (about nine tiles), so a third to a half of their repeated fills took a kept list. - Residency is the same with and without kept lists: 4028 of 8192 MiB, and 8300 of 16384 MiB. (cherry picked from commit ee030ba7ed497aeb4bf0c92653cc33078e987379) |
||
|
|
ecddb49936 |
FAST-PATHS: the NVIDIA pool block gap with its sizes, its frees and making ahead
The RTX 5080's measurement of its own (an exclusive window, 12 blocks a size): vkAllocateMemory of a pool block's memory takes about 0.16 ms a MiB, idle or beside another process's GPU work (medians 5.5, 11.0, 20.4 and 40.6 ms for 32, 64, 128 and 254.7 MiB), vkFreeMemory about 0.035 ms a MiB, and every vkQueueSubmit another thread calls during either returns once it does. Frames every 16.7 ms met a 254.7 MiB making 28.6 to 48.6 ms late on their own thread (23 of 23 over 1 ms), and up to 67.5 ms with the making on another thread, spread over the frame or right after a submission (11 of 23 either way). So no block is made ahead on a thread of the device's own: it would not keep frames from the hold. A smaller block would shorten it in proportion, at the cost of each command buffer's pool capacity, which is the orchestrator's call. Verified: docs only; the numbers are entry poolwait-poolwait-sizes-063031-063031 (7eb0aab5e5's allocation_holds). (cherry picked from commit f3e209f7ea255d79ef6b524bd1dcd176e9792589) |
||
|
|
bfcd71e5d6 |
Record the short last row's shadow among the known gaps
A texture over host pages whose buffer ends inside its last row's pitch is a shadow (Refused(Placement)): a linear image's last row takes the whole pitch, so the image's memory requirements reach past the buffer's bytes, over an import of the caller's pages and over a copied host buffer's copy alike, whose placement is the buffer's length. Metal reads such a texture in place, so it is a runtime cost above the driver's: docs/FAST-PATHS.md's known gaps now say so, and InPlaceRefusal::Placement's doc names the case. Seen on the Iris Xe (ANV) and the 780M and RX 550 (RADV) by a probe at the guest's shape, which stays on a branch of its own. Verified: cargo fmt; scripts/api-signatures --check (signatures unchanged; a doc change). (cherry picked from commit 9493894b26cee3b1a525d9a0916a83f3fc6a594f) |
||
|
|
da896c5a1f |
Textures over a device-allocated copy: the caller's pages' verdicts, the pooled check only for the pitched image
On RADV (the RX 550, job 8832) every texture over a copied host buffer whose copy lies in memory the device allocates stayed a shadow: the route asked the runtime's pooled class's verdicts, which the check leaves unchecked there, though the image over such a copy is mostly the driver's own linear image, which starts PREINITIALIZED and so keeps the copy's bytes at its first move. The pooled class judges only the DRM_FORMAT_MOD_LINEAR image made UNDEFINED at Metal's pitch where the driver lays its rows otherwise. So the route asks the caller's pages' class (Pointer) for texels as they lie in the copy and as they lie in the pages (a rebind may import them), and fresh pages' where the copy lies in them; copy_unplaced refuses the pitched image for its pitch where the pooled check did not pass for its accesses. The wider plans of a texture over a copy (the usages its descriptor lacks) take the caller's pages' verdicts too, as the route does. Texels::over_caller_pages answers only over a copied buffer. The device test now asserts an image over the copy where both checks passed and none where the pages' did not. Verified: cargo fmt; builds and tests run as potluck jobs after this commit. (cherry picked from commit 7911bb167b88661f3d4b8b6a4431145ff22a143c) |
||
|
|
1cf4730839 |
Textures over a copied host buffer: an image over the copy where the check passed, not a shadow
Every texture made over a copied host buffer (a no-copy buffer whose import the caller's gate
refused, or that failed) was a shadow, refused as `Refused(Placement)` ("a copy of the caller's
pages in memory of the device's own"), whatever its usage: each command buffer copied the copy's
texels into the shadow's image, and merged writes back, on top of the copy's own copy-in and merge.
A consumer whose views of guest memory pass the host's mapping budget gets copies of its large
window surfaces (reims's Iris census: 112 gate copies, 1.9 GB), and every texture over them is
such a double copy: the boots' 491 refused-placement shadows.
The GPU uses the copy in the pages' stead, so a texture's image can lie there, as a rebind onto a
copy already makes one (`in_place_over_copy`):
- route.rs: a copied buffer's class is its copy's memory's (Fresh in fresh pages the runtime
imported, else Pooled); the in-place decision asks that class's verdicts and the caller's pages'
(Pointer: a rebind may import them), each for texels that lie in lines as they lie there
(`Texels::line_start` reads the copy's offset in its memory; `over_caller_pages` the pages').
- in_place_image.rs: `unplaced` over a copy makes the image in the copy's memory: in fresh pages
the host-allocation one, as over the pages; in memory the device allocates `own_unbound`, the
driver's linear image (PREINITIALIZED) where it lays the rows at the pitch, else the
DRM_FORMAT_MOD_LINEAR one of no external memory (`unbound_in` serves both, and
`in_place_unbound`). The image is watched for rebinds and its first move holds the pages, for any
no-copy buffer's pages (the class no longer decides it). A rebind onto a device-allocated copy
takes the DRM_FORMAT_MOD_LINEAR image too where the pooled class passed for its accesses
(`class_takes`, from `fresh_pages_take`).
- The image's identity is the buffer's, so its uses name the copy: commits copy the CPU's writes
in, completions merge the GPU's back, as for the buffer.
- Counted: `WorkCounts::copied_textures_in_place` (also in `host_textures_in_place`); a shadow's
notice names the copy.
Tests (copied_device.rs): a sampled and a rendered texture over a gate-refused copy take an image
over the copy exactly where the verdicts of the copy's memory and the pages pass (before this,
every one was a shadow, so on a device whose check passes the test fails), read the caller's
texels and a CPU write before a commit, and their blit and clear reach the texels' bytes in the
pages alone; such a texture follows rebinds to another copy and back to an import.
Docs: copied.rs, in_place.rs, in_place_image.rs, route.rs, HOWTO (copied host buffers),
FAST-PATHS (the in-place row), TexturePlacement::InPlace; api_signatures blessed.
(cherry picked from commit e6573e3f1b942d11bda3063f5477745018cf9239)
|
||
|
|
15c72b1690 |
GPU pools: a block a queue lets go is the device's spare for the next queue
A queue's pool block that went (its queue went, or no lease held it for QUIET) was released, and the next queue to need a block of that kind made one again: on the RTX 5080 a 254.7 MiB vkAllocateMemory of 4.9 to 189.5 ms beside other GPU work, during which the driver holds every vkQueueSubmit of the process (docs/FAST-PATHS.md, known gaps). Now the block becomes the device's spare of its kind where the device holds none (else it is released, as before), a made-meanwhile block too, and a queue holding no block takes the spare at its first lease before it makes one. A device so makes no more blocks of a kind than the most queues that held one at once, and none as queues come and go or rest. The cost is one block of each kind beyond the queues' own until a queue takes it or the device goes: 254.7 MiB of device memory on the RTX 5080 Laptop GPU, 1 GiB of host memory kept wired on the M3 Max. The spare is safe to hand on: no lease holds a block that goes, so no command uses it, and nothing reads a pool's bytes before its own command buffer wrote them. QueueBlocks::drain pops the slots instead of taking the map. Tests: the pool CPU tests cover the spare from both releases, the made-meanwhile block, the teardown and queue churn (eight queues one after another make one block); the device tests see a later queue and a rested one take the spare without a making, and the handler test makes each round's block after a holder queue took the spare. Verified: cargo fmt only, here; the runtime and validation suites, clippy and the device runs follow as potluck jobs. (cherry picked from commit dcc2bc0cb49f391b7d14c135d7aae97f1a93795b) |
||
|
|
9024d9ee5f |
index_pools: count a completed handler's lag from its submission's return too
runtime_lane::index_pools::a_completed_handler_waits_for_no_pool_block_made_meanwhile
failed on the RTX 5080 (round
|
||
|
|
384ce01a32 |
HostRam lists: HOWTO, runtime README and FAST-PATHS with the 780M's numbers
HOWTO section 6 gains HostRam::with_dma_buf_of_runs: what the source answers, where copies take lists, what they differ from (a chunk's import pins every page of it, for good, and later copies import nothing; lists pin the copy's pages while it runs, and every copy pays its imports), and the Radeon 780M's numbers from tests/host_ram_listed_bench.rs at 4f30c38a77 (before the rebase onto development; the list path is unchanged by it): 4028 MiB of an 8 GiB guest's file held where whole chunks would make 8192 MiB resident, 8300 of 16384 for 16 GiB; a surface-shaped tile 4.1 to 4.5 ms from the commit to the completion, a scattered one 0.9 to 1.25 ms, against 0.39 to 0.48 ms over an imported chunk. The copy paragraph says where lists replace the staged and alone paths. The runtime README names the call; FAST-PATHS's row on idle dma-buf imports gains the trade (memory for per-copy time, the consumer's choice, no accuracy). (cherry picked from commit c6f08a396cc2e4713dedfae06ad0648019e9e22d) |
||
|
|
5640e17560 |
Document the model's linear sample of planes read in place
FAST-PATHS.md gets the ledger row for ycbcr_in_place_reads (Model default, Exact switch, the 780M's exact-form cost measured at development's tip), the device-gaps row and the in-place section name the choice; API.md's policy list and the half/float filter and ycbcr-filter-not-exact catalogue entries name the model; PrecisionNote::HalfSampleFilter/FloatSampleFilter and Degradation::YCbCrFilterNotExact docs say the model records and announces them. (cherry picked from commit 5f83699d296386c3b0b357f2baa63cfefc086096) |
||
|
|
016c09572a |
Pooled moves: docs and API signatures
TexturePlacement::Pending: over the device's own memory, a texture made while the pooled check is pending now moves to its image at Metal's pitch the same way (it no longer stays a shadow for good). Texture::vk_image, docs/FAST-PATHS.md (row 41), docs/API.md (the shadow reasons over the device's own memory) and docs/HOWTO.md (the padding-unobserved paragraph) say so, naming WorkCounts::pooled_textures_moved_in_place and pooled_texture_shadows_freed_after_move. API signatures: the two new WorkCounts fields (scripts/api-signatures/signatures.py --bless, two lines added). (cherry picked from commit 4c1beda492dcc4af16923df09724b7fbf0e7387a) |
||
|
|
7e5821d9d1 |
In place: renders over padding a buffer declares unobserved take a verdict that lets that padding change (Access::UnobservedRenders)
What: a new check access, UnobservedRenders, that the renders rounds answer beside Renders, as the
storage-write rounds answer BufferWrites beside Writes. Where a shape's rows' padding is free
(Shape::padding), a renders round that changed no byte but of that padding (after a row's last
texel, before its pitch, the last row's included) fails Renders for its row ends and keeps
UnobservedRenders. A byte past the last row's pitch, or a texel, fails both. A new Padding variant,
Unobserved (Free padding over a buffer that declares padding_unobserved, Texels::padding), makes
in_place() ask UnobservedRenders in the stead of Renders (Access::rendered); the wider render-target
plan of an image in place asks the same. The check's SHAPES gain 172x67 BGRA8 at a 704-byte pitch,
whose last row's pitch ends 64 bytes past a multiple of 128 and 256, so a device that writes back
more than a line around a row's last texels changes a byte past the image and fails both.
VERDICTS 48 -> 56 (7 accesses), the record 56 bytes; CHECK_VERSION stays 11 (unlanded).
Why: on the Iris Xe (job 7965 at c4eeeba7e8), the pooled class's Renders verdict failed for rows
ending mid-line (the clear and store, and draws, write back the 64-byte line holding a row's last
texels whole), so none of the 93 device caches went in place (93 shadows, frame 4145 us declared
and undeclared alike), and the item's case (a padding-unobserved texture at a 64-aligned pitch, rows
ending mid-line, rendered) stayed a shadow (CheckFailed{Renders, InLines}). The declaration already
lets a render pass's load and store write those bytes; no byte past the last row's pitch may change,
and Padding::of guarantees the last row's pitch ends on a line.
Also: a padding-unobserved buffer in fresh pages takes the same rule; BufferDescriptor's doc says so.
Tests: unit cases for the compare (the line write-back of each row's padding is Padded; a 128-byte
write-back past the last row's pitch, a byte past it or a texel is Changed), Padding::declared, the
tally (Renders answers two), the decision test over Unobserved padding, the shadow-cause words; the
device test asks the UnobservedRenders verdict and asserts the texels' padding is Unobserved. Device
evidence follows on the Iris.
(cherry picked from commit 990d744ec71269663e292c7f2f3e4148d166bacb)
|
||
|
|
703eca0dba |
Pooled class: tests and docs
The padding-unobserved device test settles the check and holds the answer to the making's (NotHostPages exactly where the texture aliases, else the shadow's cause); a new device test renders textures of the guests' cache shapes (64-aligned pitches, rows ending inside a 64-byte line) over declared buffers and checks that a pitched image appears only where the pooled class passed for reads and renders, that the CPU's texels read back through the texture, that a clear reaches the buffer's rows, and that the bytes after the last row keep the CPU's. The validation lane reads 48 verdicts. Docs: in_place.rs and in_place_check.rs module docs, FAST-PATHS row 41, API.md (placement answers, the shadow reasons), HOWTO's padding-unobserved paragraph, the runtime README, BufferDescriptor::padding_unobserved, TexturePlacement's NotHostPages and Pending (a pooled texture made before its verdicts stays a shadow). Verified: cargo fmt only; builds and the device runs follow. (cherry picked from commit ae31d0fd3841b136c692897cbdf425633e9344c3) |
||
|
|
20360b6038 |
In-place check: the narrow rounds' large surface is 1024x64, not 1024x1024
The last of the narrow store shapes was a 1024x1024 R8Uint surface at a 1024-byte pitch. On the M3 (release, job 7745's probe) its three rounds took 7.5-8.4 ms of each class's 14-16 ms of narrow rounds, and the narrow rounds put the whole check 30 ms past the base's (0.33 s to 0.36 s; the base's spread is about 7 ms). A sixteenth of its rows keeps its 1024-byte rows, the row width of the largest such guest texture, and the many workgroups of its dispatch, and cuts its fill, word-per-texel source and compare by sixteen. Verified: cargo fmt; the shape tests read NARROW_STORE_SHAPES and name no size. The check's time is measured again on the M3 in the next jobs. (cherry picked from commit 3927363fbd5883c78cf2835255ae145e2f1541f3) |
||
|
|
b1e2f06e9e |
Docs: a written texture over host pages is a shadow by width only outside 1, 2, 4, 8 and 16 bytes
Two passages still said a shader's writes of 1- or 2-byte texels keep a texture over host pages a shadow: the shadowed-texture entry of docs/API.md's degrade-notice catalogue and the host-pages bullet of docs/FAST-PATHS.md's costs. The device's check now stores those widths too; a texture is a shadow by its width only for a width outside the ones it stores. Verified: docs only; grep finds no other passage that names 1- or 2-byte written texels as a shadow's cause. (cherry picked from commit 90bd51d7a55257a40e115c55da2a53c7bb0b4f80) |
||
|
|
6575c031f5 |
In place: 1- and 2-byte texels a shader writes, checked apart by the device's check
In every guest session reims measured (Iris Xe and Radeon 780M, macOS 26.7.2 guests), host_texture_shadows_store_width was 114, from 23 distinct R8Unorm, A8Unorm and R16 textures a shader writes (32x32 at 256-byte rows among them). They were shadows because the in-place check's write kernel stored only 4-, 8- and 16-byte texels (STORED_TEXEL_BYTES, ShadowCause::StoreWidth), so no check covered a driver's writes of narrower ones. What changes: - in_place.rs (from selfread's parked 0c587bcad5): Access gains NarrowWrites and NarrowBufferWrites, with 36 verdicts instead of 24. Access::written picks the writes check of a texel width and padding. STORED_TEXEL_BYTES holds 1, 2, 4, 8 and 16; NARROW_TEXEL_BYTES holds 1 and 2. in_place asks the written check in place of Writes. The report names "narrow writes" and "narrow buffer writes". CHECK_VERSION goes to 9 (development's dma-buf import fix took 8). - in_place_check.rs: NARROW_STORE_SHAPES, rounds of their own for the narrow accesses, through the copy-in kernel's R8_UINT and R16_UINT views (a801dac7d7). The shapes are packed R8 256x16 and R16 128x16 at 256; R8 61x37 and R16 45x29 at 256, whose rows end inside a word and whose heights are odd; the 16- and 64-byte tight pitches; and an R8 1024x1024. The source buffer holds a word per texel, the texel's bytes low and zeros above, since CopyIn takes 4*words() bytes a texel. A narrow round's change fails only the narrow verdicts, never a 4/8/16-byte texture's. A device whose kernel or image is not made (no shaderStorageImageExtendedFormats) leaves them unchecked. - in_place::storable: one helper for a render target's storage usage, used by route.rs and storage_form.rs. It asks Access::written(texel, Padding::Kept) instead of Writes, so a narrow render target never takes the 4-byte verdict. writes_reach (the storage usage an image that does not render takes beyond its usage) and fresh_pages_take ask the written check of the texels' width; InPlaceWatch carries the width. - InPlaceAccess::Writes covers the narrow accesses. Docs (in_place, the check, API.md, HOWTO, FAST-PATHS row, runtime README, WorkCounts, HostPageTexturePolicy, TextureShadowReason) say 1, 2, 4, 8 and 16 bytes, with narrow writes checked apart. The lane's VERDICTS goes to 36. Tests: - The decision test runs every width, 3 bytes for StoreWidth among them, against narrow answers that differ from their wide twins'. It also checks storable. - Shape tests cover the narrow set: tight pitches, row ends at 16/64/128/256, free padding. - New: each_check_of_storage_writes_stores_its_texels_width. A narrow tally case. - New device test narrow_writes_device: the guest's 32x32 R8Unorm and A8Unorm (and RG8Unorm and R16Unorm) at 256-byte rows over a no-copy buffer. Each takes its narrow verdict's path, its placement query agrees, a kernel's writes reach the bytes, and the padding and the bytes past the last row are kept. - in_place_storage adds an R8Unorm render target. Verified: not yet built; the build, clippy, unit and device runs follow as jobs. (cherry picked from commit dbb985df199b1c46bb783aafbd50efd40bcab187) |
||
|
|
c73e4b36a8 |
Document learned coverage's measured costs and the spare pools' effect
FAST-PATHS' attachment-read paragraph and render/snapshot.rs now state what learned coverage does where the device measures readers, and the measured results against the build before the area rule (pre) and the spare-pool scratch (q4): - Iris Xe (job 7575, pre from 7439): crossover rows at most 1.03 times pre, except 320x180 readers covering 1.5% or 12.5% (both builds snapshot) at 1.05-1.07, the query's own cost; readers that learned a dense coverage now split (area lane 0.99-1.01 of the split). - RX 7900 XTX (7578, pre from 7481): 0.68-1.05 of pre after the control's drift between runs; per-round spread up to 1.4x. - Radeon 780M (um870, 7628): dense readers 1.00 of pre; readers over 12.5% of a scissor their pass filled whole 1.15-1.26 of pre, as the area-rule control takes too. The spare-pool doc states the Iris measurement: from pools made a pass, the measured readers took 1.07-1.19 times the same forms unmeasured, and from spare pools 1.00-1.06. (cherry picked from commit 1978c9008cf2ee9a7d90033e940a93ba24680fbe) |
||
|
|
3f8b07c044 |
In-place check: a kernel's writes of a texture over a buffer may change its rows' padding
What: a second verdict for a kernel's writes, Access::BufferWrites, taken by a texture over a
buffer's rows (no IOSurface plane's) whose buffer holds its last row to its pitch and whose rows,
each to its pitch, start and end on a line of the device's memory (in_place::Padding::Free). The
same Writes rounds give it: the writer and the compare tell a change of a byte of the shape's
rows' padding (after a row's last texel, before its pitch, the last row's included) apart from
any other change. A round that changed only such bytes (Round::Padded) fails Writes for its row
ends, as before, and counts as kept for BufferWrites, and the rounds go on through every shape;
any other change (a texel, a byte past the last row's pitch) fails both and ends the class's
rounds. in_place() asks BufferWrites in the stead of Writes for such a texture; renders, an
IOSurface plane's rows and a render target's storage usage (storable) keep the strict verdict.
The rebind's choice of fresh pages carries whether the padding is the buffer's own. 24 verdicts,
CHECK_VERSION 7; the report adds `{class} buffer writes` lines.
Why: real Macs disagree on those bytes, so Metal leaves them to the GPU. The probe
(row_padding_writes.m) found an Intel UHD Graphics 630 under macOS 26.7.1 writing older values
back over the CPU's writes to the padding of textures over a buffer under a kernel's writes
(10,197 and 28,162 bytes in 100 rounds of 3662x64 and 61x64 BGRA8, 304 and 307 in the last row;
m3-max-7240, m3-max-7269), keeping them over IOSurfaces and under clears, stores and draws; an M3
Max under 27.0.1 (arm64 and x86_64, m3-max-7241) and a Radeon Pro 5300M (static check, 7269) kept
every byte. The owner's ruling: follow the x86 Macs' envelope and remove the shadow copy where
possible. On the Iris Xe, whose writes write back the 64-byte line holding a row's last texels,
written textures over a buffer whose rows end inside a line now take the image in place.
Docs: in_place.rs and in_place_check.rs module docs, docs/API.md (the in-place paragraph, the
shadowed-texture notice, section 10 Kernels with the three probe results), FAST-PATHS row 41, the
runtime README. Lanes: in_place_textures' VERDICTS 24 and its written-texture checks ask the
buffer writes verdict where the padding is free (in_place_rows::padding_free/writes), the
padding bytes of a texture in place with free padding no longer held to the pattern.
Tests: tests::in_place's decision test over both paddings; Padding::of cases (the guest's
3662x2039 surface at a 14656-byte pitch is free, 416x51 at 64-byte lines kept, slices apart);
Bytes::compare telling a change of each row's padding (the last row's last byte included) apart
from one past the last row's pitch or of a texel, and from padding that is not free; Tally's
verdicts for the Iris's walk and the others.
Verified: pending.
(cherry picked from commit 200f2a9e2b26eeaff45c1cc5ec71decf42d8437e)
|
||
|
|
46013629ca |
Give the area rule's measured costs on the Iris Xe and with the split weighed by its copy
The rule's doc (render/snapshot.rs) and FAST-PATHS's attachment-read paragraph now give what the
lanes measured at 2fb3261df0 (copies b9db87767a on ms01, 226fb24902 on gem10):
- snapshot_area_costs, no scissor (the rule against the split on a device withholding
fragmentShaderPixelInterlock): a reader over 1.5% of the target 0.09-0.33x on the Iris Xe
(m3-max-7079), 0.09-0.23x on the Radeon 780M (7077), 0.25-0.43x on the RX 7900 XTX (7076); over
the whole target 1.03-1.20x, 1.95-2.30x and 1.30-2.10x.
- snapshot_crossover over a private 1920x1080 target, against the build before the rule
(5a216c19b0;
|
||
|
|
37875af7f3 |
Weigh a self-read's split by the texels its copy moves
The area rule (render/snapshot.rs) weighed the split as a copy of every texel of the color's
level. The split's copy for a draw that reads at its own pixels is cut: for a one-level,
one-slice color it moves only the texels inside the rectangle bounding the draw's scissors, a
pixel wider each way (render.rs's bound_own_pixel_reads, ShadowCopies::cuts). So the rule
overstated the split for readers through scissors smaller than the target, and since
|
||
|
|
902002273d |
Narrow RADV's first-write-after-suspend gap to moved and dedicated memory
Measured on the RX 7900 XTX (gem10, Mesa 26.2.6) with tests::zeroed_start's busy test, five processes each started with the GPU in runtime suspend (job m3-max-7290). The first replace_region into a texture made behind about 1.5 s of fills took 55 to 114 us with the blocks host copies place in made ready ahead, each run readying 1 block and making 0 in place. With that readying off (negative control: 5ee5d0e582's keep_room change) it took 553 to 654 ms, and the test failed on its readied-block assertion. Awake it took 58 to 63 us, against 68 to 96 us without. What stays open, from the in-process probe on the same card: a texture placed before a mid-process suspend waited 86 ms for the kernel's moves back, and a texture of its own block (4096 x 4096) waited 73 ms. (cherry picked from commit 065f04d7f3016469a01d9148aba4dc9e991dfd79) |