0e9889dfaae1fd5f2d1d42b0d322ca0766ca1f8a
1760
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0e9889dfaa |
replay: the rt backend reads a Private buffer back through a blit into a Shared buffer of the play's own
The new runtime's player backend refused every read of a Private buffer
("a Private buffer": it has no contents). The gate's per-command-buffer
compare (`--dump-command-buffers`, `compare-dumps`) therefore read none of
them on rt: its play pair over glbench-780m-r2's command buffers
58254..58416 on the 3090 (m3-max-52237, development
|
||
|
|
2f4c9fc9dc |
conformance: a new texture's fresh read is unchecked on metal2vulkan-rt, where Metal is silent
rt answers a new texture with whatever its memory last held. Metal's two texture-making sentences
say nothing of a new texture's contents: MTLDevice.h gives newTextureWithDescriptor: only
"Allocate a new texture with privately owned storage.", and Apple's page only "Creates a new
texture instance.". The page for newBufferWithLength:options: promises zeros ("Creates a buffer
the method clears with zero values."). An Apple M3 Max on macOS 27.0.1 read zero from new Shared
and Managed textures.
What changes:
- A new justification, Justification::NewRuntimeAccepted(slug): an accepted difference of
docs/API.md that holds on the rt run alone. On the old runtime's run it is
Unjustified::OldRuntime, which faults nothing, so the old runtime's answers still compare.
- The declaration replay::new_texture_contents(site) leaves the site unchecked under the new
docs/API.md entry "The new runtime's new textures read what their memory last held". It carries
the four facts above and the words "silent", never "undefined".
- It is named at the fresh site of every texture row:
- fresh-texture-* and fresh-chain-*, every storage mode;
- fresh-pattern-*;
- texture-round-trip-*;
- each format-footprints round trip.
- It is not named by any buffer row or texture-over-buffer row: Metal promises those zeros, and
they stay exact on rt. The written sites and the statuses stay exact on both runtimes. rt writes
nothing to pass a row.
Why: these rows' fresh sites follow process history on rt. m3-max-52251 (lavapipe, rt) ran plain
development at
|
||
|
|
905b16b79a |
command-replay: --gpu-wait-timeout bounds the play's device waits
The replay command took only the 10 s default for every device wait, so a play on a CPU device (lavapipe) whose command buffer takes longer than 10 s ends with status 86 though nothing hangs. It now takes --gpu-wait-timeout SECONDS (1..=600) as the other device-executing commands do, applied before any device opens; a value outside the range is an error line and status 2. Needed for the CPU-ICD repro of a GPU hang (docs/VALIDATION.md, the suspected-hang protocol). Verified: clippy and the player build; the lavapipe play that uses it is the check. |
||
|
|
a36ac51121 |
translator: the identity domains' refusal names the first form the function holds that they do not lower
The identity gate (lower::select's identity_admits) answered Unsupported{IdentityDomains, NotImplemented}
for every plan it does not admit, with nothing saying which of its conditions failed. It now
names the first form the plan holds, in the refusal's symbol (diagnostics only), by what a
program does that takes it: a stage off the floor's push window, an encoder value it reads as a
push field outside the identity set, a buffer argument not reached by its device address, an
argument buffer's texture of a type, depth comparison, raw or cross-type read the identity arrays
do not take, a handle that reads its table entry beyond its element, a texture argument with
state beyond its resource ID, a sampler form (a texture argument sampled through a sampler the
identity sampling does not take, a sample of an argument buffer's texture, an argument buffer's
sampler, an array of samplers, a bicubic filter, a specialized sampler argument), a runtime fact
of bound state, or a descriptor. The checks and their conjunction are unchanged
(identity_refusal is None exactly where every condition held), so an admitted plan is lowered as
before; only the refusal's symbol is new, and only under the identity domains, which the new
runtime alone takes.
A test confirms which form argument buffers tier 2's pointer indexing takes (engine/ab_tier2's
ab_indexed: thread g reads the texture of element g of the argument buffers a pointer member of
the bound one reaches): on lavapipe and the M3 profile its plan reads the root table
(PushField::RootTableAddress), whose address the identity domains do not push, so it is refused
naming that, while the default domains compile it and the identity domains lower ab_copy and
ab_read. docs/API.md's identity paragraph names the form and says the symbol names the first one.
Verified: probe job m3-max-52000 (gem10, the gate change with the form unpinned) read
"an encoder value the function reads as RootTableAddress" for ab_indexed on lavapipe, and
a_bicubic_kernel_is_refused_under_the_identity_domains passed beside it; refusal_surface --check
is clean. The pinned test's run is the next check job.
|
||
|
|
758d485660 |
conformance: the multisampled twin recorded on the M3 Max
Metal's answers (an Apple M3 Max, macOS 27.0.1 build 26A434, three runs, job m3-max-51921, record and times in one job): pipeline-facts-render-multisampled-direct answers imageblockSampleLength 12 and imageblockMemoryLengthForDimensions: 1536 at [8, 4, 3], as the multisampled case with indirect-command support does, and supportIndirectCommandBuffers false. The old runtime replayed both on the M3 (MoltenVK) exact in the same job. rt's README line on the rule's measurements names the twin. docs/CONFORMANCE-COVERAGE.md regenerated. Verified: job m3-max-51921 (BUILD_CONFORMANCE=0, RECORD=0, TIMES=0, REPLAY_OLD=0, both cases exact on the M3). The new runtime's comparison is the next check job. |
||
|
|
f3e9f517bd |
conformance: the narrow-attachments and depth-stencil facts recorded on the M3 Max
Metal's answers (an Apple M3 Max, macOS 27.0.1 build 26A434, three runs each, job m3-max-51875, record and times in one job): - pipeline-facts-render-narrow-attachments, R8Unorm then RG16Float: imageblockSampleLength 6 and imageblockMemoryLengthForDimensions: 192 at [8, 4, 3]. RG16Float sits at byte 2, its component's alignment, which is the rule metal::format::color_record holds ([(0, 1), (2, 4)]); packing tight would answer 5, aligning every texel wider than a byte to 4 would answer 8. - pipeline-facts-render-depth-stencil, RGBA8Unorm then RGBA16Float with Depth32Float_Stencil8 as depth and stencil: 12 and 384, the same as the two colors without it, so depth and stencil take no room. The old runtime replayed both on the M3 (MoltenVK) exact in the same job. The case comments and rt's README line on the rule's measurements state the two values. known-gaps-rt.tsv gains each case's five rows on every venue that pipeline-facts-render-plain already holds: device and label (the consumer's own) and the three tile getters (the libs census). docs/CONFORMANCE-COVERAGE.md regenerated. Verified: job m3-max-51875 (BUILD_CONFORMANCE=0, RECORD=0, TIMES=0, REPLAY_OLD=0, both cases exact on the M3). The new runtime's comparison is the next check job. |
||
|
|
30156e1aaf |
conformance: the new runtime's side answers pipeline state facts, label, device and the tile getters refused fields
compute_pipeline_facts and render_pipeline_facts were left at the Side default on the rt side, so the two pipeline-facts cases whose state rt makes (pipeline-facts-compute-plain and pipeline-facts-render-plain) refused the whole facts call. Both now answer through the state: - compute: staticThreadgroupMemoryLength, supportIndirectCommandBuffers (false on every state rt makes), imageblockMemoryLengthForDimensions: and requiredThreadsPerThreadgroup, the last two getters present landed in 90792a2bfa; - render: imageblockSampleLength, imageblockMemoryLengthForDimensions: and supportIndirectCommandBuffers. label and device are the consumer's own (rt keeps neither on a state), and a drawing state's three tile getters (maxTotalThreadsPerThreadgroup, a tile threadgroup's, per Metal's documentation of the render state's getter, threadgroupSizeMatchesTileSize and requiredThreadsPerTileThreadgroup) are not rt's, as rt makes no tile render state (the planner's ruling). Each is a refused Field, so the state's other getters compare. imageblockMemoryLengthForDimensions: of a compute state is a Field too, as rt answers it with a typed error for a kernel whose imageblock it does not measure. Rows: 7, every venue: label and device of both cases (the consumer's own), and the three tile fields of the render case, in words (rt's README names the tile getters it lacks). The rt README's tile getter list gains maxTotalThreadsPerThreadgroup. The coverage document gains the two facts types' field rows. The other four cases are refused at the making as before (indirect command buffers, and the kernel that reaches an imageblock). Verified: coverage.py writes the document; build, tests and the lavapipe replay of both sides follow in the check job. |
||
|
|
ee1a8aee7c | REPLAY-STREAM: the new runtime's player binds a range as the single-slot bind of each | ||
|
|
d75eab9c2b |
validation: the per-command-buffer compare of two plays applies the cover rule, word by word
The 3090 chain gate compared rt's and the old runtime's plays command buffer by command buffer through a probe that never lands: whole-object checksums of each buffer a command buffer named, then a script that asked the probe's dumps of Covers. A whole-object checksum is no compare under the cover rule: a buffer partly under a texture's write differs under the cover, and a word that differs outside it shows only as the same mismatch. This lands the compare in the player's own tooling, on the player's own Covers (94d7c1620c's rule, unchanged). - Player::dumping(command buffers, dir): once each listed command buffer completed (its wait seen, before the next call plays), every buffer its encoders named is written into dir as cbC-objO.bin, with cbC-objO.cover holding the ranges of it the cover rule held covered then, or cbC-objO.unread where the backend could not read it. A write failure ends the play (PlayError::Dump). Off unless asked. - compare_dumps(a, b) (replay/dumps.rs) compares two plays' dumps word by word, leaves out a word wholly inside a range either play held covered (the old runtime answers no slot access, so its plays cover less), and reports every other differing word per command buffer and buffer, a dump one play lacks, and a dump either could not read. - command-replay: --dump-command-buffers FIRST..LAST --dump-dir DIR on play; compare-dumps --a DIR --b DIR prints a line per buffer that differs outside every cover and a summary ending agree or DIFFER, exit 0 / 1 / 2. - Covers::ranges(object), read-only, for the dump. - docs/REPLAY-STREAM.md, section 10: the options, the files and the compare's lines. Tests (no GPU, the player on the test backend, two plays each that differ only in the words at bytes 0x10 and 0x1800 of a 0x2000-byte heap buffer whose first 0x1000 bytes a texture's write covers after the command buffer bound it): - replay::tests::the_dump_compare_reports_a_differing_word_outside_every_cover: the dump's cover is 0..4096; the word at 0x10 is covered, the one at 0x1800 (word 1536) is reported; DIFFER. - replay::tests::the_dump_compare_reports_a_word_whose_cover_the_buffer_s_last_write_voided: the encoder binds the buffer again after the dispatch (a binding counts as a write), the dump holds no cover, and both words are reported. - replay::tests::the_dump_compare_agrees_on_alike_plays_and_reports_a_dump_one_play_lacks. The test backend now keeps a heap buffer's bytes as it keeps a device buffer's, so a write into one reads back. Verified: the check job named at hand-over compiles it and runs the replay tests. |
||
|
|
0c36de79d9 |
replay: a surface's pictures fill its shapes at their first use, as the product's lazy fill does
m2v.externalWriteDone (a decoded picture landed in a receiver buffer) no longer refills the buffer's shapes at once. As the product's per-shape form does after a video command buffer, every shape of the buffer owes a fill from it, its own write lost; the first command buffer whose encoders use a texture of the buffer (a binding, a pass's attachment, a blit, a useResource) fills every owing shape of the buffers it uses before its commit, by blits in a command buffer of the player's own committed then. A picture another lands over before any use is never copied. The eager form copied every picture at its landing, so a burst of pictures landing at one present was copied there whether used or not. New counters: surface_pictures_filled (pictures a fill took) and surface_pictures_unfilled (those another landed over before any use, or whose buffer went first); the surfaces line also gives the pictures not used yet. The copy-from-guest-RAM comment now names the product's fill from the pages, not a refill. docs/REPLAY-STREAM.md sections 4 and 10 say so. Verified: the new device test a_surface_picture_fills_its_shapes_at_their_first_use (two pictures land before a kernel reads the texture: one fill of one shape, the second picture read, the first never copied) runs in the check that follows this commit; not yet run. The eager form fails it (two refills). |
||
|
|
71d767c904 |
translator: the storage-texture fact names the texture access type the air crate now exports
What: metal2vulkan-air exported intrinsics::Access only under cfg(test), so the unbound analysis of 0a810a7ab5 did not compile (E0432). The air crate now exports Access (Form stays test-only), the type of Texture's public access field. The analysis counts a read or block read through a loaded texture as a storage access unless the operation declares access::sample or access::read, so a read that declares no access (an emitter before AIR 2.0) counts, as the fact's 'false is proven' needs. The interface and API.md docs say so. Verified: cargo fmt; signatures.py --check gives no diff. The check job compiles it. |
||
|
|
4231c5ba25 |
rt, translator: a declared write of a texture with no storage element refuses the argument-buffer dispatch
What: bug 4's held path. A compute encoder's use_resource with a usage that writes a texture (or a view of one) made for shader writes with no storage element (Texture::unstored) now makes every later dispatch of that encoder whose kernel may reach a texture through its storage image beyond its bound slots Gap::StorageElement, with no slot and the texture's format. A kernel without such an access dispatches whatever is resident, and use_heap declares nothing (Apple's header: useHeap declares the heap's resources read only through an argument buffer), so a write through a resource ID with no write-usage use_resource stays dropped, outside documented Metal. How: the translator had no fact for that access (writes_unbound_resources with texture_writing_stages would also refuse a kernel that writes a bound texture and a buffer through an argument buffer), so StageInterface and PipelineInterface gain unbound_storage_textures, decided in compile/unbound.rs beside the read and write facts: a texture write or atomic, or a read of a texture the operation declares access::write or access::read_write, on a handle that may come from memory, an integer or a call; an intersection or a call the entry cannot see into counts; indirect-command and acceleration-structure operations touch no texture. Gap::StorageElement's slot becomes Option<u32>. The render encoder builds no useResource:, so the draw half has no trigger; the README says it waits for it. SEMANTICS_VERSION 2190 -> 2191 and ARTIFACT_FORMAT_VERSION 547 -> 548 (one field in StageInterface and PipelineInterface). docs/REFUSALS.md regenerated; api_signatures gains the field and the variant's new shape; docs/API.md states the fact; the rt README's known gap says what is refused and what stays dropped. Tests: the translator's unbound-facts test states the new fact (an argument buffer's texture write and a read_write read count, a sample and a read do not); storage_element gains every_device_refuses_a_declared_write_of_a_texture_with_no_storage_element over RGBA8Unorm_sRGB, BGRA8Unorm_sRGB, A8Unorm and an sRGB view of an RGBA8Unorm texture, and the same formats in a heap under use_heap alone. Verified so far: cargo fmt; refusal_surface.py, signatures.py --check and metal-coverage --check give no further diff. The build, the suites and the device legs follow in potluck jobs. |
||
|
|
a2576535bd |
replay: a plain surface shape takes shader read and render-target usage alone
The surface form's usage word, as ruled final. A shape no texture over it declares shader write, shader atomic or Metal's unknown usage for (a plain shape) is made with shader read and render-target usage alone: rt gives such a texture its format and that format's sRGB sibling as views, and no storage view, so a plain shape's attachment reads are not refused and its image carries the short view list. A shape shaders may write keeps the usage Metal gives a texture whose use it does not know (shader atomic where declared), with the long view list, so a storage plane's textures of other formats of the same bytes a texel stay views of it with no copy. A texture or view of a format other than a plain shape's own or that format's sRGB sibling is refused (surface_format_refusals), and textures over a plain shape that declare pixel-format-view usage are counted (surface_plain_format_views). docs/REPLAY-STREAM.md section 10 says so. Verified: the new test a_plain_surface_shape_views_as_its_format_and_its_srgb_sibling_alone (a sibling view found, another format refused as a texture and as a view, counted) runs in the device suite of the check that follows this commit; not yet run. |
||
|
|
0b8fe27977 |
replay: the surface form counts order-case shapes
surface_order_shapes counts the shapes shaders may write made over a plane that holds a shape of their extent shaders may not write: the order case, which the storage bit makes another shape. The doc's counter list reflows. Not yet compiled. |
||
|
|
a5f4f03a32 |
replay: the surface form counts the slot writes a pipeline state's interface declares
surface_declared_writes counts the draws' and dispatches' surface texture slots whose bound state's interface writes them, beside surface_usage_writes, those taken as writes by usage with no interface at hand: together they say which binds write a shape. Not yet compiled. |
||
|
|
079fe12625 |
replay: a surface shape takes storage for shader atomic usage too; the shapes' sort and drop count as clippy and the type checker want
The planner's storage test is shader write, shader atomic or unknown usage (an image atomic is a storage image's operation); a shape made for a texture that declares shader atomic carries it. The idle shapes sort by recency with sort_unstable_by_key, and the overlap drop's count filters by reference. Not yet compiled. |
||
|
|
aa8dd9f131 |
replay: surface textures play as the product's per-shape form, with the usage word
The rt player's surface form now mirrors the product's per-shape form (reims's surface cache, shapes.rs): a shape is a plane's (receiver, plane, offset, pitch) texture of one extent and texel size, and every shape is current over its whole extent by the product's three rules. A new shape is filled from the buffer once the dirty shapes are written back; a copy back to the guest's RAM first writes every dirty shape back; at the end of an encoder that may have written a shape, the write goes through the buffer into each other shape of its plane that a live texture views or that is dirty, and the plane's other shapes go. Writes are noted from pass attachments, blit destinations, the slots the bound pipeline state's interface writes (texture_accesses), and by usage where no interface is at hand. The newest-entry rule, its download at a new shape and the older-shape use counter are gone. The usage word: a shape is made with shader read, render-target and pixel-format-view usage, and shader write (a storage view) only for a texture that declares it or Metal's unknown usage; the shape key carries that bit. A storage shape serves a later texture of its extent that does not declare it; a declaring texture over a plane whose shape has no storage is another shape. The report and counters give overlap copies and bytes, straddled texels, unordered writes, usage writes and write-backs. The device test now checks a copy from the guest's RAM reaching both shapes of a plane and a blit through one shape reaching the other at its encoder's end. Not yet compiled. |
||
|
|
cce95596b4 |
rt: a threadgroup within Metal's limit for the kernel and past this device's is the device's Limit, not Metal's refusal
A compute state answers the least of Metal's maxTotalThreadsPerThreadgroup for the kernel and
this device's limits for it (maxComputeWorkGroupSize, its subgroups' count, and for emulated SIMD
groups their scratch beside maxComputeSharedMemorySize). A dispatch past that answer was
Refusal::ThreadgroupSize, which states that Metal itself refuses the threadgroup: on lavapipe
compute-threadgroup-simd-scratch's 1024 threads, which Metal runs, were refused as "past the
state's 256" and the suite counted our refusal where the old runtime reports the device's lack
(MaxComputeSharedMemorySize 32768 against 57344).
The interface keeps Metal's own answer beside the state's
(ComputePipelineMetalInfo::metal_max_total_threads_per_threadgroup, or a required size's
threads). A threadgroup past Metal's answer stays Refusal::ThreadgroupSize; one within it and past
the state's is the new Limit::ThreadgroupThreads { size, max }, basis device. The conformance
crate's rt side reads that limit as the venue's lack, as it reads the translator's device gaps.
REFUSALS.md and api_signatures.tsv regenerated.
Verified at this commit: cargo fmt, refusal_surface.py, signatures.py --bless and coverage.py
--check; the build, the suites and the lavapipe replay (where the case should read lacks-feature)
run in the lane's check job.
|
||
|
|
451f6e9900 |
conformance: the function and library facts' device and options rows on every venue
The new runtime's side refuses two fields of these facts: the device relation of a library and a function (the consumer's own, device), at 24 cases' case/facts/device, and a function's options (memory2's libs census 11-19, m3-max-51379..51431: every function descriptor of the 17 streams has options 0), at 22 cases' case/facts/options. Each row is one m3-max-51389 replay on lavapipe listed as unlisted, every other field of these cases comparing exactly there; the facts reach no device, so the rows hold on every venue. The coverage document counts them by field. Verified at this commit: the rows are those m3-max-51389's rt lavapipe replay lists (46, site and answer as listed); coverage.py --check. |
||
|
|
ad7c6b4fa8 |
conformance: binary archives are the consumer's own, the descriptors' binaryArchives field and the archive programs
reims keeps binary archives in its guest bundle: the device's MTLBinaryArchive holds only each added function's lookup key, serializing and loading use the bundle's own file format, and no message reaches the host, so neither runtime is ever asked. The planner ruled them the consumer's own (ConsumerObject::BinaryArchive, "MTLBinaryArchive, binaryArchives", named in rt's README). Rows on every venue: the six pipeline descriptor cases' binaryArchives field, which the new runtime's side refuses, and the six binary-archive cases' archive programs (case/program), which it leaves at the trait's default. The dynamic-library cases and library-from-data share the archive program and are not archives, so they keep no row. Verified at this commit: cargo fmt and coverage.py --check; the ledger and the replay run in the lane's check job. |
||
|
|
df4903b21a |
conformance: the new runtime's side answers function and library facts, the device and options refused fields
RtSide left function_facts, function_facts_from_descriptor and library_facts at the trait's default, so 24 cases ended refused on rt (15, 7 and 2 on the earlier whole-set run). The runtime's library is the translator's and a function is the translator's function of it, so the side reads each getter as a consumer holding them does: the library's functions a program makes by name (a Core Image kernel library's extern functions left out, by the translator's own stage), its type and install name; a function's reflected properties and constants dictionary, through Function::properties, or Function::specialized_properties for a function made with constant values, whose dictionary the translator states is empty, as Metal answers it. The old runtime's side shares the attribute and constant-value helpers, which move into function_facts. FunctionFacts takes options and the device relation as Fields, and LibraryFacts the device relation. The runtime keeps no device on a library or a function, so device is the consumer's own, as the planner ruled (ConsumerObject::Device, named in rt's README); a function keeps no MTLFunctionOptions, so options is refused, its rows waiting on memory2's every-stream count of function options. Failure derives Eq, so every facts type keeps its Eq. Verified at this commit: cargo fmt only and coverage.py --check; the build, the suites and the lavapipe replays run in the lane's check job, whose replay names the device rows' sites. |
||
|
|
f297ec44b6 |
conformance: the new runtime's side answers the rising-value probe, its label a refused field
RtSide left Side::shared_event_rises at the trait's default, so shared-event-rising-value ended refused on rt. The probe's host sets, GPU signals and bounded host waits are the runtime's shared event's, made as the old runtime's side makes them; the runtime keeps no label, so EventRise's label becomes a Field the side refuses (the consumer's own, label), with its every-venue row, and the coverage document counts EventRise by field. Verified at this commit: cargo fmt only and coverage.py --check; the build, the suites and the lavapipe replays run in the lane's check job. |
||
|
|
4913a812df |
conformance: the coverage document counts a field-by-field facts type by field, and rt's label rows
A facts call running said nothing of which of its fields were compared, so a field the new runtime's side refuses read as covered beside its call. The coverage document gains a section that counts each facts type answering field by field (a struct with a crate::case::Field field) by field: its fields, the ones a side may refuse, the leaf each records at (read from the type's node), and the new runtime's ledger rows that refuse each at that leaf, of the cases whose module calls a Side method answering the type. A Field whose node records it at no leaf this can read stops the generator. The six pipeline descriptor cases' label rows (pipeline-descriptor-* and compute-descriptor-*, every venue: the consumer's own, label) go into known-gaps-rt.tsv. Their binaryArchives rows wait for memory2's every-stream count of binary archives, which their head will cite. Verified at this commit: coverage.py --check passes on the regenerated document; the build, the suites and the lavapipe replays run in the lane's check job. |
||
|
|
b683148a41 |
rt, translator: the identity domains give a SIMD-group's threads no lockstep order
What: under the identity domains (the new runtime's profile) the translator no longer inserts the barriers that make Apple's SIMD-group lockstep explicit (`lockstep::order`): `OrderKey::of` is `None` there and `ordered_entry` takes the specialized entry as it is. The resident-table domains (the old runtime's) keep the order until the cutover. With no lockstep barrier on the new runtime's path, its one-row machinery is dead and deleted: `Compiled::rows`, `pipeline::one_row`, `encoder::Module::Rows`, `keeps_rows` and `choose`'s `rows`, the `OneRow` and `RowLockstep` arms, and the translator's `CompiledFunction::runs_lockstep_barriers_in_rows` with `KernelFacts::lockstep_in_rows` (the API signature table; the version numbers rise in the branch's last commit). Why: documented Metal orders the threads of a SIMD-group only through barriers and atomics; the Metal Shading Language calls two of them that conflict between barriers a data race. The order was an emulation of undocumented Apple-GPU behaviour (owner's rule 1). Its barriers made 1,443 of 5,368 distinct kernels of the recorded streams observe their threadgroup partition, every pair of them unproven, and they stopped partial-threadgroup dispatches the variant cannot run (rt's frame-320 and frame-335 refusals of the 30-wide kernels). docs/API.md's accepted differences gain one entry, the conformance case `simdgroup_lockstep` leaves its output words unchecked against it, and CONFORMANCE-COVERAGE.md and REFUSALS.md are regenerated. Tests: the identity-profile one-row test becomes `the_identity_domains_order_no_lockstep_pair` (barriers under the default domains, none under the identity domains, the partial variant in tiles); the harness's cells test keeps the old domains' one-row facts and adds the identity domains' none; rt's one-row tests and the row-lockstep tree test go, and `row_cells` runs every grid on its tiles' pipeline made with the state. Verified: cargo fmt; coverage.py and refusal_surface.py regenerated. Clippy and the suites run on the check job named when the branch is handed over. |
||
|
|
ac72291f01 |
translator: the binder writes a slot's biased word under the identity domains; the slot-pointer test drops ptrtoint; the old render key re-pinned
Three failures of the landed biased slot word (development's suite, job 51276):
- engine_identity::the_binders_edge_regions_set_multi_region_on_from_queries_and_store_metals_grid
trapped out of bounds at 0x6_8000_0000: the translator's own binder
(BindingPlan::instantiate_*) still wrote SlotGuestBase as gpu_address + offset, while a
pipeline compiled under the identity domains adds 2^31 back to that word. This was a code bug in
the landed change. rt was not affected: it writes its own push (pipeline::address_word) and does
not use the binder. The binder now writes the word less 2^31 (bind::instantiate::guest_word)
wherever the plan's device compiles under the identity domains. The flag is
ResourceTemplate::biased_slot_words, set by the compute and render planners. All three writers
read it: slot_field, the render rebind's bases and its loose words. RUNTIME_VERSION
2538 -> 2539: a run of an unchanged plan pushes another word under the identity domains. The
runtime sources' pin moves with the binder's files.
- engine_identity::a_slot_pointer_used_as_a_value_is_its_metal_address was refused at compile
(Unsupported{IdentityDomains}, not implemented). Its ptrtoint makes the slot pointer a wide
pointer, which reads the root table, a push field identity_admits does not admit. The refusal
is the test's premise, not the bias: select and the plan are unchanged by the bias. The test
now covers two address compares and two loads, one 4 bytes below a bind address, with the two
slots on either side of 2^31: their words lie on either side of 0, so a compare of the words
would answer the other way. A new test,
a_slot_pointer_converted_to_an_integer_is_refused_under_the_identity_domains, pins the ptrtoint
refusal on both profiles, where the default domains compile the kernel. docs/API.md section 5
says so; it no longer claims that a converted pointer reads the bias back.
- pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value: the key moved only
because SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION moved (2186/544 -> 2188/546); the
fixture's bytes are unchanged. Re-pinned to the value job 51276 computed.
|
||
|
|
f6032c796c |
rt: a render encoder sets the alpha test reference, and alpha-test states are made
A gap against the old runtime. rt refused every render state whose fragment
runs the private alpha test (PrivateRenderState::alpha_test_enabled with a
compare function other than Never or Always): the translator pushes
PushField::AlphaTestReference there, and render.rs draws() mapped no value for
it, so new_render_pipeline_state answered Gap::RenderPipeline { DrawInput }.
Nothing drew against an unfilled push word; Never and Always states, which read
no reference, were made and drew right.
Now RenderCommandEncoder::set_alpha_test_reference_value(f32) (Apple's
setAlphaTestReferenceValue: SPI) keeps the reference's 8-bit unorm code in the
encoder's state, Metal's 1 until set, not kept across encoders (the old
runtime's rule, from probes on an Apple M3 Max, macOS 27.0.1); draws() maps the
field to FieldValue::AlphaTestReference, and a draw pushes the code. A change of
code refills the push bytes; an equal one records nothing new. The code is the
translator's: bind::alpha_test_code, now public (api_surface row, docs/API.md
line), so rt and the binder compare as Metal does through one function.
Test: tests::alpha_test draws green at alpha 0.6 (code 153) under Greater, one
quadrant a draw through scissor rectangles: the default reference and 0.75
keep the clear, 0.25 (held across draws) draws, and a second encoder starts at
1 again (its whole-target draw changes nothing) until 0 draws. README and the
API signature table updated.
Verified: build and device legs follow.
|
||
|
|
e74d7ab714 |
conformance: record visibility-disabled-reset and -accumulate on the M3
Metal's answers (an Apple M3 Max, macOS 27.0.1, job m3-max-51288, record and times in one job): every word stays as it was in both passes, the pass with no mode and the pass with Disabled at both words, under Reset (0xaa bytes) and under Accumulate ([100, 7]), as the lane table in cases/visibility.rs states. docs/CONFORMANCE-COVERAGE.md regenerated. |
||
|
|
42f9e9137f |
rt: a pass keeps its visibility result buffer; Disabled is the visibility mode built
The two tessellation streams' render passes set a visibility result buffer and enable no mode; rt skipped every such encoder (Unheld(visibilityResultBuffer)). On an Apple M3 Max (macOS 27.0.1, job m3-max-51220) a pass with the buffer and no mode leaves the buffer's bytes as they were under Reset and under Accumulate, so the planner's minimal form is exact and carries no note. - RenderPassDescriptor.visibility_result_buffer: checked for its device (Refusal::OtherDevice) and kept by the command buffer until it retires, as Metal's pass holds it. It declares no access and joins no hazard set: no command of the pass reaches it. - RenderCommandEncoder::set_visibility_result_mode: Disabled at any offset is a no-op; Boolean and Counting are Gap::Draw of the new DrawKind::VisibilityResults. - visibilityResultType is not a field: it decides only what an enabled mode writes. - Device test: the pass draws, the buffer's gauge holds after the test's handle is gone and falls once the command buffer retires, its bytes are unchanged, and the pass takes the submissions, barriers and passes of one without it. - Conformance: the rt side passes the buffer and the mode; new cases visibility-disabled-reset and visibility-disabled-accumulate (no mode in one pass, Disabled at both words in the next); recordings follow from the M3. - Player: setPass's visibilityResultBuffer goes into the new field (a skipped buffer still marks the pass unheld). - rt README, api_signatures and docs/REFUSALS.md regenerated. Verified: cargo fmt only so far; builds, clippy and device legs follow as potluck jobs. |
||
|
|
9c2288b3ae |
REPLAY-STREAM: the refills' bytes and GPU time among the surface counters
681a736c40 added surface_refill_bytes and surface_refill_gpu_nanos and the longest refill command buffer on the surfaces line; the doc's list of the counters now names them and says which frame a refill's GPU time falls in. Doc only. |
||
|
|
d95591c966 |
replay: the rt backend plays textures over a surface as views of one texture per receiver range and shape
The rt backend played newTextureWithDescriptor:iosurface:plane: as a substitute, an ordinary texture whose texels are undefined, so two textures over one surface shared nothing and the 3090 chain's rt plays varied where the old arm, which plays the texture over its receiver buffer, repeated. It now plays it as the product makes it: one Device::new_texture_for_views texture (an entry) per receiver range (receiver buffer, plane, offset, bytesPerRow) and shape (width, height, bytes a texel), with shader read and write, render-target and pixel-format-view usage, and every recorded surface texture a view of it at the texture's own index. The receiver buffer holds the pages' bytes as the stream writes them: - a new entry is filled from the buffer by a blit in a command buffer of the backend's own, committed at the making: after every earlier commit, with no wait; - a new shape over a range first downloads the range's newest entry into the buffer at that entry's extent, then fills the new entry, so bytes map by byte offset; an older shape's entry goes once no texture of it lives and is not kept current, and the calls that name such a texture after a newer shape are counted (surface_older_uses), argument buffers unseen; - a copy from the guest's RAM into a range also copies the range into its newest entry, and a copy back first copies the newest entry into the range, both in the copy's own blit encoder: replace_region would land ahead of the encoders already in the command buffer, and get_bytes would add a wait the old arm does not have; - a recorded CPU write into a range uploads the texels it covers (replace_region) until the buffer's first m2v.externalWriteDone, the new record of another API's write landing (a decoded picture), which refills every entry of its buffer by a blit committed then; the old backend plays that record as nothing; - another call naming a receiver buffer as a buffer is refused, and a texture of a format that reads across a surface's two planes is skipped (skipped_surfaces_across_planes). The player leaves a receiver buffer's checks and snapshot ranges uncompared on every runtime (verdict receiver, a receivers line), as the texels live apart from it; the rt backend reads a texture back for a check, laid out as the old backend lays it out. The surface substitute key goes; substitutes_read counts the tiled and gap substitutes (and their views) a call named, the substitutes line naming the first, and the doc's claim that a substitute makes a play no gate result, which no code made true, now says what holds. The surface record's keys move to args.rs, shared by both backends. Census before building (job 51225, gb-3090-r3): 653 entries made, none after an uncommitted guest-RAM copy into their buffer, so a fill committed at the making misses no copy there. Tests: the surfaces unit test (the texels a write reaches); the player's receiver test; the device test of two formats over one surface, a new extent, a copy from the guest's RAM and an older-extent use. To be run by the check job. |
||
|
|
a615269526 |
replay: the covered line counts the covers a binding took off, as a binding may be a read
The stream carries no buffer access, so a buffer binding (set...Buffer...) or a useHeap: of the object's heap counts as a write and takes a cover off. That errs toward comparing; a residual difference in such an object's later compares may be the covering texture's bytes, not the play's. The report's covered line now says how many covers a binding took off. Verified: the covers unit test gains a fourth round (covered again, then bound) asserting binding_uncovers 1 and the new line; to be run by its check job. |
||
|
|
0c00926c84 |
replay: the rt backend tallies the textures over buffers held in an image of their own by pixel format and usage
The known-gap line for the pool side's copy at commit wants the classes of the textures the device's linear image does not take, per card; the report gave only their count. The backend now keeps, for each texture over a buffer the runtime held in an image of its own (the gauge rose across the making), its descriptor's pixel format and usage, and prints them, most first, on a 'textures over buffers in an image of their own, by pixel format and usage' line. REPLAY-STREAM.md lists it. |
||
|
|
2385a0a489 |
replay: the rt backend counts the render encoders it skips by kind
The tessellation plays reported skipped_encoders=214 (and 205) with no kind, so whether a pass met NoAttachment, a storage gap or a property the runtime's descriptor does not hold could not be told from the report. The backend now keeps each skipped render encoder's kind with its count and first frame and call, and prints `skipped render encoders KIND N, the first at frame F, call C`: `ParallelRenderCommandEncoder`, `Unheld(KEYS)` for a pass whose descriptor sets properties the runtime's does not hold, or the runtime's gap for the pass (Debug). The skipped_encoders count is unchanged. REPLAY-STREAM.md lists the line. |
||
|
|
94d7c1620c |
replay: a heap texture write covers what it meets; the compares leave it out until written again
Metal leaves an aliased resource's contents undefined once another resource is written over its memory. In a placement heap, a texture write over a buffer's (or another texture's) recorded range leaves the recording holding its runtime's layout of the texels there, and the play its own (rt shares the memory as a placement heap does; the old arm makes the heap's buffers and textures apart and keeps the bytes from before). identity's liveness pass over u4 (to frame 315) found 16,942 covers of a heap buffer's range by a heap texture write and no read through a covered buffer before its next write or release: the bytes are dead, and a compare of them is no verdict. The player now tracks, by structure alone (covers.rs), each object the stream places in a placement heap (its heap, recorded offset, and length: a buffer's own, a texture's as the runtime answers its size, read ahead) and the texture writes: a draw's or dispatch's to the texture slots its pipeline state's interface marks written (Backend::texture_writes; the new runtime answers from ComputePipelineState / RenderPipelineState::texture_accesses, the old runtime answers no slot access, so on it only the following count), a render pass's to every texture its descriptor names, a blit's to its destination, generateMipmapsForTexture:, a useResource:usage: with write usage and replaceRegion:. A write of a texture over a buffer is the buffer's. A texture write covers the bytes of every other object placed in its heap that its range meets; the object is written again by the player's writes into it (m2v.write, contents at creation, copies from the guest's RAM, a snapshot's bytes before), a blit into it, and, as the stream carries no buffer access, any binding of it to an encoder, a write-usage useResource:usage: or a useHeap: of its heap. A check of a covered object reports `covered` and a snapshot range meeting covered bytes `covered`, neither compared; a `covered N: ...` line counts the covers and what they left out. REPLAY-STREAM.md says so, and says gap_pipeline_ids is bookkeeping: nothing is skipped for it. Test (replay::tests): a placement heap with a buffer and two textures at offset 0; a dispatch whose state writes slot 0, which holds the first texture, covers the buffer and the second texture; their checks are `covered`; the buffer written whole is compared again, the second texture stays covered; a dispatch of a state that only reads the slot covers nothing. |
||
|
|
c4b38afdb8 |
rt and translator: a buffer slot's pushed word is its address less 2^31, and an access adds its offset plus 2^31, zero-extended
Under the identity domains a buffer slot aligned to its argument was reached as its pushed address
plus the access's 32-bit byte offset sign-extended to 64 bits. The sign extension is what keeps an
offset below the bind address exact, but a device cannot split a sign-extended offset into a
scalar base and a vector offset as it does a zero-extended one. Now rt pushes the slot's address
less 2^31, and an access adds its offset plus 2^31 (modulo 2^32) to that word, zero-extended. That
is the same address for every offset in [-2^31, 2^31), which the 2 GiB buffer cap guarantees, in
one 32-bit add that a device fuses with the index's shift. A unit index x + c with a constant c
folds c into the bias: (x + c) * s + 2^31 = x * s + (c * s + 2^31) mod 2^32. The builder notes
each u32 sum of a value and a constant for that; the note changes no emitted word.
One place on each side:
- rt: pipeline::address_word, used by the compute and render push writers for every
BufferAddress field: a bound buffer, a setBytes copy, or the nil buffer.
- translator: lower::access::pointer.
- biased_slot_address feeds the direct reach.
- slot_address (the word plus 2^31) feeds every other reader: an access from the word below
it, a pointer compare, ptrtoint, the memmove overlap's Metal addresses, and pulled vertex
fetch.
- The bias applies only under the identity domains and only where the word is pushed: a
replay variant reads the true address from its root entry.
Unchanged:
- A texture's or sampler's resource ID and the parameter block's address are not biased.
- A pointer loaded from an argument buffer keeps today's form: the address the buffer holds.
- The default domains, which the old runtime and the golden tables use, take no new instruction:
the readers there load and bitcast the field in the same order as before.
Argument-buffer pointers left in their form (planner's condition):
- They are 19.6% of the corpus's device and constant accesses.
- Time-weighted, they are 0.8% of accesses on the 780M stream gb-780m-u4 and 2.4% on the RTX 3090
stream gb-3090-r5.
- Kernels with any such access take 1.9% and 8.4% of those streams' GPU time.
Slot pointers used as values, in the entry functions of the corpus's 11,580 kernels (census over
the local sources shards):
- 781 (6.7%) use one as a value: 14 convert one to an integer, 46 compare one, and 731 store one.
Every such store but one writes private memory (a pointer cell); the one other writes device
memory.
- 3,511 (30.3%) pass one to a non-inlined function.
- 33 pass one to an air.* call (command encoding, intersect).
A ptrtoint and a compare read slot_address. A pointer parked in a private cell or passed to a
function stays a fat pointer, whose accesses take the forms above. The one store to device memory
makes a wide pointer, which reads the root table, a field identity_admits does not admit. A new
engine test, a_slot_pointer_used_as_a_value_is_its_metal_address,
runs a kernel under the identity domains with biased pushes on the interpreter. It does a ptrtoint
to i64 and to i32, an address compare, and loads 4 bytes below a bind address and 20 above
another, and checks each against the true addresses.
Probe numbers (measured: one particle kernel run alone on RADV 26.2.6, us per dispatch, best of
forward and reverse; the module's two positions accesses changed by hand). Biased form against the
plain zero-extended offset (inexact below the bind address), at subgroup size 32 and at the
driver's 64:
- RX 7900 XTX: 33.6 vs 33.6, 30.8 vs 30.6; at 4x the grid 374.6 vs 374.0, 273.1 vs 272.9.
- PHOENIX 780M: 168.1 vs 168.3, 121.1 vs 120.5; at 4x 2521.9 vs 2522.8, 1744.6 vs 1752.8.
- HawkPoint 780M: 173.3 vs 173.2, 122.5 vs 122.7.
The sign-extended form it replaces measured, at 32:
- HawkPoint: 189.8 (same job), 9.5% slower.
- PHOENIX at 4x: 2735.3 (same job), 8.5% slower.
- XTX: 35.9 (another job), 6.8% slower.
The XOR form with a host-biased word (V7) measured 178.8 on HawkPoint: the add is the one that
fuses.
The tests:
- The identity engine tests push the biased word through engine_word_phases::slot_word.
- rt's three hand-made test kernels (ADD, STEP, WIDE) add 2^31 to each slot word. Their arrays
are regenerated from the doc GLSL with glslangValidator --target-env vulkan1.2 and checked with
spirv-val. Today's GLSL reproduced today's arrays exactly before the edit.
docs/API.md (sections 1 and 5), PushField::SlotGuestBase's doc and rt's README known gap on the
2 GiB cap state the word and the form.
SEMANTICS_VERSION 2186 -> 2188 and ARTIFACT_FORMAT_VERSION 544 -> 546. The identity nolockstep
lane holds 2187 and 545, unlanded; these take the next numbers so the two land separately.
|
||
|
|
f811bb4716 |
rt: a blit encoder releases an exported block to the other API, in its command buffer
The read direction of an export: another API (a video encoder) reads what a blit wrote into an exported block. BlitCommandEncoder::release_to_external(&buffer), which Metal has no counterpart of, records one buffer barrier into the encoder's command buffer after every earlier command: the whole block's release from rt's queue family to the acquire's other family (EXTERNAL for an opaque handle, FOREIGN_EXT for a dma-buf), src ALL_COMMANDS / MEMORY_WRITE. No submission of its own, nothing on the submit thread, no wait. It is a write use of the buffer for the encoder's ordering: textures over a buffer in the block copy back first, and since Vulkan ignores a release's second scope and only ALL_COMMANDS waits for it, the barrier after it is owed (Building::release_command, beside owe_pass; the flag owed_pass is now owed_all), paid by the next command or the command buffer's end barrier. Counted in Metrics::external_releases and Metrics::barriers. A buffer whose block is not exported is Refusal::NotExported (its doc and Display now name the release too). Release after release without an acquire is the spec's own case (7.7.6 NOTE: "It is valid to never call the acquire operation after a release, and instead simply start using the resource on any queue (even the releasing queue), but the contents should be reinitialized before being read"), so the next frame's blit needs no acquire. The README and the acquire's doc state the read direction's contract: the other API reads from the command buffer's completion; from the call until the consumer's next write through the runtime, the runtime reads nothing of the block and the consumer encodes no read of it. The export device test now releases through the call, twice in two command buffers with no acquire between (fill, release, fill, release), and the second device reads the second fill's bytes; a release of a buffer in a taken block is NotExported; external_releases grows by 2. REFUSALS.md and the API signature table regenerated; the replay's metrics name external_releases. Verified: build and device legs follow (job ids in the lane's report). |
||
|
|
0ecac16dd3 |
rt: a render state answers Metal's imageblock sample and memory lengths; one imageblock gap
The consumer asked for RenderPipelineState's imageblockSampleLength and
imageblockMemoryLengthForDimensions:. Metal's render answer is not 0 without an explicit
imageblock: it counts the color attachments' texels (measured on an M3 Max and an M4, and kept
by the translator as metal::format::imageblock_sample_length: [R8Unorm, R32Float] is 8). rt makes
no state whose fragment function reaches an imageblock (RenderPipelineKind::Imageblock), so a
state's sample is its colors alone, computed once per content from the descriptor's color
formats; the memory length is that times the width, the height and the raster sample count, none
rounded, as the old runtime answers it from the same measurements. A color format with no
measured place in Metal's record answers the gap.
The gap is one variant for both states: Gap::ImageblockMemoryLength { dimensions } becomes
Gap::ImageblockLength, which the compute state answers for a kernel that declares an imageblock
it never reaches (or whose compile kept no reflection to tell) and the render state for an
unmeasured color format. The compute state's imageblock_memory_length_for_dimensions answers u64,
as the render state's does.
Test: every_device_answers_a_state_s_metal_answers also makes a render state of R8Unorm and
R32Float colors: 8 bytes a sample, 512 for 8 by 8 pixels of one sample. README (render states;
the compute paragraph's gap name), api_signatures.tsv and REFUSALS.md regenerated.
Verified at this commit: cargo fmt only. The build and device legs run on the lane's tip.
|
||
|
|
c57b0436c8 |
rt: a compute state answers Metal's static threadgroup memory, execution width and imageblock length
The consumer counts each Metal answer rt holds but does not give. ComputePipelineState now
answers three more, each from its whole module's translation, kept per content (Answers):
- static_threadgroup_memory_length(): staticThreadgroupMemoryLength, the translator's
ComputePipelineMetalInfo::static_threadgroup_memory_length (rounded up to 16 as Metal reports
it); the threadgroup memory rt adds beside it is not counted.
- thread_execution_width(): threadExecutionWidth, the translator's thread_execution_width, 32 on
every device (the old runtime answers the same value from the translator): a kernel that
observes its SIMD group runs it 32 wide, and one that does not cannot tell its width.
- imageblock_memory_length_for_dimensions(dimensions): 0 for a kernel that declares no
imageblock. rt makes no state for a kernel that reaches an imageblock (the translator records
RuntimeFact::ImageblockSize on its first use, which the interface refuses as Gap::KernelInput),
but the translator plans only used parameters, so a kernel that declares an imageblock it never
reaches does get a state. For it, and where the compile kept no reflection to tell, the answer
is the new Gap::ImageblockMemoryLength { dimensions }: no authored case measures Metal's length.
Whether the kernel declares one is read once per content from the reflection its compile kept
(ComputePipelineDescriptor::reflection over StageSource::Compiled, decoding nothing).
Test: every_device_answers_a_state_s_metal_answers (device cfgs): the harness's block_scan
answers 1024 bytes of static threadgroup memory (256 words), sample_down 0; both 32 wide and an
imageblock length of 0. README (compute states), api_signatures.tsv and REFUSALS.md (26 -> 27
gaps) regenerated.
Verified at this commit: cargo fmt only. The build (clippy of rt under both device cfgs) and the
device legs run on the lane's tip.
|
||
|
|
8a8ce7f7cf |
Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development` while this branch was in flight, so the copy committed here counted a smaller one. Verified: regenerating at this tip leaves no change beyond the `Generated at` stamp. |
||
|
|
aaccee3ca8 |
conformance: copy-out-strides recorded on the M3 Max (macOS 27.0.1, m3-max-51024)
Metal's answer on all 14 sites is the stride model: each row at its offset plus the row index times the stride, the bytes between and after the rows 0xcd. docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py). |
||
|
|
18c52e7a8c |
rt: a heap's resources take one id in the hazard sets, the heap's
What: every buffer and texture placed in one heap takes the heap's id in the compute encoders' hazard sets, whatever its tracking mode and whatever bytes it reaches. A heap is the one at its offset in its block (`HeapRange`); `HeapIds` maps each to an id that lives while a resource of the heap does, the entries of gone heaps dropped once the map doubles (at least 64). Textures placed by `new_heap_texture` take it at once. Buffers take it through the new `Device::new_heap_buffer(heap, offset, length)`, `MTLHeap`'s `newBufferWithLength:options:offset:` (a buffer past the heap's end is `Refusal::HeapBufferPlace`); a buffer placed by `new_buffer` is no heap's and keeps its own id. Views take their parent's; a texture in place over a heap buffer takes the buffer's. Only the hazard sets read it: the copies over buffers and a pass's attachments keep naming resources by their own ids (`Accesses::each(interface, tracked)`). The player places a stream heap's buffers with `new_heap_buffer` and a stream block's with `new_buffer`; the conformance crate's heap buffers take `new_heap_buffer`. Why: Metal tracks a heap's resources as one, "tracking is done at the granularity of the heap" (MTLHeap.h, hazardTrackingMode), and the old runtime keys a heap buffer's and a heap texture's hazard identity by its heap (metal2vulkan-runtime heap.rs, tracker.rs). rt keyed them by resource, so inside one encoder, or after an encoder that only read, a write through one heap resource and a use of another over the same bytes got no barrier. Tests: `every_device_orders_a_heap_s_resources_as_one`: two heap buffers over the same bytes take a barrier between a write and a use and the second sees the first's words; two apart in one heap take one too; two heaps' none; a buffer past its heap's end is refused; 200 heaps that come and go leave at most 64 entries. docs/REFUSALS.md and the API signature table regenerated (two records added: the method and the refusal). Verified: cargo fmt; refusal_surface.py and signatures.py --bless. Build, clippy and the device suites on the check job named when the branch is handed over. |
||
|
|
e9c324a8f4 |
conformance: the decode cases' bound loosens metal2vulkan-rt's run alone; the old runtime's rows are as they were
The planner's ruling on the twelve old-side RADV rows |
||
|
|
608e084db1 |
rt: Block::external_writes_done, the acquire of another API's writes into an exported block
A decoder writes a frame into an exported block through its import of the handle; the
runtime's commands may read it only after the block's ownership comes back from the other
API's queue family. Vulkan's external memory requires that transfer whatever the sharing mode
(section 7.7.6, "Resources shared with external APIs or instances using external memory must
also explicitly manage ownership transfers between local and external queues").
Block::external_writes_done() records the acquire: one buffer barrier of the whole block, from
VK_QUEUE_FAMILY_EXTERNAL for an opaque handle (same device and driver) or from
VK_QUEUE_FAMILY_FOREIGN_EXT for a dma-buf (another driver), to the runtime's family, visible to
every later command. It goes in the upload, as zero_block_range's fill does: submitted ahead of
every command buffer committed after the call, holding the block until it completes, with no
wait for the GPU. The consumer calls it after its own wait on the decoder. A dma-buf names the
foreign family, which VUID-VkBufferMemoryBarrier2-srcQueueFamilyIndex-09099 allows only with
VK_EXT_queue_family_foreign enabled; new_exported_block already refuses a dma-buf export where
it is not (Limit::ExportType { listed: None }), so every exported dma-buf block can name it.
No release back to the other API is recorded. Section 7.7.6: "If an application does not need
the contents of a resource to remain valid when transferring from one queue family to another,
then the ownership transfer should be skipped." A decoder that overwrites the whole block needs
nothing the runtime left in it, so only the decoder-to-runtime direction is a transfer. The
contract, in the rt README beside the two calls: between external_writes_done and the other
API's next write of the whole block, the other API does not access the block, to read or to
write. The old runtime records the same acquire and no release.
Metrics::external_acquires counts the acquires (each also one of Metrics::barriers); the
replay report prints it. A block that is not exported is Refusal::NotExported. memory::Own's
Export carries the handle, which names the family.
docs/REFUSALS.md regenerated; api_signatures blessed.
Tests (src/tests/export.rs, device cfgs): after the second device has read rt's bytes, it fills
the whole block and releases it to the external family; external_writes_done is counted, and a
blit then reads the second device's bytes. An acquire of a taken block is refused typed.
Verified at this commit: cargo fmt only. The lane's build and device legs run on the tip that
carries it.
|
||
|
|
ea9b65a972 |
rt: Device::new_exported_block, one dedicated exportable allocation per block
The consumer's video path shares decode surfaces with a hardware decoder: the decoder imports
rt's memory and writes decoded frames into it. Metal has no counterpart, as it has none of
presenting.
The form is one on every device: an allocation of its own in the Private memory type,
dedicated to the one buffer that spans it (VkMemoryDedicatedAllocateInfo), exportable as the
handle the consumer names, never a range of a pooled allocation. Vulkan lets a driver require a
dedicated allocation for an export (VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT), so the
dedicated form is the one every driver takes, and what exportable memory costs each submission
falls on these allocations alone.
- ExportHandle: OpaqueFd (unix), DmaBuf (unix), OpaqueWin32 (Windows). A handle is offered
where the device lists its extensions and vkGetPhysicalDeviceExternalBufferProperties says its
buffers export it; elsewhere Limit::NoExport, before anything is allocated.
- A dma-buf's other side is another driver, which an ownership transfer names as
VK_QUEUE_FAMILY_FOREIGN_EXT; without VK_EXT_queue_family_foreign that family may not be named
(VUID-VkBufferMemoryBarrier2-srcQueueFamilyIndex-09099), so a dma-buf export there is
Limit::ExportType { listed: None }. A buffer whose memory requirements do not list the
Private type is Limit::ExportType { listed: Some(bits) }.
- Export carries the new handle (the consumer's to close), the allocation's size and its memory
type, which an import of an opaque handle names again
(VUID-VkMemoryAllocateInfo-allocationSize-01742, and the dedicated import of
VUID-VkMemoryDedicatedAllocateInfo-buffer-01879).
- The extensions stay out of the floor: VK_KHR_external_memory_win32 and
VK_EXT_queue_family_foreign join the optional list, enabled where listed.
- Gauges::exports counts exported blocks whose memory is not yet freed; the block-maker thread
frees them as it frees imports (memory::Own).
- No image is made in an exported block's memory, which is dedicated to its buffer
(VUID-vkBindImageMemory-memory-10926): a texture over a buffer in it takes the counted copy,
as over an import, and a heap texture in it is Gap::HeapTexture.
docs/REFUSALS.md regenerated; api_signatures blessed; the rt README has the call, its
extensions and its known gap.
Tests (src/tests/export.rs, device cfgs): every offered handle exports, is written by rt,
released by the test's own barrier and read back through a second device's import of the
handle, with the gauge back after the free; every other handle is refused typed; an exported
block holds no image; and the submit cost with 64 live exports against none, printed.
Verified at this commit: cargo fmt only. The lane's build (clippy plain and under both device
cfgs, Rustdoc, signatures, refusals) and device legs run on the tip that carries it.
|
||
|
|
f1aa961e34 |
conformance: RADV's BC1 to BC3 sRGB rows on the old runtime hold the case's unjustified bound too
The old runtime holds DriverFact::ColorBlockDecodeIsMetals for the RX 7900 XTX and the Radeon 780M, so it announces no compressed-texel-decode there, and the decode cases' bound, justified by that notice alone, justifies nothing: each of the twelve sRGB sites now differs twice, as the device's sRGB decode (the row already listed) and as the case's loosening that nothing justified. m3-max-50924's old-side XTX leg named the twelve; each gets its row beside the site's. rt notes every block-compressed texture, so it announces the notice there and the sites are announced (the same leg's rt side). docs/CONFORMANCE-COVERAGE.md regenerated. |
||
|
|
260163301f |
conformance: the fresh-texture test counts the decode notice; the catalogue's cost stays the old runtime's words
m3-max-50899's suites named three things of ee0827889e. fresh_contents' a_row_loosens_the_notices_site_and_a_private_texture_s_fresh_site counted a texture row's allowances without the compressed-texel-decode declaration its block-compressed rows now make: it counts it, and holds that only those rows make it. The old runtime's catalogue test holds an entry's Cost to the words the kind announces, before whatever more it says: the measured bounds go after the announced cost (the RTX 2080's, and ANV's and the UHD 630's BC3 alpha 2/255 and BC4/BC5 1.4/255, signed 0.0134, each BC4/BC5 texel within 0.0001 of the specification's exact decode), and the cost is the old runtime's again. docs/CONFORMANCE-COVERAGE.md regenerated: 89 ledger rows fewer. Verified: the bcref decode of the per-element dumps (the 2080, the Iris Xe and the UHD 630). Expected: the suites green on msi with this commit. |
||
|
|
3a6eac60d5 |
conformance: the decode cases' bound takes float rounding; fills and fresh textures declare the decode note; stale BC rows go
The whole-set replays of c83f9b0db1 on lavapipe named three things. texture-fills-130, -134 and -152 and the fresh-texture-bc1-rgba rows make block-compressed textures, which rt now notes as CompressedTexelDecode, and declared no such notice: both families now declare it at the notices site (texture_fills.rs among the native notes it already declares; fresh_contents.rs where the row's format is block-compressed). Neither loosens a value. The old runtime announces compressed-texel-decode on lavapipe for BC1 to BC5, so with the cases' bound justified by that notice its 40 llvmpipe rows (256 bits) no longer diverge, and the replay said so. Those rows go, with the 128-bit lavapipe rows and the RTX 5080 Laptop rows (whose recorded largest differences all lie inside the family bounds) and RADV's BC4 and BC5 rows (RADV holds no ChannelBlockDecodeIsMetals, so the old runtime announces there). RADV's BC1 to BC3 sRGB rows stay: RADV holds ColorBlockDecodeIsMetals, so the old runtime announces nothing there. Each texel is a float, rounded by up to half an ulp of a value below 1, so two codes exactly a bound apart can read a few billionths past it (6/255 between 128/255 and 134/255 in float is 6/255 + 3e-8): the bound takes f32::EPSILON / 2 on top. The RTX 2080's BC3 reached 0.023529410362, 1.4e-9 inside 6/255, by that luck alone. docs/API.md: the catalogue's measured bounds, from the per-element dumps on the RTX 2080 (620.70.06), the Iris Xe (ANV) and the UHD 630 (Intel's Windows driver): ANV and the UHD 630 reach BC3's alpha 2/255 and BC4/BC5 1.4/255 (signed 0.0134), past the 1/255 and 1.3/255 (0.013) it stated; the 2080's BC1 to BC3 3/255 and BC3's alpha 6/255. |
||
|
|
ae452ee883 |
rt: a block-compressed texture carries the static note of its decode, CompressedTexelDecode
A read, sample or gather of a BC texel on metal2vulkan-rt is the device's decode of the texture's own blocks, where Metal interpolates a block's endpoints with 6-bit weights. rt carried no note of it, so the ten BC1 to BC5 decode cases read divergent on every Linux venue with no notice behind them. The old runtime announces the same difference as compressed-texel-decode, gated by driver facts; rt decides by the format class alone, on every device, RADV included. - PrecisionNote::CompressedTexelDecode in the translator's public enum (codec, and ARTIFACT_FORMAT_VERSION 544; fast_paths' "elsewhere" list; validation allows it unbounded). No pipeline stage records it, so no translation changes. - Texture::precision_note: Some(CompressedTexelDecode) for a texture or view whose own pixel format has a block extent (metal::format::block_extent: BC1 to BC7, ASTC, ETC2, EAC, PVRTC; rt makes the last four only where the device holds the format), None otherwise, as DepthStencilState::precision_note is shaped. Device test: a BC1, BC7, ETC2 and ASTC 4x4 texture (where the device makes it) and its sRGB view carry the note; RGBA8Unorm and its sRGB view carry none. - The old runtime's Degradation::from_precision_note maps the note to its existing compressed-texel-decode kind (one arm, which the exhaustive match requires). - The conformance rt side announces the note of every texture it makes (one keep_texture helper, makes_texture, and the work runner's made resources). - compressed-texel-decode leaves the suite's native notes: its catalogue entry states bounds, and a native note loosens nothing. The ten BC decode cases declare it and loosen each round's texels by the catalogue's largest bound for the family on any driver (BC1/BC2 4/255, BC3 6/255, BC4/BC5 7.4/255, signed 0.065; an sRGB form the sRGB decode's largest step over 4/255). The other families that make a compressed texture declare it at the notices site alone: the BC moves and views, ASTC, ETC2/EAC, the read-write tier tables and the usage table of the descriptor pairs. - docs/API.md's catalogue entry covers both runtimes; rt's README states the note; api_signatures and CONFORMANCE-COVERAGE regenerated. |
||
|
|
c9637b0d08 |
replay: a descriptor-form no-copy buffer is a pool buffer; only the bytes form imports
The planner ruled the mapping: the player plays every descriptor-form no-copy buffer (newBufferWithDescriptor: with noCopy) as a pool buffer, a buffer of a recorded block where its recorded range lies in one and a place of its own elsewhere, and imports only the bytes form (newBufferWithBytesNoCopy:length:options:deallocator:, the host's own in the recordings). The recordings do not tell the program's own no-copy memory (an import in the product) from the host's pool buffers, so that memory plays as a pool buffer too: a known gap. The host's recorder makes a buffer over the program's memory only with a pinnedGpuAddress and no zeroFrom (zeroFrom and unpinned buffers are always the host's own), so the report's gap line bounds the gap by those outside every block, with their bytes. REPLAY-STREAM.md states the mapping and the gap. The test plays three descriptor-form buffers outside every block (one pinned with no zeroFrom, one unpinned, one pinned with zeroFrom), a texture over the first read through a blit, and checks the counts line, the gap line's bound of 1, and that the imported side counts only the bytes-form buffer's texture copy. |
||
|
|
2fe8ac55c1 |
matrix: a host-time row past its limit by less than old's own move is VOID for the round
The frozen arm's second rule, beside FROZEN_DRIFT (the planner's ruling of 2026-11-19, reading
(a)): a row judged by its host time, and not by re-timed pairs, whose excess over its limit
(ratio over limit, less 1) is smaller than its own old time's move from the base in the round
is VOID, since the old runtime's drift alone could carry it there. GPU-time rows and rows judged
by their re-timed pairs are never voided by it. Neither rule makes a row red; the paired re-time
judges a red row.
harness_budget parks such a row as VOID with its excess and the move; the report's table reads
VOID for it (over_lines, through excess_voids); each leg's lines name the rows each rule voided
(print_leg). docs/VALIDATION.md states the rule.
The venue-wide reading was withdrawn: the frozen arm's largest moves sit on cold creation rows
(create_4KiB/device_first +88% on one leg of
|