bb09d7bb060e3d13945ea9b7bf8428f65e0a6744
2322
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3ecfe8f034 |
Conformance ledger: the BGRA4Unorm texture buffer's rows follow the device's texel-buffer query
|
||
|
|
bbdf8d4d90 |
Conformance recordings: the five managed-named cases, carried from the 5300M's measurement
Each recording holds the case's carried answer as record mode writes a carried case's: the transcript of the reader's content as an AMD Radeon Pro 5300M under macOS 26.7.1 read it, 8 rounds a reader (jobs 81602 and 81644), measured_on amd-radeon-pro-5300m, validated not run. The compute slot, the declaration, the vertex slot and the blit source read the bytes as of the reader's commit; the reach through the address alone reads the bytes the GPU's copy last took. The oracle's own run is forbidden by the cases (one copy), so nothing here ran on Metal. They were written by record::carried and record::write, the calls record mode makes for a carried case, through a scratch test of a CPU-only job's own workspace (job m3-max-81916, at c098a9848e), never committed. docs/CONFORMANCE-COVERAGE.md is regenerated with them (scripts/conformance-coverage/coverage.py): 192 case modules, 1347 recordings, 85 carried. Verified: in the same job the conformance suite ran 1050 tests, 1048 passed; the two failures are the coverage document, regenerated here, and the cases' missing Metal time records, which the oracle's times run adds next. |
||
|
|
8be5365553 |
Player: a two-copy stream's announcement is taken at the first commit that names the buffer
The runtime now takes a Managed range at the first commit whose encoders name its buffer, as Metal on an AMD Radeon Pro 5300M does (jobs 81602, 81644). The player's own second copy, which a two-copy stream's Managed buffers take on a device with unified memory, took every range named at the next commit of any command buffer; it now follows the runtime's rule. - second.rs: Seconds keeps, for each command buffer not yet committed, the buffers with a second copy its encoders named, themselves or through a texture over one (made over the buffer, a tiled one, or a view of one), and a commit takes only those buffers' ranges. A released buffer with ranges pending stays only while a command buffer not yet committed that named it, or a texture over it, can take them; otherwise its place goes back at once. A command buffer released uncommitted takes nothing. - mod.rs: each encoder call's named objects, a render pass's attachments, resolve textures and visibility result buffer at its encoder's making, and the textures and views made over a second copy feed it. render.rs keeps the pass's resolve textures and visibility result buffer by stream id. - encoders.rs: copy_named takes the committing command buffer's ranges alone. - stale.rs: a didModifyRange: is pending until a commit whose uses name the object takes it, with the bytes written by then (an indirect command buffer's command takes it where it is encoded); writes between the announcement and that commit are not stale. - docs/REPLAY-STREAM.md says so. Tests: rt_replay a_two_copy_stream_s_announcement_is_taken_at_the_first_ commit_that_names_the_buffer (zeros announced, a commit of another buffer, 7s written with no announcement, a copy of the buffer reads the 7s); tests an_announcement_is_taken_at_the_first_commit_that_names_its_buffer (the census counts one stale use where it counted two). Not yet compiled. |
||
|
|
2b335a8174 |
rt docs: the memoryless refusal's basis says what is true now
Gap::MemorylessTexture's basis read "render passes are not built", which stopped being true when render passes were built. It now names the reason the refusal stays: a memoryless attachment keeps its contents for the whole render encoder, across the renderings the runtime ends and restarts inside one encoder (barriers after writing draws, the feedback-loop barrier, copies for textures over buffers and Managed copies, shadow copies), and the image that would hold them is not built. docs/REFUSALS.md regenerated (scripts/refusal-surface). Docs only: no behaviour changes. refusal_surface.py --check exits 0. |
||
|
|
e4195ee560 |
Conformance recording: indirect-range-gpu-written-indexed-patch-draws on Metal
Metal's answer for the indexed-patch-draws range row, recorded on the Apple M3 Max (macOS 27.0.1, 26A434) by job m3-max-81637 at 992794d8bd (the AIR commit, d244877fb2 after the rebase onto 685bde8009, the same patch), with its times (8 rounds, the same job). The execution completes, and commands 1 to 5 draw rows 2 to 11 whole: each command's quad, whose four corners are stored out of order and named in order by its 16-bit control-point indices, covers its two rows. Each texel holds the command's mark, the patch index i, the instance and the base instance i, the patch-draws row's texels exactly. The ledger's Iris Xe row is the Extension refusal, as for the other range rows: the Iris Xe lists no VK_EXT_device_generated_commands. CONFORMANCE-COVERAGE.md is regenerated. |
||
|
|
39423d92f1 |
ICB: a kernel's indexed patch draws into an indirect command buffer, executed through a layout of indexed patch draws
The owner's 3406 order, the planner's next indirect command kind: MTLIndirectCommandTypeDrawIndexedPatches. The records (pipeline::IndirectDrawLayout) grow by 8 bytes a command for every kind. The control-point indices' address is a third u64 that an execution pushes, and VUID 11103 asks each token's offset to be at or past the one before it, with the draw token last (VUID 11100). So the address cannot go after the draw; it lies past the index token's 16 bytes, at index() + 16. Every command's tail is now 16 + 8 + 4 + 20 = 48 bytes: the stride is index() + 48 (was + 40), the sequence index's place index() + 24 (was + 16), and the draw's arguments index() + 28 (the translator's DRAW_AT, was 20). The cost is 8 bytes a command in every buffer: 160 bytes for 7 vertex and 7 fragment slots (was 152, 5% more), 48 for none (was 40), 544 at most (was 536), which the floor's stride and token-offset limits are checked against. One record shape for every kind stays: a kernel cannot know a buffer's kind when it is translated, so it writes one shape whatever buffer it reaches. The main lane accepted this on the condition that the already-landed kinds' rows run again at the new layout. Translator (lower/access/icb.rs): a render_command's draw_indexed_patches writes what draw_patches writes (the draw's VkDrawIndirectCommand of patches, the factors' and the patch indices' Metal addresses) and the control-point indices' Metal address at the new place (CONTROL_POINTS_AT, IndirectDrawLayout::control_point_indices). Its operands are draw_patches's, with the control-point indices at operand 6. Runtime: Device::new_indirect_command_buffer takes DRAW_INDEXED_PATCHES alone (CommandDraw::IndexedPatches), refused as patch draws are on a device whose executions run no tessellation stage (TessellationStages). Its layout pushes the control-point indices' address where the control stage reads it (FieldValue::ControlPointIndices), holds no index buffer token, ends in TOKEN_DRAW and names the tessellation stages. An execution checks the state's control-point index type against the buffer's kind, as a direct draw checks it against the call: patch draws with a state of an index type are Refusal::PatchDrawWithIndexType, and indexed patch draws with a state of none Refusal::IndexedPatchDrawWithoutIndexType. This replaces the patch draws' check through an empty PatchReads. Docs: the runtime README's ICB section (records, tokens, refusals, floor limits); the API guide's section 1; METAL-COVERAGE (coverage.tsv); CONFORMANCE-COVERAGE and REFUSALS.md regenerated (the two refusals gain the draw site); the API signature table blessed for control_point_indices. Tests: the red commit's engine and runtime device tests; the layout's unit tests at the new offsets, the reset command's control-point place among them; a unit test of the indexed patch tokens. |
||
|
|
08447f8aff |
ICB: a kernel's patch draws into an indirect command buffer, executed through a layout of patch draws
The owner's 3406 order, the planner's next indirect command kind: MTLIndirectCommandTypeDrawPatches. Translator (lower/access/icb.rs): a render_command's draw_patches writes VkDrawIndirectCommand (the patch count, the instances, the patch start and the base instance) where a plain draw's goes, and in the index token's 16 bytes, which a buffer of patch draws does not read as a token, the tessellation factors' Metal address and the patch indices' (0 for the null pointer). The records stay one shape for every kind (pipeline::IndirectDrawLayout::factors and ::patch_indices name the two places). The control-point count is not read, as a direct patch draw does not read it; the factors' instance stride and the factor scale are read only under a per-instance step function or tessellationFactorScaleEnabled, which the runtime refuses at the pipeline state. A post-tessellation vertex function of a state made for indirect command buffers is compiled under LoweringInputs::indirect_range (pipeline/compile.rs), so each evaluation tests its command against the execution range as a plain vertex function does. Runtime: Device::new_indirect_command_buffer takes DRAW_PATCHES alone, the buffer's kind CommandDraw::Patches. Its command layout pushes the factors' and patch indices' addresses where the state's control stage reads them (FieldValue::TessellationFactors, FieldValue::PatchIndices), holds no index buffer token and ends in TOKEN_DRAW; the layout and each execution name the tessellation control and evaluation stages beside the vertex and fragment ones (dgc::PATCH_STAGES). An execution of patch draws draws a patch list with a post-tessellation state and reads no tessellation factor buffer of the encoder's; a state that is not post-tessellation is Refusal::PatchDraw, as is a post-tessellation state with a buffer of other draws, and a state of a control-point index type Refusal::PatchDrawWithIndexType, as for a direct patch draw. VUID-vkCmdExecuteGeneratedCommandsEXT-supportedIndirectCommandsShaderStages-11060 requires the bound stages in the device's supportedIndirectCommandsShaderStages, so the floor reads whether they hold the tessellation stages (IndirectCommandLimits::tessellation_stages) and a buffer of patch draws is refused without them, a new kind, IndirectCommandsKind::TessellationStages. Mesa's source answers VK_SHADER_STAGE_ALL_GRAPHICS on RADV and VK_SHADER_STAGE_ALL on lavapipe. Two draw kinds together, DRAW_INDEXED_PATCHES and the rest stay CommandTypes. Docs: the runtime README's ICB section and refusal line; the API guide's section 1; METAL-COVERAGE (coverage.tsv); CONFORMANCE-COVERAGE regenerated; the API signature table blessed for the new field, methods and variant. REFUSALS.md regenerated with no change. Tests: the red commit's engine test and runtime device test, with the device test's arm for the TessellationStages refusal; a unit test of the patch tokens; the floor's limits test reads the tessellation stages. |
||
|
|
0539084768 |
Conformance recording: indirect-range-gpu-written-patch-draws on Metal (red still)
Metal's answer for the patch-draws range row, recorded on the Apple M3 Max (macOS 27.0.1, 26A434) at 0616460f73 by job m3-max-81499, with its times (8 rounds, the same job). The execution completes, and commands 1 to 5 draw rows 2 to 11. Each texel holds the command's mark, the patch index i, the instance and the base instance i. The instance a post-tessellation vertex function reads counts from the base instance: an odd command's second instance reads i + 1, an even command's only instance reads i. The ledger's Iris Xe row is the Extension refusal, as for the other range rows: the Iris Xe lists no VK_EXT_device_generated_commands. CONFORMANCE-COVERAGE.md is regenerated. Red: the runtime refuses an indirect command buffer of DrawPatches (CommandTypes), so the row's replay meets a refusal that the ledger does not list. |
||
|
|
dcf039d472 |
rt: a copy between two buffers whose bytes meet goes in chunks of the shift, as memmove
Owner 3406 follow-up to L212. A copy between two buffers whose ranges meet in one block was refused (Refusal::BufferCopyOverlap, basis "ours"). Two buffers placed over each other in a heap are aliases. Metal's validation names copies between buffers among the defined copies between aliases in a placement heap (job m3-max-81493), and plain Metal on an Apple M3 Max gives memmove's bytes for them (probe overlapping_alias_copies.m, job m3-max-81544). Form (blit.rs): - buffer_to_buffer takes whether the two are one buffer and answers BufferChunks. - Ranges apart are one chunk. - Two buffers' ranges whose bytes meet are chunks no longer than the shift |to - from|, the last chunk the rest. The chunk at the end the shift points to goes first: the last first where the destination lies past the source, else the first. So no command's source and destination share a byte (VUID-vkCmdCopyBuffer-pRegions-00117, which each one-region command meets on its own), and no chunk reads a byte an earlier one wrote. - copy_from_buffer_to_buffer records one vkCmdCopyBuffer a chunk with the slabs' execution barrier (between) between two, each counted as a blit barrier. Every hazard between two chunks is a write after a read. - Two ranges on the same bytes copy nothing. - One buffer's overlapping ranges stay Refusal::BufferCopyOverlap. Its basis is now metal-documented: Apple's page for the copy allows the same buffer only "if size is less than the distance between sourceOffset and destinationOffset". The conformance case buffer-blit-overlapping-copies is one buffer, so its ledger row holds. Only its note's wording changed; coverage.py regenerated with no change. - A shift of n bytes takes size/n commands, rounded up. That is the fewest any form without an intermediate takes. Unit test a_copy_between_buffers_takes_ranges_inside_both_and_cuts_two_buffers_bytes_that_meet (renamed) expects the chunk orders both ways, a partial last chunk, and nothing for the same bytes. The rest of its cases are unchanged. Docs: the copy's doc, BufferCopyOverlap (REFUSALS.md and basis.rs regenerated), the runtime README's blit encoders, the tests' module doc. Verified: refusal_surface.py --check exits 0. Green under the validation layer, which fails a test on any message, so each one-region chunk met VUID-vkCmdCopyBuffer-pRegions-00117 on these devices: the 27 blit tests pass on lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M (RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671). The runs built the series before its rebase onto development; the patches are the same. |
||
|
|
2416a42d36 |
rt: copies between a heap texture and memory it aliases are Metal's own refusal, but a whole level between two heap textures
Row L212. Metal's API validation stops a copy between aliases in a placement heap unless it copies between buffers, between linear textures of one row stride, or entire texture surfaces. Source: probe overlapping_alias_copies.m on an Apple M3 Max, macOS 27.0.1, jobs m3-max-81486 and m3-max-81493. The runtime refused all of these as Gap::OverlappingCopy. It now refuses what Metal stops as Refusal::AliasingCopy, and records nothing for it. Form (blit.rs): - buffer_copy: a region that meets a heap texture's memory, either way, is Refusal::AliasingCopy (Metal: "blitting between aliasing resources is defined on a placement heap only when using a blit method copying entire texture surfaces, or when copying between buffers"). - texture_copy: two textures whose memory meets, one placed in a heap, that are not both heap textures copying a whole level into a whole level (whole_level: origin 0, size the level's extent, the view's first level taken off) are Refusal::AliasingCopy. A texture in place over a heap buffer against a heap texture is refused even for a whole level (Metal: "... only when both textures are linear and have the same bufferBytesPerRow value"). - The whole level between two heap textures stays Gap::OverlappingCopy, counted, per the planner's ruling. That is how the consumer reaches copyFromTexture:toTexture:, which Metal's validation takes and the M3 answers with the source's bytes at 0, 128 and 8320 bytes apart. No copy command and no cut reads no byte it writes (VUID-vkCmdCopyImage-pRegions-00124). The form through an image of the runtime's, counted, is built once a guest's run counts the gap. Docs: blit.rs's module and copy method docs; error.rs's Gap::OverlappingCopy (REFUSALS.md regenerated); Metrics::overlapping_copies_refused; the runtime README's blit encoders and their known gaps, which carry the M3's answer and the VUID. The README also cites the M3's answer for a surface's buffer and its own plane (job m3-max-81486). No conformance ledger row covers these shapes. Verified: refusal_surface.py --check exits 0. Green under the validation layer, which fails a test on any message: the three tests pass, with the rest of the 27 blit tests, at the series' tip on lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M (RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671). The runs built the series before its rebase onto development; the patches are the same. |
||
|
|
19d642612d |
Tests: copies between a heap texture and memory it aliases are Metal's own refusal, but a whole level between two heap textures
Row L212. These copies were all Gap::OverlappingCopy: a copy between a
texture placed in a heap and a resource whose memory meets it.
On an Apple M3 Max, macOS 27.0.1, the conformance probe
overlapping_alias_copies.m (jobs m3-max-81486 and m3-max-81493) shows that
Metal's API validation stops most of these shapes with
"blitting between aliasing resources is defined on a placement heap only
when using a blit method copying entire texture surfaces, or when copying
between buffers":
- a buffer and a texture over its bytes, either way;
- the region method between two heap textures that alias.
It stops a heap texture and a linear texture over a heap buffer at its
bytes with "... only when both textures are linear and have the same
bufferBytesPerRow value". It passes copyFromTexture:toTexture: between two
heap textures that alias. The consumer copies that as whole levels through
copy_from_texture.
The new Refusal::AliasingCopy (Basis: metal-measured) names the shapes
Metal stops. docs/REFUSALS.md, error/basis.rs and api_signatures.tsv are
regenerated. A whole level into a whole level between two heap textures
stays Gap::OverlappingCopy, per the planner's ruling. Nothing produces the
new variant yet.
Tests:
- textures_whose_memory_meets_where_one_is_laid_out_by_the_device_are_refused_or_copy_in_no_order
(unit, renamed) expects the two heap textures' whole-level copy still to
copy in no order. It expects part of a level, either way and at an offset,
and a texture in place over the heap texture's bytes, either way, to be
Refusal::AliasingCopy.
- a_buffer_copy_over_its_texture_s_own_bytes_copies_in_slabs_or_in_no_order
(unit) expects a region meeting a heap texture's memory, into it and out
of it, to be Refusal::AliasingCopy.
- every_device_refuses_a_copy_between_heap_resources_whose_memory_meets
(device) expects the whole level onto its alias to be the counted gap,
and part of a level onto its alias and the heap buffer either way to be
Refusal::AliasingCopy. Nothing is recorded, and one refusal is counted.
Verified: refusal_surface.py --check exits 0, and signatures.py --bless adds
the one variant row. Red as expected, under the validation layer, on
lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M
(RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and
the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671): the three tests
fail. The device test says "part of a level onto its alias:
Err(Unsupported(OverlappingCopy { pixel_format: RGBA8Unorm }))", the unit
tests "not a refusal: it was checked". The runs built the series before its
rebase onto development; the patches are the same.
|
||
|
|
62e3835aa1 |
Docs: CONFORMANCE-COVERAGE.md regenerated for the plain-draws row's notice
5781011f02 gave indirect-range-gpu-written-plain-draws its point-size notice allowance and left docs/CONFORMANCE-COVERAGE.md one line behind it (coverage.py --check: not what the suite's sources and recordings derive). Regenerated; --check now says as derived. |
||
|
|
3f6967e92a |
API guide: a function's draw_primitives of triangles writes an indirect command's record too
docs/API.md section 1 listed the render_command operations a function writes under the identity domains; draw_primitives of triangles joined them in d14977bfcf. Its arguments go where an indexed draw's do. Docs only. |
||
|
|
21f0cae67b |
ICB: a kernel's plain triangle draws into an indirect command buffer, executed through a layout of plain draws
The owner's 3406 order, the planner's first indirect command kind: MTLIndirectCommandTypeDraw. Translator (lower/access/icb.rs): a render_command's draw_primitives of the constant triangle type writes VkDrawIndirectCommand (vertex count, instances, vertex start, base instance) where an indexed draw's VkDrawIndexedIndirectCommand goes, 20 bytes past the index token's place, and writes nothing else. Both kinds share the records (pipeline::IndirectDrawLayout), so an encoding writes one shape whatever buffer it reaches. A kernel cannot know a buffer's kind when it is translated, because it reaches the buffer through an argument buffer. A reset's draw of nothing reads as either kind's. Points and lines stay refused, as for indexed draws, because an execution draws one topology. Runtime: Device::new_indirect_command_buffer takes DRAW alone as well as DRAW_INDEXED alone, and the buffer keeps its kind (indirect::CommandDraw). An execution's command layout follows the kind. A layout of plain draws holds no index buffer token, which VUID-VkIndirectCommandsLayoutCreateInfoEXT-pTokens-11095 forbids there, and ends in TOKEN_DRAW. Its tokens are one fewer. The execution shapes' cache keys on the kind, and the reset templates serve both kinds. DRAW together with DRAW_INDEXED stays a typed refusal, CommandTypes, until the planner rules. A layout takes one draw token (VUID-...-11100), and no form found draws both kinds in command order at a bounded cost: two executions reorder the commands, an execution per command costs two a command, and identity indices hold only as many vertices as a bound buffer of them. The CommandTypes doc, the runtime README's ICB section and its refusal line say so. Docs: the README ICB section; METAL-COVERAGE (coverage.tsv: "plain or indexed triangle draws"); CONFORMANCE-COVERAGE regenerated for the new row's recording and ledger row. REFUSALS.md regenerated with no change. Not run on an Intel card: the Iris Xe lacks VK_EXT_device_generated_commands, so its ledger row is the Extension refusal; the four-card proof jobs are named in the hand-over. |
||
|
|
16f7bc942e |
Runtime: a texture over host memory's import is restored inside its make, which waits for it
The planner ruled the seam (ii), for new_texture and new_texture_in_place alike, one form: the
restore pair of a texture in place over host memory's import runs in a submission of the
runtime's own inside the make, and the make returns after it completes. Metal touches no bytes at
a make, and a CPU write to a Shared buffer that no pending GPU command uses is fully defined.
Running the pair at the next submission on any queue let one thread's commit revert another
thread's write (reims: an app wrote its first frame into a fresh pool surface under a lock that
waits on nothing, and a later submission from another process ran the pair mid-write): a lost
write documented Metal never loses. The planner's earlier term (the pair in the texture's first
command buffer, held by an ordering test) is withdrawn. Discrete devices are untouched: they have
no pair.
Device::texture, for a texture whose image restores (Keep::Restore), has the upload that holds
its move home go at once, alone (WorkState::flush), and waits on the progress semaphore for it
(Done::wait), the pattern Texture::get_bytes and new_buffer's Private zeroing use. The upload's
barrier orders the save after the GPU work already submitted, so the make waits for that work
too. An encoded shared-event wait is held on the CPU and never submitted, so it never holds the
make's submission back. The make is refused in a scheduled handler (Refusal::InScheduledHandler),
which runs on the submit thread that the make waits for, as those calls are.
Docs: new_texture's and new_texture_in_place's, InScheduledHandler's list, the counters'
(HostMemoryRestore inside the make), check_over's and the homing comment; the runtime README's
Imported blocks paragraph and its known gap, which now says what remains (a host write from
another thread during the make) and carries the Radeon 780M row (Phoenix, RADV, job
m3-max-81673: 696 against 537 us a frame at one draw, 1025 against 793 at four);
docs/REPLAY-STREAM.md; AGENTS.md rule 2 ("after one counted copy pair at its making") and rule 3
("a counted copy pair at the texture's making restores the bytes"), in the planner's words.
Tests: host_in_place, over_causes and import count the pair at the make.
Verified on lavapipe, job m3-max-81704: the seam test failed at the commit before (exit 100) and
passed here (exit 0), with clippy under --cfg m2v_cpu_icd clean. With the series' final code (runs
at its README commits, which change no code), the touched device tests with in_place_views passed on
the Apple M3 Max under KosmicKrisp 26.3.1 (job m3-max-81753, 12 of 12), the Radeon 780M (job
m3-max-81798, 18 of 18), the Iris Xe (job m3-max-81801, 18 of 18) and the RTX 3090 (job
m3-max-81792, 18 of 18), the integrated three restoring in place inside the make (32 restore copies
over sixteen 1080p makes); gate job m3-max-81765 (clippy in three configurations, Rustdoc, the
runtime's private Rustdoc, and the runtime, translator, validation and conformance suites) passed
with the series' final code.
|
||
|
|
2186bd04d1 |
Runtime: an in-place texture's restore pair counts under OverCause::HostMemoryRestore
A texture in place over host memory's import on an integrated or CPU device costs one save and
write-back of the bytes under its image around its move out of the undefined layout, once, at
its first use. Those two copies counted under OverCause::HostMemory, beside a copied texture's
copies at its uses, so a census could not tell an in-place texture's kind line from a copy's.
The planner ruled (row 1, pin N) that the pair stays counted, in count and bytes and in the
totals, under a cause that says what it is.
The upload's restore now counts under OverCause::HostMemoryRestore, in
Metrics::over_copies_host_memory_restore and over_copy_bytes_host_memory_restore, and still in
over_copies, over_copies_imported and bytes_copied; its OverCopyKind carries that cause.
over_copies_host_memory counts the per-use copies alone. Docs: new_texture's, the runtime
README's Imported blocks and over-copy paragraphs, docs/REPLAY-STREAM.md's over-copy causes (now
twelve beside host memory's) and the frame line's host_memory part, which carries the restore
pairs.
Verified on lavapipe before the rebase onto
|
||
|
|
5f9287e40e |
Runtime: Buffer::new_texture_in_place, a texture over a buffer in place or a typed refusal
The consumer keeps a texture of its own where the runtime would make the counted copy of a
texture over a buffer, and needs the runtime's in-place texture everywhere else. Buffer::
new_texture_in_place makes what Buffer::new_texture makes where that texture is in place, and
refuses with Refusal::TextureNotInPlace { cause } where new_texture would make the copy, naming
the OverCause its copies would count under. A refusal makes no texture and counts no copy.
One decision in one place: Source::Over carries what the making does with a texture it would not
make in place (Unplaced::Copy for new_texture and a surface plane's texture, Unplaced::Refuse for
the new call). Device::texture refuses at the same two points where it chooses the copy: where
check_over names a cause, and where the linear image made does not lie as the texture's bytes do
(Unmade::Unfit). No new form and no new query: over host memory's import the choice is still
row 1's unified-memory query alone. A texture buffer is a view, never copied, and is made as
new_texture makes it.
The doc comment names newTextureWithDescriptor:offset:bytesPerRow: and lists what is refused;
texture_copy_cause's doc and the runtime README name the new call. docs/REFUSALS.md regenerated
(the refusal's two sites in texture); api_signatures blessed at the red commit.
Verified on lavapipe before the rebase onto
|
||
|
|
cbe89f239d |
Runtime tests: a texture over a buffer made in place alone agrees with the ordinary make (red)
The consumer asked for an in-place-only make of a texture over a buffer: the linear image in
place wherever Buffer::new_texture takes it, and a typed refusal naming the cause wherever
new_texture would take the counted copy, so that the consumer keeps those bytes in a texture of
its own and counts them.
This commit adds Refusal::TextureNotInPlace { cause: OverCause } (Basis: ours), its Display arm,
docs/REFUSALS.md and basis.rs regenerated, the api_signatures table blessed, and a stub
Buffer::new_texture_in_place that makes the ordinary texture. copy_cause's test now runs each
device in both forms (an integrated or CPU device through its two-copy view too), makes each
case in place alone beside the ordinary texture, and adds a render target over its texels alone,
an R8Unorm texture of 13 x 3 at the device's pitch, and RGBA8Unorm and R8Unorm textures over host
memory's import. It asserts that the in-place-only make is in place where texture_copy_cause
answers in place, and elsewhere refused for that cause with no texture made and no copy counted.
Expected red on every device: the stub makes the counted copy where the answer is a cause (the
pitch case at least, on every device).
|
||
|
|
0703c09cdb |
Runtime: a texture over host memory's import in place on an integrated or CPU device alone, the counted copy at each use elsewhere
The planner's ruling on row 1 (a). The in-place form over a host-pointer import is chosen by rule 2's unified-memory query, Vulkan's physical device type (Core::unified_memory, the query that keeps one copy of a Managed buffer): in place on an integrated or CPU device, after one counted copy pair at its first use; on a discrete or virtual device the per-use counted copy stays. The planner's earlier term that deleted the per-use path is withdrawn by name: that path stays, for discrete devices alone. It is the same query and the same form, widened, not a new one. Grounds. On an integrated device a texture over Shared memory is already a linear image in place by rule 3, on the ordinary Shared-buffer route and on the dma-buf import route, and pays the same linear read; the host-pointer import was the one case still copying at each use. The speed pair (a scratch timed test, never landed: a 1920x1080 RGBA8Unorm texture over host memory the CPU writes whole each frame, read at every texel by a 1080p pass of 1 or 4 draws; base |
||
|
|
4b7f935a80 |
Runtime: a texture over host memory's import in place, its bytes saved and written back once
A texture over a buffer in host memory's import (Device::import_host_memory) used to be the counted copy at every use. Its bytes were copied into an image of its own before each submission that used it, and back after each write. Now it is in place: the device's linear image, made for host memory's handle, bound in the import's own memory. The condition is that the external image query for VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT answers the linear image importable, compatible and not dedicated-only, and that the image passes the tests of any texture over a buffer in place. This is not a new copy. It is the existing last form made smaller: one copy pair in the texture's life, in place after it, on documented behaviour only. - Created UNDEFINED: an image bound in imported memory names the import's handle type (VUID-vkBindImageMemory-memory-02989), so it starts undefined (VUID-VkImageCreateInfo-pNext-01443). - Saved and written back around the one transition: a move out of the undefined layout may discard the bytes (Vulkan 1.4, section 7.1.1). - Host access by memory-domain operations: host memory has no other side whose release an acquire could match (section 11.2.6). The image's one move home is in the upload ahead of the first command buffer submitted after the making, from any queue, in this order: 1. a barrier from every earlier command's writes, including earlier submissions on the one queue, to the save; 2. a copy of the bytes bound under the image into a Private block taken at the making; 3. the move, in a barrier that waits for the save's reads; 4. the write-back, with a barrier between write-backs, since two imports of the same pages may meet; 5. a barrier from the write-backs to every later command and the host. The block goes back once the upload retires. A later use copies nothing. Where the query offers no linear image of the format and usage, the texture stays the counted copy at each use. On the Mac driver that is every render target, since it makes no linear colour attachment. Counts: - the two copies count in Metrics::over_copies_host_memory (and over_copies, over_copies_imported, bytes_copied), each of the bytes bound under the image; - new: Metrics::textures_in_place_over_imports counts each texture in place over an import, host memory's or a dma-buf's, at its making; - the replay's frame metrics carry it. Docs, in this commit: - AGENTS.md rule 3's first exception gains the planner's clause verbatim; - the runtime README's Imported blocks gives the form, and states the two VUIDs' rule in plain words; - its known gap gives the pair, the window while the upload runs (a host write may be lost, and a host read may see the bytes undefined), and which formats and usages keep the per-use form on which driver, by query; - REPLAY-STREAM.md and Buffer::new_texture's doc follow. Tests: - host_in_place gains two checks: a fill submitted before the making and not waited for is in the first read, and the texture counts once at its making; - over_causes, import's texture test and imported_aliases now take either form, asserting in place on lavapipe and the copy where the query refuses. Verified on the system lavapipe (llvmpipe, LLVM 23.1.4), job m3-max-81271, filter host_in_place, over_causes, import's texture test, imported_aliases, import_overs and layouts: 17 tests. - Red at the commit before: host_in_place fails at its in-place assertion; the other 16 pass. - Green, at a tree whose code equals this commit's: 17 of 17 pass. The restore pair is 2 copies, 512 bytes. In imported_aliases, the Half textures are in place, two pairs for two textures over one import. Clippy -D warnings under --cfg m2v_cpu_icd is clean for the runtime and validation. |
||
|
|
9ce9960452 |
Conformance tests: record mode reads the host's macOS release from the side, so its tests run on any Mac
CI run 47018745061 (at
|
||
|
|
094405e9a9 |
Harness and player: video planes ask shader read and write with no read-alone fallback
Since c850655216, new_exported_surface answers a plane whose image in place lacks storage with the copy form (SurfaceCopy::Usage) rather than Gap::SurfaceUsage. So the harness's churn probe and the replay player's video surfaces can no longer reach their fallback to planes of shader read alone, and this commit deletes it: - churn.rs: the probe's retry and Video's usage field, replaced by one const usage; - videos.rs: the retry, its read_only counter, and the report's "with planes of shader read alone" count; - REPLAY-STREAM.md and videos.rs's module doc now say the copy form takes such a device. A device that lacks storage now shows in the report's copy-form count under its reason. Checked by the hand-over job: clippy of the harness and validation crates, and the validation suite. |
||
|
|
6d9706769a |
rt: a surface plane whose image in place lacks a usage its texture asks takes the copy form
new_exported_surface refused a plane whose texture asks a usage that its image in place does
not hold or export, ShaderWrite's storage for one, with Gap::SurfaceUsage. As ruled for row 5,
that plane now takes the counted copy form with its own reason, SurfaceCopy::Usage { plane }.
The copy form's texture over the block's buffer is an optimal image of the usage the texture
asks. The submissions copy it into the image and back (Metrics::over_copies), so a kernel's
write through a view of the plane reaches the exported bytes by that copy before the host or
the other API reads them.
How:
- Query::plane answers usage_verdict's reason in place of the gap. With nothing else to fail,
its return type drops the outer Result and the pixel_format it carried only for the gap.
- The feedback-loop retry skips Usage, as it skips Tiling and NoModifier, since dropping the
loop does not change the usage asked.
- Gap::SurfaceUsage stays for the Direct3D 11 import, and its doc now says that alone.
Docs, in this commit: the runtime README (the guide's storage paragraph, the copy form's list
of reasons, and a fifth case in the known gaps), REFUSALS.md regenerated (SurfaceUsage's row
and its sites) and the api_surface table (the new variant).
Tests:
- Verdict unit test a_plane_whose_tiling_lacks_an_asked_usage_takes_the_copy_form, with
synthetic features: a LINEAR tiling without STORAGE_IMAGE, where the optimal tiling has it,
takes Usage for a plane that asks storage, and lies in place for one that does not.
- The device test every_device_writes_a_surface_plane_through_a_shader_write_uint_view no
longer accepts Gap::SurfaceUsage at the make.
- The write-back through the copy form's own copy is the same copy_form path the device test
already ran at f997a251fc: on the RTX 3090 (NVIDIA 620.70.06, m3-max-81338) the dma-buf row
took Copy(Tiling) and the copy-form row Copy(Pitch); on the RX 7900 XTX (RADV, Mesa 26.2.6,
m3-max-81352) and lavapipe (Mesa 26.2.4, m3-max-81341) the copy-form row took Copy(Pitch).
Each had the kernel's 2,073,600 texels written through the ShaderWrite R8Uint view, read
back exactly from the surface's buffer.
- No device queried takes Usage for an R8 plane (the row 5 queries m3-max-81308, 81309,
81310, 81314, 81318, 81322 and 81353).
|
||
|
|
adba2693a1 |
Conformance ledger: the shared creator's remaining refusals are the consumer's own and rt's padded formats
With a247e1ec2b the rt side answers newSharedTextureWithDescriptor:,
newSharedTextureHandle and newSharedTextureWithHandle:. Replaying the four cases on lavapipe
(Mesa 26.2.4, m3-max-81374) gave these results:
- the made, texture and handle sites compare against Metal's recording;
- a creator outside Private storage, and RGBA16Float_XR, answer nil as Metal does;
- 52 sites stayed refused, none divergent. This commit lists them:
- 40 sites read parentTexture, parentRelativeLevel, parentRelativeSlice and isShareable, on
the shared texture and its views. rt keeps no getter for them (TheConsumers), with the same
text as the views' existing rows.
- 8 resource and resource-after-handle sites read MTLResource's getters (TheConsumers), with
storageMode among them, so storageMode is not compared at those sites.
- 4 made sites for Private R10Unorm_X6, R10Unorm_X6_sRGB, RG10Unorm_X12 and
RG10Unorm_X12_sRGB, where rt makes no texture of the format (the same gap as
extended-swizzles-*'s rows; the 11-19 selector census found no stream that uses them).
All are venue *. CONFORMANCE-COVERAGE.md is regenerated (coverage.py --check: as derived).
The same job's full replay found no mismatch outside these four cases (52 in all, every one
listed here), and the conformance suite passed (1048 of 1048). The replay that shows these rows
holding is the hand-over's job.
|
||
|
|
e33ee4099f |
Conformance ledger: the shared creator's 31 cells compare against Metal (red)
The 31 rows of shared-creator-padded-format-storage, shared-creator-extended-range-samples, texture-shared-handles and texture-view-descriptors at which the rt side answers Unavailable(shared_texture) are dropped: the side is to answer newSharedTextureWithDescriptor: and the handle calls as the runtime's consumer does on the runtime's one device, so each of those sites compares against the M3 Max recordings (Metal's nil at Shared, Managed and Memoryless, and for RGBA16Float_XR at Private; a texture at Private otherwise). Red: the side still answers Unavailable, so a replay of the four cases fails on 31 refusals the ledger does not list. CONFORMANCE-COVERAGE.md is regenerated (coverage.py --check: as derived). |
||
|
|
e1e6f52848 |
Conformance ledger: the shared-texture rows are not built yet, as a guest meets the call
The 31 rows of shared-creator-padded-format-storage, shared-creator-extended-range-samples, texture-shared-handles and texture-view-descriptors that the rt side refuses with Unavailable(shared_texture) gave "no stream uses it yet" (the 11-19 census) as their reason. That is stale: on 12-02 a viewer's render process called newSharedTextureWithDescriptor: about 2.5 s after its window opened, and its consumer answered nil. Their reason is now the ledger's "refused: not built yet (fix-l155)", so every replay counts them as open work, and the row says what is to be built: on rt's one device a shared texture is a Private texture and the texture its handle opens a clone of the same Texture, the handle the consumer's. Docs only: no row's case, venue, site or answer changes. CONFORMANCE-COVERAGE.md is regenerated (coverage.py --check: as derived). |
||
|
|
6b939ef793 |
Replay player: copyFromTexture:...sliceCount:levelCount: as the runtime's region copies
Metal's copy of whole surfaces between textures has no runtime call of its own; the player refused it as not played on a blit encoder, which ended a viewer stream's play on the XTX in its first seconds (job m3-max-81089). It now plays as the runtime's copy_from_texture, once for each slice and level of the counts, each the source level's whole extent from the origin to the origin, as a bind of a range plays as single-slot binds. The runtime's own checks refuse a level or slice past either texture. REPLAY-STREAM.md says so. |
||
|
|
8ac91a9b33 |
Docs: REPLAY-STREAM.md's render encoder paragraph rewrapped at 100 columns
The patch draws' sentence left two lines past the paragraph's width. |
||
|
|
b6c6997cfa |
Replay player: drawPrimitives and drawIndexedPrimitives from an indirect buffer
The player refused both of Metal's indirect draws of primitives as not played on a render encoder, so a stream whose program draws from an indirect buffer lost each such draw. Each now plays as the runtime's call (draw_primitives_indirect, draw_indexed_primitives_indirect), its arguments and index buffer at their offsets. The patch draws' buffer helper becomes draw_buffers, which both arms share: a draw naming a skipped index or indirect buffer is a skipped draw, and one skipped by its state or a bound object is counted as before; patch_draw keeps the patch draws' count of draws through a state whose record lacks tessellation. REPLAY-STREAM.md says the draws play direct or from an indirect buffer. |
||
|
|
59326c8dff |
Translator: half computes in 16 bits where only 16-bit DenormPreserve is missing, noting half denormals
The planner's ruling (T3). On a device with shaderFloat16, 16-bit RoundingModeRTE and 16-bit
SignedZeroInfNanPreserve whose only missing 16-bit control is DenormPreserve, the half operations
narrow::half_controls gates take the 16-bit route: a half + - * / sqrt and fused multiply-add on
the device's 16-bit instructions, half values held at 16 bits, the controlled pair for a float
rounded to half, and a half widened from and narrowed to its bits by the device's conversion.
It is the 16-bit floats query's existing form, read from one more of its properties.
narrow::controlled_modes declares RoundingModeRTE and SignedZeroInfNanPreserve for 16 bits there
and no denormal mode: not DenormPreserve for 16 bits (VUID 06296), nor the 64-bit one the
independence for 32 bits only ties to it (VUID 06289 asks for the same denormal mode at 16 and
64 bits). The independence rules decide which devices take it as before, and a device missing any
other 16-bit control keeps half in float.
MoltenVK on the M3 stays off the route: its denormal modes are not independent at all
(denormBehaviorIndependence NONE), where the form would tie float's denormal mode to half's and
change how the module's float arithmetic reads denormals, which Metal flushes; and its rounding
modes are not independent while it offers no 64-bit RoundingModeRTE, so the 16-bit
RoundingModeRTE the form declares cannot be declared at every width as VUID 06292 asks.
Every module that declares those controls on such a device (narrow::flushes_half_denormals)
records the new static note PrecisionNote::DeviceHalfDenormals, "half denormals may flush to
zero where Metal preserves them": the Vulkan spec leaves a 16-bit denormal to the device in an
entry declaring no 16-bit denormal mode. No other module records it. The conformance suite holds
its code, metal2vulkan-degrade-device-half-denormals, among the native notes beside
device-denormals (the device's own denormals, the one form built there); validation allows it
unbounded, as it does NativeHalfConversion.
Run on lavapipe, whose committed profile has this shape: its half arithmetic moves from float to
16 bits. Turnip on an Adreno GPU before the 8xx series reports the same controls (Mesa 26.3.1,
tu_device.cc lines 534, 1038-1048: shaderFloat16, RTE and SignedZeroInfNanPreserve for 16 bits,
DenormPreserve for 16 bits false below A8XX, independence ALL): not measured on a tile-based
phone GPU; no such device in the lab. No performance claim is made.
Tests: engine_native_half's new test (the red commit before this) now also asks for the note on
each such module and for none under all three controls or without another one. The tests that
held lavapipe as the conversion form now hold it under the controls (engine_native_half's
rounding kinds, memory and decode widenings and controlled modes; engine_half_hold's held values
and division; engine_arith's 16-bit fma profiles), and the conversion form on lavapipe's
description without 16-bit RoundingModeRTE.
SEMANTICS_VERSION 2325 (development holds 2323; 2324 is mad's), and ARTIFACT_FORMAT_VERSION
601 -> 602 (the new note's codec member). Golden rows are blessed at the pin.
Docs: the precision-note catalogue (docs/API.md, the new entry and the conversion entry's
controls), docs/HOWTO.md, the runtime README's shaderFloat16 row and its half fma line, the
NativeHalfConversion note's device list, api_signatures.
The conformance ledger. The form moves lavapipe, whose float controls lack only 16-bit
DenormPreserve, onto the 16-bit route. The conformance replay in the pinned lavapipe image (Mesa
26.2.4, LLVM 23.1.1) then answers 79 of the runtime ledger's llvmpipe rows otherwise:
- 47 now match Metal and are dropped: vertex-format-half4 28 and integer-vertex-attributes 16
(the rows said lavapipe folds the unrounded OpFConvert pair, with no 16-bit DenormPreserve to
make it Metal's; the pair now rounds under the 16-bit controls), and half-texel-nans-rg11b10f's
3 (nearest-sample, read, widened).
- 32 now answer otherwise and are replaced, each with the answer and a reason written from this
run's printout (first differing element):
- vertex-format-half4, 8 rows (Float..Float4, Half..Half4): only the NaN differs now, Metal
0x7fc00000, the device 0xffc00000; one element per component, where the rows recorded the
unrounded values (Float, the largest difference inf) or the kept payload (Half).
- half-texel-nans, 18 rows (nearest-sample, read and widened of r16f, rg16f, rgba16f, r32f,
rg32f, rgba32f): a 16-bit float texel's NaN now narrows to 0x7e00 (the payload dropped, as
read-through-sample already answered; Metal hands back the texel's code); a 32-bit one to
0xfe00 (Metal 0x7e00); the widening answers 0xffc00000 (Metal 0x7fc00000). Six rows count more
elements than before (the 16f nearest-sample and read rows: 215 -> 472, 428 -> 940,
852 -> 1874), twelve fewer.
- bicubic-texel-classes, 6 rows: fewer elements at every site, each count and largest
difference the one the 780M and RTX 5080 rows record; within the bicubic note's bound.
None of the 79 is a half denormal.
docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py): ledger rows
7932 -> 7885. The image is the pinned one, so the ledger's llvmpipe line does not move.
Not replayed, a follow-up: the six bicubic-texel-classes rows of venue "llvmpipe (LLVM 23.1.4,
256 bits)", a lavapipe outside the pinned image; this commit leaves them as they were.
Verified: the replay of this tree without the ledger edit, job m3-max-80972 (pinned lavapipe
image): exit 1 with row differs 32, now answers otherwise 32, now matches 47; the rows are written
from its printout. The same counts in job m3-max-80871 (the pre-rebase fix, against its base,
which exits 0). coverage.py --check: as derived.
No lab card's translation moves. The golden blesses at development (
|
||
|
|
9f42b4c1f3 |
Translator: OpenCL C's mad is its multiply and its addition, each rounded on its own
Apple's OpenCL compiler spells OpenCL C's mad(a, b, c) as air.mad.<T>. No
family decoded it, so a kernel that calls it (a real OpenCL workload's
image-scaling kernel, air.mad.f32 in AIR 2.8) was refused as
UnknownIntrinsic. OpenCL C leaves how mad rounds its product to the
implementation. The M3 Max's GPU rounds the product and then the sum.
- Decode: MathFn::Mad, which Math::parse reads from air.mad.<T> for the
three types the compiler was measured to spell (MAD_TYPES: f32, v4f32,
f16), each T (T, T, T), always Precision::Precise. Every other type
(v2f32, v3f32, v8f32, v4f16, bf16, i32) and spelling (fast_mad,
native_mad, a sign token) stays undecoded, as the planner ruled. mad is
not a TABLE stem, so Math::float_stems (Metal's own functions) is
unchanged.
- Lowering, the planner's option (2): canon::routine, which already
rewrites the frexp and ilogb routine calls into plain AIR after SCCP,
now replaces each mad call with an fmul of a and b followed by an fadd
of that product and c. Both carry no fast-math flags, whatever the
call's own flags are. Lowering then gives them exactly what an
unflagged fmul and fadd get: NoContraction on each, the profile's half
form, and no new note. air_math's invariant arm (Frexp, Ilogb) now
takes Mad too.
- Which form is smaller: the canonicalization. The families rows need a
DeclClass::Air, so MathFn::Mad cannot be avoided, but the rewrite
reuses the routine pass's expander, about 40 lines. A lowering of its
own would need a new FloatFn and its half forms.
Evidence, with its caveat as it is:
- Spellings come from Metal's OpenCL mode (newLibraryWithSource with
sourceLanguage 1, macOS 27.0.1, AIR 2.9), over our own kernels on the
M3 (job m3-max-80752).
- Answers come through the OpenCL framework on the M3 Max's GPU (job
m3-max-80759), not through a Metal pipeline of OpenCL mode:
- float, at a = b = 1 + 2^-12 and c = -(1 + 2^-11): mad answers 0,
fma 2^-24, and a*b+c 2^-24;
- float4: each lane of mad answers 0;
- half, at a = b = 1 + 2^-6 and c = -(1 + 2^-5): mad answers 0 and
fma 2^-12.
Tests:
- families_tests OBSERVED rows (previous commit, red).
- intrinsics::tests::opencl_mad_decodes_in_its_measured_types_alone.
- engine_arith::opencl_mad_is_its_multiply_and_its_addition, over our
own .ll on the three profiles:
- each mad kernel's linked SPIR-V has the same opcodes as its twin
written as an unflagged fmul and fadd, with the same notes;
- the float and float4 kernels have OpFMul and OpFAdd, each
NoContraction, and no Fma;
- the interpreter answers 0 on the probe's inputs.
- runtime opencl_data::opencl_mode_mad_rounds_its_product_and_its_sum, a
kernel of OpenCL mode: +0 on the float, on each float4 lane and on the
half, under a device cfg.
Public surface: MathFn gains Mad (api_signatures.tsv blessed), so an
exhaustive match over MathFn in a consumer breaks. docs/REFUSALS.md was
regenerated and is unchanged. docs/API.md lists mad beside the OpenCL C
native_ and half_ functions.
SEMANTICS_VERSION 2323 -> 2324: a module that calls air.mad translated to
a refusal before and translates now. The authoring classification follows
on its own, since its key fingerprints the product's sources
(ANALYZER_ABI), so no census version needs a bump.
|
||
|
|
0c12c606fa |
Translator: the address form's indexed patches name their cause
The last cause-less Feature::Tessellation refusal of the translator, the
address form's in pipeline/link/tessellation control_plan
("addressed && !fits"), now names TessellationCause::IndexedPatchFactors:
a control-point index type beside a per-instance factor step or a factor
scale where pointers are device addresses used directly, where the
control-point indices' address takes the control stage's push words that
hold the factors' instance stride and scale (control::address_fits).
Every Feature::Tessellation NotImplemented refusal now carries a cause:
the translator's through Unsupported::tessellation, the AIR front end's
through its conversion.
Tests: the link test of the commit before this one (each such pair on
every committed profile of the identity domains); the engine test of the
address form's stepped and scaled descriptors asserts the cause too.
api_signatures blessed (the variant), REFUSALS.md regenerated (the
control_plan site moves under error/mod.rs's Unsupported::tessellation).
runtime-sources.sha256 unchanged: neither file is a runtime input.
|
||
|
|
530fb4ea4c |
Validation: the runtime route refuses no patch draw through index buffers, which no case makes
The engine candidate's runtime route required a patch draw to name no patch or control-point index buffer, and refused one that did as executor_not_implemented. No case reaches that refusal: the case mapping (graphics::patch_draw) names neither buffer for every patch draw, the case schema has no field for them, and the AIR states nothing about a draw's index buffers. The conformance suite's tessellation-patch-indices case compares drawIndexedPatches and patch index buffers against Metal. The route now takes every patch draw, its refusal message and VALIDATION.md's sentence drop the clause, and the routing test drops its patch draw through a patch index buffer. The runtime platform's draw keeps its own check of the translator's DrawCall fields, which fails a draw that names an index buffer visibly. |
||
|
|
7dff42d6a5 |
command-replay: SIGTERM stops the play at its next frame end
A watchdog's SIGTERM killed a play inside a frame; on a 3090, plays killed mid-frame were followed by a wedged card (11-23), which is why a play on an NVIDIA card ends at an --until-frame. The player now takes a stop flag (Player::stopping_on): once it is set, the play stops after the frame then playing ends, as at --until-frame, and command-replay tears the device down as at any end. The SIGTERM handler writes its progress line and sets the flag instead of re-raising; after the stop the play writes `progress stopped after SIGTERM: frame N of M ended last at T s`, no judged metric, the report verdict `stopped SIGTERM after frame N, short of its range` and exit status 1. A frame that never ends (a call that never returns) is left to the caller's kill (timeout -k). Not yet built: a lavapipe job plays one stream under a forced 150 s watchdog with the player before this commit (red: killed inside a frame) and with it (green: ends at a frame). |
||
|
|
ac99c98778 |
Replay player: drawPatches from an indirect buffer, and drawIndexedPatches direct and indirect
The player refused three of Metal's four patch draws as not played on a render encoder, so a stream whose program draws patches through an indirect buffer or a control-point index buffer lost those draws. Each now plays as the runtime's call (draw_patches_indirect, draw_indexed_patches, draw_indexed_patches_indirect), beside drawPatches, through one helper the four share: a nil patch index buffer is none, a draw naming a skipped buffer (patch index, control-point index or indirect) is a skipped draw, a draw skipped by its state or a bound object is counted as before, and a draw through a state whose record lacks the tessellation key is counted. REPLAY-STREAM.md names the patch draws among what render encoders play. |
||
|
|
ce337e89a7 |
Docs: the overlap refusal's basis cites the Mac readings; a DontCare store is a known gap
Refusal::BufferCopyOverlap's Basis line kept "ours" with no reading of Metal behind it. It now cites the two: on an Apple M3 Max, macOS 27.0.1, arm64 and x86_64 under Rosetta (job m3-max-80419), and on a Radeon Pro 5300M, macOS 26.7.1 (job m3-max-80501), every overlapping copy equals memmove's, forward and backward, Shared and Private, 64 bytes to 16 MiB, five runs each; on that Mac's UHD Graphics 630 a forward overlap of 64 KiB and up differs from memmove's in each of five runs, at the same first byte and the same count of bytes. Metal's validation layer was on in both and stopped none. The kind stays "ours": the readings show plain Metal takes the copy, which the refusal-surface script calls metal-takes, and the runtime's RefusalBasis has no variant for it, so naming it is a public type change, not this docs commit. REFUSALS.md regenerated. The runtime README's render encoder gaps gain the DontCare store: it stores, because Vulkan fixes a rendering's store operation as it begins and a pass may become several renderings for commands met after it begins, so a tile-based GPU writes back attachments Metal lets a program discard; not measured on a tile-based phone GPU, no such device in the lab. The counts are from the store census over two replay streams (jobs m3-max-80663, m3-max-80681 and m3-max-80720, the last the one the README quotes, after the census also followed descriptors made by renderPassDescriptor): 6,401 of 80,906 passes over 1,115 frames (5.74 a frame, 7.9%) and 4,886 of 73,212 over 1,036 frames (4.72 a frame, 6.7%), each such pass storing one colour attachment and not caring about a second or its stencil attachment. Docs only: a doc comment, the generated REFUSALS.md and the README. refusal_surface.py --check passes. |
||
|
|
dec74d9cf7 |
Translator: a tessellation refusal names the structure it met
Feature::Tessellation with Needs::NotImplemented covered fourteen refusal
sites behind one name, so a walk's log line ("the translator refused the
feature Tessellation, needing NotImplemented", cause None) could not say
which without the AIR. A tessellation refusal now carries
Cause::Tessellation(TessellationCause), one variant per structure the
sites refuse, the way an access refusal names its AccessCause; sites that
refuse the same structure share a variant, none is named by a file, a line
or a string of its own:
- PatchStep: a layout stepping per patch or per patch control point read
by a vertex function that is not post-tessellation (metal/vertex.rs
fetch_as, fixed-function input; lower/stage_io/fetch.rs, the pulled
fetch).
- PatchInterface: a patch input or a patch builtin in a function that is
not post-tessellation (lower/stage_io/plan.rs, two arms).
- UncountedPatch: [[patch(kind)]] with no count, or a count of 0 whose
control points are read (lower/tessellation plan_entry and select).
- InstanceStepRate, AttributeStep: a patch attribute per instance at a
rate above 1; a step the attribute's input has no element for.
- Builtin, VertexInput, SimdGroup: another builtin, a vertex input, or
SIMD-group semantics in a post-tessellation vertex function.
- ControlPointInput: the AIR front end's Tessellation, which is that one
structure (its two arms in canon post_check); the conversion from the
front end's refusal names it, so the front end's types are unchanged.
lower/tessellation's not_implemented() helper takes the cause, so the
compiler makes each of its sites name one; thirteen of the fourteen arms
name a cause. The fourteenth, the control-point index type
on the address form (pipeline/link/tessellation control_plan) is left as
it is: the drawIndexedPatches change removes that arm.
Feature stays Tessellation, so validation's outcome key (feature_key, the
Debug of the feature) and the census are unchanged; nothing stores the
cause (as for the access cause). No version bump.
Tests: the error module's Display test of a tessellation refusal and of
the front end's conversion; the cause asserted at the fixed-function and
pulled patch-step refusals (metal/vertex.rs, engine_vertex_fetch), the
uncounted patch (reflection), post-tessellation SIMD-group functions, and
a new test of a control-point layout stepping per patch, a patch layout
stepping per vertex (AttributeStep) and per instance at 2
(InstanceStepRate). The commit before this one adds those tests against
the cause-less sites.
runtime-sources.sha256 rewritten: metal/vertex.rs's refusal names its
cause, and no run behaves otherwise. api_signatures blessed
(TessellationCause, Cause::Tessellation), api_surface lists the enum,
REFUSALS.md regenerated (the sites are built through error/mod.rs's
Unsupported::tessellation), docs/API.md's error table names the cause.
Consumer uses (consumer-uses.sh, read-only, over the consumer's
development 33784022f1 and its lane tips of the last day):
Feature::Tessellation and TessellationCause, 0 hits.
|
||
|
|
c50fd04219 |
rt: drawIndexedPatches, and patch draws through a patch index buffer
The runtime refused a patch draw through a patch index buffer
(Gap::Draw of DrawKind::PatchIndexBuffer) and had no indexed patch draw.
The viewer draws every patch with drawIndexedPatches, indirectly, through
a nil patch index buffer and a UInt32 control-point index buffer (reims's
walk at development
|
||
|
|
082248f947 |
Translator: the address form reads patch and control-point indices through their pushed addresses; a fragment's primitive id is the patch's position
Under the identity domains (the runtime's), a post-tessellation function's control stage reads its factors through their pushed address and binds no buffer. It had no way to read a patch index buffer or a control-point index buffer, so it took each patch's index from its position and refused a control-point index type (NotImplemented(Tessellation)). The viewer's two pipelines are UInt32 control-point indices drawn by drawIndexedPatches, and both were refused. The control stage's push range now holds, at its offset: - 0: the factors' address (u64), as before; - 8: under a control-point index type, the control-point index buffer's address plus its offset (PushField::ControlPointIndexAddress, u64); otherwise the per-instance step's stride at 8 and the scale at 12, as before; - 16: the patch index buffer's address plus its offset (PushField::PatchIndexAddress, u64), 0 for a draw without one. 24 bytes in all, below the post-tessellation function's window (push::TESSELLATION_BASE). A control-point index type beside a per-instance factor step or an enabled factor scale has no room for both, and stays NotImplemented(Tessellation) (control::address_fits); the runtime refuses those two at state creation anyway. What the stage reads, from the Apple M3 Max's tables (jobs m3-max-80366 and m3-max-80398): - the patch at position p (patchStart plus its place in the draw) reads its factors at p, whatever its patch index; - its [[patch_id]] is the uint at index p of the patch index buffer where the pushed address is not 0, else p; - control point j of patch pid is the vertex the index at pid * N + j of the control-point index buffer names (a ushort read out of its aligned word for UInt16, a uint for UInt32), else pid * N + j. Each read goes through the address unchecked, as the factor reads do. No check form is added. A fragment function's [[primitive_id]] behind the stage is the patch's position, with a patch index buffer or without (the same tables): the control stage writes p to a flat varying at PATCH_POSITION_LOCATION (3), which the evaluation stage hands on, and the control point varying moves to location 4. Before, the varying carried the patch index, which equals the position only without a patch index buffer. The cache codec carries the two new push fields: ARTIFACT_FORMAT_VERSION 601. Translation output changes for every post-tessellation pipeline under the identity domains: SEMANTICS_VERSION 2323 (2322 is split-store's). Tests: control/tests.rs runs the address form's patch index and control points on the SPIR-V interpreter (both index types, a nonzero and a zero patch index address) and checks the pushed fields of each form; engine_tessellation compiles the stream's state under UInt16 and UInt32 on every committed profile with the identity domains, with the fields at 0, 8 and 16, and refuses UInt32 beside a per-instance step or a scale; lower::push checks the range fits below the window for every step, scale and index type the form takes. |
||
|
|
a3fb852de3 |
rt: a heap makes texture buffers in place in its bytes
Metal's heap makes a texture buffer (MTLTextureTypeTextureBuffer): heapTextureSizeAndAlign answers its texels' bytes at an alignment of 16, and newTextureWithDescriptor:offset: lays the texels linearly in place at the offset (m3-max-80369, m3-max-80398). rt refused both with Refusal::TextureBufferNotOverBuffer. Now: - Device::heap_texture_size_and_align of a texture buffer answers width x texel bytes, unrounded, at 16, or at the device's texel-buffer offset alignment for the format where that is larger (minimum_texture_buffer_alignment). No Vulkan call. - Device::new_heap_texture and new_heap_texture_for_views of a texture buffer place a buffer of those bytes at the offset as new_heap_buffer places one, and make the texture buffer over it as Buffer::new_texture makes one, through the same texel_texture: one buffer view, one form on every device, no query. It takes the heap buffer's heap id and placement, so its uses are the heap's in the hazard sets and its writes mark the heap's aliasing textures stale. - Its backing is TextureBacking::Texture, as Metal answers its buffer with nil. - A placement past the heap or off the alignment is Refusal::HeapTexturePlace. A heap in an exported block makes one too: a buffer view needs no image. - texel_texture's descriptor checks move to texel_shape and texel_width, shared with the size answer. TextureBufferNotOverBuffer stays for new_texture, new_texture_for_views, new_managed_texture and new_drawable_texture. The test also checks HeapTexturePlace at offset 8 and past the heap's end. Docs: the runtime's README (textures, heaps, exported blocks), docs/API.md's heap-size accepted difference, the refusals' docs; docs/REFUSALS.md regenerated. Conformance ledger (docs/CONFORMANCE-COVERAGE.md regenerated): - 22 rows of a one-level RGBA8Unorm, R8Unorm or RGBA16Float texture buffer's heap size in the texture-pairs cases are dropped: the replay now matches them; - 6 rows of a texture buffer of 2 or 7 levels now record Refusal::TextureLevelCount, as Buffer::new_texture refuses it, where Metal's heap answers one level's footprint; - 11 rows of RGBA16Float_XR, YCBCR8_420_2P, Unspecialized and BGRA4Unorm texture buffers' heap sizes now record Gap::TextureFormat; - the device's newTextureWithDescriptor: rows keep TextureBufferNotOverBuffer, their reason naming the heap as the other way to make one. Verified (the change at 6d5f748347 on |
||
|
|
2e5503c0f7 |
Translator: a store moves into the ways of a branch only under a key that orders nothing
The sink (lower::access::quad::sink) ran on the specialized entry, before lockstep's order, on every profile. Lockstep pairs only accesses that reach each other on one path, so a store moved into each way of a branch whose lanes diverge lost its pairs with the other way's accesses: under a key that orders lanes (the resident-table domains), a pair the program has, which lockstep would have ordered, went unordered. The sink now runs on the ordered entry, and only under a key that orders nothing (OrderKey::orders_nothing, the identity domains, which order no pair and so lose none); under a key that orders, the store stays in its block. Under the identity domains the same stores move; the order, which inserts nothing there, now finds the pairs behind its SimdgroupAccessOrder note in the program as written. engine_store_quad's descriptor-profile test now asks for sst_split's seven word stores there. Verified: the test fails before this change, on moltenvk-m3 with seven stores where six are expected (filtered, 3 tests), and passes after (filtered, 47 tests), with clippy clean (m3-max-80575). Under the identity domains the change moves the same stores: the row_tail module is byte-identical before and after it on the committed rtx50, lavapipe, 780M and Iris Xe profiles (m3-max-80635). At the branch's last commit: clippy in all three configurations, rustdoc, the runtime's suite on lavapipe (942 passed, 4 skipped), the translator's (3412 passed, 37 skipped, the tables a bless is due for left out), validation's (1319 passed, 3 skipped) and conformance's (1047 passed) (m3-max-80665). |
||
|
|
8e2fc13cfe |
Translator: four word stores of one block at consecutive words are one 16-byte store where aligned
A row of floats written four at a time from a float4, with its tail guarded, stores the first float in one block and the other three in the block its branch takes when the row holds them. Each store was its own word store. Now the specialized entry moves such a block's last store into both successors of its branch, where one of them opens with the three stores after it (`lower::access::quad::sink`). Selection then finds, in one block, four plain word stores at byte offsets k, k+4, k+8 and k+12 from one base with nothing between them that touches memory, all reaching one slot (`quad::plan`). The last of them emits the four; the others emit nothing. At emit each invocation tests the first word's offset: where it is a multiple of 16 and the 16 bytes pass the slot's containment check, the four words are one uvec4 store (through the slot's uvec4 view where the kernel binds its buffers, at the device address with Aligned 16 elsewhere); otherwise the four word stores run as selected, each checked by itself. At a device address the 16 bytes are checked in the shader, so a store that straddles the buffer's end keeps every in-range byte. One form on every device: the memory decides only where the store goes, as for every other access. Under the descriptor profiles, where lockstep orders lanes, a barrier it puts between the stores keeps them words. engine_word_phases's alignment test now allows the two tested 16-byte stores of vwp_words's two runs of four word stores. SEMANTICS_VERSION 2322 (development holds 2321): the SPIR-V of such kernels changed. Verified: engine_store_quad, engine_word_phases and the access tests pass on the interpreter in both forms at bind offsets 0, 4, 8 and 12 (m3-max-80331, m3-max-80352); clippy in all three configurations, rustdoc, the runtime's suite on lavapipe (937 passed, 3 skipped) and the translator's (3404 passed, 37 skipped, the tables a bless is due for left out) at the change (m3-max-80386). Timed with the harness's row_tail workloads, the harness commit against this change, the arms alternated in one job per card; GPU time, the median of the rounds' medians: - NVIDIA GeForce RTX 3090 (m3-max-80449, 4 rounds): the Shared rows fell from 46.3 to 2.12 ms (224 floats a row), from 52.4 to 3.29 ms (49) and from 24.8 to 19.4 ms (27,730, bimodal in both arms); the Private rows took 0.2 to 0.4% longer. - AMD Radeon RX 7900 XTX (m3-max-80450, 4 rounds): every row within 1.1% of the base. - AMD Radeon 780M (m3-max-80482, 8 rounds): the times fall in two clock states, the change's runs in the slower one in 5 of 8 rounds and the base's in 2 to 4; within a state the change takes 0.973 to 1.014 of the base's time. Not run on an Intel card. Those jobs ran an earlier build of this change on an older development; its row_tail module equals the one at this branch's last commit byte for byte on the committed rtx50, lavapipe, 780M and Iris Xe profiles (m3-max-80707, m3-max-80705). |
||
|
|
f1689ad668 |
conformance: a ledger row lists each answer its venue's hosts give, where they part by what the venue does not state
The CI's ubuntu leg at
|
||
|
|
511f31b0ba |
Translator: an index past an array field's array sends its private-arena access to the sink, not onto the last element
|
||
|
|
e93d7e6b1b |
Docs: a fragment's primitive id behind tessellation is the patch's position without a patch index buffer
The evaluation stage's varying carries Metal's patch index, which is the patch's position in its draw only where no patch index buffer is bound. With one, Metal's [[primitive_id]] stays the patch's position while its patch index is the buffer's entry (an Apple M3 Max, job m3-max-80366), so the docs now say which draws the varying's value is Metal's for, and that the runtime records no patch draw through a patch index buffer (DrawKind::PatchIndexBuffer stays refused). The translator module docs, lower_inputs, the tessellation link module, docs/API.md and the runtime README say so; no code changes. Doc lines past 100 columns in stage_io/plan.rs, lower_inputs.rs, the tessellation link module and the engine_device_arena and engine_draw_bases tests are rewrapped, and the patch test's println is shortened under the limit. |
||
|
|
5689683788 |
Translator: a fragment function's primitive id behind a post-tessellation function is the patch's position
Behind an evaluation stage, Metal's [[primitive_id]] is the patch's position in its draw, patch start included, the same in every instance and for every triangle the tessellator makes of the patch (an Apple M3 Max, job m3-max-80266: draws of two patches from patch 0 over two instances read 0 and 1 in both instances; two patches from patch 2 read 2 and 3). Vulkan's PrimitiveId there counts the draw's patches from 0 and restarts in each instance (the specification's PrimitiveId: "The index of the first primitive generated by a drawing command is zero ... reset to zero between each instance drawn ... In a fragment shader, it will contain ... the value that would have been presented as input to the geometry shader had it been present"), so it differs once patchStart is not 0. The translator refused such a pipeline at link, NotImplemented(Tessellation), which a walk's pipeline met behind its post-tessellation [[base_instance]]. The fragment function now reads it through the primitive ID's flat varying (IoRole::PrimitiveId), on every device, one form: a post-tessellation vertex function compiled under LoweringInputs::primitive_id_varying writes Metal's patch index, its patch input at PATCH_INDEX_LOCATION, to that varying at each return (stage_io::PrimitiveIdStore::Patch). Without a patch index buffer the patch index is the patch's position; the runtime draws no patches through one (DrawKind::PatchIndexBuffer stays refused), and the docs state the value for draws without one. The same value reaches every vertex of the patch, so the provoking vertex does not matter. Device::compile_render_pipeline and the render keys decide the varying for a post-tessellation vertex stage as they do on a device without a fragment PrimitiveId; the library answers that without decoding the function (a metallib function's TESS tag, a module entry's air.patch), and a compiled stage from its interface. Link refuses a fragment function compiled to read Vulkan's PrimitiveId behind an evaluation stage as NeedsInput(PrimitiveId), where it refused every such fragment as NotImplemented(Tessellation); docs/REFUSALS.md is regenerated. The varying takes a location as any other: the evaluation stage's outputs are held to maxTessellationEvaluationOutputComponents when it is planned, and link numbers the fragment's inputs below maxFragmentInputComponents / 4, each a typed InterfaceComponents limit refusal past it. Tests: a_fragment_primitive_id_behind_tessellation_is_the_patch_index_varying (MoltenVK's and RADV's profiles: the evaluation stage reads the patch-index input, the fragment stage one flat input and no PrimitiveId, L3), the link test of a fragment that reads Vulkan's PrimitiveId, and the runtime test every_device_reads_a_patch_s_position_as_its_fragments_primitive_id, green on lavapipe (llvmpipe), job m3-max-80338. |
||
|
|
a992aa6929 |
Translator: a GEP into an array field of a thread variable stays inside its array
A thread struct that holds pointers or heap handles beside an array field indexed at run time was open to pointer forwarding: provenance made the offset of any run-time index unknown, so the data access could overlap a pointer slot. A heap handle stored into such a struct then fell to the handle family's catch-all, Lowering(Access). That is the refusal of a post-tessellation vertex function a walk met (two render pipeline states refused). The Metal Shading Language leaves an index past an array undefined. So a thread-space getelementptr whose first index is a constant, each of whose run-time indices steps over an array its own type path names, and whose every use is a load or store address, is a GEP into an array field (provenance::array_geps). Over a base whose roots are stack allocations at constant offsets, its offsets are its displacement plus at most (len - 1) * stride per run-time index. These keep unknown offsets: a flattened offset (a run-time pointer index), a run-time vector lane, an address another GEP offsets or that is merged or stored, a base that may be null, and memory outside the thread space. A run-time index at a struct level has no IR form. Lowering holds every run to the bound. In the private arena, where objects lie side by side, such a GEP takes each run-time index as min(index, len - 1) (access.private.gep.array). A typed object's access already never leaves its levels. docs/API.md records the accepted difference: an index past the end of an array field of a local struct does not reach its neighbouring fields; it is undefined in MSL. The struct then closes as a forwarding cell, and its heap-handle stores that no load reads take the cell's unread store (the previous commit). Verified: - red: m3-max-80079, b9d9dfc9ba (parked_heap_handles refused at its handle store, block 0 instruction 11). - green: gate m3-max-80143 at the same tree on a scratch branch (lavapipe tests 47 passed; validation 1315 passed, 3 skipped; conformance 1047 passed; the translator suite's only failures are the tables development re-blesses: the engine inventory with four new parked_heap_handles rows, the golden printout, and 315 golden hash cells under SEMANTICS_VERSION 2319). - L0: a_gep_into_an_array_field_is_bounded_to_the_array (the bound, and each disqualifying shape staying unknown). - read-back, whole-struct copy (a memcpy) and a stepped address stay Lowering(Access). - the walk's two metallibs on the XTX node (m3-max-80156): the handle store's refusal is gone; the vertex function next met the two refusals the following commits remove. Cost: one UMin per run-time index into a private-arena array, the bound itself. The device-arena budget test's word bounds move by one each (13 for a word load, 12 for a word store, 24 for a float4 load). SEMANTICS_VERSION 2320 (development holds 2319). |
||
|
|
4fe41c795d |
rt: a blit copy with a texture buffer on either side copies its buffer's bytes
Metal makes copyFromTexture:...toTexture: with a texture buffer as the source or the destination.
copy_from_texture refused it as Gap::TextureCopy ("A texture buffer's texels are its buffer's
bytes, which no image copy reaches"). Under the rule that a refusal of what Metal makes is built,
it now copies a texture buffer's texels as the bytes of its buffer (texel_texture_copy):
- Checked as Metal checks any copy: one pixel format and one sample count
(Refusal::TextureCopyMismatch), and each region inside its texture's level and slice (`place`,
Refusal::TextureRegion), sizes of 0 taken as copy_from_texture takes them.
- Between two texture buffers: the region's bytes copied between their buffers by
copy_from_buffer_to_buffer, from each one's offset plus origin.x texels. The same bytes copy
nothing, as the same region of one image does, and bytes that meet are
Refusal::BufferCopyOverlap, as that call refuses them.
- Between a texture buffer and another texture: copy_from_buffer into the texture from the texture
buffer's row in its buffer, or copy_from_texture_to_buffer out of it into that row. That is one
vkCmdCopyBufferToImage or vkCmdCopyImageToBuffer region, checked and ordered as those calls are.
The command buffer keeps both textures. Gap::TextureCopy's doc drops the texture buffer case, and
docs/REFUSALS.md is regenerated. Buffer::new_texture's doc, copy_from_texture's doc and the runtime
README's texture buffer contract say what such a copy does. The texture buffer refusal test no
longer expects the gap from a copy of one into itself; that copy of the same bytes now copies
nothing.
|
||
|
|
c55fd4603c |
Validation: a video picture landed is the surface's mark of the other API's writes, not an acquire
The play calls Surface::external_writes_done once a picture lands on a video surface's pages. That call records no acquire: each submission part that uses the planes acquires and releases them itself, and the call marks the other API's writes on the host side. videos.rs' module doc already said so, but its counter and report line still named the call an acquire, as did docs/REPLAY-STREAM.md (the `m2v.externalWriteDone` row in section 4, and the video surface paragraph and its counters in section 10) and the replay test's doc. The executed counter video_surface_acquires is now video_surface_writes_done, and the report's `video surfaces` line says "N writes marked done" for "N acquires". Its one reader in the tree is rt_replay.rs' a_video_surface_is_waited_for_at_its_ready_point_once, updated; no script in the tree names it (grep for surface_acquires over *.rs, *.md, *.py and *.sh). The count is unchanged: one a picture landed in a surface. Wording and naming only; no behaviour changes. |
||
|
|
772441372c |
rt: a blit between a buffer and a texture buffer copies the region's bytes between the two buffers
A guest's 3D model window stayed blank: it fills an RGBA8Unorm texture buffer placed in a heap by
copyFromBuffer:...toTexture:, which BlitCommandEncoder::buffer_copy refused as Gap::TextureBytes
("A texture buffer's texels are its buffer's bytes, which no image copy reaches"). A texture
buffer has no image: its texels are its buffer's bytes from its offset. So a copy between it and a
buffer, in either direction (copy_from_buffer into it, copy_from_texture_to_buffer out of it), is
now checked as any texture's copy is, by the same checker (`buffer_copy`: the region inside its one
row, level 0 and slice 0, Refusal::TextureRegion past it; Metal's measured layout rules,
Refusal::BufferCopyLayout), and then the region's bytes (origin.x and width in texels times the
texel's bytes, at the texture buffer's offset) are copied between the two buffers by
copy_from_buffer_to_buffer. That path keeps both buffers, takes the Managed copies and the heap
places, and orders the copy as any copy between buffers. A texture buffer's uses take its buffer's
id in the hazard sets, so a later kernel's read is ordered after it. The command buffer also keeps
the texture. Two parts of the generic check don't apply: an image's rows or memory meeting the
region (it has none), and a copy command's offset alignment (vkCmdCopyBuffer takes any). The check
runs without them. Bytes of the texture buffer that meet the other buffer's region are
Refusal::BufferCopyOverlap, as copy_from_buffer_to_buffer refuses them.
Gap::TextureBytes's doc drops the texture buffer case and its basis line ("nor a texture buffer's
copy as a buffer copy; no recorded stream copies a texture buffer"), and docs/REFUSALS.md is
regenerated. Buffer::new_texture's doc, copy_from_buffer's and copy_from_texture_to_buffer's docs
and the runtime README's texture buffer contract now say what a blit with a buffer does. The
texture buffer refusal test no longer expects the gap from copy_from_buffer_with_options. A copy
between a texture buffer and a texture (Gap::TextureCopy) is left as it is.
|