3e2e65ee1a3cf5c22ac6c4e6affc5337b93ffd3f
34
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c99bf0c6c3 |
Translator and runtime: a nearest runtime pixel sampler keeps its texel centre; only linear takes the level-0 arm
The exact arm hands the device's unnormalized sampler Metal's coordinate itself. Under a linear filter that is the device's own filter at Metal's coordinate (DeviceSampling). Under a nearest filter it moves texel selection onto the device sampler's own handling of the coordinate, and the pixel-samplers replays at 82b6989d59 show new slot divergences where the cards matched Metal before: - RX 550 (m3-max-85883): rgba8 and rgba16f nearest-zero and -border. - RTX 3090 (m3-max-85881): subnormal-zero and -border. Metal's recorded answers for the subnormal cases read texel -1 at a negative subnormal and texel 0 at a positive one, so no flush of a subnormal to 0 is taken. What changes: - SamplerWord::reads_unnormalized holds only for pixel coordinates with linear min and mag filters (no mip filter, isotropic, s and t clamped), the descriptor's unnormalized_reads of linear filters. - The shader's level-0 test compares the word's filter bits with UNNORMALIZED_LINEAR alone. Two instructions fewer per test. - A nearest word takes the form shipping before the series: the texel's centre over the size. A gather through a nearest word takes x / N with its PixelSamplerScaling note, as before the series. - The runtime makes twins, and holds level-0 elements, only for linear states. - SamplerWord::UNNORMALIZED_NEAREST is deleted. This series added it and nothing reads it now; it is not on development. - a_words_unnormalized_reads_are_its_descriptors now pairs the word with the descriptor's unnormalized_reads of linear filters: 9 descriptors, linear with linear over 3 by 3 modes. - Docs: the predicate's filters in docs/RESOURCE-ID.md and the runtime README; the sampler module's pixel-coordinate list names the level-0 arm. The conformance pixel_samplers module doc is corrected: a const site under the identity domains reads a normalized sampler, a linear slot site the twin. SEMANTICS_VERSION 2376 and RUNTIME_VERSION 2575 (a nearest word's arm and the runtime's linear-only twins and level-0 elements); the runtime-sources pin is recomputed. Checks: red d9abcdde67 holds only_a_linear_pixel_samplers_word_reads_unnormalized. This commit's gate and the family's card replays are named in the ledger commit that follows. |
||
|
|
43f22a5661 |
Docs, versions and API tables: the level-0 elements and unnormalized twins
The runtime's README describes set 1's sampled-image array of 196,608 elements (textures, second elements, level-0 elements) and the plain sampler array's 8,000 unnormalized twins, the level-0 element written at the first dispatch or draw that samples a texture through a state that reads unnormalized (Gauges::level_zero_views), the floor's limits (sampled images 262,144, samplers 32,000, per-stage resources 458,752, all pools 490,752; Vulkan's least with descriptorIndexing is 500,000), and attachment reads on every device. docs/RESOURCE-ID.md gives the two ranges, the word test and what a consumer laying the arrays out itself writes; an argument buffer's sampler still scales a pixel coordinate. The API signature table is blessed and api_surface names the two consts. Versions: SEMANTICS_VERSION 2375 (slot pixel samples gain the exact arm, and the interface's level_zero_samplers), ARTIFACT_FORMAT_VERSION 610 (TextureSlot's codec gains level_zero_samplers), RUNTIME_VERSION 2574 (set 1's sizes, twins, level-0 elements and the floor's limits). REFUSALS.md regenerated with no change. |
||
|
|
58988c6b83 |
Translator and runtime: BGR10_XR and BGRA10_XR textures are held as the UNORM codes of their bits and read as Metal's values
An arm64 guest walk met MTLPixelFormatBGR10_XR (554) and MTLPixelFormatBGRA10_XR (552), which the runtime refused (Gap::TextureFormat): the translator held them raw in an integer format whose values the identity domains do not convert. A texture of either is now held in the UNORM format of its bits (FormatEmulation::ExtendedRangeUnorm): BGR10_XR in A2R10G10B10_UNORM_PACK32, bit-identical, its alpha read as one; BGRA10_XR in R16G16B16A16_UNORM, viewed with red and blue exchanged. Copies, blits, getBytes and replaceRegion move Metal's bytes unchanged. The emulation is admitted for sampling, linear filtering and min/max reductions; a device whose format query lacks the usage is refused the texture. The runtime's form admits it. Every float or half sample, gather and read of a sampled colour image (lower::texture::extended_unorm) tests the texture's word: a slot's pushed resource ID word, format (word >> 16) in 552..554; an argument buffer member's handle, which now carries the word's low bits and bit 30 where the word names one of those formats (AccessPlan::heap_extended). Where it does, each lane holding a channel's code (the word's border-texel bits: code lanes, and alpha lanes) is mapped from the field's value u to Metal's (c - 384) / 510: w = u * m (m = 1023, or 65535 / 64), a read's and a gather's code taken whole (a 16-bit field's floor(w + 1/128), whatever its low 6 bits hold; a 10-bit field's nearest code, floor(w + 1/2), as NVIDIA's gather on the RTX 3090 widens a 10-bit code by replicating its bits, (c << 6 | c >> 4) / 65535, up to 0.015 of a code low, m3-max-85756), alpha clamped to [384, 894], and the quotient formed as n * KH + n * KL (KH + KL the f32 split of 1/510), which rounds once to Metal's correctly rounded value at every code, fused or not (unit tests over all 1024 codes of both formats, and of a replicated 10-bit code). The difference, both products and the sum are decorated NoContraction: lavapipe otherwise factored the sum into n * fl(1/510), which misrounds 572 of the codes (the first try replay's reads one f32 step off at exactly the codes that misround). A read the device's robustness bounds tests its operands inside the branch and reads a code lane outside as 0, Metal's out-of-bounds texel. A sample is the device's filter of the codes, which the affine map keeps. On a real card a nearest sample is Metal's value exactly: the RX 7900 XTX's every nearest sample of both formats, m3-max-85664. Lavapipe converts a field by its reciprocal, c * fl(1 / (2^b - 1)), as PrecisionNote::DeviceTexelConversion records, and the map keeps that: its nearest sample of BGRA10_XR's code 602 is four f32 ulps from Metal's (m3-max-85482, LLVM 23.1.1; m3-max-85612, LLVM 23.1.4). The runtime test compares nearest samples exactly, on lavapipe (cfg m2v_cpu_icd) against lavapipe's conversion so mapped. A render pipeline with a 552 or 554 colour attachment is made as before, through the formats' second, raw candidate (R32_UINT, R16G16B16A16_UINT; emulation ExtendedRange): their render targets are not built, and a texture of either with RenderTarget usage takes that candidate, which the runtime refuses (Gap::TextureFormat), so no pass draws into one. A storage element is not built (the storage choice refuses the emulation). Not built (the runtime's known gaps, docs/API.md): a sample past the edge through a border address mode reads the device's border in code space (opaque white 1.2529, BGRA10_XR's 1.2549; black -0.7529); a linear sample of a BGRA10_XR texel whose fields' low 6 bits are set filters them in (within 63/64 of a code step); every float sample, gather and read of a sampled colour image pays the word's test and branch. SEMANTICS_VERSION 2373 (module words: the arm, the handle's bits). RUNTIME_VERSION 2572 (a run views an extended-range format held as its UNORM codes); runtime-sources.sha256 re-pinned. api_signatures blessed: FormatEmulation::ExtendedRangeUnorm added (a consumer matching FormatEmulation exhaustively meets a new variant; the enum is non_exhaustive). REFUSALS.md unchanged. The ledger's llvmpipe rows for extended-swizzles-bgr10xr gain the four border sites (0ag1/g2, 0ag1/sl, 0ag1/sn, ar10/g1) the replay on lavapipe at the CI pin (Mesa 26.2.4, LLVM 23.1.1) shows, m3-max-85482, and its BGRA10_XR rows of nearest and linear samples name the low-bits gap beside the border's: most of the case's random fields hold low bits, which a sample filters in. Lavapipe's conversion shows at none of the case's elements (each texel's fields checked against lavapipe's reciprocal conversion). Coverage regenerated. |
||
|
|
41438f2693 |
Translator: a depth cube's read by face samples its cube view, as a colour cube's does
A read of a depth cube or depth cube array by face (depthcube<float, access::read>'s
read(coord, face, lod), air.read_depth_cube and air.read_depth_cube_array) was refused on every
profile, Unsupported{IdentityDomains; NotImplemented}: the read kept the 2D-array view
(RuntimeFact::ImageViewShape), which the identity arrays hold no element of. The resident tables
built it before the cutover to the one form, and that commit deleted its interpreter test with
them; the runtime's README listed it as a known gap.
A colour cube's read by face already samples its cube element, the texture's cube view, at the
texel's centre and the read's explicit level through element 0 of the plain sampler array (the
default sampler, nearest, every level), its operands tested in the shader. A depth cube's element
is its cube view of the depth, which that plain float sampler samples without a comparison as a
depth cube's sample() does, the depth the sample's first component. So slot::samples_cube_element
no longer excludes a depth shape: the read takes the same form, and the slot states no
ImageViewShape.
Tests:
- engine_texture's an_identity_cube_read_by_face_samples_its_cube_element compiles
unk_read_depth_cube too, on every identity profile: L3 passes, no ImageViewShape fact, its two
textures from the sampled float depth cube and depth cube-array classes, its sampler from the
plain array, OpImageSampleExplicitLod and no OpImageFetch. Red with slot.rs at the base.
- The runtime's tests::cube_reads gains cr_depth (a Depth32Float depth cube of three levels) and
cr_depth_array (a depth cube array of two cubes and two levels): every texel of every face,
level and cube reads its uploaded depth bit for bit, and each read outside the texture reads 0.
- scripts/qualify-public-cases, CI's step, qualifies the public case
depth-cube-and-cube-array-reads-at-32-and-16-bit-coordinates (3 x 3 depth textures, every
texel of every face and cube, depths over many binades) on lavapipe against its Apple M3 Max
observation.
Docs: lower::texture's module docs, slot.rs, emit.rs, API.md and RESOURCE-ID.md say a depth
cube's read by face samples its cube view; the runtime README's known gap loses the depth cube
read and names it lowered. engine_texture_unk's module docs no longer claim an interpreter run of
the depth cube reads.
Engine inventory: engine/unk_read_depth_cube.ll moves from Unsupported{IdentityDomains;
NotImplemented} to ok on all 15 profiles; its .air.ll twin moves at the M3 bless.
SEMANTICS_VERSION 2365 -> 2367 (a placeholder, renumbered at landing): the fixture's 15 golden
cells, one a profile, change from the refusal to modules, and no other cell moves. The golden
table and the authored compile census (the case's row, not_supported today) are re-blessed on
development.
Verified, at this commit's tree on
|
||
|
|
6706d5b97f |
rt and translator: a sampler of Metal's undeclared filter 2 is made and filters as nearest
MTLSamplerMinMagFilter's raw value 2 (SamplerMinMagFilter::Cubic) is declared by no SDK header, Apple page or Metal Shading Language text, and nothing a program asks tells it about the value, so it is undocumented Metal and is not emulated. Metal makes the state on every Mac measured. An Apple M3 Max filters it over a footprint wider than one texel, and a Radeon Pro 5300M and an Intel UHD Graphics 630 read the nearest texel (the conformance case's own inputs: jobs m3-max-85003 and m3-max-85004). The runtime now makes such a state and filters it as nearest on every device: no shader arm, no second pipeline, no query, no note. - rt Device::new_sampler_state no longer refuses a Cubic min or mag filter. Nothing raises Gap::CubicSampler now; the variant stays, documented so, because the consumer names it. - translator: SamplerWord::of sets no bit for a Cubic filter, so its word is the nearest filter's. SamplerWord::CUBIC (bit 30) is deleted (its one reader, the anisotropic word path, is gone on development). SamplerWord::FIELDS is now (1 << 30) - 1. unnormalized_reads compares the two filters as the device's (a Cubic filter's is NEAREST) rather than refusing Cubic. vk_sampler already made NEAREST of Cubic. - SamplerMinMagFilter::Cubic stays, because the consumer converts a guest's raw 2 to it. It is documented through regen_metal_enums.py's PRIVATE_DOCS as Metal's undeclared raw value 2, which the M3 Max filters and the x86 Macs read as nearest, and whose device sampler and word here are the nearest filter's. generated.rs is regenerated against the macOS 27.2 SDK. - docs: the runtime README's sampler line, RESOURCE-ID.md (the word's bit 30 is now 0, and the consumer makes a Cubic state as nearest), resource_words.tsv's three Cubic lines (bit 30 cleared: 0x40000000 -> 0x00000000 twice, 0x58f6ab53 -> 0x18f6ab53), and the comments in select.rs and extended.rs that said the runtime makes no cubic sampler. - reach.tsv's SamplerBicubicFilter row no longer names a runtime cubic sampler as its reach. REFUSALS.md and error/basis.rs regenerated (refusal_surface.py: Gap::CubicSampler has no raise site); api_signatures.tsv blessed (SamplerWord::CUBIC removed, FIELDS changed). - RUNTIME_VERSION: a Cubic state is made where it was refused, so it takes a bump, set at staging (left at development's 2568 here). SEMANTICS_VERSION stays, since no module's words change. runtime-sources.sha256 re-pinned. Consumer search (reims-vgpu development 1913fcbc15 and the steelbrain/* refs from the last day): Gap::CubicSampler, 2 hits (development crates/reims-vgpu-vulkan/src/rt_platform/diag.rs:3071 and :3109, a test that counts the gap's name), kept. SamplerWord::CUBIC, SamplerWord::FIELDS and SamplerMinMagFilter::Cubic by name: 0 hits. The consumer's rt_platform::state::tests::states_on_vulkan, which expects None for min_filter 2, now gets a sampler. |
||
|
|
e5b7498833 |
Translator: an argument buffer's texture read through a sampler takes its border texels from its resource ID's word
Metal 4.1's read(sampler, coord) of a texture an argument buffer holds was refused as
Unsupported{IdentityDomains} with cause HeapResource ("a texture handle that reads its table
entry beyond its element (Indexed ...)"): a read that may hand back the border texels made the
handle search's indexed form (Lookup::Indexed), whose uses read the border texels from a
handle-table entry, and the one form has no table. Metal gives the read to every guest device,
so it is built. The golden table's engine/kernel_read_through rt_heap_zero, rt_heap_ow and
rt_heap_arg, and the conformance cases read-through-a8, -heap-border, -heap-sampler, -r32f,
-rgba8 and -rgba8-swizzled, were refused.
The form is the slot's. Bits 0-11 of the texture's resource ID's word hold its border texels
(docs/RESOURCE-ID.md), and an argument buffer's member holds the whole ID, word included:
- AccessPlan::lookup no longer has an indexed form; a function with heap_border yields Element or
Flagged (alpha) as any other, which the admission takes;
- emit_identity_handle carries the word's low 14 bits (HANDLE_WORD, above the 16-bit element) in
every texture handle of such a function, ungated (the texture-buffer words keep their
TexelBufferWords gate where they alone need them);
- heap_element_index masks such a handle to its element at every use;
- heap_border_texels takes bits 0-11 of the carried word, and for a texture buffer whose word
holds a word layout's fields there, its format's border texels from its code, as a slot's read
does (words::slot_border_texels). It was an error stub;
- the read's words estimate counts that extraction (32 words) in place of two indexed flag reads.
Nothing builds Lookup::Indexed now, so it goes, with what only it used: HANDLE_ENTRY,
FLAG_BORDER_TEXELS, INDEXED_FLAGS_WORDS, heap_flags (a check for the indexed form; its two
callers wrap the handle themselves), the search's indexed arm and its test rows.
Test: engine_identity's
an_argument_buffer_textures_read_through_a_sampler_takes_its_border_texels_from_its_word compiles
rt_heap_zero, rt_heap_ow and rt_heap_arg on lavapipe, moltenvk-m3 and moltenvk-m3 without
robustImageAccess2. Each passes L3, plans heap_border, states no BorderTexels fact and no
specialization constant but the dispatch's, and on the CPU interpreter reads Metal's border
texels (metal::sampler::border_texel) of R32Float, RGBA8Unorm, A8Unorm and a swizzled RGBA8Unorm
for each entry's border colors, and the texel inside the texture. engine_texture_oob's
every_read_through_a_sampler_validates_or_is_refused_typed now validates the three entries where
it counted their refusal.
Conformance ledger (known-gaps-rt.tsv): the six `*` rows of those cases' rt_heap pipelines go.
With the pipelines made, each case runs whole, and llvmpipe's answers at 96 sites that a refusal
had left uncompared differ from Metal's by one f32 ulp in A8Unorm, RGBA8Unorm and swizzled
RGBA8Unorm texels. Those are the device's own 8-bit conversion (rule 1, note
device-texel-conversion), and each gets an llvmpipe row. docs/CONFORMANCE-COVERAGE.md is
regenerated.
Docs: the runtime README's forms list loses the entry for this read. API.md's identity paragraph
and RESOURCE-ID.md say an argument buffer's texture reads its border texels as a slot's does.
Engine inventory (public_fixture_expectations_engine.tsv): the 45 cells of
engine/kernel_read_through.ll's rt_heap_zero, rt_heap_ow and rt_heap_arg move from
Unsupported{IdentityDomains; NotImplemented} back to ok. Their .air.ll twins, which only macOS
assembles, move at the M3 bless.
SEMANTICS_VERSION 2360 -> 2361 (renumbered at landing: 2359 and 2360 went to checked naming and the seq_cst fence): the rt_heap cells of the golden table change from the refusal to
modules. The golden table is blessed at the next pin, not here. runtime-sources.sha256 moves for
memory/handles.rs alone: the deleted indexed form is translation code, and no run of an
unchanged artifact changes.
Verified, at this commit's tree:
- m3-max-84730, on the CPU with no device. Red: the new test and the read-through validation test
with the lowering and memory/handles.rs at the base fail (EXIT 100). Green: both pass, with the
search's tests (EXIT 0). fmt, signatures, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd),
Rustdoc, private docs, doctests and scripts/api-docs pass. The metal2vulkan suites ran 3,494
tests, 3,493 passed, and the one failure is golden_hashes_match_the_table; the engine inventory
parts pass. Validation ran 1,348 tests, all passed, 2 skipped; conformance ran 1,053, all passed.
- m3-max-84829, on the CPU with no device: of the golden table's 28,950 changed lines, all are
"profile changed" lines of the table not yet blessed since the resident core's deletion, and 45
change a cell, every one an rt_heap cell of engine/kernel_read_through.ll, from the refusal to a
module.
- m3-max-84715, the pinned lavapipe image (llvmpipe, LLVM 23.1.1, 256 bits): the conformance
replay of the 13 read-through cases ends EXIT 0 with "the 96 row(s) above are exactly the open
gaps known-gaps-rt.tsv expects on this venue".
- m3-max-84619, on the Iris Xe (Mesa 26.2.6), at the same change on the base before the inventory
bless: the 13 read-through cases report 0 gap rows, EXIT 0.
|
||
|
|
1c68dd10f4 |
Texture buffers: a read-write one is words where its format's own view reads none without a format
A texture buffer's form (rule 2's texture buffer formats, metal::format::texel_buffer_form) asked three accesses of a format's own view: a uniform texel buffer, a storage texel buffer, and a storage texel buffer written without a format. A function that reads a texture buffer through access::read_write reads its storage element without a format, which Vulkan asks of the view's format (VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT, VUID-vkCmdDispatch-OpTypeImage-07030), so on a device whose own view of a format lacks that bit the runtime refused the draw or dispatch (Gap::StorageElement, ReadWithoutFormat). ANV on the Iris Xe (RPL-P) lacks it for BGRA8Unorm, B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm (jobs m3-max-81883, m3-max-82116); its committed profile (intel-irisxe-rplp-anv) answers the same for RG11B10Float, RGB10A2Unorm and RGB10A2Uint, and so do intel-irisxe-anv and intel-uhd770-rpls-anv for all seven (job m3-max-82025). Holding those formats as words for every texture buffer would cost one made to be read 31.6% and 31.7% on that Iris (texel_buffer_bgra8_read and texel_buffer_b5g6r5_read, job m3-max-82136). The form now asks a fourth access, the storage read without a format, only of a texture buffer whose usage, fixed at its making, holds both MTLTextureUsageShaderRead and MTLTextureUsageShaderWrite, or is MTLTextureUsageUnknown (metal::format::texel_buffer_read_write): Metal lets a function reach a texture buffer through access::read_write only where its usage holds both. texel_buffer_form(pf, usage, profile) is one answer per format and usage per device; one made to be read or written alone keeps the three-access answer. On the three ANV profiles the seven formats move to words for such a texture buffer and nowhere else. AGENTS.md's rule 2 says so in the same commit: the three accesses, plus the storage read without a format for a texture buffer made with both usages, one answer per format and usage per device; it is still one query-chosen form, and the count of fourteen is unchanged. The word says the usage, as it says the format, so a shader that meets a texture buffer through a handle, as one at a slot, tells which answer holds: bit 11 of a texture buffer word of a format with a word layout, TextureWord::TEXEL_BUFFER_READ_WRITE, is set where it was made both to be read and to be written. It lies within the 14 low bits an argument buffer's handle carries (HANDLE_WORD), and the word stays the same on every device. The translator holds the codes a profile holds as words per usage (WordCodes: alone, read_write); the words twin's held test tests bit 11 beside the code only where some format is words for the one usage and not the other (read_write & !alone), and where the two sets are equal the test and the module are what they were. The runtime asks texel_form of the texture's usage at its making, and Device::minimum_texture_buffer_alignment, Metal's query of a format alone, answers the larger of the two forms' alignments: on the three ANV profiles (uniform offset alignment 1, storage 16, a single texel enough for both) B5G6R5Unorm and BGR5A1Unorm go from 2 to 4 bytes (a word against a 2-byte texel), and BGRA8Unorm, BGR10A2Unorm, RG11B10Float, RGB10A2Unorm and RGB10A2Uint stay 4; every other profile's two forms are equal, so its answer is unchanged (computed from the committed profiles' limits, not measured apart). Public contract, in this commit: TextureWord::of_texture_buffer(pixel_format, width, usage), texel_buffer_form(pf, usage, profile), the new texel_buffer_read_write and TextureWord::TEXEL_BUFFER_READ_WRITE (api_surface, api_signatures.tsv); docs/RESOURCE-ID.md's bit 11 row, its texture buffer word section and its test vectors: tests/resource_words.tsv gains a usage column, each format with a word at read (1) and read-write (3) usage with its widths, and at write (2) and unknown (0) at width 1. Consumer search: reims-vgpu at 4f46e27e3b (main's) and at its current e447795571 (mine): no guest computation of words; of_texture_buffer, texel_buffer_form, TEXEL_BUFFER_ and resource_words have no hit, and TextureWord's one hit is link-order.txt, a symbol order list naming TextureWord::of. The runtime README's known gap now says the read is served for a texture buffer made with both usages, and keeps the measured words' cost scoped to those; its form, alignment and words-cost paragraphs, docs/API.md and docs/REPLAY-STREAM.md name the usage. The zero for amd-rdna2-apu-radv, intel-arl-anv and nvidia-pascal-linux is unaudited: those committed profiles report all 39 word formats as words, so no format can move there by this rule (main opens a row to re-record them). SEMANTICS_VERSION 2339 (development holds 2338): the words twin's module on the three ANV profiles and the form's answers move. RUNTIME_VERSION 2558: a texture buffer's form, its word and the alignment the runtime answers move. runtime-sources.sha256 re-pinned (metal/format/texel_words.rs and metal/format/mod.rs are runtime inputs). docs/REFUSALS.md does not move (refusal_surface.py --check passed). Verified at 0cbe4dfc70, a commit of this same tree on a try branch (tree dd16b6a2f7): - red: the test before this one (rebased here as 5900eb8642), at ed24bac82a, job m3-max-83041 on the Iris Xe (RPL-P, Mesa 26.2.6): every_device_runs_texture_buffers_made_to_be_read_and_written_at_every_slot failed with B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm "not dispatched", the read-written slot's ReadWithoutFormat refusal; - the Iris Xe (RPL-P, Mesa 26.2.6), the runtime's texture buffer tests (--cfg m2v_gpu, filter test(texture_buffer)), job m3-max-83121: 12 run, 12 passed; the new test alone, job m3-max-83127, passed, every one of the 15 formats answering the CPU's at every slot. It asserts, per texture buffer made, that the words gauge (Gauges::word_texture_buffers) moved exactly where the form answers words for its usage, and that the words twin ran once per dispatch where one bound is words; every_device_reads_and_writes_texture_buffers_of_formats_held_as_words printed B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm "own view; made to be read and written, words: every answer the CPU's", where they were refused before; - the Iris Xe, rt_replay's texture_buffers_play_with_their_recorded_ids_and_the_cpu_s_texels (--cfg m2v_gpu), job m3-max-83115 (at 9eb68e9c2c, which differs from this tree by a test helper's name in the runtime's texture_buffer_words.rs alone): BGRA8Unorm and B5G6R5Unorm play as "own view, read_write words" with the recorded IDs (each word with bit 11 where made to be read and written), the CPU's texels and values, where the play ended in the refusal before; - the Intel UHD 630 (Windows driver 101.2145, validation layer 1.4.363.0), job m3-max-83145 (the win-cross build m3-max-83134): the runtime's whole suite, 985 run: 984 passed, 1 failed, 4 skipped; every_device_runs_texture_buffers_made_to_be_read_and_written_at_every_slot and every_device_reads_and_writes_texture_buffers_of_formats_held_as_words passed. The one failure, half_simd_reductions' every_device_sums_and_multiplies_half_simdgroups_as_metal, fails the same way at pin Q (m3-max-82853) and at 2e9f9866be (m3-max-83061) and is outside this change; - job m3-max-83128 (Linux): the runtime's, devtools' and harness's suites 280 run, 280 passed, 2 skipped; validation 1323 run, 1323 passed, 3 skipped; conformance 1052 run, 1052 passed; doctests; on lavapipe (--cfg m2v_cpu_icd) the runtime's texture buffer tests 12 run, 12 passed, and rt_replay's texture buffer play passed, every format the same form for both usages there; - the Linux gate, job m3-max-83122: cargo fmt --check, signatures --check, refusal_surface.py --check, clippy -D warnings (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and rustdoc all clean; the translator's and AIR suites 3459 run: 3458 passed, 1 failed, 22 skipped, the one failure golden_hashes_match_the_table, a bless due of 80 cells under 2339 (the 78 below and development's own 2); the runtime guard (the_runtime_sources_are_the_committed_ones) passed; - golden cells (job m3-max-83165: the golden test's every changed cell at this tree and at development's |
||
|
|
c56000f9e4 |
Translator: a texture buffer held as words is read through a sampler by the words
A read through a sampler (MSL 4.1's read(sampler, coord)) of a texture buffer took the texture's own view alone, and where the device held the bound format as words the runtime refused the draw or dispatch (Gap::TexelBufferOwnView). The words now build it: the site reads the sampler's state (through::state), addresses the index against the words' width the way the own view's read addresses it against its size (through::buffer_index, which address() now calls for a texture buffer: the first texel outside, the nearest where a runtime slot sampler's s mode is clamp_to_edge, the border where the t mode is clamp_to_zero or clamp_to_border), calls the read routine at the addressed index, and where it reads the border hands back the border texel of the format the word's code names (words::border_texels), the alpha 1 of a format without alpha included. Such a read no longer records RuntimeFact::TexelBufferOwnView; the remaining own-view accesses are a read that observes residency, a read or write of another numeric class, a read of an sRGB texture's codes and a write of fewer than four lanes. The site's word estimate adds the sampler's addressing again and THROUGH_WORDS (the view's size, the width, the border texels by code). Tests: engine_identity's read-through test now asserts no own-view fact and a words routine where the profile holds formats as words. The runtime test reads rt_buffer (mirrored_repeat), rt_buffer_ow (clamp_to_border, opaque white) and rt_arg_buffer through three runtime sampler states (clamp_to_edge; t clamp_to_zero; t clamp_to_border opaque black) over six formats in either form, against Metal's texel in bounds and outside. Docs: words.rs module docs, the fact's and the gap's docs and Display, the runtime README's known gap, RESOURCE-ID.md; REFUSALS.md regenerated. Verified at the hand-over tip 355c902082, with (b), on development |
||
|
|
e46643db97 |
Translator: a texture buffer's word keeps its border texels unless its format has a word layout
The words change cleared bits 0-11 of every texture buffer's word, on the premise that no texture
buffer is read through a sampler. Metal 4.1 reads one so (`read(sampler, x)`, the fixture
kernel_read_through's rt_buffer, rt_buffer_ow and rt_arg_buffer, the conformance case
read-through-buffer), and under the identity domains such a read takes the border texel from
those bits. So every texture buffer read through a bordered sampler read a zero border on every
device, and one of a format with a word layout read its fields as border texels. The base,
development
|
||
|
|
740d12b3a6 |
Texture buffers: the twin's docs, the player's twin gauges and metrics, and B5G6R5Unorm harness rows
AGENTS rule 2's texture buffer form and the runtime's README name the stage constant, the words twin made in the same make as each plain pipeline, what picks it, and its second compile and memory as the form's known gap; docs/API.md and RESOURCE-ID.md name the gate. The replay player prints the word pipelines' and word-held texture buffers' gauges and the twins' makes and time beside pipeline_creation_nanos. The harness's texel_buffer_b5g6r5_write and texel_buffer_b5g6r5_read rows time a format the lab's cards hold as words, a 2-byte texel written by two atomics and read through the words' routine, checked against the CPU's exact conversion and decode. Not built yet. |
||
|
|
7cdaa1cc3f |
Texture buffers: each device holds a format as words only where it lacks the format's own view for an access
metal::format::texel_buffer_form is the one place that decides, per format and device: the format's own view where the device holds it directly as a uniform texel buffer, a storage texel buffer and a storage texel buffer written without a format; else words where it has a word layout; else its own view of the first two (whose writes the runtime refuses). The resource ID word is unchanged and the same on every device; a module takes the codes its profile holds as words (texel_buffer_word_codes) and tests a word's code against them, emitting nothing of the words where the profile holds none so. The routines' cases and the precision notes follow those codes. The runtime's texel_form takes the same answer. AGENTS.md rule 2 gains the fourteenth form; the runtime's README records the words' cost (7.3x the own view's GPU time for an R8Unorm texture buffer written on an RTX 3090, job m3-max-80580). This commit alone was not built; the series is checked at its tip. |
||
|
|
0ad55e1468 |
Docs: the texture buffer word, the formats held as words, their notes; test vectors of the texture buffer word
RESOURCE-ID.md gains the texture buffer word (TextureWord::of_texture_buffer: bits 0-1 padding, 2-7 the code, 8-9 texels per word, 10 a texel of two words; the 39 codes in order) and drops its stale line that a texture buffer has no index. The runtime's README says which formats a texture buffer holds as words and which it still refuses; the KosmicKrisp BGRA8Unorm gap is gone. API.md and PrecisionNote's docs say a texture buffer held as words records SrgbTexelDecode and DevicePackConversion for its float reads and writes, and that its other conversions are exact. tests/resource_words.rs writes texture buffer lines (format, width, word); the table is blessed in a later commit. REFUSALS.md regenerated (one more TextureFormat site). |
||
|
|
f4f5cc33da |
rt docs: Metal's validation asks ShaderRead and ShaderWrite at every read_write slot; the runtime asks less where the function only writes
The runtime README's rule (Textures: Texture slots and usage), pipeline::slot_usage's doc and RESOURCE-ID.md's sentence on slot usage said the runtime asks a texture's usage at a slot as Metal's validation asks it, ShaderWrite alone at a read_write slot the function does not read. Metal's validation asks both at every read_write slot, by the declared access, whatever the function does there. Measured on an Apple M3 Max, macOS 27.0.1 (job m3-max-80068, a scratch probe of runtime-compiled MSL, R32Float 4x4): - a read_write slot the function only writes, of a ShaderWrite-alone texture, asserts "Compute Function(k_rw_write): reads texture (t[0]) whose usage (0x02) doesn't specify MTLTextureUsageShaderRead (0x01)"; - one the function only asks the width of asserts the same of 0x02 and the write of 0x01; - one it only reads asserts the write of 0x01 and the read of 0x02; - both usages run. Plain Metal runs every case, and the written one writes its texels. The runtime keeps its rule: such a slot asks ShaderWrite alone, as its write reaches the texture through its storage element alone, so a ShaderWrite-alone texture runs there as plain Metal runs it. The three texts now say what Metal's validation asks and what the runtime asks. They also name a texture atomic's slot as one that reads. Metal's validation asks both there: a 0x21 texture asserts the write and a 0x22 one the read; 0x03 runs without ShaderAtomic. Docs only; no behaviour changes. Verified: cargo fmt. Rustdoc runs as a job. |
||
|
|
c25a5b238a |
rt: a view made with a swizzle keeps its texture's usage at a slot, as its known gap rules
8811dd6790 checked a texture slot against the usage Metal answers, and answered a view made with a swizzle as ShaderRead and PixelFormatView alone, so a kernel's write through such a view became Refusal::TextureUsageAtSlot. That reversed the runtime's recorded known gap of swizzles (README, Known gaps of textures: a view's descriptor reports its base texture's usage, so a draw into such a view and a kernel's write through it run, the write stored unswizzled; docs/API.md's accepted differences), on which OpenCL mode stands: Apple's OpenCL binds an image of most channel orders as a swizzled view and writes it (tests/opencl_swizzles.rs, job m3-max-16336). The runtime suite on lavapipe at b28f70e076 (job m3-max-78531) failed three tests on it: opencl_mode_queries_of_a_swizzled_write_only_image_answer_the_view, opencl_mode_writes_through_a_swizzled_image_store_the_value_as_written and every_device_reads_through_a_view_s_swizzle_and_writes_past_it, each "the Kernel function uses texture slot 0, whose texture's usage MTLTextureUsageShaderRead | MTLTextureUsagePixelFormatView lacks what its access there asks". The slot check now takes the texture's descriptor usage (TextureObject::metal_usage: Metal's unknown usage as 0x17, a view's its texture's, a swizzled view's included). The known-gap text and new_texture_view_with_swizzle's doc are as before 8811dd6790; the refusal's doc, the README's Texture slots and usage and RESOURCE-ID.md say a view's usage is its texture's, a swizzled one included. The slot_usage test's swizzled destination is now a case that runs and stores the texel as written. The same run failed every_device_gives_an_index_to_the_texture_placed_there_last, whose dispatch wrote through A, a texture of ShaderRead usage alone, at sample_down's written slot: that is the refusal Metal's validation gives, and the test's point is that A's placement empties D's storage element. It now writes through D's ID, the same index, which D's ShaderWrite usage lets the slot check pass, and D still keeps its texels. Verified: cargo fmt; refusal_surface.py --check (REFUSALS.md unchanged). The suite run of this commit follows as a job. The other 865 tests of job m3-max-78531 passed (3 skipped). |
||
|
|
73bb5eb204 |
rt: a dispatch or draw whose texture lacks the usage its slot's access asks is TextureUsageAtSlot
A function's texture slot bound to a texture whose usage lacks what the function's access there
asks reached no element of the texture's and ran: it read element 0 of set 1 (nil's null
descriptor) or a null element as zeros and dropped its writes, with no refusal and no count. The
textures: one no shader reaches (no index: a Depth32Float target of RenderTarget usage alone, a
texture of PixelFormatView usage alone), a colour target of RenderTarget usage alone (null
elements), a texture not made for shader writes at a written slot (no storage element), and a
view made with a swizzle at a written slot (written unswizzled, where plain Metal writes through
the swizzle).
Each dispatch and draw now checks, once after the pipeline state or a binding changes and before
it records anything, each texture its functions' slots reach against the usage Metal's validation
asks by the access the function declares there (pipeline::slot_usage): ShaderRead for a sample or
read slot, a size query alone included; ShaderWrite for a write or read_write slot; both for a
read_write slot it reads. The texture's usage is Metal's answer (TextureObject::metal_usage):
the descriptor's, Metal's unknown usage as 0x17, and a texture reading through a swizzle other
than the identity ShaderRead and PixelFormatView alone. A texture short of it refuses the command,
Refusal::TextureUsageAtSlot { stage, index, usage }, binding and recording nothing. The binds take
every texture, as Metal's do. Gap::SwizzledReadWrite stays checked first for a read_write slot it
reads. The check reads facts the interface and the texture already hold; nothing runs per draw.
Basis (the previous commit's measurement, an Apple M3 Max, macOS 27.0.1, jobs m3-max-78392 and
m3-max-78422): plain Metal reads and writes the texels; Metal's validation asserts "Compute
Function(k_read): reads texture (t[0]) whose usage (0x04) doesn't specify
MTLTextureUsageShaderRead (0x01)", "writes texture (t[0]) whose usage (0x01) doesn't specify
MTLTextureUsageShaderWrite (0x02)" (an access::write argument asked only its width included), and
"Fragment Function(f_first): Shader reads texture (t[0]) whose usage (0x04) doesn't specify
MTLTextureUsageShaderRead (0x01)".
Docs: REFUSALS.md regenerated (the refusal's site); the runtime README's Textures section states
the rule (Texture slots and usage) and its compute encoder, render encoder and swizzle entries
name the refusal; RESOURCE-ID.md's sentence that a slot binding a colour target of neither usage
reads nil now says what a runtime refuses; the doc comments of set_texture, set_vertex_texture,
dispatch_threadgroups, draw_primitives, gpu_resource_id and new_texture_view_with_swizzle name it.
The test literals of the kernel interface and of a content's draws (tests/compute.rs,
tests/indirect.rs) take the new field.
Verified: cargo fmt. The red and green runs, clippy and the runtime suite on lavapipe follow as
jobs.
|
||
|
|
5806b10c13 |
Translator: a sampled cube read by face samples its cube element under the identity domains
L215 (a). A texturecube or texturecube_array read by face was declared as the binder's 2D-array
view of its faces (RuntimeFact::ImageViewShape), since SPIR-V's OpImageFetch takes no cube. The
identity domains hold a sampled cube's element as its cube view and source no such fact, so
every such read was Unsupported{IdentityDomains}.
Under the identity domains a sampled cube (not a depth cube) that is read is now declared as its
cube element, and the read samples it. It goes through element 0 of its numeric type's sampler
array (binding 2, or 4 for an integer texture), which no ID reaches: the default sampler. It
samples at the direction of the read texel's centre on its face, with the read's level as the
explicit Lod.
- On face f the centre is (sc, tc) = ((2x + 1 - w) / w, (2y + 1 - h) / h), whose numerator is an
exact integer.
- The direction is Vulkan's cube map face selection read backwards, the table Metal's faces share.
With m the face's sign, it is (m, -tc, -m*sc), (sc, m, m*tc) or (m*sc, -tc, m).
- Its major axis is the face's, at magnitude 1, so (s, t) on that face is the texel's centre, half
a texel inside its cell, and nearest reads that texel. Integer Lod l under nearest mip selects
level l.
- A sample clamps every operand, so the read is checked in the shader on every device
(ReadCheck::Shader). x and y are tested against the extent at the level, the face against 6, the
cube index against the cube count, and the level against the level count, with Metal's
out-of-bounds texel outside (its alpha from the ID's word).
- slot::samples_cube_element is the one rule the declaration and the read's check share.
SlotPlan::face_sampler gives the sampler use the sampler family declares.
- A depth cube read by face, and a cube whose faces an emulated filter fetches, keep the 2D-array
view and stay refused under the identity domains. The table domains are unchanged.
The runtime's default samplers now reach every level (maxLod VK_LOD_CLAMP_NONE, was 0), so an
explicit level past 0 reads that level. A sampler element nobody owns holds the default, as do
nil, freed and out-of-range sampler IDs. Their samples could reach only level 0 before; they now
reach the level they ask for.
Existing tests that cover the default samplers:
- tests::arrays' set_1_is_filled_at_creation (both live with set 1);
- tests::device's gauge check (set 1's two default samplers and nothing else);
- tests::argument_sampling's argument_sampler_edges (an argument buffer's sampler against the
default's answer).
RESOURCE-ID.md states the default sampler and the cube read's contract for a consumer that lays
the arrays out itself. API.md and the runtime README say so too; the README's known gap now names
only the depth cube read.
A refusal becomes a module, so SEMANTICS_VERSION 2315. The golden table's cube_faces cells
change from the refusal, a bless at the next pin. No refusal site was added or removed:
docs/REFUSALS.md regenerates unchanged.
|
||
|
|
ed4b0ecd76 |
rt: storage textures written or read at a run-time level, through runs of set 1's level elements
What: under the identity domains a storage slot written, read or size-queried at a level other
than the constant 0 indexes a run of set 1's storage-image array instead of being refused as
Unsupported{IdentityDomains} ("an encoder value the function reads as TextureLevels(S)"). The
translator pushes the bound texture's level count (PushField::TextureLevels) and the run's first
element (the new PushField::TextureLevelBase, beside it), states no StorageTextureLevels or
StorageTextureLevelViews fact, and an access at level l takes element
first + min(l, max(n, 1) - 1) of the array, NonUniform, inside l < n. A texture of one level
pushes its own index, nil 0 with count 0.
The runtime's binding 1 grows by 65,536 level elements past its 65,536 textures, 4,096 runs of 16
(floor::LEVEL_ELEMENTS, floor::LEVEL_RUN). The first dispatch or draw that binds a texture of more
than one level to such a slot (the encoder's checks, compute and render stages alike) gives it a
run: a single-level storage view of each level, of its storage element's type (a cube's level as
the 2D array of its faces, a view's from its own first level), written at the run's elements. A
later bind takes the texture's lock and pushes the same two words: no Vulkan call. The run goes
back through the pool and reaper once the texture is released and its work retired: elements null,
views destroyed (Gauges::level_elements). Every run held, or a texture of more than 16 levels, is
the new Limit::LevelElements { max: 4096 }, and the dispatch or draw does not run. The floor's
storage-image limits and both totals rise by 65,536: storage 196,608, per-stage resources 327,688,
pools 351,680; every lab device's profile is far above (llvmpipe 1,015,808 storage, the least).
SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION bump in the branch's last commit (a new PushField).
Why: 17 guest kernels in 6 libraries were refused at state creation by this form.
Docs: REFUSALS.md and the signatures table regenerated, RESOURCE-ID.md (binding 1 past 65,536),
API.md (storage levels under identity), the runtime README (Set 1, the floor table, the known-gap
line replaced by the Limit), the runtime-floor profile's limits, and the conformance ledger's
level-sizes-storage row removed.
Checked by: engine_texture_levels' identity test and the runtime's storage_levels device tests
(red at 6ad1c33124: jobs m3-max-70886 and m3-max-70892 on lavapipe), engine_identity's
a_storage_slot_written_at_a_run_time_level_is_an_element_of_its_run; the lane's jobs report the
runs per card.
|
||
|
|
29e54794ca |
Runtime: a sampler state bound with LOD clamps of its own samples with them
A bind's LOD clamps (setSamplerState:lodMinClamp:lodMaxClamp:atIndex:, its
vertex and fragment forms and the range forms) that read otherwise than the
state's own were Gap::LodClamps. Metal takes the call; on the M3 Max
(conformance cases sampler-bind-lod-clamps-kernel and -fragment) the pair
replaces the state's clamps, a lower bound above the upper reads at the upper's
level, and a plain bind afterwards reads the state's own clamps again.
How: such a bind takes the state's variant of the pair, the state's descriptor
with the pair as its clamps, its device samplers from the shared sampler table,
placed at a variant element of set 1's sampler arrays. The three sampler arrays
grow from 4,000 to 8,000 elements in the runtime's layout; elements 4,000 to
7,999 are the variants'. Shaders declare the heap arrays unsized, so the
translator is unchanged: a slot's sampler index is the runtime's push, and an
argument buffer's sampler index of 4,000 or more still reads element 0, so no
program-written ID reaches a variant. A state keeps its 16 most recently bound
variants; a new one past them takes the place of the least recently bound one
no command buffer holds, and where work holds all 16 the new one is held by its
command buffer alone. Past 4,000 live variants a bind is
Limit::LodClampVariants { max: 4000 }. The lod_clamp_variants gauge counts the
live variants. A NaN bound, which Metal documents no answer for, binds the
state as it is.
The floor's sampler limits rise to 24,000 (maxPerStage and maxDescriptorSet
UpdateAfterBindSamplers) and 286,144 (maxUpdateAfterBindDescriptorsInAllPools);
the lab's least are 500,000 (MoltenVK on the M3 Max) and 1,048,576 (Intel UHD
Graphics 630 on Windows), and Vulkan requires 500,000 of each with
descriptorIndexing.
Gap::LodClamps goes; REFUSALS.md, basis.rs, the signature table, the Metal and
conformance coverage pages regenerate. The validation replay plays clamped
binds (no skipped_clamped_samplers). The ledger drops three rows the clamped
binds now answer (compute-plural-texture-and-sampler-binding steps 11 and 14,
render-state-unread-slots). The compute single clamp form's coverage row named
set_sampler_state; it names set_sampler_state_with_lod_clamps.
Tests: a kernel samples through the binds as Metal reads them; a state's 16
kept variants filled past that; the 4,000 variant elements filled past their
capacity; the gauge flat across a bind and retire loop and zero at device
drop. Verified: see the lane's report (jobs named there).
|
||
|
|
418494f380 |
rt: a texture's image accessor no longer shadowed by TextureObject::image; the texture buffer's docs
TextureInner's Option-returning image() lost method resolution to the TextureObject trait's image() -> vk::Image on Arc<TextureInner>, so ae747745df did not compile (compile job m3-max-63551 on msi: E0599 at nine call sites). It is image_of() now. texel_form asked supports_format with the ash format; it takes the translator's. Docs for the texture buffers of ae747745df: RESOURCE-ID.md's arrays paragraph names set 1's bindings 5 and 6 (uniform and storage texel buffers, 65,536 each) and the null elements of the other kind; API.md's identity forms list texture buffer reads, writes and atomics, slots and members alike, and keep refusing the parts or rows forms; the runtime README's known gaps of textures add the swizzle, the view and blit copies, and the both-usages format rule. Verified: rustfmt; the compile job follows on the rebased tip. |
||
|
|
a449642cc7 |
rt docs: placing at an index pending work may use is the consumer's duty, not the program's
The sentence said no work in flight may read a displaced object through the index, "the program's duty, as it is Metal's". It was wrong on both counts: - A placement at an index a released object still holds for an unretired command buffer writes set-1 elements with one vkUpdateDescriptorSets (arrays.rs place_texture, place_samplers_locked). Under UPDATE_UNUSED_WHILE_PENDING with PARTIALLY_BOUND, the spec allows that only where no shader invocation dynamically uses the element (vkspec 1.4.366, the binding flags' text), so Vulkan does not define it. - Metal hands a released ID out again at once on a Radeon Pro 5300M (oracle job m3-max-63074), so a program may be given an ID that work in flight still reads. Keeping the write away from pending work is the consumer's duty: it keeps a released ID back until every command buffer committed before the release has retired. The placement is not refused (form (ii), not built). Between the last holder's retirement and the block-maker's deferred vacate the index is still the released object's, and a placement then is defined; a refusal would meet a guest there. The displaced form stays for that window, and the docs say so. Docs only: the runtime README's index paragraph and sampler line, docs/RESOURCE-ID.md, the replay player's rationale in docs/REPLAY-STREAM.md, and the safety contracts of place_texture, place_samplers and hold_samplers and new_texture's doc. Verified: cargo fmt, the API signatures check; Rustdoc runs in the quick check after the land. |
||
|
|
4f6dc912f3 |
Identity domains: a plain ulong texture slot is the RG32 element its resource ID names
A `ulong` texture slot that no `ulong` atomic updates is an `RG32` unsigned image whose two words
the shader joins and splits (`TexelClass::Uint64`), declared `Rg32ui` where it is a storage image
(`ulong_format`, under the floor's `shaderStorageImageExtendedFormats`). Under the identity domains
identity_class refused every `ulong` declaration, so such a kernel was
`Unsupported{IdentityDomains}` ("a type the identity arrays hold no element of"). It now admits it:
its class is the unsigned integer class of its shape, as its declared image is, and a storage
declaration of `Rg32ui` is the class `StorageFormatClass::Format(R32G32_UINT)`, whose variable is
the storage-image array's (set 1, binding 1, which every storage class aliases), as Metal binds
only an `RG32Uint` texture there. A slot a `ulong` atomic updates (an `R64ui` image) and an
argument buffer's `ulong` texture stay refused. The default domains are unchanged.
Docs: RESOURCE-ID.md's arrays name the `RG32Uint` storage class of a `ulong` texture; API.md's
identity forms name a `ulong` slot's reads and writes.
Test: engine_identity's ulong_texture_slots_are_rg32_elements_their_resource_ids_name: the owned
fixture unk_ulong_access (a sample-access and a read-access `texture2d<ulong>`, a write-access
`texture3d<ulong>`) under the identity domains on lavapipe, moltenvk-m3 and moltenvk-m3 without
robustImageAccess2: each passes L3, its classes are the sampled array's unsigned 2D class and the
storage array's 3D `R32G32_UINT` class, and on the CPU interpreter each of 20 threads reads its
elements' two words joined as `(v, 0, 0, 1)`, `(0, 0, 0, 1)` outside the textures, and writes the
sum's two words inside the texture alone.
SEMANTICS_VERSION 2246 -> 2247: a refusal becomes a module.
Evidence:
- The 9 public conformance cases on the plain ulong slot (unk_ulong_rw x7, unk_ulong_access
x2): before, at
|
||
|
|
841c6872ac |
Identity domains: a read through a sampler takes its border texels from the resource ID's word
MSL 4.1's read(sampler, coord[, offset][, lod]) of a texture slot, through a constexpr sampler
with a clamp_to_zero or clamp_to_border axis or through a runtime [[sampler(n)]], reads Metal's
border texel at an index outside the level. The default domains take the border texels from the
slot's BorderTexels specialization (RuntimeFact::BorderTexels); under the identity domains that was
state of the bound texture they did not source, so such a kernel was
Unsupported{IdentityDomains}. The border texels are bits 0-11 of the texture word
(TextureWord::BORDER_TEXELS, docs/RESOURCE-ID.md), already in the slot's pushed resource ID
(PushField::SlotGuestBase). Under the identity domains select_through now sets neither the slot's
border_texels nor the fact, and border_bits reads the word through emit::identity_id and masks
it, as the format's missing alpha is read. SlotPlan::identity_lowered and identity_unsourced drop
the border texels, which the identity domains now source. An argument buffer's texture read so
(its handle-table entry's border texels) is still refused. The default domains are unchanged.
Conformance (known-gaps-rt.tsv, runtime on lavapipe against the committed Metal answers): six
read-through rows translate and match, so their rows go: read-through-int exact;
read-through-half, -layers, -line, -read-write and -volume differ only by notices the suite
declares. read-through-volume reads through a runtime sampler of an opaque-black border, whose
sampler state the runtime notes on every device: the case now declares that notice
(replay::swizzled_border_notice) wherever it reads through such a sampler, as border_swizzles
does. The four plane rows (a8, r32f, rgba8, rgba8-swizzled) now make every pipeline up to
rt_heap_zero, an argument buffer's texture read through a border sampler, where they are still
refused; their rows move there.
Docs: RESOURCE-ID.md says a slot's read through a sampler takes its border texel from bits 0-11
of the word; API.md's identity forms name the read through a sampler (the paragraph's lines
reflowed); CONFORMANCE-COVERAGE.md re-derived for the six rows gone (REFUSALS.md re-derives
unchanged).
Test: engine_identity's a_read_through_a_sampler_takes_its_border_texels_from_the_word:
engine/kernel_read_through's rt_arg (a runtime sampler, offset (1, -1)) under the identity domains
on lavapipe, moltenvk-m3 and moltenvk-m3 without robustImageAccess2: L3, no specialization
constant but the dispatch's, no BorderTexels fact, and on the CPU interpreter, through a sampler
that clamps every axis to the border, each of R32Float, RGBA8Unorm, A8Unorm and RGBA8Unorm
swizzled (a, b, 0, r), under each border color, reads metal::sampler::border_texel's texel past
the right, left and top edges and the texel inside.
SEMANTICS_VERSION 2234, one above the previous commit's (main renumbers at landing): a refusal
becomes a module. The old runtime's render descriptor key changes with it, pinned at landing.
Verified (potluck; the jobs ran this diff on the previous commit's diff on development
|
||
|
|
2dd8ffce0d |
Identity domains: a texture atomic's slot is the R32 storage element its resource ID names
A texture atomic (atomic_fetch_*, atomic_exchange, atomic_compare_exchange_weak, atomic_load or
atomic_store on a texture1d, 1d_array, 2d, 2d_array or 3d of uint or int, access::read_write)
declares its slot R32ui or R32i, as Vulkan's image atomics require and as Metal requires an R32Uint
or R32Sint texture there. Under the identity domains identity_class refused every storage
declaration with a format, so such a kernel was Unsupported{IdentityDomains}. It now admits an
R32ui or R32i storage declaration as the class StorageFormatClass::Format(R32_UINT | R32_SINT),
whose variable is the storage-image array's (set 1, binding 1, which every storage class aliases;
no link or declaration change). The atomic's emission takes the element of that array at the
index the slot's pushed resource ID holds (emit::identity_id), as a read or write does; it took the
array variable itself before, which no path reached. The default domains are unchanged.
Still refused under the identity domains: ulong atomics, texture-buffer atomics and an argument
buffer's atomic texture.
The CPU interpreter models OpImageTexelPointer (unmodelled before): a pointer to a texel inside
its image (Root::Texel), through which an atomic reads and writes the texel's first component, as
an atomic of an R32ui / R32i image does. Robustness's atomic outside the image and one on an
unmapped texel stay unmodelled.
Conformance: swizzled-storage-atomics now makes its pipeline and meets the runtime's
Gap::SwizzledReadWrite at its first dispatch (case/RRRR/dispatch), where a read_write slot bound to
a swizzled texture is refused; its known-gaps-rt.tsv row moves there and says why: Metal's atomic
answers the texel unswizzled, but nothing yet says a slot's reads are atomics alone.
Docs: RESOURCE-ID.md's arrays name the R32Uint / R32Sint storage class of a texture atomic;
API.md's identity forms name a texture slot's atomics (the paragraph's lines reflowed);
CONFORMANCE-COVERAGE.md re-derived for the atomics row's reason (REFUSALS.md re-derives
unchanged).
Test: engine_identity's a_texture_atomic_is_the_r32_storage_element_its_resource_id_names: a
generated texture2d<uint, access::read_write> atomic_fetch_add under the identity domains on
lavapipe, moltenvk-m3 and moltenvk-m3 without robust image access; each passes L3, its one image
class is R32_UINT storage at set 1 binding 1, the guard's size query is there exactly where the
device lacks robust image access, and on the CPU interpreter each thread adds 5 to its texel of
element 2 (the one the pushed resource ID names), answers the texel it held, and no other element
changes.
SEMANTICS_VERSION 2233, one above development's (main renumbers at landing): a refusal becomes a
module. The old runtime's render descriptor key changes with it
(the_old_render_descriptor_key_keeps_its_value), pinned at landing.
Verified (potluck; the jobs ran this diff on development
|
||
|
|
d3d40dd31e |
Identity domains: an argument buffer's texture sampled through the argument buffer's own sampler
Under the identity domains, an argument buffer's sampler was refused. Its cubic test pushed the
execution status address ("an encoder value the function reads as ExecutionStatusAddress"), and
behind that was the form's own refusal ("an argument buffer's sampler"). The sampler's resource ID
is now its handle, read from the member's 8 bytes with no sampler table (access::handle,
emit_identity_sampler):
- Its index selects the element of the set-1 sampler array of its use. That is the array an
argument buffer's sampler already declares, at the same binding the slot samplers' identity
arrays use.
- The word's fields (pixel coordinates, the nearest-pixel test) come from the ID's high word
(sampler::emit::heap_sampler_field).
- The handle is a uvec2 wherever it is held (lowered_pointer, and word_repr for a member word).
A select's null operand is the nil ID.
Bad-ID guard: compare-and-select, index < 4,000 ? index : 0, so an index past the arrays samples
through element 0, the default sampler. I chose it over 4,096-element arrays with a 12-bit mask
because it is two instructions with no layout or floor change. The mask would need every array at
4,096 elements and every unowned element holding the default sampler, which the floor does not
state. pipeline::link::IDENTITY_SAMPLERS becomes pub(crate) for it.
No cubic test under the identity domains (sampler::select::cubic_reach returns early). The runtime
makes no sampler state of a cubic filter (Gap::CubicSampler), so no live ID's word carries bit 30.
The runtime README says so beside the gap, and docs/RESOURCE-ID.md says how the shader reads the
ID.
The conformance ledger's 32 rows refused only by the cubic mark now run through the runtime. On
lavapipe:
- 3 match: pixel-samplers-rgba16f-nearest-{border,edge,zero}.
- 5 are refused at case/encoder, Unavailable argument_encoder or argument_encoder_with_arguments:
the rt side has no argument encoder.
- 24 differ. In each, every source our side runs answers alike wherever Metal's do.
Their 32 rows become 192 rows scoped to llvmpipe, each naming its note and bound:
- pixel-downscales: pixel-sampler-scaling, 2/255.
- pixel-samplers linear: device-sampling.
- rgba8 nearest and subnormal: device-texel-conversion.
- the two nearest mirror norm sites: device-sampling, the device's mirror clamp to edge at
normalized coordinates, which a device test shows a slot's sampler and an argument buffer's
read alike.
docs/CONFORMANCE-COVERAGE.md is regenerated for the ledger (7,490 rows to 7,650).
pixel-samplers now declares the slot form's pixel-sampler-scaling on nearest states as well
(replay::pixel_sampler_scaling_notice): under the identity domains the slot's word is read at
dispatch, so the note is the operation's on any state.
SEMANTICS_VERSION 2231 (a placeholder for the landing to renumber).
Tests:
- engine_identity's
an_argument_buffers_sampler_samples_through_the_identity_arrays_by_its_resource_id covers
tail_argument_samplers' four kernels and tail_argument_cube_gradient on every profile: L3, set
0 empty, set 1 the identity layout, the bindings used, no sampler slot ID, constexpr index or
status address pushed, and no RuntimeFact::CubicArgumentSampler.
- metal2vulkan-runtime tests::argument_sampling (lavapipe, m2v_cpu_icd):
- argument_sampler_edges through a linear state reads the edge averages; through an ID of that
word with index 4,000 it reads element 0's nearest texels (the guard).
- every_device_samples_alike_through_an_argument_buffers_sampler_and_a_slots: one texture at
the pixel-samplers case's 800 normalized coordinates through one nearest state under clamp to
edge, to zero, to an opaque white border and mirror clamp to edge, bound at a slot and held in
an argument buffer; bit-equal.
- validation's an_argument_buffer_sampler_samples_its_member_texture compares the runtime's run
with Metal's texels, where it held the refusal.
Verified (potluck jobs; this commit's tree equals WIP 16c70bf88a on
|
||
|
|
b676eda182 |
rt: a colour render target takes an index, and a draw reads it as an attachment as it reads a shader-read one
Metal fetches any render target, and its header gives every texture a handle with no tie to usage (MTLTexture.h: gpuResourceID, "Handle of the GPU resource suitable for storing in an Argument Buffer"). rt took an index only for shader-read or shader-write usage, so a colour target made for rendering alone had no second element and every fetch from it was Gap::Draw(FetchedAttachment): guest 26's 4,792 refusals, all of that shape. - The index rule: shaders reach a texture made for shader reads or writes, or a colour render target (render-target usage of a pixel format with no depth or stencil), which takes an index exactly where it does (Refusal::TextureIndex), at every maker: new_texture and the heap, buffer and Managed makers, views, drawables and surface planes. A depth or stencil target made for neither is unchanged. - A colour render target not read takes what a shader-read one takes for attachment reads: the sampled usage, and the feedback usage where the image format query offers both beside its usage; the shadow on a device without the loop; neither where the query refuses them, and its draws that read it stay Gap::Draw. Its home stays the attachment layout, so a pass that does not read it records no move of it, and a fetching pass moves it home, feedback, home with the existing move code. - Only its second element is written: its sampled-texture element stays the null one, so a slot that binds it reads nil as before. place_texture takes the view its second element names in place of a flag. - A linear image in place over a buffer takes no sampled usage for a target shaders do not read. - The in-tree consumers take the rule: the replay player's texture class, the harness's and the conformance suite's rt side. rt's own tests make their unindexed colour targets with new_texture_for_views, and give indices where a test needs new_texture's path. - docs/RESOURCE-ID.md, the runtime README and Refusal::TextureIndex's doc say the rule; docs/REFUSALS.md is regenerated. Also rides along, from the planner, in the README's known gaps of memory blocks: a block freed before a submission used it waits on the block-maker thread for its bind, and a ring take that needs a new ring block can wait behind it. Verified: see the check job named in the landing. |
||
|
|
a47fc3e69d |
translator: an argument buffer's texture index is masked to the set-1 image arrays
What: under the identity domains (Device::from_queries' profile alone; Device::new never takes them, so its modules are unchanged), the handle of a texture whose resource ID an argument buffer holds is the ID's low word masked to its low 16 bits (IDENTITY_TEXTURES - 1, the two image arrays' 65,536 elements, a power of two the compiler checks): one OpBitwiseAnd a handle. A bad ID reads the element at index & 0xFFFF, never one outside the arrays. Nothing else changes: a slot's index is the runtime's own push (SlotGuestBase), a constexpr sampler's too (ConstexprSampler), and an argument buffer's sampler is not lowered under these domains, so the sampler arrays stay at 4,000 with no mask. docs/API.md, where that sampler's refusal is listed, and RESOURCE-ID.md say the change that first lowers one masks its index the same way. The new runtime's README records, among the known gaps of memory blocks, that a shader uses a buffer's gpuAddress unchecked, so a stale one can still fault the device. SEMANTICS_VERSION 2178: from_queries' translations of such a texture change (2177 is the unlanded float-array branch's). The feedback elements (index + 65,536 in the sampled array, where the device reads attachments): only a draw's push of a texture slot's index reaches them. The render encoder builds no useResource: or useHeap:, so no draw makes an argument buffer's texture resident, and Metal reads an argument buffer's texture only once it is resident; the mask keeps every argument-buffer index below 65,536 besides. So an argument-buffer texture that is also the pass's attachment is never offset to its feedback element: the shader reads element index, as before, a read Metal leaves undefined while the texture is not made resident (only the compute encoder has use_resource and use_heap). Why: the ID is the program's word, and an index past the arrays fetches a descriptor outside them. Verified: - Check 46942 (msi) at this change on |
||
|
|
fe23decd1b |
rt: a constexpr sampler's index under the owner rule, and an object released with work pending
A constexpr sampler's numbering is a placement like any other. Where a sampler state took the index from it, a later pipeline state that numbers the constexpr sampler there took nothing back: it sampled through the program's sampler. Now it places the constexpr sampler there again with every element it holds (Arrays::hold_samplers: under the grants' lock, the owner's additions where it still owns the index, else a placement), and the constexpr sampler keeps its elements' samplers to write them. The consumer chooses constexpr indices and keeps them from the program's sampler states while a state numbering one lives; rt does not check it (rt README, compute pipeline docs). An object the program released while a command buffer that used it is pending is displaced like a live one: a placement at its index takes it at once, and its teardown once the command buffer retires touches nothing it no longer owns (one owner compare for both). Nothing empties an element at the program's release: a committed command buffer still reads the object through its index, which Metal allows. The owner's teardown nulls it. RESOURCE-ID.md states the duty (no work in flight reads a displaced or released object through its ID) and what an element no object owns holds: every element is written at device creation, a null descriptor (nullDescriptor, on the floor) or the array's default sampler, and written back to that when its owner goes. The replay player gave constexpr samplers the lowest free sampler index, the range the stream's named sampler IDs come from, so a program's sampler state could take a constexpr sampler's index. It now gives them the highest free one, outside that sequence (Indices::highest; REPLAY-STREAM.md). Tests: - sampling::every_device_gives_a_constexpr_sampler_s_index_to_the_object_placed_there_last: a nearest sampler state over sample_up's linear constexpr sampler reads nearest; a later state numbering it takes the index back (linear, for both states); the sampler state's going touches nothing; the slot gauge counts the index once. - sampling::every_device_gives_a_released_object_s_index_to_the_next_at_once: a command buffer samples A through SA, signals and waits on the host; A and SA are released and B and SB made at their indices while it is pending (asserted); another queue reads B through SB; after the first command buffer retires, and A and SA with it, the index still reads B through SB. The writes are valid under UPDATE_UNUSED_WHILE_PENDING with PARTIALLY_BOUND (vkspec: "as long as they are not dynamically used by any shader invocations"): A's dispatch completed before its signal. - replay a_constexpr_sampler_takes_no_index_of_the_sequence. |
||
|
|
fd916e7f99 |
rt: an index has one owner, the texture or sampler placed there last
The consumer's program places a texture at an index a live texture of its own still holds, and releases the older one later (179 placements in one recorded stream, 92 in another). Metal takes it: the later texture takes the ID. rt refused it (IndexInUse). Now Grants keeps one owner word per held index (a HashMap per class, the word given at placement and never again on the device; no list of holders, no refcount, no second bitset). A placement at a granted index always succeeds and makes the placed object the owner; a release vacates the index and empties its elements only where the releaser still owns it, so a displaced object's going touches nothing. Placement and element writes happen under the grants lock in one step (Arrays::place_texture, place_samplers, add_samplers, vacate_texture, vacate_samplers), so the elements always belong to the owner. Where a placement displaces another object, a texture with no storage view writes its storage element null and a sampler writes the arrays it does not use back to their defaults, so nothing stale answers. The descriptor-slot gauge counts held indices: a displacing placement adds none. The same occupancy serves textures, sampler states and constexpr samplers. Constexpr samplers are kept by (index, state words), each with its owner word; a later pipeline state of the same words adds its arrays where the constexpr sampler still owns the index. Refusal::IndexInUse is deleted: nothing Metal refuses remains. A texture now takes its index after its image and views are made, so an index not granted is refused after the image is made and freed at once. The duty: no work in flight reads a displaced object through its ID, as Metal's. rt does not check it. RESOURCE-ID.md and the rt README state the rule and the duty. The harness takes the next index round each class's range (its workloads make far fewer objects than a range holds). The replay player keeps the object placed last per index: a named index an object holds is taken, and the earlier object's release leaves it; with no index free for a constexpr sampler it answers IndicesNotGranted past the range. Tests: grants' an_index_has_one_owner_the_object_placed_there_last (both classes); sampling::every_device_gives_an_index_to_the_texture_placed_there_last (a storage-capable D at 3, a sampled-only A over it, whose placement empties D's storage element: a write through 3 is dropped and D keeps its texels; B storage-capable over A, A dropped; sampling through 3 reads B, writing through 3 writes B; B dropped, sampling through D's ID reads zero; the slot gauge counts 3 once); the sampler states' test places a state over a live one; replay's indices test. REFUSALS.md regenerated, api_signatures loses IndexInUse. |
||
|
|
cc9ab54b86 |
rt: one texture index class, 1 to 65,535, and a storage array as long as the sampled
The consumer hands each guest process texture IDs from one pool (1 to 16,320) and places every texture at its own ID whatever its usage. rt split textures into two index classes by usage (StorageTexture 1..4095 with shader-write usage, Texture 4096..65535 without), so every named sampled-only texture below 4,096 and every storage-capable one above it was refused (IndicesNotGranted), where Metal takes them: 4,818 makings in one recorded stream and 5,707 in another. Now there is one texture class, IndexClass::Texture, 1 to 65,535, with one grant bitset and one occupancy; IndexClass::StorageTexture is deleted. Set 1's storage-image array (binding 1) is as long as the sampled-image array, 65,536 (floor::TEXTURES replaces SAMPLED_IMAGES and STORAGE_IMAGES). A texture with a storage view writes both elements at its index; any other writes its sampled element alone and its storage element stays null; a texture that goes writes both null. Samplers keep their class. Why every floor device holds it: Vulkan's Required Limits (vkspec 56.1, Table 75 and Table 76) give maxPerStageDescriptorUpdateAfterBindStorageImages, maxDescriptorSetUpdateAfterBindStorageImages, the two SampledImages limits, maxPerStageUpdateAfterBindResources and maxUpdateAfterBindDescriptorsInAllPools a minimum of 500,000 on a device that supports descriptorIndexing. The floor's own sums become 2 * 65,536 + maxColorAttachments (131,080 at 8) and 2 * 65,536 + 3 * 4,000 = 143,072, both below 500,000. Every lab capture (2080, 3090, XTX, 780M x2, HawkPoint, RX 550, Iris Xe, UHD 630, lavapipe) reports descriptorIndexing and 1,015,808 or more for each of the six limits. The floor's limit check stays the one gate: no query-chosen size, no second form. Translator: link.rs's identity set 1 sizes binding 1 by IDENTITY_TEXTURES (65,536), the same constant as binding 0, so rt's of_the_device check still matches it. Nothing else in the pipeline interface, binding plan or resource-ID decode assumes a storage index below 4,096: the identity handle is the low word (masked only of bit 31 where the alpha flag rides it), indexing each array's runtime-array variable. The identity domains are reached only from Device::from_queries' profile (rt sets PointerDomain::Identity; the old runtime never does), so Device::new's modules, refusals and notes do not change. SEMANTICS_VERSION 2173: the identity set 1 layout is a binding-plan fact that changed under unchanged keys. Consumers in the tree: the harness and the replay player grant and place every texture in the one class; the player reserves a texture ID in it. Docs: RESOURCE-ID.md's class table (nil, texture, sampler), the rt README (set 1, grants, textures, the fault paragraph, the floor's limits table), IndicesNotGranted's doc (an object at an index not granted, as well as a release) and IndexRange's basis; REFUSALS.md regenerated; api_signatures loses the variant. Tests: sampling::every_device_makes_a_texture_of_any_usage_at_any_index grants the whole texture range, makes a shader-read texture at 2 and a shader-write one at 5,000, and checks one sample_down dispatch against the CPU mean. arrays' fill-past-capacity fills every texture index (a storage texture at 1, views of it at 2..65,535, 128 made again). |
||
|
|
100b92d608 |
identity: constexpr samplers by a pushed index into set 1's sampler arrays
Under the identity domains a texture slot sampled through a constexpr sampler takes the sampler
from the set-1 sampler array of its use (binding 2 plain, 3 compare, 4 integer texture) at an
index the consumer pushes: PushField::ConstexprSampler(CombinedSampler), one u32. The consumer
makes the device sampler that the new public CombinedSampler::constexpr_sampler(profile)
describes, places it at an index of that array, and pushes the index. The index is a push word,
not a specialization constant: an index allocated at run time would key the driver's and the
pipeline cache's entries. Link's immutable sampler for the default domains now goes through the
same method, with the same result.
Under the identity domains every device sampler is normalized: a constexpr pixel sampler's
coordinate is scaled in the shader, as a runtime sampler's is, never handed to the device's
unnormalized sampler. A linear sample or gather through it records
PrecisionNote::PixelSamplerScaling, which is static. No address-mode-map variant applies there
(no binder picks a variant), so the sampler keeps its own modes and the slot records no
ConstexprSampled fact.
Still refused as Unsupported{IdentityDomains}: an argument buffer's sampler, arrays of samplers,
bicubic and anisotropy emulation. The refusal test now uses engine/a2_bicubic_weights.
Translation output changes only under the identity domains (Device::from_queries). Device::new
output is unchanged: golden_hashes_match_the_table passes at this tip (job m3-max-42192), with no
"changed under an unchanged key" and no "profile changed:" line.
Public surface: PushField::ConstexprSampler and CombinedSampler::constexpr_sampler are added
(api_signatures blessed); nothing is removed or changed.
SEMANTICS_VERSION 2162: identity-domain modules of constexpr-sampling kernels change.
ARTIFACT_FORMAT_VERSION 531: PushField gains a variant.
Verified:
- m3-max-42097 (msi), this change on
|
||
|
|
445b720f78 |
identity: texture slots sampled through runtime sampler slots from set 1's sampler arrays
Under the identity domains a kernel samples a texture slot through a runtime sampler slot. The
texture is its class's set-1 element at the index of its pushed gpuResourceID, as a read's is.
The sampler is the element of a set-1 sampler array at the index of the sampler slot's pushed
gpuResourceID (SlotGuestBase of the sampler slot), joined to the texture by OpSampledImage. The
array is picked by the use: binding 2 for a plain sample, 3 for a depth comparison, 4 for a
texture of an integer format; 4,000 SAMPLER descriptors each, PARTIALLY_BOUND |
UPDATE_AFTER_BIND | UPDATE_UNUSED_WHILE_PENDING, every stage, the same set 1 for every pipeline.
The sampler's word (pixel coordinates, a nearest pixel sampler) is read from the ID's high word,
so no specialization constant and no SamplerReduction, SamplerCoordinates, CubicSampler or
ConstantLanes fact remains; every precision note is static. An integer write to a storage slot
without a format saturates to the channel widths the consumer pushes
(PushField::TextureIntegerChannels, a u32), with no fact.
Still refused as Unsupported{IdentityDomains}: constexpr samplers (next change: a pushed index),
an argument buffer's sampler, arrays of samplers, bicubic and anisotropy emulation, a slot's
minimum level.
Translation output changes only under the identity domains (Device::from_queries). Device::new
output is unchanged: golden_hashes_match_the_table passes at this tip (job m3-max-42189), with no
"changed under an unchanged key" and no "profile changed:" line.
For the runtime's side (the planner's three facts):
a. The runtime must dedupe device samplers by create info across the three arrays' uses.
Exhausting maxSamplerAllocationCount (4,000 on the 2080, 3090 and UHD 630; 32,768 on
lavapipe; 65,536 on the others) must be a typed refusal, with a fill-past-capacity test.
b. The update-after-bind limits for 65,536 sampled images, 4,096 storage images and 12,000
samplers hold on all nine profiles (the smallest is lavapipe's 1,015,808); the floor must
check them by query.
c. The count of cubic sampler descriptors is asked of the replay lane; if any exist it goes back
to the planner before step 5 closes.
SEMANTICS_VERSION 2161: identity-domain modules of sampling kernels and integer writes change.
Verified:
- m3-max-42094 (msi), this change on
|
||
|
|
75b422338a |
identity: argument-buffer textures are the set-1 elements their resource IDs name
Under the identity domains an argument buffer's texture handle is the gpuResourceID its member
holds: the handle is the ID's index, the element of the class's set-1 array (0 is nil, the null
descriptor), with no handle table, no search and no descriptor. Where the shader checks a read
itself (no robustImageAccess2) the handle carries the word's missing-alpha bit (word bit 12) at
HANDLE_ALPHA_ONE, so the handle form is Lookup::Element or Lookup::Flagged{alpha} only.
The handle tables' variant forms are off under these domains (`texture::tabled`): reads of a
member of another numeric class, raw-texel decodes, storage conversions (red-blue, sRGB alias),
A8 alpha-in-red, unreadable-storage nulls, YCbCr write marks, and the HeapCrossClassNeutral,
HeapStorageReads and HeapResidency facts. A slot and a member of one class index one array, so
the class's volatility now merges the slots' uses with the groups'. The admission takes heap
groups whose declaration is their identity class with no plain, raw or cross classes; anything
else stays Unsupported{IdentityDomains}.
Translation output changes only under the identity domains: the default domains plan and emit
as before (no golden re-bless needed). SEMANTICS_VERSION 2153.
The test kernel `tex` gains an argument-buffer form (`texture_kernel(true)`), checked on
lavapipe, moltenvk-m3 and moltenvk-m3 without robustImageAccess2: same answers at the same
elements, set 0 empty, and the handle form Element or Flagged{alpha} as the profile checks reads.
Verified (this commit's tree, as 657e2245c2 on
|
||
|
|
fa52012831 |
identity: texture slots are the set-1 elements their pushed resource IDs name
Under the identity domains a kernel's texture slots now lower. A slot's gpuResourceID is pushed as its PushField::SlotGuestBase (the index in the low word, the word in the high one). Its texture is the element at that index of one of set 1's two fixed arrays: binding 0, SAMPLED_IMAGE x 65,536, and binding 1, STORAGE_IMAGE x 4,096. Each is partially bound, updated after binding and while unused elements are pending, and seen by every stage, with the same layout for every pipeline (BindingSource::IdentityArray). Each image class the kernel declares (shape, numeric type and depth comparison, sampled, or storage without a format) is a variable of its descriptor type's binding. The slot binds no descriptor and declares no specialization constant: - is_null_texture answers whether the index is 0. Nil needs nothing else in the shader, since element 0 of each array is a null descriptor (the device test of |
||
|
|
737ccbf81a |
metal: the resource ID word, its spec and test vectors
Under the identity binding domains a guest computes a texture's or sampler's gpuResourceID itself, with no round trip: the index the consumer grants in the low 32 bits and a word in the high 32 bits that is a pure function of the Metal descriptor. The guest's port needs the word specified and a file of vectors both sides check. - metal::resource_word::TextureWord::of(pixel_format, swizzle): bits 0-11 Metal's border texels after the swizzle (the existing border_texels rule), bit 12 the out-of-bounds alpha of a format without alpha, bits 16-31 the MTLPixelFormat raw value, so a texture's word is never 0. None for the placeholders and the formats the translator holds no texture of or only copies. - The sampler word is the existing SamplerWord, unchanged. - docs/RESOURCE-ID.md: the ID's layout, the index classes (0 nil; storage-capable textures 1 to 4,095, valid in both arrays; other textures 4,096 to 65,535; samplers 1 to 3,999), both words' bits and the level rule, and the vectors file. README's documentation table lists it. - crates/metal2vulkan/tests/resource_words.tsv: 392 vectors (every pixel format with a word under the default swizzle, each channel of seven formats from each other source, every sampler field through its values, the level clamps around the points the nearest level turns at, and one descriptor with every field changed). tests/resource_words.rs recomputes every line through the public API and holds the file equal to what the generator writes; an ignored test blesses it. - api_surface lists the new module; api_signatures regenerated. Verified: - msi job 40810 at the same tree: clippy -p metal2vulkan --all-targets --all-features -D warnings, rustdoc -D warnings, nextest 18 of 18 (resource_words, the TextureWord unit test, api_surface, api_signatures). - msi job 40811 at the same tree: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd. - msi job 40809: the bless test wrote the vectors; the combined sampler line (0x58f6ab53) and the A8Unorm and R8Unorm texture lines checked by hand against the bit tables. |