8167cc60dedc2f927dedff2e66045630892a5ea9
6202
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8167cc60de |
commit_and_submit: the order test drains its queue every 50th commit, as the checked one does
What: submission_handlers_keep_commit_order_across_commit_and_commit_and_submit now makes every 50th commit a commit_and_submit that first waits for the commit before it to complete, as checked_command_buffers_keep_commit_order_across_commit_and_commit_and_submit does. Why: the test asserts some submission handlers ran on a committing thread. Each commit() wakes the scheduler's thread, whose pass is often still under way at the other thread's next commit_and_submit, which then makes no pass; and on a driver whose batches group, a committing thread submits only where its VkQueue runs at most one earlier submission not seen complete, which the two threads' backlog may never leave it. On the Radeon 780M (RADV) inside the touched suites' run it failed: 0 of 1000 handlers on a committing thread, 1 pass at commit, 0 batches (m3-max-36934, debug, 76 tests in parallel). Run alone in release it passed 10 of 10 with 12-17 of 1000 on a committing thread, with RUNTIME 2461's fix and without it alike (m3-max-36983): the margin, not that fix. After a drain the scheduler's thread is idle and the VkQueue runs nothing, so the commit_and_submit makes its pass and submits alone. Verified: in the jobs named in the lane's report. |
||
|
|
2ccc3e9c38 |
Re-bless the golden hashes and the authored compile census at 9ae7edf748
What: SEMANTICS 2137 ( |
||
|
|
9ae7edf748 |
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. |
||
|
|
ba311896eb |
SEMANTICS 2137: Iris: a loop-uniform read-only slot stays a storage view (undo SEMANTICS 2136)
What: reverts |
||
|
|
4f081c3490 |
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. |
||
|
|
e6900ca020 |
Iris constant twin doc: state the per-encoder evidence, not one walk's totals
What: DriverWorkaround::PushReadsLengthenThreadPayload's doc (device/profile.rs) said a storage twin of a kernel's uniform view took 145.8 to 150.2 s of GPU time over a walk of guest compute workloads that took 137.4 s without it. It now gives the mean GPU time an encoder from the runtime's encoder times in two walks without the twin against four with it. Comment only; no code, version or answer changes. Why: the 137.4 s total came from one walk (m3-max-35702, scratch 68e39640e9). The second walk without twins, m3-max-36778 at |
||
|
|
24ccfe58db |
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. |
||
|
|
d6152c3247 |
RUNTIME 2461: Scheduler: a pass at commit asks whether a batch's host step is due, not whether it holds segments
What: scheduler::plain(), which decides what the pass of a committing thread
(commit_and_submit) and of a thread about to block may submit, left every batch that holds
segments to the scheduler's thread as a host step (LeftAtCommit::HostStep). It now asks the
command buffer whether a step is due (needs_host_step), as the thread's own look does
(holds_back, check_heads, gate_heads, place_of).
Why: BatchSync::segments is a gate alone: since
|
||
|
|
3bc091f20a |
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. |
||
|
|
c9bad0206e |
Joined completions: the order test off its own queue; a private doc link to a test-only constant
Fix forward of RUNTIME 2459 (
|
||
|
|
5dcb87e2e2 |
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. |
||
|
|
8bed9e05e4 |
RUNTIME 2460: A completed command buffer lets go of its kept footprints and its parts' sparse updates
Footprints: a completed command buffer lets go of its batches' kept footprints A batch's kept footprint (CommandBufferShared::footprints) holds a probe of each of its segments (SegmentProbe), and each probe holds a clone of the segment's work (Deferred) and of a Rerecord step input. The command buffer moves every segment's work into what it retained at its batch's submission (State::place) or at its completion (State::unplaced) and lets go of that as it completes, but the kept footprints stayed until the CommandBuffer was dropped. So a program that keeps a completed command buffer, as Metal programs keep a completed MTLCommandBuffer to read its status, error and GPU times, kept the work of every segment whose batch's footprint the scheduler had kept: a staged scatter's (its staging region of the arena and the RAM's use), a splice's (its arena regions and its merges' scratch), an execution's, a render pass's and a loop's check's among them. Nothing asks for a footprint once the command buffer completed: the scheduler asks only of the batches it holds. The release lets go of them now (Footprints::let_go), after its completed handlers and before what it retained, each popped under the leaf lock and dropped without it, as retained is. Verified: the device test tests::host_ram_copy_device::a_kept_completed_command_buffer_holds_nothing_of_its_staged_scatter failed without this on lavapipe (msi job m3-max-36825: alive after its completion 2, kept footprints' probes 1, after its drop 0; a staging of 163840 bytes). It now also asserts no kept probe after the completion; the run with this change is reported with the tip. Sparse updates: a completed command buffer lets go of its resource state encoders' updates A resource state encoder's part keeps its updates (SparseUpdate: the textures a mapping or a move names, and an indirect update's buffer) after its batch's submission bound them: that submission clones them for the bind, and the part held them until the CommandBuffer was dropped, so a program that keeps a completed command buffer kept those textures and that buffer, where Metal lets go of what a command buffer used as it completes. Nothing reads a part's updates after its batch's submission (the steps, the footprint, the fold and storage-form checks and an encoding again all come before it). The release takes them out of the parts under the state's lock and drops them without it, after the completed handlers, beside the kept footprints. Verified: see the tip report (the device test tests::kept_sparse_updates::a_kept_completed_command_buffer_holds_no_texture_its_mapping_update_names run at the commit before this one and at this one). Runtime tests: a kept completed command buffer's staged scatter, measured A device test of the case: a program keeps a completed command buffer (as a Metal program keeps a completed MTLCommandBuffer to read its status, error and GPU times) whose blit encoder staged a scatter into a guest RAM through the CPU (host_ram/copy.rs's StagedScatter: its staging region of the arena, as long as the copy's bytes, and the RAM's use). It holds a weak reference to each segment's work, taken before the commit (CommandBuffer::segment_works, a device test's view, through Deferred::weak), and asserts none is alive once the command buffer completed, while the program still holds it; it prints how many are, how many segments the batches' kept footprints probe (CommandBuffer::kept_footprint_probes), and how many are alive once it is dropped. Verified: not yet run; this commit is the measurement. Runtime tests: name the work's type in Deferred::weak's downgrade Verified: the measurement job m3-max-36816 failed to compile without it (E0308). Runtime tests: a kept completed command buffer's mapping update, measured A device test of a resource state encoder's update: a mapping of every tile of a sparse texture the program let go of once it encoded the mapping, its command buffer kept after it completed. It asserts the texture's handles' retain is gone once the command buffer completed, while the program still holds it, and prints the retain's and the texture object's holds after the completion and after the drop. Verified: not run at this commit alone; the job that runs it here and with the fix after it is reported with that fix. Verified: m3-max-36850 (msi, lavapipe) at 006565aff9: clippy --cfg m2v_cpu_icd 0; the scatter test (alive after completion 0, kept probes 0) and the sparse test ((0, 0) after completion) pass; footprint families 177/177; the sparse control at 02b1234c4d fails ((1, 1) after completion); the scatter control m3-max-36825 fails (alive 2, probes 1). Clippy plain and --cfg m2v_gpu and rustdoc run after the merge. |
||
|
|
0b674f2c1e |
Re-bless the golden hashes and the authored compile census at 884da5680a
SEMANTICS 2136 ( |
||
|
|
884da5680a |
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. |
||
|
|
3de483d86f |
RUNTIME 2459: Joined completions: a command buffer marked to join the next groups under Exact
CommandBuffer::set_completion_joins_next marks a command buffer, before its commit, as one whose completion may be seen with the next one's. Under CompletionPolicy::Exact, on a device whose merge check holds and whose queues are not relayed, a marked command buffer's batches wait in the scheduler's group as every batch does under Grouped. The first batch of the VkQueue behind them that is not marked goes last in that group, which then goes at once (GroupEnd::Closed, WorkCounts::group_ends_closed), so it is seen complete at its own end and never held back. Its submission check runs with the marked ones' (check_heads), so they are found ready together. No group is kept past its pass under Exact (Alone::Unkept, WorkCounts::batches_held_alone_unkept): a kept group can reach the GPU after the work ahead of it ended, which would delay the unmarked one behind it. Everywhere else (Grouped, no merge, relayed queues, the encoder trail, batches that never group) the mark changes nothing. Why: on the Iris Xe, ANV on i915 lists every VkDeviceMemory in each execbuffer, about 170-190 us of driver time a vkQueueSubmit at the consumer's import count, and the consumer cuts each guest command buffer into about 12 parts committed under Exact, one kernel submission each. In its walk the GPU sat idle about 1.5 ms per waited guest buffer between parts already committed, behind a backlog of those calls. The consumer will mark every part but the last of a cut whose completion nothing observes. Grouped-completion's notice, docs/API.md's catalogue, FAST-PATHS row 38, the runtime README, CompletionPolicy::Exact's doc, api_signatures and REFUSALS say so. Tests: runtime_lane::joined_completions (marked parts group and a group is closed by the last; checked parts too; a no-op where the device's own check finds no merge; unmarked parts go alone; an unmarked command buffer is seen complete while the long one behind it still runs, the marked one before it complete by then), on lavapipe with the merge assumed. Joined completions: the cost table's length, and the order test's first work done before The conformance cost table's SHARED list holds 36 rows with batches_held_alone_unkept. In the order test the marked command buffer took the new buffers' first work, which no batch in a group takes, so it went alone and nothing grouped: the buffers' first work now runs before it. Verified: clippy and lavapipe lane job m3-max-36769 showed the failure (grouped 0 with grouping true); the rerun is the next job. Verified at 8e6c37c263: m3-max-36784 (msi) clippy --workspace --all-targets --all-features 0; m3-max-36785 (msi, lavapipe, --cfg m2v_cpu_icd) joined_completions + grouped_submissions + alone_batches 21/21 (marked parts under Exact with the merge: 7 command buffers in 2 submissions; unmarked: 7 submissions, 0 grouped; lavapipe's own merge check, not Holds: 0 grouped; an unmarked buffer is seen complete at its own end). The Iris merge check answers Holds (m3-max-36725: 9.6 us in one call of 4 against 26.4 us apart). Release-mode lavapipe, clippy --cfg m2v_gpu and m2v_cpu_icd and rustdoc run after the merge. |
||
|
|
03e5c2fd24 |
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. |
||
|
|
a552a55d1f |
SEMANTICS 2136: Iris: a kernel's loop-uniform read-only slot is a uniform view
What: a new cost fact, DriverWorkaround::UniformAddressStorageReadsSlow, derived for ANV on the Iris Xe RPL-P alone. On a profile that takes it, with robust descriptors: - the memory plan finds a kernel's read-only slots read in a loop at a per-instance uniform offset (SlotPlan::uniform_loop_reads); the loop forest and the per-instance uniformity run only there (memory::plan::marks_uniform_loop_reads), nowhere else; - lowering (lower::access::loop_uniform_views) reads such a slot through a uniform view in place of its storage view when the slot is also one unwritten_slots admits: an argument the AIR declares unaliased (air-buffer-no-alias) that no store, atomic, volatile or coherent access reaches, so no write of the dispatch lands on it and the view reads the bytes the storage view would. No aliasing fact, no bind-time check, no runtime change; - the view is sized as Profile F's fallback sizes its views (fallback_view): its window's range, or maxUniformBufferRange where the window does not bound it. Then the slot states RuntimeFact::UniformViewRange as Viewed and no BufferRangeLimit, so a plan whose shape binds a buffer whose length class does not fit asks for the existing storage_view_slots variant, whose compile keeps the slot a storage view and states it Kept (a fixed point). That variant is made only for such a shape. Every other profile and stage is unchanged. Why: Iris job m3-max-36137 measured a convolution's weights, read in its tap loop at the loop counter, at 316.3 us per tap through the storage view and 249.0 us per tap through a uniform view of the same bytes (4896.8 and 4042.4 us a dispatch at 15 taps, 10589.8 and 8523.5 at 33). The uniform view is the one form A's walk and that arm measured fast; ftreg's twin removal ( |
||
|
|
47dd49ebe4 |
dispatch_chain: describe the textured form as a guest's compute encoders, naming no benchmark
A comment wording only. |
||
|
|
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. |