From 9b046a7cf8ac8cc4c0485778d3527c4cfd338b7f Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 11 Nov 2026 00:27:52 -0800 Subject: [PATCH] Conformance: lavapipe's row for vertex-fetch-past-4gib-small-buffer, its fixed-function fetch wrapping at 2^32 Replayed on lavapipe (llvmpipe, LLVM 23.1.4, homelab-um790-xtx-1, job m3-max-13976), both policies: case/out differs in 24 elements, the largest difference 27, and nothing else in the case. The 24 are the four slots of the six far draws at strides 4 and 12, the layouts the runtime leaves to the device's fixed-function vertex input. The first differs at byte 32 (Metal 0, ours 0x10, word 0: element 2^30 at stride 4, displacement 2^32 read mod 2^32), and 27 is word 11 (0x1b), element WRAP_12 + 3 at 2^32 + 44 read at byte 44. The pulled stride-6 draws read zero as Metal does. llvmpipe reports robustBufferAccess2 (vulkaninfo in job m3-max-14015), under which a vertex input past the bound range reads zero, so the wrapped word is lavapipe's own fetch. The same case replays exact on RADV (AMD Radeon 780M, RADV PHOENIX, job m3-max-14015) and on MoltenVK on the M3 Max (m3-max-13932), under both policies. The row is scoped to llvmpipe and names what is open on our side: pulling an attribute whose draw may fetch past 2^32 bytes of its bind offset on a device whose fixed-function input wraps, which no device check finds today. docs/CONFORMANCE-COVERAGE.md counts the row (3584 ledger rows). Verified: coverage.py --check "as derived" locally; the Linux conformance suite and the lavapipe replay of the case at this tip. --- crates/metal2vulkan-conformance/known-gaps.tsv | 1 + docs/CONFORMANCE-COVERAGE.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/metal2vulkan-conformance/known-gaps.tsv b/crates/metal2vulkan-conformance/known-gaps.tsv index dfffa7f7b..1b45690fc 100644 --- a/crates/metal2vulkan-conformance/known-gaps.tsv +++ b/crates/metal2vulkan-conformance/known-gaps.tsv @@ -3691,3 +3691,4 @@ padded-fetch-rgb10a2-srgb-clear-float Iris(R) Xe divergent case/reads 24576 elem padded-fetch-rgb10a2-srgb-draw-float Iris(R) Xe divergent case/reads 29590 elements differ (F32), the largest difference inf A fragment function reads `RGB10A2Unorm_sRGB` color 0 through a `float4` `[[color(0)]]` input and writes what it read to an `RGBA32Float` color 1, after an earlier draw of the pass wrote `float` values into color 0: Metal's tile holds that draw's outputs rounded to `half` toward zero, unclamped (a value past `half`'s range infinite), and ours reads the codes that draw stored, decoded to their tile value. The difference is the one the runtime announces as `extended-range-blends-stored-codes`, which the case declares. Open: our `half` shadow of a padded attachment (`LoweringInputs::extended_shadows`, built for the extended-range forms alone), which would hold the tile's `half` through the pass. padded-fetch-rgb10a2-srgb-load-float Iris(R) Xe divergent case/reads 11544 elements differ (F32), the largest difference 0.00048828125 A fragment function reads `RGB10A2Unorm_sRGB` color 0 through a `float4` `[[color(0)]]` input and writes what it read to an `RGBA32Float` color 1, over every code of the format loaded into the attachment: Metal reads each code's colour through its sRGB table, rounded to `half`, alpha its two-bit value rounded to `half`, and ours is the tile value of the codes (`extended_range::tile_value`): each colour decoded by the device's `Pow` transfer, then narrowed to `half` by the device's conversion, so a colour lands a `half` step from Metal's table where the two round apart. Under the native-arithmetic contract the device's conversions are the answer: `device-pack-conversion` and `native-half-conversion` (in `replay::NATIVE_NOTES`) record them, and validation derives no tolerance from them. Open: nothing. padded-fetch-rgb10a2-srgb-load-half Iris(R) Xe divergent case/reads 11544 elements differ (F32), the largest difference 0.00048828125 A fragment function reads `RGB10A2Unorm_sRGB` color 0 through a `half4` `[[color(0)]]` input and writes what it read to an `RGBA32Float` color 1, over every code of the format loaded into the attachment: Metal reads each code's colour through its sRGB table, rounded to `half`, alpha its two-bit value rounded to `half`, and ours is the tile value of the codes (`extended_range::tile_value`): each colour decoded by the device's `Pow` transfer, then narrowed to `half` by the device's conversion, so a colour lands a `half` step from Metal's table where the two round apart. Under the native-arithmetic contract the device's conversions are the answer: `device-pack-conversion` and `native-half-conversion` (in `replay::NATIVE_NOTES`) record them, and validation derives no tolerance from them. Open: nothing. +vertex-fetch-past-4gib-small-buffer llvmpipe divergent case/out 24 elements differ (U32), the largest difference 27 lavapipe's own fixed-function vertex input, not a value of ours: Metal takes a fixed-stride element's displacement in 64 bits, so every far element of the case (a vertex start, base vertex, index or base instance past 2^30, over a 64-byte buffer) lies past the buffer and reads zero (M3 Max, macOS 27.0.1). The 24 elements are the six far draws at strides 4 and 12, which the runtime leaves to the device's fixed-function input, and llvmpipe reads each at its displacement taken mod 2^32: element 2^30 at stride 4 reads word 0 (0x10) where Metal reads 0, and the largest, 27, is word 11 (0x1b), element WRAP_12 + 3 at 2^32 + 44. llvmpipe reports robustBufferAccess2, under which a vertex input past the bound range reads zero. The stride-6 draws, which the runtime pulls, read zero as Metal does, and RADV (PHOENIX) and MoltenVK (M3 Max) replay the case exact. Open: the fetch is lavapipe's; ours would be to pull an attribute whose draw may fetch past 2^32 bytes of its bind offset on a device whose fixed-function input wraps, which no device check finds today (render/vertex_reach.rs bounds only a pulled attribute's furthest element). diff --git a/docs/CONFORMANCE-COVERAGE.md b/docs/CONFORMANCE-COVERAGE.md index b22cd5a9a..5ee58fc53 100644 --- a/docs/CONFORMANCE-COVERAGE.md +++ b/docs/CONFORMANCE-COVERAGE.md @@ -44,7 +44,7 @@ Its limits, measured rather than asserted: | committed recordings | 1277 | | distinct SDK items the Metal leg reaches, of any status | 821 | | of those, reached only where this cannot name the family | 3 | -| ledger rows (a case whose gap is recorded) | 3583 | +| ledger rows (a case whose gap is recorded) | 3584 | | declared crossings of the option space (pairs put to Metal at once) | 26 | | declared crossings that are no pair of it (a boolean or numeric field, or one type in two slots) | 30 | @@ -5823,4 +5823,5 @@ A case whose difference from Metal is recorded rather than compared away. The le | `padded-fetch-rgb10a2-srgb-draw-float` | A fragment function reads `RGB10A2Unorm_sRGB` color 0 through a `float4` `[[color(0)]]` input and writes what it read to an `RGBA32Float` color 1, after an earl… | | `padded-fetch-rgb10a2-srgb-load-float` | A fragment function reads `RGB10A2Unorm_sRGB` color 0 through a `float4` `[[color(0)]]` input and writes what it read to an `RGBA32Float` color 1, over every co… | | `padded-fetch-rgb10a2-srgb-load-half` | A fragment function reads `RGB10A2Unorm_sRGB` color 0 through a `half4` `[[color(0)]]` input and writes what it read to an `RGBA32Float` color 1, over every cod… | +| `vertex-fetch-past-4gib-small-buffer` | lavapipe's own fixed-function vertex input, not a value of ours: Metal takes a fixed-stride element's displacement in 64 bits, so every far element of the case … |