f6032c796ca831fbc9847c1359c4300ef8a3bd4e
1735
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f6032c796c |
rt: a render encoder sets the alpha test reference, and alpha-test states are made
A gap against the old runtime. rt refused every render state whose fragment
runs the private alpha test (PrivateRenderState::alpha_test_enabled with a
compare function other than Never or Always): the translator pushes
PushField::AlphaTestReference there, and render.rs draws() mapped no value for
it, so new_render_pipeline_state answered Gap::RenderPipeline { DrawInput }.
Nothing drew against an unfilled push word; Never and Always states, which read
no reference, were made and drew right.
Now RenderCommandEncoder::set_alpha_test_reference_value(f32) (Apple's
setAlphaTestReferenceValue: SPI) keeps the reference's 8-bit unorm code in the
encoder's state, Metal's 1 until set, not kept across encoders (the old
runtime's rule, from probes on an Apple M3 Max, macOS 27.0.1); draws() maps the
field to FieldValue::AlphaTestReference, and a draw pushes the code. A change of
code refills the push bytes; an equal one records nothing new. The code is the
translator's: bind::alpha_test_code, now public (api_surface row, docs/API.md
line), so rt and the binder compare as Metal does through one function.
Test: tests::alpha_test draws green at alpha 0.6 (code 153) under Greater, one
quadrant a draw through scissor rectangles: the default reference and 0.75
keep the clear, 0.25 (held across draws) draws, and a second encoder starts at
1 again (its whole-target draw changes nothing) until 0 draws. README and the
API signature table updated.
Verified: build and device legs follow.
|
||
|
|
e74d7ab714 |
conformance: record visibility-disabled-reset and -accumulate on the M3
Metal's answers (an Apple M3 Max, macOS 27.0.1, job m3-max-51288, record and times in one job): every word stays as it was in both passes, the pass with no mode and the pass with Disabled at both words, under Reset (0xaa bytes) and under Accumulate ([100, 7]), as the lane table in cases/visibility.rs states. docs/CONFORMANCE-COVERAGE.md regenerated. |
||
|
|
42f9e9137f |
rt: a pass keeps its visibility result buffer; Disabled is the visibility mode built
The two tessellation streams' render passes set a visibility result buffer and enable no mode; rt skipped every such encoder (Unheld(visibilityResultBuffer)). On an Apple M3 Max (macOS 27.0.1, job m3-max-51220) a pass with the buffer and no mode leaves the buffer's bytes as they were under Reset and under Accumulate, so the planner's minimal form is exact and carries no note. - RenderPassDescriptor.visibility_result_buffer: checked for its device (Refusal::OtherDevice) and kept by the command buffer until it retires, as Metal's pass holds it. It declares no access and joins no hazard set: no command of the pass reaches it. - RenderCommandEncoder::set_visibility_result_mode: Disabled at any offset is a no-op; Boolean and Counting are Gap::Draw of the new DrawKind::VisibilityResults. - visibilityResultType is not a field: it decides only what an enabled mode writes. - Device test: the pass draws, the buffer's gauge holds after the test's handle is gone and falls once the command buffer retires, its bytes are unchanged, and the pass takes the submissions, barriers and passes of one without it. - Conformance: the rt side passes the buffer and the mode; new cases visibility-disabled-reset and visibility-disabled-accumulate (no mode in one pass, Disabled at both words in the next); recordings follow from the M3. - Player: setPass's visibilityResultBuffer goes into the new field (a skipped buffer still marks the pass unheld). - rt README, api_signatures and docs/REFUSALS.md regenerated. Verified: cargo fmt only so far; builds, clippy and device legs follow as potluck jobs. |
||
|
|
9c2288b3ae |
REPLAY-STREAM: the refills' bytes and GPU time among the surface counters
681a736c40 added surface_refill_bytes and surface_refill_gpu_nanos and the longest refill command buffer on the surfaces line; the doc's list of the counters now names them and says which frame a refill's GPU time falls in. Doc only. |
||
|
|
d95591c966 |
replay: the rt backend plays textures over a surface as views of one texture per receiver range and shape
The rt backend played newTextureWithDescriptor:iosurface:plane: as a substitute, an ordinary texture whose texels are undefined, so two textures over one surface shared nothing and the 3090 chain's rt plays varied where the old arm, which plays the texture over its receiver buffer, repeated. It now plays it as the product makes it: one Device::new_texture_for_views texture (an entry) per receiver range (receiver buffer, plane, offset, bytesPerRow) and shape (width, height, bytes a texel), with shader read and write, render-target and pixel-format-view usage, and every recorded surface texture a view of it at the texture's own index. The receiver buffer holds the pages' bytes as the stream writes them: - a new entry is filled from the buffer by a blit in a command buffer of the backend's own, committed at the making: after every earlier commit, with no wait; - a new shape over a range first downloads the range's newest entry into the buffer at that entry's extent, then fills the new entry, so bytes map by byte offset; an older shape's entry goes once no texture of it lives and is not kept current, and the calls that name such a texture after a newer shape are counted (surface_older_uses), argument buffers unseen; - a copy from the guest's RAM into a range also copies the range into its newest entry, and a copy back first copies the newest entry into the range, both in the copy's own blit encoder: replace_region would land ahead of the encoders already in the command buffer, and get_bytes would add a wait the old arm does not have; - a recorded CPU write into a range uploads the texels it covers (replace_region) until the buffer's first m2v.externalWriteDone, the new record of another API's write landing (a decoded picture), which refills every entry of its buffer by a blit committed then; the old backend plays that record as nothing; - another call naming a receiver buffer as a buffer is refused, and a texture of a format that reads across a surface's two planes is skipped (skipped_surfaces_across_planes). The player leaves a receiver buffer's checks and snapshot ranges uncompared on every runtime (verdict receiver, a receivers line), as the texels live apart from it; the rt backend reads a texture back for a check, laid out as the old backend lays it out. The surface substitute key goes; substitutes_read counts the tiled and gap substitutes (and their views) a call named, the substitutes line naming the first, and the doc's claim that a substitute makes a play no gate result, which no code made true, now says what holds. The surface record's keys move to args.rs, shared by both backends. Census before building (job 51225, gb-3090-r3): 653 entries made, none after an uncommitted guest-RAM copy into their buffer, so a fill committed at the making misses no copy there. Tests: the surfaces unit test (the texels a write reaches); the player's receiver test; the device test of two formats over one surface, a new extent, a copy from the guest's RAM and an older-extent use. To be run by the check job. |
||
|
|
a615269526 |
replay: the covered line counts the covers a binding took off, as a binding may be a read
The stream carries no buffer access, so a buffer binding (set...Buffer...) or a useHeap: of the object's heap counts as a write and takes a cover off. That errs toward comparing; a residual difference in such an object's later compares may be the covering texture's bytes, not the play's. The report's covered line now says how many covers a binding took off. Verified: the covers unit test gains a fourth round (covered again, then bound) asserting binding_uncovers 1 and the new line; to be run by its check job. |
||
|
|
0c00926c84 |
replay: the rt backend tallies the textures over buffers held in an image of their own by pixel format and usage
The known-gap line for the pool side's copy at commit wants the classes of the textures the device's linear image does not take, per card; the report gave only their count. The backend now keeps, for each texture over a buffer the runtime held in an image of its own (the gauge rose across the making), its descriptor's pixel format and usage, and prints them, most first, on a 'textures over buffers in an image of their own, by pixel format and usage' line. REPLAY-STREAM.md lists it. |
||
|
|
2385a0a489 |
replay: the rt backend counts the render encoders it skips by kind
The tessellation plays reported skipped_encoders=214 (and 205) with no kind, so whether a pass met NoAttachment, a storage gap or a property the runtime's descriptor does not hold could not be told from the report. The backend now keeps each skipped render encoder's kind with its count and first frame and call, and prints `skipped render encoders KIND N, the first at frame F, call C`: `ParallelRenderCommandEncoder`, `Unheld(KEYS)` for a pass whose descriptor sets properties the runtime's does not hold, or the runtime's gap for the pass (Debug). The skipped_encoders count is unchanged. REPLAY-STREAM.md lists the line. |
||
|
|
94d7c1620c |
replay: a heap texture write covers what it meets; the compares leave it out until written again
Metal leaves an aliased resource's contents undefined once another resource is written over its memory. In a placement heap, a texture write over a buffer's (or another texture's) recorded range leaves the recording holding its runtime's layout of the texels there, and the play its own (rt shares the memory as a placement heap does; the old arm makes the heap's buffers and textures apart and keeps the bytes from before). identity's liveness pass over u4 (to frame 315) found 16,942 covers of a heap buffer's range by a heap texture write and no read through a covered buffer before its next write or release: the bytes are dead, and a compare of them is no verdict. The player now tracks, by structure alone (covers.rs), each object the stream places in a placement heap (its heap, recorded offset, and length: a buffer's own, a texture's as the runtime answers its size, read ahead) and the texture writes: a draw's or dispatch's to the texture slots its pipeline state's interface marks written (Backend::texture_writes; the new runtime answers from ComputePipelineState / RenderPipelineState::texture_accesses, the old runtime answers no slot access, so on it only the following count), a render pass's to every texture its descriptor names, a blit's to its destination, generateMipmapsForTexture:, a useResource:usage: with write usage and replaceRegion:. A write of a texture over a buffer is the buffer's. A texture write covers the bytes of every other object placed in its heap that its range meets; the object is written again by the player's writes into it (m2v.write, contents at creation, copies from the guest's RAM, a snapshot's bytes before), a blit into it, and, as the stream carries no buffer access, any binding of it to an encoder, a write-usage useResource:usage: or a useHeap: of its heap. A check of a covered object reports `covered` and a snapshot range meeting covered bytes `covered`, neither compared; a `covered N: ...` line counts the covers and what they left out. REPLAY-STREAM.md says so, and says gap_pipeline_ids is bookkeeping: nothing is skipped for it. Test (replay::tests): a placement heap with a buffer and two textures at offset 0; a dispatch whose state writes slot 0, which holds the first texture, covers the buffer and the second texture; their checks are `covered`; the buffer written whole is compared again, the second texture stays covered; a dispatch of a state that only reads the slot covers nothing. |
||
|
|
c4b38afdb8 |
rt and translator: a buffer slot's pushed word is its address less 2^31, and an access adds its offset plus 2^31, zero-extended
Under the identity domains a buffer slot aligned to its argument was reached as its pushed address
plus the access's 32-bit byte offset sign-extended to 64 bits. The sign extension is what keeps an
offset below the bind address exact, but a device cannot split a sign-extended offset into a
scalar base and a vector offset as it does a zero-extended one. Now rt pushes the slot's address
less 2^31, and an access adds its offset plus 2^31 (modulo 2^32) to that word, zero-extended. That
is the same address for every offset in [-2^31, 2^31), which the 2 GiB buffer cap guarantees, in
one 32-bit add that a device fuses with the index's shift. A unit index x + c with a constant c
folds c into the bias: (x + c) * s + 2^31 = x * s + (c * s + 2^31) mod 2^32. The builder notes
each u32 sum of a value and a constant for that; the note changes no emitted word.
One place on each side:
- rt: pipeline::address_word, used by the compute and render push writers for every
BufferAddress field: a bound buffer, a setBytes copy, or the nil buffer.
- translator: lower::access::pointer.
- biased_slot_address feeds the direct reach.
- slot_address (the word plus 2^31) feeds every other reader: an access from the word below
it, a pointer compare, ptrtoint, the memmove overlap's Metal addresses, and pulled vertex
fetch.
- The bias applies only under the identity domains and only where the word is pushed: a
replay variant reads the true address from its root entry.
Unchanged:
- A texture's or sampler's resource ID and the parameter block's address are not biased.
- A pointer loaded from an argument buffer keeps today's form: the address the buffer holds.
- The default domains, which the old runtime and the golden tables use, take no new instruction:
the readers there load and bitcast the field in the same order as before.
Argument-buffer pointers left in their form (planner's condition):
- They are 19.6% of the corpus's device and constant accesses.
- Time-weighted, they are 0.8% of accesses on the 780M stream gb-780m-u4 and 2.4% on the RTX 3090
stream gb-3090-r5.
- Kernels with any such access take 1.9% and 8.4% of those streams' GPU time.
Slot pointers used as values, in the entry functions of the corpus's 11,580 kernels (census over
the local sources shards):
- 781 (6.7%) use one as a value: 14 convert one to an integer, 46 compare one, and 731 store one.
Every such store but one writes private memory (a pointer cell); the one other writes device
memory.
- 3,511 (30.3%) pass one to a non-inlined function.
- 33 pass one to an air.* call (command encoding, intersect).
A ptrtoint and a compare read slot_address. A pointer parked in a private cell or passed to a
function stays a fat pointer, whose accesses take the forms above. The one store to device memory
makes a wide pointer, which reads the root table, a field identity_admits does not admit. A new
engine test, a_slot_pointer_used_as_a_value_is_its_metal_address,
runs a kernel under the identity domains with biased pushes on the interpreter. It does a ptrtoint
to i64 and to i32, an address compare, and loads 4 bytes below a bind address and 20 above
another, and checks each against the true addresses.
Probe numbers (measured: one particle kernel run alone on RADV 26.2.6, us per dispatch, best of
forward and reverse; the module's two positions accesses changed by hand). Biased form against the
plain zero-extended offset (inexact below the bind address), at subgroup size 32 and at the
driver's 64:
- RX 7900 XTX: 33.6 vs 33.6, 30.8 vs 30.6; at 4x the grid 374.6 vs 374.0, 273.1 vs 272.9.
- PHOENIX 780M: 168.1 vs 168.3, 121.1 vs 120.5; at 4x 2521.9 vs 2522.8, 1744.6 vs 1752.8.
- HawkPoint 780M: 173.3 vs 173.2, 122.5 vs 122.7.
The sign-extended form it replaces measured, at 32:
- HawkPoint: 189.8 (same job), 9.5% slower.
- PHOENIX at 4x: 2735.3 (same job), 8.5% slower.
- XTX: 35.9 (another job), 6.8% slower.
The XOR form with a host-biased word (V7) measured 178.8 on HawkPoint: the add is the one that
fuses.
The tests:
- The identity engine tests push the biased word through engine_word_phases::slot_word.
- rt's three hand-made test kernels (ADD, STEP, WIDE) add 2^31 to each slot word. Their arrays
are regenerated from the doc GLSL with glslangValidator --target-env vulkan1.2 and checked with
spirv-val. Today's GLSL reproduced today's arrays exactly before the edit.
docs/API.md (sections 1 and 5), PushField::SlotGuestBase's doc and rt's README known gap on the
2 GiB cap state the word and the form.
SEMANTICS_VERSION 2186 -> 2188 and ARTIFACT_FORMAT_VERSION 544 -> 546. The identity nolockstep
lane holds 2187 and 545, unlanded; these take the next numbers so the two land separately.
|
||
|
|
f811bb4716 |
rt: a blit encoder releases an exported block to the other API, in its command buffer
The read direction of an export: another API (a video encoder) reads what a blit wrote into an exported block. BlitCommandEncoder::release_to_external(&buffer), which Metal has no counterpart of, records one buffer barrier into the encoder's command buffer after every earlier command: the whole block's release from rt's queue family to the acquire's other family (EXTERNAL for an opaque handle, FOREIGN_EXT for a dma-buf), src ALL_COMMANDS / MEMORY_WRITE. No submission of its own, nothing on the submit thread, no wait. It is a write use of the buffer for the encoder's ordering: textures over a buffer in the block copy back first, and since Vulkan ignores a release's second scope and only ALL_COMMANDS waits for it, the barrier after it is owed (Building::release_command, beside owe_pass; the flag owed_pass is now owed_all), paid by the next command or the command buffer's end barrier. Counted in Metrics::external_releases and Metrics::barriers. A buffer whose block is not exported is Refusal::NotExported (its doc and Display now name the release too). Release after release without an acquire is the spec's own case (7.7.6 NOTE: "It is valid to never call the acquire operation after a release, and instead simply start using the resource on any queue (even the releasing queue), but the contents should be reinitialized before being read"), so the next frame's blit needs no acquire. The README and the acquire's doc state the read direction's contract: the other API reads from the command buffer's completion; from the call until the consumer's next write through the runtime, the runtime reads nothing of the block and the consumer encodes no read of it. The export device test now releases through the call, twice in two command buffers with no acquire between (fill, release, fill, release), and the second device reads the second fill's bytes; a release of a buffer in a taken block is NotExported; external_releases grows by 2. REFUSALS.md and the API signature table regenerated; the replay's metrics name external_releases. Verified: build and device legs follow (job ids in the lane's report). |
||
|
|
0ecac16dd3 |
rt: a render state answers Metal's imageblock sample and memory lengths; one imageblock gap
The consumer asked for RenderPipelineState's imageblockSampleLength and
imageblockMemoryLengthForDimensions:. Metal's render answer is not 0 without an explicit
imageblock: it counts the color attachments' texels (measured on an M3 Max and an M4, and kept
by the translator as metal::format::imageblock_sample_length: [R8Unorm, R32Float] is 8). rt makes
no state whose fragment function reaches an imageblock (RenderPipelineKind::Imageblock), so a
state's sample is its colors alone, computed once per content from the descriptor's color
formats; the memory length is that times the width, the height and the raster sample count, none
rounded, as the old runtime answers it from the same measurements. A color format with no
measured place in Metal's record answers the gap.
The gap is one variant for both states: Gap::ImageblockMemoryLength { dimensions } becomes
Gap::ImageblockLength, which the compute state answers for a kernel that declares an imageblock
it never reaches (or whose compile kept no reflection to tell) and the render state for an
unmeasured color format. The compute state's imageblock_memory_length_for_dimensions answers u64,
as the render state's does.
Test: every_device_answers_a_state_s_metal_answers also makes a render state of R8Unorm and
R32Float colors: 8 bytes a sample, 512 for 8 by 8 pixels of one sample. README (render states;
the compute paragraph's gap name), api_signatures.tsv and REFUSALS.md regenerated.
Verified at this commit: cargo fmt only. The build and device legs run on the lane's tip.
|
||
|
|
c57b0436c8 |
rt: a compute state answers Metal's static threadgroup memory, execution width and imageblock length
The consumer counts each Metal answer rt holds but does not give. ComputePipelineState now
answers three more, each from its whole module's translation, kept per content (Answers):
- static_threadgroup_memory_length(): staticThreadgroupMemoryLength, the translator's
ComputePipelineMetalInfo::static_threadgroup_memory_length (rounded up to 16 as Metal reports
it); the threadgroup memory rt adds beside it is not counted.
- thread_execution_width(): threadExecutionWidth, the translator's thread_execution_width, 32 on
every device (the old runtime answers the same value from the translator): a kernel that
observes its SIMD group runs it 32 wide, and one that does not cannot tell its width.
- imageblock_memory_length_for_dimensions(dimensions): 0 for a kernel that declares no
imageblock. rt makes no state for a kernel that reaches an imageblock (the translator records
RuntimeFact::ImageblockSize on its first use, which the interface refuses as Gap::KernelInput),
but the translator plans only used parameters, so a kernel that declares an imageblock it never
reaches does get a state. For it, and where the compile kept no reflection to tell, the answer
is the new Gap::ImageblockMemoryLength { dimensions }: no authored case measures Metal's length.
Whether the kernel declares one is read once per content from the reflection its compile kept
(ComputePipelineDescriptor::reflection over StageSource::Compiled, decoding nothing).
Test: every_device_answers_a_state_s_metal_answers (device cfgs): the harness's block_scan
answers 1024 bytes of static threadgroup memory (256 words), sample_down 0; both 32 wide and an
imageblock length of 0. README (compute states), api_signatures.tsv and REFUSALS.md (26 -> 27
gaps) regenerated.
Verified at this commit: cargo fmt only. The build (clippy of rt under both device cfgs) and the
device legs run on the lane's tip.
|
||
|
|
8a8ce7f7cf |
Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development` while this branch was in flight, so the copy committed here counted a smaller one. Verified: regenerating at this tip leaves no change beyond the `Generated at` stamp. |
||
|
|
aaccee3ca8 |
conformance: copy-out-strides recorded on the M3 Max (macOS 27.0.1, m3-max-51024)
Metal's answer on all 14 sites is the stride model: each row at its offset plus the row index times the stride, the bytes between and after the rows 0xcd. docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py). |
||
|
|
18c52e7a8c |
rt: a heap's resources take one id in the hazard sets, the heap's
What: every buffer and texture placed in one heap takes the heap's id in the compute encoders' hazard sets, whatever its tracking mode and whatever bytes it reaches. A heap is the one at its offset in its block (`HeapRange`); `HeapIds` maps each to an id that lives while a resource of the heap does, the entries of gone heaps dropped once the map doubles (at least 64). Textures placed by `new_heap_texture` take it at once. Buffers take it through the new `Device::new_heap_buffer(heap, offset, length)`, `MTLHeap`'s `newBufferWithLength:options:offset:` (a buffer past the heap's end is `Refusal::HeapBufferPlace`); a buffer placed by `new_buffer` is no heap's and keeps its own id. Views take their parent's; a texture in place over a heap buffer takes the buffer's. Only the hazard sets read it: the copies over buffers and a pass's attachments keep naming resources by their own ids (`Accesses::each(interface, tracked)`). The player places a stream heap's buffers with `new_heap_buffer` and a stream block's with `new_buffer`; the conformance crate's heap buffers take `new_heap_buffer`. Why: Metal tracks a heap's resources as one, "tracking is done at the granularity of the heap" (MTLHeap.h, hazardTrackingMode), and the old runtime keys a heap buffer's and a heap texture's hazard identity by its heap (metal2vulkan-runtime heap.rs, tracker.rs). rt keyed them by resource, so inside one encoder, or after an encoder that only read, a write through one heap resource and a use of another over the same bytes got no barrier. Tests: `every_device_orders_a_heap_s_resources_as_one`: two heap buffers over the same bytes take a barrier between a write and a use and the second sees the first's words; two apart in one heap take one too; two heaps' none; a buffer past its heap's end is refused; 200 heaps that come and go leave at most 64 entries. docs/REFUSALS.md and the API signature table regenerated (two records added: the method and the refusal). Verified: cargo fmt; refusal_surface.py and signatures.py --bless. Build, clippy and the device suites on the check job named when the branch is handed over. |
||
|
|
e9c324a8f4 |
conformance: the decode cases' bound loosens metal2vulkan-rt's run alone; the old runtime's rows are as they were
The planner's ruling on the twelve old-side RADV rows |
||
|
|
608e084db1 |
rt: Block::external_writes_done, the acquire of another API's writes into an exported block
A decoder writes a frame into an exported block through its import of the handle; the
runtime's commands may read it only after the block's ownership comes back from the other
API's queue family. Vulkan's external memory requires that transfer whatever the sharing mode
(section 7.7.6, "Resources shared with external APIs or instances using external memory must
also explicitly manage ownership transfers between local and external queues").
Block::external_writes_done() records the acquire: one buffer barrier of the whole block, from
VK_QUEUE_FAMILY_EXTERNAL for an opaque handle (same device and driver) or from
VK_QUEUE_FAMILY_FOREIGN_EXT for a dma-buf (another driver), to the runtime's family, visible to
every later command. It goes in the upload, as zero_block_range's fill does: submitted ahead of
every command buffer committed after the call, holding the block until it completes, with no
wait for the GPU. The consumer calls it after its own wait on the decoder. A dma-buf names the
foreign family, which VUID-VkBufferMemoryBarrier2-srcQueueFamilyIndex-09099 allows only with
VK_EXT_queue_family_foreign enabled; new_exported_block already refuses a dma-buf export where
it is not (Limit::ExportType { listed: None }), so every exported dma-buf block can name it.
No release back to the other API is recorded. Section 7.7.6: "If an application does not need
the contents of a resource to remain valid when transferring from one queue family to another,
then the ownership transfer should be skipped." A decoder that overwrites the whole block needs
nothing the runtime left in it, so only the decoder-to-runtime direction is a transfer. The
contract, in the rt README beside the two calls: between external_writes_done and the other
API's next write of the whole block, the other API does not access the block, to read or to
write. The old runtime records the same acquire and no release.
Metrics::external_acquires counts the acquires (each also one of Metrics::barriers); the
replay report prints it. A block that is not exported is Refusal::NotExported. memory::Own's
Export carries the handle, which names the family.
docs/REFUSALS.md regenerated; api_signatures blessed.
Tests (src/tests/export.rs, device cfgs): after the second device has read rt's bytes, it fills
the whole block and releases it to the external family; external_writes_done is counted, and a
blit then reads the second device's bytes. An acquire of a taken block is refused typed.
Verified at this commit: cargo fmt only. The lane's build and device legs run on the tip that
carries it.
|
||
|
|
ea9b65a972 |
rt: Device::new_exported_block, one dedicated exportable allocation per block
The consumer's video path shares decode surfaces with a hardware decoder: the decoder imports
rt's memory and writes decoded frames into it. Metal has no counterpart, as it has none of
presenting.
The form is one on every device: an allocation of its own in the Private memory type,
dedicated to the one buffer that spans it (VkMemoryDedicatedAllocateInfo), exportable as the
handle the consumer names, never a range of a pooled allocation. Vulkan lets a driver require a
dedicated allocation for an export (VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT), so the
dedicated form is the one every driver takes, and what exportable memory costs each submission
falls on these allocations alone.
- ExportHandle: OpaqueFd (unix), DmaBuf (unix), OpaqueWin32 (Windows). A handle is offered
where the device lists its extensions and vkGetPhysicalDeviceExternalBufferProperties says its
buffers export it; elsewhere Limit::NoExport, before anything is allocated.
- A dma-buf's other side is another driver, which an ownership transfer names as
VK_QUEUE_FAMILY_FOREIGN_EXT; without VK_EXT_queue_family_foreign that family may not be named
(VUID-VkBufferMemoryBarrier2-srcQueueFamilyIndex-09099), so a dma-buf export there is
Limit::ExportType { listed: None }. A buffer whose memory requirements do not list the
Private type is Limit::ExportType { listed: Some(bits) }.
- Export carries the new handle (the consumer's to close), the allocation's size and its memory
type, which an import of an opaque handle names again
(VUID-VkMemoryAllocateInfo-allocationSize-01742, and the dedicated import of
VUID-VkMemoryDedicatedAllocateInfo-buffer-01879).
- The extensions stay out of the floor: VK_KHR_external_memory_win32 and
VK_EXT_queue_family_foreign join the optional list, enabled where listed.
- Gauges::exports counts exported blocks whose memory is not yet freed; the block-maker thread
frees them as it frees imports (memory::Own).
- No image is made in an exported block's memory, which is dedicated to its buffer
(VUID-vkBindImageMemory-memory-10926): a texture over a buffer in it takes the counted copy,
as over an import, and a heap texture in it is Gap::HeapTexture.
docs/REFUSALS.md regenerated; api_signatures blessed; the rt README has the call, its
extensions and its known gap.
Tests (src/tests/export.rs, device cfgs): every offered handle exports, is written by rt,
released by the test's own barrier and read back through a second device's import of the
handle, with the gauge back after the free; every other handle is refused typed; an exported
block holds no image; and the submit cost with 64 live exports against none, printed.
Verified at this commit: cargo fmt only. The lane's build (clippy plain and under both device
cfgs, Rustdoc, signatures, refusals) and device legs run on the tip that carries it.
|
||
|
|
f1aa961e34 |
conformance: RADV's BC1 to BC3 sRGB rows on the old runtime hold the case's unjustified bound too
The old runtime holds DriverFact::ColorBlockDecodeIsMetals for the RX 7900 XTX and the Radeon 780M, so it announces no compressed-texel-decode there, and the decode cases' bound, justified by that notice alone, justifies nothing: each of the twelve sRGB sites now differs twice, as the device's sRGB decode (the row already listed) and as the case's loosening that nothing justified. m3-max-50924's old-side XTX leg named the twelve; each gets its row beside the site's. rt notes every block-compressed texture, so it announces the notice there and the sites are announced (the same leg's rt side). docs/CONFORMANCE-COVERAGE.md regenerated. |
||
|
|
260163301f |
conformance: the fresh-texture test counts the decode notice; the catalogue's cost stays the old runtime's words
m3-max-50899's suites named three things of ee0827889e. fresh_contents' a_row_loosens_the_notices_site_and_a_private_texture_s_fresh_site counted a texture row's allowances without the compressed-texel-decode declaration its block-compressed rows now make: it counts it, and holds that only those rows make it. The old runtime's catalogue test holds an entry's Cost to the words the kind announces, before whatever more it says: the measured bounds go after the announced cost (the RTX 2080's, and ANV's and the UHD 630's BC3 alpha 2/255 and BC4/BC5 1.4/255, signed 0.0134, each BC4/BC5 texel within 0.0001 of the specification's exact decode), and the cost is the old runtime's again. docs/CONFORMANCE-COVERAGE.md regenerated: 89 ledger rows fewer. Verified: the bcref decode of the per-element dumps (the 2080, the Iris Xe and the UHD 630). Expected: the suites green on msi with this commit. |
||
|
|
3a6eac60d5 |
conformance: the decode cases' bound takes float rounding; fills and fresh textures declare the decode note; stale BC rows go
The whole-set replays of c83f9b0db1 on lavapipe named three things. texture-fills-130, -134 and -152 and the fresh-texture-bc1-rgba rows make block-compressed textures, which rt now notes as CompressedTexelDecode, and declared no such notice: both families now declare it at the notices site (texture_fills.rs among the native notes it already declares; fresh_contents.rs where the row's format is block-compressed). Neither loosens a value. The old runtime announces compressed-texel-decode on lavapipe for BC1 to BC5, so with the cases' bound justified by that notice its 40 llvmpipe rows (256 bits) no longer diverge, and the replay said so. Those rows go, with the 128-bit lavapipe rows and the RTX 5080 Laptop rows (whose recorded largest differences all lie inside the family bounds) and RADV's BC4 and BC5 rows (RADV holds no ChannelBlockDecodeIsMetals, so the old runtime announces there). RADV's BC1 to BC3 sRGB rows stay: RADV holds ColorBlockDecodeIsMetals, so the old runtime announces nothing there. Each texel is a float, rounded by up to half an ulp of a value below 1, so two codes exactly a bound apart can read a few billionths past it (6/255 between 128/255 and 134/255 in float is 6/255 + 3e-8): the bound takes f32::EPSILON / 2 on top. The RTX 2080's BC3 reached 0.023529410362, 1.4e-9 inside 6/255, by that luck alone. docs/API.md: the catalogue's measured bounds, from the per-element dumps on the RTX 2080 (620.70.06), the Iris Xe (ANV) and the UHD 630 (Intel's Windows driver): ANV and the UHD 630 reach BC3's alpha 2/255 and BC4/BC5 1.4/255 (signed 0.0134), past the 1/255 and 1.3/255 (0.013) it stated; the 2080's BC1 to BC3 3/255 and BC3's alpha 6/255. |
||
|
|
ae452ee883 |
rt: a block-compressed texture carries the static note of its decode, CompressedTexelDecode
A read, sample or gather of a BC texel on metal2vulkan-rt is the device's decode of the texture's own blocks, where Metal interpolates a block's endpoints with 6-bit weights. rt carried no note of it, so the ten BC1 to BC5 decode cases read divergent on every Linux venue with no notice behind them. The old runtime announces the same difference as compressed-texel-decode, gated by driver facts; rt decides by the format class alone, on every device, RADV included. - PrecisionNote::CompressedTexelDecode in the translator's public enum (codec, and ARTIFACT_FORMAT_VERSION 544; fast_paths' "elsewhere" list; validation allows it unbounded). No pipeline stage records it, so no translation changes. - Texture::precision_note: Some(CompressedTexelDecode) for a texture or view whose own pixel format has a block extent (metal::format::block_extent: BC1 to BC7, ASTC, ETC2, EAC, PVRTC; rt makes the last four only where the device holds the format), None otherwise, as DepthStencilState::precision_note is shaped. Device test: a BC1, BC7, ETC2 and ASTC 4x4 texture (where the device makes it) and its sRGB view carry the note; RGBA8Unorm and its sRGB view carry none. - The old runtime's Degradation::from_precision_note maps the note to its existing compressed-texel-decode kind (one arm, which the exhaustive match requires). - The conformance rt side announces the note of every texture it makes (one keep_texture helper, makes_texture, and the work runner's made resources). - compressed-texel-decode leaves the suite's native notes: its catalogue entry states bounds, and a native note loosens nothing. The ten BC decode cases declare it and loosen each round's texels by the catalogue's largest bound for the family on any driver (BC1/BC2 4/255, BC3 6/255, BC4/BC5 7.4/255, signed 0.065; an sRGB form the sRGB decode's largest step over 4/255). The other families that make a compressed texture declare it at the notices site alone: the BC moves and views, ASTC, ETC2/EAC, the read-write tier tables and the usage table of the descriptor pairs. - docs/API.md's catalogue entry covers both runtimes; rt's README states the note; api_signatures and CONFORMANCE-COVERAGE regenerated. |
||
|
|
c9637b0d08 |
replay: a descriptor-form no-copy buffer is a pool buffer; only the bytes form imports
The planner ruled the mapping: the player plays every descriptor-form no-copy buffer (newBufferWithDescriptor: with noCopy) as a pool buffer, a buffer of a recorded block where its recorded range lies in one and a place of its own elsewhere, and imports only the bytes form (newBufferWithBytesNoCopy:length:options:deallocator:, the host's own in the recordings). The recordings do not tell the program's own no-copy memory (an import in the product) from the host's pool buffers, so that memory plays as a pool buffer too: a known gap. The host's recorder makes a buffer over the program's memory only with a pinnedGpuAddress and no zeroFrom (zeroFrom and unpinned buffers are always the host's own), so the report's gap line bounds the gap by those outside every block, with their bytes. REPLAY-STREAM.md states the mapping and the gap. The test plays three descriptor-form buffers outside every block (one pinned with no zeroFrom, one unpinned, one pinned with zeroFrom), a texture over the first read through a blit, and checks the counts line, the gap line's bound of 1, and that the imported side counts only the bytes-form buffer's texture copy. |
||
|
|
2fe8ac55c1 |
matrix: a host-time row past its limit by less than old's own move is VOID for the round
The frozen arm's second rule, beside FROZEN_DRIFT (the planner's ruling of 2026-11-19, reading
(a)): a row judged by its host time, and not by re-timed pairs, whose excess over its limit
(ratio over limit, less 1) is smaller than its own old time's move from the base in the round
is VOID, since the old runtime's drift alone could carry it there. GPU-time rows and rows judged
by their re-timed pairs are never voided by it. Neither rule makes a row red; the paired re-time
judges a red row.
harness_budget parks such a row as VOID with its excess and the move; the report's table reads
VOID for it (over_lines, through excess_voids); each leg's lines name the rows each rule voided
(print_leg). docs/VALIDATION.md states the rule.
The venue-wide reading was withdrawn: the frozen arm's largest moves sit on cold creation rows
(create_4KiB/device_first +88% on one leg of
|
||
|
|
c8e65bd9cb | REPLAY-STREAM.md: the report's textures over buffers line | ||
|
|
01d40ad5fc |
replay: a descriptor-form no-copy buffer inside a recorded block is a buffer of it; others import
The product's no-copy buffers are not all imports. A newBufferWithDescriptor: with noCopy whose recorded address and length lie inside a live block's recorded range (m2v.newBlockWithLength: storageMode:) is the program's buffer in that block's storage, a pool buffer on rt; it now plays as a buffer of that block at that offset, as m2v.newBufferInBlock:offset:length:options: does (the in-block buffer path is one method both use), its bytes at its making put there first. Only a descriptor-form one outside every block (the program's own no-copy memory) and the bytes form (the host's own buffers in the recordings, never the program's) go through the import. The backend keeps each live block's recorded range (imports::NoCopies) and counts the three kinds; the report's no-copy buffers line replaces the no-copy imports line. REPLAY-STREAM.md says which plays how. The no-copy device test adds a block recorded at an address and a descriptor-form buffer recorded inside it: it reads the bytes written into the block there, and the line counts it in the block, beside one descriptor-form and one bytes-form import. Verified so far: nothing; the build and tests run in the check job. |
||
|
|
4521865fe5 |
rt: a stored slot bound to a texture with no storage element is Gap::StorageElement
A draw or dispatch whose function writes a texture slot, or reads one through
its storage image (access::read_write), bound to a texture made for shader
writes that has no storage element, dropped the writes and read zeros. Such a
texture is one whose format the device does not store through a storage image
without a format (the 8-bit sRGB formats, RGB9E5Float or BGR10A2Unorm where the
device lacks their storage), or holds through a view of another (A8Unorm in
red, the extended-range formats).
That draw or dispatch is now refused with Gap::StorageElement { slot,
pixel_format }, found where the swizzled read_write gap is found: at the
dispatch's bind check and at the draw's Facts::find. Which slots count is the
bound function's own access (a write, or a storage read), not the texture's
ShaderWrite usage bit. A texture made without ShaderWrite (and not of Metal's
unknown usage) is outside documented Metal when written, and is not refused.
A texture an argument buffer reaches by its resource ID is not seen at the
bind; its writes stay dropped, recorded in the runtime README's known gaps.
The refusal stands until the alias storage element lands: a view of the
nearest format whose storage Vulkan requires of every device, with the
translator's conversion.
docs/REFUSALS.md regenerated; api_signatures gains the variant.
Test: storage_element::every_device_refuses_a_stored_slot_bound_to_a_texture_
with_no_storage_element binds a 2x2 RGBA8Unorm_sRGB texture to a write slot
and a read_write slot, and expects the gap exactly where the device's optimal
tiling lacks STORAGE_IMAGE with STORAGE_WRITE_WITHOUT_FORMAT, a dispatch
elsewhere, and a read slot dispatching everywhere.
|
||
|
|
5250b8dd7b |
rt: the over-copies over imported blocks are counted on their own side
Metrics::over_copies_imported and Metrics::over_copy_bytes_imported count the copies between a texture over a buffer and its image of its own where the bytes shaders reach are in an imported block (host memory or a dma-buf), beside over_copies and over_copy_bytes, which still count every such copy; the rest are over the runtime's own blocks, where the device's linear image does not take the texture. One mechanism: OverCopy carries whether its buffer's bytes are imported, and Counters::over_copied adds the imported side where it is. A first-boot report can then read the imports' copies alone, and a play the pool buffers' copies (total less imported). The api_signatures rows, the doc lines (Metrics, over.rs, the README) and the player's per-frame counters carry the two. Tests: copy_over's device test asserts its texture over a buffer in a taken block moves neither imported counter; the import test asserts every copy of its texture over an imported block counts on the imported side, its texels' bytes each; the player's no-copy device test asserts its one copy is imported. Verified so far: signatures.py --check; the build and tests run in the check job. |
||
|
|
324cfb72cf |
replay: the new runtime's player imports no-copy buffers' memory; rt counts over-copy bytes
Both no-copy creators (newBufferWithBytesNoCopy:length:options:deallocator:, and newBufferWithDescriptor: with noCopy) now make their buffers over zeroed host pages of the player's own, each imported as a block of its own through rt's import_host_memory, as the product imports the program's pages; the import's release frees the pages once the runtime has freed the import. A texture over such a buffer is then the runtime's counted copy, so a play's frames count those copies. A device without host-memory import refuses a no-copy buffer by name. Two-copy forms keep their second copy: the import holds the CPU's copy where the runtime keeps a GPU copy, and the copy shaders reach where the player keeps the second copy itself. Release and command-buffer use tracking now cover a buffer with no place of its own but a device copy or an aside. rt gains one deterministic metric, Metrics::over_copy_bytes: the bytes of the copies between a texture over a buffer and its image of its own, still counted in bytes_copied (Counters::over_copied adds all three; the now unused Metric::OverCopies is gone). The player's per-frame counters carry it, its drop gauges and live gauges carry rt's imports gauge, and its report gains a no-copy imports line. Tests: rt's copy_over device test checks each copy adds the texture's bytes to both byte metrics; a new rt_replay device test plays both creators, a texture over the first, a blit of the texture checked against the stream's bytes, one over-copy of 64 bytes, the imports line and the imports gauge at zero at device drop. Verified so far: signatures.py --check passes; the build and tests run in the check job. |
||
|
|
4a393990fa |
rt: a presenting command buffer is scheduled once its submission passed vkQueueSubmit2
What: the planner's change to the presenting design, and its additions. - Scheduled means, for a command buffer that presents a drawable, that its submission has passed vkQueueSubmit2: the submit thread no longer schedules it as its last segment joins the group (the group goes at once anyway), but in submit(), between queue_submit2 and core.done.submitted, which is where the completion thread first learns of the batch (complete.rs, Done::submitted). Its status, kernel times, scheduled handlers and wait_until_scheduled all follow the call, with no window and no wait across threads, and its scheduled handlers still run before its completed handlers. A failed submission schedules nothing: its handlers run as it retires, as an ended command buffer's do. The split wait (CbState::signal_unsubmitted) is gone. - A present from the command buffer's own scheduled handler is valid now; the docs still say to present from the consumer's thread, as the handler runs on the submit thread. - Several drawables in one command buffer each signal their own semaphore; the same semaphore twice is Refusal::DrawableSemaphoreRepeated (new), the same drawable twice Refusal::DrawableNotAcquired. - The Safety texts of the three unsafe calls name the Vulkan rules the runtime cannot check (the image is that swapchain's; `ready` unsignalled with no signal or wait pending; the swapchain not destroyed while in use). - The README's "Destroying a swapchain": which completions and drops come first (VUID-vkDestroySwapchainKHR-swapchain-01282); views may outlive the image, as Vulkan's object lifetime rules let a child of the device outlive the image it views. Tests: the render test's second frame presents from the scheduled handler, the first and third from the test's thread beside a handler that sleeps 100 ms; both drawables' teardowns follow the guide, destroying the stand-in image before the views go; a new test presents two drawables from one command buffer and checks the two refusals. Not yet run: potluck jobs next. |
||
|
|
e5157492d7 |
rt: drawables' textures over a swapchain's images, their acquire, and a present that signals the consumer's semaphore
What: the two presenting pieces the new runtime lacked, so a consumer can present on the runtime's own device. - Device::new_drawable_texture (unsafe): a texture over an image of the consumer's swapchain, checked against the swapchain's create info (2D, one level, its extent and one layer; the format the runtime holds the pixel format in; usage holding the texture's, transfer included). Its home layout, views, set 1 elements and hazards come from the existing plan (form()). The image is never destroyed by the runtime: Backing::Drawable, and the reaper frees only the views. - Texture::drawable_acquired (unsafe): re-arms the existing homing, so the upload of the next submission moves the image home ahead of every later commit; from UNDEFINED the first time and from PRESENT_SRC_KHR after a present (texels kept). - CommandBuffer::present_drawable (unsafe): at commit the last segment's end barrier also moves the image home -> PRESENT_SRC_KHR, and that segment's submit info signals the consumer's binary semaphore beside the progress semaphore; the group goes at once, as an event signal's does. - wait_until_scheduled of a presenting command buffer returns once its submission passed vkQueueSubmit2: rt marks a command buffer Scheduled, and runs its scheduled handlers, before the submit, so a present made after the wait could otherwise wait on an unsubmitted binary signal (VUID-vkQueuePresentKHR-pWaitSemaphores-03268), on the shared and on the reserved present queue. - Refusals with their basis: DrawableDescriptor, DrawableFormat, DrawableUsage, NotDrawable, DrawableAcquired, DrawableNotAcquired. docs/REFUSALS.md regenerated, api_signatures blessed (9 records added, none removed or changed). The README's presenting section replaces the "not built yet" lines, with its known gaps (no acquire semaphore; no present from the presenting command buffer's own scheduled handler; a presenting command buffer that never runs leaves the image acquired). Tests (src/tests/present.rs, device cfgs, validation layer): an image made as a swapchain's stands in for one; three frames of acquire, pass, present and a stand-in present that waits on the semaphore on the presenting queue and copies the image out of PRESENT_SRC_KHR, for a render-target and a shader-read drawable; the presenting command buffer's sleeping scheduled handler must have returned before wait_until_scheduled does; each refusal. Not yet run: built and run in potluck jobs next. |
||
|
|
7cda47f536 |
matrix: an owned row fails only 3% past its owned ratio; a one-pass outlier is timed again
An open record in status.tsv now names the ratio its row was owned at (the new `owned` column,
filled for the existing entries from the matrix note of
|
||
|
|
2db8331d56 |
command-replay: the new runtime's gauges at device drop go out as the matrix's lines
After the play, the new runtime's backend ends its device (NewRuntime::end) and now hands back what it read once the device dropped (Ended: every rt::Gauges field by name, threads as the slots still held, whether all read zero, whether it quiesced). command-replay writes one line per gauge into the report, "M2V-MATRIX gauge replay-rt/device/GAUGE@drop N", the matrix's own record form (scripts/matrix/results.py's RECORD pattern; its rule fails a gauge not 0 at @drop), so any play job's output can be checked by that rule. The teardown error now names only the gauges not at zero. The old runtime's counts end with its device, so its plays print none. Tests: a unit test of the lines' form and the error's naming; the rt device test of a play that ends with a command buffer held asserts every line is "M2V-MATRIX gauge KEY@drop 0". The stream guide's report section says so. Checked by the lane's check job (named in the report to main). |
||
|
|
feec58e2f5 |
rt: a texture over a buffer in an imported block is the counted copy, on every device
replay's census C: the window server (b3) makes 425 textures over its no-copy buffers, and every no-copy buffer is now an import, so refusing them (Gap::TextureOverBuffer in d335594515) would refuse the window server's textures. They take rt's existing copy form instead: an image of its own, which the device copies the buffer's bytes into before the submissions that use it and back after a command writes it, counted in Metrics::over_copies. The buffer stays the import itself. The runtime makes no image in imported memory. Such an image would be made for the import's handle (VUID-vkBindImageMemory-memory-02728), so in the undefined layout (VUID-VkImageCreateInfo-pNext-01443). An acquire from VK_QUEUE_FAMILY_FOREIGN_EXT is not used: it needs a matching release (7.7.6), which host writes do not make (host memory imported by its address is shared with the host as host access), and it leaves an aliasing resource's contents undefined (7.7.6). Whether an in-place form exists stays open with the planner until the copy's cost is measured. - check_over answers the copy for a buffer in an imported block; Gap::TextureOverBuffer's doc goes back to its old cases; new_texture's doc and the README say how such a texture is made, and the README records it as a known gap. - Tests: the import device tests run on every platform (host memory from std::alloc; the shared-file mapping test unix-only), so the Windows UHD leg runs them. A texture over imported host memory is copied on every device, reads the host's own bytes, its writes reach the host, and both copies count in over_copies. - REFUSALS regenerated for the import limits (the rebase took development's at d335594515). Verified: nothing yet; the check job and the device legs follow. |
||
|
|
bc6dc40a14 |
player: the old runtime plays a recorded heap as its buffers and its textures apart
On the old runtime's player, a heap with a recorded range is now made by what the stream places in it (read ahead), whatever its type: - its buffers go in a heap at the recorded address and of the recorded size, each at its recorded offset, never laid out again (a pinned span never grows); - its textures go in a heap outside the pinned space, laid out for the runtime's sizes as the texture-only rule did. It is one heap, so textures placed at one offset still share. Buffer-only = the pinned heap alone, texture-only (or nothing placed) = the outside heap alone, mixed = both. Backend::holds_no_buffer becomes Backend::split_heap(heap, HeapSplit); the old backend holds a split heap as Object::Heap(buffers' heap, textures' heap), and useHeap: uses both. A buffer the runtime refuses at its recorded offset in its heap now stops the play typed (PlayError::Unpinned with the runtime's reason) instead of as a Runtime error. Why: u4's old arm stopped at f1033 on mixed heap #188906 (4 MiB placement, 2600 buffers and 1000 textures over its life): the relayout grew it for the runtime's texture sizes, and the pinned heap's grown span met #188909, recorded 0x8968 bytes past the heap's Metal span. u2 and u3 carry the same heap twice each, u4 again at f1059. The report line becomes "pinned N of N; K heaps' textures outside; S textures whose recorded range (by the runtime's texture sizes) met a live buffer's". S comes from the read-ahead: a texture's range is the heap's recorded address plus its offset for the runtime's size answer (the stream holds no texture size), a buffer's its recorded range; reported, not a stop. The heap code moves to replay/heaps.rs (relay, placement helpers, HeapSplit, Overlaps). Safe by census (jobs 50282-50286, every stream on five nodes, 29 names): every heap is a placement heap; no call takes a heap as receiver except the placements, none names a heap as an argument, and no heap or size getter is recorded; the only calls on heap resources are m2v.privateBytes on heap buffers and texture views of heap textures, neither compared. The automatic-heap half rests on its unit test, as REPLAY-STREAM.md now says. Tests: unit tests for the three shapes (textures alone, buffers alone with an alignment that would move them, mixed with a larger texture and a met buffer) and for automatic heaps; a lavapipe device test of a mixed heap whose texture the runtime makes larger, with a buffer pinned right past the heap's recorded span that keeps its address. The negative control (no split told, the whole heap relaid) must fail them; the check job and its inner codes are named in the report to main. |
||
|
|
b28b4975b5 |
matrix: the GPU legs run the replay player's stream device tests; status rows lose closed owners
The GPU legs' archive held metal2vulkan-rt alone, so the replay player's stream device tests (metal2vulkan-validation's runtime_lane::replay_streams, 17 on the old runtime, and runtime_lane::rt_replay, 24 on the new) ran on lavapipe only. A break in the player or a runtime's stream path that only a GPU shows waited for a lane's play of a recorded stream to find it, as the old arm's pin stop did. The archive now holds the validation crate too, and a leg runs the runtime's tests and those two modules (DEVICE_TEST_FILTER). The Windows leg is unchanged until the validation crate is shown to build there. status.tsv, by the planner's ruling of 2026-11-18: - 10de:1e87 frame_5cb is a gap row: the runtime guide's known gaps carry it (crates/metal2vulkan-rt/README.md, NVIDIA's latency per submission). - 8086:a7a0 frame_5cb and 10de:2204 create_state/first are within their limits; their closed lanes' names are cleared (a row gets an owner when it goes over). - identity's rows wait for their card's native table, the guest-visible test; "Iris swing unresolved" was stale. Verified: see the check job named in the landing message (unit tests of the matrix script, the archive built with both packages under --cfg m2v_gpu, the filter's selection listed, and the selected tests run on a GPU). |
||
|
|
1ee16e6a0f |
command-replay: every report line, the frame lines among them, goes to the standard error too
identity's scripts lost 50152's record when they deleted the job's temporary directory, where report.txt lay. The planner ruled that the player prints each report line and each frame-end line to stderr as well as to report.txt, so no script can lose them. ReportFile, the one writer of report.txt, now implements Write. Each write goes to the file and then to stderr, and the player's frame lines go through it (with_frame_lines takes the report rather than its file). A failed stderr write never fails the file's. REPLAY-STREAM.md section 10 and the binary's docs say where the lines go. Test: the range test's helper runs command-replay and asserts that its stderr carries every report.txt line, in order. All its plays stop before a device opens, so no device is needed. |
||
|
|
331ff7bcba |
player: the old runtime makes a heap the stream places no buffer in outside the pinned space
glbench-3090-r4's old arm stopped at f198: buffer #22759, pinned at 0x4020086d8000 (32 KiB past heap #22754's recorded end), met the span the old runtime held for #22754. #22754 is a placement heap that holds six RGBA16Float textures and no buffer. The player lays placement heaps out again for the runtime's texture sizes, and grew it from 2 MiB to about 2.5 MiB; pinned at its recorded address, the grown heap held #22759's pages. In Metal the two never meet. The rule (the planner's): on the old arm a heap is pinned only where the stream places a buffer in it. A texture has no address and a heap answers none, so no address the program holds lies in a heap without buffers, and pinning it buys nothing. The read-ahead finds those heaps from the stream alone, never from the runtime's size answers or what the space holds, so the old arm's address layout is the same on every card. The player tells the backend before the making (Backend::holds_no_buffer). The old backend makes the heap outside the space, and the address map keeps its recorded range at its recorded address, so the address census is unchanged. A heap that holds a buffer keeps its recorded address and the typed stop where its grown span meets another pin. The report's pinned line now says "pinned N of N; K heaps without buffers outside: ...". REPLAY-STREAM.md sections 5, 9 and 10 say so. Tests: - a_heap_without_buffers_is_made_outside_the_recorded_addresses (player, no device). The test backend pins. A texture-only heap is told and made outside; a heap with a buffer, and its buffer, are made at their recorded addresses. A word into the outside heap's range is still counted, and no word moves. - a_heap_without_buffers_leaves_the_next_pin_its_address (old runtime, device). A 64-KiB pinned heap holds only a 256-KiB texture, and a buffer is pinned at the first granule past the heap's recorded span. Without the fix the grown heap's span holds the buffer's and the play stops. |
||
|
|
a3ff94f510 |
replay: the escape note (m2v.bufferEscaped) and a stop on a written word into a noted buffer
The recorder will note a buffer whose address may escape into the program's memory: once in the
buffer's life, at the first gpuAddress read (kind 0), argument-encoder write (1), gpuResourceID
read of a texture over it (2) or residency-set add (3); the whole buffer escapes. No stream
carries the note yet.
The player now reads m2v.bufferEscaped: the receiver must be a made object and the one argument
a kind from 0 to 3, else the stream is invalid. Once a buffer's note is read, a written word that
looks like an address (the census's aligned words) whose value lies in that buffer's recorded
range stops the play with PlayError::NotedWord {target, offset, value, buffer, kind}. Moving such
a word is not built: no stream exercises it, and the move gets built with the first stream that
does. AddressMap::noted_word finds the word at any nesting level. The lookup runs only once a
note was read, so a stream without notes pays nothing for it.
The report counts the notes (Report::escape_notes); the addresses line ends "the stream predates
the escape note" where there are none, "escape notes N" otherwise.
Test (unit, a synthetic stream): a note, then a write of a word into the noted buffer stops,
naming the word; the same kind of word into a buffer with no note played as written before it;
a kind past 3 and a note of an unmade object are invalid streams. docs/REPLAY-STREAM.md section 5
holds the record and the stop, section 10 the line.
Verification: the replay checks run as a potluck job on this commit.
|
||
|
|
d2834389c7 |
replay: written words play as recorded on both runtimes; a census counts the address-looking ones
The player rewrote every 8-byte word of written bytes whose value lay in a live recorded range. On a stream recorded before the escape note a word's value cannot tell an address from data, and on u4 that rewrote two 32-bit indices of an index array into an address of the play, which a kernel later read through out of bounds (the rewrite-off control played u4 whole with no fault). Now no written word moves on its value, on either runtime: - The address map's word pass is a census that writes nothing (AddressMap::census). It counts address_looking_words (aligned 8-byte words in a live range) and misaligned_address_words in the same bytes as before: writes, copied contents, guest-RAM copies and Private bytes before a dispatch into objects that answered a gpuAddress, and set*Bytes data. Both are stream-fixed, equal on both runtimes. - What moves are typed address arguments (tag 8), through the map: relocated_words now counts only those that moved, so it is zero on the old runtime, whose ranges are at their recorded addresses. - unrelocated_writes is deleted: no written word is relocated anywhere, so it meant nothing. - A Private range's bytes after a dispatch are compared as recorded. - The report's relocation line becomes "addresses address_looking_words=N misaligned_address_words=N address_arguments=N relocated_words=N differing_ids=N: written words play as recorded; the stream predates the escape note". Tests: - unit: written words play as recorded and are counted; a typed address argument moves with its object (and one in no range stays); guest-RAM copies and copied contents play as recorded; the census counts by alignment. - device, rt: a data word in a live range plays as written (sha check); the census is the same on the old and new runtimes (and the old pinned both objects). - The rt granule test read the runtime's addresses through relocated words; it now checks the places line's slack (each place spans its length rounded up to its recorded granule). docs/REPLAY-STREAM.md sections 5 and 10 and docs/VALIDATION.md say the new form. The escape note (m2v.bufferEscaped) and the stop on a word into a noted buffer follow in their own commit. Verification: the replay checks (clippy in three configurations, replay unit tests, the replay device tests on lavapipe, rustdoc) run as a potluck job on this commit. |
||
|
|
43ef0ce7de |
conformance: tessellation-rendered-patches, triangle patches drawn into a target
The suite's tessellation cases read the tessellator's domain points with rasterization off; none renders a patch. This case draws the owned fixture tess_rendered_patches (a triangle patch of three control points fetched per patch control point, a colour fetched per patch and passed flat) into an 8 by 8 RGBA8Unorm target under a recorded stream's patch-draw state (fractionalOdd up to 64, factors per patch, counter-clockwise), with the factors 8 bytes into their buffer. Two passes: `drawn` draws patches 0 and 1 (patch 1's zero edge factor culls it), then patch 3 alone from patch start 3; `back-culled` culls back faces and draws all four, where patch 3 is patch 2 mirrored. Every texel is 0 or 255 per channel and no slanted edge meets a texel centre, so the answer is exact whatever the tessellator's inner points. Recorded on the M3 Max (macOS 27.0.1) in job m3-max-49694, with its times; a test holds the recorded texels to the module's description of Metal's answer. The case lands without a cost record: a cost record is a whole-set measurement, and `cost --alone` folds into one that does not exist yet. docs/CONFORMANCE-COVERAGE.md regenerated. |
||
|
|
16f750a424 |
replay: the old runtime's player makes every recorded range at its recorded address
The player's old backend made each object where the runtime had room and relocated every 8-byte word that lay in a live recorded range. A data word whose value happened to lie in one (two 32-bit indices in a pixel-sized index array) was rewritten into an address of the play, and a later kernel read through it out of bounds. Now the old backend makes every object that answered a gpuAddress at that address (AddressPlacement::At): device buffers of every making form, blocks and heaps, the descriptor's pinnedGpuAddress aside, so heaps take their answer too. Every other object, and the player's own staging, readback and host buffers, go Outside ([2^47, 2^48), past every span a pin can take). A refused pin, or an object made at another address than it recorded, stops the play with PlayError::Unpinned naming the object; no other placement is tried. The address map still runs, with each range's base its recorded address, so it moves no word, every address argument plays as recorded, and relocated_words and the other stream-fixed counts stay equal across runtimes. The report adds "pinned N of N". The new runtime's backend is unchanged (Backend::places_at_recorded defaults to false). Tests (device, old runtime): the pointer-chain test now also asserts its four objects pinned; a data word in a live range plays as written; a pin inside another's span stops typed. docs/REPLAY-STREAM.md sections 5 and 10 describe the form and the report line. Verification: the replay checks (clippy in both cfgs, the replay unit tests, the replay device tests on lavapipe, rustdoc) run as a potluck job on this commit. |
||
|
|
2e1b543f1b |
rt: patch draw device tests; the address form reads no word past the factors; the player gives the recorded tessellation state (work in progress)
The address form read one word past a patch's factors where they start at a multiple of 4; it now reads the first word again there, so every word it reads holds a factor's byte (the interpreter test trapped on the over-read). The players gave the recorded tessellation state only where the vertex function's patchType was not None. The glbench streams' patch functions answer None (their container has no TESS tag) while their AIR is post-tessellation, so the state was dropped and the translator drew their patches under Metal's defaults. The state now goes to every pipeline where it differs from the defaults; the translator decides from the AIR and ignores it for a plain vertex function, as Metal does. |
||
|
|
4454b23eb4 | rt: patch draws in the player, README and refusals (work in progress) | ||
|
|
4196a258ec |
Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development` while this branch was in flight, so the copy committed here counted a smaller one. Verified: regenerating at this tip leaves no change beyond the `Generated at` stamp. |
||
|
|
f6d308a628 |
rt tests: the indirect-place and given-back tests read the pool's one VkBuffer per allocation
What: - compute::every_device_reads_indirect_arguments_only_at_a_multiple_of_4_of_their_block expects Refusal::ArgumentPlace's place as the arguments' byte of the block's allocation (the block's offset there plus their place in the block). Vulkan reads indirect arguments at a multiple of 4 of the VkBuffer, which now spans the allocation, so that is the byte the check reads. The refusal's docs, dispatch_threadgroups_with_indirect_buffer's and draw_indexed_primitives' say so; docs/REFUSALS.md regenerated. - large::every_device_takes_no_block_an_encoded_uncommitted_command_buffer_holds asserted that the next take of a given-back length gets that range again. The pool takes a zeroed range first, so it need not. The test now asserts what it is for: the pool does not hold the block while the encoded command buffer holds it, and holds it once the command buffer is dropped. Why: both expected the per-block VkBuffer that 96340f0f9d deleted. The legs on 96340f0f9d's archives failed exactly these two on lavapipe (49447), the Iris (49459), the 2080 (49460), the 3090 (49462) and the M3 (49463); nothing else of the pool failed there. Verified: nothing yet for this commit; its check and legs follow. |
||
|
|
2efe8b1582 |
translator: the fractional-spacing note's measured drivers include ANV
PrecisionNote::TessellationFractionalSpacing's doc and its API.md entry listed ANV among the drivers not measured. A consumer's tessellation pixel test (its render_tess_bump device test) passed on its Iris Xe (ANV) leg, so ANV's fractional partitions matched Metal's answers in that test's cases. The note now lists RADV (780M, RX 7900 XTX), NVIDIA Turing, ANV and MoltenVK, and says factors past the device's range are not measured: no test sets one. Docs only; no behaviour changes. Verified: cargo fmt --all. |
||
|
|
f940151891 |
translator: a fractional partition on the device's tessellator carries a static note
Vulkan leaves where a fractional spacing places its vertices to the implementation ("Tessellator
Spacing": the two shorter segments' length need only fall monotonically with n - f, and their
place on the edge is the implementation's), where Metal's tessellator places them by its own rule.
No note said so: rule 1 wants a static note on an operation whose answer can differ from Metal's.
PrecisionNote::TessellationFractionalSpacing is now recorded on the evaluation stage of every
pipeline of a fractionalOdd or fractionalEven partition drawn through the device's tessellation
stages (Control::notes); the emulation, Metal's tessellator, records none. Its documentation
states the measurement: equal to Metal's by a consumer's device tests on RADV (Radeon 780M, RX 7900
XTX), NVIDIA Turing and MoltenVK; other drivers, ANV and lavapipe among them, are not measured.
The old runtime takes it as a note kind (tessellation-fractional-spacing), validation allows it
unbounded, codec and ARTIFACT_FORMAT_VERSION 542, SEMANTICS_VERSION 2184 (the evaluation stage's
notes change), fast_paths' list, API.md's catalogue; the tessellation engine test expects it on
the fractional cases and on no emulated stage. api_signatures regenerated.
|
||
|
|
28f2735f52 |
translator: the tessellation winding's vertex order is measured, on four drivers
Metal's clockwise output winding maps to VertexOrderCcw and its counter-clockwise one to VertexOrderCw. The control stage's docs, PrecisionNote::TessellationWinding and API.md called that an unobserved reading of MoltenVK's mapping. A consumer's device test, tessellation_states_tessellate_as_metals, now matches Metal's bytes (recorded on the M3 Max) for both windings on RADV (Radeon 780M, RX 7900 XTX), NVIDIA Turing and MoltenVK; the docs say so, and that other drivers are not measured. The note stays: it is still recorded on every tessellation pipeline. Docs only. |