70dffca0c2b46a9c3bda85a024a8be734cbbdd65
1599
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
70dffca0c2 |
Deep threadgroups run as one row: SpecKey::DeepThreadgroup on from_queries, rt keys it on the size
Metal allows 1024 threads along z; a device's maxComputeWorkGroupSize[2] may hold 64 (NVIDIA's), so rt refused a kernel's threadgroup of 1x1x320 (Limit::ThreadgroupShape) and could not play a recorded stream past its frame 216 on any NVIDIA card. One form serves every shape on every device: a threadgroup deeper than DEEP_THREADGROUP (64) runs as one row of its threads. Translator, on Device::from_queries' profile only (ProfileFacts::deep_threadgroups, OneRow; Device::new keeps Axes and is byte-equal): a kernel whose workgroup is its threadgroup (LocalSizeForm::Spec, no compute derivatives) declares the boolean SpecKey::DeepThreadgroup. Its WorkgroupSize is (Deep ? sx*sy*sz : sx, Deep ? 1 : sy, Deep ? 1 : sz), OpSpecConstantOp selects (the WorkgroupSize rule now takes spec-constant operations whose defaults are positive), and its position in the threadgroup Deep ? LocalInvocationIndex unflattened over (sx, sy) : LocalInvocationId. The linear index, workgroup and grid builtins keep their values, so group counts, regions and indirect buffers are untouched. The binder sets it for a region deeper than 64 and checks that region as the flattened tiers' are. MetalDeviceProperties on that profile reports the capped invocations on every axis (1024 on every floor device) instead of the device's per-axis sizes. SEMANTICS_VERSION 2172, ARTIFACT_FORMAT_VERSION 536. rt: the key is a function of the variant's size (size[2] > DEEP_THREADGROUP), so it adds no pipeline and no cache key. choose() takes no device limit: an image-only kernel's deep tile runs whole as one row on every device (it ran whole on RADV/ANV and in tiles on NVIDIA). fits(), ComputeLimits::max_group_size and Limit::ThreadgroupShape are deleted: every workgroup is within the floor by construction (a const assertion). A module that neither flattens nor declares the key is a creation gap. README: the deep form, worst-case pipeline counts, the 50-pipeline line. REFUSALS.md regenerated; API.md; api_signatures blessed; api_surface pins DEEP_THREADGROUP. Tests: the translator runs a barrier-exchange kernel at 1x1x320, 2x3x100, 1x4x256 (deep) and 4x4x4 on the interpreter, checks the evaluated WorkgroupSize, no key on Device::new, the binder's setting on an NVIDIA profile, and the reported maxima; rt's choice tests drop the device limit; the observing-kernel device test adds deep whole, ragged and indirect dispatches; the square test adds a column 256 deep. Verified: built and tested under the check job named in the report. |
||
|
|
5c5ce57119 |
replay: the Managed form comes from the identity of the device the guest makes its objects on
A stream may record more than one device: reims's one-copy recording on the 780M also holds the host window's device on the display GPU, which is not unified. Each segment opens with one identity record per live device in id order, and the player passed every record to the backend, so the last one decided how every Managed buffer was kept, whichever device the guest used. The player now reads ahead which recorded device the guest makes its objects on (the one that most calls making an object have as their receiver, the lowest id of a tie) and takes the Managed form from that device's identity record only. The report names the other devices on a `devices apart from the guest's` line. Test: a unit test with two devices, one unified and one not, the guest on each in turn. |
||
|
|
53274a5352 |
rt: a Managed buffer keeps two copies on every device that is not unified
What: where device-local memory has no room for a copy block, a Managed buffer's device copy is now a Private block of its own, taken through the pool, so it spills to whatever memory type has room like any Private block; where no type has room, new_managed_buffer returns the allocation's out-of-device-memory error (Metal: nil). Before, such a buffer was its Shared range, one copy, on a device whose has_unified_memory is false. Gauges::managed_spilled_bytes counts the bytes of Managed buffers whose device copy is not device-local, while they live; the replay player reports it beside spilled_bytes. The rt README states the cost: on a full discrete card a Managed kernel reads its copy across the host link. Why: the planner's ruling. Metal keeps a Managed buffer's two copies on a discrete Mac: a kernel's write stays in the GPU's copy until a synchronize, and didModifyRange sends the CPU's bytes over it. With one copy, a kernel's write reached the consumer's bytes, and a range named with no CPU write left the kernel's value in place: a program could observe the difference. Tests: tests::managed::every_device_keeps_metal_s_two_copy_rule_for_a_managed_buffer (every device): a kernel takes each word x to 2x+1, the range is named with no host write, a second kernel reads it. Where has_unified_memory is false the consumer's bytes keep the host's words and the reader reads them, and the buffer's address is not its Shared range's; on a unified device the reader reads the kernel's write. tests::spill: the same rule with the Private type's allocations made to fail (the test seam core.fail_private) and the pool's Private blocks spilled; on a device that is not unified the gauge counts the buffer's 256 bytes while it lives and reads 0 after. The api signature table gains the gauge field. |
||
|
|
d2e5edbd60 |
harness and matrix: record the whole process's instructions per run and gate the frame and burst rows on them
The harness now counts each timed run's user-space instructions across the whole process. The counts repeat run to run where the times do not: rt's p50 spread across processes was 0.16 to 0.27%. The matrix gates the frame and burst rows (WALL_ROWS) on those counts, beside the host-time judgement and floors they keep under the GPU-p50 rule. devtools: ProcessInstructions opens one user-space instructions counter per core type with inherit set, so every thread started after it opens counts: the runtimes' and the drivers' threads too. The harness opens it first thing in main, before any device starts a thread, and each timed run records the counted delta. A node that refuses perf_event_open, and every non-Linux host, records none. harness: each row whose runs were not sized prints `M2V-MATRIX instructions harness-<runtime>/<row>/per_run <p50>`. matrix: a frame or burst row with a count on both runtimes passes the instructions gate as well as its time's limit: - it fails when rt's count is over old's; - it fails when rt's count is past 1.03 times the stored count in scripts/matrix/instructions.tsv (one column per driver family, `all` where the legs agree within 3%); - it is named when its count is more than 1% under the stored count, which then ratchets down; - it is named when no count is stored, and is then gated against old alone. The single-kernel rows stay judged on their GPU p50 as before, and every row's count is shown beside its times. The old runtime's harness counts are parked from the per-record instructions-versus-base check, like its times. instructions.tsv starts empty: a matrix run's counts seed it. VALIDATION.md describes the time rules and the gate in one paragraph. Verified: scripts/matrix tests (python3 -m unittest discover, 45 OK) on this Mac, over this rule and the GPU-p50 rule together. Before the rebase, check m3-max-45591 on msi (at c597bb3603) passed clippy x4, nextest for devtools, harness and rt (118 passed, with the process counter's test), and the release harness build. Count job m3-max-45641 on the 2080's node recorded the per_run count of every row on both runtimes except long_4cb, which is sized. |
||
|
|
b2e33dba6d |
matrix: a harness row with a GPU time is judged on it against the old runtime's GPU-time floor
The planner's ruling on the old-against-old GPU-p50 floors. On the XTX, whose host-time floors
reach 1.2-1.3 on the shader rows (8 runs, m3-max-45546), the same runs' GPU p50 spreads 1.004 on
simd_reduce (36.96-37.12 us, host time 44.9-55.8 us), 1.008 on narrow_ints, 1.012 on image_filter
and 1.024 on constexpr_sampling: the host time's spread is the host's, not the card's. So:
- A row with a GPU time on both runtimes is judged on its GPU p50, new over old, against the old
runtime's GPU-time floor on that leg (the new scripts/matrix/gpu-floors.tsv), with its host
times shown beside it. A ceiling applies to the time its row is judged on.
- The frame and burst rows (WALL_ROWS) stay on their host time and its floor, with the
instructions gate: their GPU time spans the gaps between their command buffers and spreads as
widely on several GPUs (1.68 on the Iris Xe's frame_5cb, 1.43 on the UHD 630's
burst_160_shared). gpu-floors.tsv lists no such row.
- CARD_VARIANCE names rows whose GPU time varies on the card itself: the XTX's sampling (GPU p50
16.3-20.3 us over the 8 runs; 1.264 in the earlier 4-run set, m3-max-45424) and
constant_managed (66.8-69.2 or 74.4 us). They are judged like any other row, never fail a leg,
and are named on its line as the card's variance.
- A re-timed run keeps the row's GPU time too (RETIME_KEEP, harness-retime-gpu/), and the re-time
selection chooses by the same measure (RETIME_SELECT with GPULIMITS and WALLRE), so a row judged
on its GPU time is re-timed and judged on its re-timed GPU pairs.
gpu-floors.tsv comes from the runs behind floors.tsv, no new job: the harness of
|
||
|
|
73f24bed7a |
replay rt backend: the report names the first skipped render state and why
A render pipeline state the runtime answers with a typed gap or the translator refuses is skipped and counted, and nothing said which one or why: the replay device test's draw was skipped on every device (legs 45244, 45245, 45246) with skipped_render_states=1 and no reason. The backend now keeps the first such state's object id and the runtime's answer, and its lines print `skipped render states N, the first #ID: WHY`. The device test prints the backend's lines after the player's. REPLAY-STREAM.md names the line. Verified: the next job builds the validation crate in every cfg and runs the replay test on lavapipe. |
||
|
|
e8113811dd |
replay: the rt backend plays render pipeline states, passes and render encoders
The new runtime builds draws (its render encoder, render pipeline and depth-stencil states), so the player's rt backend stops skipping render encoders whole. It plays, on rt's API: - newRenderPipelineStateWithDescriptor:error:, its constexpr samplers numbered as a compute pipeline state's are (one helper, `numbered`, for both); newDepthStencilStateWithDescriptor:; MTLRenderPassDescriptor.new and .renderPassDescriptor with their m2v.setPass, m2v.setColorAttachment, m2v.setDepthAttachment and m2v.setStencilAttachment setter records; - renderCommandEncoderWithDescriptor: and the render encoder's calls the old runtime's backend plays, with the vertex stage's textures and samplers, both stages' bytes, cull mode, winding, blend color, and the draws' instance, base-vertex and base-instance forms. What rt does not build stays skipped and counted, honestly: a render pipeline state rt answers with a typed gap or the translator refuses (skipped_render_states); a parallel render encoder, or a render encoder of a pass that holds what rt's descriptor does not (resolve textures, depth planes, store action options, a visibility result buffer, layered or tile rendering, a skipped texture) or that rt answers with a typed gap (skipped_encoders); and a draw whose pipeline state, bound buffer or texture, or index buffer is a skipped object (skipped_draws). The render pipeline, depth-stencil and pass-key parsing moves from the old backend's descriptors.rs to replay/translator.rs, shared by both backends, as the sampler's is. docs/REPLAY-STREAM.md says what the rt backend plays and counts. Verified: lint of the validation crate (clippy in every cfg, the replay tests, rustdoc); the device test that follows plays a draw on every device. |
||
|
|
0d1a32436b |
vertex input under the identity domains: every attribute in fixed function, no pulled form
Planner ruling 11-18 (final): fixed-function vertex input for every attribute on every device,
the form native Vulkan uses and the fastest measured on every device, one form. Nothing of the
pulled form is taken on Device::from_queries' profile. Before this, the translator's
containment rule (contain::encoding is Check::InShader without buffer robustness) moved every
[[stage_in]] attribute into the shader, a form that reads through a descriptor the identity
domains refuse, so every rt render state with a vertex descriptor was refused as
Unsupported(IdentityDomains).
Translator (metal::vertex::fetch_as, pipeline::link::vertex::resolve), under the identity domains
only (lower::access::identity), so Device::new's profile and the old runtime are unchanged:
- the containment rule no longer moves an attribute: the device bounds the fetch as it bounds
any (no buffer robustness: a fetch outside its buffer reads what the device gives);
- an unnormalized signed-integer format (Char*, Short*, Int*) is fetched in fixed function into
a variable declared int, VertexFetch::SignedFixedFunction (new): Vulkan's numeric-type match
lets a SINT format feed only a signed variable, and the device sign-extends as Metal does. The
module reads the variable's bits by OpBitcast. Elsewhere such an attribute is still pulled and
sign-extended in the shader;
- every case that pulled is a typed refusal by what it needs, never a second fetch form.
Metal's vertex descriptor on the rt floor:
- Maps directly:
- formats: every Metal vertex format to the Vulkan format of its layout and conversion, by the
device's VERTEX_BUFFER format query. 8/16-bit integer formats read into float attributes go
through USCALED/SSCALED, signed integer formats into int variables, UChar4Normalized_BGRA is
B8G8R8A8_UNORM, the 10:10:10:2 formats are A2B10G10R10, and FloatRG11B10 is
B10G11R11_UFLOAT_PACK32. The validation crate's profiles of RADV (780M x2, RDNA3), ANV (Iris
Xe, UHD 770), NVIDIA (Pascal, RTX 50) and lavapipe report VERTEX_BUFFER for all of them but
FloatRGB9E5;
- steps: PerVertex is VERTEX rate; PerInstance at rate 1 is INSTANCE rate;
- offsets and strides: the descriptor's, baked into the VkPipeline.
- No fixed-function equivalent on the floor, so a typed refusal:
- PerInstance rate > 1 and Constant: Unsupported{VertexStepRate}, by query. They need
VK_KHR_vertex_attribute_divisor's vertexAttributeInstanceRateDivisor (plus ZeroDivisor for
Constant) and supportsNonZeroFirstInstance, which the floor does not enable, so it is
refused on every rt device today. Its needs name the missing feature, or the
maxVertexAttribDivisor limit;
- a format the device does not report for VERTEX_BUFFER: Unsupported{Format} with that format
usage, by query;
- FloatRGB9E5: Unsupported{Format}, not implemented, by need. Of the profiles above only
lavapipe's reports it, and its fetch answers 0 for the fourth component, where Metal and
Vulkan give 1;
- an offset or stride off the format's component alignment (Metal takes any byte multiple on
Apple5+), and an offset, stride, attribute count or layout count past
maxVertexInputAttributeOffset, maxVertexInputBindingStride, maxVertexInputAttributes or
maxVertexInputBindings: Unsupported{VertexInputLayout}, with the limit where one is passed;
- PerPatch and PerPatchControlPoint: Unsupported{Tessellation}, as before.
rt: RenderPipelineKind::StepRate is deleted: the translator's VertexStepRate refusal comes first
on every rt device, so no pipeline states a divisor. README: the vertex input bullets, their
refusals, and the known gap that a vertex fetch outside its buffer returns what the device gives.
docs/API.md: the identity domains' vertex input. REFUSALS.md regenerated, with reach marks for the
two new features (VertexStepRate app, VertexInputLayout rare); api_signatures blessed.
Tests:
- engine_identity_render from_queries_fetches_every_attribute_in_fixed_function (lavapipe and
moltenvk-m3 profiles with buffer robustness and the divisor withheld): ima_vertex's float2
and short attributes are R32G32_SFLOAT and R16_SINT, nothing pulled, L3-valid; a rate-2 layout
is VertexStepRate needing vertexAttributeInstanceRateDivisor. It fails without this commit (the
attributes were pulled, then refused as IdentityDomains);
- rt draw every_device_fetches_a_signed_attribute_in_fixed_function: a short of -2 reaches the
fragment's uint output as 0xFFFFFFFE on every texel; a rate-2 layout is refused as
VertexStepRate. The existing stage-in test (vertex buffer and set_vertex_bytes) now makes its
pipeline.
Verified: the next lint job and the device legs on every device.
|
||
|
|
2aabffabb0 |
rt draws: a buffer bound off its argument's alignment is refused before the draw records anything, by the dispatch's shared check
Identity's Refusal::BufferOffsetAlignment (
|
||
|
|
b29fcccdc9 |
rt: the render encoder's draws, its state, and render states that number their samplers
A render encoder now draws. It holds Metal's render state (a pipeline state, the vertex and fragment functions' buffers, bytes, textures and sampler states, one viewport and scissor rectangle, cull mode, winding, a depth-stencil state, the stencil references and the blend color) and records draw_primitives and draw_indexed_primitives as one vkCmdDraw or vkCmdDrawIndexed each, setting the dynamic state that changed and pushing each function's fields in the one push range. Draws take no barrier, as Metal orders none within an encoder. - render: a content's Draws (slots with accesses, push fields, vertex bindings), derived from the translator's interface; a state numbers its functions' samplers through the compute path's numbering (number_samplers), so new_render_pipeline_state takes sampler_ids, and RenderPipelineKind::Samplers goes; DrawInput refuses what a draw does not supply. Vertex strides are baked (the descriptor key holds them): VERTEX_INPUT_BINDING_STRIDE leaves the dynamic states, so a per-bind stride is refused by DynamicState. The line class's pipeline is made at its first draw, a first-use wait. - pass: both store actions store, so a pass can end its rendering early (a memory barrier after a draw that wrote memory, or a copy a draw needs first) and begin it again with LOAD; Pass::begin serves both. - PUSH_STAGES: one constant for the layout's push range and every push. - Device::new_depth_stencil_state; IndexBuffer, Viewport, ScissorRect; Refusal VertexBufferOffset, IndexBufferOffset, ViewportNotFinite, StencilAttachment; Gap::Draw with DrawKind (Points, DepthTest, Viewport, AttachmentFormats, AttachmentRead). - ring: a write answers its block buffer and offset, so set_vertex_bytes feeds fixed-function vertex input. - harness: one sampler_ids for compute and render states. The census of the gb and b2 render contents (m3-max-44704) set the scope: every translated content reads only SlotGuestBase and ConstexprSampler fields, facts AddressAlignment, DeviceAddresses and MovableStorageWrites, no parameter block, writes no memory; 146 of 267 number samplers; 93 have one vertex binding. Tests: host tests for the viewport mapping; device tests for triangles where Metal's clip space puts them (direct, indexed through a scissor, through a viewport; 3 barriers, no pipeline made, no bytes copied), the line pipeline made once, stencil replace and test, a constexpr sampler sampling each texel, stage_in from a buffer and from bytes, and the refusals and gaps. Not yet run. |
||
|
|
813dd5cfd7 |
matrix: jobs sized from whole builds' peaks, and a job short of RAM runs again with twice its room up to the default
The UHD leg of matrix
|
||
|
|
56efbd0e13 |
matrix: the floors measured with the mean statistic on seven legs; the seeded-floor stopgap deleted
scripts/matrix/floors.tsv held floors seeded from old-runtime runs under the nearest-rank
statistic, some of them the old runtime's paired completions read as a fast run (alu 22.066 on
the 780M leg, 19.640 on the Iris). Measured again with the harness of
|
||
|
|
5abbd52c0e |
matrix: the memory pool's blocks gauge fails only on a rise between iterations 100 and 200
The matrix at
|
||
|
|
5422cf1825 | matrix: every row's GPU p50 beside its time; rows passing only on a seeded floor over 1.10 named | ||
|
|
2f362d5f66 | replay: a texture its descriptor marks outside takes none of the program's IDs; a gpuResourceID record of one stops the play | ||
|
|
f1ae24f38d |
replay: the skipped objects' IDs leave the differing count, beside the compute pipeline states' gap
The new runtime's backend skips render pipeline and depth-stencil states, so nothing in its play reads their IDs; b3's play counted 8,082 of them as differing. It now counts them (skipped_resource_ids) and command-replay leaves them out of differing_ids, as it leaves the compute pipeline states' typed gap. The id lines stay. |
||
|
|
de2ce035e9 |
matrix: creation rows timed alone in five processes, per-row floors, an A B B A re-time
The planner's timing rule for the matrix's harness legs: - The harness takes `--skip NAME,...`, and a name ending in `*` in `--only` or `--skip` names every workload it starts. A name that names no workload is an error. - Each runtime's harness run skips the creation rows (`--skip 'create_*'`); they then run alone (`--only 'create_*'`) in five processes per runtime, each with a fresh driver cache and store, so no row before them moves their times. The first process's records are kept whole, its device's gauges at drop renamed to harness-<runtime>/creates/device/... so every key is recorded once; the later processes keep only the creation rows' first samples, as harness-first/<row>/<n>/<runtime> (parked records). - A creation row's first sample (/first, /first_take, /next_take, /first_allocation_total) is judged by the ratio of the medians of its five processes; a single first sample is never red. - A row's limit is 1.03 times the greater of its ceiling and its floor: the widest ratio between two of the old runtime's own runs of the row on that GPU (scripts/matrix/floors.tsv, seeded from store2's noise table's "widest" column; 1002:1900 has no column there, so its floors are 1). Ceilings are unchanged. - A row past its limit is re-timed once, A B B A (two pairs), and fails only if the median of the pairs' ratios is past the limit too. Deterministic counts are untouched. docs/VALIDATION.md describes the new runs and rule. Verified: scripts/matrix/test_results.py, 33 tests OK locally (new: a row within its floor passes, past it but back within on its re-time passes, past both fails; first samples by the median of five, never one alone; the creation processes' sed programs record each key once; the floors table reads). The generated harness_runs shell passes bash -n for a Linux and the Windows leg. The harness's selection tests and lint run in the check job. |
||
|
|
366ff410a3 | replay: the old runtime's backend tells a texture's storage mode too, for the texture_writes line | ||
|
|
48f7079244 |
replay: the report counts CPU writes into Managed textures a committed user may still be using
Whether rt must capture a Managed texture's bytes at replaceRegion (rather than when the GPU copy is next used) turns on how often a program writes one while a command buffer that used it may still be running. The report now says. - The player keeps, from the stream alone (replay/texwrites.rs): the textures and each view's texture; each encoder's command buffer; the textures each command buffer used (an encoder call naming the texture or a view of it, or an encoder made with an MTL...Descriptor object, or one made on such an object, that names one); each texture's latest committed user per queue; and the completions the stream records, which are only the program's CPU waits (waitUntilCompleted of a command buffer or a later one of its queue, waitUntilSignaledValue:timeoutMS: reaching a value one of its queue's command buffers signals). The play itself waits at each commit, so this is the recording's order, not the play's. - At each call on a texture that carries bytes (replaceRegion:...), blobs resolved, it asks the backend whether the texture is Managed (Backend::managed_texture, default None; the rt backend answers from the texture's descriptor) and counts the write, and where a committed user has no recorded completion, counts it by the presents since that user's commit (0, 1, 2, 3+) and names the first eight. - Report::texture_writes (TextureWrites) carries the counts and the report's texture_writes line says them, with the writes into textures whose storage the backend does not tell. REPLAY-STREAM.md section 10 documents the line. Verified: a replay test (Kept backend) writes a Managed texture used through a view by a committed command buffer, before and after a present, writes a texture that is not Managed, and writes again after the CPU waited: 3 writes, 2 with the user not seen complete (one per present bucket), the first two named; clippy and the plays in the check job. |
||
|
|
1d9ceb87c8 |
rt: the compute encoder's use_heap keeps the heap's block for its command buffer, and the new-runtime player plays useHeap
Metal's useHeap: names a heap the encoder's work may reach. rt had no such call, so the player skipped and counted each one. ComputeCommandEncoder::use_heap takes the heap's block number (a HeapRange's block, or the block a placement heap's buffers sit in) and keeps that block in the command buffer until it retires, exactly as use_resource keeps a buffer's block (keep and the new keep_block share one list). Metal states no retention for useHeap:, so keeping is the safe reading. The call declares no access: a kernel that reaches a heap's resources through addresses outside its slots already orders against every write since the last barrier. A number no handle names answers Error::NoSuchBlock, as new_buffer's does. The player's compute encoders now call use_heap with the heap's block, and still skip and count a useHeap: of a skipped object. REPLAY-STREAM.md's skip list and the rt README say so. Test: heap::every_device_holds_a_used_heap_until_its_command_buffer_retires takes a Private block, uses it twice in one encoder (the command buffer holds it once), releases it while the encoder is open (the command buffer still holds it, and a new use of its number answers NoSuchBlock), commits, and waits for the block's last holder to go once the command buffer retires. api_signatures.tsv regenerated (one new method); REFUSALS.md unchanged. |
||
|
|
61f2799088 |
replay: --until-frame, frame lines as each frame ends, and the rt backend's unwritten line
A play that hangs (gb's fault at frame 1095, b2's at 312) wrote no report: report.txt got its frame and end lines only at the play's end, so every hung play left 0 frames in its timing table, and the cold and warm plays of the frames before each fault could not be read. - Player::until_frame(F) stops after frame F's present (frames counted from 0 as Report::frames counts them), completes the work committed so far and reports as at the stream's end; command-replay's --until-frame F sets it and says `until-frame F`. - Player::with_frame_lines(out) writes each frame's lines (Report::frame_lines: its frame and end lines) to out as the frame ends, flushed; command-replay passes its open report.txt and writes the rest at the end (Report::lines_but_frames). Report::lines keeps every line, the completed groups' first. - The rt backend's report gets an `unwritten N` line: the Shared buffers made without bytes that a compute encoder bound or used and whose command buffer committed before any recorded write, upload or GPU pass reached their bytes since their making, with the first few named and the command buffer that read each. It is where a recording that missed the program's writes shows (b2's uniform ring #58725 had no recorded byte in its life). What reaches a buffer: an m2v.write into it, into its block over it or into another buffer of the block over it; a blit or render encoder call naming it or such a buffer (skipped encoders included); the commit of a dispatch binding it. It counts and stops nothing (new_runtime/unwritten.rs, hooks in the make paths, write, release, the encoder calls and the commit). REPLAY-STREAM.md section 10 documents --until-frame, the per-frame lines and the unwritten line. Verified: replay tests for the frame stop and the per-frame lines (Kept backend) and for the unwritten count (the tracker alone: block writes, a blit naming, a write before the commit, a release, a later commit, an alias made later); clippy and the device plays in the check job. |
||
|
|
92f773ba0a |
conformance: record buffer-bind-off-alignment on the M3 Max
Record mode (job m3-max-44847 at 09c51a35ef, an Apple M3 Max, macOS 27.0.1) took the case's two Metal facts: - Plain Metal ran the pass: every step answered Ok, and the command buffer is Completed with no error, over 3 runs folded into one outcome. - Metal's API validation stopped it at the pass: "Compute Function(vwp_words): the offset into the buffer src that is bound at Buffer index 0 must be a multiple of 4 but was set to 2.", and the same for dst at index 1. docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py): 167 case modules, 1,282 recordings. Verified: the recording's facts as listed (read from the file); coverage.py --check passes. |
||
|
|
9bec8a977e |
rt: a dispatch that reaches a buffer bound off its argument's alignment is refused
The planner ruled that the bind-offset mask becomes a typed refusal. The binder pushed a bound
buffer's address, its gpuAddress plus the offset, rounded down to the alignment the kernel takes
it to have (FieldValue::BufferAddress's mask, from RuntimeFact::AddressAlignment), where Metal's
API validation refuses the bind offset ("must be a multiple of 4 but was set to 2" for a uint *
argument, probe vector_access_placement.m in the conformance crate). Plain Metal runs such a
dispatch at addresses of its own: an M3 Max reaches each element at its address rounded down to
the smaller of its alignment and 4. That is not the rounding the binder did for 8- and 16-byte
arguments.
The dispatch now refuses it with Refusal::BufferOffsetAlignment { index, offset, alignment }
before it records or keeps anything. check_alignment runs after the threadgroup size check and
before a kernel without effects returns, so both direct and indirect dispatches take it.
fill_parameters pushes each address as it is. A set_bytes copy sits at a multiple of 16 in the
ring, which every mask divides, so it is never refused.
Docs:
- docs/API.md: the identity-domain paragraph and the section 10 entry (renamed: "A dispatch that
reaches a buffer bound off its argument's alignment is refused"); no case names its slug.
- RuntimeFact::AddressAlignment's doc and the mechanism comment.
- The rt README paragraph and FieldValue::BufferAddress's doc.
- docs/REFUSALS.md regenerated (44 rt refusals); api_signatures.tsv gains the variant's row.
Tests (device, under --cfg m2v_gpu or m2v_cpu_icd):
- every_device_refuses_a_bound_address_off_its_alignment (was ..._rounds_a_bound_address_down_...):
at alignments 2, 4, 8 and 16, each of 17 binds 1 to 15 bytes past a multiple of 16 that the
alignment does not divide is refused and leaves the buffer unchanged, and the same buffer bound
at 48 runs. Without the check every one of the 17 dispatches returns Ok.
- an_argument_bound_off_its_alignment_is_refused (was ..._runs_at_the_address_rounded_down):
the translated vector_word_phases kernels with one argument off its alignment are refused,
naming the index, offset and alignment, and the command buffer completes with every buffer
unchanged.
|
||
|
|
d1e9062b5f |
rt: blocks are ranges of 16 MiB allocations; the block-maker thread allocates only while a class's free bytes run low
The pool handed a take of up to a block length a whole pooled block and kept one ready block per
class, which the block-maker thread made again as soon as a take used it. A 16-byte Shared buffer
took the ready block, and the 16 MiB allocation that followed held the consumer's next pipeline
creation for its whole length on NVIDIA's driver.
Now each block is a range of one of its class's allocations, with its own VkBuffer:
- A take is a kept block of its length, else the first free range that fits, else the start of an
allocation made in the call: 16 MiB, or the block's own length where that is longer. Lengths
round up to 64 KiB (or bufferImageGranularity); a block starts at its length rounded up to a
power of two, up to 2 MiB.
- Device::new makes one 16 MiB allocation per class. After that, the block-maker thread makes
another only while the class's free bytes are under 8 MiB. A take never waits on it for memory.
- A take that no free range fits, while the class keeps blocks of other lengths, allocates at once.
It also asks the block-maker thread to give those blocks' bytes back, after the consumer's hook.
Only when its own allocation fails does it wait for those bytes, then look for a free range once
more.
- An allocation holding no live block is idle. A class keeps its idle allocations while their
bytes plus those of its allocations in use stay at or under the most bytes it had in use over the
last 10 seconds, and within an eighth of its memory type's heap. Past that it frees the oldest,
except the reserve that keeps 8 MiB free. The rule runs at takes and give-backs on an injectable
clock; there is no timer.
- Removed: the dedicated path, fits-and-fills-half, the 256 and 128 MiB idle bounds and the 64 MiB
Private block.
- Metrics: blocks_reused replaces dedicated_blocks_reused. New metrics: block_bytes_made, and the
vkAllocateMemory time on the consumer's threads (count, total, longest) apart from the
block-maker thread's.
Tests:
- Unit: rounding, base alignment, and the window and surplus rule.
- On device:
- the first allocations, and the trigger at 8 MiB free;
- kept blocks taken again with their number, address and mapping;
- an allocation beside kept blocks of other lengths, with their bytes given back;
- the failed-allocation path, at an answered maxMemoryAllocationCount;
- idle allocations following the window down, the reserve kept;
- a seeded 300-step stress of mixed takes and releases across both classes, each step under a
one-minute timeout.
- Tests that took a block of 1 byte and used more of it now take what they use.
- The replay's rt counters read the new metrics.
Verified: cargo fmt; api_signatures blessed; REFUSALS.md regenerated. Clippy, the suites and the
device legs follow as potluck jobs.
|
||
|
|
13bb9a0a4e |
replay: Managed buffers play in the recording device's form, from its identity record or --managed
How a Managed buffer behaves depends on the recording device's hasUnifiedMemory: one copy where it is true (a CPU write needs no didModifyRange), a GPU copy made at the buffer's making and changed only by didModifyRange where it is false. The stream did not say which, and the rt backend always made the runtime's Managed buffer: gb, recorded on a discrete GPU, wrote its no-copy Managed buffers (#368205, #368202, #368214) once before first use with no didModifyRange, so their GPU copies never got the bytes; b2, recorded with unified memory, relies on such writes legitimately. The player now takes the form from the stream's new m2v.deviceIdentity record (it plays as nothing and tells the backend hasUnifiedMemory through Backend::recorded_unified_memory), or for a stream without one from command-replay's --managed one-copy|two-copy. One copy: every Managed buffer plays as a Shared one. Two copies: the runtime's Managed buffer, its GPU copy from the bytes it was made with: a copied buffer's, or the new create-time bytes a no-copy one's making now carries (newBufferWithBytesNoCopy's first argument, a no-copy descriptor's contents). A stream with no identity record gives none, so a no-copy buffer's GPU copy takes the writes recorded before its first use (the commit of a command buffer whose encoder names it). With neither the record nor the setting a Managed buffer stops the play with an error saying so. The report's managed line names the form and its source, counts the Managed buffers and the no-copy ones with contents from first use, not from create, and notes a two-copy recording played on a unified-memory device. REPLAY-STREAM.md documents the identity record, the create-time bytes and the player's rule. Verified: a replay test plays an identity record as nothing and sees the backend told hasUnifiedMemory; the rt paths need a device play (gb on the 3090 next). |
||
|
|
2868c3946d |
rt error: the BufferCopyOverlap variant and its Display arm closed again after the rebase over the b2b copy
Rebasing the render encoder over
|
||
|
|
4d1b0bf113 |
rt: the render encoder, one dynamic rendering a Metal render encoder with its load and store actions one to one
CommandBuffer::render_command_encoder(&RenderPassDescriptor) is renderCommandEncoderWithDescriptor:. It begins one vkCmdBeginRendering (dynamic rendering, in the floor: floor.rs requires vulkan13.dynamicRendering) into the pass's attachments, and end_encoding ends it with vkCmdEndRendering. Load and store actions map one to one (Load/Clear/DontCare, Store/DontCare). A clear color is a float in a float, normalized or sRGB channel (the device converts it), and an integer channel's is truncated toward zero and saturated, NaN 0, as Metal's; rotated formats and A8Unorm held in R8_UNORM go through the format's rotation; a clear stencil keeps its low 8 bits. The render area is the smallest attachment's level, cut to renderTargetWidth/Height where set. Each attachment is one level and slice of a 2D texture, 2D array, cube or cube array of one sample: the texture keeps an identity-swizzled image view of that level and layer, made at the first pass and freed with the texture through the reaper (new gauge attachment_views). A pass orders itself as a blit copy does, two barriers: the first after every earlier command, moving shader-read-only homes to the attachment layout (general and attachment homes render in place) and paying an owed barrier; the second after the rendering, moving them home and making the writes visible to every later command. Refused as Metal's validation stops them: Refusal::AttachmentUsage, AttachmentPlace, AttachmentFormat; past maxColorAttachments, Limit::ColorAttachments. Not built, Gap::RenderPass naming RenderPassKind: a depth attachment, more than one sample, a resolve, a 1D or 3D attachment, the Unknown and CustomSampleDepthStore store actions, a clear of a format only a shader clears, a pass with no attachment. The replay streams' passes (pass census over gb and b2, counts only): one or two color attachments plus a stencil in 11,187 of them, every attachment a level of a 2D texture of one sample, no depth, no resolve, loads Load/Clear/DontCare, stores Store/DontCare. Tests: tests::pass's host tests pin the action mapping and the clear values; on_device clears a mip level of a shader-read texture (moved and back), an integer texture and a stencil, loads and keeps, cuts the area, clears one slice of a 2D array, and counts one pass alone as one submission, three barriers, one pass and no bytes copied; each view is made once and freed with its texture; refusals leave the command buffer open. README render encoder section and known gaps; REFUSALS.md and api_signatures regenerated. Verified: the lint job and the device legs are the check. |
||
|
|
b0e68fd826 |
Delete the folded-tile pipeline: a kernel that is not image-only runs every grid in the remap's tiles
The planner's ruling makes the rule two lines. An image-only kernel that does not observe its threadgroup partition is declared: 16x16x1 on a grid one deep, the grid's tile (grid_tile) on a deeper one, at MultiRegion 0 with the extent test. Every other such kernel runs today's remap: 256-lane workgroups, each one tile the region carries. The fold no longer serves buffer-touching kernels. Image-only kernels used it only where the grid's tile is past the device's maxComputeWorkGroupSize, and that class is too small to keep a form for, so those dispatches take the remap too. The census (replay's job m3-max-44582, both recorded streams): image-only non-observer dispatches whose tile is past a depth of 64 (NVIDIA's, the floor's limit) are 6 dispatches, 1,760 threads in each stream, one (spec, tile) pair of tile 1x1x256. That is 0.0004% of the image-only non-observer threads in one stream and 0.0033% in the other. No tile is past a side of 1,024. Deleted: SpecKey::FoldedTile and the select that took it in place of the region's tile (lower::dispatch), its binder entry, codec tag, signature row and API guide sentence; rt's Variant::fold, Constant::FoldedTile, Choice::fold and Last::fold. The cache versions stay at this branch's single bump (SEMANTICS_VERSION 2171, ARTIFACT_FORMAT_VERSION 535, now for KernelFacts::image_only and the edge test under MultiRegion 0 alone). An image-only kernel's pipeline per tile stays: its workgroup is the tile, so a deeper grid's first dispatch at a tile makes it, and waits once, as the square device test's two-deep dispatch checks. Verified: cargo fmt; docs/REFUSALS.md regenerated (unchanged). The dispatch-choice tests pin a tiling kernel's grids of every depth in the remap's tiles, and a 1,024-deep column in them past a depth of 64. The translator's engine test runs the edge kernel at MultiRegion 0 in 16x16x1 workgroups and at the grid's tile. |
||
|
|
45b27a7623 | WIP square workgroups: docs, refusal surface, device test | ||
|
|
361b9aa29b |
replay: rt plays buffer copies, and guest-RAM copies through a staging place and a buffer copy
Both recordings' guest-RAM copies (gb 106 before frame 1095, b2 14 before frame 312) land in Private buffers, and the rt backend skipped them, so the bytes and addresses they carry never reached the GPU. A buffer-to-buffer copy now plays as rt's copy_from_buffer_to_buffer. A copy from the guest's RAM, the recording's plumbing, plays as its pieces' bytes in a Shared staging place of the backend's own, then a buffer copy into the target in the same blit encoder, so the GPU's order holds. A buffer copy takes whole 4-byte words at 4-byte offsets: a piece's edge bytes up to whole words come from the target's mapping where it has one; a piece with such edges into a buffer with none is skipped and counted. The staging place is given back at the command buffer's commit and is free once it completes, so the staging stays bounded by the work in flight (staged_guest_ram_bytes counts it). The player times these copies in a column of its own (`upload`), the recording's share and not the runtime's. |
||
|
|
3201e09737 |
rt blit: copy_from_buffer_to_buffer, Metal's copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:
The replay's rt backend skips buffer-to-buffer copies and the guest-RAM copies that need one, so their destinations are never written on rt: the lead suspect for gb's hang and b2's device loss on the 780M. This builds the copy. One vkCmdCopyBuffer region between the bytes shaders reach (a Managed buffer's device copy where the device keeps one), between a fill's two barriers: the first after every earlier command (paying an owed barrier, hazard sets start again), the second making the write visible to every later command; a copy into a Shared buffer marks the segment so its end reaches the host. The command buffer keeps both buffers until it retires; textures over either device copy are settled as the other copies settle them. A size of 0 records nothing. Refused: another device's buffer (OtherDevice); a range past either buffer's end (new Refusal::BufferCopyRange, Metal's validation); an offset or size not a multiple of 4 (new Refusal::BufferCopyUnaligned, Metal's documented macOS rule); a source and destination sharing bytes, one buffer's overlapping ranges or two buffers overlapping in one block (new Refusal::BufferCopyOverlap: vkCmdCopyBuffer forbids it, VUID-vkCmdCopyBuffer-pRegions-00117, and the runtime does not emulate it). Tests: a host test pins the checks (offsets in the device buffer, adjacent buffers of one block, size 0 anywhere, each refusal); on_device copies between two buffers of one block and within one buffer, the bytes checked and everything around kept, one copy alone one submission, three barriers, one pass and no bytes copied; a copy into a Managed buffer lands in the bytes shaders reach, brought to the host by a synchronize. README blit section; REFUSALS.md and api_signatures regenerated. Verified: the lint job and the device legs are the check. |
||
|
|
c7b709b156 |
replay: rt plays textures over buffers and views, substitutes surface textures, and counts each skip by kind
The rt backend skipped every texture over a buffer, every texture view and every IOSurface texture, and with them each dispatch and blit that bound one: words in the program's memory then named textures the play never made. Textures over a buffer now play as the runtime's (Buffer::new_texture) and views as its views (Texture::new_texture_view). An IOSurface texture, a tiled texture over a buffer, and a texture or view the runtime answers with a typed gap become an ordinary texture of the same descriptor, counted as a substitution (the recording's artefact, not the runtime's). optimizeContentsForGPUAccess plays as nothing; the blits still not built are counted by kind: buffer copies, guest-RAM copies in and out, texture syncs and mipmaps. The report's second line says how far relocation reached: words relocated, words left at 4 past 8, address arguments, writes into objects with no recorded range, and the objects whose ID differs from the recording's, which now make the play an error. The relocation tests assert the writes of no address are counted. |
||
|
|
a19807b814 |
translator + rt: a render pipeline's two functions push one range of the floor, dense by link
On Device::from_queries' profile (PushWindow::Floor) a vertex function's push window is [0, 256) and a fragment function's [push_base, 256), where push_base (a new LoweringInputs field, keyed only when set) is the vertex function's push end rounded up to 8 (CompiledFunction::fragment_push_base). compile_render_pipeline compiles the fragment from the vertex it compiled; rt sets the base from the lowered vertex before lowering the fragment. Under the identity domains a vertex or fragment function whose fields do not fit is refused, Unsupported(IdentityDomains) with maxPushConstantsSize's limit, never spilled. Link refuses a fragment whose fields start inside the vertex function's, InvalidDescriptor(PushBase). The fixed windows of Device::new (vertex [0, 64), fragment [64, 128)) and a compute kernel's are unchanged; a mesh pipeline's fragment keeps its start past the mesh window. Why: the planner ruled the dense layout over the census of gb and b2 (job m3-max-44421, every content's functions resolved at its creation): 267 and 259 translated pairs, at most 248 bytes, none over 256; four fragment bases (8/16/24/40), and no fragment function meeting two, so the base costs no extra lowering. A fixed 128/128 split loses 3 pairs in each stream; the old 64-byte windows spilled 6 into a parameter block. Tests: push.rs pins each kind's window on both profiles (a compute kernel's does not move with a render base) and places a fragment from its base to the floor's end; engine_identity_render compiles colored_vertex + sampled_fragment on from_queries with the fragment's fields at 16, and refuses the fragment compiled apart at base 0 (PushBase) until it compiles under the vertex's base. The floor already refuses a device under 256 bytes (tests::floor, maxPushConstantsSize 255 and 64). Verified: cargo fmt; api_signatures blessed, REFUSALS.md regenerated. Lint and legs follow. |
||
|
|
2ac0ea6799 |
replay: each frame's end says where its wall time went
A spike frame's wall time needs a split by cause before two runtimes can be compared on it. The player now times, on its own thread, each kind of work: reading and decoding the stream and its blobs, writing bytes into the runtime's memory, reading back, waiting for command buffers, the calls that make or release resources (with the longest one), the calls that make libraries, functions and pipeline states (with the longest one), every other runtime call, and reading the runtime's counters; what is left is the player's own work. Beside them, a frame's GPU busy time is the union of the GPU intervals of the command buffers it waited for, which a new Backend method gives: both runtimes' GPUStartTime and GPUEndTime. The end line carries them, and the old runtime's counters add its vkCreate*Pipelines and shader-cache nanoseconds. A test plays three command buffers, two of them overlapping on the GPU, and checks the frame's GPU busy time counts the overlap once and the end line holds the times. |
||
|
|
8fa569e62d |
harness, matrix: each runtime keeps its pipelines in a store of its own, fresh for the matrix's main run and warm for its warm run, so create_state and the first uses compare like for like
The old runtime's shader cache defaulted to the per-user ~/.cache/metal2vulkan, which every earlier run on the node had filled, while the new runtime's harness device kept no store: create_state's first state and the first-use rows timed old warm against rt cold (jobs 44170, 44171: old's first on the 2080 2.9-3.2 ms on its warm cache, 8.9-9.7 ms on a fresh one). - old::system_default and rt::system_default take the store (None: the runtime's default, for the tests). - The command takes --store DIRECTORY: each session keeps its pipelines in <DIRECTORY>/<place>-<runtime>; without it, a directory made for the run under the OS temp directory and removed when it ends. Each runtime's line and each create_state row say "store fresh" or "store warm, N files". - The matrix gives each runtime's main run a fresh empty store beside its fresh driver cache, and its warm run the same store; a re-timed row's runs take the harness's own fresh store. - VALIDATION.md and the harness docs say so. Verified: the matrix's harness script, rendered and run against a stand-in harness, passes a fresh --store to each runtime's main run (cygpath'd on Windows); the build, clippy and the authored tests in the check job. |
||
|
|
e0f76d7836 |
harness: a multi-command-buffer row is judged by its last command buffer's commit-to-complete time, and each command buffer's lateness is a column
The planner's ruling on long_4cb's red: rt reports the command buffers committed while an earlier one runs complete together, at the group's last end, which the owner accepted. The mean over a run's places counted that lateness: on the 2080, long_4cb's #2-#4 came at 96.2-97.3 ms where the old runtime's came at 71.7, 83.7 and 95.6 ms, while the last's own (96.6-97.2 against 95.6-95.8 ms) is not late (jobs 44196, 44197). The rule holds for every row of several command buffers, so frame_5cb's too. - run::matrix_time is the steady time of each run's last command buffer's commit-to-complete time. - The harness's completed handler is given its lateness, from the command buffer's GPUEndTime to the handler's start on the runtime's host clock (rt::host_time, the old runtime's host_time); Report::late_us holds it by place, and the table prints late_us_p50 and late_us_p99 beside the c2c columns, with a line by place. It is no record: no ceiling until the first host-time matrix shows it on every GPU. - The rt README's queue known gaps carry the measured lateness; VALIDATION.md and the harness docs say the last command buffer's time. Verified: the matrix_time unit test asserts the last place's time where the mean differs; the check job builds and runs it. |
||
|
|
4c5257d3ec |
replay: the report's first line names the runtime and whether the play took snapshots
A timing table must never come from a snapshotting play unnoticed: the device line reads device NAME runtime old|rt snapshots yes|no for both runtimes. Verified: cargo fmt only; clippy, replay tests and the release build next. |
||
|
|
fd0f8fcaef |
replay: --snapshots no plays every m2v.privateBytes dispatch as it is on either runtime, so old's and rt's plays do the same work
Old's play of gb on the 3090 with snapshots read 0.54 of 1.9 GB of stream in about 5 minutes (m3-max-44322, cancelled before its 15-minute limit): the player's own splits and readbacks around 12,000 dispatches dominate it, and rt declines them, so their frame times and memory would not compare. Player::without_snapshots takes none on any backend. Verified: cargo fmt only; clippy, replay tests and the release build next. |
||
|
|
6dab612810 |
rt: take_block returns a Block handle, and dropping a block's last handle gives the block back
A block was plain data (BlockInfo) owned by the device's claims map until release_block(id) or the device's teardown, so a block whose number the consumer lost was held until the device died: memory unreachable but held, a leak by construction, which the "zero at device drop" gauges do not see (the player's play ran out of memory at frame 1074). The planner ruled the handle as proposed: - take_block returns Block, rt's own handle with no Metal counterpart, which derefs to the block's BlockInfo. Clones share one claim (Claim); the drop of the last handle runs what release_block ran: the device forgets the block's number and the work's pending upload counts it, and the block is zeroed and kept or freed once no buffer, command buffer or upload uses it. - The device keeps claims by number as weak references, now in the core (Core::claims), so every call that takes a block number still does (new_buffer, new_managed_buffer, heap ranges); a number whose handles are all gone answers Error::NoSuchBlock. - release_block(block: Block) consumes a handle: the drop made explicit; another device's block is Refusal::OtherDevice. - The device's teardown frees every block still claimed after halt, that is after the consumer's BlockMappings::unmap returned for each handed block (contract 6A's order: the claims' slots are emptied only then); a handle dropped after the teardown finds its slot empty and does nothing. The harness keeps each pooled block's handle and gives a dedicated block's to its buffer; the replay backend keeps a stream block's handle in its object and a dedicated place's in the place. rt's tests hold their handles where they used to hold numbers. Tests (device cfg, command.rs): a dedicated block whose last handle drops with no release_block while a held command buffer uses it answers NoSuchBlock for its number at once, stays live (Gauges::blocks one up) until the command buffer completes, and is then freed (back to where it was); of two clones, dropping one gives nothing back and the number still names the block, releasing the other frees it; a handle that outlives its device finds every gauge zero after the teardown, and its drop does nothing. README, the BlockInfo, NoSuchBlock and OtherDevice docs, docs/REFUSALS.md and api_signatures.tsv follow. |
||
|
|
11b77a466e |
rt: render pipeline states on the content key, sharing the device's map of contents
Device::new_render_pipeline_state(&RenderPipelineDescriptor) is newRenderPipelineStateWithDescriptor:error: without reflection. A state's content is the translator's render_variant_key of its descriptor; render contents and compute kernels share the one bounded map of 1,024 contents (kernel_map::Content), so a state of a held content costs the key and a lookup. Each content lowers its vertex and fragment functions through the cache directory's translations, and makes its triangle-class VkPipeline at creation through its own pipeline file (the per-pipeline cache use is now one helper, made_through_cache, shared with the compute path, and the layout's words one function, layout_words). A point or line class's VkPipeline comes with the draws. Everything Vulkan 1.3 leaves dynamic is dynamic state; the pipeline renders dynamically into the attachments' formats. Built: one vertex and at most one fragment function, colour and stencil attachments, one sample. Refused by Gap::RenderPipeline with a RenderPipelineKind: depth, multisample, amplification, tessellation, synthesized stages, framebuffer fetch, imageblock, shader stencil, alpha to one, step rate, numbered samplers, constant data, other specializations, dynamic state beyond 1.3, and a feature or extension device creation does not enable. Gauges::render_contents counts the contents alive. The harness gains create_render_state, create_state's render twin: colored_vertex and colored_fragment of the public examples fixture into one BGRA8Unorm attachment, the first creation (a content unseen) timed apart, then 1,000 of the seen content, on old and new. Tests (tests/render.rs, every device of the cfg's kind): a second state of a content lowers and makes nothing and shares the first's; another format, a blended attachment and a stencil attachment with two colours are contents of their own; depth, four samples and a constexpr sampler are refused by kind with no pipeline; a device on a cache directory a device before it used reads both lowerings and writes nothing. |
||
|
|
21b5fb6c3d | replay: the rt backend's counters add dedicated blocks taken again and dispatches without effects, and its frame ends the idle Shared and Private bytes the pool keeps | ||
|
|
c2ab6cc79a |
replay: the rt backend times each compute pipeline state's making and says whether its kernel was new, on a pipeline line of the report
The planner asks whether NVIDIA's first-pipeline cost is paid once per process or once per kernel: each state's making's wall time, in order, with whether another specialization of its kernel (a library's function by name) was made before. Backend::lines carries the backend's own report lines; command-replay prints them after the player's. Verified: cargo fmt only; build, clippy and replay tests next. |
||
|
|
9ab646922d |
replay: the rt backend gives the stream's blocks and heaps back at their release; old plays what only the scratch player did; each frame's end reports wall time, resident memory and the backend's gauges
- The rt backend dropped a released m2v block or heap without Device::release_block, so every block gb made and released stayed allocated; the 3090 play stopped at frame 1074 on vkAllocateMemory (m3-max-44161). - The old backend skips a library from source (no device here compiles Metal source), what is made of a skipped object, and the draws of a render encoder whose pipeline state is one, all counted; it takes MTLRenderPassDescriptor.renderPassDescriptor and the copyFromBuffer:... toTexture: form without options. Those were the scratch player's alone, so old could not play gb from development. - Each frame's end line: wall nanoseconds, VmRSS, and the backend's gauges as they stand (rt's live blocks, buffers, textures, pipelines, kernels, command buffers, spilled bytes and the bytes of the blocks the backend holds by class; old's live, empty and dedicated memory blocks). Old's counters add device memory allocated and pooled blocks made and freed. The skipped and gaps lines are printed for both backends, before ok or error as documented. Verified: cargo fmt only so far; build, clippy and the replay tests run next on msi. |
||
|
|
32d511d17d |
harness, matrix: long_4cb runs one size on both runtimes: --size gives a sized row its size, the matrix passes the first runtime's to the later runs, and a row run at two sizes fails uncompared
A workload whose size follows the device (long_4cb) was sized by whichever runtime ran it first in
its process. The matrix times each runtime in its own process, so each sized it from its own base
time, and they could run different work: the RX 550's long_4cb ran at different sizes on the two
runtimes at
|
||
|
|
b96e61afa3 |
docs: VALIDATION.md's matrix says a harness time is host time and a ceiling is only ruled
The `time` record kind is what a program waits on, timed on the host (commit-to-complete where the workload times it, else the wall time a run adds), since the harness's matrix_time change on this branch; the harness budget lists no ceiling now, and one is given only by a ruling after the work on its row. The doc said GPU time and measured-ratio ceilings. Verified: the text only; python3 scripts/matrix/test_results.py, 28 OK on this branch. |
||
|
|
80bd8ca764 |
rt: pooled blocks are 16 MiB of Shared memory and 64 MiB of Private
A pooled block's length is now per memory class, MemoryClass::block_len: 16 MiB Shared and 64 MiB Private on every device. It replaces the one 256 MiB BLOCK_LEN. take_block gives a pooled block up to the class's length and a dedicated one past it. Textures are placed in texture blocks up to the Private length. The harness and the replay player's places take blocks of the class's length. Why: a driver may hold the device's other calls for the whole of a block's vkAllocateMemory, and the hold grows with the bytes, so the length sets how long one hold lasts. On an RTX 3090 (NVIDIA's Linux driver, probe at 70d7cae48e, jobs 44050 and 44053 with the RTX 2080), a pipeline creation beside a Shared block's making took 40-45 ms at 256 MiB and 6-8 ms at 16 MiB (3-4 ms settled). 16 MiB is the largest piece a guest's allocator takes. Private holds less: 3.4-4.6 ms beside a 64 MiB block, at most 1 ms more than beside a 32 MiB one. At 64 MiB, a texture or a Managed buffer's device copy of 32 MiB takes a pooled block. Tests: every_device_pools_16_mib_shared_and_64_mib_private_blocks covers the lengths, the dedicated block past each, and a 32 MiB texture placed in a texture block. The memory, command, places, spill and upload tests use the class's length. The memory test reads a Private block back a Shared block's length at a time. API table re-blessed (the BLOCK_LEN const goes, MemoryClass::block_len comes). |
||
|
|
4b88203551 |
rt: a texture over a Managed buffer's device copy that the device's linear image does not take is copied at Metal's Managed events
Where the device's linear image does not hold a texture over a Managed buffer's device copy in
place (another pitch, an offset off the image's memory alignment, a format or usage the linear
tiling lacks), the texture was refused (Gap::TextureOverBuffer). It is now an optimal image of
its own, copied from and to the device copy only at Metal's own Managed events, with no tracking
of commands:
- in, from the device copy, by the upload that leads the next submission using the texture,
where a did_modify_range met its range (after the upload's copy of that range) or submitted
device work wrote the buffer (a binding whose compiled interface writes it: the translator's
uses, not the declared access; a blit or fill into it) or another texture over a range that
meets its;
- back, where device work wrote the texture, before the next reader of the device copy (a
binding that reaches the buffer, a blit from or into it, a copy into another texture over a
range that meets its, a synchronize_resource, a did_modify_range over it). A reader recorded
after the write takes it in its own commands; the upload that leads a submission, which runs
before the submission's commands, takes it only once the write's segment was submitted
(Segment::managed_wrote; the segment's submission settles each write it made).
The buffer keeps each such texture's entry (ManagedOvers). A texture released while its copy
back is owed leaves its image with the buffer until a reader takes it or the buffer is released;
a lookup by id skips a released entry, whose id a texture made since may hold. The Shared rules
(crate::over's per-submission copies) now apply only to textures over a buffer of no device copy
(copied_shared). The planner ruled that Managed keeps its device side; this is that side's copy
form.
Tests (device cfg): the Managed device test (100 uses copy in once; a modify over the range
copies once, one outside it not at all; a kernel's write owes one copy, a read none; a written
texture read through its buffer by a blit; a synchronize; two textures over one range; a
released texture whose buffer goes copies nothing back and frees its image; one released before
a kernel reads its buffer goes back first), and a kernel that declares a Managed buffer
read-write and never touches it owes no copy. README, Gap::TextureOverBuffer's doc and
docs/REFUSALS.md follow.
Verified: lint m3-max-44117 and device legs m3-max-44136 (780M HawkPoint, 3090), 44137 (RX 550),
44138 (XTX, 2080, 780M Phoenix, lavapipe), 85/85 each with the validation layer on, on the same
tree based on
|
||
|
|
f1c73d60bc |
A dispatch of a kernel that writes no memory records nothing
The translator states on a pipeline's interface whether some stage writes memory another invocation or a later command can read (PipelineInterface::writes_memory, the union of the stages' StageInterface::writes_memory: a store to a buffer or through a device address, a texture write or an atomic update, in the entry or any function it calls; the ExecutionStatus words are the product's and do not count). The cache's artifact format and semantics versions move with the new field. rt reads it into the compute state's interface. A dispatch of a kernel without it, direct or indirect, is checked as Metal checks it and then records nothing: no bind, no push, no vkCmdDispatch, and the indirect buffer is not kept or read. Metrics gains dispatches_without_effects, which counts them. Such a kernel has no effect a program can observe, so the only difference is less GPU and encode time than Metal's. Tests: the translator's a_compute_pipeline_states_whether_its_kernel_writes_memory (a kernel that returns at once, one that only reads, one that writes only its own thread's array: no; a store behind a branch, a noinline callee's store: yes, on the function and the linked pipeline, each validated), and rt's every_device_records_nothing_for_a_dispatch_of_a_kernel_without_effects (a direct, an indirect and an unbound dispatch of a kernel the interface says writes nothing leave the buffer unchanged and count three). |
||
|
|
3fd4b72b2c | replay: the report counts the recorded ranges a newer one met in part (parted), on both backends; the rt backend counts the compute pipeline IDs it cannot give as a typed gap (gap_pipeline_ids), summed on a gaps line | ||
|
|
ad33c4269f |
replay: the rt backend plays fences on compute and blit encoders (rt's Fence, 05ce4db691); a render encoder's fence calls stay skipped with it
|