ca796ca5ff7c8e87cbcb960681ffd96e2ce96d2f
193
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
47fec71d2a |
Validation player: command-replay refuses an option given twice, and section 10 lists every option
options() now refuses an option a command line gives twice, "--NAME is
given twice", before anything runs: exit status 2 and the usage
printed, as for an option the subcommand does not take. Before, the
second value replaced the first in the map with nothing said, so a
script that spliced options after its own (`--until-frame X
${PLAY_ARGS}`) played the splice's value unnoticed. The module doc and
with_options' doc say so.
docs/REPLAY-STREAM.md section 10 named the options each subcommand
takes only in part, though it said each takes "the options its usage
names". Its play synopsis now lists all twenty, adding --state-log,
--state-threads, --state-keys, --state-digests, --prepass-width and
--dump-command-buffers with --dump-dir. A paragraph after the
states-only one now says what the state options and --prepass-width do,
from the module doc. dump and shapes show [--blobs DIR]. The rule now
reads: each option once, none it does not take.
Callers audited at development 039f7a9350 for an option given twice
(the 9db78abe7d audit of unknown options covered the same callers): the
orchestration's round script and its leg scripts, every orchestration
job script that runs the player, the scripts of every carry repository
at its HEAD (104 invocations in all), the consumer's tree (no caller),
CI, CONTRIBUTING.md and the docs (none runs the player), and the
in-tree tests. No invocation names an option twice. Where options are
spliced from the environment, the values on record don't repeat an
option either: PLAY_ARGS (--check-presents), PLAYARGS (empty or
--managed two-copy) and UNTIL (becomes --until-frame, in scripts that
do not pass --until-frame themselves). Three splices have no recorded
value and stay unaudited: FS_PLAY_ARGS, EXTRA and PARGS.
Verified: the red commit's every_subcommand_refuses_an_option_given_twice
fails at its parent (lavapipe-free run, job m3-max-86867: 1 passed, 1
failed). The jobs for this commit are named in the lane's report.
|
||
|
|
ed55748644 |
Docs: the runtime README, API.md, REPLAY-STREAM.md and VALIDATION.md state each measurement by its card and driver, not by our job id
The planner widened the job-id rule from the published crates' rustdoc to the four prose docs a
reader takes measurements from. Each lab job id (m3-max-NNNN, and the bare job numbers beside
them) and each commit sha comes out; the ids stay in the commit messages that already carry them.
A measurement keeps the card, driver and OS its sentence names. Where an id was the only basis a
sentence named, the sentence now says what was measured and on what:
- the runtime README's identity-domains paragraph cited five plays of recorded streams; it now
states what the states-only plays of the 26 kept replay streams on lavapipe show: each makes
every pipeline state its stream makes, and none of their render or compute states is refused,
a refusal under the identity domains among them (the plays of jobs m3-max-83458, -83494, -83695,
-83889 and -83954, each printing refused 0);
- the probe lists name the cards ("probes on the RTX 3090, the Iris Xe, lavapipe and the RX 7900
XTX"; "probes on a Radeon Pro 5300M and a UHD Graphics 630, both macOS 26.7.1");
- sentences that compared runs by id compare them by order ("failed in one run and passed in two
others"), and "the same job" is "the same run";
- "rt at <sha>" and "players built from <sha>" become what that build was ("a build of the runtime
that copied a texture over any import"), or go where the card and driver already say it;
- VALIDATION.md's harness count reads "the harness on lavapipe".
Two README tables lose their Job column (the import-cost table and the guest-buffers table). The
edited paragraphs are rewrapped at 100 columns; a token diff against the parent shows only the
ids, the shas, the two columns and the rewordings above.
submit.rs's three citations of two probe commits (06860a3848 and b15b306d2f) become "measured
with a probe build of the runtime" (and, for the split probe, "that timed each command buffer");
the IN_FLIGHT and infos comments are rewrapped at 100 columns.
So it does not grow back, scripts/api-docs first fails when the four docs name a job id
(`m3-max-NNNN`, or `job NNNN`); CONTRIBUTING.md, API.md's description of the script and ci.yml's
comment on its step say so.
docs/CONFORMANCE-COVERAGE.md is unchanged: its generator has no job column. Its 1772 lines with an
id are all in its last section, The ledger, which quotes the last field of known-gaps-rt.tsv; the
ids are in the ledger's own sentences, which the ruling keeps out.
Not widened, per the ruling: the ledger, known-gaps-rt.tsv, results.py, test comments and the
unpublished crates. The OS is not added to measurements whose sentence named a card and driver
but no OS.
Verified on the CPU with no device, job m3-max-84430 at this commit's tree: cargo fmt --check 0;
the workspace's rustdoc with -D warnings 0; scripts/api-docs 0, and 1 with a job id planted in
docs/VALIDATION.md, naming the planted line (the tree clean after its restore); the refusal
surface's --check 0; the 13 tests that read these docs passed (feature_enables, the floor, the
accepted differences, the precision-note catalogue, the consumer's objects and the guide's
example). Before the commit, no line of the four docs matched the check's pattern, and rustfmt
--check passed on submit.rs.
|
||
|
|
62e9d045c3 |
Validation player: command-replay refuses an option a subcommand does not take
Each subcommand names the options it takes beside its required ones, and options() refuses any other with "--NAME is not an option of SUBCOMMAND" before anything runs: exit status 2, the usage printed, as for any bad command line. Before, an unknown --name VALUE pair went into the map and was never read, so a mistyped or retired option played as if absent. The sets are what each subcommand reads: play its four required options and blobs, managed, until-frame, past-range, states-only, state-log, state-threads, state-keys, state-digests, gpu-wait-timeout (the wait module's flag), video-handle, check-presents, read-device-copies, prepass-width, dump-command-buffers and dump-dir; dump and shapes --stream and --blobs (their stream reader reads it; the usage and the module doc now show it); compare-dumps --a and --b; compare-plays --a, --b and --frame; snippet video-surfaces --out and --handle. The module doc and docs/REPLAY-STREAM.md section 10 say so. The audit in the red commit's message found no caller passing an option outside these sets except --probe-dump in two lab probe scripts of one carry, which no commit here ever read. Verified by the job named in the lane's report: the red test at the parent and green here, clippy x3, rustdoc, the validation suite. |
||
|
|
5f1686fb55 |
Validation: a texture over a heap buffer is covered where its buffer is
The cover rule held a buffer's cover on the buffer alone, so a texture made over a covered heap buffer read as uncovered: its check was compared and its dump carried no cover, and compare-dumps could report as a difference the bytes Metal leaves undefined once a heap texture's write aliased them. Covers::covered now maps an object to the one whose bytes it holds (a view to its texture, a texture over a buffer to that buffer), the same mapping the rule already used to decide whether a texture's write is tracked. The rule also takes the player's own list of the selectors that make a texture over a buffer (makes_texture_over_buffer), which adds the tiled form (newTiledTextureWithDescriptor:offset:bytesPerRow:) the rule had missed. docs/REPLAY-STREAM.md and dumps.rs say a texture's cover follows its buffer's. Verified by the test the previous commit added (red there, green here); the jobs are in the lane's report. |
||
|
|
1c68dd10f4 |
Texture buffers: a read-write one is words where its format's own view reads none without a format
A texture buffer's form (rule 2's texture buffer formats, metal::format::texel_buffer_form) asked three accesses of a format's own view: a uniform texel buffer, a storage texel buffer, and a storage texel buffer written without a format. A function that reads a texture buffer through access::read_write reads its storage element without a format, which Vulkan asks of the view's format (VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT, VUID-vkCmdDispatch-OpTypeImage-07030), so on a device whose own view of a format lacks that bit the runtime refused the draw or dispatch (Gap::StorageElement, ReadWithoutFormat). ANV on the Iris Xe (RPL-P) lacks it for BGRA8Unorm, B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm (jobs m3-max-81883, m3-max-82116); its committed profile (intel-irisxe-rplp-anv) answers the same for RG11B10Float, RGB10A2Unorm and RGB10A2Uint, and so do intel-irisxe-anv and intel-uhd770-rpls-anv for all seven (job m3-max-82025). Holding those formats as words for every texture buffer would cost one made to be read 31.6% and 31.7% on that Iris (texel_buffer_bgra8_read and texel_buffer_b5g6r5_read, job m3-max-82136). The form now asks a fourth access, the storage read without a format, only of a texture buffer whose usage, fixed at its making, holds both MTLTextureUsageShaderRead and MTLTextureUsageShaderWrite, or is MTLTextureUsageUnknown (metal::format::texel_buffer_read_write): Metal lets a function reach a texture buffer through access::read_write only where its usage holds both. texel_buffer_form(pf, usage, profile) is one answer per format and usage per device; one made to be read or written alone keeps the three-access answer. On the three ANV profiles the seven formats move to words for such a texture buffer and nowhere else. AGENTS.md's rule 2 says so in the same commit: the three accesses, plus the storage read without a format for a texture buffer made with both usages, one answer per format and usage per device; it is still one query-chosen form, and the count of fourteen is unchanged. The word says the usage, as it says the format, so a shader that meets a texture buffer through a handle, as one at a slot, tells which answer holds: bit 11 of a texture buffer word of a format with a word layout, TextureWord::TEXEL_BUFFER_READ_WRITE, is set where it was made both to be read and to be written. It lies within the 14 low bits an argument buffer's handle carries (HANDLE_WORD), and the word stays the same on every device. The translator holds the codes a profile holds as words per usage (WordCodes: alone, read_write); the words twin's held test tests bit 11 beside the code only where some format is words for the one usage and not the other (read_write & !alone), and where the two sets are equal the test and the module are what they were. The runtime asks texel_form of the texture's usage at its making, and Device::minimum_texture_buffer_alignment, Metal's query of a format alone, answers the larger of the two forms' alignments: on the three ANV profiles (uniform offset alignment 1, storage 16, a single texel enough for both) B5G6R5Unorm and BGR5A1Unorm go from 2 to 4 bytes (a word against a 2-byte texel), and BGRA8Unorm, BGR10A2Unorm, RG11B10Float, RGB10A2Unorm and RGB10A2Uint stay 4; every other profile's two forms are equal, so its answer is unchanged (computed from the committed profiles' limits, not measured apart). Public contract, in this commit: TextureWord::of_texture_buffer(pixel_format, width, usage), texel_buffer_form(pf, usage, profile), the new texel_buffer_read_write and TextureWord::TEXEL_BUFFER_READ_WRITE (api_surface, api_signatures.tsv); docs/RESOURCE-ID.md's bit 11 row, its texture buffer word section and its test vectors: tests/resource_words.tsv gains a usage column, each format with a word at read (1) and read-write (3) usage with its widths, and at write (2) and unknown (0) at width 1. Consumer search: reims-vgpu at 4f46e27e3b (main's) and at its current e447795571 (mine): no guest computation of words; of_texture_buffer, texel_buffer_form, TEXEL_BUFFER_ and resource_words have no hit, and TextureWord's one hit is link-order.txt, a symbol order list naming TextureWord::of. The runtime README's known gap now says the read is served for a texture buffer made with both usages, and keeps the measured words' cost scoped to those; its form, alignment and words-cost paragraphs, docs/API.md and docs/REPLAY-STREAM.md name the usage. The zero for amd-rdna2-apu-radv, intel-arl-anv and nvidia-pascal-linux is unaudited: those committed profiles report all 39 word formats as words, so no format can move there by this rule (main opens a row to re-record them). SEMANTICS_VERSION 2339 (development holds 2338): the words twin's module on the three ANV profiles and the form's answers move. RUNTIME_VERSION 2558: a texture buffer's form, its word and the alignment the runtime answers move. runtime-sources.sha256 re-pinned (metal/format/texel_words.rs and metal/format/mod.rs are runtime inputs). docs/REFUSALS.md does not move (refusal_surface.py --check passed). Verified at 0cbe4dfc70, a commit of this same tree on a try branch (tree dd16b6a2f7): - red: the test before this one (rebased here as 5900eb8642), at ed24bac82a, job m3-max-83041 on the Iris Xe (RPL-P, Mesa 26.2.6): every_device_runs_texture_buffers_made_to_be_read_and_written_at_every_slot failed with B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm "not dispatched", the read-written slot's ReadWithoutFormat refusal; - the Iris Xe (RPL-P, Mesa 26.2.6), the runtime's texture buffer tests (--cfg m2v_gpu, filter test(texture_buffer)), job m3-max-83121: 12 run, 12 passed; the new test alone, job m3-max-83127, passed, every one of the 15 formats answering the CPU's at every slot. It asserts, per texture buffer made, that the words gauge (Gauges::word_texture_buffers) moved exactly where the form answers words for its usage, and that the words twin ran once per dispatch where one bound is words; every_device_reads_and_writes_texture_buffers_of_formats_held_as_words printed B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm "own view; made to be read and written, words: every answer the CPU's", where they were refused before; - the Iris Xe, rt_replay's texture_buffers_play_with_their_recorded_ids_and_the_cpu_s_texels (--cfg m2v_gpu), job m3-max-83115 (at 9eb68e9c2c, which differs from this tree by a test helper's name in the runtime's texture_buffer_words.rs alone): BGRA8Unorm and B5G6R5Unorm play as "own view, read_write words" with the recorded IDs (each word with bit 11 where made to be read and written), the CPU's texels and values, where the play ended in the refusal before; - the Intel UHD 630 (Windows driver 101.2145, validation layer 1.4.363.0), job m3-max-83145 (the win-cross build m3-max-83134): the runtime's whole suite, 985 run: 984 passed, 1 failed, 4 skipped; every_device_runs_texture_buffers_made_to_be_read_and_written_at_every_slot and every_device_reads_and_writes_texture_buffers_of_formats_held_as_words passed. The one failure, half_simd_reductions' every_device_sums_and_multiplies_half_simdgroups_as_metal, fails the same way at pin Q (m3-max-82853) and at 2e9f9866be (m3-max-83061) and is outside this change; - job m3-max-83128 (Linux): the runtime's, devtools' and harness's suites 280 run, 280 passed, 2 skipped; validation 1323 run, 1323 passed, 3 skipped; conformance 1052 run, 1052 passed; doctests; on lavapipe (--cfg m2v_cpu_icd) the runtime's texture buffer tests 12 run, 12 passed, and rt_replay's texture buffer play passed, every format the same form for both usages there; - the Linux gate, job m3-max-83122: cargo fmt --check, signatures --check, refusal_surface.py --check, clippy -D warnings (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and rustdoc all clean; the translator's and AIR suites 3459 run: 3458 passed, 1 failed, 22 skipped, the one failure golden_hashes_match_the_table, a bless due of 80 cells under 2339 (the 78 below and development's own 2); the runtime guard (the_runtime_sources_are_the_committed_ones) passed; - golden cells (job m3-max-83165: the golden test's every changed cell at this tree and at development's |
||
|
|
dc3e5ab673 |
Texture buffers: the site reads the profile's word codes from the plan; the player's word of a texture buffer; a replay stream of texture buffers
The site test read the codes from the module's declarations, which do not hold them; it reads the plan's. The player compared a texture buffer's recorded ID with TextureWord::of, whose border texels a texture buffer's word does not carry; it takes TextureWord::of_texture_buffer of the descriptor's format and width, as RESOURCE-ID.md and REPLAY-STREAM.md now say. rt_replay gains a stream of texture buffers of five formats (RGBA8Unorm, R8Unorm, BGRA8Unorm, B5G6R5Unorm, RGBA16Unorm) over a Shared buffer, read, written and read-written by tb_word_formats with the IDs the program saw recorded, each played on the cfg's device: no id line, the CPU's texels and values, and each format's form on that device printed. Unbuilt. |
||
|
|
432bbb0a60 |
Replay player: a noted word in a buffer reached only as texels plays as recorded
The player moved every written word whose value lies in a buffer noted escaped (AddressMap::move_noted), whatever the buffer it was written into. In rec-m3-max-80463 it moved 3 RG8 mask words of no-copy buffer #1960, which the program reads only as texels through texture #1962 over it. Each play wrote its own host address there, so two plays read different texels (audit lane, m3-max-81898 and m3-max-81914). Now the move is decided by the stream's structure: - read_ahead, which already walks the whole stream, notes each buffer's life, keyed by the object and its making's position (as recorded_ids is): - whether a texture is made over it (it receives newTextureWithDescriptor:offset:bytesPerRow:, the tiled form or the linear form); - whether any call names it as an argument, at any depth of lists and maps, but a copy between a buffer and a texture (copyFromBuffer:... toTexture:..., copyFromTexture:...toBuffer:...), whose bytes are texels. A buffer with a texture over it and no such naming is reached only as texels. - At an object's making the play marks it live as such, or unmarks the id. - place_words takes the write's target (none for set*Bytes data). Into a buffer reached only as texels, the words move_noted would move play as recorded and are counted as texel_only_words (AddressMap::count_noted, which shares move_noted's pass). The census is unchanged. - Unchanged: a buffer with no texture over it, including one the stream never names (the existing noted-word test), set*Bytes data, and any buffer bound, encoded, used, copied buffer to buffer or added to a residency set. texel_only_words is a new stream counter: in FIXED, frame and group lines, and the report's addresses line. Docs: REPLAY-STREAM.md section 5's noted-word paragraph and section 10's counts and addresses line. The counter lists the replay tests spell out gain it. |
||
|
|
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. |
||
|
|
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
|
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
c55fd4603c |
Validation: a video picture landed is the surface's mark of the other API's writes, not an acquire
The play calls Surface::external_writes_done once a picture lands on a video surface's pages. That call records no acquire: each submission part that uses the planes acquires and releases them itself, and the call marks the other API's writes on the host side. videos.rs' module doc already said so, but its counter and report line still named the call an acquire, as did docs/REPLAY-STREAM.md (the `m2v.externalWriteDone` row in section 4, and the video surface paragraph and its counters in section 10) and the replay test's doc. The executed counter video_surface_acquires is now video_surface_writes_done, and the report's `video surfaces` line says "N writes marked done" for "N acquires". Its one reader in the tree is rt_replay.rs' a_video_surface_is_waited_for_at_its_ready_point_once, updated; no script in the tree names it (grep for surface_acquires over *.rs, *.md, *.py and *.sh). The count is unchanged: one a picture landed in a surface. Wording and naming only; no behaviour changes. |
||
|
|
59d00cd865 |
Validation: the play's own buffers take each copy-form surface's buffer over its exported block
A surface in the copy form holds a buffer of the runtime's over its exported block (`Device::copy_form`), which its planes, textures over it, hold too. The play's count of its own buffers (`NewRuntime::play_holds`) took none of them, so each copy-form surface the program made between frames 100 and 200 moved `buffers_excess`. The copy-form merge leg's RX 550 (m3-max-79613) and a rerun on the RTX 5080 Laptop GPU (m3-max-79696, at 2361470bff) failed the_play_s_own_textures_take_its_video_and_exported_surface_planes on `buffers`: excess 1 at frame 100 and 2 at 200, with both video surfaces copied (Tiling) and both exported surfaces in place. No leak: the growth is the second video surface's buffer, freed with the surface. The play now holds one buffer for each video surface in the copy form while the player keeps it (`Videos::held_buffers`), and one for each exported surface in the copy form while it or a plane of it the stream holds lives (`Exported::held_buffers`), as the textures term counts their planes. The test's first exported surface is a dma-buf's, which NVIDIA's dma-buf takes in the copy form, so the exported term with a plane outliving its surface runs there too. |
||
|
|
e0f63843c4 |
replay: the longest translation at encode is an end line, not a frame's counter
translation_at_encode_max_nanos is a maximum since the device was made, so a frame's difference of it means nothing: the report gives it once, as `translation at encode longest N ns` beside the commit lock's, and keeps translations_at_encode among the executed counters. |
||
|
|
ce471296d5 |
rt: an Accumulate pass writes its visibility results as a Reset pass does, on every device
set_visibility_result_mode refused Boolean and Counting in a pass whose
visibilityResultType is Accumulate (Gap::Draw{AccumulatedVisibilityResults}, counted in
Metrics::accumulated_visibility_refused). MTLRenderPass.h documents Accumulate in one
sentence, "Accumulate visibility results data across multiple render passes." Measured
(the conformance recordings, values.rs VisibilityResultType): Metal on an Apple M3 Max
(macOS 27.0.1) adds a Counting result into the word's low 32 bits and ORs a Boolean one,
while Metal on a Radeon Pro 5300M and a UHD Graphics 630 (macOS 26.7.1) writes it in
place of the word, as Reset does. The documented sum needs an add of a query's count into
a buffer word: a scratch copy of the query results and a kernel of the runtime's own after
the rendering, which is not built. The planner ruled that the runtime answers Accumulate
as Reset on every device until that sum is built, which then replaces it everywhere.
So the setter takes every mode in an Accumulate pass as in a Reset pass, and the
encoder no longer keeps the pass's visibilityResultType, which nothing reads now.
Removed public items: DrawKind::AccumulatedVisibilityResults and
Metrics::accumulated_visibility_refused (the consumer's checkout names neither in code;
two doc comments and one test of its rt platform describe the refusal:
rt_platform/render.rs:76 and its test at :2299, rt_platform/descriptor.rs:21).
DrawKind::VisibilityResultInterrupt stays refused, its doc now saying why: its answer
needs the same add. docs/API.md's accepted differences records the measured answers; the
rt README, VisibilityResultType's doc, the validation replay's docs and
docs/REPLAY-STREAM.md follow. The validation replay test of an Accumulate stream now
holds that its modes write as a Reset pass's, nothing skipped. REFUSALS.md regenerated
(Gap::Draw loses one site); api_signatures blessed (the two removed records).
|
||
|
|
d9054b5164 |
Validation: a play's gauge records are the runtime's objects past the play's own, of each kind the program makes one at a time
A play's frames 100 and 200 are not one loop's iterations: the program makes and releases objects between them (glbench-3090-r4 holds 62 textures at frame 100 and 690 at 200), so a runtime gauge held flat there judged the program. The matrix's records of a play are now, for buffers, textures, samplers and events, the runtime's live objects of the kind less the play's own (`KIND_excess`): the stream's live objects the backend made, and the backend's own that stand for them (two-copy Managed buffers' CPU copies and the released ones a commit still copies, the asides, the guest RAM scratches; the planes' shapes, one texture a plane and shape that the plane's surface textures and views are views of; the video and exported surfaces' planes). The settled end lines at frames 100 and 200 carry the play's count of each kind as KIND_held. An excess below zero is written as it is, which results.py takes for no count. The runtime's other kinds follow the program's objects and work, not one object each: they are not replay records (the harness's loops hold those its workloads reach), and every kind stays held at zero at the device's drop. Verified: in the hand-over. |
||
|
|
f4eb47d792 |
Validation: a play's gauges at frames 100 and 200 go out as the matrix's records, every kind on its end lines
What: - The runtime backend's end lines (`Backend::live`) carry every count of an object kind the runtime keeps live: samplers, LOD clamp variants, level elements, kernel variants and entries, render contents, attachment views, descriptor slots, device samplers, shadows, resolve images, plane stand-ins, buffer set pools, surface buffers, indirect command buffers, releases waiting and handles out join them, and the pipeline cache's bytes. - At the ends of frames 100 and 200 (GAUGE_FRAMES) the player reads them once they hold still (Backend::settled_live): the runtime backend reads them every 10 ms until no release waits and two reads in a row agree on every recorded kind, for at most 2 s, a wait no frame's time holds. What the program released goes on the runtime's block-maker and reaper threads after the work before it retired, so a read straight after the frame's waits could differ between two plays. - command-replay prints, where the play ended frame 200 and skipped nothing by then, `M2V-MATRIX gauge replay-rt/STEM/GAUGE@100` and `@200` for each kind of GAUGED (gauge_records). scripts/matrix/results.py judges them as it judges the harness's: equal at 100 and 200, blocks no higher at 200. - Left out, and why: handles_out (1 while the play holds the device), releases_waiting (lowered by the block-maker thread whenever it runs), private_units (a layout of memory that follows the bytes the program holds), and every byte and age gauge, which follows the program's content and the pool's idle clock: the pipeline cache's data (bound 128 MiB), the translator's entries' bytes (bound 64 MiB), the staging bytes, the pool's allocated, idle, reserved, reused, taken and block bytes, and the shadows', resolve images' and stand-ins' bytes, whose counts are recorded. Why: the matrix's leak rule (live gauges per resource kind flat between iterations 100 and 200) reached only the harness's compute workloads. The kinds only draws and passes make (render contents, attachment views, shadows, resolve images, stand-ins, the samplers draws reach) had no such check, and a play's end lines lacked 17 of the kinds. Docs: REPLAY-STREAM.md section 10 (the end line's gauges, the settled read, the records), VALIDATION.md's gauge row, command-replay's module doc. Tests: replay::tests the_player_settles_the_gauges_at_frames_100_and_200_alone and the_gauge_records_are_the_counted_kinds_at_frames_100_and_200; replay::rt_replay the_end_lines_carry_every_gauge_the_gauge_records_carry (device); test_results.py test_a_plays_gauges_at_frames_100_and_200_are_held_flat_as_the_harness_s. Verified: in the hand-over. |
||
|
|
1c307b4608 |
Runtime: a pass rasterizes at the sample positions its descriptor sets, through VK_EXT_sample_locations
L168: a pass's custom sample positions were dropped while the guest could be told they are supported, so a non-default set rendered at the standard positions with no refusal. What changed: - VK_EXT_sample_locations joins the floor's OPTIONAL_EXTENSIONS (enabled where listed; it has no feature). Device::programmable_sample_positions_supported (programmableSamplePositionsSupported) is true where the device lists it with locations at every sample count above 1 it renders, a 1 x 1 grid, every sixteenth from 0 to 15/16 and variableSampleLocations; false elsewhere. No second form: a device that answers no refuses positions other than the defaults. - RenderPassDescriptor::sample_positions is checked as the pass begins (crate::positions): each coordinate is taken to the nearest sixteenth, a tie up, at most 15/16, and each sample past the positions given at the pixel's corner, as the conformance suite's sample_positions rows measured an Apple M4. A set that comes to Vulkan's standard locations (Metal's defaults at 1, 2 and 4 samples) rasterizes as an empty one on every device. - Refusal::SamplePositions (Count, Coordinate, OneSample, Unsupported) where Metal's validation stops the descriptor or the device answers no. Gap::RenderPass of SamplePositions for other positions beside a depth attachment (Vulkan needs a sample-locations-compatible depth image whose layout transitions name the last locations) or at a count the device's locations lack. Gap::Draw of SamplePositions for a draw in such a pass whose fragment module uses InterpolateAtSample (VUID-01524), read from the translator's GraphicsState. - A draw in such a pass takes a VkPipeline of its class made with sampleLocationsEnable and the locations as dynamic state (Raster::positions), one pipeline for every set; the encoder records vkCmdSetSampleLocationsEXT before the pass's first draw. Every coordinate handed to Vulkan is a sixteenth in [0, 15/16], which Vulkan's required 4 sub-pixel bits hold exactly, so no precision note. - The translator's description of a device that enables the extension states it (floor::shader_extension), as for every extension creation enables that the translator names; the translator reads none of its properties. tests::translator_fields gives GraphicsState::interpolates_at_sample its verdict (refused at custom positions). - The conformance rt side passes a case's positions to the runtime; the replay player sets them on the runtime's descriptor and drops its count of passes at other positions (docs/REPLAY-STREAM.md says so). - README (floor table, the device's answers, the known gap rewritten), REFUSALS.md and basis.rs, api_signatures.tsv, METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated. Tests: the device test every_device_rasterizes_a_pass_at_its_sample_positions now gates on the device's answer and holds the answer to the extension's properties; new device tests every_device_refuses_the_positions_metal_refuses and a_draw_that_interpolates_at_a_sample_is_refused_at_custom_positions; new device-free tests (placed::) of the answer's gates (each count above 1 the device renders in sampleLocationSampleCounts, a 1 x 1 grid, a range holding 15/16, 4 sub-pixel bits, variable locations) and of the placement (every coordinate in [0, 1) on a sixteenth from 0 to 15/16, refusals, the corner, the standard sets, the count and depth gaps); the replay device test sample_positions_play_through_the_runtime_s_descriptor. Verification: the lane's jobs, named in the ledger commit that follows. |
||
|
|
edee7b22ec |
Replay: the stand-in makes no import Vulkan forbids: no dedicated opaque fd import, no memory type its buffer lacks
The audit lane read the stand-in cold (standin.rs:262, 288-290 at cc3188c3da): - An opaque fd's import named the stand-in's buffer in VkMemoryDedicatedAllocateInfo wherever the driver keeps that buffer to a dedicated allocation. Such an import must name a buffer identical to the exporter's (VUID-VkMemoryDedicatedAllocateInfo-buffer-01879), and the runtime's export is dedicated to its own buffer, of other usage, whose create info the export does not give. That case is now an import the stand-in cannot make, counted with that reason; an opaque fd's import is dedicated to no buffer. - The import bound memory of the export's type without checking that the stand-in's buffer lists it (VUID-vkBindBufferMemory-memory-01035). A type the buffer does not list is now an import failure with that reason, before the allocation. docs/REPLAY-STREAM.md section 10 says both. |
||
|
|
ca370da605 |
Replay: the stand-in for the other API is Linux's and macOS's; the validation crate's clippy for Windows passes
The validation crate builds for x86_64-pc-windows-gnullvm (with llvm-mingw for the bundled SQLite, as win-cross.sh builds command-replay for the Windows play), and its clippy there (job m3-max-78094 at abf7b8f873, plain and under --cfg m2v_gpu) reported the stand-in: its writes wait under the crate's bounded fence waits (gpu::wait::vulkan), which the crate keeps to Linux and macOS, and its empty extension list for an NT handle did not type-check. Rather than a Windows form of the fence wait, the stand-in is Linux's and macOS's alone: its import is fd-only, and on any other host StandIn::new says why it is absent, so each landing is counted unwritten with that reason and the play goes on (the S1 ruling's handling of a stand-in that cannot be made). The NT-handle import, which no build compiled, is gone, and so is the device test's Windows arm: the test, under the layer through candidate::validated, is Linux's and macOS's. A plane's rows are the caller's tuple. The same clippy reported lib-test code that predates the exported surfaces and never compiled for Windows: build_support_tests.rs hex-encoded through crate::hash (not on Windows; now sha2's own lower-hex), and gpu/wait.rs's tests of the fence and Metal waits' own endings, which Windows lacks (now gated as those variants are). docs/REPLAY-STREAM.md section 10 says the stand-in is Linux's and macOS's and what Windows counts. |
||
|
|
edc657331a |
Replay: the exported-surface device test plays under the validation layer; the format doc's exported-surface records
The device test of the exported-surface snippet ran with the layer on the loader's path but not enabled: the validation crate's replay tests make their instance with no layer. Each of its plays now runs under the Khronos validation layer as the candidate runs do (candidate::validated, made reachable from the replay tests): the device must list the layer as an active tool, and any message the layer logs fails the test, the stand-in's device's included, since it lives on the runtime's instance. docs/REPLAY-STREAM.md: section 4 points at the records, section 7 gives them (m2v.newExportedSurface, m2v.surfacePlane, m2v.exportSurface, m2v.surfaceWritesDone, release), and section 10 says what the player does at each, the stand-in for the other API, what a player cannot reproduce, the runtime's hand-overs with its Metrics docs as the contract, the hand-over and exported-surfaces report lines and counters, --video-handle's override, and `command-replay snippet video-surfaces`. Verified before this commit (job m3-max-78051, f58ff0a2b3, lavapipe on msi, layer on the path but not enabled): dma-buf in place and opaque-fd in the copy form each play 3 frames that agree with the contract (acquires 2, releases 3 in frame 0 and 2 after) and 6 checks that match. |
||
|
|
8ac09ba43e |
Replay compare-dumps: a differing buffer's line names its first word in each play
compare-dumps said which word of a buffer differed first outside every cover, but not what either play held there, so telling a NaN from a rounding step or a stale word meant reading both dumps by hand. A Difference now carries that word in each play's dump (first_values, little-endian; a short end's bytes with zeros above them, none past a dump's end), and its line prints them after the word's index: "the first word W (a 0x........, b 0x........)". The stream doc says so. The three compare tests take the values in their expected lines and Differences, and a new unit test compares three buffers whose second word differs in b, ends 2 bytes into it, or ends before it. |
||
|
|
866a8dd2f2 |
Replay player: a compute pipeline state takes the stream's openClMode
The player refused a compute descriptor whose openClMode was true, so a stream that makes an OpenCL-mode pipeline (a guest running OpenCL C on Metal) stopped at its first one. The runtime's descriptor carries the mode (open_cl_mode_enabled), and the translator links the kernel for it: the three hidden buffers ahead of the kernel's own, its buffer indices 3 on, get_global_id with the dispatch's offset. The player now gives the stream's value to the descriptor, off where absent, and the stream doc says so. The previous commit's test is its check on lavapipe: red before this commit, green with it. |
||
|
|
cf270fa34e |
Harness and replay player: count dispatches by the form their kernel reaches its buffers in
The harness's matrix counts gain bound_dispatches and address_dispatches, and the replay player's executed counters gain those two with buffer_sets_written and buffer_sets_held, so a run shows which form its dispatches took. Built only; the harness run is the Iris read that follows. |
||
|
|
5b260257e0 |
Runtime and replay player: count each dispatch barrier in one source, and print the device's buffer alignment
What: Metrics::dispatch_hazard_barriers is now the sum of nine sources, each such barrier in exactly one: dispatch_after_write_barriers and dispatch_write_after_read_barriers (the dispatch's own dependencies), then dispatch_encoder_end_barriers, dispatch_pass_end_barriers, dispatch_indirect_barriers, dispatch_unbound_barriers, dispatch_arena_piece_barriers, dispatch_heap_barriers and dispatch_other_barriers. The replay player prints the nine on each frame line's executed counters and in the report's totals. The tally's bit mask is a u128 (69 metrics). The rule for a barrier with several causes: it counts under the dispatch's own dependency where it has one, first a write (it reads or writes a resource a command since the last barrier wrote), then a write after a read (it writes one that was only read), both by the resource's own id; otherwise under the first source in this order: an encoder that wrote ended; a render pass moved nothing home (or copied a resolve into a buffer); an indirect dispatch after a write since the last barrier that reached argument reads, whatever buffer was written; an access outside every resource (a read after a write, a write after any access, or the barrier such a write owes); a Private-arena piece after the first; a conflict through a heap's one id alone (an exported surface's buffer and planes, which share one id, count here too); anything else (a memory barrier call, a release to another API, a concurrent encoder after commands that touched anything). An owed barrier keeps the first of its causes in that order. In a concurrent encoder the dependency is read only where a barrier is owed, as Metal orders nothing else there. Two buffers of one heap over the same bytes count under the heap: at buffer level they are two resources. How: a heap's resources are marked in the hazard sets by the heap's id, as before, and also by their own ids in a second table of the sets that places no barrier and only tells a dependency on the resource from a conflict through the heap's id. Building::owe takes its cause and no longer starts the sets again; the command that pays the owed barrier does, after reading them: Building::command clears them after paying, and dispatch_hazards takes its command buffer without paying (current_command) and pays the owed barrier itself, counted by every cause it has. Where barriers go is unchanged: each path that paid an owed barrier records the one barrier it recorded before, and the sets start again at the same barriers. Rider: Device::buffer_alignment (no Metal counterpart) returns the alignment Vulkan's memory requirements gave the runtime's buffers, which the pool read at the device's making. The replay player's device line prints it (`device NAME runtime rt buffer alignment N`), and the device test prints it and checks it is a power of two. The runtime prints no line of its own at a device's making, so a consumer's log shows it only by reading this accessor. Why: the planner's reading of the dispatch-hazard barriers: whether the sources that are not the guest's own dependencies reach a quarter of a frame's barriers on any stream. The buffer alignment goes into every lab log because the ring and the zero address assume a multiple of 16 with no query behind it. Tests: every_device_counts_each_dispatch_barrier_in_one_source checks the write after a read, two encoders' ends (the second's dispatch reading the write before it counts as that dependency), a render pass's end that moved nothing home, an indirect dispatch after a write of another buffer, a read outside every resource and a memory barrier in a concurrent encoder, each in its one source with the sources summing to the dispatch barriers; every_device_places_barriers_at_hazards_only checks the dependent and concurrent encoders' in the write dependency and none for independent dispatches; every_device_orders_a_heap_s_resources_as_one checks the heap's source, and the write dependency for one buffer of a heap used twice; the arena test checks its pieces' barriers in the arena source; the hazard sets' unit tests check the own-id table. The signatures table is blessed (9 fields, 1 method). Verified: nothing yet in this commit; the gate (fmt, clippy in three configurations, Rustdoc, the runtime suite on lavapipe and the validation suite) runs on it next. |
||
|
|
0b7d408201 |
Runtime and replay player: count barriers by cause, the guest's blits and buffer binds, and over-copy bytes by frame
What: - Metrics counts every barrier in one of seven causes, whose sum Metrics::barriers now is: pass_start_barriers (a render pass's first), pass_home_barriers (the move of its attachments home at its end), blit_barriers, dispatch_hazard_barriers (a dispatch's own, at a hazard or paying one owed), segment_end_barriers, upload_barriers (the uploads' and Managed copy-ins' barriers, the over copies they carry among them) and other_barriers (inside a pass, over copies in a command buffer, heap moves ahead of a command or segment, releases). Metric::Barriers is gone: each site that records a barrier counts its cause, and the shared helpers (Building::barrier, alias::record, over::record_side) take the cause from their caller. - The replay player's executed counters carry the seven, so each frame line prints them. - The player's stream counts (the guest's, fixed by the stream) add blits, an encoder's copy, fill, mipmap, synchronize, reset and optimize commands, and the buffer slots the set-buffer calls set on render and on compute encoders, each split into buffer changes (another buffer than the slot held, or its first set) and offset-only changes (replay/binds.rs). - The runtime backend's report adds an `over copies by frame` line: over-copy bytes a frame, mean and largest frame, by memory class (Private, Shared) and by cause (pitch, dma-buf, host memory, every other cause as own_image), and the number of textures in an image of their own the largest frame's calls named (new_runtime/over_frames.rs), from counters the runtime keeps. - docs/REPLAY-STREAM.md and the runtime README name them; the signatures table blessed (7 fields). Why: the planner's reading of round d9b644bae7's plays: whether pass-boundary and blit barriers are half or more of a frame's barriers (the two pass forms), and whether over copies of Private buffers reach 1 MB or 5% of a frame's copied bytes (the third form), needs the barrier split and the over-copy split a frame, beside what the guest asked for; the guest's buffer binds per draw and per dispatch size the descriptor work. Tests: every_barrier_rt_records_is_counted adds a pass over a texture whose home is shader-read and checks each cause's count against the barrier commands recorded (pass start 1, pass home 1, blit 2, dispatch hazard 0, segment end 1, upload 6 or more, other 0); every_device_places_barriers_at_hazards_only checks the dispatch-hazard and segment-end counts on dependent, independent and concurrent encoders; every_device_reads_its_attachment_through_a_texture_after_a_memory_barrier checks the causes on the feedback-loop and the copy path; the player's the_stream_fixes_its_calls_commits_encoders_draws_dispatches_blits_and_binds checks blits and every bind count; over_copies_by_frame_give_the_mean_and_the_largest_frame checks the line. |
||
|
|
8c3bffc079 |
Runtime: count over-copy bytes by the buffer's memory class, and the renderings an encoder ends and begins again
What: two counters, so reach is counted rather than guessed. - Metrics::over_copy_bytes_private and Metrics::over_copy_bytes_shared split over_copy_bytes by the memory class the bytes shaders reach are in (MemoryClass of the buffer's block; a Managed buffer's device copy counts in neither). OverCopy carries the class; Counters::over_copied takes it. - Metrics::rendering_interrupts counts each vkCmdEndRendering and new vkCmdBeginRendering inside one render encoder (RenderCommandEncoder::interrupt, its one site): barriers, copies a draw or a visibility result mode needs first, feedback and heap moves, an execution's count kernel. The passes counter counts encoders and cannot show these. - The replay player's executed counters carry the three, so every play's frame lines print them; docs/REPLAY-STREAM.md and the runtime README name them; the signatures table blessed (3 fields). Why: the per-frame counts of round d9b644bae7's plays put over-copy bytes at 4.87 MB a frame on the desktop stream (5080) and 34.5% of bytes copied on the 780M recording (Iris), with no way to tell how much lies over Private buffers, whose bytes no host write reaches; and no counter shows how often a render encoder's rendering is cut. Tests: each_memory_class_counts_its_copies_bytes_alone (device-free); the device test every_device_counts_each_textures_copies_under_its_cause checks the class split for each copy and adds a texture over a Private buffer (pitch cause on lavapipe); every_device_reads_its_attachment_through_a_texture_after_a_memory_barrier holds the count at 2 on both the feedback-loop and the copy path. |
||
|
|
e9484b7d03 |
Replay dumps: a texture the cover rule holds covered is dumped with a whole-texture cover
A heap texture that another placement's texture wrote over after its last write was reported by compare-dumps as a difference: the dump loop passed no cover for a texture (dumps.rs: "always `-` for a texture"), so the bytes Metal leaves undefined there were compared. Each texture a listed command buffer stores or binds is now dumped, when the dump reads it (after the wait that saw the command buffer complete, the moment a buffer's ranges are taken), with the cover 0..N, N its dump's length, where the cover rule holds any byte of it covered (Covers::covered), and `-` otherwise. A texture's ranges in the rule are its bytes in its heap, which the dump's parts are not laid out as, so a covered texture is covered whole. The compare then leaves its words out as it leaves out a covered buffer word. dumps.rs and docs/REPLAY-STREAM.md section 10 say so. Test: the_dump_compare_leaves_out_a_covered_texture_and_reports_one_outside_every_cover (no device; Kept reads a texture part's first word from a per-texture word where it holds one). Of three textures placed in a heap, #5 and #6 over each other and #7 apart, two dispatches of a state that writes slot 0 write #5 then #6, which covers #5; the second play reads #5 and #7 otherwise. #5's cover is 0..32 and its differing word is counted covered; #7, covered by nothing, is the one difference reported. Verified at this commit: nothing yet; the lane's jobs follow. |
||
|
|
f6b1adf204 |
Replay player: a layered pass plays as the runtime builds it, and its dump holds each slice
The player marked a pass whose renderTargetArrayLength is 2 or more as one the runtime's descriptor does not hold (Unheld(renderTargetArrayLength)) and skipped its encoder, though RenderPassDescriptor::render_target_array_length takes it: the runtime renders that many slices from each attachment's slice, refuses an attachment with fewer slices (AttachmentPlace) and answers a length past maxFramebufferLayers with Gap::RenderPass of ArrayLength. The player now sets render_target_array_length from the recorded value (narrowed to u32 as the other counts are) and lets the runtime decide: a gap is a skipped encoder counted by the gap, and a refusal stays the play's error. The attachments already carry slice and resolveSlice into the runtime's descriptor; no other field is dropped for a layered pass. The dump's stores read a layered pass's attachment as its first slice alone. They now keep each pass descriptor's renderTargetArrayLength from its m2v.setPass record and store that many slices from the attachment's slice (or the resolve's), through the MTLStoreActionUnknown path too. dumps.rs and docs/REPLAY-STREAM.md (sections 10's skipped encoders and the dump) say so. Tests: a_layered_pass_plays_and_its_draw_renders_the_layer_it_selects (device cfg; a stream of a 2D array of two slices, R32Uint, renderTargetArrayLength 2, cleared to 7, and rt6_layered's triangle selecting layer 1: no encoder or draw skipped, the blit's check of both slices matches 7 then 0x101, and the dump of the command buffer holds both slices) and a_layered_pass_s_dump_holds_each_slice_it_renders (no device; Kept: length 3 stores slices 1 to 3 of a Store attachment and 0 to 2 of an Unknown one, length 1 the slice alone). Verified at this commit: nothing yet; the lane's lavapipe job and the quick check follow. |
||
|
|
c43f1a5447 |
Replay player: setSamplePositions:count: plays on a pass descriptor, and passes at other positions are counted
The runtime player refused setSamplePositions:count: on a render pass
descriptor ("not played on a render pass descriptor"), so every play of a
stream whose 2D renderer sets positions on its 4-sample pass stopped before
that pass.
It now plays the call as the runtime treats it: the runtime's descriptor has
no field for the positions and every multisample pass rasterizes at Vulkan's
standard sample locations, so nothing is set and nothing is refused. The pass
keeps the positions its last call set, and each render encoder the runtime
makes of a pass whose positions differ from Metal's defaults for the pass's
sample count (its attachments', or defaultRasterSampleCount with none) is
counted on a report line, with the first one's frame and call:
"passes at sample positions other than Metal's defaults N: rasterized at the
defaults, Vulkan's standard locations; the first at frame F, call C".
Metal's defaults are taken as Vulkan's standard locations at 1, 2 and 4
samples (the spec's Standard Sample Locations table; the runtime's floor row
standardSampleLocations and its known gap name them Metal's defaults at those
counts; the conformance rows sample-positions-default-4x/-2x). No other
count's defaults are held, so a set at any other count counts as differing;
an empty list (count 0) is the defaults.
Tests: rt_replay's sample_positions_play_and_a_pass_at_other_positions_is_counted
writes its own stream, two passes over a 4-sample target, one at the 4x
defaults and one at four others; it plays through with nothing skipped and
the line counts only the second (call 12). Without the fix the play stops
refused at call 5. new_runtime's
sample_positions_differ_from_metal_s_defaults_of_the_pass_s_count checks the
comparison (defaults, one coordinate off, reordered, fewer positions than
samples, Vulkan's 8x locations) and the line at zero, without a device.
Docs: docs/REPLAY-STREAM.md lists the call among the pass descriptor's
setters and says how the backend plays and counts it.
|
||
|
|
d2e8ab2a85 |
Replay player: a colour attachment's depthPlane is played
What: the new-runtime player forwards a colour attachment setter's `depthPlane` into the
runtime's RenderPassColorAttachmentDescriptor::depth_plane, as it forwards resolveDepthPlane, and
no longer holds the pass for a plane but 0 ("Unheld(depthPlane)", the encoder skipped). A depth
or stencil attachment's depthPlane is not played and holds nothing: Metal reads it of a 3D
texture alone (Apple's page for depthPlane, as fetched: "If the texture isn't a 3D texture, then
Metal ignores this property."), and the runtime refuses a 3D texture's depth or stencil
attachment by its type (TextureType) whatever its plane, which the player counts as any gap.
Why: since
|
||
|
|
c54fa438a2 |
Player: a dump holds each texture a listed command buffer's compute encoders bind
--dump-command-buffers wrote every buffer a listed command buffer's encoders named and every colour attachment its render passes stored, so a texture a compute pass wrote showed only through a later pass that sampled it. A play that parts between two drivers in a render pass that samples a compute pass's textures could not say which of the two passes parted first. dumps::Stores now keeps the compute encoders made and not yet ended, and each texture such an encoder binds (setTexture:atIndex: and setTextures:withRange:, a nil one left out) is a part to dump: its first level and slice, read once the command buffer completed, as an attachment's parts are, into cbC-objT.bin with the cover "-". A texture both stored and bound holds each part once, in Part order. An argument encoder's setTexture:atIndex: is none: its receiver is no compute encoder. docs/REPLAY-STREAM.md and the module docs say what a dump holds. Test: a_listed_command_buffer_dumps_the_textures_its_compute_encoders_bind (one bound texture, a range with a nil, a texture bound twice, a render encoder's fragment texture and an unlisted command buffer's compute texture left out). Verified: clippy -D warnings over the workspace with all features, and the validation suite, the new test among them (job in the land line). |
||
|
|
06c8ebccd6 |
Player: a tessellation factor scale of 1 plays as nothing, any other is a skipped render command
The player refused setTessellationFactorScale: ("not played on a render
encoder"), so a recording that sets the scale stopped at its first
setter. The runtime's render encoder has no scale setter: Metal reads
the scale only in a patch draw through a post-tessellation pipeline
state that enables it (tessellationFactorScaleEnabled), and the runtime
refuses every such state at its making (RenderPipelineKind::Tessellation),
which the play counts as a skipped render pipeline state.
render::factor_scale reads the setter's scale: Metal's default of 1
plays as nothing, and any other scale is a skipped render command of
kind TessellationFactorScale, counted in the report's headline with its
first frame and call. This is faithful only while the runtime refuses
every scale-enabled state; once it builds the scale, its encoder takes
the setter and the player passes the scale on. The code comment and
docs/REPLAY-STREAM.md say so.
The recording that met it (m3-max-71779, read in place, no card): 185
scale setters, every one at 1, the first in frame 409; 0 of its 1668
render pipeline records enable the scale, so no state there is refused
for it.
Test: a_tessellation_factor_scale_other_than_1_is_a_skipped_render_command
(1 as a float and a double, 2 and 0.5, and a scale that is no float).
Verified on msi: clippy -D warnings over the workspace with all features,
and the validation suite, the new test among them.
|
||
|
|
1f81d53c30 |
Player: a compute pipeline record's stage input plays as the kernel's
The player refused every compute pipeline record whose stageInput was not
nil ("a stage input"), so a recording that makes a kernel with a
[[stage_in]] parameter stopped at that state's frame. The runtime takes
the stage input (ComputePipelineDescriptor::stage_input); only the player
lacked it.
translator::stage_input reads the record's stageInput, {layouts,
attributes, indexType, indexBufferIndex}, into the translator's
StageInputDescriptor the way vertex_descriptor reads a vertex descriptor:
layouts and attributes at their indices, a stride of 2^64 - 1 as
MTLBufferLayoutStrideDynamic, Metal's raw step functions, attribute
formats and index type through their enums, and Metal's unset layout for
a buffer an attribute reads that no layout names. Nil stays no stage
input. A raw value the enums lack, or a key the form does not hold, is
the player's refusal. A descriptor the runtime refuses is the runtime's
typed error: a gap or a translation refusal counts as a skipped compute
state in the play's report, any other error ends the play with it.
docs/REPLAY-STREAM.md states the form.
Test: a_compute_pipeline_record_s_stage_input_is_read (the record form,
a dynamic stride, a buffer no layout names, nil, and an unknown key).
Verified on msi: clippy -D warnings over the workspace with all features,
and the validation suite, the new test among them.
|
||
|
|
acda405b30 |
Player: a dump holds each colour attachment its command buffer's render passes stored
A play asked to dump command buffers (--dump-command-buffers) wrote only the buffers their encoders named, so a draw's output reached no dump. It now writes, once a listed command buffer completed, each colour attachment its render passes stored, as cbC-objT.bin beside the buffers' dumps, with a cover of "-", so compare-dumps reads them unchanged: a texture an attachment names under MTLStoreActionStore or StoreAndMultisampleResolve, a resolve texture under MultisampleResolve or that one, and an Unknown store action as the encoder's setColorStoreAction:atIndex: decides it. The dump holds the parts the passes stored (level, slice and depth plane, or the resolve's), one after another, each laid out as a check reads a texture's first level and slice; a part the backend cannot read (a multisample texture stored without its resolve) is an .unread file. Colour only: a texture of a combined depth and stencil format reads back one aspect at a time, through a copy with that aspect's blit option, which this read does not make. The stream doc and the command's help say so. The backend gains Backend::read_texture_part; the runtime's backend reads a part as its check reads level 0 (the CPU's read, or a blit's copy of a Private texture), the check's read unchanged. Verified: by the jobs named in the landing report. |
||
|
|
60a6b2746e |
Docs: the memory-class line measures by two whole plays on the RX 7900 XTX
|
||
|
|
d876f56b82 |
Docs: the two killed plays on the RTX 3090 were followed by its driver's GSP timeout
After lane kernmap's two plays of the Intel-made compute recording on um870's RTX 3090 were stopped at their time limits inside frame 368 (m3-max-71535, 09:28-09:41, and 71553, 09:42-09:57), the card's telemetry froze from the first sample after the second (09:57:33) and the driver logged Xid 119 (a GSP RPC timeout, fn 76) at 10:08:36, naming no process; the node was rebooted. The consumer read its journal and job log: no guest run touched the card from 08:34:40 until then, and the driver's out-of-memory group at 09:57 is routine at card open (13 times that day). The planner ruled it a lab artifact of those plays, no row, written beside the memory-class line. Verified: the docs check follows as a job. |
||
|
|
29b659121e |
Docs: a recording is a timing source only on a card of its own memory class
Lane kernmap played the consumer's GPU compute benchmark recording, made on an Intel integrated card, on the RTX 3090 (pin R; m3-max-71535 and 71553, P0, both capped inside frame 368, 0 refused). Frames 366 and 367 alone took about 378 s of GPU-busy time, against 257.2 s for the whole play on the RX 7900 XTX and 74.3 s on the integrated 780M. The consumer's own guest on the 3090 runs the same benchmark's workloads in 37.1 s of GPU time in all (native 33.4 s), and its recording of the same run on the discrete AMD card is 1.3 GB, against this one's 25.3 GB: the Shared storage an integrated guest builds on. The planner ruled the 3090's frames play-only, and that a recording times only on its own memory class. The replay doc now says so beside the timing verdict rule. Verified: the docs check (workspace Rustdoc, -D warnings) follows as a job. |
||
|
|
9a11fbd543 |
Docs: the replay player makes and executes no indirect command buffer
docs/REPLAY-STREAM.md said that only an indirect command buffer, "which the runtime does not build", would read a pipeline state's resource ID. The runtime builds indirect command buffers; the player is what does not: making one is "not played on a device" and executing one "not played on a render encoder" (new_runtime/mod.rs, render.rs), typed refusals that end the play. The doc now says so beside the refusal rule, and names what would read a pipeline state's ID: an argument buffer's pipeline-state member, which the runtime refuses at the making of a state whose function reads it (rt README, known gaps). The player's comment on that ID drops the same stale reason. Verified: the docs check (workspace Rustdoc, -D warnings) follows as a job. |
||
|
|
17473a1a42 |
Player: a render encoder's residency declarations play through the runtime
The render encoder's arm played its eight residency forms (useResource:usage:,
useResources:count:usage:, useHeap:, useHeaps:count:, each with stages: or without) as nothing,
"as the runtime's render encoder has none". The runtime's RenderCommandEncoder has use_resource
and use_heap now, so they play through it as a compute encoder's do: each resource of the call,
or of its list, through use_resource with the call's usage; each heap, or each of its list,
through use_heap. The stream records each C array and its count as one list, so the usage is
argument 1, and the stages come last; the runtime's render encoder takes no stages, so they are
not read.
What each read before, and now:
- Render encoder, all eight forms: before, no argument and no runtime call; a skipped object they
named was not counted. Now: the resource ({Buffer: object} or {Texture: object}) or heap of
argument 0, each of a list; the usage at argument 1; a skipped object is a skipped call, each
of a list as its own, as docs/REPLAY-STREAM.md says of skipped_calls.
- Compute encoder, the four forms: unchanged in what they read; one resolver (NewRuntime::uses)
now serves both encoders, and heap_of, which only the compute arm called, is gone.
- The usage: before, 1, 2 or 3, any other value refused. Now MTLResourceUsage's option set of
read (1), write (2) and sample (4), any other bit or none refused. Without the sample bit, a
render encoder's useResource:usage: of read | sample, which played as nothing before, would
now be refused.
- objects_named, which the unwritten count reads a render or blit encoder's call by, and which
notes the objects a command buffer's encoders name (resource indices owed, placed buffers' and
no-copy Managed buffers' users, tiled textures' takes): before, bare objects and lists only, so
a residency declaration's {Buffer: object} or {Texture: object} named nothing. Now it names the
resource too, on compute and render encoders alike.
docs/REPLAY-STREAM.md: render and compute encoders play their residency declarations through
the runtime's encoder, the stages forms as those without; the unwritten count's reaching calls
include a residency declaration's resource.
Tests: the commit before this one (red: the skipped-object device test and the unwritten test).
|
||
|
|
3e9cd15b0a |
Player: a release of an object its device's release dropped plays as nothing
Metal's objects keep their device, so a program may release its device before what it made: a guest recording's last two calls release the device and then the host's display library made on it. The player drops everything a device made at the device's release, and the library's release that followed found no object and stopped the play as an invalid stream, after every frame had played. The player now keeps the ids a device's release dropped, and the stream's own later release of one removes it from that set and plays as nothing; the backend released it once, with the device. Ids are never reused (docs/REPLAY-STREAM.md, section 4), so the set holds only objects whose release may still come. A second release of such an object, or the release of an object no call made, still stops the play. Verified: an_object_released_after_its_device_plays_as_released_with_it and the replay tests in the job named in the lane's report; no local build. |
||
|
|
15af4d5de0 |
Player: --dump-command-buffers takes a list of ranges and single ids
A play that should dump only the command buffers holding a changed kernel's dispatches had to dump every command buffer between the first and the last of them: on a recording whose workloads interleave, tens of gigabytes the compare then reads for nothing. The option now takes LIST: FIRST..LAST ranges (both ends held) and single ids, joined by commas, in any order (CommandBufferList, in dumps.rs beside the dumps it selects). Ranges that overlap or touch are merged and a lookup is one ordered-map search, so a list of thousands of command buffers costs the play nothing per call. A single FIRST..LAST range reads as before; anything else stops the play before it starts, as a bad range did. Before: the dump test helper passed 20..=29 as a RangeInclusive, the only form there was. Verified: the red tests from the previous commit (a_dump_list_holds_its_ranges_and_ids_and_ nothing_between, a_play_dumps_the_listed_command_buffers_alone) run in the job named in the lane's report; no local build. |
||
|
|
82d1c62eb5 |
Player: the plural residency declarations play and count as their single forms
A compute encoder's useResources:count:usage: and useHeaps:count: were refused ("not played on a
compute encoder"), so a play stopped at the first one; a guest recording on the Iris Xe stopped
at frame 290 of 430 there. They play now as Metal defines them: each resource of the list as
useResource:usage: with the call's usage, through the runtime's use_resource, and each heap of
the list as useHeap:, through use_heap. The stream records each C array and its count as one
list (docs/REPLAY-STREAM.md), so the usage is argument 1.
What each read before:
- The compute encoder read useResource:usage: alone (its resource as {Buffer: object} or
{Texture: object}, the usage at argument 1) and refused both plurals.
- The covers rule and the unwritten count read useResource:usage:'s resource with as_object,
which takes only a bare object, so a recorded {Buffer: object} wrote and uncovered nothing in
them; both plurals fell through as calls that only name objects. They read the resource now as
the stream records it (Value::as_resource), and each resource or heap of a plural as its single
form.
- The render encoder reads none of its residency declarations' arguments (it plays them all as
nothing), so it read no usage wrongly.
The player's resolvers gain held (a resource value) and block_of (a heap id), which resource and
heap_of now call. docs/REPLAY-STREAM.md says compute encoders play the four forms through the
runtime and that the unwritten count, the skipped calls and the covers rule read the plurals as
their single forms.
Tests (the two commits before this): the device test of a compute encoder's four forms, the
unwritten test of the plural and of the singular on the format, and the covers test of the
plurals. Not run here: no local builds; to be checked on development.
|