c3d5b3e05e40a8fbe2035d509df5ce2efea799ff
6184
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c3d5b3e05e |
Re-bless the golden hashes and the authored compile census at 19f8fb7588
SEMANTICS 2135 ( |
||
|
|
19f8fb7588 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
8933378831 |
SEMANTICS 2135 / RUNTIME 2458: No storage twins: a kernel's constant buffer on the Iris reads its uniform view alone
What: the Iris Xe RPL-P profile (DriverWorkaround::PushReadsLengthenThreadPayload) declares no storage twin. A kernel's constant slot keeps its plain uniform view, read at its residual as on every device without ConstantOffsetUniformReadsPreloaded; its set-0 layout binds the uniform view alone. Deleted with it, everything only the twin used: - translator: DescriptorView::UniformWithStorageTwin, BufferForm::storage_twin, ResourceKind::StorageTwin, BindingSource::StorageTwin, AccessPlan/Declared twins and the census's twin count, storage_twins, views::declare_twin/twin_symbol, emit's TwinMem, the twin's NonWritable statement (unwritten_buffer keeps its unaliased-argument use), PlannedBuffer::twin, the second DescriptorRange, buffer_uses back to buffer_use, range_at_bind_offset's unbound twin arm, planned_range's twin exclusion, rebinds_into's twin arm, the interpreter's twin binding, the codec's variants, and BindingPlan::read_only_buffer (its only reason was the twin); - runtime: uniform_residual_form_of and reads_other_words (keyed_regions takes no flat_grid), the neutral zero buffer's STORAGE_BUFFER usage and plan-based read-only check (back to the descriptor type alone, binding::read_only_buffer); - validation: out_of_bounds's twin arms; - docs: API.md section 5's twin bullet, the workaround's profile doc, residual.rs, views.rs, ModuleBuilder::unwritten_buffer, non_writable.rs, neutral.rs, neutral_zeros_shared's docs; api_signatures.tsv drops the five items. Kept: storage views' RangeAtBindOffset at offset 0 on that profile and its creation of both forms (RUNTIME 2410), set-0 counting tests, the dispatch_chain example's arms. Why: the twins are the confirmed cause of the Iris regression. Walk A (the tip with no twins) took 137.4 s of GPU time against 145.8 to 150.2 s for three walks with twins; Face Tracking 13.50 s against 18.1 to 21.1, Super Resolution 25.78 against 28.2 to 28.4, Background Blur 4.93 against 5.7 to 6.4; Horizon Detection gives up about 1.3 s (17.78 against 16.2 to 16.8). No structural rule separates where a twin pays (ftreg's report to main). SEMANTICS and RUNTIME are bumped at landing; golden tables and the compile census are re-blessed on development. Test: engine_access::a_kernel_constant_slot_binds_its_uniform_view_alone. On intel-irisxe-rplp-anv, with and without uniformBufferStandardLayout, buffer_end_byte_load_constant's slot 0 is UniformWords/UniformVec4, its RangeAtBindOffset key is read, and set 0 links exactly slot 0 at (0,0) and slot 1 at (0,1). A plan of nothing bound writes those two alone in set 0 (UNIFORM_BUFFER, STORAGE_BUFFER), and only them on four other profiles. At development the slot is UniformWithStorageTwin and set 0 holds a third binding, so it fails. ARTIFACT_FORMAT_VERSION 524: the codec drops the twin variants. Verified: m3-max-36704 (msi) at 2b88dec3f1 clippy --all-targets --all-features 0; m3-max-36706 clippy --cfg m2v_gpu 0. Rustdoc, the translator suites, clippy --cfg m2v_cpu_icd with the lavapipe runtime tests, and the negative control (the new test at development fails) run after the merge; golden tables and the compile census are re-blessed on development. |
||
|
|
e10f3529c2 |
FAST-PATHS: the Iris Xe reads imported host memory at about 2.2 times device memory's GPU time
A known gap, the device's: under ANV (Mesa 26.2.6, i915) a compute kernel's reads of constants over imported host pages cost per read, by host pointer or udmabuf dma-buf alike. Measured on the Iris Xe (reads_k probe, one pass, rings of 64): 256 threadgroups with 1,024 uint4 reads per thread took 325 us per dispatch from device memory against 714-740 us from a pointer import or a dma-buf import (jobs m3-max-36557, m3-max-36652). 4 KiB and 64 KiB rings cost the same, uniform and storage views cost the same, and no recorded command count differed between placements. The dma-buf route ran (dma_buf_imports 4, no pointer imports). The only lever would copy guest constants into device memory, which zero copy excludes. |
||
|
|
aa95a93e00 |
Predicated loops: the loop rebind test asks the announcements with contains
Clippy's manual_contains (-D warnings, --cfg m2v_gpu, job m3-max-36629) refused
the iter().any() over the heard degradations in
tests/rebind_loop_check.rs; it reads them with Vec::contains instead.
Fix forward of RUNTIME 2457 (
|
||
|
|
be50ccef9c |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
83b3b67f30 |
RUNTIME 2457: Predicated loops: a rebind while a loop without work apart runs again is taken
A predicated loop's check (Deferred::Loop) answered false in Deferred::resolved_at_its_calls, so the commit's steps_hold kept the pages of every buffer over host pages its command buffer used until it completed, and a rebind of one meanwhile was refused Invalid(Rebind(EncodedUses)) for as long as the loop ran on, which Metal does without bound. The check's host step reads only its unit's halt word, in the command buffer's upload arena. Each run again submits the laying's VkCommandBuffers again as they were encoded (Piece::Raw), the predicate word's VkBuffer or address and the body's sets taken at encoding, over the pages the laying's event group took at its first submission, which Submitting::submit keeps in State::retained until the command buffer completes; the batch the check holds keeps it from completing before the loop ends. Only the work the laying left apart is recorded again at each run: a host step's resolves the buffers its encoder named then, and work on the GPU alone records over the buffers as they lie then. So a loop's check is now resolved at its calls where its laying left no work apart (LoopCheck::leaves_work_apart). A rebind after the laying's submission is taken and every run again keeps the old pages, as Metal's loop reads the pages its submission found. A rebind before that submission is taken too, and the laying's encoders, which keep no log to be encoded again from, fail their submission EncodedUseRebound (announced), as every other compute encoder that predication reaches past does. A laying that left work apart keeps holding as before. The docs say so: deferred.rs, rerun.rs, rebind.rs (the module doc, RebindProblem::EncodedUses, Buffer::rebind_bytes_no_copy), the commit's steps_hold comment, the runtime README, and FAST-PATHS's two known gaps (the refusal now names a loop whose laying left work apart; the rebind between submissions names a loop's laying rebound before its submission). docs/REFUSALS.md does not move. The test is tests/rebind_loop_check.rs: a no-copy buffer holds a DoWhile's word and its body's input. A rebind while the loop runs again is taken, the loop runs again after it, ends on the old page's word alone, and its body wrote the old page's input; a rebind before the laying's submission fails the command buffer EncodedUseRebound, announced, its output unwritten. Verified: m3-max-36621 (msi, lavapipe, --cfg m2v_cpu_icd) at 30a7bfaa4e: rebind_loop_check 2/2 (running: rebind Ok, loop ends on the old page's word, old input; before submission: rebind Ok, EncodedUseRebound announced); rebind_*|pending_rebind|host_step_*|rerun_*|predicat* 29/29; control (development's Loop arm) fails both with Err(Invalid(Rebind(EncodedUses))); m3-max-36628 clippy --all-targets --all-features 0. clippy --cfg m2v_gpu / m2v_cpu_icd, rustdoc and the validation lanes run after the merge. |
||
|
|
bdba2e7858 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
74b2b04859 |
RUNTIME 2456: Bind inside a releasable import before keeping it for good
bind_in_import took the outer import with `pages(ReadApart::Inside)` before any of its checks: that call keeps a releasable import imported for good. Every refusal after it (a dedicated dma-buf, the window outside the placement, the alignment, the memory types, a failed vkBindBufferMemory) then returned None, the buffer became a copy, and the outer import stayed held for good with nothing bound in it: never released while idle again. Now the checks and the bind read the import through the blit's non-pinning hold (`blit_pages`, imported again where released, which the release sweep skips while it is held), and `expose(ReadApart::Inside)` runs only once vkBindBufferMemory succeeded. A released import the device cannot import again is now a refused bind (a copy) rather than a lost device, since no work reads the stand-in there. The test `a_bind_refused_inside_a_pointer_import_leaves_it_releasable` refuses a bind inside a live pointer import through a test hook (`refuse_binds_in_imports`, compiled only into the Linux device tests) and checks the outer import is not counted as read apart inside, not kept for good, and released; then binds a second buffer inside it and checks it is kept for good. At development's bind_in_import the first check fails: the import is held for good and never released. Verified: m3-max-36585 (msi, lavapipe) at 940903c12e: pointer_residency|one_import|host_import_counts|dma_buf_beside|lone_fetch|host_residency 46/46; the new test alone passes (released after the refused bind, kept for good after the bind); clippy --all-targets --all-features -D warnings 0. The control at development's bind_in_import, clippy --cfg m2v_gpu and m2v_cpu_icd and rustdoc run after the merge. |
||
|
|
83f6c5ed10 |
The what and why of RUNTIME 2455 (9afd9699e1), whose folded message lost them
RUNTIME 2455 folded two commits whose messages did not reach it. They follow verbatim. No change to any file. --- 9f9a9a2019 Begin ahead: a settled pool's primaries begun on a device thread, one an encoder A command buffer that gives its first pool back settled posts the pool to a new device thread (begin_ahead.rs) once its completed handlers ran, and the completing thread begins none itself. The thread begins as many of the pool's primaries as encoders of that command buffer opened their own in it, one at least and spares::AHEAD = 8 at most (a dealt frame's chunks opened 5.6 encoders' own on average on ANV), one at a time: the pool out of the spares under their lock only while one begins, kept again between begins, so a taker never waits for a begin and one between two begins takes the pool with those begun so far. Every encoder that opens its own primary takes one begun while the pool holds any; before, only a command buffer's first encoder did, and only where no thread waited for the command buffer that gave the pool back. Why off the completion path too: each begin was 8 to 20 us on ANV (spares.rs), spent by the completing handler thread while the queue's context was held, for every settled command buffer no thread waited for. The completion now only posts (one lock, one push, one wake). The cost is a race: a command buffer that takes the pool before the thread made its begins finds fewer. Counted: WorkCounts::encoder_primaries_begun_ahead_missed, the encoders among as many as the pool's begin ahead owed that found none (the pool taken first, or out of the spares as the thread came to it); each began its own as before. A pool is due its begins from the give-back until the thread made them (CommandPool::due), and owes as many as the pool's last command buffer opened (CommandPool::owed) to its next taker. The thread: one a device, started by the first post, at the user-interactive class as the handler threads that began these before; at most 64 pools wait, one posted twice waits once; holds the spares' pools, the device's functions, loader word and counts (spares::BeginTargets), never the device; each begin in a section of the exit guard; stopped and joined by the teardown after the handler contexts stop, before the spares are released. The command buffer allocation the begin may make goes through the same helper as the device's (device::allocate_command_buffers), counted alike. CommandPool::begun is a Vec; take_begun is open_encoder, which also counts the encoder for the pool's next begin ahead. The gate's waiter count (Gate::awaited) had no user left and is deleted, with its test. Tests: - tests::begin_ahead::each_render_encoder_after_a_settled_command_buffer_ opens_from_a_primary_begun_ahead: a command buffer of 5 render encoders on a new pool, then the next takes that pool, the only spare: each of its 5 render encoders opens from a primary begun ahead (encoder_primaries_begun_ahead 5), none missed, same pixels. - tests::begin_ahead::a_waiter_returns_before_the_begins_and_a_taker_before_ them_counts_its_encoders_missed: the thread held (test hook) at its begins, the command buffer's wait returns with no primary begun; the next command buffer takes the pool first and counts 5 missed; released, the third opens all 5 from primaries begun ahead. - spares unit tests for several begun primaries, the AHEAD cap, the misses, and a pool that may begin no more being due no more. - Tests that read the spares or the begin counts after a wait settle the thread first (BeginAhead::settle, test only); draw_again's begun-alike test holds the thread from the start rather than waiting for a run that begins its own, and its begun-meanwhile test holds it until the event's command buffer took a pool, so that pool is due a begin; the bound test holds it so the begins are its own. Verified so far (scratch commits of the same tree, msi lavapipe): the touched suites begin_ahead|spares|draw_again 64/64 and clippy --cfg m2v_cpu_icd 0 (m3-max-36530); the tip's own runs follow. --- 5774363889 Spares test: a pool past a command buffer's first holds its primaries begun ahead beside POOL_HOLDS A spare that holds primaries begun ahead and serves a command buffer past its first pool keeps them begun (only a command buffer's first pool's encoders take them), and the command buffer grows its made primaries to POOL_HOLDS beside them: lavapipe (msi, m3-max-36541) saw a spare of 35, 32 primaries, a secondary and two begun ahead, past the fewest test's bound of POOL_HOLDS + 2. The bound is POOL_HOLDS + AHEAD + 1 now, and the spares module docs say where the begun ones sit. Verified: the rest of that job's 243 touched tests passed; this test's run follows. |
||
|
|
bdd4710e92 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
9afd9699e1 |
RUNTIME 2455: Spares: primaries are begun ahead on a device thread, one for each encoder the pool last served, eight at most
Verified: m3-max-36547 at 5774363889, lavapipe begin_ahead|spares|draw_again|pending_audit 72/72, clippy (host, m2v_cpu_icd) 0; m3-max-36546 clippy --cfg m2v_gpu 0; m3-max-36541 at 9f9a9a2019 rustdoc 0; negative control m3-max-36540 (AHEAD = 1) fails both new tests (taken 1 against 5; missed 1 against 5). PHOENIX (m3-max-36549) runs after the merge. |
||
|
|
566dc02f9d |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
32285d7988 |
RUNTIME 2454: Carries: a queue holds sixteen, a frame's dozen side by side each open warm
A program that encodes each frame as about a dozen command buffers side by side (measured: 11 to 12 a frame) opens each of the next frame's against the carries of this frame's commits. A queue held four (queue::CARRIES), so over a third of them opened with no carry (measured: 333 a second of 883 command-buffer parts), and each one's first draws took every step. Sixteen hold a frame's with room. Memory held per queue at sixteen, measured on lavapipe (msi, job m3-max-36477, a throwaway test that dropped the carries a queue held and counted the heap bytes freed with a counting allocator): 33,952 bytes a carry whose encoders drew once, 34,384 a carry of 100-draw encoders, the same in each of four rounds; 16 carries 543,232 to 550,144 bytes (about 0.53 MiB) a queue, against about 0.13 MiB at four. size_of: Carried 920, LiveBind 21,072, BindState 632. A carry's live bind goes back to the device's live binds as it is let go. Scope: the test's one-state draws; a program's carries with more slots bound hold larger tables (unmeasured). Test: tests::carried_draws::a_dozen_command_buffers_encoded_side_by_side_ each_open_from_a_carry_their_queue_holds, two groups of twelve: each of the second group opens from a carry (kept_draws_carried_across 12), none let go at a commit, only the first group's draws take every step, the pixels those of the same passes on queues of their own. side_by_side_frame takes the group size; the existing callers pass 2. Verified: lavapipe (msi) carried_draws 16/16 at the scratch commit with the same tree plus the measurement (m3-max-36477); the negative control and the tip's own runs follow. Verified: m3-max-36493 at 3c8f52ce23, lavapipe carried_draws|spares|draw_again 76/76, clippy (host, m2v_cpu_icd) 0, rustdoc 0; m3-max-36494 clippy --cfg m2v_gpu 0; negative control m3-max-36492 (CARRIES = 4) fails the new test (across 4 against 12). PHOENIX runs after the merge. |
||
|
|
9dc0a6a6ef |
Docs: name no workload of a consumer's benchmark
docs/FAST-PATHS.md's unshared-isolation row and a spares test's doc named two workloads of a guest compute benchmark; they now say 'one workload' and 'a guest's compute workload'. The repository names no consumer app, benchmark or workload. No behaviour change. Verified: git grep for the benchmark's and its workloads' names finds none after the change. |
||
|
|
5ecdb6a1ac |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
e63ecb9405 |
RUNTIME 2453: Host pages: a buffer inside a no-copy buffer's own dma-buf import dedicated to nothing is bound in it
What: Device::bind_in_import now binds a no-copy buffer whose pages a live import of dma-bufs holds all of inside that import, as it does inside an import of the pointer, where the import is one VkDeviceMemory dedicated to nothing (a no-copy buffer's own dma-buf of one chunk, a piece of a shared file's import, a guest RAM chunk's). The new VkBuffer is made for the import's handle type (VkExternalMemoryBufferCreateInfo DMA_BUF, from bound_memory), its alignment and memory type checked as before, and the holding import is kept imported for good (HostImport::pages(ReadApart::Inside), as for a pointer import). Still refused: an import the driver took only dedicated to its buffer (DmaBufPages::dedicated_to_buffer, NVIDIA 615's retry) and several chunks bound to a sparse buffer (no memory); those pages stay a copy, or an import of their own beside dma-bufs. Before, every dma-buf import but a guest RAM chunk's refused, so such a buffer was a copy (copied_over_live_imports) whenever it came with no dma-buf source, or a second import beside it. The Vulkan rules: VUID-vkBindBufferMemory-memory-02985 (a buffer bound to imported memory names the import's handle type in VkExternalMemoryBufferCreateInfo::handleTypes, which host_buffer does from bound_memory's External(DMA_BUF)); VUID-vkBindBufferMemory-memory-01508 binds only the dedicated buffer where VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, which holds only for the dedicated retry, still refused; VUID-vkBindBufferMemory-None-10739 (offset a multiple of the alignment) and -memory-01035 (memory type) as checked before. Why: on the Iris, with a platform mapping a view of guest pages through one dma-buf, a guest heap's region takes a 2 MiB no-copy buffer imported through that dma-buf, and the 256 KiB buffers placed in the heap's pages, handed over by their pointer alone, became copies of the pages over the live import: 582 copy ins compared a second, each the copy's whole 64 pages (155 MB/s), 10.7 MB/s copied in, commit_nanos 43.7 -> 120.5 ms/s. With the views mapped from their files the same buffers were bound inside the pointer import (buffers_bound_in_import), with no copy. dma_buf_buffer_imports_dedicated was 0 there: every such import was dedicated to nothing. Docs: bind_in_import's doc no longer says a buffer's own dma-bufs' memory is that buffer's alone; dma_buf.rs's module docs, import_from_source's and chunks_buffer's `sole` contract and DmaBufPages::dedicated_to_buffer say a buffer over part of the pages binds inside an import dedicated to nothing and in none dedicated to its buffer; FAST-PATHS's NVIDIA dma-buf gap says the same. Test: tests/dma_buf_beside.rs's without_pointer_imports_a_buffer_inside_a_live_dma_buf_import_is_bound_in_it, on a device made without VK_EXT_external_memory_host: a first no-copy buffer over 4 pages of a memfd with a dma-buf source, then inside it a second with no source and a third with one, each bound inside ([0, 0, 0, 0, 1] of copied over live, beside, inside live, pointer imports, bound inside) where the first's import is dedicated to nothing (else a copy, and beside or a copy); the GPU reads the CPU's bytes through each, a CPU write before the commit reaches a copy through the second, a fill through one and a copy through the other in one encoder are ordered either way, and after the first's release the second's fill reaches the file's pages and reads through the third. Verified: m3-max-36423 at e377c24dce, clippy -D warnings (runtime and translator, all targets and features) 0 and rustdoc -D warnings 0. Lavapipe tests, the negative control, the cfg clippy and PHOENIX run after the merge. |
||
|
|
3ce1d01744 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
aa272cd706 |
Rebind: record the refusal while a dispatch's host step is left as a known gap
A compute encoder can leave a dispatch to its host step (Deferred::Dispatch, indirect_dispatch.rs): an indirect dispatch off the GPU's own path, or any dispatch while an indirect stage-in region is set. The host step reads the arguments once the work before it completed, and resolves the buffers its encoder named as it records. Deferred::resolved_at_its_calls is false for it, so the commit keeps the pages of every buffer over host pages the command buffer used until it completes. A rebind of one meanwhile is refused with Invalid(Rebind(EncodedUses)), where Metal's replace before the submission reaches the new pages. Encoding the encoder again (the reverted 947c110e49) would not reach this path: the rebind is refused before any encoding again. So the behaviour stays, and is now recorded: - rebind.rs's module doc lists the dispatch among the commands that keep a committed command buffer counting as uncommitted until it completes, with the refusal; - the doc comments of RebindProblem::EncodedUses and of Buffer's and Heap's rebind_bytes_no_copy name the committed case; - Deferred::resolved_at_its_calls names its false arm (an execution, a dispatch left to its host step, a loop's check); - the runtime README's rebind sentence names the committed case; - docs/FAST-PATHS.md has a known-gaps entry. HOWTO does not state the rebind's refusal, so it is unchanged. The test is host_step_reads.rs's a_rebind_while_an_indirect_dispatch_s_host_step_is_left_is_refused_until_completion. On a device without device addresses (shaderInt64 withheld), it dispatches [4, 1, 1] threadgroups from a no-copy page behind a shared-event gate, and rebinds the page before the signal over one holding [2, 1, 1]. It asserts: - the rebind is refused with Invalid(Rebind(EncodedUses)); - the command buffer completed with no error; - the host step ran; - the dispatch ran the encoded page's 256 threads; - a rebind is taken once the command buffer completed. Degradation kinds added or removed: none. |
||
|
|
286d25bded |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
439b3b7280 |
RUNTIME 2452: Sparse scrubs: a rebind encodes the encoder of a scrub again
A blit or a render pass that writes a sparse texture leaves a scrub of the unmapped tiles it wrote, recorded at its batch's submission (Deferred::SparseScrub). Deferred::resolved_at_its_calls answered false for it, so the commit's steps_hold kept the pages of every buffer over host pages the command buffer used until completion, and a rebind of one before the first submission was refused with Invalid(Rebind(EncodedUses)). Had it not been, the encoder kept no log (Unlogged::Segments), and the submission would have failed EncodedUseRebound. The scrub zeroes tiles of its texture alone, as its batch mapped them, and reads no buffer. So it is now resolved at its calls, and left again by an encoding again: the blit or pass encoded again leaves its own scrub over the same texture, and the first's goes unrun (finish_replay prepares it; splice_replay retains the first's). Unlogged::Segments now names only a GPU-written indirect dispatch's host step. The docs of records_again, finish_replay and splice_replay name the scrub. The test is tests/rebind_sparse_scrub.rs. The texture's left tiles are mapped, then a blit writes the whole texture and fills a no-copy buffer behind a shared-event gate. The buffer is rebound before the signal, and the test asserts: - the command buffer completed with no error; - one encoder was encoded again; - the fill reached the new pages and not the old; - the mapped tiles hold the blit's texels. The control (this commit's deferred.rs reverted) fails at the rebind with Invalid(Rebind(EncodedUses)). Degradation kinds added or removed: none. Verified: m3-max-36396 at 8f4ce875f5 (same tree), clippy -D warnings of the runtime (all targets and features) 0 and rustdoc -D warnings 0. The cfg clippy, the control, the rebind tests, the suites on lavapipe and the sparse conformance replay run after the merge. |
||
|
|
56c04b2f41 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
f27f432487 |
RUNTIME 2451: Shadows: a gated copy in copies from the truth's buffer as its call found it
RUNTIME 2450's test, dirty_pages_device::a_rebind_before_the_first_submission_encodes_a_gated_copy_in_s_encoder_again, failed on lavapipe at RUNTIME 2450 and at the tree before it alike (m3-max-36334): rebind_bytes_no_copy answered Invalid(Rebind(EncodedUses)), not EncodedUseRebound. A shadow's copy in left to its batch's submission (Deferred::GatedCopyIn) read the truth's VkBuffer as its record ran there (ShadowBuffer::Rebound), so it was work whose step resolves what it records then (Deferred::resolved_at_its_calls false): its commit held the pages of every buffer over host pages the command buffer used until it completed (steps_hold), and a rebind of one meanwhile was refused at the call, as for a command buffer not yet committed, where Metal's replace is not. The rebind never reached the encoding again, so RUNTIME 2450's predicate (Deferred::left_again_by_an_encoding_again for GatedCopyIn) was inert on that path; the test's control at development's files fails on the same refusal. Now a GatedCopyIn captures, at its encoder's call, the VkBuffer of a truth a rebind may move (GatedCopyIn::from: bytes of a buffer over host pages, the only such truth a gated copy in reads, a log's; a standing one's truth only the runtime's commands write), and its record at the submission copies from it (ShadowCopy::record_gated and record_moves take it beside the gate; every other caller passes none and reads the buffer as it is). Its recording then reads nothing of a buffer resolved later, and Deferred::resolved_at_its_calls answers true for it: the command buffer lets those pages go at the commit (held weakly until its first submission), a rebind before that submission is not refused but encodes the encoder again, whose own gated copy in captures the new buffer and takes the first's place (RUNTIME 2450), and a rebind after it leaves the old pages to the command buffer until it completes. A first gated copy in whose encoder a rebind could not encode again is let go of with its encoder's failing segments (State::fail_part, before record_scrubs), so no captured buffer is recorded after its pages went. Docs: shadow.rs (GatedCopyIn, record_gated), deferred.rs (resolved_at_its_calls), and attached_read_faces' busy lane, which said a rebind there is refused. Verified: cargo fmt only; the job reported with this tip runs RUNTIME 2450's test (which this fix-forward makes pass) and its control. Degradation kinds added or removed: none. Verified: m3-max-36366 at fc0e1aee30 (same tree), clippy -D warnings (runtime; m2v_gpu; m2v_cpu_icd runtime+validation) 0 and rustdoc -D warnings 0. The control, RUNTIME 2450s test, the rebind tests and the touched suites on lavapipe run after the merge. |
||
|
|
2687d19eb6 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
5410cd5cf4 |
RUNTIME 2450: Shadows: a rebind encodes the encoder of a gated copy in again
An encoder that left a shadow's copy in to its batch's submission (Deferred::GatedCopyIn: over host pages a consumer logs, the regions its log decides; or a command buffer's first copy in of a shadow that may stand across command buffers) kept no log (Unlogged::Segments): no Segment::records_again test held for it. A rebind, before the command buffer's first submission, of a buffer over host pages that encoder used then failed the command buffer with EncodedUseRebound, where Metal resolves the use at the submission. Keeping the log alone would not do: the encoding again redoes the copy in for itself (a gate of the log taken again, a standing decided at the submission, ended_encoders_wrote answering false while replaying) and leaves a GatedCopyIn of its own, or records the copy in in place, but finish_replay asked every other segment to record on the GPU alone, which a gated copy in does not, and refused the encoding again. Now Deferred::left_again_by_an_encoding_again answers for GatedCopyIn too: the encoder keeps its log, its place takes the encoding again (splice_fits), finish_replay prepares the encoding again's segment as the commit prepares one (no recording, StepInputs::None), and the batch's submission records it (submit.rs's record_scrubs, which takes every unrecorded such segment). The first's goes unrun, retained. A gated copy in made by the encoding again holds a gate of the log made after the commit's decisions (DirtyShadows::committed), whose decision is none, so it copies every region (CopyInGate::regions): a superset of the rows the log reports changed, read at the submission, after every CPU write before the commit; the shadow's hold was advanced to the commit's stamp by the first gate's decision, and its image then holds at least that. Its cost, one whole copy in, falls only on a rebind of such an encoder. A standing gate is decided at the submission (stands), as the first's would be. GPU parts are unchanged: a gated copy in starts none. Unlogged::Segments now names a GPU-written indirect dispatch's host step and a scrub. Docs: deferred.rs, rebound_use.rs, encoder.rs, reencode.rs, shadow.rs (GatedCopyIn). Test: dirty_pages_device's a_rebind_before_the_first_submission_encodes_a_gated_copy_in_s_encoder_again: a kernel inverts a shadowed RGBA8 texture over a logged no-copy buffer into a plain texture, behind a shared event only the host signals; the buffer is detached and rebound over other pages, logged by the same log, before the signal. Asserts the command buffer completes with no error, the rebind encoded the encoder once, one gated copy in ran (the encoding again's) and copied every row (dirty_copies_in_gated +1, dirty_copies_in_whole +1), and the kernel read the new pages' texels. At development's files it is expected to fail on the error (EncodedUseRebound). Degradation kinds added or removed: none. Verified: m3-max-36334 at a7b5d28822 (same tree), clippy -D warnings of the runtime (all targets and features) 0. Rustdoc, the cfg clippy, both controls, the rebind tests and the touched suites run after the merge. |
||
|
|
3858812d69 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
dcac15a5c6 |
RUNTIME 2449: Host RAM: a rebind encodes the encoder of a gather staged past the imports again
An encoder that left a gather from a guest RAM staged through the CPU kept no log (Unlogged::Segments) where an encoding again could not copy the gather through the imports in its place: over a chunk that takes no import while it runs (Staging::cpu_only: a chunk the device refuses, or one an object's own import of its pages holds back), or in a part of its own after the GPU completed the work before it (Staging::after_the_gpu: a copy into those chunks was recorded, or a buffer over host pages lies over the bytes), which a copy through the imports would not start. A rebind, before the command buffer's first submission, of a buffer over host pages that encoder used then failed the command buffer with EncodedUseRebound, where Metal runs it over the new pages. Now such a gather is staged again as its first encoding staged it, as RUNTIME 2448 does for a staged scatter: HostRamCall::staged_again answers the first encoding's Staging for a gather that is not Staging::through_imports (StagedGather::encoded_again_through_imports), and Deferred::left_again_by_an_encoding_again answers for such a GatherStage, so the encoder keeps its log, its place takes the encoding again, and finish_replay leaves the step for its host step. Every other staged gather is copied through the imports by an encoding again, as before (Deferred::recorded_by_an_encoding_again). Unlogged::Segments now names a GPU-written indirect dispatch's host step, a scrub, and a shadow's copy in left to its batch's submission (shadow::GatedCopyIn, which no Segment::records_again test holds either; the doc did not name it). Docs: host_ram/copy.rs (First touch, the gather; Staging; StagedGather), deferred.rs, encoder.rs, reencode.rs, rebound_use.rs, and docs/HOWTO.md's two sentences on a gather's rebind. Test: host_ram_copy_device's a_rebind_before_the_first_submission_encodes_a_gather_staged_after_the_gpu_again, on the shape of a_first_gather_over_chunks_a_scatter_wrote_waits_for_no_import (each chunk import held in flight 300 ms by making_pause): one encoder scatters into scattered pages, gathers them back (staged after the GPU, the scatter having written the chunks) and fills a no-copy buffer, behind a shared event; the buffer is detached and rebound before the signal. Asserts the command buffer completes with no error, the first encoding staged both copies, the rebind encoded the encoder once and staged both again, the fill is in the new pages alone, the RAM's runs hold the scatter's bytes, and the gather's buffer holds them too. At RUNTIME 2448's files it is expected to fail on the error (EncodedUseRebound): the gather's step keeps the encoder from keeping its log. Degradation kinds added or removed: none. Verified: m3-max-36303 at 75b7873bc2 (same tree), clippy -D warnings of the runtime (all targets and features) 0 and rustdoc -D warnings 0. The cfg clippy, the lavapipe control at the old files, the staged rebind tests and the touched suites run after the merge. |
||
|
|
eb57e734d7 |
submission_turns: the hand-off checks wait for no completion until every command buffer was submitted
a_pass_s_submission_handlers_run_while_it_goes_on_grouped failed once on lavapipe at 7399e1ebfc (job m3-max-36231, msi under three builds' load): the earlier command buffer's submission handler started 200.3 ms after the pause after the later one's submission ended. That is one whole extra pause: the later command buffer was submitted first and the earlier one after it, its handler handed off only after its own submission's pause. The checks release the scheduler's thread and then wait for each command buffer's completion at once. A thread about to block passes for itself where no pass is under way (Scheduler::submit_before_waiting), and its pass submits only command buffers with no submission handler, each behind no earlier commit it overlaps: one that came between the scheduler thread's passes took both commits in, submitted the later one (no handler, another queue, another target) and left the earlier one, whose handler it may not run, to the thread's next pass. Nothing of the runtime's early wake is on this path: these checks commit with `commit`, and only `commit_and_submit`'s pass wakes the thread early. Both FirstWork checks now poll, without a wait for completion, until the scheduler's thread submitted every command buffer (CommandBuffer::submit_returned_time), then wait. The hand-off check also asserts the submission order (earlier before later) and prints both submissions' returns after the held one's, so a failure names which order it saw. Verified: to be run on lavapipe (submission_turns) and in the next PHOENIX suite. |
||
|
|
6300970312 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
ce22739364 |
RUNTIME 2448: Host RAM: a rebind encodes a staged scatter's encoder again, staging it again
An encoder that left a scatter into a guest RAM staged through the CPU (Deferred::ScatterStage and ScatterDrain, host_ram/copy.rs) kept no log (Unlogged::Segments): no Segment::records_again test held for those steps. A rebind, before the command buffer's first submission, of a buffer over host pages that encoder used then failed the command buffer with EncodedUseRebound, where Metal resolves the use at the submission and runs it over the new pages. Keeping the log alone would not do: an encoding again took no chunk (takes() is empty there, and so is the kept plan's) and copied the scatter through the imports, which starts no part, while the staged scatter's CPU copy goes in a part of its own; splice_fits refuses an encoding again with fewer parts. And a scatter staged because a chunk takes no import while it runs (CopyTake::CpuOnly) cannot go through the imports at all. Now the call records how its first encoding staged it (HostRamCall::staged, set where the staging is decided), and an encoding again stages a scatter so marked again (HostRamCall::staged_again): no kept plan, no imports, record_staged_scatter from where the buffer lies then, its two steps and its part as the first's. It is the first encoding's own decision made again. Deferred::left_again_by_an_encoding_again answers for ScatterStage and ScatterDrain too, so such an encoder keeps its log (Segment::records_again), its place takes the encoding again (reencode.rs's splice_fits), and finish_replay leaves the two steps for their host steps as the commit left the first's. The first encoding's steps are retained unrun, as a replaced splice's are; the stage takes its arena region only at its step, so the unrun one takes none. Every other copy in an encoding again goes through the imports as before. Unlogged::Segments now names a GPU-written indirect dispatch's host step, a staged gather over a chunk that takes no import or in a part of its own, and a scrub. Docs: host_ram/copy.rs (First touch, the scatter; takes), deferred.rs, encoder.rs, reencode.rs, rebound_use.rs, and docs/HOWTO.md's sentence that such a rebind failed EncodedUseRebound. Test: host_ram_copy_device's a_rebind_before_the_first_submission_encodes_a_staged_scatter_s_encoder_again, on the shape of the staged gather's: a blit encoder scatters into scattered pages (a page named twice) and fills a no-copy buffer, behind a shared event; the buffer is detached and rebound before the signal. Asserts the command buffer completes with no error, the first encoding staged the scatter, the rebind encoded the encoder once and staged the scatter again, the fill is in the new pages alone, the RAM's runs hold the scatter's bytes (the later's for the page named twice), and the page beside them is unchanged. At development's files it fails on the error (EncodedUseRebound). Degradation kinds added or removed: none (EncodedUseRebound stays, for fewer encoders). Verified: m3-max-36269 at ebf9c7563f, clippy -D warnings of the runtime (all targets and features) 0. Rustdoc, the cfg clippy, the lavapipe control at the old files, the new test and the touched suites run after the merge. |
||
|
|
56d06bc71d |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
865e824a97 |
RUNTIME 2447: Carried draws: a queue holds the carries of its latest four commits; draws_none_kept_uncarried
What: a command queue's place held one carry (render/carried.rs), the kept draws of its latest command buffer's last render encoder, and each commit that carried replaced it, letting the one before go untaken. It now holds up to four (queue::CARRIES), the latest first; a render encoder that holds no carry of its own takes the latest that fits its pass (carried_fits, checked at the opening as before), and one that does not fit stays held for another. With four held, the commit that hands a fifth lets the one held longest go (kept_draws_carry_dropped_commit). A new count, WorkCounts::draws_none_kept_uncarried, splits draws_none_kept: those of encoders that opened from no carry. Why: a consumer deals each of its compositor's command buffers (about 63 render encoders) into about 11 command buffers of one queue, encoded side by side and committed in order. Each one's first render encoder opens before the ones just before it commit, so the one carry its queue held reached at most the first opener after a commit, and the next commit replaced it (374/s let go untaken, 378/s taken, in a profiled 26.7.2 walk on the Iris). The others opened cold: draws_none_kept ran at 4.6 to 5.0 per such command buffer on three 26.7.2 walks, each about 128 us of host CPU against about 14 us rebound, 27% of the walking threads' samples. A carry names the program's objects by key and handle alone (index buffers, vertex buffers and bind state values as ResourceKey and raw handles, pipeline states and interfaces weakly); what it holds strongly is the runtime's own (settles' variants and plans, VkPipelines, draw settings), so a queue holding four keeps no program buffer or texture alive. Test: tests::carried_draws:: command_buffers_encoded_side_by_side_each_open_from_a_carry_their_queue_holds (two command buffers encoded, then committed; two more encoded: both open from a carry, none let go at a commit, only the first two draws counted uncarried, pixels as on queues of their own) and a_carry_held_beside_another_keeps_no_released_buffer_alive (a host page's no-copy index buffer the first one draws, released once the first two committed, is freed, its deallocator run, while its carry sits held beside the second's; the fourth pass then opens from it and draws another buffer's indices). Verified: m3-max-36241 at bdafc3ba84, clippy -D warnings (runtime and translator, all targets and features) 0 and rustdoc -D warnings 0. Lavapipe touched suites (36242), the CARRIES = 1 negative control (36243) and clippy under m2v_gpu/m2v_cpu_icd run after the merge. |
||
|
|
e76cb0e374 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
d3a79a68db |
Early wake: a committing pass's own submission handlers wait for no later submission, which may go first
With the early wake (RUNTIME 2445) the scheduler's thread is woken before the committing thread runs its own command buffer's submission handlers, so it may submit a later batch before they start. The docs still said they run before any later batch's submission, and the check asserted it: its own handler noted one kernel submission at its start. That held in the check only while the scheduler's thread was held until the handler began. With the thread asleep and free (d4142474fd), job m3-max-36199 on lavapipe: the Exact variant failed it, the handler noting 2 submissions at its start (the scheduler's thread had already submitted second's first), with all three later batches submitted by its end (Some(3), no slice rescue). The handlers wait for none of those submissions, which is what the early end buys; when a later batch's submission comes relative to them is not ordered. The check now asserts that the handler ran inside the call; the early end is asserted by the pass's counts (one batch at commit, one early end), the wake by the three submissions by the handler's end, and the handler order as before. The runtime README, the scheduler's module docs, commit_and_submit's docs and WorkCounts::scheduler_passes_at_commit_ended_early now say so. Verified: to be run on lavapipe and PHOENIX, with the no-wake control. |
||
|
|
c2c28b0565 |
submission_turns: the committing pass's check stages the scheduler's thread asleep
The check of a committing pass that ended at its own submission handlers held the scheduler's thread after a pass (waiter_submits::Held). Its control without the wake (c9bda0351d) still passed, 14/14 on lavapipe (job 36157): the pass's mark (state.dirty) alone sends a thread that is held, not asleep, on to the left batches as soon as it is let go. The check now waits until the scheduler's thread sleeps with nothing to do (Scheduler::asleep), then holds every commit_and_submit before its pass (trace::Point::AtCommitPass) as its commit is posted with no wake (trace::posted_count), four in all, and lets only the first go on (trace::let_through), whose pass takes all four in. With no wake the sleeping thread never sees the mark while that handler runs, so the three later command buffers are submitted by its end only at the wake (Some(3), with no slice rescue). The assertion on that runs before the wait for completion, so a missing wake fails there, with the counts, and not at the completion's timeout. Verified: to be run on lavapipe, with a control that removes the wake. |
||
|
|
43d2fa26ff |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
8562b28fe4 |
RUNTIME 2446: Shadows: a split merge on the host copies no piece; its kernel skips their columns
A merge on the host past shadow_merge::HOST_WHOLE_BYTES split: its host step stored the pieces of each row in lines beside the texels, and its kernel the rest. To keep the kernel off those lines, the GPU copied the pieces' kept bytes into an arena region and their changed bytes over them in the kept part: two vkCmdCopyBuffer calls of one region per piece. On the Iris Xe (ANV) that work cost about 7 to 9 us a region, growing with the rows, not the bytes: about 0.6 ms for 34 rows (m3-max-35898) and about 15 ms for 1024 (m3-max-36118: a BGRA8 1023x1024 render target over host pages drew in 17.57 ms a command buffer as a shadow against 1.26 ms in place, its host step 0.28 ms of it). Now the kernel takes a column window (bind::ShadowMergeModule: two more push words, PUSH_BYTES 24; shape_within, shape the whole row): a word outside the columns is neither read nor written in either store form, and counts as unchanged in its block. A split merge pushes the words between each row's pieces where every row's pieces lie at the same places in it (shadow_merge::columns: whole words, the same head and tail each row; rows whose pitch is no multiple of the line differ, and those merges go on the host whole). It records the changed copy and its dispatches alone, with no save, no mask, two fewer barriers and no arena region; the host step reads each piece's kept and changed bytes in the scratch's two parts, which nothing writes after the changed copy. Removed: HostMerge::saved, ShadowMerge::saves, ShadowCopy::merge_saves, the merge's region in EncoderCore::merge_on_host, MergeDrain::_region, and the split's copy uses of the kept part. The bound stays 1 MiB; its doc comment states the measured costs. Linear merges push the whole row. Tests: - bind::shadow_merge's a_region_merged_within_columns_leaves_the_words_outside_them: 70 rows of 6 words, columns 1 to 4, every word changed; words outside the columns keep the current buffer's, in both store forms, and a window of every column equals shape. - shadow_runs' merges_on_the_host_go_whole_up_to_the_bound_and_split_past_it also asserts shadow_merge_words_examined: every word of the whole merge's rows; for the split, the words between each row's pieces alone (height * (row bytes - line) / 4). - shadow_write_lines' cost test gains a 4K shape: 3839 RGBA16Float texels a row, 2160 rows 30720 bytes apart. The merge module is under no golden table (golden_hashes covers the fixtures' translations). api_signatures: PUSH_BYTES, shape, and the new shape_within. Degradation kinds added: none. Landing note: msi m3-max-36189 at 4b09425f2d (same tree): clippy metal2vulkan + runtime, all targets and features, CLIPPY=0. The API tables, the module tests, rustdoc, clippy m2v_gpu / m2v_cpu_icd, the lavapipe control (development's whole-row kernel fails the split test's words-examined count) and the touched suites, PHOENIX and the Iris re-time follow on development. |
||
|
|
6df2d88550 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
7fa39e82e5 |
RUNTIME 2445: Scheduler: a committing pass that ended at its own handlers wakes the scheduler's thread before running them
What: where a commit_and_submit pass ends right after its own command buffer's last batch with
batches left, it marks the state for the thread's pass (State::dirty) under the lock. Right after
the lock is free, before the completion turn it owes and before its handlers, the committing
thread wakes the scheduler's thread (wake_thread, Woken::Host). That pass reports no left_over,
so the end of submit_at_commit does not wake the thread again; passed_over() is still checked.
The thread passes while the committing thread runs its handlers; the batches it submits take
later Turns tickets, so their handlers still run after the committing command buffer's.
Why: in PHOENIX m3-max-36098 (the guest-shaped SubmissionHandlers leg after RUNTIME 2442), the
time from an early end to the next kernel submission made by the scheduler's thread was
p50 27 / p90 278 / p99 986 / max 1273 us (212 samples). The left batches waited for the
committing thread's handlers and the wake after them. The usual wake (wake_for, inbox.nudge)
skips the wake while the committing thread is still counted as the passer, and pass_once_then
never looks again. The scheduler's thread is never gated by a counted passer: it waits only for
the lock.
Tests: submission_turns' a_committing_pass_ends_at_its_own_submission_handlers_{exact,grouped}
now let the scheduler's thread go once the committing command buffer's handler has started. That
handler waits, up to two seconds, for the three later command buffers' submissions
(CommandBuffer::submit_returned_time), and all three are made before it ends (none without the
wake). The handler-order assertion stays. The test's messages lose the runs of spaces an edit
left in them.
The check also requires no sleep-slice rescue (WorkCounts::scheduler_slice_rescues moves by 0): the first control with the wake removed (ctl/complat2f 86baad51c4, lavapipe m3-max-36134) passed the timed check, because a 100 ms WAIT_SLICE let the left batches go within the handler's two-second bound.
Verified: msi m3-max-36132 at 46c7eedd4a (product code as landed): build, runtime clippy plain and --cfg m2v_gpu, unit, sigs EXIT=0. The tightened check at the tip and its control (m3-max-36157), the suites, clippy x3, rustdoc and the PHOENIX legs (m3-max-36158) follow on development.
Degradation kinds added: none.
|
||
|
|
81280c01f4 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
c602b94223 |
RUNTIME 2444: Host pages: remove the lend of free padding to the copies; such render targets are shadows
What: a texture that renders over host pages whose rows end inside a line, with
free padding, whose renders failed, no longer takes its image in place when the
class's copies failed too. Removed: in_place::lent_to_copies and lends, the lend
branch in in_place() (it now asks each access's own verdict and nothing else),
unlent_words and the shadowed-texture notice words it added,
degrade_line_write_back and line_write_back_reason, the storage form move's lend
count and notice, Degradation::LineWriteBack ("line-write-back") with its
docs/API.md catalogue entry, the device test lent_dma_buf_targets, and the
validation lane's LINE_WRITE_BACK list. copies_verdict stays: through
InPlaceChecks::decided it now decides only whether a shadow's copies back and
merges into such pages are spliced (shadow_splice::splices). FAST-PATHS's
host-pages row and the Iris known gap are edited in place.
Why: the lend loses CPU writes Metal keeps. Both Macs kept render padding over
buffer rows (m3-max-35486 and 35487: clear-and-store and draw changed 0 bytes;
only the UHD 630's kernel changed any), and the lend's render passes write the
rows' last lines back whole on the Iris. Its stated reason was that the shadow
lost the same bytes. That no longer holds: the shadow splices its copies back
and merges on the host on such devices, and on the Iris (m3-max-35898) its
clears and draws put back 0 bytes against the copy control's 5,941 in 300
rounds. Under the user's contract rule a form that loses writes Metal keeps is
deleted, not kept behind a switch.
Guest cost, bounded by counts: the guest's Iris Forward+ boot (reims run 35408
at
|
||
|
|
4a9fc2ac19 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
61b3749144 |
RUNTIME 2443: WorkCounts::dma_buf_sparse_binds; DmaBufRequest and HOWTO state what several chunks cost
What: a new WorkCounts field, dma_buf_sparse_binds, counts each
VkSparseMemoryBind the dma-buf chunks bind a sparse buffer with (one a
chunk, counted in dma_buf.rs's chunks_buffer once the binding is made).
DmaBufRequest's rustdoc and docs/HOWTO.md now say what an answer of
several chunks costs: each chunk is one sparse bind, which RADV makes a
GPU virtual-address operation of its own, updating the GPU's page tables
as the buffer is bound and again as it is released, where one chunk binds
a plain buffer in its import with no such update. The advice: answer a
request whose pages lie in several runs with one dma-buf of those runs
where the source can (udmabuf's UDMABUF_CREATE_LIST, up to list_limit),
and with several chunks only where one dma-buf cannot hold them. The
host_ab example lists the count.
Why: a consumer's guest compute walk on the RX 7900 XTX (RADV, Mesa
26.2.6) rose 0.4 s in its heaviest workload once its source answered
guest buffers with many pieces of its RAM's region files: 81 sparse
buffers over about 5,000 pieces in one second of setup, followed by
15,732 of amdgpu's page-table range jobs (377 ms of kernel SDMA jobs in
that second, against about 45 ms before), and 4,930 more as 240 buffers
were destroyed with one memory freed. Across the workloads the page-table
jobs tracked the pieces at about 3.5 a piece; the guest's own GPU job
time fell. No count said how many binds a sparse buffer took, and the
docs gave sources no cost for splitting.
Test: tests::dma_buf_shared_files's two-piece buffer now asserts two
sparse binds for its one sparse buffer (none where the device binds one
piece) and prints the count.
Verified: in the job that reports this tip (clippy of the runtime, the
dma_buf_shared_files tests on lavapipe). api_signatures blessed (one
field). No new Degradation kind.
Verified: msi m3-max-36087 at 9c5829c1ac: clippy -p metal2vulkan-runtime --all-targets --all-features CLIPPY=0; lavapipe (m2v_cpu_icd) tests::dma_buf_shared_files 10/10 ("two pieces of one file: ... sparse buffers 1, sparse binds 2", asserted). Clippy m2v_gpu / m2v_cpu_icd and rustdoc follow on development.
Degradation kinds added: none.
|
||
|
|
2c6a66c3a0 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
3348b469c2 |
RUNTIME 2442: Scheduler: a committing pass ends right after its own command buffer's last batch where that one has submission handlers
What: where a commit_and_submit pass submits its own command buffer's last batch and that command
buffer has submission handlers, the pass ends there. It takes no check, and leaves whatever else
is ready to the scheduler's thread, which the committing thread wakes as before (left_over ->
Woken::Host). The committing thread then runs its own handlers once the lock is free, before any
later batch's submission. New WorkCounts::scheduler_passes_at_commit_ended_early counts the
passes that so ended with batches left. A test-only hold point, trace::Point::AtCommitPass, comes
before a committing thread's pass.
Why: PHOENIX m3-max-35993 (the guest-shaped submit-cost leg, a trace of Turns waits by the
holder of the ticket waited behind) found one kind of wait. A segment that a committing pass
handed off waited behind that pass's own ticket: 0.12 a frame, p50 3449 us, max 4586 us. The
handler runs only after the pass's later submissions, which are costly in that leg. Every
segment after it in the one hand-off context waited too: submission return to own handler
p99 3410 us on the handler threads. The scheduler's handed segments never waited in Turns, and
committing threads never waited behind handed segments.
Tests: submission_turns' a_committing_pass_ends_at_its_own_submission_handlers_{exact,grouped}.
The scheduler's thread is held after a pass. A commit_and_submit is held before its pass while
three ready command buffers are committed after it: one on another queue, one behind it on its
own, one behind the first on the other. Its handler runs inside its call with one kernel
submission made (without this change, after all four). The pass submitted one batch and counted
one early end. The handlers run in submission order, each queue's in commit order.
Verified: msi m3-max-36060 at 0c131eff3a: build, runtime clippy plain and --cfg m2v_gpu, unit, sigs EXIT=0 (api_signatures: WorkCounts::scheduler_passes_at_commit_ended_early). Control m3-max-36061 (early return removed, lavapipe): both checks FAIL under Exact and Grouped ("submitted 4 batches, ended early 0; handlers ... [ours 4, ...]"); the other 12 submission_turns tests pass. Lavapipe suites, clippy x3, rustdoc and the PHOENIX submit-cost leg (36069) follow on development.
Degradation kinds added: none.
|
||
|
|
7cc30e485e |
Tests: a no-copy buffer's import goes at the completion past a merge on the host
RUNTIME 2440 removed the program's buffer from the host step's drains (SpliceDrain, MergeDrain), whose segment the command buffer keeps until it goes. The test that showed the hold, a_no_copy_buffer_a_committed_dispatch_writes_a_texture_over_keeps_its_import_until_completion, no longer reaches a merge on the host since RUNTIME 2438/2439: its rows fill whole lines, so no line holds a byte beside its texels, and the merge goes by its kernel alone. The new leg TextureMergedOnHost keeps the path: the same dispatch into a texture over the no-copy buffer, its rows a texel short of their pitch (511 RGBA8 texels in 2048 bytes), on a device whose every texture over host pages is a shadow (HostPageTexturePolicy::Shadow, under which the check gives no answer), so both releases (at the commit, and once scheduled) take the merge on the host. Each asserts that a host step ran (WorkCounts::shadow_host_steps grew) and that the deallocator runs once the command buffer completed, the CommandBuffer still held. Where the device's lines hold no more than a texel, the leg prints and returns. texture_write and over_buffer take the width. The texture write legs' check goes row by row: each row's texels hold the dispatch's, and the bytes past them to the pitch still hold the pages' fill (the merge keeps them); for the 512-texel rows of TextureWrite that is every word, as before. Test only; no product change. Verified (lavapipe, m2v_cpu_icd, msi m3-max-36042): - CONTROL_LVP=100 with 7713853865's shadow.rs, shadow_merge.rs and shadow_splice.rs (the drains holding `_buffer`): "host steps 1", then "the deallocator never ran" at the Committed release. - HOLD_LVP=0 at RUNTIME 2440: the new test (host steps 1 at each release) and TextureWrite, 2 of 2. - HOLDS_LVP=0: every *holds* test, 134 of 134. - clippy of metal2vulkan-runtime under m2v_cpu_icd and m2v_gpu: clean. |
||
|
|
7dc5edc687 |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
c2aedcd64c |
Diagnostics: encoder times count draws again; the pass log watches states by label hash
METAL2VULKAN_ENCODER_TIMES counted a render encoder's draws only where a draw took every step: a draw drawn again as before (render/draw_again.rs) or rebound (render/draw_again/rebound.rs) bumped the encoder's draw calls but not its timed work, so a row named a fraction of its draws (a measured guest run: rows of about 2300 draws/s against about 36k indexed Vulkan draws/s). Both paths now count as the program's draws, as every step's do. METAL2VULKAN_LOG_PASSES watched only textures by format and size, and its 256-line bound was spent before the pass of interest ran: in that run every 2768x1570 pass before the measured step printed (256 lines distinct even with object IDs left out, 171 by attachments and states alone), so the pass the encoder times ranked first never printed. A `state:HASH` entry now watches a render pipeline state by the label hash the encoder times name their rows by (encoder_trail::label_hash), so a run can name exactly the pass it needs; each state in a line carries its hash, so a line maps encoder-time rows to states. The hashes are worked out only where the log watches a state or prints a line. The bound and the once-per-pass rule are as before. Both are default-off diagnostics and change no work while off. Tests: tests::encoder_times::an_encoder_s_draws_again_count_among_its_draws (draws again as before and rebound, each counted, in a line of all its draws; fails without the fix: the line names only the draws that took every step); tests::pass_log state-entry parsing, refusals and matching. |
||
|
|
325eb61cde |
Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
f3390be7f0 |
RUNTIME 2441: Scheduler: a committing thread's pass keeps only its own command buffer's submission handlers; gated completions post with one look
What: commit_and_submit's own pass (and the pass the lowering thread makes for one left for a
render encoder's end) keeps inline only its own command buffer's submission handlers, which run
on the committing thread inside the call, in their turn, as before. Every other command buffer's
handlers whose last batch the pass submits go to the device's handler threads right after that
submission, as one segment with its Turns ticket; the committing command buffer's ticket is taken
as its batch goes, so submission order holds. Both of submit_plain_ready's places that take
handlers (a submitted last batch and one held in the group) go through keep_or_hand_off.
A transition to Completed or Error whose transition to Scheduled is still owed is posted behind a
gate only where its submission handlers have not run (gate_for_handlers); otherwise plainly. The
gated post pushes the item behind the gate and opens the poster's closing under one lock with one
look for a thread (Contexts::post_gated), where post_behind and open made one each. FAST-PATHS
records the hand-off's own cost (19.1 wakes a frame).
Why: on PHOENIX, in the guest-shaped submit-cost leg after the scheduler-pass hand-off
(RUNTIME 2437), a submission's return to its own handler was p50 991 / p99 5231 us where a
committing thread ran it (978 handlers), against p99 380 on handler threads: a committing pass's
handlers waited for the rest of that pass's submissions. The gated post's second look for a thread
cost 4.4 wakes a frame.
Tests (submission_turns): a_committing_pass_keeps_only_its_own_submission_handlers_{exact,grouped}
(fails at control C2 m3-max-35888, the hand-off reverted: the earlier command buffer's handler ran
on the test thread); a_gated_completion_is_posted_with_one_look_for_a_thread_{exact,grouped} (fails
at control D m3-max-35877, post_behind + open: [(true,2)] against [(true,1)]). The check takes the
device's queue plan.
Verified: msi m3-max-36014 at bd810397db: build, runtime clippy plain and --cfg m2v_gpu, unit
44/44, sigs, lavapipe suites 126/126 (encoder_holds TextureWrite passes). Workspace clippy x3,
rustdoc and lvpval 30/30 at the pre-rebase tip 2d09ed2392 (m3-max-35927). PHOENIX m3-max-35923
(suites at df21628b0f): handler-thread wakes per frame 50.2 -> 48.37 (post_behind + open 8.9 ->
post_gated 6.72); seen to seen-handler p50 11, p99 3658 us.
Degradation kinds added: none.
|