dc6ab2fda76014f88003fd7bcccdd3d0d155ff73
175
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c55fd4603c |
Validation: a video picture landed is the surface's mark of the other API's writes, not an acquire
The play calls Surface::external_writes_done once a picture lands on a video surface's pages. That call records no acquire: each submission part that uses the planes acquires and releases them itself, and the call marks the other API's writes on the host side. videos.rs' module doc already said so, but its counter and report line still named the call an acquire, as did docs/REPLAY-STREAM.md (the `m2v.externalWriteDone` row in section 4, and the video surface paragraph and its counters in section 10) and the replay test's doc. The executed counter video_surface_acquires is now video_surface_writes_done, and the report's `video surfaces` line says "N writes marked done" for "N acquires". Its one reader in the tree is rt_replay.rs' a_video_surface_is_waited_for_at_its_ready_point_once, updated; no script in the tree names it (grep for surface_acquires over *.rs, *.md, *.py and *.sh). The count is unchanged: one a picture landed in a surface. Wording and naming only; no behaviour changes. |
||
|
|
59d00cd865 |
Validation: the play's own buffers take each copy-form surface's buffer over its exported block
A surface in the copy form holds a buffer of the runtime's over its exported block (`Device::copy_form`), which its planes, textures over it, hold too. The play's count of its own buffers (`NewRuntime::play_holds`) took none of them, so each copy-form surface the program made between frames 100 and 200 moved `buffers_excess`. The copy-form merge leg's RX 550 (m3-max-79613) and a rerun on the RTX 5080 Laptop GPU (m3-max-79696, at 2361470bff) failed the_play_s_own_textures_take_its_video_and_exported_surface_planes on `buffers`: excess 1 at frame 100 and 2 at 200, with both video surfaces copied (Tiling) and both exported surfaces in place. No leak: the growth is the second video surface's buffer, freed with the surface. The play now holds one buffer for each video surface in the copy form while the player keeps it (`Videos::held_buffers`), and one for each exported surface in the copy form while it or a plane of it the stream holds lives (`Exported::held_buffers`), as the textures term counts their planes. The test's first exported surface is a dma-buf's, which NVIDIA's dma-buf takes in the copy form, so the exported term with a plane outliving its surface runs there too. |
||
|
|
e0f63843c4 |
replay: the longest translation at encode is an end line, not a frame's counter
translation_at_encode_max_nanos is a maximum since the device was made, so a frame's difference of it means nothing: the report gives it once, as `translation at encode longest N ns` beside the commit lock's, and keeps translations_at_encode among the executed counters. |
||
|
|
ce471296d5 |
rt: an Accumulate pass writes its visibility results as a Reset pass does, on every device
set_visibility_result_mode refused Boolean and Counting in a pass whose
visibilityResultType is Accumulate (Gap::Draw{AccumulatedVisibilityResults}, counted in
Metrics::accumulated_visibility_refused). MTLRenderPass.h documents Accumulate in one
sentence, "Accumulate visibility results data across multiple render passes." Measured
(the conformance recordings, values.rs VisibilityResultType): Metal on an Apple M3 Max
(macOS 27.0.1) adds a Counting result into the word's low 32 bits and ORs a Boolean one,
while Metal on a Radeon Pro 5300M and a UHD Graphics 630 (macOS 26.7.1) writes it in
place of the word, as Reset does. The documented sum needs an add of a query's count into
a buffer word: a scratch copy of the query results and a kernel of the runtime's own after
the rendering, which is not built. The planner ruled that the runtime answers Accumulate
as Reset on every device until that sum is built, which then replaces it everywhere.
So the setter takes every mode in an Accumulate pass as in a Reset pass, and the
encoder no longer keeps the pass's visibilityResultType, which nothing reads now.
Removed public items: DrawKind::AccumulatedVisibilityResults and
Metrics::accumulated_visibility_refused (the consumer's checkout names neither in code;
two doc comments and one test of its rt platform describe the refusal:
rt_platform/render.rs:76 and its test at :2299, rt_platform/descriptor.rs:21).
DrawKind::VisibilityResultInterrupt stays refused, its doc now saying why: its answer
needs the same add. docs/API.md's accepted differences records the measured answers; the
rt README, VisibilityResultType's doc, the validation replay's docs and
docs/REPLAY-STREAM.md follow. The validation replay test of an Accumulate stream now
holds that its modes write as a Reset pass's, nothing skipped. REFUSALS.md regenerated
(Gap::Draw loses one site); api_signatures blessed (the two removed records).
|
||
|
|
d9054b5164 |
Validation: a play's gauge records are the runtime's objects past the play's own, of each kind the program makes one at a time
A play's frames 100 and 200 are not one loop's iterations: the program makes and releases objects between them (glbench-3090-r4 holds 62 textures at frame 100 and 690 at 200), so a runtime gauge held flat there judged the program. The matrix's records of a play are now, for buffers, textures, samplers and events, the runtime's live objects of the kind less the play's own (`KIND_excess`): the stream's live objects the backend made, and the backend's own that stand for them (two-copy Managed buffers' CPU copies and the released ones a commit still copies, the asides, the guest RAM scratches; the planes' shapes, one texture a plane and shape that the plane's surface textures and views are views of; the video and exported surfaces' planes). The settled end lines at frames 100 and 200 carry the play's count of each kind as KIND_held. An excess below zero is written as it is, which results.py takes for no count. The runtime's other kinds follow the program's objects and work, not one object each: they are not replay records (the harness's loops hold those its workloads reach), and every kind stays held at zero at the device's drop. Verified: in the hand-over. |
||
|
|
f4eb47d792 |
Validation: a play's gauges at frames 100 and 200 go out as the matrix's records, every kind on its end lines
What: - The runtime backend's end lines (`Backend::live`) carry every count of an object kind the runtime keeps live: samplers, LOD clamp variants, level elements, kernel variants and entries, render contents, attachment views, descriptor slots, device samplers, shadows, resolve images, plane stand-ins, buffer set pools, surface buffers, indirect command buffers, releases waiting and handles out join them, and the pipeline cache's bytes. - At the ends of frames 100 and 200 (GAUGE_FRAMES) the player reads them once they hold still (Backend::settled_live): the runtime backend reads them every 10 ms until no release waits and two reads in a row agree on every recorded kind, for at most 2 s, a wait no frame's time holds. What the program released goes on the runtime's block-maker and reaper threads after the work before it retired, so a read straight after the frame's waits could differ between two plays. - command-replay prints, where the play ended frame 200 and skipped nothing by then, `M2V-MATRIX gauge replay-rt/STEM/GAUGE@100` and `@200` for each kind of GAUGED (gauge_records). scripts/matrix/results.py judges them as it judges the harness's: equal at 100 and 200, blocks no higher at 200. - Left out, and why: handles_out (1 while the play holds the device), releases_waiting (lowered by the block-maker thread whenever it runs), private_units (a layout of memory that follows the bytes the program holds), and every byte and age gauge, which follows the program's content and the pool's idle clock: the pipeline cache's data (bound 128 MiB), the translator's entries' bytes (bound 64 MiB), the staging bytes, the pool's allocated, idle, reserved, reused, taken and block bytes, and the shadows', resolve images' and stand-ins' bytes, whose counts are recorded. Why: the matrix's leak rule (live gauges per resource kind flat between iterations 100 and 200) reached only the harness's compute workloads. The kinds only draws and passes make (render contents, attachment views, shadows, resolve images, stand-ins, the samplers draws reach) had no such check, and a play's end lines lacked 17 of the kinds. Docs: REPLAY-STREAM.md section 10 (the end line's gauges, the settled read, the records), VALIDATION.md's gauge row, command-replay's module doc. Tests: replay::tests the_player_settles_the_gauges_at_frames_100_and_200_alone and the_gauge_records_are_the_counted_kinds_at_frames_100_and_200; replay::rt_replay the_end_lines_carry_every_gauge_the_gauge_records_carry (device); test_results.py test_a_plays_gauges_at_frames_100_and_200_are_held_flat_as_the_harness_s. Verified: in the hand-over. |
||
|
|
1c307b4608 |
Runtime: a pass rasterizes at the sample positions its descriptor sets, through VK_EXT_sample_locations
L168: a pass's custom sample positions were dropped while the guest could be told they are supported, so a non-default set rendered at the standard positions with no refusal. What changed: - VK_EXT_sample_locations joins the floor's OPTIONAL_EXTENSIONS (enabled where listed; it has no feature). Device::programmable_sample_positions_supported (programmableSamplePositionsSupported) is true where the device lists it with locations at every sample count above 1 it renders, a 1 x 1 grid, every sixteenth from 0 to 15/16 and variableSampleLocations; false elsewhere. No second form: a device that answers no refuses positions other than the defaults. - RenderPassDescriptor::sample_positions is checked as the pass begins (crate::positions): each coordinate is taken to the nearest sixteenth, a tie up, at most 15/16, and each sample past the positions given at the pixel's corner, as the conformance suite's sample_positions rows measured an Apple M4. A set that comes to Vulkan's standard locations (Metal's defaults at 1, 2 and 4 samples) rasterizes as an empty one on every device. - Refusal::SamplePositions (Count, Coordinate, OneSample, Unsupported) where Metal's validation stops the descriptor or the device answers no. Gap::RenderPass of SamplePositions for other positions beside a depth attachment (Vulkan needs a sample-locations-compatible depth image whose layout transitions name the last locations) or at a count the device's locations lack. Gap::Draw of SamplePositions for a draw in such a pass whose fragment module uses InterpolateAtSample (VUID-01524), read from the translator's GraphicsState. - A draw in such a pass takes a VkPipeline of its class made with sampleLocationsEnable and the locations as dynamic state (Raster::positions), one pipeline for every set; the encoder records vkCmdSetSampleLocationsEXT before the pass's first draw. Every coordinate handed to Vulkan is a sixteenth in [0, 15/16], which Vulkan's required 4 sub-pixel bits hold exactly, so no precision note. - The translator's description of a device that enables the extension states it (floor::shader_extension), as for every extension creation enables that the translator names; the translator reads none of its properties. tests::translator_fields gives GraphicsState::interpolates_at_sample its verdict (refused at custom positions). - The conformance rt side passes a case's positions to the runtime; the replay player sets them on the runtime's descriptor and drops its count of passes at other positions (docs/REPLAY-STREAM.md says so). - README (floor table, the device's answers, the known gap rewritten), REFUSALS.md and basis.rs, api_signatures.tsv, METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated. Tests: the device test every_device_rasterizes_a_pass_at_its_sample_positions now gates on the device's answer and holds the answer to the extension's properties; new device tests every_device_refuses_the_positions_metal_refuses and a_draw_that_interpolates_at_a_sample_is_refused_at_custom_positions; new device-free tests (placed::) of the answer's gates (each count above 1 the device renders in sampleLocationSampleCounts, a 1 x 1 grid, a range holding 15/16, 4 sub-pixel bits, variable locations) and of the placement (every coordinate in [0, 1) on a sixteenth from 0 to 15/16, refusals, the corner, the standard sets, the count and depth gaps); the replay device test sample_positions_play_through_the_runtime_s_descriptor. Verification: the lane's jobs, named in the ledger commit that follows. |
||
|
|
edee7b22ec |
Replay: the stand-in makes no import Vulkan forbids: no dedicated opaque fd import, no memory type its buffer lacks
The audit lane read the stand-in cold (standin.rs:262, 288-290 at cc3188c3da): - An opaque fd's import named the stand-in's buffer in VkMemoryDedicatedAllocateInfo wherever the driver keeps that buffer to a dedicated allocation. Such an import must name a buffer identical to the exporter's (VUID-VkMemoryDedicatedAllocateInfo-buffer-01879), and the runtime's export is dedicated to its own buffer, of other usage, whose create info the export does not give. That case is now an import the stand-in cannot make, counted with that reason; an opaque fd's import is dedicated to no buffer. - The import bound memory of the export's type without checking that the stand-in's buffer lists it (VUID-vkBindBufferMemory-memory-01035). A type the buffer does not list is now an import failure with that reason, before the allocation. docs/REPLAY-STREAM.md section 10 says both. |
||
|
|
ca370da605 |
Replay: the stand-in for the other API is Linux's and macOS's; the validation crate's clippy for Windows passes
The validation crate builds for x86_64-pc-windows-gnullvm (with llvm-mingw for the bundled SQLite, as win-cross.sh builds command-replay for the Windows play), and its clippy there (job m3-max-78094 at abf7b8f873, plain and under --cfg m2v_gpu) reported the stand-in: its writes wait under the crate's bounded fence waits (gpu::wait::vulkan), which the crate keeps to Linux and macOS, and its empty extension list for an NT handle did not type-check. Rather than a Windows form of the fence wait, the stand-in is Linux's and macOS's alone: its import is fd-only, and on any other host StandIn::new says why it is absent, so each landing is counted unwritten with that reason and the play goes on (the S1 ruling's handling of a stand-in that cannot be made). The NT-handle import, which no build compiled, is gone, and so is the device test's Windows arm: the test, under the layer through candidate::validated, is Linux's and macOS's. A plane's rows are the caller's tuple. The same clippy reported lib-test code that predates the exported surfaces and never compiled for Windows: build_support_tests.rs hex-encoded through crate::hash (not on Windows; now sha2's own lower-hex), and gpu/wait.rs's tests of the fence and Metal waits' own endings, which Windows lacks (now gated as those variants are). docs/REPLAY-STREAM.md section 10 says the stand-in is Linux's and macOS's and what Windows counts. |
||
|
|
edc657331a |
Replay: the exported-surface device test plays under the validation layer; the format doc's exported-surface records
The device test of the exported-surface snippet ran with the layer on the loader's path but not enabled: the validation crate's replay tests make their instance with no layer. Each of its plays now runs under the Khronos validation layer as the candidate runs do (candidate::validated, made reachable from the replay tests): the device must list the layer as an active tool, and any message the layer logs fails the test, the stand-in's device's included, since it lives on the runtime's instance. docs/REPLAY-STREAM.md: section 4 points at the records, section 7 gives them (m2v.newExportedSurface, m2v.surfacePlane, m2v.exportSurface, m2v.surfaceWritesDone, release), and section 10 says what the player does at each, the stand-in for the other API, what a player cannot reproduce, the runtime's hand-overs with its Metrics docs as the contract, the hand-over and exported-surfaces report lines and counters, --video-handle's override, and `command-replay snippet video-surfaces`. Verified before this commit (job m3-max-78051, f58ff0a2b3, lavapipe on msi, layer on the path but not enabled): dma-buf in place and opaque-fd in the copy form each play 3 frames that agree with the contract (acquires 2, releases 3 in frame 0 and 2 after) and 6 checks that match. |
||
|
|
8ac09ba43e |
Replay compare-dumps: a differing buffer's line names its first word in each play
compare-dumps said which word of a buffer differed first outside every cover, but not what either play held there, so telling a NaN from a rounding step or a stale word meant reading both dumps by hand. A Difference now carries that word in each play's dump (first_values, little-endian; a short end's bytes with zeros above them, none past a dump's end), and its line prints them after the word's index: "the first word W (a 0x........, b 0x........)". The stream doc says so. The three compare tests take the values in their expected lines and Differences, and a new unit test compares three buffers whose second word differs in b, ends 2 bytes into it, or ends before it. |
||
|
|
866a8dd2f2 |
Replay player: a compute pipeline state takes the stream's openClMode
The player refused a compute descriptor whose openClMode was true, so a stream that makes an OpenCL-mode pipeline (a guest running OpenCL C on Metal) stopped at its first one. The runtime's descriptor carries the mode (open_cl_mode_enabled), and the translator links the kernel for it: the three hidden buffers ahead of the kernel's own, its buffer indices 3 on, get_global_id with the dispatch's offset. The player now gives the stream's value to the descriptor, off where absent, and the stream doc says so. The previous commit's test is its check on lavapipe: red before this commit, green with it. |
||
|
|
cf270fa34e |
Harness and replay player: count dispatches by the form their kernel reaches its buffers in
The harness's matrix counts gain bound_dispatches and address_dispatches, and the replay player's executed counters gain those two with buffer_sets_written and buffer_sets_held, so a run shows which form its dispatches took. Built only; the harness run is the Iris read that follows. |
||
|
|
5b260257e0 |
Runtime and replay player: count each dispatch barrier in one source, and print the device's buffer alignment
What: Metrics::dispatch_hazard_barriers is now the sum of nine sources, each such barrier in exactly one: dispatch_after_write_barriers and dispatch_write_after_read_barriers (the dispatch's own dependencies), then dispatch_encoder_end_barriers, dispatch_pass_end_barriers, dispatch_indirect_barriers, dispatch_unbound_barriers, dispatch_arena_piece_barriers, dispatch_heap_barriers and dispatch_other_barriers. The replay player prints the nine on each frame line's executed counters and in the report's totals. The tally's bit mask is a u128 (69 metrics). The rule for a barrier with several causes: it counts under the dispatch's own dependency where it has one, first a write (it reads or writes a resource a command since the last barrier wrote), then a write after a read (it writes one that was only read), both by the resource's own id; otherwise under the first source in this order: an encoder that wrote ended; a render pass moved nothing home (or copied a resolve into a buffer); an indirect dispatch after a write since the last barrier that reached argument reads, whatever buffer was written; an access outside every resource (a read after a write, a write after any access, or the barrier such a write owes); a Private-arena piece after the first; a conflict through a heap's one id alone (an exported surface's buffer and planes, which share one id, count here too); anything else (a memory barrier call, a release to another API, a concurrent encoder after commands that touched anything). An owed barrier keeps the first of its causes in that order. In a concurrent encoder the dependency is read only where a barrier is owed, as Metal orders nothing else there. Two buffers of one heap over the same bytes count under the heap: at buffer level they are two resources. How: a heap's resources are marked in the hazard sets by the heap's id, as before, and also by their own ids in a second table of the sets that places no barrier and only tells a dependency on the resource from a conflict through the heap's id. Building::owe takes its cause and no longer starts the sets again; the command that pays the owed barrier does, after reading them: Building::command clears them after paying, and dispatch_hazards takes its command buffer without paying (current_command) and pays the owed barrier itself, counted by every cause it has. Where barriers go is unchanged: each path that paid an owed barrier records the one barrier it recorded before, and the sets start again at the same barriers. Rider: Device::buffer_alignment (no Metal counterpart) returns the alignment Vulkan's memory requirements gave the runtime's buffers, which the pool read at the device's making. The replay player's device line prints it (`device NAME runtime rt buffer alignment N`), and the device test prints it and checks it is a power of two. The runtime prints no line of its own at a device's making, so a consumer's log shows it only by reading this accessor. Why: the planner's reading of the dispatch-hazard barriers: whether the sources that are not the guest's own dependencies reach a quarter of a frame's barriers on any stream. The buffer alignment goes into every lab log because the ring and the zero address assume a multiple of 16 with no query behind it. Tests: every_device_counts_each_dispatch_barrier_in_one_source checks the write after a read, two encoders' ends (the second's dispatch reading the write before it counts as that dependency), a render pass's end that moved nothing home, an indirect dispatch after a write of another buffer, a read outside every resource and a memory barrier in a concurrent encoder, each in its one source with the sources summing to the dispatch barriers; every_device_places_barriers_at_hazards_only checks the dependent and concurrent encoders' in the write dependency and none for independent dispatches; every_device_orders_a_heap_s_resources_as_one checks the heap's source, and the write dependency for one buffer of a heap used twice; the arena test checks its pieces' barriers in the arena source; the hazard sets' unit tests check the own-id table. The signatures table is blessed (9 fields, 1 method). Verified: nothing yet in this commit; the gate (fmt, clippy in three configurations, Rustdoc, the runtime suite on lavapipe and the validation suite) runs on it next. |
||
|
|
0b7d408201 |
Runtime and replay player: count barriers by cause, the guest's blits and buffer binds, and over-copy bytes by frame
What: - Metrics counts every barrier in one of seven causes, whose sum Metrics::barriers now is: pass_start_barriers (a render pass's first), pass_home_barriers (the move of its attachments home at its end), blit_barriers, dispatch_hazard_barriers (a dispatch's own, at a hazard or paying one owed), segment_end_barriers, upload_barriers (the uploads' and Managed copy-ins' barriers, the over copies they carry among them) and other_barriers (inside a pass, over copies in a command buffer, heap moves ahead of a command or segment, releases). Metric::Barriers is gone: each site that records a barrier counts its cause, and the shared helpers (Building::barrier, alias::record, over::record_side) take the cause from their caller. - The replay player's executed counters carry the seven, so each frame line prints them. - The player's stream counts (the guest's, fixed by the stream) add blits, an encoder's copy, fill, mipmap, synchronize, reset and optimize commands, and the buffer slots the set-buffer calls set on render and on compute encoders, each split into buffer changes (another buffer than the slot held, or its first set) and offset-only changes (replay/binds.rs). - The runtime backend's report adds an `over copies by frame` line: over-copy bytes a frame, mean and largest frame, by memory class (Private, Shared) and by cause (pitch, dma-buf, host memory, every other cause as own_image), and the number of textures in an image of their own the largest frame's calls named (new_runtime/over_frames.rs), from counters the runtime keeps. - docs/REPLAY-STREAM.md and the runtime README name them; the signatures table blessed (7 fields). Why: the planner's reading of round d9b644bae7's plays: whether pass-boundary and blit barriers are half or more of a frame's barriers (the two pass forms), and whether over copies of Private buffers reach 1 MB or 5% of a frame's copied bytes (the third form), needs the barrier split and the over-copy split a frame, beside what the guest asked for; the guest's buffer binds per draw and per dispatch size the descriptor work. Tests: every_barrier_rt_records_is_counted adds a pass over a texture whose home is shader-read and checks each cause's count against the barrier commands recorded (pass start 1, pass home 1, blit 2, dispatch hazard 0, segment end 1, upload 6 or more, other 0); every_device_places_barriers_at_hazards_only checks the dispatch-hazard and segment-end counts on dependent, independent and concurrent encoders; every_device_reads_its_attachment_through_a_texture_after_a_memory_barrier checks the causes on the feedback-loop and the copy path; the player's the_stream_fixes_its_calls_commits_encoders_draws_dispatches_blits_and_binds checks blits and every bind count; over_copies_by_frame_give_the_mean_and_the_largest_frame checks the line. |
||
|
|
8c3bffc079 |
Runtime: count over-copy bytes by the buffer's memory class, and the renderings an encoder ends and begins again
What: two counters, so reach is counted rather than guessed. - Metrics::over_copy_bytes_private and Metrics::over_copy_bytes_shared split over_copy_bytes by the memory class the bytes shaders reach are in (MemoryClass of the buffer's block; a Managed buffer's device copy counts in neither). OverCopy carries the class; Counters::over_copied takes it. - Metrics::rendering_interrupts counts each vkCmdEndRendering and new vkCmdBeginRendering inside one render encoder (RenderCommandEncoder::interrupt, its one site): barriers, copies a draw or a visibility result mode needs first, feedback and heap moves, an execution's count kernel. The passes counter counts encoders and cannot show these. - The replay player's executed counters carry the three, so every play's frame lines print them; docs/REPLAY-STREAM.md and the runtime README name them; the signatures table blessed (3 fields). Why: the per-frame counts of round d9b644bae7's plays put over-copy bytes at 4.87 MB a frame on the desktop stream (5080) and 34.5% of bytes copied on the 780M recording (Iris), with no way to tell how much lies over Private buffers, whose bytes no host write reaches; and no counter shows how often a render encoder's rendering is cut. Tests: each_memory_class_counts_its_copies_bytes_alone (device-free); the device test every_device_counts_each_textures_copies_under_its_cause checks the class split for each copy and adds a texture over a Private buffer (pitch cause on lavapipe); every_device_reads_its_attachment_through_a_texture_after_a_memory_barrier holds the count at 2 on both the feedback-loop and the copy path. |
||
|
|
e9484b7d03 |
Replay dumps: a texture the cover rule holds covered is dumped with a whole-texture cover
A heap texture that another placement's texture wrote over after its last write was reported by compare-dumps as a difference: the dump loop passed no cover for a texture (dumps.rs: "always `-` for a texture"), so the bytes Metal leaves undefined there were compared. Each texture a listed command buffer stores or binds is now dumped, when the dump reads it (after the wait that saw the command buffer complete, the moment a buffer's ranges are taken), with the cover 0..N, N its dump's length, where the cover rule holds any byte of it covered (Covers::covered), and `-` otherwise. A texture's ranges in the rule are its bytes in its heap, which the dump's parts are not laid out as, so a covered texture is covered whole. The compare then leaves its words out as it leaves out a covered buffer word. dumps.rs and docs/REPLAY-STREAM.md section 10 say so. Test: the_dump_compare_leaves_out_a_covered_texture_and_reports_one_outside_every_cover (no device; Kept reads a texture part's first word from a per-texture word where it holds one). Of three textures placed in a heap, #5 and #6 over each other and #7 apart, two dispatches of a state that writes slot 0 write #5 then #6, which covers #5; the second play reads #5 and #7 otherwise. #5's cover is 0..32 and its differing word is counted covered; #7, covered by nothing, is the one difference reported. Verified at this commit: nothing yet; the lane's jobs follow. |
||
|
|
f6b1adf204 |
Replay player: a layered pass plays as the runtime builds it, and its dump holds each slice
The player marked a pass whose renderTargetArrayLength is 2 or more as one the runtime's descriptor does not hold (Unheld(renderTargetArrayLength)) and skipped its encoder, though RenderPassDescriptor::render_target_array_length takes it: the runtime renders that many slices from each attachment's slice, refuses an attachment with fewer slices (AttachmentPlace) and answers a length past maxFramebufferLayers with Gap::RenderPass of ArrayLength. The player now sets render_target_array_length from the recorded value (narrowed to u32 as the other counts are) and lets the runtime decide: a gap is a skipped encoder counted by the gap, and a refusal stays the play's error. The attachments already carry slice and resolveSlice into the runtime's descriptor; no other field is dropped for a layered pass. The dump's stores read a layered pass's attachment as its first slice alone. They now keep each pass descriptor's renderTargetArrayLength from its m2v.setPass record and store that many slices from the attachment's slice (or the resolve's), through the MTLStoreActionUnknown path too. dumps.rs and docs/REPLAY-STREAM.md (sections 10's skipped encoders and the dump) say so. Tests: a_layered_pass_plays_and_its_draw_renders_the_layer_it_selects (device cfg; a stream of a 2D array of two slices, R32Uint, renderTargetArrayLength 2, cleared to 7, and rt6_layered's triangle selecting layer 1: no encoder or draw skipped, the blit's check of both slices matches 7 then 0x101, and the dump of the command buffer holds both slices) and a_layered_pass_s_dump_holds_each_slice_it_renders (no device; Kept: length 3 stores slices 1 to 3 of a Store attachment and 0 to 2 of an Unknown one, length 1 the slice alone). Verified at this commit: nothing yet; the lane's lavapipe job and the quick check follow. |
||
|
|
c43f1a5447 |
Replay player: setSamplePositions:count: plays on a pass descriptor, and passes at other positions are counted
The runtime player refused setSamplePositions:count: on a render pass
descriptor ("not played on a render pass descriptor"), so every play of a
stream whose 2D renderer sets positions on its 4-sample pass stopped before
that pass.
It now plays the call as the runtime treats it: the runtime's descriptor has
no field for the positions and every multisample pass rasterizes at Vulkan's
standard sample locations, so nothing is set and nothing is refused. The pass
keeps the positions its last call set, and each render encoder the runtime
makes of a pass whose positions differ from Metal's defaults for the pass's
sample count (its attachments', or defaultRasterSampleCount with none) is
counted on a report line, with the first one's frame and call:
"passes at sample positions other than Metal's defaults N: rasterized at the
defaults, Vulkan's standard locations; the first at frame F, call C".
Metal's defaults are taken as Vulkan's standard locations at 1, 2 and 4
samples (the spec's Standard Sample Locations table; the runtime's floor row
standardSampleLocations and its known gap name them Metal's defaults at those
counts; the conformance rows sample-positions-default-4x/-2x). No other
count's defaults are held, so a set at any other count counts as differing;
an empty list (count 0) is the defaults.
Tests: rt_replay's sample_positions_play_and_a_pass_at_other_positions_is_counted
writes its own stream, two passes over a 4-sample target, one at the 4x
defaults and one at four others; it plays through with nothing skipped and
the line counts only the second (call 12). Without the fix the play stops
refused at call 5. new_runtime's
sample_positions_differ_from_metal_s_defaults_of_the_pass_s_count checks the
comparison (defaults, one coordinate off, reordered, fewer positions than
samples, Vulkan's 8x locations) and the line at zero, without a device.
Docs: docs/REPLAY-STREAM.md lists the call among the pass descriptor's
setters and says how the backend plays and counts it.
|
||
|
|
d2e8ab2a85 |
Replay player: a colour attachment's depthPlane is played
What: the new-runtime player forwards a colour attachment setter's `depthPlane` into the
runtime's RenderPassColorAttachmentDescriptor::depth_plane, as it forwards resolveDepthPlane, and
no longer holds the pass for a plane but 0 ("Unheld(depthPlane)", the encoder skipped). A depth
or stencil attachment's depthPlane is not played and holds nothing: Metal reads it of a 3D
texture alone (Apple's page for depthPlane, as fetched: "If the texture isn't a 3D texture, then
Metal ignores this property."), and the runtime refuses a 3D texture's depth or stencil
attachment by its type (TextureType) whatever its plane, which the player counts as any gap.
Why: since
|
||
|
|
c54fa438a2 |
Player: a dump holds each texture a listed command buffer's compute encoders bind
--dump-command-buffers wrote every buffer a listed command buffer's encoders named and every colour attachment its render passes stored, so a texture a compute pass wrote showed only through a later pass that sampled it. A play that parts between two drivers in a render pass that samples a compute pass's textures could not say which of the two passes parted first. dumps::Stores now keeps the compute encoders made and not yet ended, and each texture such an encoder binds (setTexture:atIndex: and setTextures:withRange:, a nil one left out) is a part to dump: its first level and slice, read once the command buffer completed, as an attachment's parts are, into cbC-objT.bin with the cover "-". A texture both stored and bound holds each part once, in Part order. An argument encoder's setTexture:atIndex: is none: its receiver is no compute encoder. docs/REPLAY-STREAM.md and the module docs say what a dump holds. Test: a_listed_command_buffer_dumps_the_textures_its_compute_encoders_bind (one bound texture, a range with a nil, a texture bound twice, a render encoder's fragment texture and an unlisted command buffer's compute texture left out). Verified: clippy -D warnings over the workspace with all features, and the validation suite, the new test among them (job in the land line). |
||
|
|
06c8ebccd6 |
Player: a tessellation factor scale of 1 plays as nothing, any other is a skipped render command
The player refused setTessellationFactorScale: ("not played on a render
encoder"), so a recording that sets the scale stopped at its first
setter. The runtime's render encoder has no scale setter: Metal reads
the scale only in a patch draw through a post-tessellation pipeline
state that enables it (tessellationFactorScaleEnabled), and the runtime
refuses every such state at its making (RenderPipelineKind::Tessellation),
which the play counts as a skipped render pipeline state.
render::factor_scale reads the setter's scale: Metal's default of 1
plays as nothing, and any other scale is a skipped render command of
kind TessellationFactorScale, counted in the report's headline with its
first frame and call. This is faithful only while the runtime refuses
every scale-enabled state; once it builds the scale, its encoder takes
the setter and the player passes the scale on. The code comment and
docs/REPLAY-STREAM.md say so.
The recording that met it (m3-max-71779, read in place, no card): 185
scale setters, every one at 1, the first in frame 409; 0 of its 1668
render pipeline records enable the scale, so no state there is refused
for it.
Test: a_tessellation_factor_scale_other_than_1_is_a_skipped_render_command
(1 as a float and a double, 2 and 0.5, and a scale that is no float).
Verified on msi: clippy -D warnings over the workspace with all features,
and the validation suite, the new test among them.
|
||
|
|
1f81d53c30 |
Player: a compute pipeline record's stage input plays as the kernel's
The player refused every compute pipeline record whose stageInput was not
nil ("a stage input"), so a recording that makes a kernel with a
[[stage_in]] parameter stopped at that state's frame. The runtime takes
the stage input (ComputePipelineDescriptor::stage_input); only the player
lacked it.
translator::stage_input reads the record's stageInput, {layouts,
attributes, indexType, indexBufferIndex}, into the translator's
StageInputDescriptor the way vertex_descriptor reads a vertex descriptor:
layouts and attributes at their indices, a stride of 2^64 - 1 as
MTLBufferLayoutStrideDynamic, Metal's raw step functions, attribute
formats and index type through their enums, and Metal's unset layout for
a buffer an attribute reads that no layout names. Nil stays no stage
input. A raw value the enums lack, or a key the form does not hold, is
the player's refusal. A descriptor the runtime refuses is the runtime's
typed error: a gap or a translation refusal counts as a skipped compute
state in the play's report, any other error ends the play with it.
docs/REPLAY-STREAM.md states the form.
Test: a_compute_pipeline_record_s_stage_input_is_read (the record form,
a dynamic stride, a buffer no layout names, nil, and an unknown key).
Verified on msi: clippy -D warnings over the workspace with all features,
and the validation suite, the new test among them.
|
||
|
|
acda405b30 |
Player: a dump holds each colour attachment its command buffer's render passes stored
A play asked to dump command buffers (--dump-command-buffers) wrote only the buffers their encoders named, so a draw's output reached no dump. It now writes, once a listed command buffer completed, each colour attachment its render passes stored, as cbC-objT.bin beside the buffers' dumps, with a cover of "-", so compare-dumps reads them unchanged: a texture an attachment names under MTLStoreActionStore or StoreAndMultisampleResolve, a resolve texture under MultisampleResolve or that one, and an Unknown store action as the encoder's setColorStoreAction:atIndex: decides it. The dump holds the parts the passes stored (level, slice and depth plane, or the resolve's), one after another, each laid out as a check reads a texture's first level and slice; a part the backend cannot read (a multisample texture stored without its resolve) is an .unread file. Colour only: a texture of a combined depth and stencil format reads back one aspect at a time, through a copy with that aspect's blit option, which this read does not make. The stream doc and the command's help say so. The backend gains Backend::read_texture_part; the runtime's backend reads a part as its check reads level 0 (the CPU's read, or a blit's copy of a Private texture), the check's read unchanged. Verified: by the jobs named in the landing report. |
||
|
|
60a6b2746e |
Docs: the memory-class line measures by two whole plays on the RX 7900 XTX
|
||
|
|
d876f56b82 |
Docs: the two killed plays on the RTX 3090 were followed by its driver's GSP timeout
After lane kernmap's two plays of the Intel-made compute recording on um870's RTX 3090 were stopped at their time limits inside frame 368 (m3-max-71535, 09:28-09:41, and 71553, 09:42-09:57), the card's telemetry froze from the first sample after the second (09:57:33) and the driver logged Xid 119 (a GSP RPC timeout, fn 76) at 10:08:36, naming no process; the node was rebooted. The consumer read its journal and job log: no guest run touched the card from 08:34:40 until then, and the driver's out-of-memory group at 09:57 is routine at card open (13 times that day). The planner ruled it a lab artifact of those plays, no row, written beside the memory-class line. Verified: the docs check follows as a job. |
||
|
|
29b659121e |
Docs: a recording is a timing source only on a card of its own memory class
Lane kernmap played the consumer's GPU compute benchmark recording, made on an Intel integrated card, on the RTX 3090 (pin R; m3-max-71535 and 71553, P0, both capped inside frame 368, 0 refused). Frames 366 and 367 alone took about 378 s of GPU-busy time, against 257.2 s for the whole play on the RX 7900 XTX and 74.3 s on the integrated 780M. The consumer's own guest on the 3090 runs the same benchmark's workloads in 37.1 s of GPU time in all (native 33.4 s), and its recording of the same run on the discrete AMD card is 1.3 GB, against this one's 25.3 GB: the Shared storage an integrated guest builds on. The planner ruled the 3090's frames play-only, and that a recording times only on its own memory class. The replay doc now says so beside the timing verdict rule. Verified: the docs check (workspace Rustdoc, -D warnings) follows as a job. |
||
|
|
9a11fbd543 |
Docs: the replay player makes and executes no indirect command buffer
docs/REPLAY-STREAM.md said that only an indirect command buffer, "which the runtime does not build", would read a pipeline state's resource ID. The runtime builds indirect command buffers; the player is what does not: making one is "not played on a device" and executing one "not played on a render encoder" (new_runtime/mod.rs, render.rs), typed refusals that end the play. The doc now says so beside the refusal rule, and names what would read a pipeline state's ID: an argument buffer's pipeline-state member, which the runtime refuses at the making of a state whose function reads it (rt README, known gaps). The player's comment on that ID drops the same stale reason. Verified: the docs check (workspace Rustdoc, -D warnings) follows as a job. |
||
|
|
17473a1a42 |
Player: a render encoder's residency declarations play through the runtime
The render encoder's arm played its eight residency forms (useResource:usage:,
useResources:count:usage:, useHeap:, useHeaps:count:, each with stages: or without) as nothing,
"as the runtime's render encoder has none". The runtime's RenderCommandEncoder has use_resource
and use_heap now, so they play through it as a compute encoder's do: each resource of the call,
or of its list, through use_resource with the call's usage; each heap, or each of its list,
through use_heap. The stream records each C array and its count as one list, so the usage is
argument 1, and the stages come last; the runtime's render encoder takes no stages, so they are
not read.
What each read before, and now:
- Render encoder, all eight forms: before, no argument and no runtime call; a skipped object they
named was not counted. Now: the resource ({Buffer: object} or {Texture: object}) or heap of
argument 0, each of a list; the usage at argument 1; a skipped object is a skipped call, each
of a list as its own, as docs/REPLAY-STREAM.md says of skipped_calls.
- Compute encoder, the four forms: unchanged in what they read; one resolver (NewRuntime::uses)
now serves both encoders, and heap_of, which only the compute arm called, is gone.
- The usage: before, 1, 2 or 3, any other value refused. Now MTLResourceUsage's option set of
read (1), write (2) and sample (4), any other bit or none refused. Without the sample bit, a
render encoder's useResource:usage: of read | sample, which played as nothing before, would
now be refused.
- objects_named, which the unwritten count reads a render or blit encoder's call by, and which
notes the objects a command buffer's encoders name (resource indices owed, placed buffers' and
no-copy Managed buffers' users, tiled textures' takes): before, bare objects and lists only, so
a residency declaration's {Buffer: object} or {Texture: object} named nothing. Now it names the
resource too, on compute and render encoders alike.
docs/REPLAY-STREAM.md: render and compute encoders play their residency declarations through
the runtime's encoder, the stages forms as those without; the unwritten count's reaching calls
include a residency declaration's resource.
Tests: the commit before this one (red: the skipped-object device test and the unwritten test).
|
||
|
|
3e9cd15b0a |
Player: a release of an object its device's release dropped plays as nothing
Metal's objects keep their device, so a program may release its device before what it made: a guest recording's last two calls release the device and then the host's display library made on it. The player drops everything a device made at the device's release, and the library's release that followed found no object and stopped the play as an invalid stream, after every frame had played. The player now keeps the ids a device's release dropped, and the stream's own later release of one removes it from that set and plays as nothing; the backend released it once, with the device. Ids are never reused (docs/REPLAY-STREAM.md, section 4), so the set holds only objects whose release may still come. A second release of such an object, or the release of an object no call made, still stops the play. Verified: an_object_released_after_its_device_plays_as_released_with_it and the replay tests in the job named in the lane's report; no local build. |
||
|
|
15af4d5de0 |
Player: --dump-command-buffers takes a list of ranges and single ids
A play that should dump only the command buffers holding a changed kernel's dispatches had to dump every command buffer between the first and the last of them: on a recording whose workloads interleave, tens of gigabytes the compare then reads for nothing. The option now takes LIST: FIRST..LAST ranges (both ends held) and single ids, joined by commas, in any order (CommandBufferList, in dumps.rs beside the dumps it selects). Ranges that overlap or touch are merged and a lookup is one ordered-map search, so a list of thousands of command buffers costs the play nothing per call. A single FIRST..LAST range reads as before; anything else stops the play before it starts, as a bad range did. Before: the dump test helper passed 20..=29 as a RangeInclusive, the only form there was. Verified: the red tests from the previous commit (a_dump_list_holds_its_ranges_and_ids_and_ nothing_between, a_play_dumps_the_listed_command_buffers_alone) run in the job named in the lane's report; no local build. |
||
|
|
82d1c62eb5 |
Player: the plural residency declarations play and count as their single forms
A compute encoder's useResources:count:usage: and useHeaps:count: were refused ("not played on a
compute encoder"), so a play stopped at the first one; a guest recording on the Iris Xe stopped
at frame 290 of 430 there. They play now as Metal defines them: each resource of the list as
useResource:usage: with the call's usage, through the runtime's use_resource, and each heap of
the list as useHeap:, through use_heap. The stream records each C array and its count as one
list (docs/REPLAY-STREAM.md), so the usage is argument 1.
What each read before:
- The compute encoder read useResource:usage: alone (its resource as {Buffer: object} or
{Texture: object}, the usage at argument 1) and refused both plurals.
- The covers rule and the unwritten count read useResource:usage:'s resource with as_object,
which takes only a bare object, so a recorded {Buffer: object} wrote and uncovered nothing in
them; both plurals fell through as calls that only name objects. They read the resource now as
the stream records it (Value::as_resource), and each resource or heap of a plural as its single
form.
- The render encoder reads none of its residency declarations' arguments (it plays them all as
nothing), so it read no usage wrongly.
The player's resolvers gain held (a resource value) and block_of (a heap id), which resource and
heap_of now call. docs/REPLAY-STREAM.md says compute encoders play the four forms through the
runtime and that the unwritten count, the skipped calls and the covers rule read the plurals as
their single forms.
Tests (the two commits before this): the device test of a compute encoder's four forms, the
unwritten test of the plural and of the singular on the format, and the covers test of the
plurals. Not run here: no local builds; to be checked on development.
|
||
|
|
29e54794ca |
Runtime: a sampler state bound with LOD clamps of its own samples with them
A bind's LOD clamps (setSamplerState:lodMinClamp:lodMaxClamp:atIndex:, its
vertex and fragment forms and the range forms) that read otherwise than the
state's own were Gap::LodClamps. Metal takes the call; on the M3 Max
(conformance cases sampler-bind-lod-clamps-kernel and -fragment) the pair
replaces the state's clamps, a lower bound above the upper reads at the upper's
level, and a plain bind afterwards reads the state's own clamps again.
How: such a bind takes the state's variant of the pair, the state's descriptor
with the pair as its clamps, its device samplers from the shared sampler table,
placed at a variant element of set 1's sampler arrays. The three sampler arrays
grow from 4,000 to 8,000 elements in the runtime's layout; elements 4,000 to
7,999 are the variants'. Shaders declare the heap arrays unsized, so the
translator is unchanged: a slot's sampler index is the runtime's push, and an
argument buffer's sampler index of 4,000 or more still reads element 0, so no
program-written ID reaches a variant. A state keeps its 16 most recently bound
variants; a new one past them takes the place of the least recently bound one
no command buffer holds, and where work holds all 16 the new one is held by its
command buffer alone. Past 4,000 live variants a bind is
Limit::LodClampVariants { max: 4000 }. The lod_clamp_variants gauge counts the
live variants. A NaN bound, which Metal documents no answer for, binds the
state as it is.
The floor's sampler limits rise to 24,000 (maxPerStage and maxDescriptorSet
UpdateAfterBindSamplers) and 286,144 (maxUpdateAfterBindDescriptorsInAllPools);
the lab's least are 500,000 (MoltenVK on the M3 Max) and 1,048,576 (Intel UHD
Graphics 630 on Windows), and Vulkan requires 500,000 of each with
descriptorIndexing.
Gap::LodClamps goes; REFUSALS.md, basis.rs, the signature table, the Metal and
conformance coverage pages regenerate. The validation replay plays clamped
binds (no skipped_clamped_samplers). The ledger drops three rows the clamped
binds now answer (compute-plural-texture-and-sampler-binding steps 11 and 14,
render-state-unread-slots). The compute single clamp form's coverage row named
set_sampler_state; it names set_sampler_state_with_lod_clamps.
Tests: a kernel samples through the binds as Metal reads them; a state's 16
kept variants filled past that; the 4,000 variant elements filled past their
capacity; the gauge flat across a bind and retire loop and zero at device
drop. Verified: see the lane's report (jobs named there).
|
||
|
|
58148264f8 |
Conformance: compute-imageblock-sizes, one encoder's dispatches before any imageblock size and at two it sets
A compute step for setImageblockWidth:height: on both sides, and a case that runs a4_imageblock_extent three times in one encoder: before the encoder sets a size (one thread, Metal's 1 by 1), then at 4 by 2 and at 4 by 4, each one threadgroup of the imageblock's extent, into a guarded slot each. The case's test holds Metal's recorded answer equal to the fixture's own at each extent. The runtime README states the size as a specialization: each size a kernel runs at is one VkPipeline made at prepare_dispatch or at the dispatch, a first-use wait, where Metal changes the size with no compile (m3-max-69983); prepare_dispatch and dispatch_variant take the size. REPLAY-STREAM and VALIDATION say the player and the engine candidate set it; the ledger row for the state's imageblock length drops the dispatch refusal. The recording follows in its own commit (taken on the M3). |
||
|
|
41b5038342 |
Player: a commit waits on the CPU for the backend's own surface fill before it goes
What: the replay player's surface backend keeps its last command buffer on its own queue, a fill at a shape's making or the refill a picture owes at its first use (Surfaces::unwaited). The stream's next commit waits for it on the CPU, once, before committing, counted as surface_host_waits (an executed counter, and in the report's surfaces line). New test a_surface_picture_fills_before_its_use_behind_another_queues_long_work plays the same picture behind 256 dispatches over 4 MiB committed first on another queue, and checks the second picture, one refill and one host wait. The runtime README's queue rule now says what Metal and the code do: a command buffer sharing a tracked resource with an earlier-committed one of another queue goes after it only once that one is submitted (the M3 Max rows of that section, jobs m3-max-52432 and m3-max-52415), a cut command buffer that has begun counting as submitted until its next piece waits for an event; an event wait holds only its own queue; the fence sentence says what the code does, Metal's side measured only by jobs m3-max-52186 and m3-max-52188. Its known gaps name a program that relies on commit order between queues for a shared resource with no event or fence. docs/REPLAY-STREAM.md gives the wait and its counter. Why: a_surface_picture_fills_its_shapes_at_their_first_use read the first picture's inverse on the RX 550, the 780M, the Iris Xe and lavapipe at |
||
|
|
d15ab4501c |
Validation: command-replay play --states-only yes plays the state records and presents alone, and the report's first line names the mode
A states-only play was a probe's environment variable (M2V_PROBE_STATES_ONLY, on a probe branch that never lands): a tree without the probe played the streams in full and said nothing, so two states-only plays of a translator change read as plays of nothing they were meant to check. The mode is now an option of the validation player itself, --states-only yes|no (no by default), and every report's first line names it: `mode full: every call` or `mode states-only: the device, library, function and pipeline state records and the presents alone (--states-only yes)`. A bad value is a bad command line (exit 2, `error states-only: ...` as that first line). Player::states_only passes over every call but MTLCreateSystemDefaultDevice, m2v.deviceIdentity, the newLibrary*, newFunction*, newDynamicLibrary*, newRenderPipelineState* and newComputePipelineState* calls and m2v.present, the probe's set unchanged, so frames and the recording range end where a full play's do and the pipeline states are made cold as a full play makes them. A states-only play writes none of the matrix's judged metrics, since it runs none of the work they count. The completion-fix line keeps its place by itself, now after the mode line; its test reads it there, and a new test reads the mode line for yes, no and a bad value. docs/REPLAY-STREAM.md section 10 and the player's module doc and usage name the option and the line. |
||
|
|
a93a0d69dc |
Replay player: the unwritten count reads a buffer by its slot's access and its block's earlier bytes
The player's `unwritten` line (Shared buffers a dispatch read before any recorded write, upload
or GPU pass reached them) misread in two of the three ways the tool bug row named:
(1) every buffer a compute encoder bound or used counted as read at the next dispatch, so outputs
counted: 12,607 of one recording's 12,611 were write-only first bindings;
(3) a buffer made in a stream block counted as unwritten from its making, though m2v.write records
into the block before the making had put its bytes there.
The third, that commits at m2v.split and m2v.commitPart are not counted, does not hold: the
player plays each as the command buffer's `commit` to the backend (frames_releases_and_splits
and a_part_commits_only_where_the_host_cut_it show the backend's commits), whose commit counts.
Now, per compute encoder, the tracker keeps the waiting buffer bound at each buffer slot, its
state's buffer accesses (ComputePipelineState::buffer_accesses) and the buffers useResource:usage:
names with their usage bits. A dispatch reads a buffer at a slot its state reads and writes it at
a slot it writes; a slot the state does not use touches nothing; a used buffer goes by its read and
write bits. A buffer another call of the encoder named, or one bound under a skipped state, is
read and written, as before, and the line says how many of the count were only counted so. In a
command buffer a dispatch's write comes before later dispatches' reads. At the commit the buffers
read while waiting are counted once each and those written are reached. Each Shared block or heap
keeps the byte ranges reached in it, merged; a buffer made over reached bytes is not waiting.
Tests: a_dispatch_reading_a_buffer_nothing_recorded_reached_is_counted_once (rewritten for slots
and the block's earlier bytes), a_dispatch_reads_a_buffer_only_where_its_state_or_its_usage_reads_it,
a_buffer_made_over_its_block_s_reached_bytes_is_not_unwritten (host), and on the device cfgs
the_unwritten_line_counts_what_a_state_reads_before_anything_reached_it (scale_offset reads #6,
writes #7, reads #11 made over an m2v.write: "unwritten 1", where the old rule counts 3).
docs/REPLAY-STREAM.md's paragraph says the rule.
|
||
|
|
4a09c07658 |
Replay player: a play cut after its last frame names the command buffers held there, not an invalid stream
A play cut with --until-frame F (or at its recording range) ended exit 1 with "invalid stream: command buffers [...] still wait on events at the stream's end" where a command buffer committed before the cut waited on an event a call past the cut signals (glbench-3090-r4 cut at 400: cbs 128646 and 128648). The calls past the stop may signal it, so the stream is not invalid there. The player now tells the stream's end from the stop after its last frame. At the stop, the command buffers still held on events go into Report::held and a `held #ID ...` line, and the play ends as it would without them (exit 0 for `ok`). At the stream's end a held command buffer stays the invalid-stream error, a last frame past the end included. Test: a_play_stopped_after_its_last_frame_names_the_command_buffers_held_there (a synthetic stream: cut at frame 0 names #4 held and waits for nothing; played whole, the later signal lets #4 complete; a stream ending with #4 held is invalid with no last frame and with one past its end). Without the fix the cut play ends Err(Invalid). |
||
|
|
7911c011a0 |
Runtime: a queue keeps on the VkQueue only what it has room for, and another queue's later command buffer passes the rest
A queue sends a group only while it has room (submit::room): with fewer than two submissions not seen complete always, and with fewer than IN_FLIGHT while the expected runs behind the oldest, the group's with them, stay within GROUP_RUN (16 ms). Without room, a command buffer the held group does not take (by GROUP_RUN, UNSEEN_JOINS or GROUP) waits in its queue's list, not staged, with the queue's later commits behind it; the submit thread skips that queue and other queues' later commits go on. Each held command buffer is scheduled as it would be in a group, in commit order once its waits are met, its scheduled handlers run: only its vkQueueSubmit2 waits for room (WorkState::hold). One that presents a drawable, has nothing for the GPU, or ended sends its queue through to it, as its group would go at once. Everything that sent a group still sends it: a signal as staged, a host wait or send_now, stop, a busy completion thread, an empty command buffer, a conflict with a texture copy. A group no longer goes at its sixteenth command buffer: the seventeenth finds it full and waits for room. A queue whose expected run is not yet known has room for two. Fences: a wait on another queue also goes after an update in a command buffer held for room there, scheduled before the waiter was; that queue goes through to it first. A held head with no group is staged before any other command buffer, the earliest held first, so the order of holds is the order fences read. abandon ends the queue's command buffers not yet scheduled in place, in the queue's order behind those held for room, which go at once. Metrics::held_for_room counts the command buffers scheduled while held for room (api_signatures row). Why: one queue's backlog no longer delays another queue's command buffer by more than about GROUP_RUN of that queue's expected GPU time. |
||
|
|
215ee0125b |
replay: the player plays visibility results through rt; the occlusion pools' gauge in its printouts
What: the replay player on the runtime plays a pass's visibility results instead of stopping at
them. `m2v.setPass` carries `visibilityResultType` (Reset, Accumulate) into the runtime's
`RenderPassDescriptor::visibility_result_type` beside the `visibilityResultBuffer` it already
carried, and a render encoder's `setVisibilityResultMode:offset:` plays as
`RenderCommandEncoder::set_visibility_result_mode` (Disabled, Boolean, Counting), whose counts rt
writes into the buffer at the pass's end. What rt does not build is skipped and counted as every
render command gap is (`skipped_render_commands`, a line per kind with its first frame and call):
a mode in an `Accumulate` pass is `Draw { kind: AccumulatedVisibilityResults }`, and a mode rt
refuses as Metal's validation does (no buffer, an offset off 8 or past the buffer, an allocation
byte off 8, an offset taken before) is `Refused(KIND)`, keyed by the refusal's kind alone, the
encoder's mode unchanged. Any other runtime error still ends the play. The player's two gauge
printouts, the frame-end `live` set and the at-drop list the matrix holds at 0
(`M2V-MATRIX gauge replay-rt/device/GAUGE@drop`), add `occlusion_pools`.
rt: a test runs 200 command buffers one after another, each a pass that sets `Counting` and draws;
the occlusion pools read 1 after the 100th and the 200th (a command buffer gives its pools back
before `wait_until_completed` returns), the word 64, and 0 once the device drops. The README's
visibility section says what the gauge counts.
Docs: docs/REPLAY-STREAM.md says the backend plays visibility results, lists the two skipped forms
under the skipped render commands, drops the visibility result buffer from the pass properties the
runtime does not hold (a skipped one still skips the encoder), and names the query pools among the
frame-end gauges.
Why: the planner's ruling for the visibility follow-ups: the player plays the visibility calls a
stream records through rt, counts what rt refuses, and the occlusion pools get the leak gauge
every resource kind has.
Verified: cargo fmt. rt_replay (lavapipe): a Reset pass's Counting and Boolean words (16 and 16 for
a 4 by 4 target, the untouched word's bytes kept), an offset taken twice counted as
Refused(VisibilityResultOffsetTaken) at its call, and an Accumulate pass's two modes counted by
their gap with the buffer's bytes kept; the compile and lavapipe jobs are named in the lane's
report.
|
||
|
|
fc021c92d8 |
replay: a released index is kept back until every commit before its release has retired
The runtime leaves its consumer the duty never to place at an index pending work may use: a placement writes the index's set-1 elements, which Vulkan does not define while a pending command buffer uses them, and a consumer keeps a released ID back until every command buffer committed before the release has retired (runtime README, "An index has one owner"). The player stands in for that consumer, but owed an index only to the commits of command buffers that named its object. A command buffer that reached the object through an ID in memory, and the play's own blits and copies, owed nothing, so a play could make the undefined write. Indices::give now owes the released object's index to every commit so far, in commit order. The naming path stays for command buffers not yet committed at the release, and for a live object a later one displaces. A placement owed to a commit held on records not yet played (its command buffer waits for an event only a later record signals, or is behind one that does on its queue) cannot wait for it without a deadlock. It used to take the index anyway, counted. It is now kept back: the object takes the highest free index of its class that no commit in flight is owed, outside the program's sequence, counted on 'indices kept back N: ...' (it replaces 'indices given while a commit they owe is held N'). The held buffer reads the object it bound. The kept object's ID differs from the one the program saw, and the id lines report it. A placement waits only where no owed commit is held, so every wait can end. An index the player chooses itself skips one still owed instead of waiting or ignoring it: a constexpr sampler's (the highest free sampler index; it never waited before) and a texture's outside the program's IDs (place_outside). A sampler state equal to the one placed last at its index still takes it without waiting: the runtime writes no element for it. Tests: - rt_replay an_index_released_after_a_held_commit_is_kept_back_though_it_names_nothing is the forced-order test. Held command buffer #6 binds nothing and was committed before #5's release, and its event holds it past #8's placement. #8 must take the highest sampler index, counted. - a_placement_a_held_commit_owes_is_kept_back_and_counted replaces the old take-without-waiting test. - The Indices unit tests cover a release owing every commit before it, and top skipping an owed index. Docs: docs/REPLAY-STREAM.md section 5 (resource IDs, textures outside the program's IDs) and the backend's report paragraph; the indices.rs module doc. Verified by the compile and suite jobs named in the hand-over. |
||
|
|
a449642cc7 |
rt docs: placing at an index pending work may use is the consumer's duty, not the program's
The sentence said no work in flight may read a displaced object through the index, "the program's duty, as it is Metal's". It was wrong on both counts: - A placement at an index a released object still holds for an unretired command buffer writes set-1 elements with one vkUpdateDescriptorSets (arrays.rs place_texture, place_samplers_locked). Under UPDATE_UNUSED_WHILE_PENDING with PARTIALLY_BOUND, the spec allows that only where no shader invocation dynamically uses the element (vkspec 1.4.366, the binding flags' text), so Vulkan does not define it. - Metal hands a released ID out again at once on a Radeon Pro 5300M (oracle job m3-max-63074), so a program may be given an ID that work in flight still reads. Keeping the write away from pending work is the consumer's duty: it keeps a released ID back until every command buffer committed before the release has retired. The placement is not refused (form (ii), not built). Between the last holder's retirement and the block-maker's deferred vacate the index is still the released object's, and a placement then is defined; a refusal would meet a guest there. The displaced form stays for that window, and the docs say so. Docs only: the runtime README's index paragraph and sampler line, docs/RESOURCE-ID.md, the replay player's rationale in docs/REPLAY-STREAM.md, and the safety contracts of place_texture, place_samplers and hold_samplers and new_texture's doc. Verified: cargo fmt, the API signatures check; Rustdoc runs in the quick check after the land. |
||
|
|
53d429143a |
Replay: a lost device's fault addresses are placed among the stream's buffers and heaps
What: the runtime player's `loss` line places each access address of the driver's fault report among the stream's buffers and heaps, as the play made them. An access's range is the address rounded down to its precision, `precision` bytes long. The line names each live buffer or heap the range meets, by address, with the address's offset in it. Then it names each of the last 65,536 released ones it meets, newest first, with the frame and call of the release. It shows at most 8 of each, then "N more". Where none meets the range, it says the address is outside every buffer and heap of the stream. The released spans are kept in a bounded queue, filled at each release. Live spans are read from the object table only when the device was lost. A texture is placed only through the heap or block it lies in, and the play's own buffers are not placed. docs/REPLAY-STREAM.md documents the line. Why: the runtime reports the driver's addresses as given (DeviceLoss::fault) and places none, since only its caller knows what each range was. The player is that caller for a stream: a replay that loses the device on a 3090 then says which of the stream's objects the fault hit, whether it was live or freed (and when), or that it hit none. Test: new_runtime::tests::a_fault_s_access_is_placed_among_the_stream_s_buffers_and_heaps: - a live buffer and the live heap it lies in, by address with offsets; - a page that meets a buffer starting past the address (negative offset); - two released buffers, newest first, with their release positions; - an address outside everything; - the queue filled past its 65,536 entries, so the oldest is gone. Verified: cargo fmt --all. Build, clippy and the tests run in the job named in the lane's report. |
||
|
|
5ea6b63f01 |
Replay: a render encoder's residency declarations play as nothing
What: the runtime player plays a render encoder's useResource:usage:, useResource:usage:stages:,
useResources:count:usage:, useResources:count:usage:stages:, useHeap:, useHeap:stages:,
useHeaps:count: and useHeaps:count:stages: with no runtime call. Until now each was refused
("not played on a render encoder"), which ended the play. What these calls name is still
noted before the call plays, as for any encoder call (tiled-texture takes, index reads,
covers, place users). docs/REPLAY-STREAM.md lists the eight among what render encoders play.
Why: a recorded consumer stream (run 62101 of the 3090 Xid 13 investigation) stopped at frame
239 on its first render encoder's useHeaps:count:stages:, before any heap-pass draw. The
consumer's runtime backend makes no rt call for these either (reims-vgpu 14c00263ef,
crates/reims-vgpu-vulkan/src/rt_platform/render.rs:310-312 puts UseHeaps and UseHeapsStages in
the arm that does nothing; :301-309 notes a useResources texture's tiled take and
own-index read, and makes no rt call). The runtime's render encoder has no residency call, and
every object of a play is resident.
Test: rt_replay's a_render_encoder_s_residency_declarations_play_as_nothing (device tests,
--cfg m2v_gpu or m2v_cpu_icd). After a triangle, a stream makes a heap and declares all eight
forms on the render encoder, naming the heap and the vertex buffers, then draws again. The play
ends, nothing is skipped and the target checks green. Before this change the first declaration
was refused.
Verified: cargo fmt --all. Build, clippy and the lavapipe device tests run in the job named in
the lane's report.
|
||
|
|
0156925ec6 |
Runtime: a lost device's loss carries the driver's fault report (VK_EXT_device_fault)
What: device creation enables VK_EXT_device_fault and its deviceFault feature where the device lists the extension (one of the floor's optional extensions; Vulkan requires the feature of a device that lists it). At the device's first loss of the runtime's own whose result is ERROR_DEVICE_LOST (a failed vkQueueSubmit2, or the completion thread's semaphore read or wait), the runtime reads vkGetDeviceFaultInfoEXT once, counts then records, into the new DeviceLoss::fault: the driver's description, its memory accesses and its instruction pointers apart (each a FaultAddress of kind, address and precision, as reported), and its vendor records. A loss the consumer reports (Device::report_loss) is never read: it may name a device that is not lost, and the query is valid only on a lost one (VUID-vkGetDeviceFaultInfoEXT-device-07336). The runtime places no address; the consumer, told of every allocation's map and unmap, places them among its own blocks and buffers. The replay player prints the loss and its report as a `loss` line of its report (docs/REPLAY-STREAM.md). Why: two RTX 3090s lost the device with Xid 13 (Graphics SM Warp Exception: MMU Fault) in a consumer step, and neither the runtime nor the consumer could say which address faulted. Public API (breaking): DeviceLoss gains `fault` and is no longer Copy; new DeviceFault and FaultAddress; floor::Features gains `fault`; OPTIONAL_EXTENSIONS gains VK_EXT_device_fault. api_signatures.tsv blessed; docs/REFUSALS.md regenerated (unchanged). Verified: the 11-19 minimal repro (a dispatch reading through a freed buffer's address) with deviceFault enabled, on um870's RTX 3090 (NVIDIA 620.70.06), job m3-max-62203: the device was lost at the first empty submission after Xid 109 (11.5 s after Xid 13), and the report gave READ_INVALID 0xdef63a3000 precision 0x1000, inside the freed buffer's range, and INSTRUCTION_POINTER_FAULT 0xdefdfeb950 precision 0x10; no description, no vendor records. |
||
|
|
62c563f564 |
replay: the over-copies' causes among the executed counters
The report counted over-copies and their bytes, and those over imported blocks, but not why the runtime keeps each texture in an image of its own. The runtime already splits them by cause in Metrics (over_copies_host_memory, _pitch and the ten like them, each with its bytes). The backend now reports all twelve pairs, so a frame's, a completed group's and the total's over-copies split by cause. This is what the planner asked for to split the 48,710 small over-copies across the link. Validation only; the runtime is unchanged. The replay stage test now also checks that two of the keys are there. |
||
|
|
9027bd2aa3 |
rt: count scheduled-to-start under earlier GPU spans, GPU-end-to-handler steps and calibrations
The clean 5080 re-play's print needs three things the stage sums alone cannot give.
First, how much of each command buffer's span from scheduling to GPU start lies under other
command buffers' GPU spans, the runtime's own uploads and copy-ins included, against the part
under none of them. This is Metrics::scheduled_to_gpu_start_behind_nanos.
Second, its span from GPU end to handlers split at the completion thread's own steps. This is
Metrics::gpu_end_to_handler_steps_nanos, six steps:
- seen: GPU end to the thread seeing the completion;
- told: telling the submit thread;
- stamp read: reading the round's timestamps;
- calibration: a calibration, where the round runs one;
- earlier: the round's earlier retirements, their handlers included;
- own: its own retirement until its handlers begin.
The same steps are kept for the command buffers of 1,024 us or more (gpu_end_to_handler_tail
and its steps), so a 1-8 ms tail can be placed in a step.
Third, the calibrations and their calls' time. The counter that only the tests had becomes
Metrics::calibrations, beside calibration_nanos.
The replay backend reports all of these as executed counters.
Counting only; nothing changes form. There are no new waits, locks or allocations. What each
count costs:
- Completion thread, per round: two clock reads (the stamp read's start and end), and a third
where it calibrates. The period check reuses the stamp read's end, so it no longer reads the
clock itself.
- Per command buffer retired: one clock read where its retirement begins, then for one that
counts stages:
- one pass over a fixed ring of the latest 128 GPU spans, a stack array in the completion
thread;
- a sort, on the stack, of those that meet its span;
- one relaxed atomic add for the behind part;
- six for the steps, and seven more for one in the tail.
- Per upload or copy-in retired: the timestamps it already read go into that ring. There is no
second query read.
- Per calibration: two clock reads and two relaxed atomic adds.
Retirement returns an upload's and a copy-in's two timestamps (times::retire_own). The
completion thread places them on the host clock by the calibration as it stands
(Calibration::at, which moves nothing), and the program's command buffers' spans as placed.
Tests:
- host tests for the ring's merged, clipped union and its oldest-first replacement;
- a host test for the round's steps adding up to the span;
- the device stage test now checks that the six steps add up to gpu_end_to_handler_nanos, that
the behind part is at most scheduled_to_gpu_start_nanos, and that the device start
calibrated;
- the replay stage test checks the same through the report's keys.
|
||
|
|
b1b5168fd6 |
Replay report: untimed waits, the runtime's stage sums and its stage histograms by frame
The 5080 play of a 3090 compute recording waited 42.5 s of 95.1 s wall with 23.1 s of gpu_busy; before a fix is ruled on, the report must say where the other 19.4 s went. Three reads were missing from it: - A waited command buffer with no GPU interval (start 0, or end not past start) adds nothing to gpu_busy while its wait counts in full. Each frame's end line now has untimed_waits and untimed_wait (the wait spent on them), and the report sums them in an `untimed waits` line. - The runtime already histograms every command buffer's commit to scheduled, scheduled to GPU start, GPU run and GPU end to handler, but only in power-of-two buckets, which give no seconds. Metrics now keeps each stage's sum beside its histogram (commit_to_scheduled_nanos and the three like it), counted in the same call as the bucket. - The player printed none of it. The backend's executed counters, so every frame line and the total, now carry the four sums, held_starts and held_start_gap_nanos, runtime_command_buffers and runtime_command_buffer_gpu_nanos (the uploads and copy-ins that run outside every Metal command buffer's GPU interval), and untimed_command_buffers. The four histograms print at the play's end as `stages F ...` lines, cumulative as each frame ended, and `stages end ...`. They are not per-frame counters, so the 69k `completed` lines of a long play do not grow by 92 keys each. Tests: the runtime's stage histogram test also checks each sum against the three command buffers' own times (exact for the first three stages, bounded by the host time after each finished for the fourth); a player test on the synthetic backend counts a frame's untimed waits (none and zero-length intervals) and the report's sum; a lavapipe replay test reads the new counters and the stages lines across two frames. |
||
|
|
999b82bfe2 |
player: a pipeline state's making counts what it made, lowered, loaded and VkPipelines, and a load makes its content new
What: each group and each slow making carries "L lowered, D loaded, P VkPipelines" (translations, translations_loaded, pipelines_created). A making is of "new" content where it made any of them, and "held" where it made none. Why: the warm pass of m3-max-60954 showed the first form calling a load-only compute state "held", and using the word "cold" in a second pass. Verified: the same test, which now also checks the counts and the held state's zero driver time, green in m3-max-60980. |
||
|
|
10d00d44b4 |
player: each pipeline state's making split into the translator's, the driver's and the rest
What: the replay report gains a `pipeline makes N states: ...` summary line and up to ten
`pipeline make slowest K #ID KINDS ...` lines, documented in docs/REPLAY-STREAM.md. KINDS is
kernel, vertex or post-tessellation vertex, plus +fragment.
How: each render and compute state's making is read from metal2vulkan-runtime's own Metrics on
the player's thread before and after it, with the wall time on rt::host_time (the counters' own
clock): translation_nanos against pipeline_creation_nanos, and the rest as "other". No runtime
counter is added. rt makes every state on the calling thread, and the only other thread that can
run beside a making is the player's own pre-pass. So the pre-pass pool now tallies its
prepare_dispatch calls begun and ended. A making that ran while one of them ran is counted
("beside a pre-pass call") and marked, since its figures include that call's work. The compute
states' `pipeline I wall_nanos=` lines take their wall time from the same clock.
Why: the next cold number needs its cause beside it: per pipeline, the translator's work against
the driver's vkCreate*Pipelines.
Verified: replay::rt_replay::each_pipeline_state_s_making_is_split_into_the_translator_s_and_the_driver_s_time
on lavapipe (m3-max-60980, with fmt, clippy plain, m2v_gpu and m2v_cpu_icd, and workspace
Rustdoc green). Without the line it fails at the summary-line find. On a real card: the cold and
warm states-only plays of one recorded stream on an RTX 3090 (m3-max-60954).
|