def2c7f1d7e58c02ec06b2e7ea1615c9bef9644f
650
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
def2c7f1d7 |
Re-derive the conformance coverage document after the ledger removals
python3 -I scripts/conformance-coverage/coverage.py: the ledger count falls from 2619 to 2605 (the four attribute-stride rows, the three slice-past used-size rows and the seven move rows), the slice-past row's note follows the ledger, and the sparse families count the allowGPUOptimizedContents call the move rows now make. Found by tests::the_conformance_coverage_document_is_what_the_sources_derive failing at fcfdf2bcb1 (job m3-max-3620, the only failure of 1,019). (cherry picked from commit cc6e6740161cc876cfdf2f8ccc008088de24970b) |
||
|
|
d158a960dd |
Read the sparse move rows through uncompressed textures
The move family's rows (inside-the-level, past-the-destination's-row, clipped-source) read a tile a move rebound as 0 in 3,968 of its 4,096 words on Metal and whole on ours. probes/sparse_move_compression.m (job m3-max-3570, an M3 Max under macOS 27.0.1, five descriptors, two runs each, one outcome) shows that is lossless compression's: under the case's own descriptor (ShaderRead, allowGPUOptimizedContents YES) a moved tile kept its word in 128 texels, the first 4 by 2 of each 16 by 16 block, and with allowGPUOptimizedContents off, ShaderWrite or PixelFormatView usage both moved tiles read whole. Controls: untouched tiles whole, moved-from tiles zero, every command buffer completed, usedSize unchanged. A move is documented to move the tile's mapping, and the rows read which tiles it moved, so they now make both textures with allowGPUOptimizedContents off: - SparseTextureSpec gains gpu_optimized (Metal's default, true) and unoptimized(); both sides forward it to their descriptor. An unoptimized texture adds a byte to its fingerprint and a site suffix where the default adds none, so every other sparse case's recording keeps its fingerprint. - moved() builds its two textures unoptimized; the four move rows' recordings are re-taken on the M3 in the next commit. - docs/API.md's accepted differences gain the compressed case: Metal's moved tile may read only part of its texels, ours reads all of them under every descriptor; the runtime does not reproduce the loss. - The probe's header records its results. (cherry picked from commit b3f8f28dbf18ce6756587702dd012ebd282c4f3a) |
||
|
|
08ca74da22 |
Charge a sparse heap for a mapping update of a slice past the texture's
Plain Metal takes a sparse mapping update whose slice is past the texture's own (its API validation refuses it) and charges its heap's usedSize exactly what the same region on an in-bounds slice costs: one page a tile of the region clipped to the level's tiles, idempotent per tile, given back on an unmap of that tile, never below where it stood (probes/sparse_indirect_usedsize.m and sparse_mapping_past_the_bounds.m on the M3 Max, macOS 27.0.1, both selectors). Ours counted nothing, so sparse-mapping-a-slice-past-the-textures read 65,536 where Metal read 81,920 at used-size/2, /3 and /4. UnitGrid::clipped_region now names such a region's units at the slice (past_slices tells them apart); sparse/bind.rs's apply takes and gives back their heap room into SparseState::charged and binds nothing for them, and undo reverts them with the rest. The move keeps the slice bound (clipped_size), as measured. The texels plain Metal's page reaches (read/4: a 16 by 16 block of slice 0's tile (0, 0) reads its unwritten pattern) are not mirrored, on the owner's call via the orchestrator: an accepted difference in docs/API.md section 10 (Vulkan binds nothing past an image's layers, VUID-VkSparseImageMemoryBindInfo-subresource-01723, and the address is not derivable), which the remaining ledger row now names. Removes the three used-size rows of known-gaps.tsv. tests::sparse holds the counts against Metal's readings row by row (every row now equal). (cherry picked from commit 636522137c717715521cdda950fbb7213e00089f) |
||
|
|
1edd55cb98 |
Read a stage-in layout bound with MTLAttributeStrideStatic as Metal does
Plain Metal on the M3 Max (macOS 27.0.1) answers each of the compute encoder's four stride forms bound with MTLAttributeStrideStatic, under a [[stage_in]] layout of MTLBufferLayoutStrideDynamic, with the element at the bind offset for the first element and zero for every element past it (the attribute-stride-* recordings). That is a fetch at the constant's low 32 bits, 2^32 - 1, by the same truncation every other stride takes: element 1 lies 2^32 - 1 bytes on, past the buffer (an ICB command read the real byte there in a buffer that holds it). Ours mapped the constant to "no stride" and read every element at stride 0 (three divergent rows), and refused the inline-bytes form (one refused row). - Runtime: a compute table's stride forms hold the argument's low 32 bits, the constant included (argument_table::per_bind_stride); the plain setters still set none (stride 0), and a render stage's table is unchanged. fetch_reach then sees the constant's real reach. - Bind layer: PushField::StageInStride pushes inline bytes' stride as a buffer's; the NotImplemented(KernelStageIn) refusal for bytes at u32::MAX is gone (REFUSALS.md regenerated). - Translator: a kernel stage-in read that steps by thread position decides exactly whether its bytes lie in the first 2^32 bytes from the bind offset (e * stride + offset + size <= 2^32, without the u32 wrap; fetch::within_reach), and in a view whether the bind residual plus the displacement still fits; past it the read takes the bind offset and yields zero bytes on every device (access::pulled::prepare_within). Before, the wrapped displacement landed back inside the buffer (element 1 at 2^32 - 1 + 4 read byte 3). Removes the four attribute-stride-* rows of known-gaps.tsv. SEMANTICS_VERSION 1981 (the orchestrator's number). Tests: engine_kernel_stage_in::an_element_past_four_gigabytes_reads_zero (every profile, with and without robustness: the constant on both layouts, beside a stride of its own, and a stride of 2^32 - 8 whose element 2 wraps to 2^32 - 16); tests::argument_table:: the_static_constant_is_a_compute_tables_widest_stride. (cherry picked from commit f4d8011ccd1fe723c5192dd58e6b2eef7553fb37) |
||
|
|
2e8e0353b2 |
Regenerate REFUSALS.md for the input-form shadow's refusals
lower/fragment/input_shadow.rs refuses FramebufferFetch where the device lacks the interlock, fragment stores, multisampled storage or the shadow's storage format, and NotImplemented for the shapes it cannot keep Metal's answer in (python3 scripts/refusal-surface/refusal_surface.py). (cherry picked from commit 8a9d1405ec2dc326f1d78fd8831065ac75276e70) |
||
|
|
9175e22891 |
Degrade catalogue: lavapipe's passes hold the extended-range shadow beside the input attachment
docs/API.md's entry for extended-range-blends-stored-codes said every pass over input attachments keeps the codes; on a device with the pixel interlock, fragment stores and Rgba16f storage images the pass holds the shadow, and the notice fires there only where the shadow cannot follow (a multisampled load, a refused shadowed variant) and, for a masked word write, only where the pass holds no shadow. The four xr-masked-bgr10xr notice rows that went in 9b264b29fe are that last case. Degradation::ExtendedRangeBlendsStoredCodes' doc says the same. Verified: doc text; the runtime suite's catalogue test runs with the suites. (cherry picked from commit 536615e3c3460673f6defce426dfa72fc51f8f3f) |
||
|
|
91a95766bb |
Conformance ledger: lavapipe's extended-range blends read the half shadow beside the input attachment
With the shadow held over input attachments (and the input-form draws
kept for recording again), the lavapipe xr replay on msi (m3-max-3561,
at 43b2d2dd54; 109 xr-* cases) answers the 26 group-1 texel sites
exactly as the RTX 5080 does, and 22 of them as the M3 Max does (the
four xr-gradient-*blended* rows differ from the M3's by the device's
arithmetic, as the 5080's do):
- xr-gamut-bgra10xr-{over,straight}-{half,float}-{x1,x4}, the sRGB twins
and the x4-stencil pair, xr-masked-bgra10xr{,-srgb}-rgb-over,
xr-masked-bgr10xr{,-srgb}-red-over and
xr-gradient-bgra10xr{,-srgb}-blended-{x1,x4}: each row's answer is the
measured one, and its text the 5080's (the device's blend arithmetic,
encode and resolve, in replay::NATIVE_NOTES or announced and
declared), saying the function blends over the input attachment and
reads and writes the shadow beside it in the interlock. None is our
gap any more.
- The four notice rows of xr-masked-bgr10xr{,-srgb}-{red,blue-green} go:
extended-range-blends-stored-codes is no longer announced, as the pass
holds the shadow.
The gamut and masked cases' allowance docs no longer say lavapipe holds
no shadow. CONFORMANCE-COVERAGE.md regenerated.
Verified: the msi replay above (lavapipe, LLVM 23.1.1). The whole
replay on the homelab lavapipe (LLVM 23.1.4) runs next.
(cherry picked from commit cd910afb74e5faf67a0e6affdea77ced18205747)
|
||
|
|
14e55e0c6c |
A reset compute pipeline descriptor is a fresh one: an accepted difference
MTLComputePipeline.h documents -[MTLComputePipelineDescriptor reset] as "Restore all compute pipeline descriptor properties to their default values", and maxTotalThreadsPerThreadgroup as "If it is not set, returns zero". The runtime's reset is ComputePipelineDescriptor::new, every field at its default. Metal's reset on the M3 Max (macOS 27.0.1) keeps threadGroupSizeIsMultipleOfThreadExecutionWidth, maxTotalThreadsPerThreadgroup and requiredThreadsPerThreadgroup as the program set them (true, 96 and 8 by 6 by 2 in compute-descriptor-reset), while the tile and mesh descriptors' resets restore every field on the same machine. The owner's decision: the header's contract is Metal's, and the compute descriptor's kept fields read as one release's defect. docs/API.md section 10 (Kernels) states it. compute-descriptor-reset loosens its five thread-shape sites to the runtime's default alone (AnyOf the default, so Metal's kept value is still a divergence), justified by that entry, and its five known-gaps rows go. A module test holds the entry, the five paths and the defaults; the other two shapes loosen nothing. CONFORMANCE-COVERAGE.md regenerated. Verified: the conformance suite and clippy run on this branch next. (cherry picked from commit 3dbd14b8fa45f6fcb836603b32aace527d009c0e) |
||
|
|
924f46aac7 |
use_host_ram and HOWTO: the no-source case and the dma-buf route in one statement
flakes's landing (
|
||
|
|
ba7ed4d150 |
Bless the API signatures and regenerate the refusal surface for the submission checks and HostRam's dma-bufs
Removed: DriverFact::PointerImportsFollowTheirAddress and DriverFact::SubmissionsWithoutSignalsMerge (in metal2vulkan::device and the runtime's re-export). New: HostRam::with_dma_buf, Device::pointer_imports_follow_their_address, the doc(hidden) Device::submissions_merge, fresh_pages_pay, settle_submit_checks and submit_check_report, and WorkCounts submit_checks_run, submit_checks_recalled, submit_check_calls, host_ram_dma_buf_imports and host_ram_pointer_imports_failed. REFUSALS.md: Problem::DmaBuf gains its site in ram_span_as_dma_buf. Verified: scripts/api-signatures/signatures.py --bless and scripts/refusal-surface/refusal_surface.py (both read source only). (cherry picked from commit 027b38e988e93373d58a26b388d0989a98809b33) |
||
|
|
718f6543b4 |
HostRam: chunks imported as dma-bufs where held pointer imports tax every submission
reims measured raw Vulkan on the Radeon 780M: each live host-pointer import adds about 0.75 us plus 0.33 us per MiB to every vkQueueSubmit (amdgpu gets every page of a userptr again in each CS), each dma-buf about 0.44 us with no per-page cost. A guest RAM imported in 64 MiB pointer chunks would cost RADV about 24 us per chunk per submission, and RADV refuses the pointer of any shared mapping (a memfd's) anyway, so the consumer imports 13-135 region blocks and its IOSurfaces one dma-buf each there. - `HostRam::with_dma_buf(source)` (new public method) gives the RAM a DmaBufSource. Each import of the RAM, a chunk or an object's run imported alone, is then one dma-buf of its pages where the device's submission checks found a held pointer import taxing every submission (the ImportTax verdict; the pointer where that import fails), and elsewhere the pointer first, the dma-buf where the pointer is refused. The decision reads the device's measured verdict or the driver's refusal, never its identity: NVIDIA, ANV and MoltenVK (untaxed) keep the pointer path unchanged. `use_host_ram` waits (at most 10 s) for the checks first when the RAM has a source. - A buffer bound in a dma-buf chunk is made for DMA_BUF_EXT memory (VUID-vkBindBufferMemory-memory-02985; `host_buffer` takes the handle type). Its placement lends the chunk's imports, so textures over it take the dma-buf image route (an image over a dma-buf of their own pages from the RAM's source), asked at the RAM's addresses (`Placement::dma_buf_address`: the caller's view may differ from the RAM's). A rebind into such a chunk makes the heap's and in-place images again as a rebind onto the caller's dma-bufs does. `host_backing` reports such a buffer InHostRam; its deallocator goes at once (it frees no memory of its own); the chunk's RAM keep-alive goes after the chunk's dma-buf import is freed. - Counted: WorkCounts::host_ram_dma_buf_imports (new field). Also in this commit, for the submission checks of 363fa41176: the docs that named the removed DriverFact rows (PointerImportsFollowTheirAddress, SubmissionsWithoutSignalsMerge) name the device checks (FAST-PATHS grouping row and known gaps, HOWTO, fresh_pages.rs, buffer.rs, buffer_descriptor.rs, host_memory.rs, work_counts.rs); fresh_pages.rs and FAST-PATHS give the measured reason for the tax gate (one 64 MiB fresh-page buffer: a commit's p50 10.7 -> 36.6 us on the 780M, 14.7 -> 164.7 us on the RX 550, submit_per_fresh_page_buffer at 27b9b13bcd); the checks' 10 s answer wait is one constant (submit_check::ANSWER_WAIT) shared with the in-place check; and the recall test's failure names the record, where it lies, the cache's rejected/failed reads and both identities (it failed on lavapipe, msi-laptop, m3-max-3160: no device recalled the record in 60 s; the cause is not known yet). Verified: cargo fmt only; compiled and tested in the following jobs. (cherry picked from commit fa8c27f1549fe09d769847ef63f8e34d51f2c6af) |
||
|
|
f8ca661520 |
Conformance ledger: the RTX 5080's held sRGB reads, and its BGR10A2 held write runs
The 5080 replay at 3e5ef48250 (b5080 entry replay-r4-nv-043226, whole suite, 1228 verdicts) reported three ledger mismatches beyond the 20 known ycbcr gather and minify sites: - read-write-tier-held diverges at BGRA8Unorm_sRGB and RGBA8Unorm_sRGB (192 elements, largest 64919). The 5080 stores neither sRGB format, so the heap views a held texture through its UNORM alias and the function decodes by the MSL transfer through the device's Pow, as on lavapipe; srgb-texel-decode is announced for the case. Two rows, in the sRGB decode section, whose header now names both venues and the held alias read. - norm-storage-fields-bgr10a2unorm no longer refuses hsw_held/dispatch on the 5080 (the heap's storage aliases, f4c1fbd170): its row goes. The held BGR10A2Unorm texels match Metal on the 5080 (no row), and so do the RGB9E5 attribute reads: the one RGB9E5 site left, attribute-format-fetches' attribute3/Half2, is the listed half NaN quieting of another attribute. Verified: the replay output above; coverage regenerated with scripts/conformance-coverage/coverage.py. Not verified: a 5080 replay at this commit. (cherry picked from commit e127ed348db352da2a4a4fa97fecd8f836ea867f) |
||
|
|
25b6686318 |
Regenerate CONFORMANCE-COVERAGE.md for the host-scoped lavapipe rows
bc3e17852b split five ledger rows by host (2619 to 2625 rows), which conformance_coverage::the_conformance_coverage_document_is_what_the_sources_derive caught (potluck job m3-max-3361). Regenerated with scripts/conformance-coverage/coverage.py. (cherry picked from commit a348cf1f29cacd026d796a2ecadae48fc70c8384) |
||
|
|
85685b7941 |
Link a visible-function reference to a definition of another type by position
A pipeline refused a linked function whose definition's type differed from
the reference's (InvalidDescriptor(LinkedFunction { problem: Signature })).
Metal makes those pipelines and passes the arguments by position: MPS's
reduce_stitched declares float reductionStitched::write_fn([8 x i8], float,
float), and the stitcher defines write_fn as float([8 x i8], float), which is
how Geekbench's Background Blur and Face Tracking failed on the consumer.
What Metal does was measured with the probe linked_function_signatures.m
(m3-max-3238, M3 Max, macOS 27.0.1) and the consumer's probes (m3-max-3228,
Radeon Pro 5300M and UHD 630, macOS 26.7.1): every pipeline is made; an
extra trailing argument is dropped (5 on all three); a missing trailing
parameter reads 0 (all three); a same-width plain value is reinterpreted
bit for bit, arguments and results alike (all three); another width is
undefined on the M3 and the 630 and the low bits on the 5300M; a pointer for
a value, a value for a pointer, another address space and an aggregate of
another type are undefined on the M3.
Now a stub whose type differs from its definition's resolves to an adapter
(canon/adapt.rs): an internal function of the stub's type that calls the
definition with the arguments by position, which inlining takes. Dropped
trailing arguments, zero for missing parameters, bitcast at one width, low
bits or zero-filled bits at another (scalars and vectors of int and float, a
bool as one bit, widths up to 64 bits), the result likewise, zero from a void
definition, dropped by a void reference. Anything else (pointer/value,
address space, aggregate of another type, vararg, isomorphic structs of other
identity) is Unsupported(Linking, not implemented) at a surviving call, where
it was an InvalidRequest that claimed Metal refuses it. Stub::Resolved keeps
the definition (the linked function, for the call-stack model) apart from the
function its calls call. The import pairs the definition's type with the
reference's by position, so a definition of another arity still takes the
reference's identified structs.
LinkProblem::Signature had no producer left and is removed (a public
variant of metal2vulkan-air, re-exported by metal2vulkan; api_signatures.tsv
re-blessed). SEMANTICS_VERSION 1976 -> 1977: refused inputs now translate.
docs/API.md section 3 states the contract and section 10 the choices where
Metal's answer is undefined and the refused shapes; REFUSALS.md regenerated
(unchanged).
Tests: link_tests (extra arguments, missing parameters, one-width bits,
other widths, void results, the refused shapes), engine_linking's renamed
linked_scale now links and computes, error/tests maps another LinkProblem.
(cherry picked from commit 493bc2dabe979e2280aea2d3fcbf5d17e2446f28)
|
||
|
|
bc13149480 |
HostRam tests: fresh RAM a device imports; shared RAM a device refuses imports no chunk
On RADV (a Radeon 780M, Mesa 26.2.6) 8 of the 19 host_ram_device tests failed every run: every
test over fresh_ram, a memfd mapped shared as QEMU's memory-backend-memfd,share=on RAM is. RADV
imports a pointer through amdgpu's userptr, which takes private anonymous pages alone, so it
refuses those pages (Device::imports_shared_host_pointers answers false there): the device's
thread imported no chunk ("one chunk from the RAM's start", left 0), and a no-copy buffer over
the RAM was refused, Unsupported(HostMemory, NotRepresentable) (diagnosed on homelab-um870-1,
potluck jobs m3-max-2986, 3083 and 3119). The runtime's answer is the right one with no dma-buf
source; the tests asked RADV for RAM it cannot import.
fresh_ram now takes the device and maps the memory it imports: the memfd mapped shared where
imports_shared_host_pointers answers true (NVIDIA, lavapipe, MoltenVK), else private anonymous
memory, as QEMU's memory-backend-ram RAM is, both never touched and advised for huge pages.
ahead_device asks the probe once up front, so no test's counts or allocation limit meet its
one-page import. A new test pins the no-source case where the device refuses shared pointers:
a_ram_of_shared_memory_a_device_refuses_imports_no_chunk_and_refuses_its_objects makes the
memfd RAM, uses it, and expects the buffer over it refused (Unsupported, HostMemory), no chunk
imported or live, and the RAM's keep-alive dropped after the use; elsewhere it says so and
passes. use_host_ram's docs and HOWTO state that no-source case.
(cherry picked from commit 48202da5ba0c0cb7f49d0a630e59efd11c5918f7)
|
||
|
|
99c195f869 |
Conformance ledger: lavapipe's held read-write rows follow the heap's alias views
f4c1fbd170 lets the heap view a held RGBA8Unorm_sRGB, BGRA8Unorm_sRGB or BGR10A2Unorm read-write texture through its storage alias. On lavapipe (CachyOS, LLVM 23.1.4, 256 bits, job m3-max-3206 on homelab-gem10-1) read-write-tier-held's three `beyond` rows now dispatch, and their read-back, status, stored and stored-bytes sites are exact; only texels differ, by the device's own answers: - BGR10A2Unorm: 10 elements one f32 ulp low (Metal 0x3E48320D, ours 0x3E48320C), the device's reciprocal product, device-texel-conversion, as the slot path's row of read-write-tier-round-trip-float says; - the two sRGB formats: 219 elements, the largest difference 64921 bits, the MSL transfer through the device's Pow where Metal takes its twelve-bit table (Metal 0x3BB80B81 = 23/4095, ours 0x3BB7AD6D, the transfer of code 17), srgb-texel-decode, which the runtime announced for the case in that run, as did device-pack-conversion. So the 18 refused and only-Metal llvmpipe rows go and three native-answer rows take their place, and norm-storage-fields-bgr10a2unorm's llvmpipe refusal at case/hsw_held/dispatch (the same heap write, refused the same way) goes: that site now dispatches. The NVIDIA rows wait for a 5080 run. The engine_heap_binder table test now allows FLAG_RED_BLUE and checks it is set on the BGRA8Unorm member alone (it failed at f4c1fbd170: "other flags are reserved", left 4). read-write-tier-held's allowance comment says when unnamed-texture-unviewable fires now. CONFORMANCE-COVERAGE.md regenerated. Verified at f4c1fbd170 (the binary of this commit differs only in the ledger and that test): 317 of 318 selected metal2vulkan tests passed, the one failure the table test fixed here; the replay's unlisted and stale sites for these rows are the ones this commit lists and removes. (cherry picked from commit 3e5ef48250375a08ec2f9eadccae7a83481add6b) |
||
|
|
3d5bb02ba0 |
Hold sRGB and blue-first read-write textures in an argument buffer
Metal reads and writes an RGBA8Unorm_sRGB, BGRA8Unorm_sRGB or BGR10A2Unorm texture through access::read_write, and through an argument buffer too (read-write-tier-held's `beyond` rows). The heap binder refused such a member's storage element, NotImplemented (ArgumentBufferTextures), wherever its storage choice was an alias: lavapipe and NVIDIA store no 8-bit sRGB format and no A2R10G10B10, so the dispatch's bind state was refused there, where a slot of the same texture converts in the shader through the alias. The heap now does what the slot does, keyed by what the handle carries: - bind::heap::storage_conversions(profile) lists, per texel class index and red-blue order, the formats whose heap storage choice is an alias a function converts by (SwizzleBgra, SrgbEncode, SrgbEncodeBgra), one class per key; a key whose formats choose otherwise converts nothing. The binder views a member of such a choice through its alias (which its image lists among its view formats) instead of refusing it; another alias (RGB9E5Float's word, ARGB8's rotation, an RGBX format) and a swizzle that loses the class are still refused. - A blue-first format shares its texel class with its red-first kin (BGR10A2Unorm with RGB10A2Unorm), so the handle-table entry gains FLAG_RED_BLUE (bit 2, metal::format::red_blue_exchanged: BGRA8Unorm, BGRA8Unorm_sRGB, BGR10A2Unorm), carried in handle bit 30 by a new Lookup::Flagged field where a module converts. - lower::texture::heap_storage_conversions gives a heap storage read or write of a float or half texel the same list; emit::heap_converted exchanges red and blue and decodes or encodes the sRGB codes where the handle's key is listed, as from_image and to_image do for the slot classes. A read's decode notes SrgbTexelDecode and a write's encode DevicePackConversion, the slot's notes (rule 1: the device's own transfer), recorded outright as other heap accesses' are. On the M3 Max's MoltenVK, which stores each of these formats itself, the list is empty: no conversion, no new note. Tests: the binder's storage-member test now expects the aliased view (lavapipe's three formats) and a refusal for the rest; a new test pins lavapipe's and the M3's conversion lists; metal::format's new test ties red_blue_exchanged to every committed profile's red-blue choices; the search's host model and masks cover the new carried bit; an engine test checks the notes and the carried bit on lavapipe and their absence on the M3. SEMANTICS_VERSION 1978. docs/API.md's two note entries name the argument-buffer form. Verification: Linux unit tests and lavapipe and 5080 replays of read-write-tier-held follow this commit (sent with the tip). (cherry picked from commit f4c1fbd1702877f44060593d006dc3372838a112) |
||
|
|
e9b236a978 |
Pull a FloatRGB9E5 vertex attribute on every device
Lavapipe reports VERTEX_BUFFER for E5B9G9R9_UFLOAT_PACK32, so a FloatRGB9E5 attribute went to fixed-function input there, and lavapipe answered 0 in the fourth component (Metal and Vulkan both say 1) and other values in the first three: vertex-format-float4 and -half4 differed in 32 (LLVM 21.1.8) or 38 (LLVM 23.1) elements by up to 65409, and vertex-format-instance-step in its 12 fourth components. The decision is now structural, made from the format, not the driver: fetch_as pulls the shared-exponent format on every profile (fixed_function_format). Vulkan requires no device to fetch it as vertex input (Table 95, "Mandatory Format Support: 64-bit/uneven Components", lists only sampled-image features for it), and its decode has no rounding to leave to the device: each component m * 2^(e - 24) is an f32 and the fourth is 1. So the module's own decode (lower::stage_io::fetch) gives the answer a conformant fixed-function fetch gives, and lavapipe gives it too. FloatRG11B10, the other packed float, stays fixed function: its NaN widening is the device's. The vertex-format sweeps now compile two modules where they compiled one (the pulled format's), and the engine tests say so. SEMANTICS_VERSION 1977: a FloatRGB9E5 attribute's projection and module change. The three RGB9E5 rows of known-gaps.tsv go (vertex-format-float4 and -half4 on LLVM 21.1.8, -instance-step on llvmpipe); the LLVM 23.1 pair went in 613a98e22d. docs/API.md's vertex_input entry says it. Verification: in the commit after this (Linux unit tests, lavapipe replays on CachyOS LLVM 23.1.4, LLVM 23.1.1 and Ubuntu LLVM 21.1.8, the 5080 and the M3 Max). (cherry picked from commit 6f2a6f3572b130db513bf457a9daf365ea241951) |
||
|
|
8623866704 |
Conformance ledger: unlist two product bugs this stream's rows recorded
A ledger row is right only where the divergence is the device's native answer (owner, 11-07: "If its a failure, fix it. Dont sweep it under the rug"). Two sets of rows this stream wrote record product bugs instead, so they go, and the bugs go back to the orchestrator: - read-write-tier-held on the RTX 5080 (18 rows): we refuse the dispatch's bind state, `Unsupported(ArgumentBufferTextures, NotImplemented)`, for a read-write texture of a `beyond` format (`RGBA8Unorm_sRGB`, `BGRA8Unorm_sRGB`, `BGR10A2Unorm`) held in an argument buffer, which Metal round-trips. Runtime and translator work (a held read-write texture whose format the heap array cannot view). - vertex-format-float4 and -half4's `FloatRGB9E5` attribute on lavapipe LLVM 23.1 (2 rows): the format reaches fixed-function vertex input as `E5B9G9R9_UFLOAT_PACK32`, and lavapipe answers 0 for the missing fourth component (Metal 1.0) and decodes other elements wrongly; translator work (pull the fetch, or fill the component after the load). The sites read as unlisted on those venues until the bugs are fixed. The same bugs' older rows (lavapipe's read-write-tier-held, the "llvmpipe" and "LLVM 21.1.8" RGB9E5 rows) were not this stream's and are handed back with them rather than removed here. Verified: only those 20 rows are removed; docs/CONFORMANCE-COVERAGE.md regenerated. (cherry picked from commit 613a98e22de81f35fb926228fc4534ddcd7e848b) |
||
|
|
25a0afe356 |
Conformance: rgb10a2-srgb's sample cases declare the decoded-tap filter's note
rgb10a2-srgb-samples-{nearest,linear}-{f,h} sample `RGB10A2Unorm_sRGB`, which no Vulkan format
holds, through a runtime sampler. The module does not know the slot's state, so it holds the
linear filter of the decoded taps whatever the slot's filter, and records that filter's sum as
the device's arithmetic (`lower::sampler::select`: a filtered access of a decoded form records
`PrecisionNote::BicubicFilterArithmetic` unless its sampler is a constant nearest one). Every
venue run announces `bicubic-filter-arithmetic` for the four cases (the M3 Max's ledger rows, the
RTX 5080 and both 256-bit lavapipe replays), and the cases declared it nowhere, so each read as an
undeclared notice: a test artifact. two_plane_samples declares the same note for the same reason.
The cases now declare it (a notice declaration: it loosens the notices site alone, so every
sample still compares exactly), and the M3 Max's four case/notices rows, which only restated it,
are removed. The module doc no longer says the cases carry no allowance.
docs/CONFORMANCE-COVERAGE.md regenerated: the ledger-row count goes from 2662 to 2658 and nothing
else moves, so the count development carries is the one its sources derive.
Verified by the replays that follow on the M3 Max (MoltenVK), lavapipe and the RTX 3090.
(cherry picked from commit ac79ff3f6a158bdb86a51b291c992436208005e5)
|
||
|
|
e1c3821e23 |
Announce DevicePointSize only at a draw that rasterizes points
What: `PrecisionNote::DevicePointSize` (a vertex function's `[[point_size]]`, or a mesh function's `set_point_size`, on a device whose `pointSizeRange` ends below Metal's 511 pixels: ANV 255, lavapipe 256) was announced by `Device::degrade_stages` at the variant's making and at every bind, whatever the draw's primitive. A point size sizes points alone: Metal has no point fill mode, and Vulkan reads `PointSize` only where it rasterizes points, so a triangle or line draw of such a state is Metal's exactly. reims's `gpu::encode_render` many_passes tests on ANV (Iris Xe) draw only triangles through a vertex function writing `psize [[point_size]] = 1.0`, and died in strict mode at drawPrimitives on this false notice. How: `degrade_stages` skips the note, as it skips `ArgumentPixelSamplerScaling`, and `Device::degrade_point_size` announces it from a draw's settings (`ShapeInputs::settings`, the place `UnsizedPoints` is announced, so an execution's command announces it where the runtime records it) where the draw rasterizes points: a `POINT_LIST` draw, or a mesh draw whose mesh function outputs points (`GraphicsState::mesh_corners == Some(1)`), without rasterizer discard. The draw shape memo keeps it as it keeps every settings notice (announced once, or at every draw on a device that announces the kind at each occurrence, through `EachWatch`). The conformance allowances that hid it are narrowed to the cases that draw points: render-draw-forms declares `device-point-size` from its rows (points and empty draw points; triangles and lines do not), with a module test that the declaration follows the rows; sample-positions (triangles only) drops it; topology-class declares it for the point-size function's point draws; primitive-type-crossings keeps it for its `Point` cells, its comment saying so. The validation lane's `making_kinds` mirrors the runtime. docs/API.md's catalogue entry says where it is announced. Test: `tests::point_size_notices` draws a point-size state as triangles, lines, strips and points on a device that announces the kind at every occurrence, and asserts the creation and every non-point draw announce nothing and each point draw announces it once where the device's largest point is below 511 (none where it is not). (cherry picked from commit db5a2306aceeb4f9994002e68ff6b2ac3fea0813) |
||
|
|
0fe90ba3d4 |
Leave rgb10a2-srgb-samples' unclassified notice site unlisted off the M3 Max
rgb10a2-srgb-samples-{nearest,linear}-{f,h} announce `bicubic-filter-arithmetic`, which the
cases declare nowhere, on the RTX 5080 and both 256-bit lavapipe venues. The rows the two
earlier commits gave that site reused the M3 Max's text, which describes the format's value
conversions and says nothing of the notice; whether the cases should declare it or the note is
recorded wider than their accesses is not established, so the site stays unlisted there.
Verified: the 8 rows removed are the only rows of those cases' case/notices site outside the M3
Max; docs/CONFORMANCE-COVERAGE.md regenerated.
(cherry picked from commit e28a9842627a2b1c0291c488ec0e317cb17659ba)
|
||
|
|
231972d92e |
Cite only the notes each venue's run announced in the new ledger rows
The fix2 replays print, for each failing row, the native notes its own run announced. Read against them, 36 of the new rows cited a note the case did not announce on that venue: - fetch-ordered-*-srgb on the RTX 5080 holds the attachment in the interlocked storage form, so its conversions are the module's (`device-pack-conversion`), not `srgb-texel-decode` and `device-color-conversion`; the row says so and leaves the per-write bound open; - half-write-nans-*16f on the 5080 announces `native-nan-encoding`, not `device-nan-encoding`; - integer-vertex-attributes cited `device-vertex-conversion`, which covers normalized fields only; - vertex-format-half4's narrow-float NaN rows on the 5080 are `native-half-conversion` and `native-nan-encoding`; - half-texel-nans-rg11b10f's rows on the 5080 and both 256-bit lavapipe venues cited `device-texel-conversion`, which none announced. Verified: every note a 5080, LLVM 23.1.1 or LLVM 21.1.8 row cites that is one of `replay::NATIVE_NOTES` is in that case's announced list in the venue's fix2 replay, but the xr-gamut and xr-masked rows, which name each of the two blend-source notes for its own fill kind. (cherry picked from commit 1f14597553913a62fbbce2c462577b25b0fd2a03) |
||
|
|
a988acb096 |
Hand a mipmapped sampler a minLod past every last level, not FLT_MAX
Metal's lodMinClamp of FLT_MAX reads a texture's last level. The translator handed it to the device as minLod itself, and lavapipe on x86-64 (CI's Ubuntu 26.04 Mesa 26.0.8 and msi's 26.2.4, both 256 bits) reads that sampler at level 0: sampler-mip-nearest and sampler-mip-linear's clamp-float-max sites answer 1.0 (level 0) where Metal answers 2001 (level 2), 16 elements each. Vulkan clamps the level into [minLod, maxLod] and then to the view's last level, so every bound at or past LAST_WORD_LEVEL (15, past every Metal texture's last level, 14) reads the same level. A mipmapped sampler's minLod is now its lodMinClamp clamped into [0, 15] (`mipmapped_min_lod`); a bound up to 15 is handed as before, and maxLod stays the descriptor's (never below minLod). Nothing keys on a device: the bound is exact on every one. SEMANTICS_VERSION 1973 -> 1974: a sampler descriptor's minLod changes for lodMinClamp above 15. docs/API.md's device-sampling entry says the bound is handed as 15. metal/sampler.rs is one of the runtime-sources pin's inputs, so the pin moves with this commit (RUNTIME_VERSION and the pin are left to the landing). Verified: `a_mipmapped_samplers_min_lod_is_held_past_every_last_level` fails without the change (minLod f32::MAX, not 15) and checks every view of 1 to 15 levels reads Metal's clamped level under the handed bounds; the venue replay is the lavapipe evidence. Landed with SEMANTICS_VERSION 1976: the branch took 1974, which stack 37 and the heap YCbCr notes (1975) had already taken. (cherry picked from commit bdb7efa414f579579e73c33d8f82fd7b312a61c6) |
||
|
|
b739f0a49a |
Scope the lavapipe ledger rows by LLVM and vector width
The generic "llvmpipe" rows were measured on the arm64 container's lavapipe (LLVM 21.1.8, 128
bits). CI's Ubuntu 26.04 lavapipe (amd64, LLVM 21.1.8, 256 bits) and msi's (LLVM 23.1.1, 256 bits)
answer otherwise at 79 of their sites, and 253 sites no lavapipe row named:
- a row a 256-bit venue no longer holds is re-scoped to the venues it does hold ("128 bits",
"LLVM 21.1.8"), and each 256-bit answer gets its own row ("256 bits" where both 256-bit venues
answer alike, else per LLVM). A row whose text states no number the new answer moves keeps its
text; the rest get texts from that venue's first differing element: the half NaN families (the
quiet bit set and the payload kept at 256 bits, a sign and payload, LLVM 23.1.1 dropping the
half round trip), norm-storage-codes (the 128-bit text plus the case's NaN of each sign, which
the two sides store at opposite ends of the format; Vulkan leaves a NaN's conversion
unspecified), 3D samples on LLVM 23.1.1, and the RGB9E5 attribute row's counts;
- the extended-range, padded 10-bit, sRGB 10-bit, xr blend and two-plane families reuse the M3
Max's venue-neutral texts (mechanism only, no site numbers); xr-planes alpha gets a lavapipe
ties-to-even text; pixel-samplers-subnormal a digest-only text;
- the 14 compressed-blits-rg11b10f and -rgb9e5f rows are removed: the accepted difference
`a-device-answers-as-the-class-of-mac-it-presents` now justifies those sites on every venue
without lossless compression (313abb4b47).
The two sampler-mip clamp-float-max sites get no row: the next commit fixes them.
Verified: every new row is generated from the fix2 census's own paste rows at 2776dd8f06 on each
256-bit venue (site, expects and answer verbatim); a prediction against those censuses leaves 2
sites unlisted (the sampler-mip ones) and no stale row on either venue. A replay at this tree on
both venues is what proves it. docs/CONFORMANCE-COVERAGE.md regenerated.
(cherry picked from commit a1dd53b33b5676b46fdc7654de060ccc8ab0d239)
|
||
|
|
f98735bbdb |
List the RTX 5080's native-arithmetic divergences in the conformance ledger
886 rows for "NVIDIA GeForce RTX 5080 Laptop GPU", each a site the whole-suite replay on the 5080 (NVIDIA 615.71.09, exact policy, at b982d02d53) reported as divergent or refused and the ledger did not list, each with the class it was triaged into and the note that records it: - device NaN encodings (half NaN 0x7FFF, float 0x7FFFFFFF, small-float all ones; gathers of NaNs and denormals) under device-nan-encoding, native-nan-encoding, native-half-conversion and device-texel-conversion, whose documentation already names this device's encodings; - BC decode against compressed-texel-decode's NVIDIA bound (covered, or past the colour bound and named as open, or not established for an sRGB form's decoded value); - packed 16-bit texels widened by bit replication (device-texel-conversion's 0.18-code bound); - 8-bit unorm stores a code apart near a tie (fragment outputs, storage writes, fills, a2c targets) under device-color-conversion, which states the 5080 stores 0.5 as 0x7f; each norm-storage-codes texel holds one value in four channels, so the largest word difference bounds every channel at one code; - attributes read as half keeping the float, NVIDIA folding the conversion pair (native-half-conversion, DriverWorkaround::HalfConversionPairFolded); - the nearest mip level at a halfway clamp (device-sampling states the shape); - filters, 3D samples, pixel samplers, downscales and resolves through the device's own units, whose bounds are measured on lavapipe and MoltenVK and not on this device: those rows say so and name the bound as open; - read-write-tier-held's refusal, the same open runtime work lavapipe's rows name. The 80 xr rows and 191 rows reusing venue-neutral texts of the M3 Max's rows are among them. Sites that the accepted-difference slug fix and the two shared-memory declarations remove (fresh-*, compressed-blits-*, xr-clear-routes-*, buffer-textures-stride-below-the-row, format-footprints-plain-stragglers) get no row. ycbcr-gathers-* and ycbcr-minify-band-* (20 digest-only sites) stay unlisted: their class is not established, and the YCbCr notes are another stream's work. Verified: the rows are generated from the 5080 census's own paste rows (site, expects and answer copied verbatim), each text from the site's first differing element in that run; a replay at this commit on the 5080 is what proves they hold. docs/CONFORMANCE-COVERAGE.md regenerated. (cherry picked from commit 0bf9ec15eac473fa19002a218ec2978f2e7a1f0f) |
||
|
|
b37276fa4c |
Note a heap texture's YCbCr filter where its handles and sampler can reach one that filters
What. A filtered `half` or `float` sample of a texture an argument buffer holds (a heap's) now
records `PrecisionNote::HalfSampleFilter` / `FloatSampleFilter` on a device that samples through
Metal's own sampler (MoltenVK), as a slot's sample does, under clauses the plan answers at each
draw or dispatch:
- `SpecKey::HeapYCbCrTextures(stage)`: a heap member of the command reaching the stage (a texture
it makes resident, or binds at a texture slot of the stage) is of a two-plane YCbCr class
(`TexelFormat::two_plane_ycbcr`);
- through an argument buffer's sampler, `SpecKey::FilteringArgumentSampler`: a listed argument
sampler (`BindShape::argument_samplers`, every live state) has a linear min, mag or mip filter,
anisotropy or a cubic filter; through a runtime slot, the bound word (`filtering_word`); a
constexpr sampler that reads one texel of one level records nothing.
Only a 2D, one-layer, color, single-sample heap sample can reach a two-plane texture, so 3D, array,
depth and multisample heap samples record nothing. The plan computes both keys in `record_noted`
(which now takes the heap's stage reach), so they are a function of the bind shape: the runtime's
bound-value memo, keyed by (variant, plan, specialization), stays valid. The runtime announces a
holding heap clause as `ycbcr-filter-not-exact` (`degrade_clauses`), naming the stage.
Why. A probe on the M3 Max (MoltenVK) showed a 4:4:4 two-plane texture (identity address-mode map:
`YCBCR8_444_2P`, `YCBCR10_444_2P`, their sRGB twins, the packed 10-bit one) held by an argument
buffer and sampled linearly through a constexpr, runtime-slot or argument-buffer sampler ran and
announced nothing, where Metal's own sampler filters the kept image's float texels, not Metal's
exact filter: an under-announcement. (4:2:0, 4:2:2 and the code-reading 4:4:4 textures reached
through handles are refused, `MappedTextureSampling { through: Handles }`; a slot texture sampled
through an argument buffer's sampler is refused at translation, `ArgumentBufferTextures`.) Which
sampler state an argument buffer holds is in its memory, which no plan reads (the binder's rule:
argument samplers come from object lifetimes), so the argument-sampler test is "a live state
filters": a program whose live states are all nearest announces nothing.
SEMANTICS_VERSION 1973 -> 1974 (precision notes change for heap samples on metal-sampler
profiles); ARTIFACT_FORMAT_VERSION 489 -> 490 (two `SpecKey` variants in the codec). The golden
table does not move (no SPIR-V changes). `api_signatures.tsv` gains the two variants.
heap_linear_samples_are_the_device_s now expects the specialized note on MoltenVK 2D samples.
Verified (potluck):
- M3 Max, MoltenVK, GPU (job m3-max-2786): 64/64 lane tests (ycbcr_textures, ycbcr_in_place,
degrade_notices, pixel_samplers, ycbcr_device_reads, argument_linear_samples), the new
a_ycbcr_texture_through_an_argument_buffer_announces_its_filter_only_where_it_can_filter
printing, for YCBCR8_444_2P and YCBCR10_444_2P_sRGB: constexpr linear 1, runtime nearest 0,
runtime linear 1, argument nearest 0, argument linear 1, argument nearest with a linear state
alive 1; RGBA16Float 0 in every case.
- lavapipe (msi, llvmpipe LLVM 23.1.1; job m3-max-2775): the same 64/64; announced only where
the device converted the 8-bit 4:4:4 texture itself.
- M3 unit tests (jobs m3-max-2767, m3-max-2774): the new
tests::engine_heap_binder::a_heap_texture_s_ycbcr_filter_note_holds_where_its_sampler_can_filter
and 134 more (engine_heap_binder, engine_ycbcr_in_place, engine_handles, golden_hashes, cache),
api_signatures/api_surface/refusal_surface 19/19, runtime tests::degradation 17/17; clippy
plain, --cfg m2v_gpu, --cfg m2v_cpu_icd and rustdoc -D warnings clean.
- Negative controls, both failing: no heap note (the unit test, and the lane's constexpr linear
case announcing nothing on the M3); a plan answering 1 for both keys (the unit test at
"YCBCR84442P beside none", the lane's argument nearest case announcing on the M3).
- Release CLI on moltenvk-m3, tip against 80d2dc465f, 3 runs: tail_argument_samplers
argument_sampler_sample 0.02 s / 25.1 MB both; handles argument_buffer_runtime_sampler 0.02 s /
25.6 MB both; grd_half_many_samples 0.05 s / 25.9 MB both.
(cherry picked from commit 8403d3746182d6c1acf7795666fc46fea811e660)
|
||
|
|
ffbfb8631d |
Bump SEMANTICS_VERSION to 1974 and regenerate the conformance coverage at stack 37's picks
Three picked branches each moved SEMANTICS_VERSION from 1972 to 1973 on their own: runtime sampler slots' filter notes now carry a test of the bound sampler word; an object function's barriers are predicated so a partial object threadgroup runs as Metal's; and extended-range partial masks and unwritten padded or bfloat attachments link. Together their outputs differ from any one branch's at 1973, so the version moves once more. docs/CONFORMANCE-COVERAGE.md is regenerated from the merged sources and recordings (the picks' conflicts kept the earlier text). Verified: conformance-coverage --check, signatures.py --check and refusal_surface.py --check pass on this tree; metal-coverage is current. |
||
|
|
c3cbf1e76b |
Conformance: the RTX 5080's XR rows at the multisampled shadow; lavapipe's BGR10_XR masks merge
The RTX 5080 (b5080 entry xr2-replay-xr, every xr-* case at b026d47db4) now matches the M3's
four-sample gamut counts (226/295 elements, one code; sRGB 547/548, up to four codes), where the
ledger had 542/543 and 610/622 from before the per-sample shadow: those ten rows take the M3's
counts and text. New rows for the 5080: the eight gradient cases (blended 134/142/109/145
elements, one code; unblended 39/44 and sRGB 56/86, the same counts as lavapipe's, the device's
float arithmetic of the gradient), the BGR10_XR masks (the M3's counts: 37, 41, 9, 14) and the
padded sRGB fill (92). The 5080's other unlisted xr-* divergences (blend, clears, clear-routes,
draw, planes, two-plane samples, two-planes) are in cases this branch does not touch; they are
left out here.
lavapipe at 36239bb3ab (msi's LLVM 23.1.1 and Ubuntu 26.04's Mesa with LLVM 21.1.8, the CI
image's): the four BGR10_XR partial-mask cases no longer refuse. Their texels match Metal's
(linear) or sit one code off (sRGB: 14 and 9 elements, the M3's counts), but the runtime announces
extended-range-blends-stored-codes at the merging draw: it reads the color over an input attachment,
where no half shadow is held, and the pipeline's state does not tell a read that only keeps codes
from the function's own fetch. The ledger records that as our gap (case/notices rows), and the
notice's documentation (degradation.rs, API.md) says it fires there. A base build (
|
||
|
|
c559ed6f84 |
Docs: the half shadow holds at more than one sample; REFUSALS for the merge's refusals
The extended-range-blends-stored-codes notice (its declaration and the docs/API.md catalogue entry) now says where it is not announced: a color whose half shadow the runtime holds, in a pass of one layer on a device that orders fetch through the pixel interlock alone, at one sample or more, from the pass's clear or (at one sample) its load; and where the codes stay: over lavapipe's input attachments, in a multisampled pass that loads the color, and after a draw the shadow cannot follow. docs/FAST-PATHS.md's word attachment row no longer says an extended-range color keeps its codes at more than one sample. docs/REFUSALS.md regenerated (scripts/refusal-surface/refusal_surface.py): link's second extended_write_mask site and fetch::unordered_extended_fetch. How verified: refusal_surface.py wrote the table with 0 variants without a reach mark or a basis; the catalogue test runs with the runtime suite next. (cherry picked from commit 70691da1d131573dac3a3c4ae4e6436ad48283f3) |
||
|
|
e10552b553 |
Re-record the mesh limits cases on the M3 Max, time every new case, regenerate the coverage document
What: the 17 mesh-limits cases' Metal answers and M3 cost bounds over the trimmed fixture, the timings of all 34 new and re-recorded cases (times --write, both legs; the host's load was above the gate's 26, so the verdict is to be re-read on a quieter host), docs/CONFORMANCE-COVERAGE.md (MTLMeshRenderPipelineDescriptor 27 of 27 items compared, the MTLRenderPipelineState getters 18 of 22), and the golden and inventory rows of the trimmed fixture. Why: the fixture's AIR changed; the suite's own tests ask each case for its cost and timing records. Verified: M3 jobs m3-max-2732 (bless, 155 touched translator tests pass) and m3-max-2737: replay on MoltenVK of the 34 cases, 29 exact, 4 announced (the partial-barrier draws' emulation notices), 1 refused as known-gaps.tsv expects (mesh-limits-amplification-2), exit 0; the conformance crate's 1023 tests pass. (cherry picked from commit d8031c15692c56abc40b3c6fc80579091bbfb680) |
||
|
|
7c6b61b76d |
Leave the mesh limits whose Metal answers follow compiler history out of the cases; ledger the amplification refusal
What: the mesh-limits family drops its 16 rows of a required threadgroup size or a function's own thread maximum, the fixture its two functions of one, and MeshLimitsSpec its required sizes. mesh_pipeline_limits.m and docs/API.md (accepted differences) record why: on the M3 Max each such answer changes with what the compiler compiled before (a first compile refuses a required size of 32 under a maximum of 64 in either stage and makes it after a compile under 64; a first compile of a function of max_total_threads_per_threadgroup(64) answered 32), so the recorded mesh-limits-required-mesh-32-max-64 made where the probe and a first compile refuse. known-gaps.tsv lists mesh-limits-amplification-2's refusal on every venue. Why: a recording of those rows holds the compiler's history, not an answer; the amplification refusal is an open gap. Verified: fresh-source creations on the M3 Max (jobs m3-max-2717 and m3-max-2725); the family re-records in the next job. (cherry picked from commit 187f1b12c0b8282a0dcf1e43ab530123ccf1d2fa) |
||
|
|
0f289cdac4 |
Commit the regenerated fixture companions, and record how Metal runs an amplified mesh draw
What: the .ll and .air.ll companions of mesh_partial_barrier, compute_thread_limit and mesh_pipeline_limits, and their TOOLCHAIN lines (regen-air-fixtures on the M3 Max, job m3-max-2677). probes/ mesh_amplification.m records its answers: under an amplification count of 2 the object function runs once (8 threads) and the mesh threadgroups it launches run once per amplification (16 threads, ids 0 and 1, a count of 2), each into its view mapping's slice. FAST-PATHS.md's known gap for a mesh pipeline's amplification says what an exact form must do and why neither built draw form is one. Why: the tests and cases read the fixtures; the gap stays open with the measured semantics written down. Verified: the probe ran on the M3 Max (job m3-max-2677). (cherry picked from commit bb5a45dd26d89d5af72e755ad4ac976975007d8b) |
||
|
|
b43ba48ee2 |
Regenerate the signature table and REFUSALS.md
What: api_signatures.tsv gains ComputePipelineProblem, its two variants and DescriptorError::ComputePipeline; REFUSALS.md's RequiredThreads row says only what creation refuses. Why: the new public refusal and the corrected problem doc. Verified: signatures.py --bless and refusal_surface.py on msi (job m3-max-2689). (cherry picked from commit 301047b4dc4f5f4f3a4d1725c9966e152f5b4fb0) |
||
|
|
9609083aa2 |
Walk object and mesh functions predicated at their barriers, and partial object threadgroups from their threads
What: the divergent-barrier pass (lower::simd::divergent::barriers) now covers object and mesh functions as it covers kernels: a workgroup barrier in a block Uniformity does not prove uniform makes the body walk predicated, so every invocation reaches it. Every object function now runs a drawMeshThreads partial object threadgroup (lower::mesh::plan_partial_groups no longer excludes a body with a barrier; RuntimeFact::PartialObjectThreadgroups). One whose body holds any workgroup barrier is walked predicated (Predication::partial_groups) from live = KernelDecl::live, the invocation being one of its threadgroup's threads (dispatch::emit_entry computes it in the entry block and hands it to the walk through CodeEmitter::entry_live/EmitCx::entry_live), so the invocations past a partial threadgroup's threads reach every barrier, and loop vote, as invocations that returned at entry, and run no other instruction of the body: no load, store or atomic of theirs is made. A body without a barrier keeps its early return. The vote word an object function's walk takes counts in its ObjectThreadgroupArena fact, which the binder checks with the encoder's lengths; where the word does not fit and the barriers are uniform, the function runs no partial threadgroup (the binder refuses such a draw as before). Why: an object function with a threadgroup barrier on a partial object threadgroup was refused (NotImplemented(MeshShading), a FAST-PATHS known gap), which kept the Metal3 mesh shading row false on every device; and an object or mesh function's barrier after a divergent early return or under a thread-dependent condition stood in non-uniform control flow, which Vulkan leaves undefined (an Intel GPU hangs on it). Docs: FAST-PATHS' known gap is gone; render/mesh.rs, bind/graphics.rs and the fact's docs say what runs. The Metal3 mesh feature rows (families/features.rs) lose their not_implemented(MeshShading), and the families test now expects the mesh shading row exact where the device runs the stages natively or as compute work. Tests: engine_mesh_barriers (new, over the owned fixture mesh_partial_barrier): every object function and the divergent mesh function predicated on every committed profile, their bodies' barriers all uniform by spirv::testing::barriers::workgroup_barriers_of (new: the check of a called body); partial draws instantiate; and the interpreter runs each emulated object function's partial and whole draws under BarrierRule::Vulkan giving the predicated reading. The old a_partial_object_threadgroup_of_a_body_with_a_barrier_is_not_implemented is replaced by a_partial_object_threadgroup_of_a_body_with_a_barrier_draws. SEMANTICS_VERSION 1973. Verification in the following commits' potluck runs. (cherry picked from commit 65660d13d001484e444c0f89b268f92b847976b1) |
||
|
|
8f2f973478 |
Announce a runtime sampler slot's YCbCr filter note only where the bound sampler filters
What: a filtered sample's note of a two-plane YCbCr format through Metal's own sampler (`PrecisionNote::HalfSampleFilter`, `FloatSampleFilter`, announced `ycbcr-filter-not-exact`) through a runtime sampler slot now holds only where the word of the sampler bound there filters. `lower::sampler::linear::filter_note` crosses the bound-format clauses with two tests of the bound word (`NoteOn::BoundSampler`, `SpecKey::BoundSamplerWord`, which the plan already records for noted keys): a linear min or mag filter, anisotropy or a cubic filter (any of those bits), or a linear mip filter, the constexpr rule `linear::unfiltered` read from the word. A constexpr sampler keeps its rule; an argument buffer's sampler, whose word no slot test reads, keeps the format-only clauses. Runtime: such a clause tests a bound value, so `Device::degrade_bound_values` reads it at each draw or dispatch. It now also answers `SpecKey::BoundTexelFormat` from the command's formats (the class `bound_texel_format` gives; a slot bound to nothing fails the clause, as `degrade_bound_formats` reads it; unknown formats hold), checks a filter note's kind as `ycbcr-filter-not-exact` (one atomic load once announced), and `degrade_clauses` announces a filter note's slot of unknown format (an execution of GPU-written commands) as that kind, naming "a format the GPU's commands bind", as `degrade_bound_formats` does. Which clauses hold stays a function of the plan (the shape it is planned for holds each bound format and sampler word), so render.rs's `QuietBoundValues` holds. Why: a runtime sampler slot announced the note whatever its sampler state, so a nearest runtime sampler on a texture that keeps its image (a 4:2:2 or 4:4:4 one on the M3) announced it though a nearest sample reads the one texel the view holds, Metal's read; the consumer runs notes fatal on Apple GPUs. Validation: `run_kinds` (degrade_notices) evaluates the bound formats through the same closure, and `bound_value_kinds` maps a filter note to `ycbcr-filter-not-exact`. Tests: `tests::engine_ycbcr_in_place::a_runtime_sampler_s_filter_note_holds_only_where_the_bound_word_filters` (clauses on moltenvk-m3 hold for linear min, mag, mip and anisotropic words over YCbCr formats, not for nearest words or other formats; lavapipe records none) and the lane test `runtime_lane::ycbcr_textures::a_runtime_sampler_announces_the_ycbcr_filter_only_where_it_filters`. Docs: the notes' rustdoc, `YCbCrFilterNotExact`, docs/API.md's two entries. SEMANTICS_VERSION 1973: the artifact's specialized notes change (no SPIR-V changes). Verified: cargo fmt; builds and runs follow. (cherry picked from commit d464b1d36f998cd8c69a9f2c9252288df64d13d9) |
||
|
|
efe9581bcf |
Map maxArgumentBufferSamplerCount in the porting guide
What: docs/RUNTIME-PORTING.md gets a table for the consumer's IdentityCaps (MTLDevice identity and size answers) with one row: sizes.max_argument_buffer_sampler_count, Metal's maxArgumentBufferSamplerCount, maps to DeviceProperties::max_argument_buffer_sampler_count. The row gives the derivation (one fewer than the smaller of a set-1 sampler array's elements, pipeline::heap_sampler_capacity, and maxSamplerAllocationCount) and marks it partial: 65535 on MoltenVK on an M3 Max, where Metal answers 500000. Why: the samplercount work added the property without a row here, so a port had no entry for the selector. The Item name is the consumer seam's field (reims-vgpu-core platform/caps.rs, IdentitySizes, on its current branches). Docs only. Checked against capabilities.rs (the field's rustdoc) and docs/API.md's accepted differences, which give the same derivation and values. (cherry picked from commit 866e5ab81bfee7ebcc521975a7c277d00ac20378) |
||
|
|
ee4a6c5b52 |
Bound texture ID placement by the handle table's reach
What: the runtime's set-1 image array capacity (resource_ids.rs `texture_arrays`, which texture placements and texture reservations are checked against) is now the least of the handle table's 65536 entries (bind::HANDLE_TABLE_CAPACITY, within which link sizes every heap array) and the update-after-bind image limits. Before, it was the limits alone. Each array carries what bounds it (`ArrayBound`): a device limit, named in the refusal as before, or the table. An ID past the table is refused Unsupported(ArgumentBufferTextures, NotImplemented), since no heap array on any device reaches it. `texture_arrays` and `check_capacity` are now free functions over the compile profile, so a test reaches them without a device. Why: this is the same gap `sampler_array` had before the samplercount work. MoltenVK reports 1,000,000 update-after-bind sampled and storage images, lavapipe 1,015,808, RADV 8388606, and ANV and NVIDIA more, so a texture reservation between 65536 and those limits was accepted. Yet no set-1 array holds such an ID: a texture placed there reads the neutral through its ID. Placements are unaffected in practice, since Metal's placement limit (16381) lies below the table's reach. Reservations of 65536 and more are now refused where they were taken. Tests: resource_ids::texture_arrays_reach_no_further_than_the_handle_table checks every committed profile: each array is at most the reach, the ID below its count is taken, and the ID at its count is refused naming its bound. It pins MoltenVK, lavapipe, RADV, ANV and NVIDIA to the table and the desktop baseline to its 128 sampled and 8 storage images a stage. Without the fix, the pins fail (moltenvk-m3: 1000000). A new device test, runtime_lane::resource_ids::a_texture_reservation_at_the_handle_table_s_reach_is_refused, reserves texture ID 65536 (refused, not implemented, where the device's limits reach past it) and 65535 (taken), printing a TEXTURE_RESERVATION line. REFUSALS.md is regenerated (check_capacity, 2 sites). Verification runs follow in the branch report. (cherry picked from commit 9629f473e25790aa573b03d6c4419d99127f33ce) |
||
|
|
570df3cc95 |
Answer maxArgumentBufferSamplerCount from the set-1 sampler array and the sampler limit
What: `DeviceProperties::max_argument_buffer_sampler_count`, Metal's `maxArgumentBufferSamplerCount`: one fewer than the smaller of a set-1 sampler array's elements and the device's maxSamplerAllocationCount (element 0 of the array, and one of the device's samplers, are the neutral sampler's; each state the array holds takes an element and a sampler of its own). The array's elements are a new public translator function, `pipeline::heap_sampler_capacity`: link's heap capacity for a heap of one sampler array with set 0 counting no sampler, the least of the handle table's 65536 entries (TABLE_CAPACITY) and the two update-after-bind sampler limits, 0 where a function cannot read a set-1 sampler array (the layout's features or the module's non-uniform sampled-image indexing). Link's heap_capacity now reads the same limit table (`heap_limits`) and arithmetic (`room`), and heap_set the same layout-feature check (`heap_layout_lacks`), so the sizing and the answer cannot drift. The runtime's `Device::sampler_array` (each state's creation-time check) now calls it too: it was the two update-after-bind limits without the handle table's reach, 500000 on MoltenVK where link makes 65536 elements, so a state past 65535 was not announced as it was made. The device's SamplerCount and the answer read one value, the identity's maxSamplerAllocationCount. Why: the consumer computed it as the least of the two update-after-bind sampler limits and maxSamplerAllocationCount; that misses the handle table's reach (500000 against our 65535 on the M3) and the neutral's element (32768 against 32767 on lavapipe, 4000 against 3999 on NVIDIA). Metal on the M3 Max (macOS 27.0.1) answers 500000 (a Swift query of MTLCreateSystemDefaultDevice, potluck job m3-max-2496), recorded in the field's docs and docs/API.md's accepted differences. Tests: engine_handles::an_argument_sampler_array_has_the_heap_sampler_capacity (link's array equals the function on every committed profile, follows lowered limits, 0 without the features); capabilities:: argument_buffer_samplers_are_one_fewer_than_the_array_and_the_sampler_limit (every committed profile, pinned venue values); the device test argument_sampler_count (the kernel's array, the device's count, the driver's limit and the answer agree; elements-1 states unannounced, the next announced). Verification follows in the branch's report. (cherry picked from commit 7a2b84f15a1dde81e35cbc0b9367962e54d8332f) |
||
|
|
296723b362 |
Test a filter notice's bound format against the format the slot's binding presents
The consumer's own-format view test died on the M3 Max (MoltenVK) in strict mode at a sample of an 8-bit 4:2:0 texture's 2D array view in its own format: `ycbcr-filter-not-exact`, "texture 0 bound as YCBCR84202P". That view is the luma view (`Texture::luma_view`): an `R8G8B8A8_UNORM` image of the codes, read as the code-reading format `RGB8_420_2P` through a swizzle, which Metal's own sampler filters as Metal filters that format (the lane already holds the view's linear sample to that format's, and Metal's view to it bit for bit). The binding plan reads the bound record's format (`ViewRecord::bound`, `RGB8_420_2P`), but the notice's bound-format test read `Texture::pixel_format`, the view's own (`YCBCR8_420_2P`), whose class carries the 1/2048 field `FloatSampleFilter`'s clause tests. So the note was wrong: no float texels are filtered there. The 10-bit views (`RGB10_420_2P` codes, `A2B10G10R10_UNORM_PACK32`) and the `_sRGB` twins' views announced it alike. `Tables::bound_format` now reads the format the texture's bindings present (`Texture::bound_pixel_format`, `ViewRecord::bound`), the one its slot's code was specialized for. That changes what the bound-format notices test and name for every texture that reads its image in another format: the luma views; views in other channels of their image's bits, whose class is their image's; and converted textures over a P3 surface, whose image is the code-reading format's codes. A P3 texture's linear sample is no longer announced: Metal's filter of it is not measured, now a FAST-PATHS known gap. Notices only: no pipeline, binding or answer changes. Docs: ycbcr.rs (views; linear filtering, with the in-place form's 4:2:0-only reach), the YCbCrFilterNotExact declaration and its API.md entry, and the FAST-PATHS known gap. Verified: cargo fmt. The lane check of the previous commit fails without this on the M3 Max; device runs follow. (cherry picked from commit 37a50861dd4e105619690a520a290c30bd3208d5) |
||
|
|
a2b99ee4f6 |
Report each write to a log of host pages in one batched call
The consumer measured DirtyCommit::report_host_writes at 77.7% of its present path on the RTX 5080: PagesLog::wrote_but called the source's hook once per run of the object's window in a guest RAM's log, about 9,000 calls a report for a 3840x2400 BGRA8 surface over scattered 4 KiB pages. PagesLog::wrote, wrote_as and a shadow's report did the same. DirtyPages gains wrote_runs(&[Range<u64>]) and wrote_runs_as(&[Range<u64>], writer), whose defaults call wrote or wrote_as once a run, in order, so existing sources keep working. Every write the runtime reports now comes to each log as one call carrying all its runs there: each range of a command buffer's writes in place (the bytes no shadow wrote, the gaps between the shadows' writes, in order), each shadow's write to the other logs, a copied host buffer's merge back (all its blocks, one call per log and copy, where it was one call per run of each block), a CPU write, and a shadow's copy back or merge (one run). For each source, the runs, their order and their writers are what the per-run calls carried. The runs gather in a thread-local buffer kept for the thread's next report, so a warm report allocates nothing (wrote_but also no longer builds a Vec per range to cut out the shadows' writes: one sorted list, swept). The internal DirtyHook calls the batched forms alone; its per-run methods went. The read side needs no batching: changed and changed_except already hand back every run of a query in one call. watch stays per run: a copied host buffer watches its runs once, at its making, not per report. Docs: the trait's contract for the runs (never empty, each non-empty, in the order of the object's bytes, apart in the object, not sorted by offset over scattered pages), its Batches paragraph, HostMemory::with_dirty_pages, the runtime README and HOWTO's guest RAM log; the api_signatures table blessed (two trait items). Tests: dirty_runs checks, over a memory log and a guest RAM log of 24 scattered pages, that a command buffer's report, a write with a shadow's merge inside it, a copy's merge back of three blocks and a CPU write each reach each log in one call per range carrying exactly the runs worked out from the window, and that a log keeping only wrote/wrote_as hears every run in the same order with the same writers. The bench gains a batched trivial log. (cherry picked from commit b69d6b70c49af0b0ab08db5fe2f8b78cd61ed2fe) |
||
|
|
b18b105cc0 |
Let a thread's own pass take the ready heads not behind, as the scheduler's does
A committing thread's pass (commit_and_submit) and a waiting thread's took only the line head committed first of all (Order::take_first, and claim_check's first_mut): any earlier commit held on any queue, its checks waiting for a signal to land or run by the scheduler's thread, sent every later commit to the scheduler's thread, a wake and a hop each, even a ready one on another queue. A consumer's video round (5080, 1 s windows) showed it: 879 commits, 741 passes at commit, 358 batches submitted there, the other ~521 batches the scheduler's (batches_held_past_a_look 522, heads held for checks 718, for check signals 129, for earlier commits 46; no event-value, host-step or binary-semaphore holds), scheduler_wakes_host 668. submit_plain_ready now takes its heads with Order::next and is_behind, the scheduler pass's own selection: the first ready head in commit order that waits behind no earlier commit keeping its place. claim_check takes the first head in commit order whose checks the thread may run and that is behind no earlier commit (no check before the batch it waits behind is submitted, as check_heads keeps). A held head so holds back only the later commits that wait behind it: its own queue's, and another queue's whose footprint runs in commit order with it. Order::take_first and first_mut, now unused, go with their two unit tests; the scheduler's next is tested by the rest of tests::scheduler. Test: commit_and_submit a_head_held_for_its_check_holds_back_only_the_commits_behind_it holds queue A's check on the scheduler's thread, then commits B (same buffer, behind A) and C (another buffer) with commit_and_submit: C is checked and submitted on the committing thread inside its call while A's check runs, B on the scheduler's thread after A; handlers in submission order C, A, B; one batch checked and submitted at commit. Before this change C's check ran on the scheduler's thread after A's (expected; the run's evidence goes with the landing report). (cherry picked from commit ff664020a1c7fe171ff15422e17b3c846624d94c) |
||
|
|
8a516f2255 |
Submit a queued commit_and_submit on the thread that runs its commit
Under RenderLoweringPolicy::Worker a commit whose last render encoder's end the lowering thread has not lowered returns at once and leaves its own work to the thread that lowers the end (render/queued_commits.rs). That run committed with Hand::Wake whatever the call was, so a commit_and_submit left so lost its inline pass: the scheduler's thread was woken for it and ran its checks and handlers. The queued commit now keeps the call's hand (State::queued_commit is Option<Hand>), and commit_queued makes commit_and_submit's pass on the thread that runs it (the lowering thread, or a program thread that settles it before a wait), with Hand::Wake on a thread command buffers' completion depends on, as commit_and_submit does there. The pass's submission checks and handlers then run on that thread. A render encoder opened there (by such a check or handler) lowers its calls at their calls: one that handed them to the lowering thread could wait for itself in reserve_end or wait_for_room. Test: deferred_calls a_commit_and_submit_after_an_end_in_flight_is_submitted_by_the_lowering_thread holds the slot so the end is in flight at the commit, then checks the check and handler ran on metal2vulkan-lowering, one pass at commit submitted and checked the batch, and an encoder the handler opened lowers at its calls. Without the hand kept the check runs on metal2vulkan-scheduler and scheduler_passes_at_commit stays 0; without the guard lowers_at_call is false. (cherry picked from commit bed9dc881cc1e6f18df708796da144a9072b9fb1) |
||
|
|
21a1cf7218 |
Give the commit hand-off's cost from idle too, and name commit_and_submit its inline form
docs/FAST-PATHS.md gave the scheduler thread's wake as 5 us on the RTX 5080 Laptop GPU, true for commits back to back, where the thread is awake. From idle it is far longer: with one fill committed every 2 ms (the completion latency lane), a commit's batch was watched 140 to 165 us after the call at the median on that GPU, against 5 us for vkQueueSubmit, and a parked thread's wake took 80 to 105 us at the median on that host. The row gives both, and names CommandBuffer::commit_and_submit as the inline form a program that needs the latency takes. (cherry picked from commit 880ffe3b551b585a7593784165a7b4ac11bc50ec) |
||
|
|
7d813def6f |
Regenerate the derived tables at stack 35's picks
The private-doc-link mend shortened the degradations! macro's note link and a refusal's doc link to in-scope paths, which moves the macro's template in api_signatures.tsv and one row of docs/REFUSALS.md; no item's signature changed for a consumer. The mesh change runs a partial object threadgroup, so the two mesh-object-draws-partial-threadgroup cases leave the conformance ledger (1378 rows to 1376) in docs/CONFORMANCE-COVERAGE.md, whose conflict the pick resolved to the earlier text. Verified: signatures.py --check, refusal_surface.py --check and conformance-coverage --check pass on this tree; metal-coverage is current. |
||
|
|
c305c66a7f |
Give mesh pipelines Metal's descriptor limits, state queries and refusals
The mesh descriptor gains Metal's fields, with Metal's defaults:
max_total_threads_per_{object,mesh}_threadgroup, max_total_threadgroups_per_mesh_grid,
the two threadgroup-size-is-multiple-of-width flags, payload_memory_length,
max_vertex_amplification_count (1) and required_threads_per_{object,mesh}_threadgroup. The
descriptor key reads every one.
A compiled mesh pipeline carries MeshPipelineMetalInfo (RenderPipeline::mesh_info), and the
runtime's RenderPipelineState answers Metal's five mesh queries from it, plus the two required
sizes. Each thread limit is the descriptor's maximum, else the function's
[[max_total_threads_per_threadgroup(n)]], else 1024, held to the device's own limit where that is
lower: the task and mesh stages' invocations with VK_EXT_mesh_shader, the compute stage's where
both stages run as compute work. The widths are 32. The grid limit is the descriptor's, else the
object function's [[max_total_threadgroups_per_mesh_grid(n)]], else 2^20, held to
maxMeshWorkGroupTotalCount where mesh functions run natively. Without an object function the
object stage answers 0 and 0, where the M3 Max answers 3 and 32 (an accepted difference).
DeviceProfile::emulates_mesh_shading says how a device runs the stages, so a consumer no longer
copies the compile layer's rule; with the getters, no separate per-stage query is needed.
What Metal refuses is refused as Metal's rule, DescriptorError::MeshPipeline with a
MeshPipelineProblem, measured on the M3 Max (mesh_pipeline_limits.m, plain and under
MTL_DEBUG_LAYER): a required size with an axis of 0, past 1024 threads or past its stage's
maximum, or for an object stage without an object function (process ends); a maximum past 1024,
a function maximum other than the descriptor's, a mesh stage's required size of other threads
than its maximum, and a payload past 16384 bytes (creation errors, codes 3 and 2). An
amplification count of 0 is VertexAmplificationCount, as a render pipeline's; one above 1, which
Metal makes, is NotImplemented(VertexAmplification), recorded in FAST-PATHS' known gaps.
payloadMemoryLength widens the object and mesh functions' payload arena past the declared type
(LoweringInputs::object_payload now reaches the object stage too); an object stage compiled on
its own without it is NeedsInput(ObjectPayload). SEMANTICS_VERSION 1971 and
ARTIFACT_FORMAT_VERSION 488 for that and the new artifact field; the runtime's warm record
format 4 for the descriptor's fields.
Docs: the new_mesh_render_pipeline_state doc now says how each device runs mesh stages, and
what it refuses; API.md's accepted differences gain the mesh pipeline rows. api_signatures
blessed (it also records RuntimeFact::PartialObjectThreadgroups from the partial-threadgroup
commit), api_surface lists MeshPipelineMetalInfo and MeshPipelineProblem, REFUSALS.md,
METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated.
Tests: engine_mesh's a_mesh_pipeline_answers_metals_mesh_queries_within_the_device and
a_mesh_descriptor_metal_refuses_is_refused_as_its_rule over every committed mesh and
emulating profile; the validation lane's
a_mesh_state_answers_metals_queries_and_refuses_what_metal_refuses on a device. Not yet built:
the next steps are the M3, lavapipe and RTX 5080 runs.
(cherry picked from commit d6934967fad363ca2185c49935204141f253b416)
|
||
|
|
ead2c31249 |
Run a partial object threadgroup of drawMeshThreads as Metal does
What: a drawMeshThreads with an object function whose threads leave a partial object threadgroup now draws instead of failing with NotImplemented(MeshShading). The binder launches the object threadgroups the threads fill, rounded up, at their whole size, under MultiRegion 1, with Metal's threads in region[1].xyz and the new flag lower::dispatch::NONUNIFORM in region[1].w (a folded variant's record carries it in word 7). An object function whose body holds no workgroup barrier (lower::mesh::plan_partial_groups, RuntimeFact:: PartialObjectThreadgroups) reads the flag: its threadgroup answers min(L, threads - group * L) per axis as threads_per_threadgroup and in its simdgroup counts, its thread position is lin unflattened over that size, and its invocations past it return before the body. The emulated wrapper's payload copy strides by the dispatched threads so those invocations still copy. A body that holds a barrier keeps the uniform form and its partial draws stay NotImplemented(MeshShading), since the returned invocations would not reach the barrier (FAST-PATHS known gap). Why: Metal (M3 Max, macOS 27.0.1) draws these: 6 threads in object threadgroups of 4 run a threadgroup of 4 and one of 2 whose threads_per_threadgroup is 2, as dispatchThreads runs a kernel. Tests: lower::dispatch's partial_object_threadgroups_match_metal (each Metal thread live once with Metal's builtins, Spec and Flat forms); the binder's object_draws_specialize_each_stage_within_its_limits (the flagged region, MultiRegion 1, refused without the fact); engine_mesh's emulated and native partial draws and a_partial_object_threadgroup_of_a_body_with_a_barrier_is_not_implemented; the lane test object_draws_store_metals_words now requires Metal's words for both Threads rows; the conformance ledger's two partial rows are removed. SEMANTICS_VERSION 1970. Verification in the following commits' potluck runs. (cherry picked from commit 1707d3428bcd641faba462d4c35b13148df83a91) |
||
|
|
1f2b0f2d39 |
Run a command buffer's completion-seen handlers where seen even with completed handlers
A command buffer with completed handlers ran its whole transition to Completed on its queue's handler thread, its completion-seen handlers included, so they started a thread wake after the queue waiter's turn: the consumer's handler_cost bench (a completion-seen and a completed handler on each 4 KiB fill) put that wake into the completion-seen latency. On an idle M3 Max (MoltenVK 1.4.2) the turn-to-handler time was 22 us at the median with a completed handler against 1 us without. Now the waiter runs such a transition to its completion-seen handlers (To::Seen: its status final, those handlers run) where its queue's context is idle, and posts the rest (To::Rest: follow release, completed handlers, slot, releases, gate) to that context while it still runs it, so the queue's later items stay behind the rest. The rest holds its own Hold, so the gate, and wait_until_completed, open only after the completed handlers and once the context is done with the rest (the order a10704b730 set). A command buffer with a Follow (it signals at its end an event another queue's command buffer may wait for) keeps the whole transition on the handler thread, so the cross-queue order (follow.rs) is untouched. Where the waiter cannot run it here (the line busy, a deallocator held), the transition goes whole, as before (Item::whole). complete() is split into complete_seen() and complete_rest(), unchanged in order. Docs: add_completion_seen_handler, completion.rs, the runtime README and RUNTIME-PORTING. Not yet run on a device. (cherry picked from commit e1f36ec2f08735c92872a3d5eed8689b398373ce) |
||
|
|
5080707c8c |
Document the surface shapes and BC textures the runtime makes
linear_plan.rs gains **Block-compressed surfaces** and **Beyond the plane's rows** (the probe's measurements and what the runtime holds); new_texture_with_iosurface_plane names the new shapes and the SurfacePlaneShape refusal; TexelsPastBufferLength records where the M3 Max puts rows past a surface's end and that the x86 Macs' are unmeasured; FAST-PATHS.md's known gaps record the refused shapes and the taller-than-plane divergence on the x86 Macs, which IoSurfacePlane cannot hold as it carries no plane height. Regenerated docs/REFUSALS.md and api_signatures.tsv (RuntimeGap::SurfacePlaneShape). Verified: refusal_surface.py (0 variants without reach or basis); signatures.py --bless. Rustdoc runs in the next M3 job. (cherry picked from commit d3bb1dfa2aab94728518529a0b2020da4a3e76aa) |
||
|
|
a57e6c770a |
Copy a standing shadow in whole at its command buffer's first use
A pass that loads a shadow and draws under a scissor copied in only the scissor's texels, so the image held only those: a later command of the same command buffer reading every texel copied them all in again (beyond what it held), and the command buffer's end, holding less than every texel, left no standing. On the M3 the padded Private plane's Write frame (a scissored pass, then a pass sampling the surface whole) planned 9478144 texels in a frame and skipped only the scissor's 262144 (job m3-max-1937); WriteThenReadApart's writer never stood. At a command buffer's first use of a shadow that may stand across command buffers, the copy in takes every texel, as over logged host pages: it moves nothing where the image stands, and leaves the image holding every texel for the command buffer's later commands and its end. The device test adds a pass that draws inside four rows: its load takes the standing image, and the next command buffer's read stands and holds the pass's rows over the earlier texels. API.md's catalogue entry says the scissor cut does not apply to that first use. Verified: runs next on the M3 with the controls. (cherry picked from commit 258964cc06d8c4da64866b6991ec8b46906fa504) |