fc8809d849e2e5b72f3e89c2d12cd4eafa61ea44
1022
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
549ab0ac23 |
Runtime: a draw that reads the depth through a range past [0, 1] goes through a depth range twin
The partial fix draws through a viewport depth range past [0, 1] where
nothing reads the depth, and refuses every other draw (DrawKind::Viewport).
Metal draws those too (M3 Max, macOS 27.0.1, job m3-max-85617). It reads
[[position]].z = znear + z * (zfar - znear) unclamped. It stores that, and a
[[depth]] output, clamped to [0, 1], and tests the clamped value. Clip
space's 0 <= z <= w clips whatever the range. Vulkan takes no such range
without VK_EXT_depth_range_unrestricted, which the floor does not have.
The translator commits before this one build the fold:
LoweringInputs::depth_range_fold. Under it, the vertex function stores
znear * w + (zfar - znear) * z as its z, from PushField::DepthRangeFold. It
stores z and w - z as two clip distances after its own. Under
depthClampEnable with the viewport at [0, 1], that clips, reads, stores and
tests what Metal does. This commit draws through it.
- RenderCompiled keeps what its content was made for (arrays, words, srgb)
and a OnceLock'd twin. depth_range_twin lowers the content's descriptor
again for the same inputs under VariantKey::depth_range_fold
(lowered_content, factored out of render_pipeline_state). It is made at
the first draw that needs it, counted (Metrics::depth_range_twins), and
timed as a make at encode. It is held as long as its content, and no map
keeps it. The translator's refusal of it is kept, so a later draw answers
it without lowering again. That refusal is the clip-distance limits.
- RenderPipelineState::folded gives the twin's state, its samplers numbered
at the state's indices, cached in RenderInner. It refuses (Viewport) a
vertex function the consumer compiled, and a twin that stores no fold.
- Fixed::fold (RuntimeFact::DepthRangeFold) makes every VkPipeline of the
twin take depthClampEnable. draws() takes the fact, and the vertex push
field as FieldValue::DepthRangeFold. fill_push writes the first
viewport's [znear, zfar - znear] as f32 bits.
- The encoder's route (in place of draws_refused) is found when the
pipeline state, the viewports or the depth clip mode are set. A draw
reads one field, as before.
- Under a past range that the pass's depth attachment or the fragment's
[[position]] z or w reads, draws go through the twin.
- The route refuses under the Clamp mode, and for a function that writes
[[viewport_array_index]] while the viewports set have different ranges.
- Only the viewports a draw reaches count: the first, or every one set
for a function that selects.
- bind_content composes the twin with the content for the draws' bindings
(for_draws). The viewports are recorded at [0, 1] while folded.
- RenderCommandEncoder::DEPTH_RANGE_NOTE (DeviceArithmetic) is the static
note of every draw through a twin. The docs/API.md catalogue says so.
Bounds: a twin holds at most 8 VkPipelines (Clip mode only), and 8 more for
its words twin, so a content holds at most 48 where it held 32, for its
life.
Docs: set_viewport, DrawKind::Viewport, Metrics::translations_at_encode,
and the runtime README's paragraph, Gap::Draw list and a known gap. The
known gap gives the first draw's stall, the twin's pipelines, the limit
refusal and the two refusals. REFUSALS.md and api_signatures.tsv are
regenerated. api_signatures also takes the translator rows of the commits
before (VariantKey and LoweringInputs depth_range_fold, PushField and
RuntimeFact DepthRangeFold). RUNTIME_VERSION 2576. The
runtime-sources pin does not move (pin-compute).
Verified: the READY gives the job lines (red at the commit before, green
here, on lavapipe and an RTX 3090; clippy in three configurations;
rustdoc).
|
||
|
|
f7c56cd4d2 |
Translator: a vertex function under the depth range fold folds the range into its position
Under LoweringInputs::depth_range_fold, a vertex (or post-tessellation vertex) function that stores its position does three things at each return: - it stores the position's z as znear * w + (zfar - znear) * z, reading [znear, zfar - znear] from PushField::DepthRangeFold; - it stores z and w - z, of the z it returned, as two clip distances after its own; - it records PrecisionNote::DeviceArithmetic. Drawn with the viewport's depths [0, 1] and depth clamping enabled, this maps a viewport depth range past [0, 1] as Metal maps it (the M3 Max, jobs m3-max-85541 and m3-max-85617): [[position]].z reads znear + z / w * (zfar - znear) unclamped; the depth stored and tested is that, clamped to [0, 1] by the clamp; and the clip distances keep Metal's 0 <= z <= w where the clamp leaves z unclipped. Planning: - The function's own ClipDistance array is declared two longer, with its own elements stored as before. - A function with none declares ClipDistance of 2 (shaderClipDistance). - Under the fold the declared count must fit maxClipDistances and maxCombinedClipAndCullDistances, else Unsupported names Feature::ClipDistance and the limit. - The usual path's check (maxClipDistances alone) is unchanged. - A function that stores no position, and any other stage, compiles as without it. docs/API.md's DeviceArithmetic entry says the fold records it on every such compile and why. SEMANTICS_VERSION 2377 and ARTIFACT_FORMAT_VERSION 611 (a new push field and fact). runtime-sources.sha256 takes the translator's new sources, including the commit before's. Verified: see the twin's READY job lines (the red tests at the commit before fail, pass here). |
||
|
|
69a3254e1a |
Precision note: device sampling names its unnormalized sampler's sub-texel step
The exact form hands a pixel sampler's coordinate as given to the device's unnormalized sampler, and on RADV that sampler's sub-texel step is not Metal's. PrecisionNote::DeviceSampling's doc and its API.md catalogue entry now carry the measured bound. Measured on seven linear downscales by 8 (the pixel-downscales cases' textures) at 306a517dc4, against Metal's answers recorded on an Apple M3 Max: - RADV, Mesa 26.2.6 (RX 7900 XTX job m3-max-85100, Radeon 780M job m3-max-85101, RX 550 job m3-max-85161): at 172,665 coordinates whose x - 0.5 lies at a half step of the 1/256 grid on both axes, the even steps (86,333) all differ from the normalized control at Metal's step and the odd ones (86,332) none: round half to even where Metal rounds half up; the largest difference is 1.906/255. At the case's 172,665 coordinates 2^-21 apart, 1.5% differ, 0.945/255. - NVIDIA 620.70.06 (RTX 3090) and ANV Mesa 26.2.6 (Iris Xe), job m3-max-85099: the slot equals the normalized control at Metal's step bit for bit at every coordinate. - KosmicKrisp (Apple M3 Max), job m3-max-85028: Metal's answer bit for bit. - lavapipe Mesa 26.2.4 (job m3-max-85083): within 1.375/255 in the compared windows. The remainder is the device's: the same module answers Metal on KosmicKrisp, and the coordinate reaches the sampler unchanged. pipeline/artifact.rs is not a runtime input; the runtime-sources pin is unchanged. |
||
|
|
8f69218029 |
Translator and runtime: a runtime pixel sampler samples at x itself through the level-0 element
The planner's group C ruling: a sample or gather through a runtime sampler slot whose state reads unnormalized coordinates takes Metal's coordinates as they are, not scaled into normalized ones. Translator: a slot sample or gather of a 1D or 2D texture, not an array, not multisampled, not depth, with no compare, no residency, no footprint and no offset base, through [[sampler(n)]], n < 16, records the sampler in TextureSlot::level_zero_samplers and branches on the sampler's word (SamplerWord::reads_unnormalized: PIXEL with nearest or linear filters, clamp-to-edge or clamp-to-zero or clamp-to-border s and t) and on the texture index (below 65,536). The exact arm hands x itself, moved by its offset, at explicit level 0, to the sampler's unnormalized twin (plain sampler element index + UNNORMALIZED_TWIN_ELEMENT) and the texture's level-0 element (sampled element index + LEVEL_ZERO_ELEMENT); every other word runs the existing path. Runtime: set 1's sampled array holds 3 x 65,536 elements (textures, seconds, level-0) and the plain sampler array 16,000 (states, then their twins). A state whose word reads unnormalized writes its unnormalized twin. A texture of one 1D or 2D layer writes its level-0 element at the first dispatch or draw that samples it through such a state: its own sampled view for one level, else a view of its first level it owns (Gauges::level_zero_views), released with the texture. The floor's limits grow to hold the arrays (sampled images 4 x 65,536, samplers 32,000), which every second element now fits, so Capabilities::attachment_reads is always true. |
||
|
|
5bfaa69869 |
Translator: BGR10_XR and BGRA10_XR textures leave the raw-held forms
With their textures held as the UNORM codes of their bits (the previous commit),
ExtendedRange::of no longer names MTLPixelFormatBGR10_XR (554) or MTLPixelFormatBGRA10_XR (552).
Their srgb=false forms stay for the two live uses that hold raw codes: a texture buffer's words
(texel_words builds Bgr10/Bgra10 { srgb: false } itself; the words path decodes and encodes them
through lower::arith::extended_range) and, until their render targets are built, a render
pipeline's colour attachment (ExtendedRange::of_attachment, through the formats' second, raw
candidate; the pipeline is made as before, and no pass draws into one).
- ExtendedRange::HEAP_READ drops them (7 to 5): an argument buffer's 552 or 554 texture is an
element of the sampled float class, read through the step's arm (its handle's bit 30), not raw
in the unsigned integer class (bind::heap::raw_held). The heap's class layout loses the two
extended entries.
- texel_format::crosses_classes still excludes them (metal::format::extended_unorm), and a heap's
storage element of one is still refused NotImplemented(ArgumentBufferTextures).
- The attachment sites (color_writes' extended_range_colors and merges_extended, link's fetch
refusal, bfloat blend, written and unwritten attachments, alpha-to-coverage, stage_io's missing
attachment, write_conversion) read ExtendedRange::of_attachment: every answer for a 552 or 554
attachment is the one before.
- The extended-range sRGB twins and the two-plane forms keep their raw paths (RGB10A8_2P_XR10's
goes with its two images).
Tests: the format table test asserts both formats' first candidate is ExtendedRangeUnorm with no
raw-held form, an attachment form, a raw second candidate, and no cross-class read; a new runtime
test samples a BGRA10_XR texture through an argument buffer's half member and a BGR10_XR one
through its float member (examples/heap_samples' hs_sample, a constexpr and a slot sampler).
Consumer search (reims-vgpu at 35cea45c0e, *.rs, *.c, *.h): 0 hits for HEAP_READ, heap_read(,
ExtendedRange, "Bgr10 {", "Bgra10 {", WordLayout::Extended, texel_words and crosses_classes;
ExtendedRangeColor appears only in crates/reims-vgpu-c/link-order.txt. Formats still reaching
the raw-held path: the extended-range sRGB twins, the two-plane forms, the padded R10X6/RG10X12
forms and their twins, RGB10A2Unorm_sRGB and the bfloat forms.
SEMANTICS_VERSION 2374 (the heap's class layout and its reads). ARTIFACT_FORMAT_VERSION unchanged
(no encoded type changes). RUNTIME_VERSION 2573 (bind's heap class layout); runtime-sources.sha256 re-pinned.
api_signatures blessed: ExtendedRange::HEAP_READ is [ExtendedRange; 5] (a consumer indexing its
two first entries breaks; none in the consumer). REFUSALS.md unchanged.
|
||
|
|
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
|
||
|
|
ee45758ba9 |
Translator: a sparse read through a sampler reads its texel, resident
Metal 4.1's sparse_read(sampler s, coord, offset, lod), a read through a sampler whose function
observes bit 0 of its status word (sparse_color::resident()), was refused in the texture family
(Unsupported{Lowering(Texture); NotImplemented}): what a sampler's addressing does to the residency
of a sparse texture's texels was unmeasured, the M3 having read only a texture that is not sparse.
With an observed residency now the constant resident word and the runtime making no sparse
texture, the question is Metal's answer over a texture that is not sparse, through each kind of
addressing, inside the texture and outside it.
Measured, with the new owned fixture engine/a2_sparse_read_through (a texture2d<float> read at
p[i] through constexpr clamp_to_edge, clamp_to_zero, clamp_to_border of opaque white, and repeat,
storing each colour and each resident()), over a 4x4 RGBA32Float texture of two levels at twelve
positions: inside the texture, one and several texels past each edge, at level 1, and at levels 2
and 5, past its last. On the Apple M3 Max (macOS 27.0.1), plain and under Metal's validation layer
(which reported nothing), every residency is resident, at every position through every sampler,
and every colour is the one a read through that sampler reads (the read_through family's rules:
the edge texel through clamp_to_edge and repeat, the border texel through the two border modes,
zero in every lane past the last level). So the read takes the constant word as every other
observed residency does, and select_read's refusal goes. Nothing else changes: the read through a
sampler and the word were each built already.
Tests:
- engine_texture_oob/through.rs's
a_sparse_read_through_a_clamp_to_edge_sampler_reads_its_texel_resident runs sparse_edge (the
test's Metal 4.1 module, storing 1.0 in lane 3 where resident) and edge_plain (the same read with
its word unused) on every profile and class over a two-level 4x4 texture: inside, past each edge,
at i32::MIN, at level 1 and past the last level, each reads the clamp-to-edge texel (zero past
the last level) and sparse_edge's lane 3 reads 1.0 at every row; it links and passes spirv-val
on every profile where it translates. It replaces
a_sparse_read_through_a_clamp_to_edge_sampler_is_refused.
- engine_identity's a_sparse_access_of_a_texture_slot_is_resident compiles a2_sparse_read_through
too, on every identity profile and moltenvk-m3 without robustImageAccess2: L3 passes, the
interface states no specialization constant but the dispatch's, and the module holds no
OpImageSparse* instruction.
- The conformance case sparse-read-through (cases/sparse_read_through.rs, the fixture's kernel,
12 threads) records the M3 Max's colours and residencies, and Metal's times. It declares
simdgroup-access-order, which loosens no value: the kernel writes out[5 * i + k] for five k,
stores the translator does not find disjoint between two threads of one SIMD-group, so the
runtime's pipeline notes it on every device (announced on lavapipe), as for the other cases
with that store.
Docs: lower::texture's module docs (the read through a sampler, the status words) and API.md's
texture paragraph say a sparse read through a sampler reads resident, with the M3 Max's answer.
docs/CONFORMANCE-COVERAGE.md is regenerated.
The new fixture's companions (.ll, .air.ll, TOOLCHAIN's line) come from
scripts/regen-air-fixtures on the M3 Max; its air_input golden printout is blessed under the
pinned LLVM. Engine inventory: the new rows engine/a2_sparse_read_through.air.ll and .ll, ok on
all 15 profiles. The .air.ll row, which only macOS assembles, carries the .ll row's answer, as
every blessed pair in the table does (1,724 pairs equal; the 10 that differ are the previous
commit's, which the next bless moves); the M3 bless confirms it.
SEMANTICS_VERSION 2365 -> 2366 (a placeholder, renumbered at landing): a function with such a
read translated to a refusal and now translates. The golden table gains the new fixture's rows at
the next pin's bless; no other cell moves (the cells that change at this commit are the previous
commit's 237, cell for cell).
Verified:
- m3-max-85077, the Apple M3 Max (macOS 27.0.1): the fixture's companions from
scripts/regen-air-fixtures, and its kernel plainly and under the validation layer (the answers
above).
- m3-max-85084 and m3-max-85200, the M3 Max: the recording of sparse-read-through, plain and under
the validation layer, and its times.
- m3-max-85550, the M3 Max: the air_input golden printout, blessed under Homebrew LLVM 21.1.8,
the pinned major.
- m3-max-85515, on the CPU with no device, at this change before its golden and row: the engine
inventory's eight llvm_as parts differ from the table only by the new row (ok on all 15
profiles, now in it). Red, with lower/texture/mod.rs at the previous commit:
a_sparse_read_through_a_clamp_to_edge_sampler_reads_its_texel_resident and
a_sparse_access_of_a_texture_slot_is_resident fail, and the control
a_clamp_to_edge_read_clamps_its_coordinate_into_the_texture passes. Green: all three pass.
- m3-max-85600, on the CPU with no device, at this change before the .air.ll row and the
declaration: the golden table's cells at this commit and at the previous commit are the same
237, cell for cell; the refusal surface's check, 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,471 tests: 3,469 passed, 24 skipped, and the failures are
golden_hashes_match_the_table, whose table is blessed at the next pin, and
inventory_lists_every_fixture_in_order, which the .air.ll row now answers; validation ran 1,343
tests, all passed, 2 skipped; conformance ran 1,055, all passed. In CI's lavapipe image,
sparse-status-plain differed only as justified, and sparse-read-through differed only at its
notices, by simdgroup-access-order, which it now declares.
- m3-max-85750, at this commit: inventory_lists_every_fixture_in_order passes, conformance ran
1,055 tests, all passed, and in CI's lavapipe image both cases differ only as justified:
sparse-read-through by the simdgroup-access-order notice it declares, sparse-status-plain by
native-nan-encoding.
|
||
|
|
2ec06b93e1 |
Translator: the sparse path goes
The translator kept a second form for a function that observes a texture's residency: a slot's
sparse arm (OpImageSparse* and OpImageSparseTexelsResident under shaderResourceResidency) or its
tile map (a storage buffer of tile bits the consumer would mirror from each mapping), selected by
SpecKey::SparseTexture from the bound texture's MTLTexture.isSparse, with Metal's measured
footprint rule for a sample or gather, writes dropped under the same constant, and
PrecisionNote::SparseResidency where the device answered. With the observed residency now the
constant resident word, nothing builds either form, and nothing can need one: the runtime has no
sparse heap or sparse texture API, and the consumer tells no guest it has sparse textures (every
Apple family's supportsFamily NO, sparseTileSizeInBytes 0, isSparse NO; a sparse heap refused at
newHeapWithDescriptor:). So the path is deleted (rule 4).
Public items deleted, each searched for in the consumer's checkout at 76e6c90369 (0 hits for every
name):
- RuntimeFact::SparseTexture { slot, sparse_arm, tile_map } and its mechanism; the 12-03 cleanup
ruling that kept it in the produced-then-refused group is reversed for it alone;
- SpecKey::SparseTexture;
- ResourceKind::TileMap and BindingSource::TileMap, with pipeline::tile_map, the map's format;
- PrecisionNote::SparseResidency (metal2vulkan-degrade-sparse-residency), with its API.md
catalogue entry, the conformance Degradation and validation's C3 deferred near-equivalent;
- error::Feature::SparseTexture, which nothing constructed;
- bind::TextureFacts::sparse and TextureShape::Texture's sparse, which no binder set.
Crate-internal, gone with them: the texture family's residency use flags, sparse_arm, tile_map and
sparse_writes on a slot plan, their spec constants and tile-map views, resident_access, the tile
decoding (TileLevel), the read's sparse and tile-map arms, the census's ".resident" suffix and
RESIDENCY_WORDS; the sampler's residency and footprint fields and lower::sampler::footprint (Metal's
measured footprint rule, read only to answer from a tile map), the sparse arm in sample, gather and
pixel fetch emission, and lower::texture::residency (every caller sits behind the texture family's
own refusal of a word with another bit observed). The SPIR-V layer loses what only those built:
the builder's sparse_sample, sparse_fetch, sparse_gather, sparse_dref_gather, sparse_read and
texels_resident, the sparse flag of SampleForm and of the fetch, gather and read instructions,
Inst::ImageSparseTexelsResident, its serialization, requirement (SparseResidency, and with it
shaderResourceResidency) and the interpreter's unmapped texels. VkFeature::ShaderResourceResidency
stays: profiles and the device queries name it.
Nothing compiled changes: no module held a sparse instruction or the constant since the previous
commit, so SEMANTICS_VERSION stays. ARTIFACT_FORMAT_VERSION 608 -> 609 (renumbered at landing):
the codec's ResourceKind, SpecKey, RuntimeFact, PrecisionNote and BindingSource lose variants,
which moves later tags. runtime-sources.sha256 moves for bind/state.rs, bind/heap.rs and the
deleted pipeline/tile_map.rs; no run of an unchanged artifact changes. docs/REFUSALS.md, the
runtime's error/basis.rs and tests/api_signatures.tsv are regenerated.
Tests deleted with what they tested: the serializer's sparse sweep, the builder's sparse read
under texel operands, the mechanism table's three SparseTexture rows (the variant indices close
up), C3's SparseResidency deferral (the deferred-row tests now use CubeGradientFootprint).
Verified, on the CPU with no device:
- m3-max-85203, at this change on
|
||
|
|
619e977d63 |
Translator: a texture's observed residency is the constant resident word
A sparse_sample, sparse_gather or sparse_read (and a sparse block read) whose function observes
bit 0 of its status word (sparse_color::resident()) was refused under the identity domains:
the observed residency made the slot's RuntimeFact::SparseTexture, a texture state the identity
domains do not source (Unsupported{IdentityDomains; NotImplemented}, IdentityCause::TextureState).
The golden table and the engine inventory held the refusal for engine/a2_sparse_status, and the
runtime's README listed it as a known gap.
Metal's answer over a texture that is not sparse, measured with this kernel plain and under
Metal's validation layer (which reported nothing): every residency resident on the Apple M3 Max
(macOS 27.0.1) and on the AMD Radeon Pro 5300M (macOS 26.7.1), not resident on the Intel UHD
Graphics 630 of the same MacBook (macOS 26.7.1), with the same colours on all three. Both answers
are Metal's. The runtime makes no sparse texture: it has no sparse heap or sparse texture API, and
the consumer tells no guest it has sparse textures (every Apple family's supportsFamily NO,
sparseTileSizeInBytes 0, isSparse NO, and a sparse heap refused at newHeapWithDescriptor:).
So the word is the M3 Max's and the 5300M's answer, a constant: an observed residency is 0,
resident, of a slot and a heap element alike, with no query, no precision note and no second
form. lower::texture::residency answers false wherever the word's other bits are not observed (a
word with another bit observed stays refused), so no access marks its slot's residency and no
slot states a SparseTexture fact. The extended-range sample, which refused an observed residency,
takes the constant word too.
Tests:
- engine_identity's a_sparse_access_of_a_texture_slot_is_resident compiles a2_sparse_status on
every identity profile and moltenvk-m3 without robustImageAccess2: L3 passes, the interface
states no specialization constant but the dispatch's, the plan no SparseTexture fact, and the
module holds no OpImageSparse* instruction.
- engine_texture_oob's block_reads_read_their_texels_as_reads_do runs br_sparse (a sparse block
read storing 2.0 where resident) on every profile and class, where it asserted the refusal:
its alpha lane reads 2.0 at every point, inside the texture and outside.
- The conformance case sparse-status-plain (cases/sparse_status.rs, the a2_sparse_status kernel
over two 4x4 RGBA32Float textures, 16 threads) records the M3 Max's colours and residencies,
and Metal's times; its module docs state all three Macs' answers.
Docs: the runtime README's known gap for this residency goes, with the sparse residency in the
list of texture state the identity domains do not source; API.md's texture paragraph says an
observed residency reads resident, with the Macs' answers, and PixelSamplerScaling's entry (here
and on PrecisionNote) loses its observed-residency case.
Engine inventory (public_fixture_expectations_engine.tsv): 147 .ll cells move from
Unsupported{IdentityDomains; NotImplemented} to ok, every profile's of a2_sparse_status,
kernel_block_read's br_sparse, sps2_residency_probes, spse_address_probes, spse_array_probes,
spse_level_probes and spse_volume_probes (15 each), and every profile's but runtime-floor's of
spse_write_probes, spse_write_barrier and a27_spse_write_barrier (14 each; runtime-floor's stays
Unsupported{IdentityDomains; NotImplemented}). Their .air.ll twins, which only macOS assembles,
move at the M3 bless.
SEMANTICS_VERSION 2367 -> 2368 (renumbered at landing): the residency-observing fixtures' golden
cells change from the refusal to modules. The golden table is blessed at the next pin.
Verified:
- m3-max-85059, on the CPU with no device, at this change on an earlier development
(004f68b48f; rebased since onto
|
||
|
|
c43c130d1a |
Tests: a sampler of Metal's undeclared filter 2 is made and filters as nearest (red)
MTLSamplerMinMagFilter's raw value 2 (MTLSamplerMinMagFilterCubic) is declared by no SDK header, by Apple's page, or by the Metal Shading Language, and nothing a program can ask tells it about the value. Metal makes a sampler state of it on every Mac measured. The case's own inputs read a footprint wider than one texel on an Apple M3 Max (macOS 27.0.1, job m3-max-85004) and the nearest texel on a Radeon Pro 5300M and an Intel UHD Graphics 630 (macOS 26.7.1, job m3-max-85003). Undocumented Metal is not emulated, so the runtime is to make the state and filter it as nearest, the x86 Macs' answer, on every device. The tests that hold that: - rt every_device_shares_sampler_states_device_samplers: a state with a Cubic min and mag filter is made (no Gap::CubicSampler), its word is the nearest state's, and it takes no device sampler of its own. - translator a_cubic_filter_is_the_nearest_filters: a Cubic min filter, mag filter or both is the nearest filter's word, device sampler of each use, and unnormalized reading, at normalized and pixel coordinates; and a_sampler_word_holds_each_field_at_its_bits: a Cubic filter's word is 0. - conformance sampler-cubic-filter: its ledger row (refused on every venue) goes. The case drops its bicubic-filter-arithmetic declaration and lets each lane's runtime red hold its own texel where the M3 Max's recording differs (every lane but lane 0), under the new accepted difference in docs/API.md. the_cubic_allowances_are_the_lanes_nearest_moves pins those lanes to the recording. docs/CONFORMANCE-COVERAGE.md regenerated (coverage.py): one ledger row fewer, one tolerance more. |
||
|
|
556ed46e41 |
Conformance: the depth colour reads declare the depth notices; API.md's border cell is the runtime's
The case's replay on lavapipe (job m3-max-84879) announced restricted-depth-range and restricted-depth-upload: the comparing stage's note and the 32-bit float depth upload's. Every texel is 0.25 or 0.75, inside [0, 1], and the notices site was the whole of their difference, so the case declares both, as sampler_filtering's compare rows do. The same job's replay with the colour allowances dropped printed the runtime's own answers: a sample past the edge under an opaque white border reads (1, 0, 0, 1), which fills the accepted difference's table. |
||
|
|
8cff38ab42 |
Conformance: depth-colour-reads, a depth texture read through a colour slot (unrecorded)
The planner ruled that the runtime keeps Vulkan's (d, 0, 0, 1) for a depth texture read through a texture2d<float> slot: the three Mac families answer three ways (M3 Max (d, d, d, 1), m3-max-84755; Radeon Pro 5300M (d, d, d, d) and UHD Graphics 630 (d, 0, 0, 1), m3-max-84762), and the 630's is Vulkan's. The case pins that answer: the owned fixture dvw_depth_views's five kernels over a 6x5 Depth32Float texture, thirteen reads (samples nearest and linear, at the edge and past it under an opaque white border, gathers of green and alpha, a view swizzled (G, R, One, Zero), and the depth2d sample and comparison). It is recorded on the M3 Max; each element where the 630's answer differs from the M3 Max's may hold the 630's value as well (0), under docs/API.md's new accepted difference, and everything else compares exactly. Lanes sit at exact coordinates, so a linear weight is the same on every device. docs/API.md section 10 gains the entry (its runtime border cell follows the replay). The recording and the coverage regeneration follow in their own commits. Verified: cargo fmt. Build, record and replay follow in their jobs. |
||
|
|
7941badd0b |
docs/API.md: a 1D texture's bicubic sample is the M3's measured answer, as the 2D one is
API.md now says the bicubic filter is not documented Metal, in 1D or 2D, and that what the sample does is Metal's measured answer on an Apple M3 Max. For 1D that is the bilinear filter of taps i and i + 1 in every format, at the fraction of q = floor(256 (x - 1/2) + 1/2) rounded half up, with the taps clamped at both ends under clamp_to_edge. The 2D sample has the same status. The basis, from Metal's own texts: - The Metal Shading Language Specification 4.1 (2026-06-04), section 6.13.1 "1D Texture": "This member function samples from a 1D texture. Tv sample(sampler s, float coord) const", and "Because mipmaps are not supported for 1D textures, lod needs to be 0". Its Table 2.7 (sampler state enumeration values) lists filter, mag_filter and min_filter as "nearest (default), linear" only. "bicubic" appears nowhere in the specification or the feature-set tables. - The Metal toolchain's header metal/__bits/metal_texture_common declares the enumerator `bicubic` in `mag_filter`, `min_filter` and `filter` only under `#if defined(__HAVE_BICUBIC_FILTERING__)`. Metal's answer comes from an Apple M3 Max on macOS 27.0.1, job m3-max-85106: bcu_forms.metal's 1D lane over an 8-texel texture at 16 points, in RGBA32Float, RGBA16Float and RGBA8Unorm. At x = 3.0, between texels 4 and 9, it reads 6.5, where a Catmull-Rom sum reads 6.25. |
||
|
|
94adea1c61 |
Identity domains: a bicubic sample of a 1D texture
The identity domains refused every function that samples a 1D texture through a bicubic
constexpr sampler ("a bicubic filter of a 1D texture", IdentityCause::SamplerState), though its
lowering reads nothing the identity domains do not source. It is the 2D sample's on one axis: the
same footprint (lower::sampler::bicubic::footprint_on, q = floor(256 (x - 1/2) + 1/2)), the
level-0 size by OpImageQuerySizeLod of the bound image (the slot's set-1 element), the taps by
OpImageFetch of that image, and the bound format's treatment from the slot's
PushField::BicubicTexels word (bicubic::format_bits, which takes no dimension), summed by the
module's Routine::Line, which the default domains already emit: the device's FMix of taps i and
i + 1 at the fraction k / 256, then the normalized formats' clamps. Metal filters a 1D texture
bilinearly over those two taps whatever its format (the module docs; the committed M3 observations
of the bcu_forms and bcx_rules cases). The runtime writes the field per slot from the bound
texture whatever its type, so it needs no change. The refusal and BICUBIC_LINE_FORM go.
The sample keeps PrecisionNote::BicubicFilterArithmetic. No new form, query or copy.
The fixture inventory's bcu_forms.ll and bcx_rules.ll rows move to ok on all 15 profiles (30
cells); their .air.ll twins move at the next M3 bless. docs/API.md, the runtime README (its bicubic
paragraph and the identity domains' known gaps) and IdentityCause::SamplerState's doc no longer
list the form. docs/REFUSALS.md regenerated: unchanged. No public item changes.
Test: tests::engine_identity::a_bicubic_kernel_reads_each_slots_format_treatment_from_its_pushed_field
(red at 74dd91398f).
|
||
|
|
6ba3572cbe |
Translator: the lockstep pass only finds pairs; its barrier insertion, rows mode and RowLockstep deleted
What: the lockstep pass (lower::simd::lockstep) keeps one job: find whether an entry holds a pair of accesses only a SIMD-group's lockstep orders, which sets Lockstep::unordered and the static note PrecisionNote::SimdgroupAccessOrder. Everything that ordered such a pair is deleted: the order key (OrderKey, Order::Rows, Decision), the barrier placement (stab, points, insert, rewritten, the barrier declarations), the rows mode (Basis::Position, Lockstep::rows, across_rows, orders_across_rows, dispatch's rows_may_split, RuntimeFact::RowLockstep and the barrier plan's rows_only), the inserted barriers' own forms (barrier::Origin, the barrier's rows guard, lockstep_class, BarrierPlan::uniform_placed and lockstep_simdgroup, the reconverges helper), Lockstep's barriers, emulated and inserted, and the select arm that emulated SIMD groups for a lockstep pair. The census names barrier.lockstep.* go; a program barrier keeps barrier.simdgroup or barrier.threadgroup. Why: the identity domains, which every state is translated under, take the key that orders nothing, so no barrier was ever inserted and every arm deleted here was unreachable. Public items removed (api_signatures.tsv): metal2vulkan-air Lockstep's across_rows, barriers, emulated and rows fields and its inserted and orders_across_rows methods, and RuntimeFact::RowLockstep. Consumer search: reims-vgpu development 76e6c90369 plus its 203 refs younger than a day: 0 hits each for lockstep, Lockstep, RowLockstep, orders_across_rows, across_rows and .inserted(. Tests: the census checks that asserted no barrier.lockstep name are gone with the names (the value checks of engine_simd_lockstep's kernels stay; its two tests that held only census checks, the branch arms and the texture calls, go with their kernels); engine_quad_ops drops its always-false lockstep_emulated; engine_store_quad, engine_ray_tracing and engine_simd_matrix drop their reads of the deleted fields; the mechanism table loses RowLockstep (62 variants). The test helper pipeline::testing::specialized_entry takes no profile, since the entry no longer depends on one: engine_store_quad checks sst_lanes' entry once, and engine_texture_unit_bit_test, engine_generic_pointers and engine_linking drop the profile they no longer pass. No module word moves: the deleted arms never ran. SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION do not move (the codec tags a fact by its name, and no artifact held RowLockstep). docs/API.md, the runtime's error and test docs, the simd module docs, lockstep.rs's title and the engine fixtures README's row_lockstep_tree row lose the clauses about inserted barriers; runtime-sources.sha256 is re-pinned. Verified: see the jobs named below. |
||
|
|
fa5d051b64 |
Translator: the two-word 64-bit integer forms deleted; every profile holds 64-bit integers in u64s
What: the arithmetic family's word form of 64-bit integers is deleted: Held::Wide and every arm on it, lower/arith/wide.rs (its word arithmetic, division, casts and lane moves) with its tests, ArithStrategy::Wide and ArithPlan's wide and divides, the profile's wide forms (wide_form_on, wide_demote, widen, widen_const, holds_wide), the two-word switch selector (SelectorForm::Words), the chunked vector's two-word lanes, the ulong texel's word form (TexelConv::U64Words loses its flag), the matrix descriptor's word form, and in the access family the two-word address (pointer.rs's Address enum and its helpers, the handle table's word entries and HandleIds, psb.rs's word base). The helpers the u64 paths still use move to arith/ops.rs (low_word, zext_word) and access/psb.rs (Pair, split). Every !int64 refusal goes with them: Feature::Int64Arithmetic, and Feature::PointerCompare, whose one producer was the static guest plan's !int64 arm. LeafCaps::int64 is deleted, and the mesh fold no longer asks for shaderInt64. BinOp::ISubBorrow, which only the word subtraction built, goes with its interpreter and builder arms (the grammar's Op::ISubBorrow stays in spv.rs). Why: Device::from_queries refuses a device without bufferDeviceAddress and shaderInt64 (IdentityDomains), and it is the only way to make a profile, so every profile has shaderInt64 and every arm deleted here was unreachable. This commit's parent is the last that holds the word form. Consumer search: reims-vgpu development cadac770c2 plus its steelbrain refs younger than a day (190 refs): 0 hits each for Int64Arithmetic, PointerCompare, LeafCaps and leaf.int64. The profile's fingerprint changes on every device (the field leaves the profile's Debug text), so the golden cells read "profile changed" until the table is re-blessed; no key stays unchanged, so SEMANTICS_VERSION does not move. The module words do not move: the u64 paths emit the same instructions in the same order (the uvec2 the slot offset builds is the same type the word form's type helper made). Tests: chunk.rs keeps the chunked lane-move and fragment-shuffle bound tests, on 64-bit and 32-bit lanes held whole; the selector test drops the word cases; the tests that asserted or filtered on the int64 field or Int64Arithmetic drop those lines; the dynamic move between slots runs L3 on every profile. docs/API.md (the object grid's needs), docs/REFUSALS.md, scripts/refusal-surface/reach.tsv and tests/api_signatures.tsv are updated; runtime-sources.sha256 is re-pinned. Verified: job m3-max-84770 at this commit (CPU only; the device steps on lavapipe): clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd EXIT=0; rustdoc EXIT=0 and private-item docs of five crates with 0 diagnostics; the translator's suite 2,594 of 2,595 passed, 20 skipped, the one failure golden_hashes_match_the_table (28,950 cells under a changed profile fingerprint, 0 changed under an unchanged key); air, runtime, devtools and harness 872 passed, 4 skipped; validation 1,348 passed, 2 skipped; conformance 1,053 passed; doctests passed; the conformance replay on lavapipe EXIT=0 with 0 ledger drift lines; the refusal-surface and signatures checks EXIT=0. The golden and engine inventory lists at the parent and at this commit show 0 computed cells moved and no inventory line. |
||
|
|
09b6d0fb89 |
Translator: the anisotropic emulation deleted; a device without samplerAnisotropy refuses an anisotropic sampler
What: lower/sampler/anisotropic.rs and its tests, the emulated filter's
routine arm, SpecKey::SamplerAnisotropy, LoweringInputs and VariantKey's
anisotropic samplers, and PrecisionNote::AnisotropicFilter and
DeviceAnisotropicFilter (no producer is left) are deleted.
metal::sampler::check_sampler refuses a sampler of maxAnisotropy above 1
for a use that filters on a device without samplerAnisotropy
(Feature::SamplerAnisotropy, needing the feature): a constexpr sampler
where the function that samples through it compiles, a runtime or
argument buffer's sampler where it is made. A runtime slot's sample
compiles as the plain sample.
docs/API.md's precision-note catalogue loses the two notes,
docs/REFUSALS.md and scripts/refusal-surface/reach.tsv are regenerated
(SamplerAnisotropy is now a device refusal), api_signatures.tsv loses
the deleted items, and the runtime README line on the emulation goes.
SEMANTICS_VERSION 2363 (renumbered at landing: 2360, 2361 and 2362 went to
the seq_cst fence, the argument buffer border texels and the
partial-threadgroups cause). runtime-sources.sha256
is pinned at this tree.
Consumer search (read only), reims-vgpu development 4bb5db49fc and every
steelbrain/* branch younger than a day, 184 refs, git grep over *.rs,
*.toml and *.md: AnisotropicFilter, DeviceAnisotropicFilter,
anisotropic_samplers, SpecKey::SamplerAnisotropy and both degrade ids:
0 hits each.
Why: the planner ruled the emulation deleted directly after G1: under the
one form it is reached only on a device without samplerAnisotropy, where
Metal's anisotropic filter is not the device's, and the refusal names
the feature that device lacks.
Verified: job m3-max-84770 (CPU only, no card): the previous commit's red
test passes at this commit (1 run, 1 passed); the golden and engine
inventory lists at
|
||
|
|
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.
|
||
|
|
3fbbadbc6e |
Translator: a seq_cst fence adds to the device's fence word, so seq_cst fences are totally ordered
Vulkan has no sequentially consistent order ("SequentiallyConsistent memory semantics is not
supported and must not be used", vkspec 1.4.366, Memory Semantics), and an acquire-release fence
lets two threads that each store and then load the other's word both read the old values, which
Metal's seq_cst fence forbids: it "establishes a single total modification order of all tagged
atomic operations" (MSL 6.16.1). Such a fence was refused, Unsupported{IdentityDomains}
SeqCstFence; five kernels of the first-setup walk's library aa5e72671a992cea meet it, each with
four air.atomic.fence(mem_device, seq_cst, device) (probe m3-max-84688).
The planner's ruled form, one for every device: a seq_cst air.atomic.fence at any scope beyond
the thread, an LLVM fence seq_cst, and a program's seq_cst barrier whose memory scope is the
device keep the acquire-release barrier they had at their own scope, then add 1 with
OpAtomicIAdd at Device scope, with the barrier's semantics, to the device's fence word. Adds to one
word are totally ordered and each reads the one before it, so the earlier fence's add (a release)
synchronizes with the later's (an acquire). Threadgroup and simdgroup fences take the device word
too (planner, option A): a stronger order than Metal names, with no workgroup memory and no
change to the threadgroup memory limit.
The word: pipeline::SEQ_CST_FENCE_WORD (256) bytes past PushField::ZeroAddress, in the runtime's
zero chunk: one per device (Core holds one Ring; the chunk is kept for the device's life and never
given back), made with every buffer usage, read only in its first 16 bytes (a checked load's unit
at ZeroAddress, psb::ZERO_RANGE_READ, and an indirect command buffer reset's index token of 0
bytes), its value never read. A function with such a fence reads ZeroAddress whether or not it
checks an access (access::place_zero_address keeps it). No new push field.
- lower::sync::barrier: total_order (selection: notes device scope, places ZeroAddress) and
add_to_fence_word (emission); Fence and Barrier carry `total`; require_seq_cst and
SEQ_CST_FORM deleted. lower::sync::memory_model: the LLVM fence's `total`.
- error: IdentityCause::SeqCstFence deleted (the consumer names it nowhere: git grep -n
'SeqCstFence\|SEQ_CST\|seq_cst_fence' at reims-vgpu f054ad57c1 finds only C __ATOMIC_SEQ_CST).
- Guards: psb.rs asserts ZERO_RANGE_READ <= SEQ_CST_FENCE_WORD at compile time; ring.rs asserts
the word fits its chunk; the_fence_word_lies_past_the_zero_range_s_reads checks both readers.
- Tests: the red test's threadgroup and simdgroup rows take the device add (option A); the
identity, dispatch and MSL 4.1 tests compile a4_device_fence, device_fence_store and
a27_memory_order where they asserted the refusal.
- Validation: ToolingRequirement::SeqCstFence and executor_contract::seq_cst_fence retired, as the
runtime runs the fence; a_seq_cst_fence_runs_through_the_runtime replaces the refusal test.
- Docs: the runtime README moves the fence from the identity refusals to a known gap with the
add's cost (RTX 3090 m3-max-84667, RX 7900 XTX m3-max-84666, Iris Xe m3-max-84668; device
fences, standing for threadgroup and simdgroup ones too); docs/API.md and ring.rs say where the
word lies. api_signatures.tsv blessed; REFUSALS.md regenerated, unchanged.
- SEMANTICS_VERSION 2360 (2359 went to checked naming, which landed first), RUNTIME_VERSION 2565 (a runtime word added; renumbered 2566 below).
Verified, potluck jobs on this branch rebased onto development
|
||
|
|
b337c83e25 |
Byte copies: the kernel's heap slot is the kernel stage's; the draw's docs, the README's and API.md's lines, and the device test's all-codes row and counts
The translator's sample kernel named its heap slot under a stage that does not exist (Stage::Kernel is the compute stage's); fixed with the other error the first build (lavapipe job m3-max-84536) reported. The runtime README states the measured layout, the form, the refusals left with their causes, and names this caller on the stencil-export known gap; API.md documents own_draw and SamplesToBytes and catalogues PrecisionNote::RoundedSampleDepthCopy. The device test gains a 128 x 128 Depth16Unorm row at 4 samples whose 65,536 units are every code once, checks every unit of the copy back out, and asserts the counts: 2 sample copies a row, and 8 stencil bit draws for a stencil row on a device without stencil export, else none. |
||
|
|
0ce2f39b71 |
Translator: the resident core deleted; every device compiles the one form, and the tests run it
Every device now compiles the identity domains, the one form: a kernel's
buffer arguments are bound as storage buffers of set 0 where the device
binds them (DeviceProfile::binds_kernel_buffers) and are reached at their
device addresses elsewhere, as every other stage's are; vertex attributes
are fetched by fixed-function vertex input; textures and samplers are
elements of the identity arrays of set 1, named by their resource IDs.
What the one form does not lower is a typed refusal,
Unsupported{IdentityDomains, NotImplemented} with the IdentityCause the
previous commit names.
Deleted, with everything only they reached:
- the device policy (device/policy.rs) that chose the resident-table
domains, and the resident root table, handle table and their facts;
- the heap raw reads (lower/sampler/heap_raw.rs, lower/texture/heap_raw.rs),
sampler footprints, bind/texel_parts.rs and bind/status.rs;
- the lockstep orders' barrier tiers, which no order key adds now
(OrderKey::of orders nothing).
Tests: 274 tests that only the resident-table policy compiled (development's
DevicePolicy::RESIDENT_TABLES, which only tests built) are deleted, among
them 15 whole files (argument tables, cross-class, device replay, dynamic
roots, two extended-range files, image shapes, mesh barriers, profile F,
separate samplers, sparse unmapped, tile, wide, sweep and the footprint
tests); each deletion's reason is listed with the READY. The others are
ported to what the one form compiles and names today: census names,
push fields, refusals with their causes, and run values. A new interpreter
harness (tests/identity_harness.rs) binds a dispatch's buffers at device
addresses and its textures as identity-array elements. Census naming is
unchanged. The validation tests that read compiled modules (coverage,
companions, the authored compile census, specialization) assert the one
form's present strings. The extended-range levels and volume tests, whose
mip filters development built under the resident tables, become two tests
of the one form's answer, which is development's default policy's: a 2D or
3D sample of an extended-range slot texture is refused, TextureState
(lower::texture::identity_class holds no class for it); a padded form's 3D
sample stays the lowering's NotImplemented(Format). Development's new
thread-local test binds through the one form's harness, and its
handle-web test (every_handle_web_an_instruction_observes_is_refused)
compiles on the default profile.
SEMANTICS_VERSION 2355 and ARTIFACT_FORMAT_VERSION 607 (cached
translations and artifacts change). docs/REFUSALS.md is regenerated and
runtime-sources.sha256 is pinned at this tree.
Verified at the stack's tip, which differs from this commit only by the
five commits after it; the jobs and their results are named in the READY.
|
||
|
|
a8ccda7cc6 |
Translator: an identity-domains refusal names the form it met
Feature::IdentityDomains with Needs::NotImplemented covered every form the identity domains do not lower behind one name; only a diagnostic symbol said which, and slot.rs's refusal of a storage texture access without its bound format named nothing. An identity refusal now carries Cause::Identity(IdentityCause), one variant per refused family, the way an access or tessellation refusal names its cause; sites that refuse the same family share a variant, none is named by a file, a line or a string of its own: - ObjectOrMeshStage: a function of a stage other than a kernel, vertex or fragment function (select.rs identity_refusal). - Descriptor: a buffer argument not reached through its device address, or a descriptor beyond a bound kernel's storage views (identity_refusal). - EncoderValue: a push field the identity window does not carry (identity_refusal). - HeapResource: an argument buffer's texture of a type or handle class the identity arrays hold no element for, read as raw extended-range texels, decoded, read through another numeric type, or through a handle that reads its table entry beyond its element (identity_refusal; link.rs's handle-class binding). - TextureState: a texture argument of a type the identity arrays hold no element of, or state of a bound texture or sampler beyond its resource ID (identity_refusal; sampler/mod.rs's identity sampling of a type with no identity class). - SamplerState: a sampler the identity sampling does not take, a minimum level or emulated filter the function specializes, a 1D bicubic filter (identity_refusal), and a reached anisotropic slot sample (sampler/anisotropic.rs). - ConstantBlob: constant data past the module's bound read through memory. - SeqCstFence: a sequentially consistent fence (sync/barrier.rs). - StorageTextureFormat: a storage texture access the device takes only with a declared format, whose bound format no input names (texture/slot.rs, which named no form before). The diagnostic symbols stay. The device-level refusal of a device without bufferDeviceAddress and shaderInt64 (derive.rs) names its needs and no cause. Feature stays IdentityDomains, so validation's outcome key and the census are unchanged, and the golden and engine table cells (feature and needs only) do not move; no version bump. Tests: the error module's Display test of an identity refusal with and without a symbol; the cause asserted at the 1D bicubic, the storage texture without its format, the constant blob, the seq_cst fence and the texture argument refusals (engine_identity) and the replay variant's encoder value (pipeline/compile tests). api_signatures blessed (IdentityCause, Cause::Identity), api_surface lists the enum, REFUSALS.md regenerated (the sites are built through error/mod.rs's Unsupported::identity), docs/API.md's error table and the identity domains' paragraph name the cause. runtime-sources.sha256 unchanged: no runtime input is edited. Consumer uses (consumer-uses.sh, read-only, over the consumer's development 90214271ed and its lane tips of the last day): IdentityCause, Cause and IdentityDomains, 0 hits. The consumer reads Unsupported::cause only through its Display (rt_platform diag.rs refusal_name, unbuilt.rs), so an identity refusal's name there now carries its cause. |
||
|
|
ed55748644 |
Docs: the runtime README, API.md, REPLAY-STREAM.md and VALIDATION.md state each measurement by its card and driver, not by our job id
The planner widened the job-id rule from the published crates' rustdoc to the four prose docs a
reader takes measurements from. Each lab job id (m3-max-NNNN, and the bare job numbers beside
them) and each commit sha comes out; the ids stay in the commit messages that already carry them.
A measurement keeps the card, driver and OS its sentence names. Where an id was the only basis a
sentence named, the sentence now says what was measured and on what:
- the runtime README's identity-domains paragraph cited five plays of recorded streams; it now
states what the states-only plays of the 26 kept replay streams on lavapipe show: each makes
every pipeline state its stream makes, and none of their render or compute states is refused,
a refusal under the identity domains among them (the plays of jobs m3-max-83458, -83494, -83695,
-83889 and -83954, each printing refused 0);
- the probe lists name the cards ("probes on the RTX 3090, the Iris Xe, lavapipe and the RX 7900
XTX"; "probes on a Radeon Pro 5300M and a UHD Graphics 630, both macOS 26.7.1");
- sentences that compared runs by id compare them by order ("failed in one run and passed in two
others"), and "the same job" is "the same run";
- "rt at <sha>" and "players built from <sha>" become what that build was ("a build of the runtime
that copied a texture over any import"), or go where the card and driver already say it;
- VALIDATION.md's harness count reads "the harness on lavapipe".
Two README tables lose their Job column (the import-cost table and the guest-buffers table). The
edited paragraphs are rewrapped at 100 columns; a token diff against the parent shows only the
ids, the shas, the two columns and the rewordings above.
submit.rs's three citations of two probe commits (06860a3848 and b15b306d2f) become "measured
with a probe build of the runtime" (and, for the split probe, "that timed each command buffer");
the IN_FLIGHT and infos comments are rewrapped at 100 columns.
So it does not grow back, scripts/api-docs first fails when the four docs name a job id
(`m3-max-NNNN`, or `job NNNN`); CONTRIBUTING.md, API.md's description of the script and ci.yml's
comment on its step say so.
docs/CONFORMANCE-COVERAGE.md is unchanged: its generator has no job column. Its 1772 lines with an
id are all in its last section, The ledger, which quotes the last field of known-gaps-rt.tsv; the
ids are in the ledger's own sentences, which the ruling keeps out.
Not widened, per the ruling: the ledger, known-gaps-rt.tsv, results.py, test comments and the
unpublished crates. The OS is not added to measurements whose sentence named a card and driver
but no OS.
Verified on the CPU with no device, job m3-max-84430 at this commit's tree: cargo fmt --check 0;
the workspace's rustdoc with -D warnings 0; scripts/api-docs 0, and 1 with a job id planted in
docs/VALIDATION.md, naming the planted line (the tree clean after its restore); the refusal
surface's --check 0; the 13 tests that read these docs passed (feature_enables, the floor, the
accepted differences, the precision-note catalogue, the consumer's objects and the guide's
example). Before the commit, no line of the four docs matched the check's pattern, and rustfmt
--check passed on submit.rs.
|
||
|
|
71a5393966 |
Translator: an imageblock refusal names its cause (ImageblockCause)
Feature::Imageblocks covered about ten structures with one untyped refusal, so a walk's counts could not tell them apart. Each site now names the structure it met, in Unsupported::cause (Cause::Imageblocks), as Cause::Access and Cause::Tessellation do: - MultisampleOperation: the front end's undecoded multisample operations (get_imageblock_samples, get_imageblock_num_colors, get_color_coverage_mask, the masked implicit store), set where the front end's refusal converts; - Stage: an explicit imageblock or an imageblock intrinsic outside a kernel or tile function, or an imageblock view outside a fragment function (param_family, use_imageblock); - TwoImageblocks, DataSize, Layout: why the planner gives the kernel's explicit imageblock no region (more than one; no or zero data size; an alignment that is not a power of two, cells past 4 GiB, or an unaliased explicit one beside the implicit one). The planner's imageblock() returns the cause and ArenaLayout keeps it (imageblock_refused) for use_imageblock to refuse with; Missing where the kernel declares no imageblock at all; - DataOperands: air.imageblock_data operands other than (coord, 0, 0); - ParameterValue: the imageblock parameter's value selected (access::select_param); - CellPointer: an imageblock-space pointer that air.imageblock_data does not make, outside a tile function (the planner); - FragmentData: a fragment function's [[imageblock_data]] input (fragment::select_param) or output (stage_io); - SliceWrite: a slice write of a shape not modelled (texture::select, texture::slice). Golden tables are unchanged (their outcome text names no cause). REFUSALS.md regenerated, the signatures table blessed (ImageblockCause, Cause::Imageblocks), the api_surface list and docs/API.md's Unsupported row name the new enum. SEMANTICS_VERSION 2354 (main renumbers at landing): a refusal's text changes. runtime-sources.sha256 follows from the job. Verified: pending (the red tests and the suites). |
||
|
|
69033afcd4 |
rt: a Shared heap's texture on a device without unified memory is an image of its own
The L21 ruling, the third use of rule 2's unified-memory query (Vulkan's device type). On an integrated or CPU device a Shared heap's image texture lies in its heap, as before. Elsewhere it is an optimal image of its own in device memory, made as new_texture makes one but not zeroed (Metal's heap textures are not), and its heap range is left unused. Before, a discrete device either refused the placement (Gap::HeapTexture where its optimal images take no Shared type: the RTX 2080 and 3090 on NVIDIA 620.70.06) or bound the image in system memory, which every read crossed the link for (97 times a Private heap's time on an RX 7900 XTX, job m3-max-79841). How: heap_source decides by core.unified_memory() and the block's class. The own form checks the placement against heap_texture_size_and_align's answers by the same rule the in-heap form uses (heap_place, factored out of make: a heap range past its block, a texture past the heap's end, a byte off the alignment are Refusal::HeapTexturePlace), then makes Source::HeapOwn: Bind::Pooled (a place in a texture block or an allocation of its own, which spills as a texture's does), the heap's hazard id kept, no alias Placement, and Under::Heap with at None, so use_heap still covers it (heap_block) and blits see no shared span (bound). Texture buffers and textures over heap buffers are untouched. Docs: AGENTS.md rule 2's unified sentence gains the clause (the count stays fourteen); the runtime README's heap text and known gaps (the device memory sum beside the heap's block, where it runs out, and the earlier speed row); new_heap_texture(_for_views), heap_texture_size_and_align, has_unified_memory and Gap::HeapTexture docs; docs/API.md and the conformance heap-size side's step 2; docs/REFUSALS.md regenerated (HeapTexturePlace's site is heap_place). RUNTIME_VERSION 2564 (renumbered at landing: development held 2563). runtime-sources.sha256 unchanged (guard PASS, m3-max-84127). Verified: red FAIL / new PASS on the RTX 3090 (build m3-max-84138, run 84144), the RX 7900 XTX (84137, 84221; rt suite under m2v_gpu 993 passed, 4 skipped, 84222) and the Iris Xe (84227, 84238); CPU suites 84127 (conformance + rt 1279 passed, 2 skipped); clippy plain 84180, m2v_gpu 84172, m2v_cpu_icd 84181, rustdoc + api-docs 84182, all EXIT=0; states-only play on lavapipe 84256 equal to the base (gb-3090-r2 10643 render / 15299 compute, windrag-780m-b4-um790 8972 / 225, 0 refused). The consumer's arm64 guest walk on the RTX 3090 at pin S (m3-max-84046) asked for no texture on a Shared heap, so the evidence is the device tests and timing. |
||
|
|
23193c9bf1 |
Translator: the padded forms' linear mip filter blends two levels, a bfloat form's reads one
Two measured changes to an extended-range sample's level, each from the M3 Max on macOS 27.0.1: - A padded form's linear mip filter (R10Unorm_X6, RG10Unorm_X12 and their _sRGB twins) now blends its two levels as BGR10_XR's and BGRA10_XR's do, through a constexpr sampler and through a runtime one, and records PrecisionNote::BicubicFilterArithmetic. Before, a constexpr sampler's was refused NotImplemented(Format), and a runtime sampler's read one level with no refusal. The probe extended_linear_mip_blends (job m3-max-82967; 16,384 lanes per form and filter, 2D, five levels, random codes) puts Metal's sample within 0.0157 of its own two levels' samples blended by mix at the fraction truncated onto sixty-fourths. The note's doc and its docs/API.md catalogue line gain that bound. - A bfloat form's linear mip filter (R16Bfloat, RG16Bfloat, RGBA16Bfloat) is now its nearest mip filter, which Metal's equals on every lane whose two levels differ (4,096, 8,192 and 16,384 lanes, nearest and linear filters). Before, a constexpr sampler's was refused. A runtime sampler's already read that level. What stays refused through a constexpr sampler: - A two-plane form's linear mip filter (not measured). The probe only shows that a five-level texture is made. - RGB10A2Unorm_sRGB's linear mip filter (not measured). Jobs m3-max-83026 and m3-max-83029 explain why. A texture of five levels holds each level's own code, which a blit reads back per level. Yet the M3 samples level 0's code at every explicit level, at gradients under a nearest mip filter, at every level under a linear one, and in a 2D array's layer 1. RGB10A2Unorm, the control, samples each level's code. Documented Metal samples the level asked for. So this is a driver defect, which is not emulated (an Apple bug report is drafted), and the format's samples keep reading the level the mip filter names. No conformance case samples that format's levels today. Docs: three comments named binder refusals that no code makes, and none of the three exists (ResourcePlanner is gone): - a runtime sampler word that states mixed filters; - a runtime linear mip filter's clamp maximum below the last level; - a runtime linear mip filter of an unmeasured form. The comments sat in lower/sampler/extended.rs, select.rs and the extended-range tests' module docs. They now state what happens: the word samples as nearest, the maximum is not read, and a two-plane form's or RGB10A2Unorm_sRGB's runtime linear mip filter reads the nearest mip filter's level. They also say this is an open gap that no consumer meets while the runtime makes no texture of these formats (the runtime's Gap::TextureFormat). The probe crates/metal2vulkan-conformance/probes/extended_linear_mip_blends.m gains the nearest mip filter at the point's level, the two-plane question and each texture's level count. SEMANTICS_VERSION moves to the next number, because refusals are removed and samples' answers change. runtime-sources.sha256 is re-pinned because metal/format/mod.rs is a runtime input. Tests (tests/engine_extended_range/levels.rs): - unmeasured_linear_mip_filters_are_refused now builds a padded and a bfloat linear mip filter, and still refuses a two-plane and an RGB10A2Unorm_sRGB one. - measured_linear_mip_filters_blend_or_read_one_level: every padded and bfloat form's constexpr sampler compiles, valid, under either mip filter, with the note on a padded linear one alone. On the CPU interpreter, at 64 levels between two, through a constexpr and a runtime sampler, a padded form's sample lies between its two levels' nearest-mip samples on every lane and strictly between on some. A bfloat form's equals its nearest mip filter's, bit for bit. Verified on the CPU with no device (job m3-max-83908): with metal/format/mod.rs, lower/sampler/extended.rs and select.rs at |
||
|
|
5b3bd800c0 |
Translator: under the identity domains a runtime sampler's LOD query outside a fragment function reads its minimum level from the sampler's word
A clamped calculate_clamped_lod in a kernel or a vertex function through a runtime sampler
argument was refused on every profile under the identity domains ("a sampler argument whose
minimum level or emulated filter the function specializes"): the query read the slot's
SamplerMinLevel specialization, which no binder chooses there.
The query now reads the word of the resource ID the sampler slot already pushes (SlotGuestBase):
0 where the word states no mip filter, else SamplerWord::LEVEL_MIN, the level a nearest mip
filter reads at lodMinClamp, bounded by the texture's last level as before. A bind-time clamp
(setSamplerState:lodMinClamp:lodMaxClamp:) binds a variant whose word is made of the clamped
descriptor, so it is read too. That is the M3 Max's and M4's measured answer
(metal::sampler::query_min_level) for no mip filter and a nearest one, and for a linear one where
lodMinClamp is a whole level or past the texture's last level. Under a linear mip filter with a
clamp between whole levels Metal answers the clamp on its sixty-fourths grid, which the word does
not hold. MSL 4.1 section 6.13 leaves both queries undefined outside a fragment function ("Only
call the calculate_unclamped_lod and calculate_clamped_lod functions from a fragment function or
a function you call with a fragment function; otherwise, the behavior is undefined."). So, per
the planner's ruling, there is no precision note; docs/API.md's accepted differences states the
answer. The resident-table path keeps its specialization.
SEMANTICS_VERSION 2347. The runtime-sources pin does not move: pin-compute.py gives a92fe0a8...
for this tree, the same as before. docs/REFUSALS.md does not move either: the refusal text
remains for an extended-range sample's linear-mip blend. The runtime README's known-gap entry
names the lowered query. Verified by the lane's red/green job, named in the lane's report.
Landed with SEMANTICS_VERSION 2347 (renumbered above development's 2346: written 2343 on its base,
then 2346 at the lane's rebase onto
|
||
|
|
011540217d |
Translator: a mode-2 fragment write to a texture buffer held as words rounds half and small floats to nearest even
A texture buffer of a format a device holds as words is written by lower/texture/words.rs's write_texel, which rounded a half-float or RG11B10Float channel toward zero at either textureWriteRoundingMode. Metal's texture buffer rounds those to nearest even at mode 2, as its storage texture does (the probe below). So a fragment function in a mode-2 pipeline that wrote a half-float or RG11B10Float texture buffer on a device holding that format as words stored a code one below Metal's on 36% to 44% of the probe's channels, and 65504 where Metal stores the infinity. Now, where Write::half_up marks the write (a fragment function's, in a pipeline of mode 2): - a half-float channel (R16Float and RG16Float, the half-float formats a device may hold as words) takes ChannelWrite::FloatNearestEven, a finite value past the largest to the infinity, as Metal's RGBA16Float texture buffer stores it; - an RG11B10Float channel takes nearest even too, and a lane that rounds to the infinity from a finite value is held at its format's largest finite value (65024 for the 11-bit channels, 64512 for the 10-bit one), as Metal's stores it; an infinity stays, and a NaN is the quiet NaN still. The RGB9E5Float word's half-up rounding is unchanged; the probe shows Metal's texture buffer storing the same bytes as its storage texture there. A write at mode 0 or 1, and every kernel's write, still rounds toward zero. The probe is committed as crates/metal2vulkan-conformance/probes/texture_buffer_write_rounding.m: texture_write_rounding_storage.m with texture_buffer<T, access::write> targets, made from a Shared buffer with MTLTextureTypeTextureBuffer and written at texel y * 256 + x, over the same 65,536 texels. On an Apple M3 Max under macOS 27.0.1 (job m3-max-83395), mode 0 matched toward zero on every channel, and mode 2 matched nearest even on every channel that is not a NaN: RGBA16Float float texels 262,112 of 262,112 (to the infinity past the largest), RG11B10Float float and half texels 196,583 of 196,583 each (held at the largest), and RGB9E5Float 65,536 of 65,536 at both texel types (half up, its hashes equal to the storage texture's). Docs: words.rs's module doc, Write::half_up and write_texel; API.md's words line names mode 2. SEMANTICS_VERSION moves above development's: a texture buffer write's answer changes. Verified on the CPU with no device (job m3-max-83575): the color_write and words tests pass (79), the golden table differs from development's (semantics 2334) in 109 cells, as at a535f1dc17, and the refusal surface is unchanged; cargo fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, the API reference check and the doctests pass; the suites pass 3740 of 3741 (24 skipped), the one failure golden_hashes_match_the_table, bless due; the validation suite passes 1340 (3 skipped) and the conformance suite 1052. The states-only plays of this tree (m3-max-83669) make what 126ee4fdf5's make (m3-max-83443): the gb-3090-r2 stream 10643 render and 15299 compute states, the 780M windrag stream 8972 and 225, none refused. |
||
|
|
9211eb3c10 |
Translator: half +, -, *, / and fma on the 16-bit instructions record NativeHalfConversion
Under the 16-bit float controls, a half +, -, * or / and a half fused multiply-add run on the device's 16-bit instructions, between exact conversions. By the Vulkan spec their results are Metal's. A driver's compiler may still compute them in float and leave them unrounded. Intel's Windows driver 101.2145 on a UHD Graphics 630 does: - A standalone tree of three 16-bit OpFAdds, or Fmas of a product, each decorated NoContraction under all three 16-bit controls, ran on 4,096 invocations. 2,284 sums and 4,080 products matched neither the half tree nor the float tree rounded once (job m3-max-83092). - The Iris Xe under Mesa ANV 26.2.6 gave the half tree on every invocation (job m3-max-83093). - In the runtime's quad test on the UHD, 112 of the 1,536 compared halves are the float chain rounded once at the store (job m3-max-82918). Per the planner's ruling, the operation carries the static note on every device, with no device check. narrow::computes_half_arithmetic looks in the emitted module for a 16-bit OpFAdd, OpFSub, OpFMul, OpVectorTimesScalar or OpFDiv, or a GLSL.std.450 Fma. Where it finds one, the pipeline records NativeHalfConversion, beside the conversion pair's existing cases. A Sqrt alone records nothing, and neither does the simdgroup half tree's ClusteredReduce. The note's reach in validation narrows to half arithmetic. Until now it reached every word fed by any float family. The AIR word scan now feeds a new family, HalfArithmetic, beside the operation's own family, from these operations: - an fadd, fsub, fmul, fdiv, frem or fneg with a half result; - a float cast whose result or operand is a half; - a call of a modelled family whose result or an argument is a half. NativeHalfConversion reaches only that family. A half word that only float arithmetic fed, through a move, is no longer reached. The note stays unbounded at the word, now on the comparison's stay-unbounded list with its reason. A driver may leave the chain unrounded and round it once at the store, and with cancellation the two answers differ by more than the stored value's ulps (40 codes measured on the UHD). How far rests on the operands, which a word does not carry. Docs: - The note's API.md catalogue entry and its PrecisionNote doc said those operations "take no such rounding". They now say the operations record the note, and give the UHD 630 measurement beside NVIDIA's fold and RADV's fusion. - The DeviceHalfDenormals entry points to it. - VALIDATION.md names the half family among those the word scan reads. Tests: - engine_native_half: the controlled-conversion test's sum kernel now records the note, as every kernel there does. - engine_float_call_notes sets the module-level note aside for 16-bit arithmetic, as it does for the conversion pair. - half_simd_reductions accepts, where the quad pipeline records the note, a quad word whose every half is Metal's or the float operations rounded once. The model is the new devtools quads_once. - In validation: - the scan's packed-halves test expects HalfArithmetic on the half word alone; - a words test shows the note reaching a half word only when half arithmetic feeds it; - the reach row is pinned. SEMANTICS_VERSION 2340 -> 2341 (precision notes added). ENGINE_EXECUTOR_ABI vulkan-engine-v215 -> v216 (the word scan feeds HalfArithmetic, and the note's reach narrows to it). Golden hashes: no cell moves. The cells hash the final SPIR-V, which the note does not touch. Job m3-max-83293 (Linux) ran golden_hashes_match_the_table twice: at this change, and with compile.rs and cache/mod.rs at |
||
|
|
d0fb4f3381 |
Translator: delete StageModule::level_reads, which nothing reads
StageInterface::level_reads and StageModule::level_reads stated, per texture slot, the levels of
its bound view the stage's reads reach (LevelReads, SampledLevels, SamplerLevels and the
structural analysis spirv::requirements::level_reads). Nothing reads them:
- the runtime: git grep -nw -e level_reads -e LevelReads -e SampledLevels -e SamplerLevels
-e finite_texels -e highest_lod -e lowest_lod at
|
||
|
|
f42e61aa84 |
Docs: the helper-thread words' four mechanisms, and what a split quad's helper query answers
The read of the ten cases held as helper_thread_words (lavapipe, job 83263; Radeon 780M, jobs 83264 and 83267) explained 454 of their 455 differing words by four mechanisms: Apple's partial quads, lavapipe's clip seam, RADV's lane order and x86 lavapipe's 8-lane subgroup. The docs said otherwise in two places: - QuadsSplitByClipping said each run of a split quad combines fewer active lanes than Metal's. Each piece's run keeps all four lanes; what differs is the helper query, which names the other piece's covered pixels as helpers where Metal's quad, shaded once, names none. The note's doc comment, its API.md catalogue entry and the validation gap's doc now say that. - FragmentSimdgroupGrouping gains the fill past a subgroup under 32 lanes: it reads an inactive lane, which MSL 4.1 section 6.10.2 leaves undefined, and the device reads the calling lane in its place (lower::simd's PartialFragment read). docs/VALIDATION.md's verdict section names the four mechanisms and what lavapipe and the 780M do under each, where the next reader of a held case looks. The gap's doc in c3.rs no longer says the cause is unread. Docs and doc comments only. pin-compute.py over the tree gives the committed runtime-sources fingerprint (artifact.rs is not one of its inputs), so no re-pin. cargo fmt --all is clean. |
||
|
|
f683293b4b |
Docs: a fetch may read the texel from before its draw, so overlapping read-modify-writes leave one
UnorderedFetchWithinDraw's words said a pixel that overlapping fragments of one draw fetch and
write "holds the result of some order of the draw's fragments", "not necessarily Metal's". The
Radeon 780M (RADV, Mesa 26.2.6) shows otherwise. Job m3-max-83259 ran the eight authored cases
the ordered_fetch_within_draw gap holds (n instances of the companion's fullscreen triangle in
one draw, so n identical fragments at every pixel or sample) five times at
|
||
|
|
41712a1ec5 |
Translator docs: NativeNanEncoding covers a NaN's payload moved through loads, stores and selects
What: NativeNanEncoding's rustdoc and its docs/API.md catalogue entry say what validation now reads it as covering: a NaN's payload moved through loads, stores and selects as well as one an operation computes. Validation excuses a word in any float lane only where Metal's answer and the device's are both NaNs of the lane's format. Why: the planner accepted reading the note as reaching every float lane, bounded to two NaNs. The public case nan-model-loads-stores-and-selects-of-nan-halves differs on lavapipe only in half NaN payloads its entry moves without an operation (e.g. Metal 0x7e01 against 0x7e00, m3-max-82836), which the note's own text already records at every read of a half from its bits. Text only: no output and no recorded note changes, so SEMANTICS_VERSION stays; artifact.rs is not a runtime source input. |
||
|
|
2c61e4fc52 |
Translator docs: NativeFma states that an unfused half product can overflow
What: NativeFma's rustdoc and its docs/API.md catalogue entry state the one case its recorded bound does not cover: an unfused product can overflow where Metal's fused result is finite, and the overflow stays the device's answer. A 16-bit product of magnitude 65520 or more rounds to the infinity of its sign, so the result is that infinity where Metal's is finite, or a NaN where the addend is the infinity of the other sign and Metal's result is that infinity. Why: the bound (half an ulp of the product plus half an ulp of the result) read as covering every input; the public cases fused-multiply-add-rounding-and-fmuladd-without-fast-math and fused-multiply-add-rounding-and-contraction-under-fast-math show the other answer on lavapipe: fma(256.0h, 256.0h, -65504.0h) is inf where Metal answers 32, and fma(65504.0h, 65504.0h, -inf) a NaN where Metal answers -inf (job m3-max-82667's rows against the committed Metal rows of the Apple M3 Max). No lowering changes; the note stays unbounded in validation. Text only: no output and no recorded note changes, so SEMANTICS_VERSION stays. artifact.rs is not a runtime source input, so runtime-sources.sha256 stays. |
||
|
|
e31bc61172 |
Validation: a precision note excuses only the words its operations feed, within its bound
What: a candidate's output is judged against Metal's one 32-bit word at a time
(observation_contract::words). An equal word matches. A differing word is excused only by a
recorded note that reaches it: a note with a bound makes a word within it a match, a note with
no bound makes it a noted word, and a word no reaching note excuses is a mismatch.
- Reach is read from the case's AIR (check::output_words): for each output word, the float
lanes it holds and the operation families whose results feed it, followed byte by byte
through bitcasts, lane moves and the zext/shl/or that pack two halves. A store placed at
A * thread_position_in_grid + B bytes gives each thread's words their own facts. A note of the
module that writes the output reaches the words its operations feed; a note of another module
reaches every word, and so does every note of a word the scan cannot follow (a load of memory
the entry writes, a call outside the intrinsic families).
- Bounds a word can carry are checked there, and a word within one matches: DeviceDenormals
only where Metal's and the device's lanes both lie at or below the smallest normal (2^-126,
2^-14 for half), of one sign unless one is a zero; NativeNanEncoding only two NaNs of the
lane's format (it reaches every float lane: a half read from its bits is no operation);
HalfTexelConversion its recorded one half ulp, or +-65504 beside the infinity; the lane
tables and the reassociation bound as before.
- NativeFma, NativeDot, NativeMix and NativeDivision keep no value bound (each states its bound
over the operands, which a word does not carry) and reach only the words their operations
feed. The fixture knows its inputs, so a per-case bound from the operands is a later form.
- SimdgroupAccessOrder reaches only a word another thread of the kernel may write: one a store
the scan cannot place in its own thread's bytes writes.
- Rows record the output's word facts (census output_words). The batch report prints, per case
and in total, the words matched exactly, within each note's bound and only noted, by note,
the unexcused words, and the cases with a word on the fall-back.
- DeviceDenormals's rustdoc states Metal's measured answer per operation: it flushes before
rounding on some (a product, fma, dot and mix just below 2^-126 answer a zero) and keeps a
denormal on others (sin, tan, asin, sinh, asinh, atanh of a denormal), from the public cases
float-products-flushed-before-rounding and nan-model-float-denormals-per-operation. Its
recording rule already covers plain multiplies; no rule changed.
ENGINE_EXECUTOR_ABI is v215: how a match is decided changed and rows record word facts.
Why: a noted difference was excused whole by any recorded note, so a note that could not cause
a word's difference (a division's note beside a product, an access-order note on a kernel whose
threads write disjoint words) hid it, and a bounded note never matched.
Verified on lavapipe (Mesa 26.2.4, the lavapipe image), the 1,168 public cases, job
m3-max-82854 (this tree with the next commit's doc text) against m3-max-82667 at
|
||
|
|
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 |
||
|
|
401d9d5949 |
Translator: an extended-range 3D texture's linear mip filter blends its two levels, under BicubicFilterArithmetic
A BGR10_XR or BGRA10_XR form's (or _sRGB twin's) 3D sample under a linear mip filter now blends its two levels' 3D filters as a 2D sample blends its levels: the device's FMix at the clamped level's f32 fraction, through a constexpr sampler and through a runtime sampler whose word states the filter. It records PrecisionNote::BicubicFilterArithmetic, as every level blend does (the runtime sampler's under its linear-mip clause). Metal's blend of a 3D texture's two levels fits no rule tried; the XR mip probe (an Apple M3 Max on macOS 27.0.1) put the closest 284 of 8,192 samples apart. The note's doc and its catalogue line in docs/API.md now state this, with a new measure committed as crates/metal2vulkan-conformance/probes/extended_linear_mip_blends.m (the M3 Max, macOS 27.0.1, job m3-max-82944). At 16,384 lanes per form, filter (nearest, linear) and shape, Metal's own two levels' samples blended by mix at the fraction truncated onto sixty-fourths lie within 0.033 of Metal's 3D linear-mip sample of BGR10_XR, BGRA10_XR and their twins, and within 0.031 of its 2D sample, the blend the module has shipped. The module blends at the f32 fraction instead, which moves its blend by under 1/64 of the two levels' difference from that rule. The select_extended doc no longer lists a 3D texture's linear mip filter among the refusals. Before this change: - A constexpr sampler's linear mip filter on such a 3D texture was refused NotImplemented(Format). - A runtime sampler's linear mip filter on one had no refusal at all. The emitted sample read the nearest level, and its comment named "the binder's refusal", which no binder or runtime code makes (ResourcePlanner::extended_sampler no longer exists). The same gap holds for a 2D sample of a form whose levels' blend is not built (another XR form, ExtendedRange::blends_levels false) through a runtime sampler that states a linear mip filter. That case is left to the oracle measure that will build it. Red test: tests/engine_extended_range/volumes.rs volume_linear_mip_filters_blend_two_levels replaces volume_linear_mip_filters_and_padded_forms_are_refused. A constexpr linear mip filter compiles, valid, with the note. On the CPU interpreter, a runtime sampler's linear-mip sample at 64 levels between two lies, on every lane, between the nearest mip filter's samples of those two levels, and strictly between on some. A padded form's 3D sample stays refused. At the base, the constexpr case is refused, and the runtime sampler's sample is one level's. SEMANTICS_VERSION moves to the next number: a refusal is removed and a sample's words change. Landed with SEMANTICS_VERSION 2338 (renumbered above development's) and runtime-sources.sha256 4361761c, recomputed on development. |
||
|
|
6191bf763d |
Translator: mode-2 fragment storage writes run: Metal's RGB9E5Float word, the device's half and RG11B10 rounding
Under TextureWriteRoundingMode::NearestEven (Apple's textureWriteRoundingMode 2) every fragment storage write now runs; the refusal NotImplemented(PrivateRenderState(TextureWriteRounding)) and the facts RuntimeFact::StorageTextureWriteRounding and HeapWriteRounding are deleted. Measured first, by the probe committed here as crates/metal2vulkan-conformance/probes/texture_write_rounding_storage.m (an Apple M3 Max under macOS 27.0.1, jobs m3-max-82793 and m3-max-82824): a fragment function writes 65,536 texels of float and of half texels into RGBA16Float, RG11B10Float and RGB9E5Float storage textures, once in a pipeline of mode 0 and once of mode 2. Mode 0 rounds every channel toward zero. Mode 2 rounds a half-float channel to nearest even, a value past the midpoint above 65504 to the infinity (262,112 of 262,112 non-NaN channels); an RG11B10Float channel to nearest even, held at the largest finite value (196,583 of 196,583, float and half texels alike); and an RGB9E5Float texel's mantissas half up under the largest clamped channel's exponent, moved up where that mantissa rounds to 512, which is Vulkan's own rule for the format (65,536 of 65,536 texels, float and half alike). Every mode-2 code lies within one unit of mode 0's. - RGB9E5Float: the word is the module's own arithmetic (texture::rgb9e5_word), so under mode 2 it is now Metal's mode-2 word exactly: the product times 2^(25 - e) converted toward zero keeps the half's bit, one added and a shift right round half up, and a largest mantissa of 512 moves the exponent up before every mantissa is rounded again. Write::half_up carries it to a SharedExponentBits slot's write (emit::to_image) and WordsPlan::half_up to the texture-buffer words' write routine. A kernel, tile or other function, a word attachment and the default mode keep the truncation. - RG11B10Float, float and half texels: the device's conversion as at the default mode, recorded as PrecisionNote::DeviceColorConversion (unconditionally for a declared format, under small_float_storage's clauses for a formatless slot or a heap). A half-float channel's note for a float texel stays half_storage_facts's. The note's storage clause and its catalogue line in docs/API.md state the measured counts. Red tests: - lower/arith/tests/color_write.rs rgb9e5_words_are_metals_at_either_mode: the emitted word, run in the SPIR-V interpreter over the probe's 65,536 texels (probe_texels rebuilds them from the probe's SplitMix64; its input and half hashes are checked against the probe's), hashes (FNV-1a) to the texture Metal wrote, bit for bit, for float and half texels at either mode. It is red with the half-up arm disabled. - tests/engine_link.rs mode_two_fragment_texture_writes_round_as_metal_or_the_device replaces mode_two_refuses_fragment_texture_writes_it_would_round. It draws over an RGBA32Float attachment, whose output records no note (the previous test's RGBA8Unorm attachment recorded DeviceColorConversion itself, which made the earlier commit's note check vacuous). Every case compiles and links valid at either mode. A declared R16G16B16A16 slot records DeviceColorConversion at both modes, a B10G11R11 slot under mode 2 alone, and an RGB9E5 word slot at neither. It is red with the product files at the base, which refuse. Public surface: PrivateRenderField::TextureWriteRounding and the two RuntimeFact variants are removed (api_signatures.tsv rows). The consumer's checkout at a20576e1fd has 0 hits for PrivateRenderField, StorageTextureWriteRounding or HeapWriteRounding (git grep). The mechanism test's variant indices move StencilBitDraws and RobustStorageBuffers into the two freed places. docs/REFUSALS.md is regenerated. Not in scope, a follow-up: a texture buffer of half-float or RG11B10Float held as words (texel_buffer_form) converts by the module's own toward-zero routine, recorded under the same note. SEMANTICS_VERSION (refusal removed, notes and words under mode 2) and ARTIFACT_FORMAT_VERSION (two RuntimeFact variants removed from the codec) each move to the next number. runtime-sources.sha256 re-pinned (4361761c): the edited translator sources are runtime inputs. Landed with SEMANTICS_VERSION 2337 (renumbered above development's) and runtime-sources.sha256 4361761c, recomputed on development. |
||
|
|
a03b74c95c |
Translator: a fragment float write to a half-float or RG11B10Float storage texture under mode 2 is the device's conversion
Under TextureWriteRoundingMode::NearestEven (Apple's textureWriteRoundingMode 2), a fragment function's float texel written to a storage texture whose slot declares a half-float or RG11B10Float format was refused NotImplemented(PrivateRenderState(TextureWriteRounding)). It now runs with the device's conversion, as at the default mode, and records PrecisionNote::DeviceColorConversion: Metal's mode 2 rounds such a channel to nearest even (RG11B10Float held at the largest finite value), the device's store toward zero on every measured driver. The half-float note comes from half_storage_facts, which every float write runs; the RG11B10Float note from mode_rounded_write, under the clauses of small_float_storage (unconditional for a declared format, by the bound format for a formatless slot, by the heap's small-float family for a heap element). The note's storage clause in artifact.rs and its catalogue line in docs/API.md state the mode-2 case. The writes whose mode-2 rounding was not measured keep the refusal: a float texel into RGB9E5Float, and a half texel into RG11B10Float or RGB9E5Float. RuntimeFact:: StorageTextureWriteRounding and HeapWriteRounding stay for a slot whose bound texture decides and a heap handle, their docs narrowed to those cases; their field `halves` (a float texel, which also refused half-float textures) is renamed `float`, since a half-float texture no longer refuses (api_signatures.tsv's two variant rows follow). The consumer's checkout at a20576e1fd has 0 hits for StorageTextureWriteRounding or HeapWriteRounding (git grep). Fixed with it: a slot declaring RGB9E5Float through its word alias (R32_UINT, StorageImageClass::SharedExponentBits, the choice every profile makes for the format) was not seen as a mode-2 target at all, so under NearestEven it compiled with the default's word, no refusal and no mode recorded. It now records the mode and is refused under NearestEven, as a declared E5B9G9R9_UFLOAT_PACK32 was. SEMANTICS_VERSION 2333 -> 2334: a refusal class changes (mode-2 storage writes), and a fragment stage writing an RGB9E5Float word slot now records the mode in StageIo. Red test: engine_link's mode_two_refuses_fragment_texture_writes_it_would_round gains a SharedExponentBits case (refused under mode 2) and expects the declared R16G16B16A16_SFLOAT and B10G11R11_UFLOAT_PACK32 cases to compile under mode 2 with DeviceColorConversion, no fact, and to link valid. runtime-sources.sha256 re-pinned (2ac17122): lower/texture/mod.rs and the other edited sources are runtime inputs. Landed with SEMANTICS_VERSION 2336 (renumbered above development's) and runtime-sources.sha256 2ac17122, recomputed on development. |
||
|
|
699f1167d6 |
Translator: a Converted half rounding's conversion pair is decorated NoContraction, as the Controlled one is
A `half` rounding in `QuantizeForm::Converted` (a profile with shaderFloat16 whose float
controls do not make the conversion Metal's) was an undecorated OpFConvert to 16 bits and
its widening. Vulkan assumes AllowTransform on every operation not decorated
NoContraction ("Precision and Operation of SPIR-V Instructions"), and Mesa's NIR folds
`~f2f32(f2f16(a))` into `a` wherever the instruction is not exact (nir_opt_algebraic.py;
vtn marks NoContraction exact), so the value went on unrounded. On KosmicKrisp (Mesa
26.3.1, Apple M3 Max) that broke half_simd_reductions: each round of the half tree kept
float precision, and 224 of 256 words differed from Metal's (job m3-max-82540, pin P's
leg). The MSL KosmicKrisp emits showed no half() between rounds; with the pair decorated,
0 words differ (job m3-max-82662).
`narrow::converted` now emits each conversion with `convert_no_contraction`, as
`narrow::controlled` does. The pair relies on Vulkan's environment rule, which reaches a
conversion, where the SPIR-V specification words NoContraction for an arithmetic
instruction only; the docs state that reliance at the Controlled pair's (narrow.rs), on
QuantizeForm::Converted, and in docs/API.md's native-half-conversion entry, and that a
driver which folds a decorated pair leaves the device's own answer, within
PrecisionNote::NativeHalfConversion, which a Converted module already records. NVIDIA's
measured fold of the decorated Controlled pair stays as recorded. SEMANTICS_VERSION 2333
-> 2334: every Converted module's words change (moltenvk-m3 is the committed profile on
that form; KosmicKrisp takes it at run time).
Evidence, all on the arms of this change before the ruling:
- KosmicKrisp conformance replay on the Apple M3 Max: 53 sites that differed from Metal
at the base now match, none added (job m3-max-82685).
- Cost: +0.46% host wall on half_mix on the M3 under KosmicKrisp, job 82685, three
alternated rounds of 200, spread 0.03%.
- Golden tables: 216 moltenvk-m3 cells change, no other profile's (job m3-max-82679).
They re-bless at the next named pin.
The red test (the commit before) asserts both forms' conversions are NoContraction;
it fails before this change and passes with it (the gate's jobs are in the READY note).
|
||
|
|
333ae1b40f |
Translator: PrecisionNote::code states each note's stable degrade code
A precision note's stable code, `metal2vulkan-degrade-` and the note's name in kebab case, was written only in the conformance crate (degradation.rs), which is unpublished. So no published item gave a caller the code to announce a note by, and README.md said the runtime announces each note once with a stable code, which it does not: the runtime records each state's notes when the state is made, exposes them through its getters, and prints and sends none (docs/API.md section 9 says so). - PrecisionNote::code (pipeline/artifact.rs) returns the code, one arm a note, as docs/API.md's catalogue names it. - The conformance crate reads it from there: Degradation::code is its note's code, through Degradation::note, the inverse of from_precision_note. Each kind's doc names its note, not a second copy of the string. - README.md's "Recorded differences" says what is true: the runtime records each state's notes at creation and exposes them with a stable code; the caller announces them. docs/API.md's catalogue lead names PrecisionNote::code. - The signature table takes the method under both crates that export PrecisionNote. The 83 codes are unchanged: each equals the conformance crate's string before this commit (checked by script against its code() table), and every_kind_is_a_catalogued_precision_note still finds each in the catalogue. New tests: every_precision_note_code_is_its_name_in_kebab_case (translator, serde feature: every variant read from the enum's source, its code the kebab rule, no code twice) and every_kind_is_its_notes_kind (conformance: note() takes from_precision_note back for every kind). No translation, runtime or refusal changes; no runtime input changes, so runtime-sources.sha256 stays. Verified: rustfmt --check on the four .rs files; the job named in the handover. |
||
|
|
7be9f00a3f |
Docs: only tests build the resident-table domains
The docs of DevicePolicy::RESIDENT_TABLES, PointerDomain::ResidentTable,
HandleDomain::Table, the lockstep module, docs/API.md and three test
comments said the resident form was the validation executor's alone and
that the executor builds the resident root and handle table itself, or
called it "the old runtime's, until the cutover deletes it". Neither is
true: the validation executor (engine.rs), the runtime, the command line
and the compile worker all build their device under
DevicePolicy::default(), and every RESIDENT_TABLES in the tree sits in a
test (the translator's src/tests and device tests, the validation
crate's #[cfg(test)] modules including coverage::tier_table, the
harness's tests and the validation integration tests).
The comments now say that: nothing outside tests builds the form, and
the runtime, the tools and the validation executor take the default.
Comments and docs only; no code changes.
Verified: git grep of RESIDENT_TABLES, PointerDomain::ResidentTable and
HandleDomain::Table at
|
||
|
|
28e4da1f17 |
Docs: Metal's resolve rounds a tie as its GPU does, and the alpha-to-coverage note's devices at 8 samples
The planner's ruling on resolve rounding: rule 1 counts a resolve among the device's own answers, and two Macs round an average that lies exactly halfway between two codes differently, so Metal fixes no answer there for a guest. An Apple M3 Max (macOS 27.0.1) rounds the tie up, as the conformance recordings sample-positions-default-2x and -4x hold (red 1/255 over half the samples resolves to 1); an AMD Radeon Pro 5300M (macOS 26.7.1) rounds it to the even code (red 0 at 1 of 2, 2 of 4 and 4 of 8 samples, an alpha of 127.5 to 128; m3-max-82284). The device's own rounding stands; no behaviour changes and neither Mac's rounding is emulated. - PrecisionNote::DeviceRoundedResolve's doc and docs/API.md's catalogue entry name both measured answers with their sources. - The seven known-gaps-rt.tsv rows of sample-positions-default-2x and -4x (Iris Xe, RADV, NVIDIA, llvmpipe) say they differ only by how a tie rounds, and why that stands; docs/CONFORMANCE-COVERAGE.md regenerated from them. - PrecisionNote::DeviceAlphaCoverage's doc and its catalogue entry say exactly which devices are measured at 8 samples: the 5300M (m3-max-82239); the M3 Max, which renders no 8 samples and so has no answer there; no device the runtime runs on. They said before both that the 5300M was measured at 8 and that 8 was unmeasured on every device. |
||
|
|
efe893738c |
Translator, runtime: supportsTextureSampleCount: answers 8 where the device renders it into a colour, a depth and a stencil attachment
The planner's ruling: raster_sample_counts, which supportsTextureSampleCount:,
getDefaultSamplePositions:count: and programmableSamplePositionsSupported read, is the device's
framebufferColorSampleCounts, framebufferDepthSampleCounts and framebufferStencilSampleCounts,
intersected with 1, 2, 4 and 8. A query answer, not a second form: a device that renders 8 into
all three attachments answers yes for 8, as a Mac's AMD GPU does (an AMD Radeon Pro 5300M under
macOS 26.7.1, job 82204) and Apple10 does, where the Apple9 table answered 1, 2 and 4 alone.
TEXTURE_SAMPLE_COUNTS leaves the apple_gpu table, whose other answers are Apple9's.
Nothing else capped at 4: a texture's samples are its format's own (Limit::TextureSamples), the
pipeline link maps 8, the sample mask takes a word, Vulkan's standard locations hold 8, and
interpolate_at_sample reads index & (n - 1).
Metal at 8, measured on the 5300M (job 82239), and where ours can differ:
- interpolate_at_sample: indices 0 to 9, 15, 16, 100, 2^31 - 1 and 2^32 - 1 read sample
index mod 8, the runtime's answer; InterpolantAt::Sample's doc says so.
- Alpha to coverage: the 5300M covers a pixel at one sample at an alpha of 1/2 or above, every
pixel alike, and at two, four and eight samples floor(alpha * n + 1 - t), t 1/8 and 3/8 at even
and odd x of an even row, 5/8 and 3/8 of an odd one; every pixel floor(alpha * n) or
ceil(alpha * n). The device's own mapping may differ: PrecisionNote::DeviceAlphaCoverage (and
docs/API.md's catalogue) now states the 5300M's rule beside the M3 Max's and that eight
samples are unmeasured on every device.
- Default positions at 8: the 5300M's answer is Vulkan's standard 8 locations.
Docs that said 1, 2 and 4: Device::supports_texture_sample_count and default_sample_positions,
the floor's standardSampleLocations line, RenderPassDescriptor::sample_positions, positions.rs,
the runtime README (default positions, the floor table) and metal_properties' field.
Verified: the stacked gate (m3-max-82337, this change on the (i)+(b) hand-over): fmt, clippy in
three configurations, rustdoc, doctests, the validation suite 1322 passed (3 skipped), the
product suite 3725 passed with the five reds development's next bless takes (none of this
change's), the runtime's lavapipe suite 974 passed (4 skipped); the red commit's tests green on
lavapipe (2 translator, 9 runtime). On an RTX 3090 (m3-max-82314), an RX 7900 XTX and a 780M
(m3-max-82315) and an Iris Xe (m3-max-82316), the same patch on
|
||
|
|
0cd07d6612 |
Docs: API.md states the local size contract of a kernel on subgroups, which its shuffles rely on
A translator consumer that is not metal2vulkan-runtime read nowhere in docs/API.md that a kernel stating RuntimeFact::LocalSizeConstraint runs only threadgroups whose size is a multiple of it, and that a dispatch at any other size runs the kernel's EmulatedSimdgroups variant. A half simdgroup sum or product on the Direct and Cluster32 tiers now reads its sibling lanes by xor shuffles in a block every lane executes, which name an inactive lane in a partial subgroup. Section 6 now says so, and that the emulated variant gives Metal's answers for the partial simdgroup, as the runtime's variant choice does (pipeline.rs: a module with multiples gets KernelVariant::EmulatedSimdgroups). Verified: docs only; the contract read from device::subgroup::requirement and the runtime's variant choice. |
||
|
|
a1f82878ff |
Translator: a half simdgroup sum or product is Metal's tree of rounded half operations on every tier
Metal's simd_sum and simd_product of half operands work as a tree. In round d (1, 2, 4, 8, 16), each aligned block of 2d lanes holds its lower and upper halves' results, combined and rounded to half. A lane that takes no part counts as the identity. Measured on an M3 Max, macOS 27.0.1, our own MSL, fast math on and off alike: - sums: m3-max-80839; - products: m3-max-80879; - three masks of active lanes: m3-max-80890. The Direct and Cluster32 tiers folded the f32-held values with OpGroupNonUniformFAdd or FMul and rounded once. Rounding once misses five of the eight measured sums (0x3c10 where Metal answers 0x3c0f), four of the eight products, and ten of the 48 masked results. The emulated tier's exchange rounds already were the tree. group::half_fold: - New form. Five rounds; each combines the lane's partial with its sibling block's partial through half_step. - In a block every lane executes, the sibling partial comes from OpGroupNonUniformShuffleXor by d. A mask below 32 stays inside a Cluster32 cluster. - Where the group may be partly live, the sibling partial is the first active lane of the sibling block, read with the live lanes' ballot. A block with none leaves the lane's own partial: the identity, as the masked probe measured. half_step: - On a module that computes half under the 16-bit float controls, it is ops::f16_binary. That is the device's 16-bit instruction, whose rounding survives a driver that folds a conversion's round trip (NVIDIA's does). - Elsewhere it is ops::float_binary. - This is the same choice half + and * make. There is no 16-bit route for group operations: half group ops run on f32-held values on every profile, so this covers every route. Other changes in this commit: - reads_lanes is true for these operations, so partly_live tracks them. - direct_ops and cluster_ops need the shuffle class; partly_live adds the ballot. - words() bounds the five rounds. - A half simdgroup sum or product no longer records PrecisionNote::ReductionOrder. float and double sums and products, every float prefix sum or product, and the matrix and AGX multiply-adds still record it. - The note's doc and docs/API.md's catalogue entry say this per route. They also record that Metal's half prefix-sum order is not measured: it matches none of f32 rounded once per lane, a lane-order chain of half additions, or a Hillis-Steele scan of them (m3-max-80839). - Validation's REDUCTIONS table drops simd.reduce.fadd.half and simd.reduce.fmul.half, so a comparison holds them exactly. Its tests now name the half scan. - bfloat has no group operations: decode refuses them. SEMANTICS_VERSION 2325 -> 2326. Tests: - lower::simd::tests::half_sums_and_products_are_shuffle_trees covers the classes and the lane reads. - engine_simd's float_sums_record_their_precision now holds that a float sum records the note and a half sum does not. - The red tests of the previous commit carry Metal's bits. Verified: cargo fmt only on this host. The red and green device jobs, and the timing on a real half-reduction kernel, follow before landing. |
||
|
|
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). |