bbc7866fa02caefd16d6c6ead0d79ed61ddb73dd
182
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
eb41a55e82 |
Draw every width Apple's setLineWidth: takes, as Metal draws it
RenderCommandEncoder::set_line_width refused every width but 1 (AppleOnly::LineWidth). Measured on the Apple M3 Max under macOS 27.0.1 (probes/line_widths.m): each encoder starts at 1 and the width holds across draws and pipeline states; Metal draws w' = floor(16 w) / 16 clamped to [0, 16] (NaN and negatives as 0, infinity as 16); at w' = 1 its ordinary diamond-exit lines; at every other w' Vulkan's non-strict parallelogram (major axis the larger extent, x on a tie; minor-axis edges through the endpoints, w' long and centred; ends not extended; centres inside, top-left ties; the width not rounded); at 0 exactly the pixel centres on the segment; one parallelogram per strip segment with no joins; triangles in fill mode Lines draw their edges so; at 4 samples every width is the parallelogram at the sample positions. The runtime (render/line_width.rs) keeps the quantized width in the encoder state and routes each draw at w' != 1: - the device's own lines (lineWidth w', no Bresenham mode) where it enables wideLines and w' lies in lineWidthRange above 0: exact where strictLines is unset, nonStrictWideLinesUseParallelogram set, w' > 1 and on lineWidthGranularity; elsewhere announced device-wide-lines under the default DevicePolicy::wide_lines = WideLinePolicy::Device, and the band under WideLinePolicy::Exact (exact_answers() selects it); - the pipeline's band variant otherwise (no wideLines, MoltenVK among them; w' outside the range; w' = 0 at half a width of 2^-subPixelPrecisionBits): cull none, the band's front face, fill mode, a PATCH_LIST of two points, viewport 0's half extent pushed with the half width; strips and loops listed as their segments (ListGap::WideLines), flat inputs under the last provoking vertex read from the list led by the last vertex, which covers the same pixels. Refused: Unsupported(WideLines) needing tessellationShader where neither route draws a line; NotImplemented(RuntimeGap::WideLines) for a triangle's edges or a mesh draw's lines the device's lines do not draw, an amplified band, a rate-mapped pass and an execution's commands. Counted: WorkCounts::device_wide_line_draws, line_band_draws. The lane test runtime_lane::line_widths draws the probe's cases through owned fixtures and compares every pixel with Metal's answers (line_widths_m3_max.txt, the probe's output), checks each wide draw took a route, and that every fragment is front-facing; its site WIDE_LINES holds the new kind in the lane's degrade-notice closure. Docs: FAST-PATHS.md's row for wide_lines and a known-gap bullet (edges and mesh lines on devices without wideLines, near-plane cuts, band fragments' inputs uncompared, width 1 on multisampled targets off MoltenVK); API.md's policy bullet and degrade catalogue; the runtime README's Line widths; RUNTIME-PORTING's row; REFUSALS.md regenerated (reach rows for feature and gap WideLines, apple LineWidth gone). Validation: the line limits the device description gained describe execution and are not compared in a profile's subset check; the generator's CORE_PROPERTIES and roadmap-2022's m2v_layer_presentation state them at the reader's absent values; opened_chains reblessed (one member more, wide_lines, on every device with it); golden_hashes' profile fingerprints reblessed (no output cell moved); api_signatures and api_surface name WideLinePolicy and LineBandState. RUNTIME_VERSION 1712; the runtime-sources pin rewritten. Verified on the M3 Max under MoltenVK 1.4.2 through maclock with the validation layer: runtime_lane::line_widths, 4 tests pass. Default and exact policies each: 102 cases, 100 matched pixel for pixel, 2 refused (the two fill-mode Lines cases at width 4, NotImplemented(WideLines)), 0 announced; 46 draws took the band, 0 the device's lines (MoltenVK has no wideLines). a_band_needs_tessellation (tessellationShader withheld: width 0 refused needing it, width 2 refused, width 1 matches) and the_lane_s_maps_tell_the_widths_apart pass. Negative control: the band widened by 1/16 of a pixel fails both runs at LANE lines 0.5. Also cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; nextest of metal2vulkan, -air, -runtime and -devtools (4954 run, the one failure the missing lane site, now declared), of metal2vulkan-validation (the failures the profile rules, chains and pin fixed here, rerun green) and of metal2vulkan-conformance (1007 pass). Not run: lavapipe, RADV, ANV and NVIDIA lanes, which take the device route. (Carried to development from steelbrain/reims-graphics-kext b16d03150c.) |
||
|
|
245b51ef7a |
Read NVIDIA's 10-bit two-plane codes through Metal's arithmetic, and judge the YCbCr lanes by the device's bounds
On the RTX 5080 Laptop GPU (NVIDIA 615.71.09, Linux), development failed 27 of the YCbCr validation tests (runtime_lane::ycbcr_textures 22, ycbcr_minify 2, ycbcr_in_place 2, dma_buf_imports' YCbCr test). Bisect on the 5080, each step built on its own, with the filters test(/runtime_lane::ycbcr/) | test(/dma_buf_imports::a_ycbcr/): - |
||
|
|
3fd1f6672b |
Cut copied host buffers' CPU sync: page-at-a-time compare, log-gated copy in, merge only what may be written
The consumer's 4K boot on the RTX 5080 at the stock vm.max_map_count was unusable past its import gate: about 680 MiB of live copies (2,934 made) were compared whole at every commit and every completion, costing about half a core on both sides. Until the GPU copy is wired, three exact cuts, plus the dirty-log reports change 1 needs (the consumer's audit, A to C). - Change 3, a page-at-a-time compare (copied.rs sync): each 4 KiB page is compared whole (slice equality, vectorized), and the byte-exact merge runs only inside a page that differs. Same bytes as before; unit-tested against the old routine on random data, both sides changed included. - A, the copies' merge-back is reported: each copy keeps its pages' DirtySource and a writer id. sync collects the runs it wrote, and merge_back reports them with wrote_as before the completion is visible. Bytes a read-only copy drops are not reported. - B, the runtime's own CPU writes into logged pages are reported: replaceRegion into a heap's shadow texture (texture/heap.rs), the argument encoder and copyParameterDataToBuffer, as buffer_texture.rs already did. - C, GPU writes into logged pages imported in place are reported: each command buffer's written uses over memory with a dirty source, as writer 0 (the consumer's own writes, which every copy counts). They are reported at commit, before signals in the completion turn, and at completion, minus the shadows' own copy-backs. Collection is on while copies or such imports are live. Past the use cap, each written import is reported whole. A texture's use is reported as its whole buffer or heap (correct, coarse). This also closes the texture-shadow gap for pages reached through two imports. - Change 1, the log gates the copy in: where a copy's pages have a log (HostRam::with_dirty_pages, or the object's HostMemory::with_dirty_pages), a commit compares only the pages the log reports written since the copy last agreed. It uses one stamp per log and commit for every copy, waited for as the shadows' gated copy-in waits (DirtyPages::wait). A false wait, a copy's first copy in, bytes no log covers, and a copy that merged back 1 MiB or more since its last copy in compare everything. The copy in now runs before the commit's second state-lock block, since it may wait up to the log's bound. - Change 2, merge-back skips copies no finished batch may have written. Its "may write" is the bindings' write answers plus unnamed reach: a command buffer with a function that reads addresses (a root table), or one that executes an indirect command buffer, counts every copy as written. WorkCounts (new): copied_copy_in_bytes_skipped, copied_merges_compared, copied_merges_skipped. RUNTIME_VERSION 1705. Docs: copied.rs (Cost, Coherence), dirty_pages.rs' trait doc (what the runtime reports), FAST-PATHS (copied-host-pages known gap; the shadow gap closed), HOWTO copied host buffers. Measured, release, 680 MiB of live copies (2,049), median of 7, copy in / merge back in ms: - RTX 5080 laptop host (Core Ultra 9 275HX): - nothing changed: 231.8 / 231.6 before; 0.16 / 0.00 with all three; - 1% of pages changed: 233.7 / 233.8 before; 3.43 / 33.0; - one copy redrawn: 254.6 / 261.6 before; 29.4 / 34.1. - M3 Max: - nothing changed: 314.5 / 314.0 before; 0.12 / 0.00; - 1% of pages changed: 321.4 / 321.4 before; 4.54 / 18.5; - one copy redrawn: 353.9 / 395.4 before; 39.4 / 54.9. The merge-back figures are with the batch naming what it writes. A real frame's skip rate was not measured; the new counters show it. Verified: - M3 Max, MoltenVK 1.4.2, --cfg m2v_gpu, under memcap and maclock: the runtime lib suite passes 1445, 2 skipped. - RTX 5080 Laptop, NVIDIA 615.71.09, one 42 s hold: copied|dirty_pages| host_ram|event 101 pass. - New tests: 6 plain gating and merge-skip tests; a contract test that a concurrent CPU write survives both ways, log on and off; 7 device tests of the B and C reports, the gated copy, a read-only batch skipped, and an unnamed write still merged back. - Negative controls, each shown failing then passing once restored: gate forced off; A's report removed; C's registration or completion reports removed; the shadows' copy-backs not subtracted; B's heap report removed; merge skip forced off; unnamed reach ignored. - clippy plain and --cfg m2v_gpu (Mac, and msi niced), rustdoc -D warnings, api_signatures, api_surface, fast_paths. Lane commits: ws/cpusync-lane (180fc103c1 .. 59d82299ad, 9 commits). One work packet, landed as 2 commits on archive/development-linear-2026-10-29: bb00ae47f6, then 2b8ad3ab58 (the re-pin). |
||
|
|
97116bb420 |
Keep pages the kernel cannot pin from NVIDIA's driver, and copy them as a failed import is copied
On NVIDIA's driver (615.71.09, RTX 5080 Laptop), a failed host-pointer
import of pages the kernel cannot pin breaks the process's later
host-visible allocations. The consumer's device-creation probe hit this, so
no guest RAM chunk imported afterwards. The runtime now asks the kernel
first on that driver, refuses such pages itself with the answer Vulkan
requires, and never hands them to the driver. The object then goes its
other ways: the dma-buf source, else a copy.
Cause, measured on msi's 5080 through runtime device tests that logged each
call's VkResult and errno, the fd table and the process's maps:
- The consumer's probe makes no dma-buf import on NVIDIA. Its 1025-page view
is past udmabuf's list_limit, so its source refuses. What fails is the
runtime's import of the view's pointer, a VM_PFNMAP mapping of a udmabuf:
vkGetMemoryHostPointerPropertiesEXT succeeds (types 2 and 3), then
vkAllocateMemory answers ERROR_OUT_OF_DEVICE_MEMORY on both.
- After that, vkAllocateMemory answers ERROR_OUT_OF_DEVICE_MEMORY to every
host-pointer import measured:
- memfd pages from 8 KiB to 8 MiB at any offset;
- anonymous pages;
- RAM 512 MiB away;
- 40 retries over 3 s;
- a second VkDevice.
It also fails a plain 64 KiB host-visible allocation. Device-local
allocations still work. The chunk import fails in vkAllocateMemory, not
in the properties query or the requirements check.
- Not the cause: a failed udmabuf import itself (the next 8 chunk imports
bind, and NVIDIA closes the handed clone: F_GETFD EBADF), the properties
query alone, mapping a udmabuf, address reuse, the fd table, VmPin/VmLck,
the kernel log.
Vulkan (vkspec 1.4.366, 11.2.6): such a restriction "must fail the memory
import operation with the error code VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR";
and (Return Codes) "VK_ERROR_OUT_OF_*_MEMORY errors do not modify any
currently existing Vulkan objects."
Fix:
- RuntimeDriverDefect::UnpinnablePagesBreakHostMemory (NVIDIA_PROPRIETARY,
no GPU probed clean, per the defect table's rule).
- On such a device, Device::refuse_unpinnable runs before a no-copy
object's, heap's or rebind's own import and before a guest RAM chunk's
import. It walks the mappings over the pages (PROCMAP_QUERY, or the maps
lines before Linux 6.11) and reads one byte of each through
process_vm_readv. The kernel refuses a whole VM_IO/VM_PFNMAP mapping, so
one read per mapping answers for all its pages.
- Pages it cannot pin get its own Unsupported/HostMemory refusal naming the
defect. That refusal sends the object to the dma-buf source; with none,
or where the source's import fails, the object is a copy, announced as
copied-host-pages and counted as a failed import. This holds for buffers,
heaps and rebinds. A RAM chunk over such pages is not imported, and the
objects over it end in the copy. Pages not mapped readable keep their
refusal. The new refusal reaches a caller only where pages remapped after
their first import are imported again (docs/REFUSALS.md regenerated).
- Counted: WorkCounts::host_imports_unpinnable.
- Every other driver, and every OS but Linux, asks nothing and keeps its
path.
- Docs: driver_defects.rs (the measurement), FAST-PATHS known gaps, HOWTO
section 6 and its copy causes, the runtime README, copied.rs,
CopiedHostPages and its API.md entry.
- RUNTIME_VERSION 1704.
Verified:
- RTX 5080 Laptop, NVIDIA 615.71.09, --cfg m2v_gpu: the runtime filter
host_ram_device|copied_device|rebind|dma_buf|host_residency|
driver_defects|host_memory|host_import|copied passes 97/97 on the
committed tree.
- New: a_chunk_is_imported_after_a_refused_import_of_a_dma_buf_mapping
failed without the fix ((0, 0) where (1, 2) is expected) and passes
with it.
- New: pages_refused_before_the_driver_with_no_source_are_copied: a
buffer, a heap and a rebind over a udmabuf mapping with no gate and no
source give 3 refusals before the driver and 3 copies. The GPU reads
the right bytes, and a chunk then imports with 2 buffers bound.
- The consumer's repro, with its device probe in front
(os::linux::host_ram::tests::a_buffer_over_one_run_of_the_ram_is_bound_in_its_chunk,
built from a read-only copy of their 2cb3c8f91): passes. It fails against
development 2e2e238346.
- M3 Max, MoltenVK 1.4.2: the same filter 83/83; runtime unit tests 1161;
API, refusal-surface and fast-paths tests 34; rustdoc -D warnings clean.
Clippy -D warnings is clean on the Mac (plain and --cfg m2v_gpu) and on
msi (plain and --cfg m2v_gpu).
Left: RADV and ANV refuse such pages themselves, so an object there with no
source is still refused (not run there). A failed chunk import is not kept,
so the kernel is asked again for each object over that chunk (cost not
measured).
Lane commits: ws/chunkfix-lane (a2420020ea, a56fa43f2b).
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: a0a1ea79d4, then 22fa5003db (the re-pin).
|
||
|
|
44eaa09898 |
Copies of read-only pages drop the GPU's writes; the gate is asked before write permission
The consumer's 4K boot on the RTX 5080 (NVIDIA 615.71.09) died at a buffer rebind onto 12 KiB of
read-only pages (`replaceBackingWithRanges:readOnly:`) with `OutOfMemory(Device)`, its gate having
refused the pages.
Cause: on Linux the runtime asked the pages' write permission before the caller's gate. Read-only
pages with a dma-buf source were sent to the source (by_pointer cleared), and the gate, asked only
for pages imported by pointer, was skipped. NVIDIA 615's import of the source's dma-bufs fails with
VK_ERROR_OUT_OF_DEVICE_MEMORY, and that failure was answered as the call's error, where a failed
pointer import takes the copy. The copy path itself never ran. Reproduced on the 5080: a buffer's
rebind, a heap's rebind and a no-copy buffer over read-only pages under a refusing gate each
answered OutOfMemory(Device). On macOS the gate was asked and the copy made, and the copy's
merge-back then wrote the read-only pages: SIGBUS in all three.
Fix:
- The gate is asked before the write permission, at a no-copy buffer's or heap's making and at a
rebind. Pages it refuses, and bytes moved in their page, are a copy, their permission unasked;
only pages imported have it asked.
- An admitted import of the caller's dma-bufs that fails (out of memory, another Vulkan error)
takes the copy too, as the pointer's import did: the gate's documented contract.
- A copy of pages the process cannot write drops the GPU's writes (copied.rs), as Metal drops them
for read-only memory (read_only_view.rs). The copy asks the system as it is made
(`mapped_writable`: PROCMAP_QUERY on Linux, mach_vm_region on macOS). At each completion, every
byte the GPU changed in the copy takes back the byte the pages and the copy last agreed on, and
nothing is written to the pages. Later commands of the same batch read the write back; a later
command buffer reads the pages' bytes. CPU writes through another mapping are copied in at each
commit as before.
- The copied-host-pages detail says so; read-only-pages-written is not announced over a copy.
Changes beyond the consumer's case: gate-refused pages and moved-bytes copies no longer ask the
kernel for write permission (no host_mappings_queried for them). Read-only pages with no source
under a refusing gate are a copy instead of Unsupported.
WorkCounts::copied_dropped_bytes (new). RUNTIME_VERSION 1703. api_signatures.tsv blessed;
REFUSALS.md regenerated, unchanged. Docs: HOWTO (copied host buffers), API.md (copied-host-pages,
read-only-pages-written), FAST-PATHS (the read-only-memory known gap now excepts copies),
ImportGate, HostMemory::new, new_buffer_with_bytes_no_copy, Buffer::rebind_bytes_no_copy, the two
Degradation declarations, copied.rs module docs.
Tests:
- Device, copied_device:
- a no-copy buffer, a buffer's rebind and a heap's rebind over read-only pages under a refusing
gate, the consumer's form: a read-only shared mapping, a dma-buf source on Linux;
- checked in each: the gate asked once with the pages, the source never called, a copy that
reads the bytes and a CPU write through the writable mapping;
- a blit fill completes with the pages unchanged, nothing merged back, copied_dropped_bytes the
fill's changed bytes, and a later command buffer reading the pages' bytes;
- Linux: the rebind under an admitting gate whose dma-buf import fails is a degraded copy that
drops the writes.
- Unit: restore, merge_back of an unwritable copy, mapped_writable (Linux and macOS).
- Negative controls:
- the three refusing-gate tests on the unfixed runtime: RTX 5080 3/3 fail with
OutOfMemory(Device) at the call; M3 Max 3/3 die with SIGBUS;
- the admitted test with only the source-failure copy arm removed: the 5080 fails with
OutOfMemory(Device).
Verified:
- RTX 5080 Laptop, NVIDIA 615.71.09 (msi; four holds, each under a minute): runtime
copied_device|rebind|host_ram_device|tests::copied::|can_be_written 52/52 at the final tree. The
admitted test's copy path ran (its line printed).
- M3 Max, MoltenVK 1.4.2, --cfg m2v_gpu under maclock and memcap: the same filter 49/49 (the
admitted test is Linux-only).
- Mac: degradation_catalogue, copied and host_memory unit tests with api_surface and
published_crates 37/37; api_signatures and fast_paths 16/16; clippy --workspace --all-targets
--all-features, plain and --cfg m2v_gpu, clean; rustdoc -D warnings for the runtime clean.
- msi: clippy -p metal2vulkan-runtime --all-targets --all-features --cfg m2v_gpu clean.
- Not run: the validation suites. The runtime-sources pin is left for landing.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 5012056c31, then 6385d650b9 (the re-pin).
|
||
|
|
c0617d796e |
Rebinds take the copy where the gate refuses: heaps, images in place, moved bytes, one-run chunks
The NVIDIA RAM route's rebind part, with RunResolver's doc saying a rebind asks it. One work packet, landed as 4 commits on archive/development-linear-2026-10-29, in order: * Rebinds take the copy where the gate refuses: heaps, images in place, moved bytes, one-run chunks (c0e37e8984) The NVIDIA RAM route's rebind part (consumer spec, part 4). A buffer's rebind with an image in place over it, and a heap's rebind, now take the copy of the new pages (copied_pages) where the caller's gate refuses their import or the admitted import fails, instead of refusing NotImplemented(RebindTextures) or failing the call. Heap rebinds ask the gate like any import. A buffer's rebind to bytes at another offset in their page, under a texture planned at the old offset, takes a copy laid out at the old offset (the gate unasked: nothing is imported) instead of refusing. - The copy's memory, where images will bind in it, holds the window's whole pages from a multiple of the import's unit. The heap's textures bound to its bytes and the images in place over the buffer are made again over the copy: in memory the device allocates, as linear images that start PREINITIALIZED, whose first move keeps the copy's bytes (Vulkan: "the transition away from this layout will preserve that data"). - Where images in place ride on the copy, it lies in fresh pages the runtime maps and imports by pointer (Device::fresh_page_buffer), and each image is made as over the caller's pages for host allocations, under the device's in-place check for fresh pages (PagesClass::Fresh, else RebindTextures). On the RTX 5080 the driver's own linear image does not lie at Metal's 256-byte pitch, so the first form still refused there. - The run resolver at rebind (ram1's route_runs and bind_in_chunk): asked once with the new window, on the calling thread with no runtime lock held, before the gate. One run inside one chunk binds in the chunk's import (no import, no gate); any other answer takes the gate, then the import or the copy. The runs are kept with the new pages, copies included; bytes moved in their page are never chunk-bound. - Metal's rebind order is unchanged: the pending check runs before the gate, and committed-not-submitted command buffers are encoded again over the copy. - RebindTextures stays, for a device that makes no image over the copy at the texels' pitch, memory type or alignment, and for drops-writes buffers (option bit 24) whose bytes moved. WorkCounts (new): copied_rebind_pages_moved (a third cause within copied_host_buffers_made) and copied_rebind_images_made. No new Error variant. heap_raw_image takes (memory, at) and a memory-type check. RUNTIME_VERSION 1702. Docs: HOWTO copied host buffers and guest RAM, API.md copied-host-pages, FAST-PATHS (the heap and in-place rebind exception removed from the known gap), the runtime README, ImportGate, HostMemory::with_runs and with_import_gate, rebind.rs, copied.rs module docs, RebindTextures; REFUSALS.md and api_signatures.tsv regenerated. Verified: - RTX 5080 Laptop, NVIDIA 615.71.09 (msi, one hold): runtime copied_device|host_ram_device|rebind|in_place 48/48; the image over the copy is made (copied_rebind_images_made asserted 1) in the gate-refused, moved and ordering tests. Validation rebinds|dma_buf_imports 28/30: the two failures (ycbcr planes over chunks "off the grid", dma-buf in place "one run") also fail at development 2cfd8d6ef9 on the same GPU. - M3 Max, MoltenVK 1.4.2, --cfg m2v_gpu under maclock: runtime host-memory filter 157/157; validation rebinds|dma_buf|copied|no_copy|host_memory 75/75; at the final tip copied_device|host_ram_device|rebind 40/40. Here textures over buffers are shadows, so only the heap image over the copy runs (1 per heap test). - 7 new device tests: gate-refused buffer rebind with a texture over it, moved bytes, heap rebind gate-refused and import-failed, ordering with a held and an uncommitted command buffer, resolver at rebind (one run binds in the chunk; two runs go gate then copy). - Focused non-device tests 76/76; clippy plain and --cfg m2v_gpu clean; rustdoc -D warnings clean for the runtime. - Not covered by one venue: both images over a copy at once. Lane commits: ws/ram3-lane (d3945d0d9d, 7a114b599e, b93a6c1eac, 8b9fa5fb46). * Re-pin the runtime sources at the landing tip (7f76090454) * Say that a rebind asks the run resolver, as c0e37e8984 made it (8dcba47435) RunResolver's doc still said a rebind to new pages does not ask it. Since c0e37e8984 a buffer's or heap's rebind asks it once with the new window, before the gate, except where the bytes moved in their page under a texture, which take a copy without asking (with_runs' and Buffer::rebind_bytes_no_copy's docs already say so). Doc only. * Re-pin the runtime sources at the landing tip (17896b4366) |
||
|
|
7d1323ebcc |
Convert extended-range, padded and bfloat texels by the device's arithmetic
A read is float(c - 384) times the f32 nearest 1/510 (a padded code's float(c) times 1/1023), a write RoundEven(clamp(v)*510)+384 (padded *1023), an sRGB twin's colour the MSL transfer by the device's Pow on the magnitude, a half result the device's narrowing, a bfloat code its bit shift with NaNs as computed. Metal's correctly rounded quotients, exact-product rounding, ties-away half rounding and its extended/padded sRGB tables leave the shader path: extended_range/table.rs, R10X6_SRGB_DECODE_STEPS, round_exact_product(_lanes) and the plan's table fields are deleted. Each such module records DevicePackConversion; FAST-PATHS' air.pack row and API.md's catalogue state the bounds (one f32 ulp, one code, half a 2^-13 sRGB step, R10X6_SRGB 1.64 steps). The host-side clear_texel and the bicubic code still read extended_srgb.rs's tables, so on an sRGB twin a clear and a shader write can differ by one code. Verified: 331 touched lib tests; clippy plain and m2v_gpu; rustdoc; conformance ledger tests; M3 replay of 89 extended-range cases (exit 0, 276 ledger rows, +254/-57 against development); validation heap_extended on the M3 (6/6); the new tests fail with FDiv decode. Golden: 346 cells in 20 heap/argument-buffer subjects move (blessed on development). Translation words of an sRGB twin's read 4433 -> 588, write 5540 -> 632. One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 8acec5a4a2, then 96d8394995 (the re-pin). |
||
|
|
76d89d87a8 |
See an event signal behind a copied host buffer at its completion turn
An event signal behind a copied host buffer is seen at the batch's completion turn, and the
copied host pages' cost is announced as the catalogue states it.
One work packet, landed as 4 commits on archive/development-linear-2026-10-29, in order:
* See an event signal behind a copied host buffer at its completion turn (8fc9c56dcb)
A batch's event signal is its GPU signal of the event's timeline semaphore,
and the host read the semaphore's counter directly (`EventShared::value`),
while a copied host buffer's GPU writes reach the caller's pages only at the
batch's completion turn (`completion.rs`, merge then `reached`). So a CPU
that saw the value could read the pages before the GPU's writes, and a plain
event's wait chained on the VkQueue let another queue's work start before
them: Metal's writes before a signal are in the pages once its value is
seen (the documented gap in FAST-PATHS, now closed).
A signal kept while the device holds a live copy is marked behind the merge
(`EventTimeline::keep`). No counter read observes it or any signal after it,
and no wait is handed its index (the scheduler's own host wait included); a
plain event's wait for it is held as a shared event's is. The completion
turn, which merges first, observes it and wakes every host wait and held
batch. The signal stays the batch's GPU signal: no submission is added. The
cost per such signal: its value reaches readers one completion turn later
than the counter shows it, and a GPU wait for it is a host hold plus a
vkQueueSubmit at that turn. Counted: WorkCounts::event_signals_behind_merge.
The same mechanism will hold for the GPU-kept copies.
RUNTIME_VERSION 1699 (renumbered at landing).
Verified on the M3 Max (MoltenVK), --cfg m2v_gpu, under memcap and maclock:
57 copied, event, scheduler and fast-path tests pass, among them the new
a_shared_event_s_value_is_seen_once_the_copy_s_bytes_are_in_the_pages
(six rounds, spin reads and host waits, a 64 MiB copy beside to lengthen
the merge) and the timeline unit test
a_signal_behind_a_merge_is_seen_at_its_completion_turn_alone. Negative
control: with the mark off, the device test fails on the byte check
("the write is in the pages once the value is seen"). clippy (plain and
--cfg m2v_gpu) on metal2vulkan and metal2vulkan-runtime, api_signatures
re-blessed (the new field), api_surface pass.
RUNTIME_VERSION 1700.
* Re-pin the runtime sources at the landing tip (2cef515da6)
* Announce the copied host pages' cost as the catalogue states it; list what pack.rs reaches (e9ba27478b) (its crates/metal2vulkan-runtime/src/degradation.rs part)
The final gate on 3e20b58763 failed two tests.
- degradation_catalogue: the signal-behind-merge fix (8fc9c56dcb) closed the
shared-event gap and rewrote the API.md entry for copied-host-pages, but the
runtime still announced "(behind a shared event's value among them)". The
announced cost now drops it, so the catalogue's entry starts with it word
for word again.
- the_runtime_sources_are_the_committed_ones: pack.rs became a runtime input
(the mipmap kernel's sRGB transfers), and it also reaches
metal2vulkan-air's intrinsics, lower/arith/math.rs and lower/arith/narrow.rs
through its pack and unpack intrinsics, which only the compile emits. They
are listed as not runtime with that reason. The stale comment about
srgb.rs's encode, tables and steps (deleted by the mipmap and n7 packets)
now says only what is true.
Verified: the two tests on the landed tip (see the landing).
* Re-pin the runtime sources at the landing tip (538f3f1161)
|
||
|
|
f4394b8712 |
Copy a no-copy buffer's pages the kernel cannot pin where the process maps them readable
Cause: a copied host buffer (the caller's gate refused the import, or the admitted import
failed) read its first bytes only through the kernel: `process_vm_readv` of our own pid on
Linux. That read pins each page, and no page of a VM_PFNMAP or VM_IO mapping can be pinned, so
on a dma-buf's mapping (udmabuf's on Linux 7.2) it fails although the pages are mapped
readable. `CopiedBuffers::add` then answered `NotCopied::Unreadable`, and the buffer, heap or
rebind was refused as not importable (`Unsupported { HostMemory, NotRepresentable }`): the copy
never worked for dma-buf mappings, which is where a consumer's gate refuses imports on NVIDIA
at the kernel's default vm.max_map_count.
Fix: where the kernel's read fails, the copy asks the process's mappings whether every page of
the range is mapped with read permission and, if so, reads it with plain loads, the access the
copy's comparisons already make at every commit and completion (`copied::read_caller`). The
mapping check generalizes the import's write check: `PROCMAP_QUERY` tests
`PROCMAP_QUERY_VMA_READABLE` as it tested `..._WRITABLE`, and before Linux 6.11 the
/proc/self/maps lines' `r` as their `w` (`host_memory::Access`, `queried_permitted`,
`permitted`, `mapped_readable`). Pages not mapped, or mapped without read permission, are still
refused. All three users of `add` (buffers, heaps' own buffers, rebinds) take it. Off Linux
nothing changes (no mapping is asked; macOS's mach_vm_read path as before). RUNTIME_VERSION
1696 -> 1697 (renumbered at landing). Docs: API.md's copied-host-pages entry, HOWTO's copied
host buffers, the runtime README, and FAST-PATHS' known gap with the measured cost.
Evidence (verified):
- msi (Linux 7.2.8, RTX 5080): tests::copied + tests::host_memory 21/21; the udmabuf test
printed "the kernel cannot read this udmabuf mapping: copied with plain loads".
Under the GPU lock on NVIDIA: tests::copied_device + tests::copied 15/15, among them the new
copied_buffer_is_made_over_a_dma_buf_mapping_the_gate_refuses (gate refusal -> copy made,
announced, CPU writes copied in and a fill merged back over the udmabuf pages).
- Negative control on msi: with the fallback disabled the two new copied tests and the new
device test FAIL (the device test at the buffer's refusal); restored, PASS.
- macOS (M3 Max, MoltenVK, under maclock): copied, copied_device, host_memory 25/25; plus
degradation, catalogue and fast_paths 45/45.
- clippy -D warnings clean: macOS plain and --cfg m2v_gpu; Linux (msi) plain and
--cfg m2v_gpu, runtime crate, all targets, all features. rustdoc -D warnings clean (runtime).
- Cost, release, msi: one add of a 64 MiB udmabuf range 15 ms (the failing kernel read 6 us,
the mapping query 22 us); each comparison of a 64 MiB copy 22-41 ms on the CPU; on NVIDIA a
live 64 MiB copy makes each empty command buffer's commit and wait 45-68 ms (0.2 ms without).
- Not run: the Mac's Linux container exposes no /dev/udmabuf.
RUNTIME_VERSION 1698 at landing.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 1612481fb3, then 95852120a3 (the re-pin).
|
||
|
|
63859d8cc1 |
Sum emulated filters' taps in the device's arithmetic
Rule 1: where the device has a native form it is the only form. The emulated filters reproduced Metal's datapath bit for bit: a 2^-16 Catmull-Rom weight table, two-word integer sums truncated onto grids and rounded half up, exact quotients, ties-away half rounding, a 12-bit sRGB grid snap, 64ths of a level and 256ths of a blend, and the anisotropic filter's piecewise log2 and chord exp2. All of it is gone. Bicubic (lower/sampler/bicubic.rs, bicubic/routines.rs): - One routine, `Plane::sum`: Catmull-Rom weights computed in f32 from the fraction (vec4 Horner), the sixteen taps summed by the device's multiply and add, rows then columns; Metal's bilinear rule (32-bit float formats, a level under four texels) is the device's FMix of the four inner taps already fetched; UNORM/SNORM clamps. - 1D: `Line::sum`, the device's FMix of its two taps. - An 8-bit sRGB twin's taps are the device's transfer, not the 1/4095 grid. A half result is the device's narrowing (`narrow::round`), not ties-away. - Kept: Metal's footprint, addressing, mirror pin, filter selection, `Quad::exact` (in-place YCbCr's filter, owner form H, not touched). - Deleted: the weight table routine, the exact/half/accumulated plane and row routines, the block and float-quad routines, their words and specials; metal::bicubic's test-only table and its test. Extended range (lower/sampler/extended.rs): - Linear, 3D and the linear mip filter's level blend decode their taps through xrconv's functions as they are, then FMix in f32 at the f32 fractions; the level weight is the f32 fraction, not 64ths; a half result is the device's narrowing. Bicubic clamps into the format's decoded endpoints. The in-place decode keeps `Quad::exact`. - Deleted: the step tables' callers (steps_of, step, level_taps, half_of) and, in xrconv's extended_range.rs and texel_round.rs, the helpers only they used (STEPS_WORDS, has_steps, steps, step_grids, ratio_by_255_to_f32, normal_half_bits; minimal edits in another lane's files). Anisotropic (lower/sampler/anisotropic.rs): - The device's Log2 and Exp2 replace Metal's piecewise log2, chord exp2 and truncations; the level and spacing are not rounded to 256ths, 4096ths or a 6-bit mantissa. - Each tap is one explicit-level sample: under a linear mip filter the fractional level, which the device's own linear mip filter blends. The two-samples-a-tap form existed because an RTX 3090's blend of a fractional level is not Metal's (1.03 codes off without anisotropy); under rule 1 that blend is the device's. A nearest mip filter's level stays whole (the 3090's anisotropic sampler blends the next level at a fractional level whatever its mipmap mode). - Kept: Metal's length, tap count thresholds, floor(256/n) weights, kappa fit and direction. Notes: PrecisionNote::BicubicFilterArithmetic is reused, broadened to the extended-range linear, 3D and level blends (select.rs records it); AnisotropicFilter's doc names the device's logarithm and blend. No new variant, no ARTIFACT_FORMAT_VERSION bump. FAST-PATHS: the two "not built yet / none known" bicubic rows are now one device-gap row (the device's sum is the form); the known-gaps bullet loses the sRGB grid snap. API.md's catalogue entries rewritten. SEMANTICS_VERSION 1922 -> 1923. Tests: the plane routine's interpreter differential against an f32 Catmull-Rom reference in the routine's order (fails on the old table and integer sum), the line routine's FMix, the routines' word bounds; engine_bicubic against the polynomial within 2^-18 (+ half ulp); extended-range engine tests compare within the filter's bound (`filtered_close`); xr_bicubic's `near` adds Metal's table's deviation from the polynomial (WEIGHTS_BOUND 2.1e-3); anisotropic and bias-reach tests count one sample a tap and two Exp2 per emulation. Lanes and the conformance suite: - runtime_lane::extended_range_samples compares linear samples within `xr_bicubic::filtered_close` (moved to devtools from the engine test, which re-exports it); two_plane_samples holds the digest of nearest cases only (a linear one's values are compared by the conformance suite's xr-two-plane-samples cases). - runtime_lane::anisotropic_filter's bounds re-measured on the M3 Max with samplerAnisotropy withheld: linear 10.375 codes max (mean 0.21), nearest mean 0.82 and 6.7% of channels a code or more off, clamp to edge 6.531 max. Other devices not measured. - conformance: the XR two-plane-samples and extended-range/padded extended-swizzles cases declare bicubic-filter-arithmetic; 32 known-gaps rows (Apple M3 Max) for the linear sites the device's FMix moves. - runtime-sources.sha256 re-pinned: metal/bicubic.rs lost its test-only table and docs; no run's behaviour depends on it. Verified (this M3 Max, macOS 27.0.1): metal2vulkan + devtools suites, 3302/3303 passed (golden_hashes_match_the_table fails: 1001 cells moved, not blessed). Module words of a bicubic sample (ANV Iris Xe profile): xr_bicubic xrb_edge 12990 -> 2093, a2_bicubic_weights 15731 -> 3858, bcx_rules 30727 -> 11388; anisotropic emulation (vk12-floor) 2705 -> 1884. Also in this packet: the padded 10-bit formats' linear samples join the known gaps (d326b293c0), and the conformance coverage document is regenerated for the filter rows. Anisotropic emulation (devices without samplerAnisotropy only) now takes the device's Log2/Exp2 and level blend, and Metal's spacing roundings (r' to 256ths, g*S to 4096ths, S to a 6-bit mantissa) are gone with them: on the M3 with samplerAnisotropy withheld, linear reads up to 10.4 codes from Metal (mean <= 0.21), bounded in runtime_lane/anisotropic_filter.rs. One work packet, landed as 2 commits on archive/development-linear-2026-10-29: abc366a2fa, then 8f506cb2fd (the re-pin). |
||
|
|
20287666c0 |
Blend extended-range attachments in the device's arithmetic; drop the 32-bit float Metal blend
Rule 1 (owner, 10-29): where the device has a native form, it is the only form.
An extended-range attachment's raw codes are something no blend unit reads, so the
shader still blends it (capability), inside the pixel interlock or over lavapipe's
input attachment. Its arithmetic used to be Metal's compiler's: lerps, common
factors, fusing by factor rank, half rounding at every step, a separate float4
model and computed-output tables. Now it is a blend unit's arithmetic: S*Fs op D*Fd
in float, in the order of the blend equation, with the source, second source and
blend color clamped to the form's range first (`extended_range::blend::native`).
- computed.rs is deleted. blend_color.rs keeps only the two source ranges.
- input_blend.rs and fetch.rs call native().
- The blend color is pushed as raw f32 bits (HalfBlendColor), so
PushField::BlendColor is gone.
- Every blended extended-range output that stores a channel now records
ExtendedRangeBlendSource (half) or ExtendedRangeFloatBlendSource (float).
- The refusals ConstantColorDifference, SrgbForm and FloatOutput are gone, as is
the fast-math DualSource refusal for extended range. Every factor, operation
and mask is built; only outputs other than four half or float lanes are
still refused (Output).
The 32-bit float storage-form blend (`Blend::float32`, `fetch::float32_blended`)
computed Metal's fused forms in float. Every committed profile except
roadmap-2022 and vk12-floor sets COLOR_ATTACHMENT_BLEND on R32/RG32/RGBA32_SFLOAT,
so that form copied Metal's bits where the device blends natively. It is removed:
- a fetched 32-bit float attachment takes the generic float blend
(UnmeasuredFetchBlend);
- one that is not fetched gets the device's blend after the pass splits.
The float4-output paths of the half/unorm8 model (Atom::Sf, Arith::Kept,
round_inner, Blend::float/narrow/takes_float) were dead after this and are pruned.
Removed:
- the Metal blend-table validation lane (extended_range_blend_table.rs)
- devtools xr_blends
- the xr_blend_table*.txt fixtures
- lower/arith/tests/blend32.rs
- the extended_range tests that pinned Metal's forms
Added:
- every_blend_is_the_devices_arithmetic: every form, 19 factors, 5 operations,
rotating masks and adversarial sources, bit-exact against a float model of
S*Fs op D*Fd
- every_blend_is_built_but_a_placeholder
Docs:
- FAST-PATHS: the "Metal's rounding per shape" fast row is removed. The
extended-range blend is now a device-gaps row with the two notes. The
32-bit float row and the interlock section are fixed.
- artifact.rs note docs and the API.md catalogue are rewritten.
- REFUSALS is regenerated, reach.tsv updated and api_signatures blessed
(removed ExtendedRangeBlend::{ConstantColorDifference, FloatOutput, SrgbForm},
PushField::BlendColor).
- Conformance: the two notes join replay::NATIVE_NOTES, and 16 Apple M3 Max
known-gaps rows hold the xr-blend add/premul sites the device's arithmetic
moves: one code, two at the sRGB premultiplied sites.
- SEMANTICS_VERSION 1923, ARTIFACT_FORMAT_VERSION 479.
Size: a premultiplied half4 fill into RGB10A8_2P_XR10 on moltenvk-m3 goes from
3275 to 1937 SPIR-V words (the blend itself from 2133 to 795). The float4 fill
goes from 3435 to 1951 words, and BGRA10_XR_sRGB premultiplied from 7992 to 6654.
Verified:
- metal2vulkan lib, touched modules: 511/511.
- Sabotage: rounding the source to half in native() fails
every_blend_is_the_devices_arithmetic; restored, it passes.
- clippy, plain and with --cfg m2v_gpu; rustdoc -D warnings.
- M3 Max conformance replay of 25 cases: half-output-blends-*,
blend-interaction-format-float32 and xr-blend-*-one-zero are justified; the 16
xr-blend add/premul sites are held by the new rows.
The replay exits 0 with the ledger held exactly. The conformance crate
passes 1007/1007, CONFORMANCE-COVERAGE is regenerated, and runtime
degradation/catalogue and api_signatures/api_surface/refusal_surface pass.
- M3 device tests (memcap + maclock, --cfg m2v_gpu): 11/11 of
runtime_lane::extended_range_blends and framebuffer_fetch::generic_blend.
The renamed blends_of_half_outputs_into_extended_range_texels asserts
Metal's bytes for one-zero and prints the 16 add/premul outputs the device's
arithmetic moves.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 808143ef80, then 18431ee908 (the re-pin).
|
||
|
|
442a9fd538 |
Bind no-copy objects over one run of guest RAM in the device's chunk import
The NVIDIA chunk route's API (HostRam, Device::use_host_ram, HostMemory::with_runs), the chunk
source and one-run route, and a chunk-bound buffer's out-of-bounds writes held to the device's
own containment (a device test and a known gap).
One work packet, landed as 7 commits on archive/development-linear-2026-10-29, in order:
* Add HostRam, Device::use_host_ram and HostMemory::with_runs (d3617f7e1d)
The API of the NVIDIA chunk route (guest RAM imported whole): the types the
chunk source, the GPU copy and the rebind lanes build on.
- HostRam (unsafe new(ranges, keep_alive)): the consumer's guest RAM ranges,
checked as non-empty, whole host pages, within the address space and apart;
a typed refusal otherwise (Invalid, Problem::HostRam). with_dirty_pages
takes one DirtyPages log for the whole RAM whose offsets are host addresses
(the log's pointer is 0), so one stamp per commit can serve every copy. The
keep-alive is dropped with the HostRam (forgotten while the process exits).
- Device::use_host_ram(&Arc<HostRam>) -> HostRamUse: a guard, since runtime
devices live for the process while a lease promises its RAM for one guest
device's life. Dropping the guard ends the use; a later RAM may be used
after. Several RAMs whose ranges are apart may be used at once; one whose
ranges meet a used RAM's (itself among them) is refused as misuse
(Invalid, Problem::HostRam). A device without VK_EXT_external_memory_host
is refused (Unsupported, naming it).
- HostMemory::with_runs(RunResolver): RunResolver is
Arc<dyn Fn(start, len) -> Option<Vec<Range<u64>>> + Send + Sync>, asked with
the import window, answering host addresses in the RAM's ranges. Stored
here; the routing that calls it comes in a later commit.
No Metal counterpart for any of it; the doc comments say so. The chunk import
itself (lazy 64 MiB chunks) and the routing in buffer_over_host_memory follow.
Verified: cargo clippy -p metal2vulkan-runtime --all-targets --all-features
-D warnings (Mac); host_ram unit tests 4/4 (range checks, refusals,
keep-alive drop); api_signatures and refusal_surface 7/7 after the re-bless
and regeneration; rustdoc -D warnings for the runtime crate.
* Re-pin the runtime sources at the landing tip (22c47609a9)
* Bind no-copy objects over one run of guest RAM in the device's chunk import (7f07d19b3d)
What: the chunk source and the one-run route (host_ram.rs).
- Chunk source: a device that uses a HostRam imports it by host pointer in
64 MiB chunks (CHUNK_BYTES), never across a range's end, lazily. Each chunk
is imported the first time an object over it is made, on that thread, once,
under a lock of its own (ChunkSlot). It goes through the existing
Memory::import_host: a coherent type, and the device-address flag where
bufferDeviceAddress is on. A whole-chunk VkBuffer is kept for the runtime's
own copies only, never named by a Metal buffer, root entry or binding.
- Chunk lifetime: chunks are never released while idle (they are no
HostImport, so host_residency never sees them). Once the HostRamUse is
dropped, a chunk is freed when nothing holds it: Placement gains ram_chunk,
so every buffer bound in a chunk holds it, and every command buffer that
used one does too. The RAM, and so its keep-alive, goes after the free
(release_then's after), dropped as the program's. Exiting leaves it all to
the process's end.
- Routing in buffer_over_host_memory: a buffer that lies in a live import of
the same bytes is unchanged. Otherwise, where the device uses a RAM and the
memory has a resolver, the resolver is asked once with the import window, on
the calling thread with no lock held, before the writability query and the
gate. Memory whose GPU writes bit 24 drops is never routed.
- One run inside one chunk: Device::bind_in_chunk makes the VkBuffer with
host_buffer against the object's own window, checks it with binds_in
against that window, and binds it at run offset + binds_in offset in the
chunk's memory. That offset must be a multiple of the buffer's alignment,
and the buffer must allow the chunk's memory type. Its placement
(Placement::ram_chunk) holds the chunk and maps the caller's pointer, so
contents stays the pointer. The buffer gets no import of its own, the gate
is not asked, and buffer_of keeps the import fixed (no Again).
- Several runs, a run crossing a chunk's end, a chunk that cannot be imported
or a buffer that cannot bind exactly: today's gate path (import, or copy
where the gate refuses).
- The RAM and runs are kept on HostPages (ram_runs) until rebind or release,
for the GPU copy lane.
- An answer that is not whole pages of one used RAM totalling the window is
refused: Invalid, Problem::HostRam.
- Heaps over host memory take the same routing (of_heap goes through
buffer_over_host_memory).
- rebind_host_pages only ignores the new HostParts.runs (`runs: _`). The
rebind lane asks the resolver there with Device::route_runs and
bind_in_chunk.
- New WorkCounts: host_ram_chunks_imported, host_ram_chunk_bytes,
host_ram_chunks_live (a gauge), chunk_bound_buffers_made.
- Docs: HOWTO "Guest RAM imported whole", the runtime README's extension list.
RUNTIME_VERSION 1697 -> 1698.
Why: the NVIDIA route (the consumer's spec). On a device that refuses
dma-buf views, each import of scattered guest pages takes a kernel mapping per
page, past vm.max_map_count at 4K. One-run objects bound in chunks take none.
How verified (this Mac, M3 Max, MoltenVK, under memcap + maclock):
- host_ram unit tests 8/8: chunk spans and lookup; one run in a chunk, a
chunk's last pages and a range's short last chunk; several runs and a run
crossing a chunk (gate path); broken answers refused.
- New device tests tests::host_ram_device 6/6. The path ran: the log prints
"chunks imported 1, chunk-bound buffers 2".
- One run binds in the chunk: 1 chunk import of 64 MiB, 0 pointer imports,
gate not asked, contents == pointer, the GPU reads the bytes, a fill
reaches them, a second buffer in the chunk imports nothing.
- Containment: a 1.5-page buffer's copy reach <= its 2-page window, and a
fill of all of it leaves the sentinel page before and the bytes after it
unchanged.
- A no-copy heap binds in the chunk.
- None, two runs and a crossing run ask the gate once and import; short and
outside answers are refused.
- A command buffer held behind an event keeps the chunk (live gauge, and
the keep-alive not dropped) after the buffer, the use and the RAM are let
go of; once it completes the chunk is freed and the keep-alive dropped.
- The same RAM twice and an overlapping RAM are refused, a RAM apart is
taken, and a new RAM over the same ranges is taken after the first use
and imports again.
- Regression on the same Mac: 249/249 for
host_|copied|dirty|rebind|heap|no_copy|dma_buf|in_place|detach|alias|
degradation|profile (copied_device, dirty_pages_device and the
host-import tests among them).
- clippy -D warnings plain and --cfg m2v_gpu (runtime, all targets, all
features); rustdoc -D warnings for the runtime; api_signatures 3/3 after
the re-bless.
Not run here: NVIDIA (msi 5080) and lavapipe; dma-buf devices' own tests
beyond the Mac's.
RUNTIME_VERSION 1699 at landing.
* Re-derive the generated documents at the landing tip (a9c042f142)
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.
Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
* Re-pin the runtime sources at the landing tip (2cfd8d6ef9)
* Hold a chunk-bound buffer's out-of-bounds kernel writes to the device's own containment (1b09d84fad)
What: a device test (tests::host_ram_device) whose kernel, the owned fixture's
scale_and_offset, writes three pages of words through a one-page buffer bound
in a chunk of guest RAM. It asserts that the page before the buffer and the
pages after it keep a sentinel, and that the kernel wrote the buffer itself.
The page-after assertion applies wherever the device keeps the same write,
through a one-page buffer of its own, out of the buffer made after it: the
chunk binding is held to the device's own containment, measured in the same
test. A known gap in docs/FAST-PATHS.md records the device that does not
contain such writes.
Why: containment (c) of the route. A chunk-bound VkBuffer ends at the
object's last page, but the chunk's memory goes on past it, so containment
rests on the device's buffer robustness or in-shader checks, not on the
import's end as a per-object import does.
Found and how verified:
- RTX 5080 laptop (NVIDIA 615.71.09), msi, one hold 06:00-06:02, strict form
(no device check): host_ram_device 7/7. The chunk's pages after the buffer
were untouched.
- lavapipe (linux-gate, slot lava, arm64), strict form: 7/7.
- M3 Max (MoltenVK 1.4.2), this form: 15/15 host_ram tests. It prints that
out-of-bounds writes changed 32720 bytes of the device's own next buffer and
32720 bytes of the chunk's next pages. A control run (not committed) showed
that a no-copy pointer import of one page changed 0 bytes past its page. So
MoltenVK's gap is within an allocation; it predates the route, which
inherits it.
- clippy --cfg m2v_gpu -D warnings (runtime, all targets).
Also: the RunResolver doc no longer says rebinds ask it; they do not until rebinds are routed (af9f1e057d).
* Re-pin the runtime sources at the landing tip (60c300198f)
|
||
|
|
9bd91540f4 |
Take the device's answers for fast atan2, half fmod and precise pow's NaN; delete exact sRGB leftovers
- fast::atan2 without every fast-math flag divides by the device's own
reciprocal of x; past 2^126 the denormal it makes is the device's
(DeviceDenormals through MetalFloatDenormals; NativeDivision as before).
FastAtan2 { reciprocal_flushed } -> FastAtan2 { by_reciprocal }.
- A half fmod answers its float remainder rounded; the Metal zero-sign
select is gone and the call records NativeTranscendentals through
FloatFn::half_zero_of_float.
- Precise pow's NaN is classed BaseToExponentOne, so it records
NativeNanEncoding like fast pow and atan2 (the measured() exclusion
was left over from the removed pow(x,1) bit fix). Fast sin/cos keep
DeviceNanEncoding on purpose: Metal answers +0 there, no NaN to stand for.
- Delete the exact sRGB pack/unpack's dead code: ArithPlan::srgb,
Declared::srgb, SRGB_PACK/SRGB_UNPACK, srgb::TABLE_WORDS,
math::unpack's normalized and sRGB branches (UnpackRounding,
unpack_rounding, mul_exact, unpackable), word::srgb_code.
WordAttachment::output_word returns Option<u32> (None for Srgb8).
With the mipmap filter on the transfer (c9dd35e8a4), srgb's declare/
word/step and SRGB_ENCODE_FIRST lost their last users and go too, with
their texel_round test; SRGB_DECODE_STEPS stays for the ASTC and PVRTC
decoders.
- FAST-PATHS: row 58 names half fmod; known gaps lose the atan2 and
half-fmod lines. API.md: native-transcendentals, native-nan-encoding.
- SEMANTICS_VERSION + 1.
Verified: fmt, clippy (all features, m2v_gpu), rustdoc; metal2vulkan
arith/word/fast_paths 241/241, engine call notes + public fixture
expectations 20/20, api_signatures+api_surface 15/15, runtime 29/29,
validation c3 72/72; the atan2 tests FAIL on the old flushed reciprocal.
No conformance case reaches atan2, fmod or pow. Golden hashes: 21 rows x
19 profiles move (fast_atan2.f32 and fmod.f16 fixtures), re-blessed on
development.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: abb2b3db6e, then f76cdba457 (the re-pin).
|
||
|
|
67a1651f35 |
Filter mipmaps by the device's arithmetic, not Metal's tables
The mipmap compute filter takes the device's arithmetic (pack.rs's sRGB transfer and half conversions), and the validation guard lists the translator files it now reaches. One work packet, landed as 5 commits on archive/development-linear-2026-10-29, in order: * Filter mipmaps by the device's arithmetic, not Metal's tables (c9dd35e8a4) Rule 1: the mipmap compute filter (extended-range formats, 8-bit sRGB textures held as their UNORM twins, formats without blits or linear filtering) reproduced Metal's bits inside a capability path. Its arithmetic is now the device's: an 8-bit sRGB code decodes as c/255 through the MSL transfer by the device's division and Pow and encodes by the transfer then RoundEven(t*255) (pack's srgb_decode/srgb_encode, as the twin's shader reads do since c70ec588c4); an extended-range sRGB code takes the same transfer on its magnitude; a half takes UnpackHalf2x16/PackHalf2x16; a float's NaN is the device's; the products and sums lose NoContraction. The twelve-bit and 8192-step tables, the k/4095 step, srgb::search and the integer half rounding are gone (RG11B10Float's encode and RGB9E5's conversion stay: no device instruction gives them). cpu.rs is the bounded model: MipmapFilterChain::expected_levels is the chain in IEEE f32, and the new MipmapFilterChain::outside_bound lists a device level's texels outside 2^-17 of the terms' magnitudes (+2^-140) of the filter of the level above as the device wrote it: a code at a rounding boundary, an sRGB transfer within 2^-17 + 2^-20, one RGB9E5 mantissa step, any NaN. The interpreter models GLSL Pow as the f64 power rounded once. Announced as before by DeviceFilteredMipmaps; its docs, API.md's entry and FAST-PATHS say the filter is the device's arithmetic. No version moves: the owned kernel is built in-process and the driver cache keys on its words. Verified: 475 touched and contract tests; the bind::mipmap_filter interpreter tests FAIL with the old table decode restored and pass with the change; clippy plain and --cfg m2v_gpu; rustdoc. Apple M3 Max: mipmap_chains 4/5 (5 formats within the bound, 8 texels off the IEEE model; the 3D blit chain is the MoltenVK failure that predates this), runtime mipmap tests 13/13, conformance blit-generated-mipmaps announced and justified. lavapipe: mipmap_chains 5/5, 9 formats through the filter including both sRGB twins, RG11B10Float and RGB9E5Float. * Re-pin the runtime sources at the landing tip (187fa18b3d) * List air.pack's lowering among the runtime sources the validation guard hashes (4020aeecc9) The mipmap filter's owned kernel (bind/mipmap_filter/kernel.rs) takes its sRGB transfer and half conversions from lower/arith/pack.rs since c9dd35e8a4, so the runtime's inputs reach pack.rs, and the guard (candidate::engine::artifact::tests::the_runtime_sources_are_the_committed_ones) failed on development's gate at 4052e2209c: "the runtime inputs reach files that are neither inputs nor listed: lower/arith/pack.rs <- bind/mipmap_filter/kernel.rs". build.rs now lists pack.rs, and its comment says srgb.rs's steps feed the ASTC and PVRTC decoders (the mipmap filter no longer reads them). The hash moves with the new input; no runtime behaviour changes, so RUNTIME_VERSION stays (the landing re-pins). * Re-pin the runtime sources at the landing tip (821450aa43) * Announce the copied host pages' cost as the catalogue states it; list what pack.rs reaches (e9ba27478b) (its crates/metal2vulkan-validation/src/candidate/engine/artifact/tests.rs part) The final gate on 3e20b58763 failed two tests. - degradation_catalogue: the signal-behind-merge fix (8fc9c56dcb) closed the shared-event gap and rewrote the API.md entry for copied-host-pages, but the runtime still announced "(behind a shared event's value among them)". The announced cost now drops it, so the catalogue's entry starts with it word for word again. - the_runtime_sources_are_the_committed_ones: pack.rs became a runtime input (the mipmap kernel's sRGB transfers), and it also reaches metal2vulkan-air's intrinsics, lower/arith/math.rs and lower/arith/narrow.rs through its pack and unpack intrinsics, which only the compile emits. They are listed as not runtime with that reason. The stale comment about srgb.rs's encode, tables and steps (deleted by the mipmap and n7 packets) now says only what is true. Verified: the two tests on the landed tip (see the landing). |
||
|
|
9c1cd5500f |
Take NVIDIA's submit stall where the count puts it, under 2 ms too
The RTX 5080's device test tests::submit_stalls_idle failed since the stall packet ( |
||
|
|
df2bbfc3ab |
Merge a shadow over logged host pages back by its changes: words, or whole blocks where Metal rewrites them
Over host pages whose consumer logs every write, a pass replacing every texel takes the gated
merge, stored in whole 256-byte blocks; a loading, storing pass's attachment merges in whole
blocks of its area's rows; a kernel's and a blit's partial writes stay word by word, and
docs/FAST-PATHS.md says why.
One work packet, landed as 6 commits on archive/development-linear-2026-10-29, in order:
* Merge back a pass replacing every texel of a shadow over logged host pages (3b5b3b9b51)
A command that replaces every texel of a shadowed texture (ShadowUse::overwrites,
a cleared pass among them) took no copy in and no keep, and its copy back wrote
every texel it moved into the buffer's bytes: on a discrete GPU, 6 MB per
host_ab drag frame across PCIe for the 23 cleared 256x256 surfaces, whatever
changed. Over host pages whose consumer logs every write to them
(ShadowCopies::logged), such a command now takes the merge a command that
leaves texels in place takes: its gated copy in (only the rows the log reports
changed since the image's last copy, every row where the log cannot say), the
keep, the command, and the merge, which stores only the words the command
changed against the keep (shadow.rs, overwrites_unkept, and the module's
**Overwrites over logged pages**).
Metal's bytes: the gated copy in is decided once the log published the stamp
the command buffer asked at its commit, so the image and the keep hold the host
bytes as of the commit, every CPU write before it included, and a word the
merge leaves already holds the value the command wrote. A byte another writer
writes after the commit is one the command writes too, a race Metal leaves
unordered. Without a log the image may lag the CPU's writes, so there the copy
back stays a plain copy, as before. No switch: no byte differs from Metal's.
RUNTIME_VERSION development's 1692 + 1 = 1693 (renumbered at landing).
Verified on the M3 Max (MoltenVK), tests::dirty_pages_device:
- a_pass_replacing_a_logged_render_target_merges_back_the_words_it_changed:
frame 1, 0 texels copied back and 1 merge; frame 2, the gated copy in takes
the told row alone (256 bytes), the told CPU row the pass clears back to the
image's old black ends black (Metal's), and a CPU row the log left out, which
the pass clears to the black the keep held, keeps the CPU's 0x50 bytes: only
changed words are stored.
- a_pass_replacing_an_unlogged_render_target_copies_it_back: 4096 texels copied
back plainly and no merge, two frames.
Sabotage 1 (overwrites_unkept ignoring the log): the logged test fails (4096
texels copied back, 0 merges). Sabotage 2 (keep and merge without the copy in):
it fails on Metal's bytes (row 0 [16,16,0,16], want [255,0,0,255]). Restored:
dirty_pages_device, shadow, shadow_host_writes, shadow_merge_read,
shadow_carried_read, render::shadows and degradation tests 57/57 under
--cfg m2v_gpu; clippy plain and --cfg m2v_gpu (runtime) clean; rustdoc
-D warnings for the runtime clean.
* Store an overwriting pass's merge over logged pages in whole 256-byte blocks (d34f373d52)
Over host pages whose consumer logs every write to them, a command that
replaces every texel of a shadow (ShadowUse::overwrites, a cleared pass among
them) is merged back word by word since 3b5b3b9b51: only the words it changed
against the keep are stored. Where those changes are scattered, every warp's
store leaves gaps between words, which an RTX 5080 storing into host memory
over PCIe charges hundreds of times for (bind::shadow_merge's module docs:
590 ms against 0.85 ms per 8 MiB), where the plain copy back it replaced stored
every texel without gaps.
The merge kernels (bind::shadow_merge_module, shadow_merge_image_module and
its kept-image form) take a store form, bind::ShadowMergeStores { Words,
Blocks }. In the block form, the 64 words a workgroup takes in one step are one
256-byte block (ShadowMergeModule::BLOCK_BYTES), marked in workgroup memory
where a word of it changed (clear, barrier, atomic or, barrier); a marked block
is stored whole, a word it left as read, and no other block is read or written.
The form is chosen by structure, with no switch: blocks exactly for the merge
of a command that replaces every texel, cut to the texels' rows (so every word
it examines is texels' bytes, none between rows or past the last texel); every
other merge (partial writes, two ways, a linear attachment's) keeps the words.
That is Metal's answer: the command wrote every byte of every such block, as
the plain copy back stored them all, so a word it left is stored with the value
the merge reads, which differs from the command's only by another writer's
write since the commit, a race with the command's own write. A scratch made for
one kind of command is kept again only for the same kind; a command of the
other kind merges it and takes a new one. WorkCounts gains
shadow_merge_dispatches_in_blocks. RUNTIME_VERSION 1693 + 1 = 1694.
Public API: bind::ShadowMergeStores (new), shadow_merge_module /
shadow_merge_image_module / shadow_merge_kept_image_module take it,
ShadowMergeModule::BLOCK_BYTES, WorkCounts::shadow_merge_dispatches_in_blocks
(api_signatures re-blessed, api_surface lists the enum).
Verified on the M3 Max (MoltenVK):
- tests::dirty_pages_device::a_scattered_overwrite_of_logged_pages_merges_back_in_whole_blocks:
a 1024x1024 target over 4 MiB of logged pages, the CPU's texels (told to the
log) grey at every other texel; a pass clearing to black (one pixel drawn
red) merges 8 of 8 dispatches in whole blocks and leaves the pass's bytes, the
CPU's grey texels black; a pass loading and drawing black everywhere changes
the same words and merges in words (0 of 8 in blocks), same bytes. GPU time
median: blocks 1.318 ms (4 MiB stored), words 1.096 ms (2 MiB stored).
- Sabotage (never choose blocks): that test fails (0 of 8 in blocks).
- Device tests dirty_pages_device, owned_pushes, shadow, shadow_host_writes,
shadow_merge_read, shadow_carried_read, render::shadows: 42/42.
- Interpreter tests of both forms (ported from the measurement branch): equal
bytes in both forms and orders, two barriers per invocation in blocks, and a
current buffer holding only the first block, so any access to an unchanged
block traps; bind::shadow_merge*, owned_divisions, api_surface,
api_signatures 26/26.
- clippy workspace plain and runtime --cfg m2v_gpu, rustdoc -D warnings.
* Re-pin the runtime sources at the landing tip (44c96cfdf8)
* Merge a loading, storing pass's attachment back in whole blocks of its area's rows (2fcdb470fe)
A render pass that loads a shadowed color attachment and stores it, changing
it only inside its draws' scissors (ShadowUse::area), merged back to the
buffer's bytes word by word: only the words it changed against the keep. Where
those changes are scattered, a GPU storing into host memory over PCIe pays for
every separate run of words in a 64-byte host line (about 180 ns each on an RTX
5080, serialized: 88 to 102 ms for every other word over 4 MiB, against 0.4 ms
in whole blocks).
Metal itself rewrites such texels. Measured on this M3 Max's Metal (macOS
27.0.1, an ObjC harness, not MoltenVK): a 512x256 RGBA8Unorm texture over a
no-copy Shared buffer, 300 passes each loading and storing it and drawing one
pixel (a long fragment loop, about 2.9 ms of GPU time each), while a CPU thread
wrote a fresh value to every other texel over and over and checked that each
read back its last write. For points at (70,70), (200,130), (10,10) and
(100,33), the other 1023 texels of the 32x32 tile holding the point reverted to
an older value in 157 to 229 of the 300 passes each; no texel of any other
tile reverted, inside the render area (renderTargetWidth 384) or past it. A
kernel writing the same texel reverted none (0 of about 1.1e9 checks). So a CPU
write to a texel such a pass leaves inside its render area, made while it runs,
is not kept on Metal either.
ShadowUse gains tile_stores: a color the pass loads and stores inside its
bounded area (render/shadows.rs), joined like area (a draw's write through the
texture another way clears it, a read keeps it). shadow::stores_blocks takes it
with the overwrites rule, and MergeFor::overwrites becomes MergeFor::blocks
(KeptArea::for_overwrite -> in_blocks, ShadowMerge's flag alike): the merge of
such a pass, when its keep is the pass's area, is cut to that rectangle's rows
and stores whole 256-byte blocks (bind::ShadowMergeStores::Blocks), each
holding a changed word as one store, no other block, nothing outside the rows.
Over any merged-back bytes, logged or not: a block's unchanged words are stored
with the value the merge reads, so only a write between that read and the
store is undone, a shorter window than a tile's load to store. A block can
reach past the tiles the draws reach (64 RGBA8 texels of a row, two 32-texel
tiles), never past the rectangle. Docs: shadow.rs **Stored attachments**,
shadow_merge.rs, bind::shadow_merge, WorkCounts::shadow_merge_dispatches_in_blocks,
API.md (shadowed-texture entry), FAST-PATHS known gap (now the partial writes
of kernels and blits). RUNTIME_VERSION 1695 + 1 = 1696.
Verified on the M3 Max (MoltenVK):
- tests::shadow::a_pass_storing_its_loaded_area_merges_in_whole_blocks (new):
blocks for a bounded loaded-and-stored pass; words unbounded, without tile
stores, or joined with a draw's write; a read keeps them. Sabotage (never
tile stores): FAIL; restored: PASS.
- tests::dirty_pages_device::a_scattered_overwrite_of_logged_pages_merges_back_in_whole_blocks:
the Load pass drawing every texel now merges 8 of 8 in blocks (the old form
asserted 0), same bytes; GPU time median 1.078 ms (clear leg 1.860 ms).
- tests::dirty_pages_device::a_pass_storing_its_loaded_area_keeps_a_cpu_write_beside_it
(new): a Load pass drawing a 64x64 square over 4 MiB of logged pages while a
CPU thread writes three texels beside it (the next block of its rows, far
right, below) from before the commit to after the completion: 8 of 8 in
blocks, 12.4 million CPU writes, each texel ending with the CPU's last write,
every other byte Metal's.
- Device tests dirty_pages_device, shadow*, owned_pushes, render::shadows: 45/45.
RUNTIME_VERSION 1696 -> 1697 (renumbered at landing). Metal's own tile stores measured on the Apple M3 Max with an ObjC harness: 300 Load+Store passes drawing one point while a CPU thread rewrote every other texel; the 1023 other texels of the drawn 32x32 tile reverted in 157-229 of 300 passes, no texel in any other tile did, and a compute kernel writing the same texel reverted none in ~1.1e9 checks. A 256-byte block can reach the neighbouring tile within the scissor rectangle (64 RGBA8 texels), never beyond the rectangle: documented in shadow.rs's "Stored attachments".
* Re-pin the runtime sources at the landing tip (3da7eb9189)
* Say why a kernel's and a blit's partial writes merge back word by word, never in blocks (2e2e238346)
The owner decided (10-29) to keep whole-block merges out of kernels' and
blits' partial writes. Blocks rewrite the unchanged bytes inside each
256-byte block with the value the merge read, undoing a CPU write made
meanwhile. Metal keeps such a write beside a kernel's write: on the M3 Max
(macOS 27.0.1, an ObjC harness over a no-copy Shared buffer), a kernel
writing one texel lost none of a CPU thread's writes to the texels around
it in about 1.1e9 checks. A pass that loads and stores its attachment
rewrites the whole 32x32 tile it draws in (157 to 229 of 300 passes), which
is why only those passes, and commands that write every texel, take blocks.
Blits weren't measured; they keep the kernel's rule.
FAST-PATHS' known gap for the word-by-word merge now says so. Docs only: no
runtime source changes, so the runtime-sources pin doesn't move.
|
||
|
|
3ec4a69763 |
Record the native-answer work left open, and name lavapipe's pulled constant step
docs/FAST-PATHS.md's known gaps gain two entries. The first lists the places that still compute Metal's own answer where the device has one: fast::atan2's reciprocal flushed past 2^126, a bicubic sample of an 8-bit sRGB format through its UNORM twin snapping each decoded tap to Metal's twelve-bit step, and half fmod's zero sign on the exact remainder routine. The second is the shadow merge's per-word stores over PCIe, measured on an RTX 5080 over 4 MiB of host pages: 150 ms of GPU time with every other word changed, 0.40 ms with a 64x64 square, 0.86 ms with every word. Whole blocks take under 1 ms in each shape but would rewrite unchanged bytes a CPU may be writing, which Metal keeps. The five llvmpipe vertex-format-constant-step half/RG11B10 NaN rows said fixed-function vertex input; lavapipe reports no nonzero first instance, so the constant step is the vertex function's own fetch there, and device-nan-encoding is recorded on that pulled read (397e431a36). Their text now says so. docs/CONFORMANCE-COVERAGE.md regenerated. Verified: tests::fast_paths and the conformance ledger tests pass. One work packet, landed as 1 commit on archive/development-linear-2026-10-29: 189c16e23f. |
||
|
|
e84d5a4b60 |
Take the device's float denormals in ldexp
ldexp reads and makes float denormals by the device's multiply, records DeviceDenormals only where the profile's MetalFloatDenormals deviation does not already answer as Metal does, and the float-tininess notice names it. One work packet, landed as 4 commits on archive/development-linear-2026-10-29, in order: * Take the device's float denormals in ldexp, and fix stale exact comments (11eaace858) math::ldexp_bits read a float denormal operand as zero and flushed a denormal result on its bits, Metal's flush. A denormal operand is now scaled by 2^64 through the device's product (kept or flushed by the device's mode), and a result below 2^-126 is the device's product with 2^-126, rounded once or flushed. Every exponent is still answered (GLSL's Ldexp leaves exponents past +128 and overflowing products undefined: capability); infinities and NaNs keep their bits. ldexp leaves FloatFn::metal_denormals, so it records DeviceDenormals; its rustdoc and docs/API.md say so. Word bound 320. SEMANTICS_VERSION 1921. narrow::to_bits is the device's narrowing since 0d7093d826; the snapshot module docs, two leaf encode comments and ops::lane_bits' doc no longer call it exact. Verified: the "ldexp f32, every exponent" check expects the denormal-keeping product and fails on the old form (25 of 192 cases); lower::arith::tests 191/191; device_precision_float_functions, fast_paths, api_signatures, engine_metal_denormals 25/25; rustdoc clean; clippy clean apart from the dead code its base still held (deleted since by b7f6dec939). * Leave ldexp's float denormals to the MetalFloatDenormals deviation (3298b30510) Since 11eaace858, math::ldexp_bits reads a denormal operand and rounds a result below 2^-126 by the device's float multiply: a denormal times 2^64, and a normal times 2^-126. ldexp then recorded DeviceDenormals on every profile. On a profile that takes DriverDeviation::MetalFloatDenormals the device's multiply reads a denormal operand as the zero of its sign and flushes a denormal result, which is Metal's ldexp answer, so the note there named no difference from Metal. denormal::coverage now lists ldexp as Covered::Deviation, the same rule as + - *: the module requires MetalFloatDenormals where the profile takes it and notes DeviceDenormals elsewhere. half and bfloat are unchanged: leave_denormals touches only f32 lanes. The module is the same on both sides of the fact. Off MoltenVK, the device's multiply rounds before it flushes, so a result whose exact value is within half a unit below 2^-126 is 2^-126 where Metal answers zero. This is the same boundary as a float product, and float-tininess-after-rounding already announces it on those devices. The test float_denormals_are_the_devices_and_noted_off_the_device_fact still treated den_ldexp and den_ldexp_tiny as Metal-on-the-bits kernels. They now follow + - *: the requirement under the fact, the note without it, and the device's word from the interpreter, which keeps denormals. The ldexp_bits rustdoc, PrecisionNote::DeviceDenormals and docs/API.md's degrade-notice catalogue now list ldexp with the deviation's operations. SEMANTICS_VERSION 1922. Verified: nextest -E 'test(/^tests::engine_arith::|^tests::engine_metal_denormals::|^lower::arith::/)' --test-threads 8: 261/261 passed (the failing test included, on moltenvk-m3 and lavapipe with the fact on and off). cargo clippy -p metal2vulkan --all-targets --all-features -D warnings: clean. * Name ldexp in the float-tininess-after-rounding notice (53aefbfc60) Since 3298b30510, ldexp on float computes a result below 2^-126 as the device's product of a normal and 2^-126, so it takes the device's float multiply's tininess. Off MoltenVK the device rounds before it flushes, so an ldexp whose exact value lies within half a unit below 2^-126 answers 2^-126 where Metal answers the zero of its sign. The notice's cost text named only the float product and fused multiply-add. The notice, its rustdoc, the float_tininess module doc, docs/API.md's catalogue entry and its DeviceDenormals entry, and the FAST-PATHS.md row now name ldexp too. The notice's trigger is unchanged and already covers ldexp. The device announces it once at creation wherever its float functions are not Metal's own (rounds_before_flushing: not MetalFloatFunctions), whatever its pipelines hold. ldexp's product is the same OpFMul, so the same devices round it first. No new trigger is needed, and modules and recorded notes are unchanged (SEMANTICS_VERSION stays at 1922). The announced cost text is part of the run (the stderr line and DebugMessage::text), so RUNTIME_VERSION goes to 1694. The runtime-sources pin moves with degradation.rs and float_tininess.rs. The "ldexp f32, every exponent" check gains the operand 2 - 2^-23. Times 2^-127 it is 2^-126 - 2^-150, which ties to even at 2^-126 on the interpreter, a device that rounds first. A sanity assertion pins the expected word. Verified: a negative control that expected Metal's flush for that one case fails the check with "1 of 208 cases differ"; without it, lower::arith::tests::device_precision_float_functions_are_valid 8/8 passed. Runtime tests::degradation, tests::degradation_catalogue and tests::device::the_device_s_multiply_rounds_a_tiny_product_before_its_flush_off_moltenvk 17/17 passed. metal2vulkan tests::fast_paths and the api_signatures binary 24/24 passed. Validation candidate::engine::artifact::tests 3/3 passed, the_runtime_sources_are_the_committed_ones included. Workspace clippy (all targets, all features, -D warnings) is clean plain and with --cfg m2v_gpu. RUSTDOCFLAGS='-D warnings' cargo doc --workspace --all-features --no-deps is clean. * Re-pin the runtime sources at the landing tip (0d03676902) |
||
|
|
ed114bcf43 |
Answer Metal's maths special values and fast functions by the device's instructions
The fast transcendental functions and the special values take the device's instructions, with the precision contract's and c3's near-equivalent checks held at the device's notes. One work packet, landed as 3 commits on archive/development-linear-2026-10-29, in order: * Answer Metal's maths special values and fast functions by the device's instructions (d49cbcd398) The fast sin, cos, tan, sinh, cosh, tanh and atanh are the device's Sin, Cos, Tan, Sinh, Cosh, Tanh and Atanh on every device: no flush past Metal's last evaluated quadrant, no kept denormal, no MSL Table 8.2 formula. The half zero and NaN-sign tables are gone: a half function is its float instruction rounded. pow, powr, fast::powr, atan2 and fast::atan2 keep only the C99/MSL special values GLSL.std.450 leaves undefined (a negative base, 0^y with y <= 0, atan2(0,0), infinities, pow's odd-integer sign), by the device's comparisons: no bit-level denormal-as-zero reading, no canonical NaN over a NaN operand (the device's sum instead), no pow(x, 1) = x, no flush of a denormal atan2 result. The fast functions take libm::Fun entries of their own, so MoltenVK records DeviceTranscendentals where its instruction is not Metal's fast function; elsewhere NativeTranscendentals and DeviceDenormals as before; the NaNs no longer claimed record NativeNanEncoding or DeviceNanEncoding. half fmod's zero stays on the exact remainder routine (capability; no note path there yet). Dead code goes: Lib's Metal mode and denormal::flush. FAST-PATHS rows, the libm module doc, and API.md's fneg/fabs paragraph (now the device's OpFNegate and FAbs) and native-transcendentals entry say so; known-gaps.tsv gains the M3's fast-float-tanh row. SEMANTICS_VERSION 1918. Verified: arith unit tests 192/192, engine tests of the path 42/42 (metal denormals, arith, metal math, float call notes), fast_paths/profile/ api_signatures 47/47, runtime degradation and catalogue 17/17; clippy plain and m2v_gpu, rustdoc; restoring pow(x,1) = x and a fast::sin flush fails the new tests; conformance replay of pass-bytes-half-tanh-regimes on the Apple M3 Max matches the ledger (exit 0; MoltenVK's Tanh is MSL's precise tanh, 2623 of 4096 words differ from Metal's fast::tanh, DeviceTranscendentals declared). golden_hashes.tsv moves 1224 cells (65 rows over 59 fixtures), re-blessed on development. Not run: lavapipe and other venues, the validation crate. * Hold the precision contract's fast tanh at the device's Tanh notes (685db3e29f) d49cbcd398 made a fast float tanh the device's Tanh instead of the MSL formula the crate computed with a division of its own, so on lavapipe it records NativeTranscendentals, not DeviceArithmetic, and on MoltenVK, whose Tanh is Metal's precise tanh rather than its fast one, DeviceTranscendentals instead of nothing. api_surface's the_precision_contract_names_each_float_operations_notes still held the formula's notes and failed in development's gate at b7f6dec939; it and its doc now hold the device's. Verified: the api_surface binary passes (with fast_paths, golden_hashes and the conformance ledger tests, 41/41) at 11eaace858. * Hold c3's near-equivalent checks at the device's tanh and NaN notes (43a9c268e4) d49cbcd398 made a fast float tanh the device's Tanh instead of the MSL formula the crate computed with a division of its own, and left the NaN of pow and of fast sin and cos to the device, so three c3 tests held the old notes and failed on development: - the_products_own_approximations_are_its_near_equivalents: tanh (fast or precise, float or half, lavapipe or MoltenVK) is now no near-equivalent; fast atan2 keeps DeviceArithmetic. Fast tanh(44) stays Apple's unstated word even where the row records DeviceArithmetic for another operation. - a_nan_encoding_the_product_answers_is_not_a_near_equivalent: on lavapipe F32 exactly precise pow and fast sin and cos record DeviceNanEncoding; the test asserts that set over msl::Prim::ALL. A differing NaN of fast sin(inf) and of precise pow(-1, 0.5) is now the note's (near_equivalent, open); precise sin(inf), mul and div keep the old answer. - an_unstated_word_the_product_approximates_keeps_its_reading_open: fast fmod keeps its open reading and refusal (now the named-lowering check); fast tanh(44) is the device's answer, unstated, and the sign-off stands with DeviceArithmetic recorded. Doc comments say what is true now. No product code changes. Verified: cargo nextest run -p metal2vulkan-validation --all-features -E 'test(/^c3::/)' 72/72 passed (3 failed before); clippy -p metal2vulkan-validation --all-targets --all-features -D warnings clean. The lavapipe/MoltenVK note sets were read from lowering_notes for every prim. |
||
|
|
ced4a0ecda |
Decode and encode 8-bit sRGB storage and twin texels by the device's transfer
Rule 1: a storage image of an 8-bit sRGB format (its UNORM alias, SrgbEncode/SrgbEncodeBgra) and a slot bound to such a format's UNORM twin decoded each code through Metal's twelve-bit step table and an exact k/4095 quotient, and encoded by searching the table. The format is capability (Vulkan has no sRGB storage; the device cannot sample the twin's format); the arithmetic is the device's. Reads (alias, twin read/sample/gather/fetch, bicubic taps) take the MSL transfer through the device's Pow (pack::srgb_decode_texel), a filtered twin sample decoding the device's filter of the codes; every access records SrgbTexelDecode. Writes take pack::pack's unorm4x8_srgb (DevicePackConversion). The module declares no sRGB table for these paths; SrgbReach, srgb_filtered_texel, the step/ratio helpers and Sampling::srgb_codes are gone. Words per access: read 520 -> 194, filtered sample 920 -> 194, write 1520 -> 314, bicubic tap 160 -> 106. Docs (artifact notes, API.md catalogue, FAST-PATHS rows, doc comments) say so; runtime_lane::srgb_storage now holds the device's bounds, with an alias-read test. SEMANTICS_VERSION 1917. Verified: clippy plain and --cfg m2v_gpu, rustdoc; nextest 65 core checks + 98 touched-module + 17 runtime degradation pass; sabotage of the decode FAILS 2, restored PASS; MoltenVK on the Apple M3 Max: runtime_lane::srgb_storage 4/4 (with the formatless storage features withheld, alias float reads within 1.83e-7 of the transfer, 762 of 1024 lanes differ from Metal's table; writes within one code; srgb-texel-decode and device-pack-conversion announced); conformance read-write-tier-round-trip-float and -held announced, justified. Golden hashes unchanged. Not run: the twin on a device that takes it (lavapipe, ANV, NVIDIA), release timing, the census. One work packet, landed as 1 commit on archive/development-linear-2026-10-29: c70ec588c4. |
||
|
|
038bad9386 |
Take the device's conversions in the storage-form fetch and blend, imageblock tiles and snapshots
The storage form, implicit imageblocks and snapshot reads take the device's conversions, and
the MetalFloatStorageNans driver fact, which nothing reads once the blend keeps the device's
NaN, is deleted.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29, in order:
* Take the device's conversions in the storage-form fetch and blend, imageblock tiles and snapshots (a049fcd0ee)
Rule 1 (owner, 10-29): where the device has a native answer, it is the only
form. The interlocked storage form, implicit imageblocks and snapshot reads
are capability and stay; the arithmetic inside them still computed Metal's
own bits. Each now takes the device's form, its difference noted with an
existing note:
- lower/fragment/fetch.rs: an 8-bit sRGB attachment's read and write through
its uint view decode and encode by arith::pack's unorm4x8_srgb forms (the
8-bit instruction and the MSL transfer by the device's Pow) instead of
Metal's twelve-bit table (math::unpack/pack with the table); the module no
longer declares the table for it. DevicePackConversion.
- fetch.rs: an 8-bit unorm blend's result is stored as computed, the storage
image's store converting it (unorm8_write's exact product with 255, the
NaN select and the clamp are gone). DeviceColorConversion, recorded in the
storage write's plan.
- fetch.rs: a 16-bit float blend no longer makes every NaN 0x7FC00000; the
NaN is the device's arithmetic's, which the store converts.
stage_io/color_write.rs records DeviceNanEncoding for every such blend and
no longer relies on VkProperty::MetalFloatStorageNans (storage_nan
deleted; the deviation stays as a measured fact, now required by no
module).
- lower/stage_io/word_color.rs: an 8-bit sRGB word's encode is
arith::pack::pack (srgb_table and encode's table parameter deleted; its
two other callers updated). DevicePackConversion.
- lower/access/tile.rs: a normalized implicit imageblock access unpacks and
packs by arith::pack (instruction or its definition), a half access rounding
the unpacked float once more by narrow::round, instead of math::unpack/pack
with Metal's table and the exact c/D-to-half grid (half_channels,
Norm::grid deleted). DevicePackConversion, but for a float conversion of a
format GLSL.std.450 names on a device whose float functions are Metal's
(MoltenVK), as air.pack notes it.
- lower/fragment/snapshot.rs: a normalized form's read decodes c times the
f32 nearest 1/D (signed: at least -1) instead of exact integer division.
DevicePackConversion.
- lower/arith/color_write.rs: the unorm rule is gone from round and
channel_words (normalized deleted); a unorm channel is the device's
conversion's. FloatNearestEven stays (Metal's textureWriteRoundingMode, a
capability), as does unorm8_code for the private alpha test.
Dead in this tree and deleted: extended_range::blend::unorm8_write,
texel_round::grid_step, srgb::STEP_WORDS. Word estimates follow
arith::pack::words.
Tests: blend8's two blend checks now hold the blend's result, stored by
Vulkan's conversion, to Metal's code (unorm8_write's test deleted with it);
color_write checks that round takes no unorm rule (fails on the old form)
and its scalar/half test uses the small-float rules; snapshot_codes checks
the device's product c * fl(1/D) (asserted to differ from the quotient at
some code; the old exact test failed on the new form, seen); the
engine_fetch_blend8 tests require DeviceColorConversion (unorm8) and
DevicePackConversion (sRGB), which fail on the old form;
engine_fetch_blend16 requires DeviceNanEncoding on every profile and no NaN
property; engine_tile's normalized tests hold reads, stores and the
read-back within DevicePackConversion's bound (3 f32 ulp, one half step
more, codes within one) on the formats the interpreter models (no Pow: the
sRGB formats, and NaN stores, are the device lane's). Validation lanes: framebuffer_fetch::blend8 asserts the native note
alone on an interlock device and unorm8 channels within one code;
framebuffer_fetch::srgb accepts device-pack-conversion as a conversion;
tile_normalized checks reads and stores within DevicePackConversion's
bound; blend16::nans docs.
Conformance: known-gaps.tsv gains eight Apple M3 Max rows for
fetch-ordered-{bgra8unorm,rgba8unorm}-srgb (x1: a code apart, within the
note's bound; x2/x3/x3-depth: two, compounded across draws), the device's
sRGB conversion in the interlocked storage form.
Docs: API.md catalogue (DevicePackConversion, DeviceColorConversion,
DeviceNanEncoding, the sRGB word paragraph, the fetched sRGB and unorm8
blends), FAST-PATHS.md's air.pack row and the fetched-blend gap, the note
and deviation doc comments.
SEMANTICS_VERSION 1916 (emitted modules change). No public API change.
* Delete the MetalFloatStorageNans driver fact, which no module reads (e3f82758cb)
After the storage form's 16-bit float blend stopped making every NaN
0x7FC00000 (the device's NaN, noted DeviceNanEncoding), nothing reads
DriverDeviation::MetalFloatStorageNans or VkProperty::MetalFloatStorageNans:
no module requires the property and no lowering asks the profile for the
deviation. AGENTS.md's no-dead-code rule, and the owner's approval of deleting
unread facts (the 10-27 unread-fact sweep, 7b4509b9c4's precedent), remove
them.
Removed: both public variants and their docs; the five measured rows
(MoltenVK on Apple9, RADV on the 780M, NVIDIA on the RTX 3090 and the RTX
5080 Laptop GPU, lavapipe) and their measurement paragraph in
device/driver_facts.rs; the derive and profile mappings; the codec's
VkProperty entry; the driver_facts test rows (the deviation-to-property
table, the Apple, NVIDIA, lavapipe and 780M expectations); the
engine_fetch_blend16 split of interlock profiles by the deviation and its
"no such property required" assertions there and in engine_extended_range.
engine_fetch_blend16 still requires DeviceNanEncoding on every interlock
profile.
Corpus observations name the deviation only inside environment.profile, a
free-text Debug string of the profile (format!("{profile:?}"), a
serde_json::Value field nothing parses into an enum), so no reader changes
and no observation file is rewritten: the established handling, as the
MetalHalfQuantize name removed on 10-28 still stands in 152 observation
files. The profiles that took the deviation (moltenvk-m3, the two 780M RADV
profiles, the three lavapipe profiles, nvidia-rtx5080-laptop) change
fingerprint, so their golden cells and evidence re-key.
ARTIFACT_FORMAT_VERSION 478 (the encoded VkProperty list changed; the
orchestrator renumbers). api_signatures re-blessed (two variant rows gone);
REFUSALS.md regenerated, unchanged.
Verified: cargo fmt; clippy --workspace --all-targets --all-features -D
warnings, plain and with --cfg m2v_gpu; rustdoc -D warnings; nextest by
exact module: device::tests::{driver_facts,profile}, cache::tests,
cache::codec::tests, tests::fast_paths, tests::engine_fetch_blend16,
engine_extended_range::half_float_storage_slots_leave_their_writes_to_the_device,
api_signatures, api_surface, refusal_surface (130/130); validation index,
observation, observation_contract, c3, requirement,
candidate::platform::device (118/118).
|
||
|
|
5f2c69e087 |
Decode a pulled normalized vertex field by the device's reciprocal product
Pulled normalized fields (vertex, [[stage_in]], post-tessellation) take the device's product,
and a post-tessellation pulled read records its NaN note as the vertex and stage-in reads do.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29, in order:
* Decode a pulled normalized vertex field by the device's reciprocal product (33a8839b7c)
The owner's ruling of 10-29: no exact emulation where the GPU has a native
answer. A normalized field the shader pulls (a vertex attribute fixed-function
input cannot fetch, a kernel's [[stage_in]] attribute, a post-tessellation
function's) was Metal's correctly rounded quotient via exact_division::div_exact.
It is now the device's product float(c)*float(1/m), rounded once, the signed one
max(., -1), as fixed-function fetch already converts it (
|
||
|
|
0a1851164d |
Copy a no-copy buffer, heap or rebind whose import the caller's gate refuses or that fails, announced
A new HostMemory::with_import_gate(ImportGate) asks the caller once,
holding no lock of the runtime's, just before a no-copy buffer, a
no-copy heap or a buffer rebind imports its pages, passing an
ImportRequest with the pages the import would map. If the gate answers
false, or an import the device and the gate admitted then fails
(OutOfMemory, another Vulkan error), the object is made over a copy of
the pages instead of failing. The default stays import-first. The copy
is host-visible memory owned by the runtime; `contents` stays the
caller's pointer. Each commit copies in the bytes the CPU changed since
the last sync, and each batch's completion merges back the bytes the GPU
changed (CPU wins where both wrote), byte by byte, before events,
waiters and handlers see it. Every copy is announced
(`copied-host-pages`) and counted. Pages the process cannot read are
never copied (the first copy reads through the kernel:
process_vm_readv / mach_vm_read_overwrite). A copied heap's buffers lie
in the copy and its textures are shadows. A rebind's copy is laid out as
its import would be. A rebind over an in-place image is refused
(NotImplemented(RebindTextures)) and a heap's rebind still imports
without asking. A caller's DirtyPages log stays attached to the copy as
to an import. The in-place check's pointer class skips copied buffers.
Ports dev-perf's fff961b7e5, 630d1b0174, 33d7aa5e98 and 9b4d4190f5 onto
a smaller coherence design: every live copy is compared in full at each
commit and completion, instead of dev-perf's log-driven,
encoder-collected copies (dev-perf's copied.rs, 79301a2515 and its
fixes, sat on a page log development has replaced). Also brings
789fa3d294's unreadable-page rule, 5190983470's lane site, and
1c7d49f788's copied-buffer skip. A driver that refuses the pointer
still fails the call (dev-perf copied there too; not taken). Known gaps
in FAST-PATHS: the compare costs O(size) per commit and completion, a
byte both sides wrote keeps the CPU's value, and a shared event's value
can be seen before the merge (c5db2d1b8a not ported). RUNTIME_VERSION
1690. Runtime-sources pin recomputed.
Public API: ImportGate, ImportRequest { start, length }
(#[non_exhaustive]), HostMemory::with_import_gate,
Degradation::CopiedHostPages, Device::fail_next_host_imports (test
hook), and the WorkCounts fields host_imports_refused_by_host,
copied_host_buffers_{made,refused,degraded}, copied_copy_in_bytes,
copied_merge_back_bytes, copied_rebind_pages_made, copied_heaps_made.
Verified on the M3 Max (MoltenVK, m2v_gpu): 11 new device tests
(tests::copied_device: buffer, rebind and heap, gate refusal and failed
admitted import, unreadable pages, a heap texture round trip) and 167
tests in the touched device filters pass; the counters move as
expected ([1,1,1,0,0] for a refusal, [0,1,0,1,0] for a failed import)
and the announcement is heard; on a 64 KiB copy 4079 bytes copied in and
4080 merged back for a 4 KiB CPU write and a 4 KiB fill, checked
exactly. Sabotage: ignoring the gate and removing the merge fails the 3
buffer tests; ignoring the rebind gate fails both rebind tests (no heap
sabotage). 249 host tests pass. Workspace clippy plain and
--cfg m2v_gpu, and rustdoc, clean; clippy re-run clean on the landing
merge. Not run on Linux.
|
||
|
|
d7d4870598 |
Wait a bound for a pipeline still being made, then drop its draws and dispatches
A cold MoltenVK compile inside one guest command buffer ran 11.59 s and tripped the guest's own 10 s FIFO watchdog, which tore the task down; development had no bound. New runtime choice DevicePolicy::pipeline_waits (PipelineWaitPolicy::Bounded, the default, or Exact, which exact_answers() selects), with bounds pipeline_creation_wait and pipeline_commit_wait (4.5 s each, so one FIFO step waits 9 s at most). Under Bounded: - A render or compute state's creation hands its predicted making to the pool and waits for it up to the creation bound (WorkCounts::creations_left_making). - A committed command buffer waits until its commit plus the commit bound for its draws', dispatches', tile dispatches' and execution replays' pipelines, then records each late one as nothing and runs on. CommandBuffer::dropped_draw names the first with VK_TIMEOUT. Counted in draws_dropped_still_making and dispatches_dropped_still_making, and announced as draw-dropped-still-making and dispatch-dropped-still-making. - An execution's settle hands its makings to the pool. A draw whose driver making failed now runs nothing and its command buffer runs on, where it used to fail it: counted in draws_dropped_unmade, named by dropped_draw(), and announced draw-dropped-unmade (Degradation::DrawDroppedUnmade: the draw, its state, a hash of the variant and specialization, and the driver's error; once per device, or each time where announce_each asks). A dispatch's failed making still fails its command buffer. Docs: FAST-PATHS.md row, API.md policy bullet and catalogue entries, runtime README Errors. RUNTIME_VERSION 1689. api_signatures.tsv re-blessed. Runtime-sources pin recomputed. Ports dev-perf 6f499ff764, 8c91a6e254, 33fc25b531, 5963fd6831 and 4ee316c55a, and the notice of aa7e78f23c in its minimal form (no per-key set, no driver-message relay). The general-form predicted key (7028c0d92a, ce02b68f23) is left out: on development it changed the pipeline makings three M3 device tests count (made_at_creation, pipeline_creation pooled making, its own general_form_drawn), cause not found. Verified on an M3 Max (MoltenVK 1.4.2), under maclock: the six bound and drop device tests under both policies (the unmade one also asserts the notice is heard once and names the driver's error), fast_paths, degradation, degradation_catalogue, pipeline_wait_order, inline_continues, dispatch_pending, api_signatures, api_surface and 169 profile tests: 218/218. Lanes on the M3: 42/44; the two failures are ycbcr_textures::a_ycbcr_sample_through_an_unmeasured_filter_is_announced (recorded failing on development before this change) and pipeline_creation::draws_made_on_the_pool_draw_as_made_ones (1 pooled making vs 2; fails the same under Exact; not yet run on development without this change). Clippy plain and --cfg m2v_gpu and rustdoc -D warnings clean. No sabotage run of the bound. |
||
|
|
7a6818deda |
Take NVIDIA's stall in every 1024th signalling submit while idle
dev-perf measured on an RTX 5080 Laptop GPU (NVIDIA 615.71.09, Linux) that one vkQueueSubmit in every 1024 that signals a fence or semaphore on a VkQueue spends 2.2-3.7 ms in the driver, counted per queue, and the batch it lands on, with everything committed behind it, waits that long. Every batch signals, so the stall can only be moved. device/submit_stalls.rs keeps each queue's place in the driver's period under the queue's lock (Period): every signalling call the runtime times is counted (batches via submit_logged, the device's own submission via use_queue(Uses::OneSignalling), the plan's empty ones); a use it cannot count (the program's, sparse binds, wait-idle, relay marks) or a due stall that did not come forgets it. Once the scheduler's thread has had nothing to submit for 1 ms and a queue's next stall is due within its next burst plus 32 calls (at most 128), it submits the calls left as empty submissions signalling a timeline semaphore of the queue's own, outside its lock, stopping where a commit or waker came. WorkCounts gains idle_submits, submit_stalls_idle, submit_stalls_on_work, submits_behind_idle_stalls, wait_behind_idle_stall_longest_nanos; host_ab prints them. FAST-PATHS records the stall among device gaps. Ports dev-perf 76bf5a3189, 28c42746a5, b76d910450, 1ef8316ecf, 9d2f46431e. Adapted: keyed as development keys driver facts, a cost fact DriverFact::SignallingSubmitsStallEvery1024 on NVIDIA's driver on the RTX 5080 Laptop GPU (0x2c19, the GPU measured) at every release (dev-perf's release-keyed DriverTrait table, fd2ddc8faa, not ported); the scheduler's short idle sleep bounds WAIT_SLICE (development has no head bound). Public API: DriverFact::SignallingSubmitsStallEvery1024 (translator and runtime re-export), five WorkCounts fields. RUNTIME_VERSION 1687. Runtime-sources pin recomputed. Tests: tests::submit_stalls (planner vs a model driver), device::tests::driver_facts (the fact's GPU scope, the 5080 profile's facts), device test tests::submit_stalls_idle (new: on a driver with the fact, at least one stall taken idle over 5000 command buffers; elsewhere no empty submission). Verified on an M3 Max (MoltenVK 1.4.2): touched-module tests 268 passed; api_signatures/api_surface 15 passed; the planner tests fail with due_idle forced to 0 (4 of 9) and pass restored; device tests 45 passed, the idle-stall test printing idle_submits 0 on MoltenVK; with the gating forced on, a run made 106 empty submissions without driver errors and the test failed as it should. Clippy plain and --cfg m2v_gpu, rustdoc -D warnings clean. The stall path itself needs the RTX 5080: see the round's 5080 run. |
||
|
|
2f033d3002 |
Take the device's Y'CbCr conversion for 4:2:2 twins and for YCbCr planes read in place
4:2:2 twins hold the device's own conversion where it has Metal's reconstruction; planes read
in place are sampled through the device's Y'CbCr sampler where the driver lays them out as the
surface does; RADV's 10-bit conversion recorded as reading codes as words. With development's
golden re-bless after the native landings. SEMANTICS 1911, ARTIFACT 477, RUNTIME 1683.
One work packet, landed as 6 commit(s) (a1088b2c2e..67dc5650e1 on archive/development-linear-2026-10-28-evening), in order:
* Hold a 4:2:2 texture's twin as the device's own conversion where it converts the format
A GBGR422 or BGRG422 texture reads a decoded twin of 8-bit codes on every device: Vulkan views
G8B8G8R8_422_UNORM and B8G8R8G8_422_UNORM only through a sampler Y'CbCr conversion, which no
pipeline's layout bakes. Until now the twin always held Metal's decode, (3c + n + 2) >> 2, computed
by the runtime's own kernel or on the CPU, even where the device converts the format itself.
Now, where the device converts the pairs' format with Metal's reconstruction (its optimal tiling
reports SAMPLED_IMAGE, TRANSFER_DST, MIDPOINT_CHROMA_SAMPLES and a linear chroma filter, and the
width is even), the twin holds the device's conversion:
- each decode pass copies the written rows' pairs out of the carrier into the scratch, then into
a per-texture image of the 4:2:2 format, and samples it through the device's conversion (the
identity model at full range) into the band's texels, which go into the twin;
- the kernel is the new bind::chroma_sample_module (ChromaSampleModule), a sample at each luma
texel's centre at level 0, each channel stored as roundEven(clamp(c, 0, 1) * 255);
- such a carrier takes no host or staging copies, so every write's decode is a GPU pass and no
texel of the twin is the CPU's decode;
- counted in WorkCounts::chroma_device_twins and chroma_device_decodes, and announced
decoded-texel-precision (the catalogue's cost text says so).
Elsewhere the twin keeps Metal's decode, as capability. The FAST-PATHS device-gaps table has the
row.
Venues (from the formats' features): MoltenVK 1.4.2 converts both formats (its single-plane 4:2:2
reconstruction is Vulkan's); lavapipe filters their chroma nearest only; RADV (Mesa 26.2.4, 780M)
reports neither format.
Verified:
- clippy -D warnings, plain and --cfg m2v_gpu, for metal2vulkan and metal2vulkan-runtime;
- chroma_decode unit tests (the sample module is valid on every committed profile), fast_paths,
the degradation catalogue tests, api_surface and api_signatures (table blessed: the new module,
ChromaDecode::format and the two WorkCounts fields);
- M3 Max (MoltenVK 1.4.2): tests::ycbcr_device::a_four_two_two_twin_holds_the_devices_conversion...
took the device route for both formats (twins 1, passes >= 2, no CPU decode, announced once);
chroma within 0.5000 codes of Vulkan's (3c + n) / 4 on 40 x 24 random pairs (the test also
prints how many chroma codes differ from Metal's; that line is compiled and clippy-clean, not
yet run);
runtime_lane::chroma_pairs (5 tests) pass, the read lane checking green exactly and red and
blue within 1/255 of Metal's on the device route;
- lavapipe (arm64 linux-gate, m2v_cpu_icd): the same runtime test and the five chroma_pairs lane
tests pass; no 4:2:2 texture took the device route (twins hold Metal's decode, exactly);
- RADV 780M: not run (host away).
docs/REFUSALS.md regenerated: unchanged. runtime-sources.sha256 updated; the RUNTIME_VERSION
bump is in the versions commit.
* Record that RADV's 10-bit Y'CbCr conversion reads codes as words
RADV has the same defect lavapipe has (RuntimeDriverDefect::TenBitCodesReadAsWords): a sampler
Y'CbCr conversion of G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 reads each code's 16-bit word as a
16-bit UNORM value, its six unused low bits included, where Vulkan converts the 10-bit code as
c / 1023.
Evidence: a bare Vulkan probe on the Radeon 780M (RADV, Mesa 26.2.4) read luma code 1023 (low bits
0) through the identity model of a LINEAR image of the format as 0.999039, which is 65472 / 65535
and not 1.0. The optimal tiling's conversion of the format was not measured; the row is per
driver, as the defect table's rows are.
What changes: the AFFECTED table gains a MESA_RADV row, with no clean GPU. Nothing is refused.
- A 10-bit two-plane texture on RADV now converts through Metal's arithmetic. Before, RADV's
optimal-tiling device conversion (ycbcr_device.rs) took it, and that path was never measured on
RADV.
- The planes image of the next commit is not taken for 10-bit codes there.
The driver_defects test expectations (every committed RADV profile, Hawk Point's 780M) and the
docs that name the defect's drivers (ycbcr.rs, ycbcr_device.rs, docs/API.md) say RADV too.
Verified: clippy -D warnings (plain and --cfg m2v_gpu) for metal2vulkan, metal2vulkan-runtime and
metal2vulkan-validation; tests::driver_defects on the host. The RADV device itself was not run: the
host is away.
* Sample YCbCr planes read in place through the device's own Y'CbCr sampler where it has Metal's reconstruction
On an integrated GPU or a CPU device, a function that only samples a YCBCR8_420_2P or
YCBCR10_420_2P texture reads the planes in place through a uniform texel buffer. It converts and
filters them with Metal's fixed-point arithmetic in the shader. Where the device converts the
planes' 4:2:0 format as a linear image with Metal's reconstruction (midpoint chroma through a
linear chroma filter), rule 1 makes the device's own conversion the only form. So such a slot now
samples the planes through the device's sampler Y'CbCr conversion. Elsewhere the texel buffer
read stays, as capability.
Translator (metal2vulkan):
- bind::YCbCrPlanesSampler (new, non-exhaustive) holds the conversion: the codes' bits and the
surface's range and matrix. It also gives the image's format: G8_B8R8_2PLANE_420_UNORM, or
G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16.
- YCbCrInPlace::with_planes_image, ::sampler and ::planes_sampler. TextureShape::Texture gains
ycbcr_planes_sampler.
- RuntimeFact::YCbCrInPlace gains `device`: the device's sampler takes every sample of the slot.
It does not where a constexpr sampler has a border address mode, or a texel offset is placed by a
parent's size.
- VariantKey and LoweringInputs gain ycbcr_planes_sampled. The binder fills it from slots with
`device`, bound to a texture that holds the image, whose runtime sampler words have no border
mode on s or t.
- Such a slot is declared as a combined image sampler: ResourceKind::YCbCrPlanes and
BindingSource::YCbCrPlanes, written from WriteSource::YCbCrPlanesImage. Its immutable sampler is
the new vk::SamplerDesc::ycbcr: linear, clamp to edge, lod 0, and a new `ycbcr` field.
- Each sample (lower/sampler/in_place.rs device_sample) is OpImageSampleExplicitLod at level 0:
- a linear sample takes Metal's coordinate, with its texel offset moved in texels;
- a nearest one takes the centre of the luma texel Metal reads, clamped to the edge;
- pixel coordinates and the filter are known when the module is made (constexpr) or read from
the runtime word;
- a half result is rounded to a half, as every sampled texel's is.
- The texel buffer stays the slot's resource otherwise. The planes read use is tracked as before.
Runtime (metal2vulkan-runtime):
- YCbCrFormats queries the two 4:2:0 formats' LINEAR tiling: SAMPLED_IMAGE,
MIDPOINT_CHROMA_SAMPLES, a linear chroma filter, and the limits and
combinedImageSamplerDescriptorCount.
- YCbCrSampler::planes gives the conversion. It is None under TwoPlaneChromaMisplaced, and for
10-bit codes under TenBitCodesReadAsWords. holds_planes checks for an even size within the
limits.
- texture/ycbcr_planes.rs (new) makes a PREINITIALIZED linear image of the format over the planes'
bytes, and only in memory the runtime allocated. It is made only where:
- the luma plane comes first;
- the driver's PLANE_0 and PLANE_1 subresource layouts are the surface's offsets and pitches;
- the alignment, the type and the room within the buffer fit.
Its view and every immutable sampler of it share one VkSamplerYcbcrConversion
(Device::made_ycbcr_conversion, kept in the owned kernels' map), so the two are identically
defined (VUID-VkWriteDescriptorSet-descriptorType-02738). Its first move rides the next
submission (Fresh, never rebindable), and it is announced ycbcr-filter-not-exact.
- Fresh pages, no-copy pages and the caller's VkBuffer keep the texel buffer. An image bound to
imported memory starts UNDEFINED, and the in-place check covers that first move for single-plane
images only.
- The texture's facts state the image (with_planes_image). binding.rs writes the view in GENERAL
under the layout's immutable sampler.
- sampler_set chains the conversion into each SamplerDesc::ycbcr sampler. A non-pushed set 0
reserves combinedImageSamplerDescriptorCount descriptors per such binding.
- WorkCounts gains ycbcr_planes_images, ycbcr_planes_images_kept_{conversion,memory,layout} and
ycbcr_planes_images_bound.
Venues (from the formats' linear features):
- Radeon 780M (RADV, Mesa 26.2.4): reports the 8-bit route for rows 256 bytes apart. Its 10-bit
codes carry TenBitCodesReadAsWords (previous commit).
- MoltenVK 1.4.2: TwoPlaneChromaMisplaced.
- lavapipe: its 4:2:0 conversion is cosited only.
Measured before building, through a bare Vulkan probe on the 780M with 8-bit codes:
- luma centres within 0.0003 codes of Vulkan's model, and points between texels within 0.66
codes;
- Metal's conversion-then-filter differs by up to 54/255 between texels of random planes;
- GPU time, 3840x2160 composited into 1680x1050: 248 us against the texel buffer's 340 (1 pass),
741 against 1027 (3 passes).
The runtime's path itself is not measured on a device that takes it: the 780M host is away.
Docs: a FAST-PATHS device-gaps row (the device's route, where the texel buffer stays, and why);
the in-place paragraph; docs/API.md (the pipeline interface paragraph, and the notice's catalogue
entry); module docs (ycbcr.rs, ycbcr_device.rs, ycbcr_image.rs); the api_surface table
(YCbCrPlanesSampler N); api_signatures blessed.
Tests:
- bind::ycbcr_in_place::the_planes_sampler_is_the_conversion_word.
- bind::plan::slots::the_planes_image_variant_takes_a_slot_the_device_s_sampler_reads.
- tests::engine_ycbcr_in_place::a_planes_image_slot_samples_through_the_device_s_conversion: the
lavapipe and M3 profiles; linear, nearest, pixel, offset and runtime samplers, each half and
float. Each case links and validates, with one OpImageSampleExplicitLod. Border and repeat-offset
slots state device false.
- Lane runtime_lane::ycbcr_in_place::a_ycbcr_texture_s_planes_image_samples_through_the_device_s_conversion
covers surfaces whose rows are 256 bytes apart. Each in-place texture is counted exactly once,
as an image or by why not. Through the image, nearest samples are Vulkan's conversion within the
device's bound, announced; without it, Metal's texels through the texel buffer, unannounced.
Verified:
- clippy -D warnings, plain and --cfg m2v_gpu, for metal2vulkan, metal2vulkan-runtime and
metal2vulkan-validation.
- Host, plain target, the touched selection (ycbcr, fast_paths, api_surface, api_signatures,
codec, slots, api_tests, the inputs encoding, sampler, ash_interop, driver_defects, degradation,
vk tests): 408 run, 407 passed. The engine test's half cases failed, because a half result was
an f16 where a sample holds it widened. They now take narrow::round_texel, and the in-place
engine tests pass, 4 of 4.
- M3 Max (MoltenVK 1.4.2), runtime and validation, ycbcr|chroma|driver_defects|runtime_sources:
66 run, 64 passed. The planes image test counted [0, 1, 0, 0] for both surfaces (kept for the
conversion: TwoPlaneChromaMisplaced), bound the texel buffer and read Metal's texels. The two
failures:
- the runtime-sources pin, re-pinned in the versions commit;
- runtime_lane::ycbcr_textures::a_ycbcr_sample_through_an_unmeasured_filter_is_announced
(anisotropic through a constexpr sampler), which fails the same way at the base, as
|
||
|
|
bd3c50d741 |
Take the device's own Depth16 bias and its store of an extended-range, padded or bfloat attachment's untouched texels
The device's depth bias unit on every format, and the device's store of untouched texels in
place of the unused-bits load pass (deleted with its capture machinery); the NaN depth
discard documented as capability. SEMANTICS 1910, RUNTIME 1682.
One work packet, landed as 7 commit(s) (88bcfeaea8..6aec9db4e9 on archive/development-linear-2026-10-28-evening), in order:
* Take the device's depth bias on a Depth16Unorm depth
Rule 1: the device's depth bias is its native form, so it is the only one. A
constant bias (or a slope alone) on a Depth16Unorm depth was recorded through
VK_EXT_depth_bias_control's depthBiasExact as Metal's own rule, c + 1 units of
1/65535 for c of 0 or more and c - 1 below (one unit for a slope alone), in
depth (floatRepresentation) or in 2^-16. Now `metal::state::depth_bias` hands
Metal's constant to vkCmdSetDepthBias in the device's own unit r on every depth
format; Vulkan leaves a fixed-point format's r to the implementation, at most
2 x 2^-16 ("Depth Bias", primsrast.adoc).
Deleted, nothing reading them any more: `depth16_units`, `DepthBiasUnit` and
`DepthBias::unit`, the `depth_format` parameter of `depth_bias` and of the
runtime's `vk_depth_bias`; the runtime's vkCmdSetDepthBias2EXT path
(`DepthBiasCommand`, `depth_bias_command`, the record's pinned representation,
the device's command, its priming and `DEPTH_BIAS_CALLS`, the exit guard's and
recorder's `CmdSetDepthBias2`, `Logged::SetDepthBias2` and its thunk, so
`CommandsReplayed::cmd_set_depth_bias2` goes). VK_EXT_depth_bias_control is
still described but no longer consumed, so the core recommends enabling neither
it nor its three features.
RADV on the 780M no longer takes DriverDeviation::MetalDepth16BiasedStores: it
was measured through the exact unit. MoltenVK keeps it (it hands Metal its
constant, by construction). Elsewhere `unorm-depth-bias` announces the device's
bias; its cost text, docs/API.md's entry, the deviation and property docs and a
new FAST-PATHS device-gap row state it.
Tests: `metal::state::a_unorm_depth_bias_is_metals_constant_in_the_devices_unit`
(the constant as given on lavapipe, NVIDIA and MoltenVK, which have
depthBiasExact or not); the recommendation test leaves the extension and its
features out; the driver-facts test drops RADV's row; the exit-guard tests lose
the priming group and render_state.rs as a keeper of the device's functions.
api_signatures blessed (DepthBiasUnit, DepthBias::unit, depth_bias's signature);
the refusal surface is unchanged. Not bumped here: RUNTIME_VERSION (the versions
commit) and the runtime-sources pin (landing).
Verified: cargo clippy -p metal2vulkan -p metal2vulkan-runtime
-p metal2vulkan-validation --all-targets --all-features -D warnings; nextest of
metal::state, device::tests::{enables,driver_facts,profile}, tests::fast_paths,
api_surface, api_signatures, exit_guard, render_state, degradation_catalogue,
draw_shape_notices and ash_interop: 159 passed.
* Cite the spec that leaves a NaN fragment depth undefined, which makes its discard capability
The native-arithmetic audit asked whether `clamp_depth`'s discard of a positive NaN
depth, on every profile, emulates Metal where the device has a native form. It does
not: Vulkan defines no answer for such a depth. "Depth Clamping and Range
Adjustment" (fragops.adoc, 35.10.1): "If zf is not in the range [zmin, zmax],
then zf is undefined following this step", with or without depthClampEnable, and a
NaN lies in no range; only depthClampZeroOne, which no profile enables, keeps a
float depth unchanged (and then the comparison of a NaN would still pass ALWAYS
and NOT_EQUAL, where Metal's fails every test). So the discard stays, as
capability, and the comment says why, so a later audit does not re-raise it.
Docs only (a doc comment); no behaviour changes.
Verified: cargo fmt --all.
* Drop the cube's unmeasured gradient route from the anisotropic tests' profile comment
The route was deleted with the native cube gradients; the comment still named it as a second
home of the anisotropic emulation. Only a profile without samplerAnisotropy emulates it now.
Verified: comment only; git grep finds no other mention of the unmeasured gradient route.
* Keep the device's store of an extended-range, padded or bfloat attachment's untouched texels
What: a render pass that loads and stores a color attachment of an extended-range, padded
10-bit or bfloat format now keeps the bytes its draws do not write, the device's own load and
store (VK_ATTACHMENT_STORE_OP_STORE of a loaded attachment), on every device. The runtime no
longer reproduces Metal's tile store: the load pass that rewrote the texels' unused bits before
the pass (render/unused_bits_load.rs, bind::unused_bits_module), the capture replay that found
the tiles a pass's draws reach for it (render/capture.rs, bind::capture_assembly_module,
capture_settle_module, tile_reach_module, the translator's capture form
LoweringInputs/VariantKey::captured_positions, CaptureForm, RuntimeFact::CapturedPositions,
PushField/PushHole::CaptureAddress, Feature::TileReach, StatusBits::CAPTURED_REACH_UNMEASURED,
StatusReport::captured_reach_unmeasured) and the pipeline states' capture forms are deleted, with
ExtendedRange::load_code, Degradation::UnreachedTilesRewritten and the WorkCounts fields
unused_bits_load_passes, unused_bits_load_texels and capture_reach_*. Every draw in such a pass
announces extended-range-bits-kept, naming the attachments (render/tile_store.rs, the renamed
module); its catalogue entry, the FAST-PATHS device-gap row and the format docs state what
differs: the unused bits, BGRA10_XR's alpha clamp, a padded sRGB twin's table and a bfloat code
through half, which Metal's pass rewrites in each tile a draw reaches. snorm-minimum-kept and
shared-exponent-kept are unchanged (TileStoreIsMetals still says where the device's store is
Metal's).
The de-indexed and private list forms keep the index read the capture form shared
(PushField::CaptureIndexAddress, CaptureLayout, CapturedIndex); the binder's de-indexed draw no
longer goes through the capture draw, and the vertex function's strip restart return, which only
the capture form's layout could take (a de-indexed strip is NotImplemented(PrimitiveId)), is
gone.
Why: the owner's rule 1. The device has a native load and store; reproducing Metal's tile store
emulated Metal's bits where the device has a native form. The difference is recorded and
announced (rule 2).
Verified: cargo clippy -D warnings, all targets and features, over metal2vulkan,
metal2vulkan-runtime, metal2vulkan-validation and metal2vulkan-conformance, plain and with
--cfg m2v_gpu: clean. api_signatures blessed, REFUSALS.md regenerated. The test runs (translator
and runtime suites, the touched validation lanes on lavapipe and on the M3 Max's MoltenVK) follow
this commit and are reported with the lane.
* Bump the semantics and runtime versions for the device's tile store and depth bias
What: SEMANTICS_VERSION 1907 -> 1908 and RUNTIME_VERSION 1681 -> 1682.
Why: SEMANTICS_VERSION, because the translator's output changes under unchanged keys: the
de-indexed and private list vertex forms no longer carry the strip restart return, and the
capture form, its runtime fact and its push field are gone. RUNTIME_VERSION, because runs of
unchanged artifacts now do something else: a Depth16Unorm depth takes the device's depth bias
(no depthBiasExact or unit rescale), and a pass that loads an extended-range, padded or bfloat
attachment keeps its untouched texels' bytes (no unused-bits load pass, no capture replay) and
announces extended-range-bits-kept. ARTIFACT_FORMAT_VERSION stays: the codec tags variants by
name, and the removed ones (CaptureForm, PushField::CaptureAddress,
RuntimeFact::CapturedPositions) leave their tags unused, so an old entry holding one is a miss.
Verified: the constants alone change; the golden tables and the runtime-sources pin are
re-blessed at landing.
* Hold the lanes and the fact census to the device's store of untouched texels
What: three runtime lanes still expected Metal's tile store after 5e710fb988 made the device's
store the only form, and the mechanism test still counted the deleted
RuntimeFact::CapturedPositions.
- extended_range_blends::a_pass_of_extended_range_and_padded_colors_names_each_loaded_color:
the padded colors, which the function does not write, keep their bytes (all ones), where
Metal's pass leaves each word 0xffc0.
- extended_range_blends::a_fetched_two_plane_attachment_written_unblended_stores_metals_write:
color 2, loaded and unwritten, keeps its bytes, where Metal's pass zeroes its color words' top
two bits.
- extended_range_blend_table::a_memoryless_color_2_blends_as_a_stored_color_does: the stored
color 0's bands are compared with the unused bits as Metal's pass leaves them
(as_metal_leaves), the codes exactly, as the table's other passes already are.
- device::tests::mechanism: the variant census is 0..89 (MergedDraws takes the freed index).
Why: the lanes held the deleted exact form; the device's store is now the contract and
extended-range-bits-kept announces the difference.
Verified: on the M3 Max (MoltenVK, --cfg m2v_gpu, under maclock and memcap) the three lanes and
the rest of extended_range_blends pass (11 of 11, with waiter_submits, which failed once under a
load of 40 and passed on its rerun); on plain, device::tests::mechanism and tests::fast_paths
pass (12 of 12); clippy -D warnings clean, plain and --cfg m2v_gpu, over the four crates.
* Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
|
||
|
|
487e23f3ee |
Declare a half color output 16-bit where the device enables storageInputOutput16
A fragment function's half color output is declared 16-bit where the device enables storageInputOutput16 and shaderFloat16, so the device blends the half Metal's attachment receives (the M3's 52 half-blend rows no longer diverge). SEMANTICS 1909, ARTIFACT 476. One work packet, landed as 6 commit(s) (9e8b40289e..f5e9c26fe3 on archive/development-linear-2026-10-28-evening), in order: * Declare a half color output 16-bit where the device enables storageInputOutput16 What: a fragment function's `half` color output through a variable of its own type (not an extended-range or word attachment's raw texel, not an attachment held with its channels rotated) is declared with 16-bit float lanes on a profile that enables `storageInputOutput16` and `shaderFloat16`, and stored by one OpFConvert of the f32 that holds the half (exact: the value is a half). The module then requires StorageInputOutput16 (derived from the Output pointer as before). `StageIo::half_outputs` lists the keys so link's contract check holds the module to the 16-bit declaration (`io_type_matches` takes the float width); the artifact codec carries the field. Every other interface variable stays 32-bit, and a device without the feature (lavapipe, NVIDIA's 615.71.09) keeps the half widened to float. Why: the widening hid the output's type from the device. With the half declared as a half, the device blends and converts the value Metal's attachment receives as its own half output: on MoltenVK that is Metal's compiler handling Metal's own output type. No Metal arithmetic is emulated and no note changes (HalfOutputPrecision and HalfOutputFastMathBlend fire as before; a computed fast-math output may still differ). Verified: - M3 Max, MoltenVK 1.4.2, macOS 27.0.1: `conformance replay` of the six `half-output-blends-*` cases: every value exact (verdict `announced`, the case's declared notice only); the 52 M3 rows of known-gaps.tsv (17, 17, 18 sites of r16f, rg16f, rgba16f) all read "no longer diverges", so they are removed. The 32-bit float formats stay exact. A replay of the 40 cases whose recorded fragment functions return half (half-output-blends-*, xr-*, rgb10a2-srgb-stores-h, render-then-sample-magnified-*, fragment-imageblock-reflection): 39 announced, 1 exact, no other ledger difference. - New unit test `a_half_color_output_is_declared_16_bit_where_the_device_enables_it` (moltenvk-m3 and amd-rdna3-radv 16-bit, lavapipe 32-bit; a float output and a rotated attachment 32-bit everywhere; L3 on each module). * Bump the cache versions for 16-bit half color outputs SEMANTICS_VERSION 1907 -> 1908: a fragment function's half color output is declared 16-bit on a profile that enables storageInputOutput16 and shaderFloat16, so its module's words and requirements change under an unchanged key (golden_hashes reports 657 cells changed; the table is re-blessed on the lane branch, not here). ARTIFACT_FORMAT_VERSION 475 -> 476: StageIo gains `half_outputs`, which the artifact codec encodes. Verified: cargo check; the version constants alone moved. * Regenerate the conformance coverage document for the 52 removed M3 rows What: docs/CONFORMANCE-COVERAGE.md, written by `python3 -I scripts/conformance-coverage/coverage.py`. Its ledger count goes from 1129 to 1077 rows and its ledger table loses the 52 Apple M3 Max rows of `half-output-blends-r16f`, `-rg16f` and `-rgba16f`, which the 16-bit half output commit removed from known-gaps.tsv (they read "no longer diverges" on the M3 replay). Why: the document is derived from the ledger, and `conformance_coverage::the_conformance_coverage_document_is_what_the_sources_derive` failed on the stale copy. Verified: the diff is those 52 lines and the count, nothing else. * Record the M3's safe-math half blends under the 16-bit half output What: PrecisionNote::HalfOutputPrecision's documentation said MoltenVK on the M3 Max stores Metal's bytes in every draw of the safe-math sweep. It now states what the lane measures with the output declared 16-bit, and that the NVIDIA, RADV, ANV and lavapipe bounds were measured with the output widened to float (RADV and ANV, which enable storageInputOutput16, now take the 16-bit form and are not re-measured: host away). Measured on the M3 Max, MoltenVK 1.4.2, macOS 27.0.1, with `runtime_lane::half_output_blends::half_output_blends_against_metals_rule` under --cfg m2v_gpu (the measurement prints HALF-BLEND-SUMMARY lines): - at this branch (16-bit output): R16Float, RG16Float, RGBA16Float 28 of 28 measured blend draws Metal's rule's value in every channel, largest distance 0; R32Float 28, RG32Float 28, RGBA32Float 26 of 28 (zero-1msa k0 and k4: one channel of 262,144 off by a zero's sign, distance 0); - at |
||
|
|
7cce610704 |
Delete the shader-side dropped-store mask
One work packet, landed as 5 commits (a31d02e99a..46c3156d42 on archive/development-linear-2026-10-28), in order: * Delete the shader-side dropped-store mask What. The per-stage mask of buffer slots whose stores the shader drops goes, with everything that existed only for it: - translator: the store-dropping lowering (lower/access/sink.rs; the guarded stores in emit, psb, pulled, dynamic, atomic and blob; the write-only store-sink binding and the OpSelect of two storage-buffer pointers that chose it, with its VariablePointers requirement), the specialization key, the stage-table field and their codec tags; - runtime: argument_table's dropped_store_buffers and its refresh, Buffer::drops_writes (now unused), the two variable-pointer enables, and SetZeroChoice.store_sinks (now the layout's set-0 bindings); - tests: engine_dropped_stores, engine_dropped_store_sink, the sink cases of neutral_zeros_shared, and dynamic_multi_variable's two encoders_plain tests, whose only binding of several variables was the sink. The narrow-unit kernel now runs at its buffers' starts and at moving offsets: the moved run checks that a dynamic offset reaches every variable of its three-variable binding, and no dispatch at a moved offset reuses its predecessor's set in either form, since a slot read to its buffer's end has a range that moves with its offset; - the Apple M3 Max known-gaps row for host-page-writes-kernel-store-read-only at case/bytes-in-the-same-command-buffer-bytes, which this fixes. Removed public items: - metal2vulkan::bind::StageTable::dropped_store_buffers (field) - metal2vulkan::bind::StageShape::dropped_store_buffers (field) - metal2vulkan::pipeline::SpecKey::DroppedStoreSlots(Stage) - metal2vulkan::pipeline::SyntheticBinding::StoreSink - metal2vulkan::device::VkFeature::VariablePointers - metal2vulkan::device::VkFeature::VariablePointersStorageBuffer (the two features were asked for only by the sink's pointer select) Why. The mask was set only from Buffer::drops_writes, which is true only for host pages imported through a read-only view, and only macOS makes one (VIEWS_DROP_WRITES; ReadOnlyView::of is None elsewhere, and no_copy_options keeps the private bit off it). No other path set it: Linux writable imports, dma-buf imports (excluded where writes drop), heaps (the same import) and argument buffers (which name no slot). On that memory the view already takes the GPU's writes nowhere, so the shader-side drop was redundant there. It was also wrong: a later command of the same command buffer reads the stored words back from the GPU's caches on Metal (8 runs of 8 on the M3 Max), and the shader-side drop made it read the pages' own bytes. Versions, placeholders for the landing to renumber: SEMANTICS_VERSION 2000, ARTIFACT_FORMAT_VERSION 500 (the codec loses four tags), RUNTIME_VERSION 1840. api_signatures.tsv re-blessed, docs/REFUSALS.md and docs/CONFORMANCE-COVERAGE.md regenerated, the runtime sources re-pinned. FAST-PATHS: the read-only-memory known gap now says what is true (writes reach the pages off macOS), and the dynamic multi-variable row is scoped to bindings whose range stays as their offset moves. Verified: - metal2vulkan suite: 3329 of 3330 pass. golden_hashes moves 3391 cells (every module with a device store loses its guard); the table is re-blessed on development. - clippy -D warnings clean, plain and with --cfg m2v_gpu; rustdoc -D warnings clean for the four touched crates. - MoltenVK 1.4.2 on the M3 Max: conformance replay of the four host-page-writes cases exits 0, both kernel-store cases exact (the visibility pair "announced", the fast-math notice, as before). The host-page, read-only and private-bit lanes and argument_table, neutral_zeros_shared and dynamic_multi_variable pass. - lavapipe (arm64, linux-gate): full conformance replay exits 0, its 891 gap rows exactly the ones the ledger expects on the venue (none unlisted, none stale); the same lanes pass. * Lane: a kernel's stores into private-bit memory reach only its own command buffer What. runtime_lane::degrade_notices gains a_kernel_s_stores_into_private_bit_memory_reach_only_its_own_command_buffer. It dispatches a4_index_word into no-copy memory of an anonymous mapping, filled with 0xab and made with Metal's private option bit 24, bound 512 bytes in, then copies the first 1024 bytes in the same command buffer and in a later one, and reads them from the CPU. Why. It holds Metal's measured answer where the runtime gives it: the same command buffer's copy reads the stored words, everywhere; on macOS, where the pages come through a read-only view, the later command buffer and the CPU read the pages' own bytes and nothing is announced; elsewhere they read the stores, announced once as the private-option notice. Every byte the stores do not name keeps 0xab at every site. Verified: MoltenVK 1.4.2 on the M3 Max prints "drops writes true; same command buffer stored true, later command buffer stored false, CPU stored false" and passes; lavapipe (arm64) prints "drops writes false; ... true, true, true" and passes. * Number SEMANTICS_VERSION 1907, ARTIFACT_FORMAT_VERSION 475 and RUNTIME_VERSION 1681, past development's The dropped-store mask's deletion took the placeholders 2000, 500 and 1840; development is at 1906, 474 and 1680. * Re-bless the golden tables after the dropped-store mask's deletion Every module with a device store loses its read-only guard (a31d02e99a), so bless_golden_hashes moves 1330 rows of golden_hashes.tsv; bless_engine_inventory, bless_engine_goldens and tests::air_input wrote nothing new. Verified: the three bless runs and air_input exit 0 at 623f8d2170. * Re-bless the authored compile census after the dropped-store mask's deletion corpus-triage --audit authored-compile --bless over 2253 cases and 21 profiles: 0 differences, 0 regressions, 0 failed, 20159 artifacts moved by hash alone (the store guard's words). Slowest compile 586 ms, slowest case across all profiles 18.5 s, peak worker RSS 231 MB. Verified: the census run above at 623f8d2170. |
||
|
|
524c2f7346 |
Record the device's own alpha to coverage as a native precision note
One work packet, landed as 4 commits (f6834405b7..7ec539ceb2 on archive/development-linear-2026-10-28), in order: * Record the device's own alpha to coverage as a native precision note What: a render pipeline that keeps alpha to coverage now records `PrecisionNote::DeviceAlphaCoverage` on its fragment stage, which the runtime announces as `device-alpha-coverage`, on every profile not measured to cover as Metal does. `link::graphics::coverage_notes` decides it from the graphics state alone and hands it through `Linked`'s new `fragment_notes` and `fragment_properties`, as the vertex stage's fixed-function notes already go. A profile that takes the new measured driver fact `DriverDeviation::MetalAlphaCoverage` (MoltenVK on Apple's GPUs of the M3 Max's macOS 27 identity, the APPLE9 row) records no note and requires `VkProperty::MetalAlphaCoverage` instead. Why: Vulkan specifies no algorithm for turning an alpha into a coverage mask, and Metal's is not the floor rule we assumed. Measured on the M3 Max (macOS 27.0.1) over 639 alphas a sample count with our own probe (probes/alpha_coverage_sweep.m): one sample covers above an alpha of 1/2; two and four samples cover ceil(alpha * n - t), t a 2x2 ordered dither. Under rule 1 the device's answer is the contract, so the note records it and nothing in the shader or the sample mask imitates Metal's. Bound, pixel by pixel against Metal's committed reading (runtime_lane::alpha_coverage, 10,224 pixels a count): lavapipe (Mesa on LLVM 21.1.8, arm64) dithers at one sample too, 2,560 pixels apart (a whole fragment stored or dropped), and at four samples 96 pixels one sample apart, all within an f32 ulp of a threshold; every pixel within floor..ceil of alpha * n. MoltenVK 1.4.2 on the M3 Max: 0 apart at 1, 2 and 4 samples (its reading is byte-identical to plain Metal's). NVIDIA is unmeasured beyond its known-gaps row. Stated in the note, the runtime kind, docs/API.md's catalogue and docs/FAST-PATHS.md's device gaps; `CoverageReadsRoundedAlpha`'s docs now say its bound is the rounding's alone. Validation derives no tolerance from it (`Allowance::Unbounded`). Versions: SEMANTICS_VERSION 1980, ARTIFACT_FORMAT_VERSION 490 (the codec gains a note and a property), RUNTIME_VERSION 1790. Verified: tests::engine_alpha_coverage (five profiles, 1 and 4 samples, coverage on and off) passes and fails with the note's recording removed; the lane passes on lavapipe (linux-gate arm64) and on MoltenVK (maclock), printing the counts above and asserting the announcement iff the note; nextest of metal2vulkan, -runtime, -conformance and -validation pass but for the golden table (stale at this base; against development's re-blessed table only the moltenvk-m3 profile fingerprint moves) and the runtime sources pin, both re-blessed on development; clippy (all features, and --cfg m2v_gpu) and rustdoc clean; api_signatures.tsv re-blessed. * Declare device-alpha-coverage native in the suite and fix Metal's coverage rule What: `replay::NATIVE_NOTES` gains `DeviceAlphaCoverage` (the coverage class), so no a2c case must declare the notice the device announces at its own coverage; values still compare field by field. The two `a2c-on-1-alpha-50` known-gaps rows (llvmpipe, RTX 5080 Laptop) keep their identity and now name the note and its bound: on llvmpipe the measured dither and counts; on NVIDIA the bound is open until the coverage lane's sweep runs there. `alpha_coverage_pairs`' model and docs, and `render.rs`'s field doc, said Metal covers floor(alpha * n) samples; they now state the measured rule (above 1/2 at one sample; ceil(alpha * n - t) under a 2x2 ordered dither at two and four), and the model's test holds the cases' recordings to it. docs/CONFORMANCE-COVERAGE.md regenerated. Why: the suite's standing declarations name every note that is the device's native answer, and the rows must say what differs and whose answer it is. Verified: the conformance suite passes (nextest); coverage.py and refusal_surface.py regenerated (REFUSALS.md unchanged). * Number SEMANTICS_VERSION 1906, ARTIFACT_FORMAT_VERSION 474 and RUNTIME_VERSION 1679, past development's The alpha-coverage note took the placeholders 1980, 490 and 1790; development is at 1905, 473 and 1678. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
12e64034b3 |
Hold back the clear's conversion note where MoltenVK's load operation clears as Metal's
One work packet, landed as 5 commits (36c1f6d2ed..bad631efa8 on archive/development-linear-2026-10-28), in order: * Hold back the clear's conversion note where MoltenVK's load operation clears as Metal's A render pass's CLEAR load operation of a colour attachment its render area covers is, on MoltenVK, Metal's own Clear load action, so the texel it stores is Metal's. The new DriverFact::ColorClearIsMetals records that for MoltenVK on the Apple9 GPUs under macOS 27, and the pass layout withholds device-color-conversion for such a clear there. A clear that is not that load operation still announces the note on every device: a clear over a smaller render area (vkCmdClearAttachments, a quad draw on MoltenVK), a clear made before the pass of an attachment its first instance leaves out, and a memoryless attachment's backing. Measured with the renders lane's clear case set (clears_are_the_device_s_conversion_of_the_clear_value) under MoltenVK 1.4.2 on the M3 Max, macOS 27.0.1, before the change: 71 colour clears, 11 depth and 4 stencil, all 86 texels Metal's bytes, none a code apart. The lane now also asserts the note stays unannounced where the fact holds; the dont-care and colour-reformat lanes expect it only where their clears are not a covering load operation (tie_cleared's new flag). RUNTIME_VERSION 1760; api_signatures re-blessed for the new variant. Verified on MoltenVK (M3 Max, --cfg m2v_gpu): the renders clear lane (86 checked, 0 apart, no device-color-conversion), runtime_lane::dont_care_stores (4) and runtime_lane::color_reformat (6) pass; device::tests::driver_facts passes. * Resolve into an sRGB twin by the device's own sRGB decode and encode A multisampled 8-bit UNORM attachment resolving into its sRGB twin is the crate-owned resolve on every device, and it applied Metal's 12-bit sRGB tables. Under the native-arithmetic rule the device's conversions are the only form where the device has them, so where the device renders the sRGB format the resolve now reads the samples through a view in the sRGB format (the device decodes each sample), averages the decoded values (their f32 sum times 1/n) and writes the average through the resolve attachment's own sRGB view (the device encodes it); the alpha keeps the unorm rule. An attachment read from a copy gets a scratch image mutable to the sRGB view. A device without the sRGB format keeps the tables through the raw UNORM views. bind: ColorResolveFormat::device_srgb / decodes_on_device, the device_mean lowering, and the tables only for the table form. runtime: of_resolve picks the form (color_resolve::decodes), the plan reads through the sRGB view and skips the raw write, twin_read_view makes a stand-in mutable to the sRGB view, resolve::scratch_viewed. device-rounded-resolve is announced for such a resolve on every device; docs (degradation, API.md, FAST-PATHS sRGB row, the module docs) say so. Measured with the new lane resolve_rounding::a_twin_resolve_into_srgb_rounds_as_announced (every pair of codes at 2 samples, the lane's pattern at 4, RGBA8 and BGRA8): MoltenVK 1.4.2 on the M3 Max 696 of 262,144 channels one code below Metal's at 2 samples, 880 of 524,288 at 4; lavapipe (Mesa 26.0.8, 4 samples only) 57,865 of 524,288, above and below; none past one code. The model in the bind tests gives 1,758 of 65,536 pairs one code apart with correctly rounded conversions. The resolves lane's twin texels now hold each colour channel to the note's two codes (lavapipe writes 0xbb where Metal's is 0xbc). Verified: the twin lane, runtime_lane::resolves (19), runtime_lane::resolve_rounding (4) and the dont-care twin case pass on MoltenVK (--cfg m2v_gpu) and on lavapipe (--cfg m2v_cpu_icd); the bind color_resolve tests (20) and the runtime color_resolve, image_plan and stand-in unit tests pass; clippy clean plain and with --cfg m2v_gpu. api_signatures re-blessed for the two new methods. * Make a plain colour fill the device's clear where the device renders the format fillTexture:level:slice:region:color: (Apple SPI) packed the colour on the host by Metal's fill rules in every format. Under the native-arithmetic rule the device's own colour conversion is the only form where it has one, so a plain fill (no pixelFormat:) of a texture whose format's fill converts a float (normalized, sRGB, half, float, small float, shared exponent; fill_value::device_converts), whose image holds Metal's bytes of the format, and which the device renders and copies both ways, is now the device's clear: a scratch image of the region in the texture's image format, samples and dimension, cleared whole by vkCmdClearColorImage, copied into the region of each image the fill writes through the blit copy path, placed as the fill. Integer formats (no conversion), the extended-range and bfloat formats, texture buffers and every format the device does not render keep the host packing; the pixelFormat: variant keeps it everywhere (capability). The clear's note is recorded where it applies against Metal's fill packing, not its clear: device-color-conversion where fill_value::device_apart holds (a normalized value within 1/1024 of a tie, widened by the fill's float product and, for the packed 16-bit formats, a step through half; an sRGB value inside (0, 1); a value a half, small float or shared exponent does not hold), device-nan-encoding for a half or small-float NaN. The fill slot still takes the packed texel. The call is logged as itself (BlitCall::FillTextureColor) so a re-encode clears again. Lanes: color_fills::plain_color_fills_are_the_device_s_clear fills the probes' 762 colours into each of the 70 formats plain and packed, notices asked for at each fill, and holds every texel to Metal's or, where that fill announced, to a code (a NaN for a NaN); it asserts an RGBA8Unorm_sRGB fill announced device-color-conversion, which the host packing never does. color_fills::plain_color_fills_land_where_packed_ones_land checks the 31 placement cases byte for byte. The Metal-hash test now packs by pixelFormat:, texture_fills runs its plain colour cases packed (Metal's bytes), and the RGBX fill test accepts an announced code. Unit test for the predicates in tests::fill_value. Measured (plain against packed, 762 colours a format): lavapipe (Mesa 26.0.8) rounds a half toward zero (RGBA16Float 420 texels a code apart), an 8-bit tie down (RGBA8Unorm 20), and writes its own RG11B10 NaNs (275); MoltenVK 1.4.2 on the M3 Max keeps RGBA8Unorm exact, stands RG11B10Float 186 and RGB9E5Float 150 texels a code apart, and writes 0x7e00 for Metal's 0xfe00 half NaN; every one announced. Verified on MoltenVK (--cfg m2v_gpu) and lavapipe (--cfg m2v_cpu_icd): runtime_lane color_fills, texture_fills, rgbx_textures, sample_fills, surface_fills, texture_buffer_fills and two_plane_copies pass; runtime unit tests (fill, replay, blit) pass; clippy clean plain and with --cfg m2v_gpu; rustdoc clean. * List lavapipe's own clear at seven plain texture fills A plain colour fill of a format the device renders to is now the device's clear (6cdfe023d9), so the texture-fills conformance case's digest moves on the gate container's arm64 lavapipe at seven formats: ABGR4Unorm, RGBA8Unorm, RGBA8Unorm_sRGB, BGRA8Unorm, BGRA8Unorm_sRGB, RGBA16Unorm and RGBA16Float. The site is digest-only, so the same fills were run per texel through the color_fills lane's helper on that venue (a throwaway probe, not committed). Of the case's four plain colours only c5's (2, -1, 0.5, 0.3) differs, in its alpha alone, one code below Metal's: 0.3 is a tie in 4, 8 and 16 bits (4.5, 76.5, 19660.5 codes) that lavapipe rounds to even, and lavapipe truncates the half (0x34cc for Metal's nearest 0x34cd). device-color-conversion records it at every such fill and its one-code bound covers it, so each row is the device's native answer, scoped to the measured build, with nothing open. Verified: conformance replay --cpu on lavapipe (llvmpipe LLVM 21.1.8, 128 bits) exits 0, the 825 rows exactly the ledger's (no unlisted, no stale); the ledger's unit tests pass; replay --gpu of the 54 texture-fills cases on MoltenVK 1.4.2 / M3 Max: 37 announced, 17 exact, none divergent. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
44910ecabd |
Hand pixel samplers' scaled coordinate to the device; test the unflushed subnormal coordinate
One work packet, landed as 2 commits (255f93b252..aba772e24d on archive/development-linear-2026-10-28), in order: * Hand pixel samplers' scaled coordinate to the device; test the unflushed subnormal coordinate Rule 1: the device's sampler is the contract. A pixel-coordinate sampler keeps its capability (the shader divides the coordinate by the level-0 size, since Vulkan's unnormalized samplers take no gather, offset, comparison, array, 3D image or level of detail) and drops the correction that reproduced Metal's position at texel edges. Deleted: `AxisSnap`, `SnapKind`, `Snap` and the snap plan (`snapped_axis`, `gathered_by_word`, `celled_by_word` and their word estimates), the texel centring of nearest pixel samples (`centred`, `centre_word`, `pixel_centre`, `PIXEL_CENTRE_WORDS`), the snapped census names, the shared switch's sampled-image arms (it is bicubic only now), `SamplerWord::PIXEL_GATED` and `PIXEL_NEAREST`, the binder's gated keying and `lower::select::pixel_gated`. A runtime slot now specializes on its word's coordinates bit alone. Kept: the division by the size, `SampleOp::PixelFetch` (a constexpr nearest clamp-to-edge sampler's exact fetch) and the argument buffer's flagged exact fetch, and Metal's position, wrap and offset rules the emulated filters still use. `PixelSamplerScaling` is now recorded on every device, MoltenVK included: always for a constexpr pixel sampler but its exact fetch, and for a runtime slot under the clause that the bound word states pixel coordinates. `ArgumentPixelSamplerScaling` is recorded for every heap access and announced at a dispatch while any pixel state lives (not only a filtering one). The notes, the API.md catalogue and a new FAST-PATHS device-gap row state the measured bound: the device's normalized sampler at a coordinate within one f32 ulp of x/N on MoltenVK and at x/N on lavapipe; a linear downscale by 8 within 1/255 of Metal's on MoltenVK, 2/255 on lavapipe. Lanes: pixel_samplers holds each pixel configuration to its normalized control within REACH ulps of the quotient and asserts both notes on every device; pixel_downscales holds every set within 2/255 of the snapped control; mirror_clamp counts a pixel lane that reads Metal's normalized answer within REACH ulps apart; resource_ids expects the argument note where a pixel state lives at the dispatch; the argument-note test waits for any pixel state. The pixel conformance cases declare `pixel-sampler-scaling`; known-gaps rows for their llvmpipe sites are replaced (38 stale, 40 new, at the end) and 22 Apple M3 Max rows appended, each naming the note. Subnormal coordinates (e7775e4c82 removed the flush): `a_subnormal_coordinate_reaches_the_device_unflushed` traces every sample and gather coordinate of constexpr border samplers (1D, 2D, 3D, gather; nearest and linear; zero and white borders) back to the loaded value through bit moves alone, on every committed profile, and holds a kernel whose AIR flushes the coordinate as not passing through. SEMANTICS_VERSION 1960; RUNTIME_VERSION 1676 (the argument note's announcement and the binder's sampler key changed). Verified: - cargo clippy --workspace --all-targets --all-features -D warnings, plain and --cfg m2v_gpu; RUSTDOCFLAGS=-D warnings cargo doc --workspace --all-features --no-deps. - Core suites (4953 tests): all pass but golden_hashes (3776 cells move, left for the re-bless); api_signatures fixed here. - Negative controls: on development's code, 7 of the new or changed sampler tests fail; with the removed flush put back in plane_coord, the subnormal test fails (border 1d zero). - Words (lavapipe; MoltenVK and NVIDIA alike in step): px_sample_argument 2869 -> 2641, xr_sample_runtime 1175 -> 967, px_const_linear_* 1078 -> 943, pix_gather_edge 1089 -> 920, runtime_gather 1165 -> 944; constexpr nearest-edge and the normalized control unchanged; spirv-val PASS on each. - Lanes on lavapipe (linux-gate arm64) and MoltenVK (M3 Max): pixel_samplers, pixel_downscales, resource_ids, mirror_clamp pass; on MoltenVK argument_linear_samples' half RGBA32Float heap groups, driver_deviations and one degrade_notices test fail, none through a pixel path. - conformance replay --cpu (whole set, lavapipe): exit 0, nothing unlisted, no stale row. The pixel cases on MoltenVK: every value site as listed; each case's set-past-layout-support notice is unlisted there, as in the untouched argument-encoder-texture-sampler. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
9afdb1e150 |
Take the device's instruction for pack, dot, mix, sqrt, exp, log, sign, fract, median3, fneg and fabs
One work packet, landed as 6 commits (3d6b2488ea..f1693ce8c4 on archive/development-linear-2026-10-28), in order: * Take the device's instruction for pack, dot, mix, sqrt, exp, log, sign, fract, median3, fneg and fabs Rule 1: where the device has a native form it is the only form. The translator still computed Metal's own bits for several functions the device has an instruction for. Each now takes the instruction, its difference from Metal recorded as a note: - air.pack/air.unpack: GLSL.std.450 Pack/Unpack Unorm4x8, Snorm4x8, Unorm2x16 and Snorm2x16; rgb10a2 and rgb565 by the device's NClamp, multiply, RoundEven, and multiply by the reciprocal; unorm4x8_srgb by the MSL transfer functions with the device's Pow around the 8-bit instruction (no table read, no NaN select). New note DevicePackConversion (device-pack-conversion), not recorded for a float conversion of the four named formats on MoltenVK. - dot, mix, fast::sqrt: OpDot, FMix and Sqrt on every device, MoltenVK included (the Mix/Dot/ChunkedChain strategies, Metal's fma chains and x * rsqrt(x) are deleted). NativeDot/NativeMix everywhere but a float one on MoltenVK; a chunked dot sums each chunk's OpDot. - precise exp/log and half exp/log/pow/powr/sinh/cosh/tanh: GLSL Exp, Log, Pow, Sinh, Cosh, Tanh (Metal's compositions, half_tanh and the half remaps deleted); half Fun kinds keep the notes honest on MoltenVK. - fract, sign, median3: Fract (bounded below one, the definition), FSign, NMin/NMax; their special-value fixes are deleted. median3 is NativeMinMax on every device (two NaNs, f32 denormals). - round keeps half-away-from-zero from Trunc without the +0 fix: C99's -0, NativeTranscendentals on every device. - float fneg/fabs: OpFNegate and FAbs, the NaN payload NativeNanEncoding and fneg's denormal DeviceDenormals. Kept: exp10/log10 compositions, fmod's routine, ldexp on bits, sinpi/cospi/tanpi, the fast_ formulas, pow/atan2 C99 specials, the saturating convert, round_integer. math::pack/unpack stay for the tile, attachment, fetch and texture callers. The interpreter models the normalized packs. SEMANTICS_VERSION 1920, ARTIFACT_FORMAT_VERSION 469 (a PrecisionNote variant). Verified so far: clippy -p metal2vulkan --all-targets --all-features -D warnings; rustdoc; nextest lower::arith (244 tests) and the engine_arith, engine_float_call_notes, engine_native_maths, engine_spirv_cross_forms, engine_native_half modules. * Delete the measured half quantize deviation; hold dot and median3 lanes to the device After the half follow-ups, no module requires VkProperty::MetalHalfQuantize: a module that rounds to half through OpQuantizeToF16 records NativeHalfQuantize on every profile, and nothing decides on DriverDeviation::MetalHalfQuantize. Delete it with its property, its derive and profile arms, its codec entry, its four measured rows (MoltenVK on Apple9, RADV on the 780M, ANV on the UHD 770 and the Iris Xe), the driver-facts test rows, and the lane assertions that it required nothing (engine_native_half, engine_arith, driver_deviations' half quantize and owned half edge lanes, native_maths' half rounding lane). Docs that named it (NativeHalfQuantize, narrow::quantizes, driver_facts) now say Vulkan leaves the quantize's rounding to the device. The lanes follow the previous commit's native forms: - driver_deviations' dot lane: dot is the device's OpDot on every device, so the half words (a dot of half lanes held as float) are no longer checked against Metal's fused 16-bit chain; the float words stay checked where the profile takes MetalFloatFunctions (MoltenVK, whose OpDot is MSL's own dot), and every kernel must record NativeDot. - driver_deviations' min/max lane: median3 is NMin/NMax on every device and records NativeMinMax, so its word (the seventh of each lane) is printed, not checked; every kernel must record NativeMinMax. - the denormal probe and native_maths docs name the device's OpDot and FMix. api_signatures re-blessed (DevicePackConversion added on both crates; the two MetalHalfQuantize variants removed). REFUSALS.md regenerated, unchanged. Verified: see the branch report. * Hold the sRGB pack bound and round's zero to what the devices answer The conformance replay on lavapipe and the MoltenVK lanes read the previous two commits' native forms against Metal: - sRGB unpack and pack: Metal decodes through its twelve-bit table (the step k / 4095 nearest the transfer) and encodes by that table's byte, where the module takes the MSL transfer by the device's Pow. DevicePackConversion's bound (artifact, runtime, API.md, FAST-PATHS.md) now says so: a decoded colour within half a twelve-bit step (1/8190) of Metal's step, beyond Pow's bound. Measured on the authored cases (lavapipe and MoltenVK): every float decode within 1.2205e-4 of Metal's, every half within that and one half ulp, every encoded channel within one code, no alpha differing; normalized packs a code apart at ties, a NaN channel the device's. - known-gaps.tsv: pass-bytes-srgb-decode-all-bytes's row takes the new answer (1153 elements, largest 0x00F90000) and names device-pack-conversion; a new row for pass-bytes-srgb-encode-sweep (772 elements, largest 0x00010101); pass-bytes-half-tanh-regimes's answer moves to 1257 elements (half tanh is the device's Tanh). CONFORMANCE-COVERAGE.md regenerated. - driver_deviations' denormal probe: round is C99's on every device (NativeTranscendentals), whose zero below zero is -0 where Metal answers +0, so its word (15) is printed, not checked. On MoltenVK it was the lane's only failing word (48 of 4096). Verified: conformance replay on lavapipe (arm64 gate container) exit 0, nothing unlisted or stale; driver_deviations' float_denormals, owned_dot and minimums lanes pass on lavapipe and on MoltenVK (M3 Max); conformance and degradation tests pass. * Hold the engine maths tests to the device's instructions engine_metal_math and engine_native_maths still asserted Metal's forms that the native change replaced; they skip without llvm-as, so the earlier focused runs missed them. - engine_metal_math: a half fast_tanh is Metal's half tanh (Metal's half functions are the same in both math modes, and MSL's fast-math formulas are its float ones), so it is the device's Tanh, no Exp2 and no division, as the code already lowers it; the float fast_tanh keeps the MSL formula and its assertions. sign is the device's FSign with and without fast math. Both record NativeTranscendentals wherever the device's functions are not Metal's own; on MoltenVK sign is MSL's own (no note) and a half tanh is MSL's float tanh rounded to half (DeviceTranscendentals). The sRGB fixtures now assert Pow beside UnpackUnorm4x8 / PackUnorm4x8, no table, and DevicePackConversion; the interpreter models no Pow, so the table reference values and the interpreter run go (their values are the device lanes'). The test is renamed metal_math_variants_select_their_forms. - engine_native_maths: dot, mix and fast::sqrt are OpDot, FMix and Sqrt with no Fma on lavapipe and on MoltenVK, a float dot and mix noting nothing on MoltenVK and a half mix NativeMix; the values hold their notes' bounds on both profiles' interpreter runs, where the test used to claim Metal's fused chains word for word on MoltenVK. - refine_float's doc: air.fast_sqrt is the device's Sqrt; engine_tiny_products' doc: the module's dot is the device's OpDot. Verified: with llvm-as set, every engine_ and lower::arith test passes (1610); clippy clean. * Number ARTIFACT_FORMAT_VERSION 473 and SEMANTICS_VERSION 1904, past development's The fast-math landing took ARTIFACT_FORMAT_VERSION 470 and the sampler-details landing 472 and SEMANTICS_VERSION 1903, so this series' encoding (the new DevicePackConversion note and the removed MetalHalfQuantize property in the codec) takes 473, and its translation changes 1904 (set in the series' first commit at the rebase onto 322dc6354d). * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
ae70850097 |
Take the device's native texel rounding, residency, level clamp and stores
One work packet, landed as 7 commits (d1161d6b38..322dc6354d on archive/development-linear-2026-10-28), in order: * Take the device's native texel rounding, residency, level clamp and stores Rule 1: where the device has a native form it is the only form, noted where it can differ. - Half texels on MoltenVK: a `half` read, sample or gather is the device's `float` texel (Metal's there) rounded to nearest even. The routine keeps only the YCbCr 8192 grid's ties away (the YCbCr work's), so the Metal-sampler families (32-bit float sample toward zero, the 16-bit normalized grids' exact half, the unmeasured class) go, with `HalfFamilies`, `HalfForm`, the grid constants and `texel_round::ones_ratio_*`. `HalfTexelConversion` is recorded under the bound format for a 32-bit float sample, a 16-bit normalized texel and an unmeasured format. - Subnormal coordinates: the clamp-to-zero flush is gone; the device reads the coordinate (`DeviceSampling`). - Residency: on a device with `shaderResourceResidency` a sample's or gather's word is the device's sparse residency (`SparseResidency`); Metal's footprint rule and the tile map stay only where the device has no residency of its own. `Probe`, the named footprint taps and the zeroing of them go. - Level clamps: a sampler's `lodMinClamp`/`lodMaxClamp` reach the device as given, not snapped to Metal's 1/64 grid; MoltenVK's Metal sampler snaps itself. Level queries are noted `DeviceSampling` off MoltenVK. - Stores: an integer texel written into a half-float or `RG11B10Float` storage texture of the float class is the store's to convert (noted `DeviceColorConversion`), and a `float` blend into a 16-bit float attachment through the pixel interlock is the store's to round (Metal's where the profile takes `MetalHalfStorageWrites`, else noted). Only `TextureWriteRoundingMode::NearestEven` keeps the shader's rounding (no store gives it). - color_writes.rs docs: drivers round small floats toward zero as measured. Docs: FAST-PATHS rows 60/61 and the subnormal gap removed; API.md catalogue entries; `PrecisionNote` and `DriverDeviation` docs. SEMANTICS_VERSION 1950, RUNTIME_VERSION 1750 (the runtime's sampler cache docs and test). Verified: cargo clippy --workspace --all-targets --all-features -D warnings clean; the metal2vulkan suite (3370 tests) with every failure fixed or updated to the native answer (half_texel, texture_interp's 16-bit grid, srgb_decode, the sparse binder tests, cross-class writes on the interpreter, fetch_blend16_narrow); golden_hashes moves and is left for development's re-bless; api-signatures and refusal-surface checks unchanged. * Take Vulkan's cube-gradient rule on a driver whose route is not measured A MoltenVK release or GPU whose cube-gradient route no measurement covers took Metal's anisotropic level and taps in the shader (`CubeGradientRoute::Unmeasured`), and elsewhere an isotropic sampler made for the use. Rule 1: the device has a native gradient sample, so it is the only form. Such a driver now takes `CubeGradientRoute::Vulkan` (the form Vulkan's derivative rule reads), the device's reading recorded as `CubeGradientFootprint`; the emulation stays only for a device without `samplerAnisotropy`. With the variant gone nothing sets the isotropic-sampler use, so it is deleted throughout: `SamplerUse::cube_gradient` and `with_cube_gradient`, `CombinedSampler::cube_gradient` and its index bit, `HandleClass::Sampler`'s `cube_gradient` (four heap sampler classes, not eight), the binding keys, the plan's `WriteSource::Sampler`/`ArgumentSampler` and `SamplerSource::Slot` fields, the codec, the runtime's and the validation executor's binders. The anisotropic emulation loses its isotropic one-tap form and the `answered` input. Consumer-visible: `SamplerUse`, `CombinedSampler`, `HandleClass::Sampler`, `WriteSource` and `SamplerSource` lose the field; `CubeGradientRoute::Unmeasured` is gone (api_signatures blessed). ARTIFACT_FORMAT_VERSION 470 (the encoded classes and symbols changed). Docs: profile.rs and error/mod.rs route docs, the AnisotropicFilter and CubeGradientFootprint notes, API.md's catalogue, FAST-PATHS's unmeasured-route gap removed. Verified: workspace clippy (all targets, all features) clean; nextest of the touched families (engine_sampler_unk, engine_heap_binder, engine_handles, anisotropic, driver_facts, cache, bind heap/plan, sym, metal::sampler, link, runtime sampler_cache, validation argument_buffer_members, api_signatures/api_surface/fast_paths): 429 run, all pass after updating the tests to the Vulkan route. * Ledger lavapipe's halfway nearest-mip level under a descriptor clamp With the level clamp handed to the device as given, lavapipe rounds a nearest mip filter's level at `lodMinClamp` 1.5 up to level 2 where Metal reads level 1; Vulkan allows either rounding at a half. The five `sampler-mip-*` sites are the device's native level selection: `DeviceSampling`'s docs (and API.md's entry) now state the shape, and known-gaps.tsv holds the five llvmpipe rows. Verified: `conformance replay --cpu` on lavapipe (linux-gate, arm64) listed exactly these five sites as unlisted and nothing stale; the conformance ledger tests pass. * Ledger the two filter-pair sites at their measured difference The two mixed-filter sites of sampler-mip-filter-pairs-nearest differ by 1000, as the other three do; the rows copied a truncated figure. Verified by conformance replay --cpu on lavapipe, whose rerun named these two rows both unlisted and stale. * Number ARTIFACT_FORMAT_VERSION 472 past the fast-math change's 470 Both the fast-math change and this series moved the artifact format to 470, so the rebase merged them silently; 471 is held for the maths-functions series. * Drop the YCbCr sample module's cube_gradient field, gone from CombinedSampler This series removed CombinedSampler::cube_gradient with the isotropic sampler use; the YCbCr sample module landed meanwhile still set it. Verified: clippy --workspace --all-targets --all-features -D warnings clean. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
cdc09276f3 |
Emit fast-math arithmetic in the AIR's order and let the device group and fuse it
One work packet, landed as 4 commits (c81ea84c14..41bbe0f1c2 on archive/development-linear-2026-10-28), in order: * Emit fast-math arithmetic in the AIR's order and let the device group and fuse it What. The translator no longer reproduces Metal's compiler's grouping, pairing and fusion of fast-math arithmetic. Each float operation is emitted in the AIR's order, decorated by its own fast-math flags: an operation whose flags hold `contract` and `reassoc` is undecorated, so the device's compiler may group and fuse it; every other one is `NoContraction` (an undecorated SPIR-V operation would also allow reassociation, which a `contract`-only operation does not), and a precise module's operations keep their order. `llvm.fmuladd` keeps its fused route: one AIR operation, answered by the device's fused instruction. Deleted: lower/arith/regroup.rs (648 lines), reassoc.rs (1469), contract.rs (585) and contract/chain.rs (1204); the Folded and Fused strategies, ArithPlan's `contract` and `unrounded` fields and select.rs's CONTRACTED read bit; output_precision's `plan` (the `unrounded` marking of half output chains, Metal's choice of where not to round) and the plumbing that existed only for it: LoweringInputs::half_output_lanes, the public HalfOutputLane, StageIo::half_output_lanes, color_writes' half_output_lanes check, its cache-key hashing and codec entry; Fma::on (tests only). Tests engine_reassoc (318), engine_regroup (134), engine_settled_sums (572), three engine_arith tests, three half-output-lane engine_stage_io tests and the fused_sync lockstep case, whose premises were Metal's grouping. Fixtures regroup_chain, sum_regroup, sum_regroup_precise, fmx2_contract_fast, fmx2_contract_precise and unm_contract_chain (.metal, .ll, .air.ll, their TOOLCHAIN lines and air_input printouts). Validation lanes sum_regroup (308) and settled_sums (394), and the three authored cases whose expected values were Metal's fusions (multiply-add-contraction-shapes-under-fast-math, multiply-add-contraction-flags-without-fast-math, multiply-add-chains-under-fast-math) with their observations. Kept: the contraction rule itself (AIR semantics); output_precision's notes (half_output_note, note_half_output, note_extended_range_sources), which state where Metal may differ rather than reproduce it; the F16 strategy's per-operation rounding. The note. The existing FastMathRewrites covers it: it is now recorded where an operation's operand comes from an operation the two operations' flags let a compiler regroup (both `reassoc`) or fuse (a product into a sum, both `contract`), looking through negation, widening, shuffles and element moves. No new kind. It moves from the ledger's elsewhere class to a device gap (docs/FAST-PATHS.md row; tests::fast_paths), joins the conformance replay's NATIVE_NOTES, and the cases' own declarations of it are gone (depth_texel_reads, half_read_nans, host_page_writes, mesh_draws, sample_positions, snorm_tile_store, visibility, topology_classes). New tests. tests::engine_fast_math_order: a fast `((d+c)+b)+a`, its precise twin, fast and contract-only `a*a+c`, and a fast vector product, on every committed profile: spirv-val, no fused instruction, one instruction per AIR operation, NoContraction exactly where the flags forbid contraction, the interpreter's answer in the AIR's order, and the note on every form but the precise sum. runtime_lane::kept_apart (reworks settled_sums): strict and contract-only mul-adds store two roundings, a precise sum stores the AIR's order, a fast mul-add stores either rounding, and the layer reports nothing. Versions: SEMANTICS_VERSION 1900; ARTIFACT_FORMAT_VERSION 469 (StageIo lost a field). Docs: FAST-PATHS.md, API.md (catalogue entry and policy), ARCHITECTURE.md (module map), artifact.rs's FastMathRewrites doc. api_signatures.tsv re-blessed. Verified (this machine unless named): - Negative control: on the parent tree both new core tests fail (a fast sum regrouped to 0x34000000 where the AIR order stores 0, the mul-adds fused, the product paired, no note); with the change they pass. - cargo check, clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; rustdoc -D warnings; refusal_surface --check; conformance and metal coverage current. - Core tests: engine_fast_math_order, engine_arith, arith::tests, engine_stage_io, engine_simd*, engine_native_*, engine_metal_math, engine_fetch_*blend, engine_bicubic, engine_rotated_weights, engine_extended_range, engine_float_call_notes, color_write, api_tests, compile tests, fast_paths: 469 + 83 passed. - The engine inventory bless (not committed) compiled every public fixture on all 19 profiles: 43593 ok cells, each through spirv-val; only the deleted fixtures' 28 rows went. - Conformance replay on lavapipe (linux-gate arm64): exit 0, the 723 rows are exactly known-gaps.tsv's, 0 unlisted. - Validation lanes on lavapipe (linux-gate arm64, --cfg m2v_cpu_icd): kept_apart and the lanes that assert notice sets (blits, degrade_notices, gpu_times, half_slice_nans, heap_metal_sizes, heap_textures, provoking, provoking_mesh, sparse_textures, ycbcr_passes): 93 passed. llvmpipe kept all 4096 fast mul-adds as written and all 4096 fast sums in the AIR's order. - kept_apart on MoltenVK (Apple M3 Max, --cfg m2v_gpu, under maclock): passed; the device's compiler fused 2370 of 4096 fast mul-adds and kept all 4096 fast sums in the AIR's order. - Release CLI before and after, back to back, on the deleted and most affected fixtures over moltenvk-m3, gate-lavapipe, nvidia-rtx5080-laptop and intel-irisxe-anv: wall within noise (about 8 ms of process start, +-3 ms on a loaded host). Words: hfb_filter_bank 148284 -> 162420 on moltenvk-m3 (half chains feeding a half output now round at each operation as the AIR says: +1408 OpFConvert, +1408 NoContraction; 289 OpFmaKHR became a multiply and an add), unm_contract_chain 33666 -> 35167, fmx2_contract_fast 18557 -> 18908, the rest within +-200. Not in this commit: the golden tables (6028 cells move in 347 subjects, 5707 of them under an unchanged key, 28 subjects go with the fixtures) and the engine inventory (28 rows go, none moves) are re-blessed on development; corpus/authored-compile.tsv keeps three lines for the deleted cases until its re-bless. * Read 16-bit operands directly and hold half chains at float without float16 What. Two forms of `half` arithmetic that were neither the device's native one nor the fast one: - Where a profile takes the device's 16-bit `+ - *` and `fma` (moltenvk-m3 on the measured fact, RADV and ANV under the 16-bit float controls), every `half` is held widened in an `f32`, so each 16-bit operation narrowed both operands and widened its result: three conversions an operation, the next operation narrowing what the last had just widened. `FunctionBuilder::convert` now answers a narrowing of a value it widened from a 16-bit float with that float (exact), and a narrowing of a plain constant whose lanes are zeros, infinities or normal halves with the 16-bit constant; the widenings nothing else reads leave with the dead code. A rounding's own pair (a narrowing widened back) is never taken apart, so `narrow::rounds_by_conversion`, which decides `NativeHalfConversion` and the controlled modes, still sees every rounding. A chain of 16-bit operations is now 16-bit instructions on 16-bit values, converted only where a value enters or leaves it. - Without `shaderFloat16` (vk12-floor, SwiftShader, Pascal) the module emulates `half` arithmetic in `float`, rounding each result by the device's quantize. New `DevicePolicy::half_chains`: `HalfChainPolicy::AtExits` (the default, the fast form) holds a `half` `+ - *` whose flags hold `contract` and `reassoc` and whose result only such operations read at `float` precision (`lower::arith::half_chain`), so a chain rounds where a value leaves it, one quantize per exit; `HalfChainPolicy::EachOperation`, which `exact_answers()` selects, rounds every operation. The profile carries it, so its fingerprint covers it. Recorded as `FastMathRewrites` (its doc and API.md's catalogue entry extended); a FAST-PATHS.md fast-default row; API.md's policy list. The forms by profile (unchanged, for the record): moltenvk-m3 takes the measured 16-bit arithmetic; RADV and ANV the controlled one; NVIDIA (the conversion pair folded, `HalfConversionPairFolded`) and lavapipe (no `DenormPreserve` for 16 bits) have `shaderFloat16` but compute `half` in `float` and round by the device's conversion pair, which this commit leaves as it is; the profiles without `shaderFloat16` quantize. Tests: tests::engine_fast_math_order::half_operations_read_their_16_bit_operands_directly (no narrowing of a widened half or a constant on any profile, the rounded chain stored, some profile takes 16-bit arithmetic) and ::half_chains_without_float16_round_at_their_exits_by_default (one quantize against two, the held and rounded answers, both policies on every profile, distinct fingerprints); runtime_lane::kept_apart::half_chains_without_float16_round_at_their_exits on the device. Updated, as the conversions they counted are gone (the half agent's files, minimal): lower::arith::tests::narrow::half_arithmetic_on_the_device_is_one_16_bit_instruction (at most two operand narrowings), tests::engine_arith::half_rounding_follows_the_operation (the chain's conversion count), tests::engine_arith::a_measured_half_sum_requires_the_arithmetic_fact_alone (a kernel whose halves only the 16-bit `fma` reads widens nothing, so needs no measured widening). Versions: SEMANTICS_VERSION 1901. ARTIFACT_FORMAT_VERSION unchanged (no encoded type changed). api_signatures.tsv re-blessed (the enum and the field). Words, release CLI, every module spirv-val'd (before = development 7b5cf8328d, then 622b388830, then this commit): - moltenvk-m3: hfb_filter_bank 148284, 162420, 140672; grd_half_many_samples 99039, 99330, 96710; nan_half_fast 10042, 10057, 9961. - nvidia-rtx5080-laptop: hfb 147962, 155474, 155474; grd 110944, 111163, 111163; nan 9888, 9882, 9882. - gate-lavapipe: hfb 148530, 155470, 155470; grd 111018, 111163, 111163; nan 9888, 9882, 9882. - vk12-floor: hfb 124826, 131766, 121270; grd 84482, 84627, 82019; nan 9838, 9832, 9808 (EachOperation reproduces 622b388830's: 131766, 84627, 9832). Verified: - Negative controls: with the narrowing fold off, the 16-bit test fails (amd-780m-hawkpoint-radv narrows a widened half); with the plan off, the chain test fails (two quantizes on lunarg-desktop-baseline-2023). Both pass with them on. - Core tests on this Mac: 1133 passed (arith, engine_arith, engine_native*, engine_stage_io, engine_fetch*, engine_simd*, spirv::*, device::*, cache::*, compile tests, api_tests, air_input, fast_paths, engine_fast_math_order, api_signatures, api_surface); conformance filtered tests 26 passed; clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; rustdoc -D warnings; refusal_surface --check. - The engine inventory bless (not committed) over every public fixture on all 19 profiles: only the deleted fixtures' 28 rows go, every other cell as before (spirv-val on each `ok`). - runtime_lane::kept_apart on SwiftShader (linux-gate arm64, --icd swiftshader): the `fast` chain 4096 of 4096 held under AtExits and 4096 rounded under EachOperation, the strict chain rounded under both; on lavapipe (whose compiler drops the undecorated conversion pairs: the `fast` chain 4096 held under both, the strict one rounded) and on MoltenVK (Apple M3 Max, under maclock: every chain rounded at each sum, the 16-bit arithmetic) both tests pass. - Lavapipe (linux-gate arm64): the conformance replay exits 0, its 763 rows exactly known-gaps.tsv's, 0 unlisted, the verdicts as at 622b388830; runtime_lane kept_apart, native_maths, half_* and degrade_notices: 28 passed. MoltenVK: the half_* lanes and native_maths' half rounding pass; native_maths_answers_within_its_recorded_bounds fails on NativeDivision (`divide::precise` records it everywhere; code this commit does not touch). Not in this commit: the golden tables (with 622b388830, 7652 cells move in 672 subjects; 28 subjects go) and the engine inventory (28 rows go) are re-blessed on development. * Number ARTIFACT_FORMAT_VERSION 470, after development's 469 What. development's own commit took 469 for its encoding change while this branch's first commit took 469 for StageIo losing half_output_lanes; the rebase merged the two equal lines silently, so two layouts shared one value. 470 keeps an artifact of either from decoding as the other. Verified: cargo check -p metal2vulkan --all-features --all-targets on the rebased tree. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
a1f1677174 |
Convert a two-plane YCbCr texture through the device's own Y′CbCr sampler where it has Metal's reconstruction
One work packet, landed as 3 commits (d38741a041..46bd06ec2f on archive/development-linear-2026-10-28), in order: * Convert a two-plane YCbCr texture through the device's own Y′CbCr sampler where it has Metal's reconstruction The owner's 10-28 decision: a YCbCr texture's texels are the GPU's own sampler Y′CbCr conversion where the GPU converts the format and the planes form one image; elsewhere Metal's fixed-point conversion stays as capability. Route. The texture's conversion pass (ycbcr.rs's refresh) copies the planes from its staging copy into an optimal image of the multi-planar format and samples it once per texel through a combined image sampler whose layout bakes an immutable sampler of the VkSamplerYcbcrConversion, writing the texture's image in the layout Metal's kernel writes (bind::ycbcr_sample_module). User pipelines are unchanged: no pipeline variant per conversion, no immutable sampler in a user layout, no combinedImageSamplerDescriptorCount in a user pool. The staging-to-image copy runs at every refresh (two regions); the sample dispatch takes the refresh's indirect arguments, so unchanged planes sample no workgroup. Which textures. Unpacked 8- or 10-bit codes of a 4:2:0, 4:2:2 or 4:4:4 layout over plane 0 whose planes form one image: no chroma codes 0, no rows past the buffer, each plane at a multiple of its texel's bytes with rows of whole texels that do not overlap (VUID-VkBufferImageCopy-bufferRowLength-09101, VUID-vkCmdCopyBufferToImage-dstImage-07976); on a device that enables samplerYcbcrConversion (enabled wherever present), whose optimal tiling has SAMPLED_IMAGE and TRANSFER_DST; a 4:4:4 format also needs Vulkan 1.3 or VK_EXT_ycbcr_2plane_444_formats (VUID-VkImageCreateInfo-None-12279), which the device now enables below 1.3 where listed. Metal's reconstruction required. Vulkan's implicit reconstruction of a subsampled format at MIDPOINT through a LINEAR chroma filter weighs the chroma 3 and 1 along a halved axis, as Metal does. Cosited it lies half a luma texel off (up to 1340/2048 of random planes on lavapipe), and nearest it takes one pair: that is what the codes mean, not a precision step, so a device without MIDPOINT_CHROMA_SAMPLES and a linear chroma filter for the format keeps Metal's arithmetic for it (a capability the device lacks). The brief allowed cosited; the measured distance is why I held it back, raised with the orchestrator. Left on ours, on purpose: - A 4:4:4 format read as codes (RGB8_444_2P, RGB10_444_2P): the identity model ignores the range and there is no chroma to reconstruct, so the device's answer is the codes ours reads, and the planes' image would only cost a copy. - A render pass's load: MTLLoadActionLoad keeps the attachment's contents and our store inverts Metal's read, not the device's; the device's load moved untouched codes by one on lavapipe (ycbcr_passes' loaded-pass lane), so the load stays Metal's arithmetic. Conversion. The surface's matrix (601/709/2020 model) and range (narrow/full); chroma filter linear where the format has YCBCR_CONVERSION_LINEAR_FILTER and (SEPARATE_RECONSTRUCTION or FILTER_LINEAR); the sampler's own filter nearest with SEPARATE_RECONSTRUCTION, else the chroma's (VUID-VkSamplerCreateInfo-minFilter-01645); each sample at a luma centre. No clamp of our own: "An implementation may clamp the R′G′B′ results of these conversions to the range [0,1]." Defects (measured, spec-forbidden; a RuntimeDriverDefect row keeps Metal's conversion): - TwoPlaneChromaMisplaced (MoltenVK 1.4.2): 4:2:0 and 4:2:2 chroma one luma texel up and left of the midpoint's and filtered twice. - TenBitCodesReadAsWords (lavapipe, Mesa 26.0.8): a 10-bit code's 16-bit word read as a 16-bit UNORM (1023 as 0.999039) where Vulkan converts c/(2^10-1). Paths measured: lavapipe converts its 8-bit 4:4:4 layout (its 4:2:0 and 4:2:2 ones are cosited only, its 10-bit ones carry the defect); MoltenVK converts none. Note and bound. ycbcr-filter-not-exact now also covers the device's conversion, announced where such a texture is made. Each channel within 0.04/2048 of Vulkan's conversion past the half the texture's image stores (0.038 measured at most), of Metal's read within 6/2048 inside [0, 1], unclamped outside it (lavapipe). FAST-PATHS gains its row; API.md matches. Plumbing: OwnedModule::YCbCrSample with a baked combined sampler; conversions and samplers held in OwnedKernels and released with it; priming makes and releases a conversion (the exit guard's 128th call, vkDestroySamplerYcbcrConversion); WorkCounts::ycbcr_device_conversions and ycbcr_device_samples count the path. RUNTIME_VERSION 1730. Lanes: the YCbCr lanes hold a texture the device converts (counted as it is made) to Vulkan's conversion within the bound instead of Metal's steps, and expect its notice (validation runtime_lane/ycbcr_device_reads.rs). Consumers: RuntimeDriverDefect gains TwoPlaneChromaMisplaced and TenBitCodesReadAsWords (an exhaustive match breaks); WorkCounts gains two public fields (a struct literal breaks); bind gains ycbcr_sample_module and YCbCrSampleModule. In place on an integrated or CPU device (not changed, not decided): a throwaway probe on the M3 Max under MoltenVK 1.4.2, 3840x2160 4:2:0 planes in host-visible memory composited into 1680x1050, best of 3x40: the device's Y′CbCr sampler over a LINEAR two-plane image of the planes in place 72.2 us (8-bit) and 81.2 us (10-bit), against 121.1 and 122.6 us for Metal's arithmetic over texel buffers (today's in-place form). MoltenVK's 4:2:0 conversion carries TwoPlaneChromaMisplaced and lavapipe's is cosited only, so neither venue could take it. Verified: build and clippy (plain and --cfg m2v_gpu); the touched host tests (catalogue, defect lists, exit guard, api_surface, api_signatures, fast_paths, the sample module on every committed profile). lavapipe (linux-gate arm64, --cfg m2v_cpu_icd): the runtime and validation YCbCr, chroma, two-plane, defect, exit-guard and degradation tests, 166 of 166, the device test counting 3 device-converted textures and the lanes 16; conformance replay --cpu exits 0, its 723 rows exactly known-gaps.tsv's (no YCbCr conformance case reaches the device path: they are 4:2:0). MoltenVK (M3 Max): the same selection 123 of 124, 0 textures device-converted; the one failure (a_ycbcr_sample_through_an_unmeasured_filter_is_announced, anisotropic through a constexpr sampler) fails identically at the base d736af8d66. Golden hashes: 2757 stale cells at the base and at this tip alike (key changes), none from this change. * Drop the YCbCr sample module's raw field, gone from CombinedSampler The sRGB change (9835965499) removed CombinedSampler::raw with the raw-view mechanism; the rebased YCbCr sample module still set it. Verified: clippy --workspace --all-targets --all-features -D warnings clean. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
2ec1f9fdc8 |
Read an sRGB texel through the device's own decode wherever the device samples its format
One work packet, landed as 2 commits (9835965499..1a930f5dc1 on archive/development-linear-2026-10-28), in order: * Read an sRGB texel through the device's own decode wherever the device samples its format Rule 1 makes the device's texel conversion the answer wherever it has a native form. A texture bound in an 8-bit sRGB format (and the sRGB forms of BC1 to BC3, BC7, PVRTC, ETC2, EAC and ASTC) was read through a second UNORM "raw" view and decoded through Metal's twelve-bit table on every device; that emulated Metal's bits where the device decodes sRGB itself. What changed: - Every read, nearest and filtered sample, pixel fetch, gather and bicubic tap of a sampled sRGB texture now reads the device's decode through the slot's sRGB view (a decoded twin's R8G8B8A8_SRGB view where the device lacks the compressed format). An input-attachment read of an sRGB color attachment reads the device's decode too (the snap-to-byte and table decode in lower/fragment/color.rs is gone). - The note is the existing PrecisionNote::SrgbTexelDecode: specialized on the bound format's class (BicubicTexels::SRGB, SpecKey::BoundTexelFormat, announced at the draw or dispatch), outright for a heap element, and at link for a float input attachment over an sRGB attachment (StageIo::decoded_fetches). On MoltenVK the module requires VkProperty::MetalSampler instead. - The capability fallback stays: a format the device cannot sample, held as its UNORM twin (R8Unorm_sRGB and RG8Unorm_sRGB on lavapipe, RG8Unorm_sRGB on ANV and NVIDIA among the committed profiles), joins the SrgbTexture variant (srgb_twin_on) and decodes the twin's codes through Metal's table through the slot's own binding: exact for one texel's codes, the device's filter of the codes otherwise (noted). The storage alias, tile, word-attachment and pack/unpack table uses are untouched. - Deleted: the raw view and its plumbing (ResourceKind::RawTexture, BindingSource::RawTexture, CombinedSampler::raw/with_raw/sampler_binding_use, TextureDecls::raw, SlotPlan::raw, BindingKey::raw), texel_format::srgb_raw_view and srgb_raw_on, RuntimeFact::SrgbDeviceDecode, VariantKey/LoweringInputs::srgb_twins (merged into srgb_textures), LoweringInputs::srgb_fetches and the input attachment's snap, the runtime image plan's extra UNORM view of sampled sRGB images, and the ASTC-native bicubic refusal. srgb_raw is renamed srgb_coded. - Versions: SEMANTICS_VERSION 1891, RUNTIME_VERSION 1672 (the image plan lists no raw view; a notice text changed), ARTIFACT_FORMAT_VERSION 469 (CombinedSampler::raw removed, StageIo field renamed). The runtime-sources pin is left for the landing. - Docs: FAST-PATHS rows (sampling, texel conversion with the measured bound, ASTC twin), the stale "runtime sampler's nearest sRGB sample" known gap removed, SrgbTexelDecode moved to the device-gap class in tests::fast_paths; PrecisionNote docs, DriverDeviation::MetalSampler, docs/API.md's catalogue, decode module docs, runtime notice texts. - Lanes: a new runtime_lane::srgb_decode reads every code of RGBA8Unorm_sRGB; the ASTC, ETC, PVRTC, BC, cross-class and fetch lanes hold an sRGB color channel to the device's decode of its own code (srgb_decode_holds: bit for bit through Metal's own texture unit) and assert where the note is announced. The BC lane keeps development's no-twin structure: an sRGB color channel off a measured driver holds as the device's sRGB decode of a code within compressed-texel-decode's bound; the ASTC CPU-write lane's check takes the device's exactness. - known-gaps.tsv: 21 new llvmpipe rows (ETC2, EAC, ASTC sRGB reads, the read-write tier's sRGB round trip), the 12 BC1 to BC3 sRGB rows' answers and words (the device's BC decode, then its sRGB decode: both notes), the 8 sRGB fetch rows' answers updated; CONFORMANCE-COVERAGE.md regenerated. Measured: llvmpipe (LLVM 21.1.8, arm64) decodes every color code within 5.25 table steps (0.00128) of Metal's value; MoltenVK on the M3 Max equals Metal at all 1024 lanes, read and sampled, and in the cross-class gathers (0 of 240 words differ through each class). Words (lavapipe, one-access kernels, a slot bound in RGBA8Unorm_sRGB): read half 2941 -> 1131, read float 2513 -> 836, fetch half 3062 -> 1264, nearest float 2580 -> 915, gather alpha half 2934 -> 1191, gather red float 2571 -> 896; linear and runtime samples unchanged (1210, 1163); a bicubic sample grows, 10524 -> 13254 half and 10318 -> 13048 float (the emulated sum of the device's decoded taps). The twin variant loses its raw binding (read half 2941 -> 2929). Verified, on this tree (rebased onto 7b5cf8328d): cargo fmt; clippy --workspace --all-targets --all-features -D warnings, plain and under --cfg m2v_gpu; rustdoc -D warnings; scripts/api-docs; api_signatures re-blessed (the 9 removals listed above); REFUSALS.md unchanged; 700 of 701 focused metal2vulkan tests (lower::texture/sampler/fragment/select, pipeline, metal, spirv::requirements, the texture/sampler/fragment/srgb engine tests, fast_paths, surfaces) pass, the golden table failing as it does on 7b5cf8328d itself (1608 cells changed under unchanged keys): blessed on both trees, this change moves 0 cells; the conformance suite's 1007 tests pass. On lavapipe (scripts/linux-gate, arm64): 168 touched runtime-lane tests pass; the runtime crate passes 1368 of 1369, the one failure deferred_calls::a_commit_after_an_end_in_flight_returns_and_keeps_its_order (status Scheduled where Committed is expected, no texture involved) failing again in 1 of 5 reruns, a timing flake; `conformance replay --cpu` exits 0 with no unlisted or stale row. MoltenVK lanes were not rerun after the rebase. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
3f3c972b8a |
Decode a pulled Int1010102Normalized 10-bit field as Metal's product
One work packet, landed as 2 commits (23c75d6d34..7b5cf8328d on archive/development-linear-2026-10-28), in order: * Decode a pulled Int1010102Normalized 10-bit field as Metal's product Metal's vertex fetch reads an Int1010102Normalized 10-bit field as its clamped magnitude times float(1/511) in float, one rounding, not the correctly rounded quotient c / 511: an ulp toward zero at 96 of the 1,024 codes (measured at every code on the Apple M3 Max, macOS 27.0.1, by runtime_lane::normalized_vertex_fetch). The shader's pulled decode (lower::stage_io::fetch::normalized) divided exactly, so Metal's constant step on MoltenVK, a device without buffer robustness, the indexed capture form and a kernel's stage input read those codes an ulp off, unannounced. It now multiplies (an OpConvertUToF and an OpFMul in place of the exact division's integer sequence); every other normalized field keeps the quotient. The FAST-PATHS known gap goes. The device-vertex-conversion entries in docs/API.md and the runtime's degradation.rs now state the 1/511 rule, the MoltenVK exemption and lavapipe's unclamped per-instance signed minimum, as the note's doc and the ledger row already do. SEMANTICS_VERSION 1890. Verified: nextest of lower::stage_io::fetch, fast_paths and the vertex tests, 116 passed; every_ten_and_two_bit_code_decodes_as_metals fails with the multiply disabled (negative control) and holds the 96-code count. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
8acf6ae154 |
Sample a BC texture's own image through the device's decode, keeping no twin
One work packet, landed as 3 commits (d8bb73078f..862d4c13a1 on archive/development-linear-2026-10-28), in order: * Sample a BC texture's own image through the device's decode, keeping no twin Under the native-arithmetic rule a device that has a BC format decodes it itself: its decode is the answer, recorded where it can differ from Metal's. The BC1 to BC5 decoded twin emulated Metal's 6-bit-weight decode on drivers not measured to make it (lavapipe, NVIDIA, ANV, RADV's BC4/BC5), at the cost of a second image 4 to 8 times the blocks and a decode after every write. It goes, and with it every piece only it used: - the translator's `bind::BlockDecode` and `bind::block_decode_module` (Metal's fitted BC1 to BC5 decode, its kernel and its tests); `bind/block_decode.rs` keeps only what the carriers' decode modules share (`BlockDecodeModule`, the bindings, `table`, `decode_module`); - the runtime's `TwinDecode::Block`, `Device::twin_decode`, the twin's announcement `decoded-block-twin` (`Degradation::DecodedBlockTwin`, removed), the view-decode notice for a view of another decode (`degrade_view_decode`, `degrade_device_decode`), and the device-test-only `Scheduler::decodes_pending`, which only the BC twin's CPU decodes needed. A BC texture (BC1 to BC7, the sRGB forms too) is now its own BC image on every device, and on a device whose driver lacks the format's fact (`ColorBlockDecodeIsMetals`, `ChannelBlockDecodeIsMetals`, `Bc6hBlockDecodeIsMetals`, `Bc7BlockDecodeIsMetals`) announces `compressed-texel-decode`, now also for a sparse texture and a texture over the caller's `VkImage`, which announced nothing before. The facts still decide the note. The carriers' twins (ASTC, PVRTC, ETC2/EAC, 4:2:2) and their CPU decode thread are unchanged; a carrier whose twin's format the device cannot sample is now refused typed instead of read as its carrier (no conformant device lacks those formats). The sRGB forms' read through Metal's table is unchanged here (another change replaces it). Lanes and suite: - `runtime_lane::compressed_decode` reads the device's decode: exact where the driver has the fact (within `device-texel-conversion`'s ulp off Metal's sampler), else within the note's stated per-format bound, with the note announced; no write makes a decode pass or CPU decode. - `cpu-block-decode` keeps a lane site in `astc_textures` (`astc_cpu_writes_decode_on_the_cpu`, the CPU decode thread's ordering behind work in flight), and `chroma_pairs` holds its notice to the CPU decodes on every device. - conformance: `compressed-texel-decode` joins `replay::NATIVE_NOTES`; the BC cases declare no twin notices; 40 llvmpipe rows in known-gaps.tsv, one per BC1 to BC5 round, each within the note's lavapipe bound. The cross-check `every_recorded_texel_is_the_lanes_fitted_rule` still holds the M3 Max's recorded texels to the case's own model of Metal's decode. - new device test `tests::bc_own_image`: every BC format, `Shared` by `replaceRegion`, `Private` by a blit and a heap's, has no twin, keeps its blocks, makes no decode, and announces the note exactly where the fact is missing. Docs: API.md's `compressed-texel-decode` entry and cost (lavapipe's BC4/BC5 bound widened to 2.4/255, signed 0.022, as measured below), `decoded-block-twin` removed; a FAST-PATHS.md device-gap row; REFUSALS.md, api_signatures.tsv, api_surface and CONFORMANCE-COVERAGE.md regenerated. RUNTIME_VERSION 1669 -> 1710 (renumbered at landing). SEMANTICS_VERSION stays: no translation changes, so the golden hashes do not move. The runtime-sources pin is not re-pinned here. Verified: - clippy `--workspace --all-targets --all-features -D warnings`, plain and `--cfg m2v_gpu`; rustdoc with `-D warnings`; the refusal, signature, Metal and conformance coverage checks. - macOS, no device: metal2vulkan-runtime + metal2vulkan-conformance 2139 passed; metal2vulkan's fast_paths, owned_divisions, bind, api_surface, api_signatures, driver_facts and cache tests 568 passed; conformance again after the ledger rows, 1007 passed. - lavapipe (linux-gate arm64, `--cfg m2v_cpu_icd`): 145 tests of the touched families passed (bc_own_image, compressed_decode, astc_textures, chroma_pairs, pvrtc/etc textures, degrade_notices, texture_blits/fills, cpu_copy_layouts, image_plan, first_moves, the degradation tests). Largest differences from Metal: BC1/BC2 2/255, BC3 3/255, BC4 2.28/255 (signed 0.0172), BC5 2.31/255 (signed 0.0212); BC6H has its fact there, BC7 announces. `conformance replay --cpu`: the only unlisted gaps were these 40 BC rounds, no stale row. - MoltenVK on the M3 Max (maclock, memcap): 43 tests passed, every BC1 to BC5 channel exactly Metal's, no `compressed-texel-decode`; the replay of 105 touched cases left all 41 BC cases exact (one unrelated divergence, `read-write-tier-held`'s `set-past-layout-support` notice). * Count the ASTC CPU-write lane's behind-work decodes from before the making `astc_cpu_writes_decode_on_the_cpu` failed once on lavapipe after the rebase onto cb759a4c4a: "ASTC4x4LDR Event: 2 CPU decodes, not 1". The cause is the test's window, not a second decode. `WorkCounts::cpu_block_decodes` counts a write's decode when the device's decode thread finishes it (`Image::finish_twin_decode`). The case writes the old blocks, commits the reader, and only then took `before`. In the Busy case `scheduled(&reads)` waits for the reader's batch, which the scheduler holds until the old blocks' decode finished, so `before` already holds it. In the Event case nothing waits, so the old blocks' decode could land after `before` and be counted with the new ones'. Each write queues exactly one job, and the thread takes them in order, so 2 is the old write plus the new. Now the case counts from before the texture's making and expects exactly two CPU decodes (its two writes) where the copies go on the host or the staging queue, and none elsewhere. The count is read after the later reader completed. That reader's batch waits for the new write's decode, the thread finished every earlier job by then, and it counts each job before it releases the batches that wait for it. Every earlier case's decodes landed before its own later reader completed too. No sleep, and no looser bound. Verified: clippy of the validation crate under `--cfg m2v_gpu`; on lavapipe (linux-gate arm64, `--cfg m2v_cpu_icd`), the test 20 times and the families bc_own_image|cpu_copy_layouts|compressed_decode|degrade_notices|astc|etc_textures|chroma_pairs| event_round_trips|grouped_submissions|waiter_submits|scheduler. The 20 runs all passed: each of the 80 behind-work cases (two formats, Busy and Event) counted exactly 2 CPU decodes, 0 cases wrong; 13 Busy cases were void (the reader ran before the write) and 2 to 4 cases a run held. The families: 86 tests passed. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
1bcc8324c3 |
Take MoltenVK's normalized vertex fetch as Metal's on the M3 Max's identity
One work packet, landed as 4 commits (15658d8c9b..d736af8d66 on archive/development-linear-2026-10-28), in order: * Take MoltenVK's normalized vertex fetch as Metal's on the M3 Max's identity A measured driver deviation, DriverDeviation::MetalNormalizedVertexFetch with its VkProperty, row and lane: the device's fixed-function UNORM/SNORM vertex conversion is Metal's float at every code. The row is MoltenVK on Apple's GPUs of the APPLE9 identity (the Apple M3 Max under macOS 27). Where the profile takes it, link's fixed_function_notes records no DeviceVertexConversion for a normalized attribute and returns VkProperty::MetalNormalizedVertexFetch, which Linked carries (vertex_properties) and graphics_requirements adds to the render pipeline's requirements: the format is pipeline state no module names, so the pipeline, not a module, requires it, as its sample counts are required. Rule 1: a note only where the device's answer can differ from Metal's. What Metal answers, measured first (a scratch MSL probe on the M3 Max, macOS 27.0.1, every code of every component of the 19 normalized formats, per vertex and per instance, float4 and half4 attributes): - float: the code over its maximum correctly rounded, but Int1010102Normalized's 10-bit fields, which Metal reads as c * float(1/511) rounded to float: 96 of the 1,024 codes (48 of each sign) one f32 ulp toward zero of the quotient. The deviation, the note's doc and the ledger say so; they said "correctly rounded" before. - half: the exact quotient rounded once to half. The translation reads a half attribute as the device's float rounded to half, which differs at codes 65455 and 65519 unsigned and 32759 and -32759 signed of every 16-bit component (one half ulp). So a 16-bit format read as half keeps the note on every profile, the deviation's included; an 8- or 10-bit format's float rounds to Metal's half at every code (checked exhaustively on the CPU), so it takes the property there too. The lane runtime_lane::normalized_vertex_fetch reads every code of every component of the 19 formats through the device, per vertex (one draw) and per instance (a draw per element at its base instance), float4 and half4, against that rule computed exactly on the CPU, and checks the notes, the requirement and the announcements. On MoltenVK 1.4.2, Apple M3 Max, macOS 27.0.1 (under maclock, --cfg m2v_gpu): 8,458,240 words of 76 fixed-function pipelines; every float4 word Metal's; 80 half4 words differ, exactly the 16-bit double-rounding codes, each one half ulp, under the note. Its CPU rule matches all 1,872 normalized components of the committed recordings of vertex-format-float4, -half4 and -instance-step (metal_s_recorded_rows_are_the_lane_s_rule). Also: the runtime's vertex_conversion_notices expects no notice on a profile that takes the deviation; engine_vertex_variants holds moltenvk-m3 to no note and the property required (but the eight 16-bit half reads), lavapipe and amd-780m-radv to the note; driver_facts' tables list the deviation. FAST-PATHS' device-gap row names the exempt devices, and a known gap records that the pulled decode (fetch.rs's normalized) divides Int1010102Normalized's 10-bit fields exactly where Metal multiplies by float(1/511). SEMANTICS_VERSION 1887 (notes and requirements of MoltenVK's render pipelines), and ARTIFACT_FORMAT_VERSION 468 (a VkProperty variant in the codec). api_signatures blessed (two variants added). REFUSALS.md regenerated: unchanged. Verified: cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; RUSTDOCFLAGS=-D warnings cargo doc -p metal2vulkan; nextest of engine_vertex_variants, driver_facts, device::tests, fast_paths, codec, cache, api_signatures, api_surface, link: 371 of 372 passed, the one golden_hashes, whose table is stale at the base too (2,724 changed cells with or without this change's version bumps) and is re-blessed on development; the lane and vertex_conversion_notices on MoltenVK under maclock. * Draw the normalized-fetch lane's instance step over every field, and record lavapipe's every code The lane drew every element of every format per instance into both attributes: about a million single-point draws, 100 s on MoltenVK and 47 s on lavapipe in the container, for a step that adds an index path and no conversion. Now each format draws both entries per vertex over every element (every code in every component, as before), and the float4 entry per instance over every element of an 8-bit or packed format and the first n/4 + 1 elements of a four-component 16-bit format, which put every 16-bit code in one of its components (Coding::legs); the 16-bit formats of fewer components are drawn per vertex alone. 2.8 s on MoltenVK. The first form's lavapipe run (Mesa 26.0.8 on LLVM 21.1.8, arm64, the linux-gate container) is the first every-code reading of a device without the deviation, and the note's recorded bound did not hold there: per vertex every normalized format is within one f32 ulp of Metal's (Int1010102Normalized exactly Metal's, lavapipe multiplying by the reciprocal too), but per instance a signed format's most negative code reads unclamped, -128/127 and -32768/32767, where Metal (and Vulkan's SNORM rule) reads -1. DeviceVertexConversion's recorded bound, the FAST-PATHS row and driver_facts' paragraph say so; the signed formats stay unaudited on RADV, ANV and NVIDIA. Verified: cargo clippy --workspace --all-targets --all-features -D warnings, plain and (validation) with --cfg m2v_gpu; cargo doc -p metal2vulkan with -D warnings; the lane's three tests on MoltenVK 1.4.2, Apple M3 Max, macOS 27.0.1, under maclock: 4,377,608 words of 51 fixed-function pipelines, every float4 word Metal's, 40 half4 words at the 16-bit double-rounding codes under the note. * Name the 8- and 16-bit signed formats as lavapipe's unclamped instance fetch lavapipe's per-instance fetch reads the most negative code unclamped for the 8- and 16-bit signed normalized formats alone: Int1010102Normalized's fields read Metal's at every code per instance as well (0 of 4,096 words differ). The note's recorded bound, the FAST-PATHS row and driver_facts' paragraph said "a signed format". Verified: the lane's run on lavapipe in the linux-gate container (Mesa 26.0.8 on LLVM 21.1.8, arm64, --cfg m2v_cpu_icd): Int1010102Normalized per instance 0 of 4,096 words off; CharNormalized to Char4Normalized and Short4Normalized one word a component past the per-vertex count, 66,052 and 256 f32 ulps. Docs only. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
5d09f454b4 |
Make the mipmap compute filter a plain bilinear filter in float
One work packet, landed as 4 commits (87ed7f903a..1af72fc0d8 on archive/development-linear-2026-10-28), in order: * Make the mipmap compute filter a plain bilinear filter in float The owner's decision for generate_mipmaps: the device's blit chain is the answer wherever the device blit-filters the format, and a compute filter runs only where it cannot (extended-range formats, formats without blits or linear filtering). That filter is a plain bilinear (trilinear in 3D) filter at texel centres in float, not a model of Apple's datapath. bind::mipmap_filter keeps its planning, scratch layout and first-level fetch, and drops the exact machinery: the measured answer tables, the reciprocal and tail models, the soft-float arithmetic and MipmapRule. The kernel decodes each field to float (Metal's 8-bit sRGB and extended-range sRGB tables, the packed floats and RGB9E5 exactly), sums the taps a linear sampler takes at the texel centres in tap order with no contraction, and encodes to nearest even. It needs no 64-bit integers. cpu.rs is the same filter on the CPU, the kernel's reference. The runtime still names the removed items; it follows in the next commit. Verified: cargo nextest run -p metal2vulkan --all-features --lib -E 'test(/mipmap_filter/) | test(/owned_divisions/)', 9 passed: every kernel validates on every committed profile, and the kernel run in the SPIR-V interpreter equals the CPU filter byte for byte over 38 formats and 9 shapes (arrays, cube, 3D, strips) and over 39 fetched first levels. * Make generate_mipmaps the device's filter: its blits, else the compute filter The owner's decision for generate_mipmaps: the device's blit chain (vkCmdBlitImage, VK_FILTER_LINEAR) is the answer for every format its blits filter, and the compute filter only where they cannot. No refusal for accuracy; refusals stay for what cannot run or what Metal refuses. mipmap_plan::plan_mipmaps now plans Blits, Picks or Filter. A filtered format takes the blit chain where the image's format has BLIT_SRC, BLIT_DST and SAMPLED_IMAGE_FILTER_LINEAR and the image takes transfers; it takes the compute filter where they lack (an extended-range format, an 8-bit sRGB texture held as its UNORM twin, a format without blits or linear filtering) and the filter computes the format in an image of its bytes. Otherwise the refusal names what the blits lack. The 1D refusal is gone (Metal makes 1D textures of one level, which are left as they are). Removed: the per-format first-use check against mipmap_answers.txt (mipmap.rs keeps only the blit recorder), mipmap_answers.txt, MipmapVerdict and Device::mipmap_generation, metal_release::MIPMAP_RULE, the texture facts' check cache, new_runtime_texture (only the check used it), and the degradation kinds mipmaps-within-spread and mipmap-tie-rounding. One kind replaces them: device-filtered-mipmaps (precision), announced once per device on both paths. WorkCounts::mipmaps_filtered counts compute-filter chains; image_blits_recorded counts the chain's blits. The filter kernel now decodes normalized, sRGB-step and extended-range codes by a product with a reciprocal rounded once to f32 instead of a division, so every operation is one Vulkan has a device round correctly and the CPU model is the device's answer on a device keeping f32 subnormals. The validation lane mipmaps_exact becomes mipmap_chains: the blit chain (work counts, each halving level within a code of the float filter, announced), every format the filter computes (the device's blits or the filter, the filter's levels byte for byte the CPU's), an extended-range texture announced as the filter, the picks, and the in-place fetch. texture_blits' every-format lane prints each format's way. Docs: API.md's catalogue, FAST-PATHS.md (a device-gaps row; the BGRA4Unorm gap's text), the runtime README, REFUSALS.md regenerated, api_signatures blessed, api_surface's table. RUNTIME_VERSION 1665 -> 1666 (mipmap behaviour changed) and the runtime-sources pin. Verified: cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; rustdoc -D warnings for metal2vulkan and the runtime; the runtime's whole suite plus the translator's surface, fast paths, refusal and mipmap tests (1180 passed); the runtime-sources guard. On lavapipe (scripts/linux-gate, arm64, --cfg m2v_cpu_icd), 13 passed: mipmap_chains (5), texture_blits' every-format lane, read_through_views' mipmaps, memoryless_uses (4), rgbx_textures' refusals and degrade_notices' site list. There the blits made 29 of the 38 formats the filter computes (87 chains), the compute filter made R8Unorm_sRGB, RG8Unorm_sRGB, RG11B10Float, RGB9E5Float, BGR10A2Unorm and the four XR formats (27 chains), each the CPU's byte for byte, and device-filtered-mipmaps was announced once. * Hold the device's filtered mipmaps among the conformance suite's native notes generate_mipmaps is now the device's filter (its blit chain, else the compute filter) and announces device-filtered-mipmaps: the device's own filtering, which rule 1 names, so it joins replay::NATIVE_NOTES beside device-sampling. Values still compare field by field. Verified on the merged tree (5a1a62bb0e + the mipmap commits): clippy --workspace --all-targets --all-features clean; nextest -p metal2vulkan-conformance -p metal2vulkan-runtime: 2140 passed. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |
||
|
|
c5978ed3d6 |
Delete LinearTilingFeaturesUninitialized: MoltenVK 1.4.2 reports linear tiling consistently
One work packet, landed as 3 commits (5522085593..cc22d95bf9 on archive/development-linear-2026-10-28), in order: * Delete LinearTilingFeaturesUninitialized: MoltenVK 1.4.2 reports linear tiling consistently MoltenVK 1.4.1 built its format table before it set renderLinearTextures, so a format's linear-tiling attachment and blit-destination features differed between instances of one process (2 of 40 on the M3 Max). The driver fact made every description leave those features out, so on MoltenVK a texture over a buffer that renders or that blits write was a shadow. Homebrew's MoltenVK 1.4.2, the only release we track, reads gpuCaps.supportsRenderLinearTextures in setFormatProperties: 500 of 500 instances made one after another in one process, with the freed heap poisoned between them, reported 0x8000dd83 for R8G8B8A8_UNORM, B8G8R8A8_UNORM, R16G16B16A16_SFLOAT and R32_SFLOAT on the M3 Max (driver 0x28a2). The owner's decision: delete the fact. Deleted: the variant and its MEASURED row and docs, DriverFact::unreliable_linear_tiling, DeviceDescription:: unreliable_linear_tiling, the stripping in DeviceDescription::query, the capture supplement's stripping and the venue test's MoltenVK branch, the core test of the stripped features, the regeneration script's UNRELIABLE_LINEAR_FEATURES and its unit test, and the FAST-PATHS bullet on MoltenVK buffer textures keeping a shadow. Recaptured moltenvk-m3 on the M3 Max (macOS 27.0.1, Homebrew molten-vk 1.4.2, vulkan-tools 1.4.363.0) by the documented flow, each capture under the Mac GPU lock: vulkaninfo --json and corpus-vulkan --capture-formats, pinned in the script's SOURCES. The profile's format diff is the linear tiling alone: COLOR_ATTACHMENT and BLIT_DST added on 56 formats, COLOR_ATTACHMENT_BLEND on 34 of them, in VkFormatProperties and VkFormatProperties3; no linear depth/stencil attachment; the sample counts unchanged. Also moved since the 1.4.1 capture: the driver (10401 -> 10402, "1.4.2"), API 1.4.334 -> 1.4.357, VK_KHR_shader_quad_ control and shaderQuadControl gone (1.4.2 stops advertising them, as driver_facts.rs records), and shaderRoundingModeRTEFloat64 and shaderSignedZeroInfNanPreserveFloat64 now false (the device has no shaderFloat64). The venue's declared identity follows (c3-venues.json, the profiles README), so MoltenVK venue rows of 1.4.1 read stale until re-recorded. The tests that removed the quad-control feature from the 1.4.1 profile to stand for 1.4.2 now read the capture as it is: simd_after_discard and fragment_group_operations_run_full_quads take a profile whose driver runs Metal's helpers (MetalFullQuads) as one that compiles without the mode. opened_chains.txt is re-blessed for moltenvk-m3's four contexts (one member and one extension fewer each). RUNTIME_VERSION 1665 -> 1666: on MoltenVK a texture over an ordinary buffer that renders or that blits write is now its own linear image, not a shadow, which changes announcements and submissions. The runtime sources pin moves with driver_facts.rs and query.rs. The translator reads no linear tiling, so SEMANTICS_VERSION stays; moltenvk-m3's keys move with its fingerprint. golden_hashes.tsv is stale for 2757 moltenvk-m3 cells (fingerprint bea6f0f2c6d5374f -> e69acb7b2f990adb), to re-bless on development. Verified: clippy --workspace --all-targets --all-features -D warnings, plain and --cfg m2v_gpu; rustdoc of metal2vulkan and validation; check_device_profiles.py (0 findings) and the script's 40 unit tests; the core, air, runtime and devtools suites (5057 tests: fails only the four quad tests fixed here, then passing, and golden_hashes); the validation suite (1362, fails only opened_chains, re-blessed and passing). On MoltenVK 1.4.2 under the GPU lock and memcap, --cfg m2v_gpu, debug: 158 validation device tests (buffer_texture_renders, _blits, _order, buffer_textures, linear_attachments, host_memory, tile_shadows, kept_buffer_bytes, view_attachments, no_copy_textures, surface_aliases, in_place_textures, degrade_notices, detach_textures and the_formats_capture_is_the_product_queried_formats_of_the_venue_device), 157 passed; 135 more texture lanes, 133 passed; 90 runtime device tests, all passed. The three failures fail identically at a527df636f. Against a527df636f on the same device, linear_attachments printed "over a Shared buffer ... aliased false" and 10 shadowed-texture notices "the linear tiling of VK_FORMAT_B8G8R8A8_UNORM lacks COLOR_ATTACHMENT | COLOR_ATTACHMENT_BLEND"; now "aliased true" and no notice of a missing linear feature in any of the 383 tests. * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. * Re-bless the golden table after moltenvk-m3's recapture from MoltenVK 1.4.2 The profile's linear tiling now holds MoltenVK 1.4.2's attachment and blit features, and the capture's version and extension moves (quad control gone), so its fingerprint and cells moved. bless_engine_inventory, bless_golden_hashes and bless_engine_goldens at 69e9622aff; public_fixtures_engine, air_input and golden_hashes: 28 passed. |
||
|
|
96b6f3d12b |
Note the device's fixed-function vertex conversions where the pipeline links
One work packet, landed as 4 commits (0e348c4f85..2fc5327329 on archive/development-linear-2026-10-28), in order:
* Note the device's fixed-function vertex conversions where the pipeline links
A normalized vertex attribute has been the device's fixed-function UNORM or
SNORM conversion since the exact division went (9c0bdbe0d2), but nothing
recorded it: llvmpipe reads 127/255 one f32 ulp high (0x3EFEFF00 against
Metal's 0x3EFEFEFF) and the run announced nothing, against rule 2. And the
narrow-float NaN note rode in the vertex compile key
(VertexFetch::FixedFunction { narrow_float }), so one function used with a
half format and any other format translated twice for one module.
The design: the module of a fixed-function attribute names no part of its
format, so neither note belongs to the module. Link knows the vertex
descriptor and which attributes the stage reads as float, so
link::vertex::fixed_function_notes decides both there, from the stage's
fixed-function attributes and the descriptor's formats, and the compile API
adds them to the vertex StageModule's precision_notes (as color_writes'
pipeline notes are added). The runtime announces stage notes already, so
it needs only the new kind. A StageSource::Compiled stage gets the same
notes, since link recomputes them.
- PrecisionNote::DeviceVertexConversion (device-vertex-conversion): a
normalized format fixed-function input fetches, whatever width the
function reads it at. Recorded on every device; MoltenVK measured
Metal's, but no measured property says so yet.
- PrecisionNote::DeviceNanEncoding for a narrow float read as float now
comes from link too; lowering records nothing for a fixed-function
attribute.
- VertexFetch::FixedFunction is a unit variant; IoRole::Attribute loses
narrow_float; narrow_float_of_f32_reads goes; declared_attributes keeps
only the numeric class. Encoding::is_normalized names the formats.
- Runtime Degradation::DeviceVertexConversion, the codec tag, docs/API.md's
catalogue entry, a FAST-PATHS device-gap row (no switch), validation's
comparison class (unbounded, as DeviceTexelConversion).
- Versions: SEMANTICS_VERSION 1884 (notes and vertex keys move),
ARTIFACT_FORMAT_VERSION 467 (VertexFetch, IoRole, the new tag),
RUNTIME_VERSION 1666 (a new announced kind); runtime-sources.sha256
re-pinned for degradation.rs. api_signatures re-blessed.
Tests: engine_vertex_variants' new
a_pipeline_notes_what_the_device_converts_from_one_translation compiles
the float4 and half4 sweeps as render pipelines on moltenvk-m3, lavapipe
and amd-780m-radv: each normalized format's vertex stage notes the
conversion, each narrow float read as float the NaN, others neither, and
every fixed-function creation of an entry has one vertex compile key and
one module (two keys before). The float4 sweep is now 1 projection and 1
module (was 2 and 1); the constant-step counts follow.
Verified: cargo clippy --workspace --all-targets --all-features -D
warnings, plain and with --cfg m2v_gpu; RUSTDOCFLAGS='-D warnings' cargo
doc -p metal2vulkan -p metal2vulkan-runtime; nextest of the touched
metal2vulkan modules (343 passed), api_surface, api_signatures,
refusal_surface, golden_hashes and the public fixture tables (pass, no
hash moved); runtime degradation tests (17), validation
observation_contract, c3 and the runtime-sources guard. No device test.
* Hold a render state's vertex conversion notices and its one translation on a device
A device test (m2v_gpu, m2v_cpu_icd) of the runtime side of the link-time
vertex notes: four states of dsx_int_attributes' int_attribute_to_float4
whose vertex descriptors differ only in attribute 0's format
(UChar4Normalized, Half4, Float4, Short2Normalized). The three after the
first must translate nothing (WorkCounts::functions_translated, the
function shared once each), and each draw of one point over a record of
0x7f bytes must announce exactly its format's kinds: device-vertex-conversion
for the normalized formats, device-nan-encoding for Half4 (whose 0x7F7F is a
NaN read as float), neither for Float4. The stored words are printed, so a
run shows the device's own conversion of 127/255 and of the NaN.
Verified: clippy -p metal2vulkan-runtime --all-targets --all-features -D
warnings under --cfg m2v_gpu; the runtime-sources guard still passes (test
modules are not runtime inputs). Not run here: it needs a device.
* Say that a pipeline's stage adds its state's notes to its function's
CompiledFunction::precision_notes said its notes were the linked stage's,
which a fragment stage's attachment-write notes already broke and the
vertex stage's link-time conversion notes break too. The doc and
docs/API.md's compile-API paragraph now say the stage adds those of the
pipeline's own state. Docs only.
* Drop a known-gaps clause that points at a ledger row no longer there
The conformance-replay paragraph said its runs were at a tip before "the narrow-float widening
above" was canonicalized; that row is gone and the clause was history. Docs only.
|
||
|
|
d72fd04a73 |
Drop half_texels' arm parameter, which every caller passes as none
One work packet, landed as 3 commits (8cc765ebea..22aadfdd31 on archive/development-linear-2026-10-28), in order: * Drop half_texels' arm parameter, which every caller passes as none The clauses an access's note took from the sampler arm that converts the device's texel went with the device-sampling deletion; both callers (`lower::sampler::select` and the texture read) pass `None`, so the parameter and its intersection go. Verified: clippy (workspace, all targets, all features) clean; 78 texture, half-texel, sampler and fast_paths tests pass. * Say in the ledger that a precise division is the device's on every device The maths-library row said divisions are the device's on every device but MoltenVK. A precise division (an `fdiv` without `arcp`, or on `half`) is the device's `OpFDiv` on every device, MoltenVK included (`float_binop_notes` records `NativeDivision` everywhere for it, as the note's doc states); only the fast division is Metal's own in a MoltenVK fast-math entry. Verified: tests::fast_paths passes. * Re-bless the golden table after the half-bits write paths' removal Blessed on development at f4dd7f6bb6: the half-float slots and heap writes that took the unsigned-integer alias or the half-bits twin now write through the format's own view, which moves 34 rows. The inventory and the fixture expectations re-derive unchanged; the bless named no cell changed under an unchanged key. Verified: bless_engine_inventory, bless_golden_hashes and bless_engine_goldens each passed (exit 0). |
||
|
|
adef203530 |
Describe each driver deviation's route as the code takes it now
One work packet, landed as 10 commits (262093ec48..8e4bfa28b4 on archive/development-linear-2026-10-28), in order: * Describe each driver deviation's route as the code takes it now The DriverDeviation, VkProperty and driver-table docs still named the exact emulations the native-arithmetic change sets deleted (Metal's libm, division, denormal flushing, NaN selection, min/max picks, the emulated sampler, the color, storage and Depth16 write roundings, the depth stand-in). Each variant's doc now says what a profile that takes it gets and what one without it gets: the device's own answer with the precision note recorded, or, where a capability hangs on the answer, its emulation or refusal. - error/mod.rs: DriverDeviation's header and the float-function, NaN, sampler, color-write, FMA, denormal, quantize, min/max, half arithmetic, storage-write, texel-write and Depth16 variants. - device/requirements.rs: the matching VkProperty docs; MetalColorWrites says no module requires it (compile.rs never adds it), and MetalHalfQuantize drops the clamp claim the code does not make. - device/driver_facts.rs: the table preambles and measurement paragraphs (docs and citations only, no row or variant changed); the deleted resolve_rounding::color_resolves_against_metals_rules citation now names the_device_resolve_rounds_as_announced, which holds the row. - runtime_lane/heap_textures.rs: heap_depth_textures_keep_their_bytes, renamed from ..._with_their_twins (no twin exists), with the two driver_facts.rs citations updated. - lower/texture/mod.rs and pipeline/compile.rs: the storage_properties doc and comment list the four properties select_write relies on, dropping the 0x7fc00000 store. Verified by reading each route in lower/ (narrow, fma, denormal, nan, arith, sampler, stage_io/color_write, texture) and pipeline/compile.rs, and by git grep for every cited test and item. * Describe the pixel samplers, routines and color-write inputs as they run now Translator docs that still described the deleted emulated sampler, the cube face fold routine, the compiler-word-bound fit and the shader's own color-write rounding: - pipeline/artifact.rs: PixelSamplerScaling no longer names a linear sample's emulation or a MetalSampler condition; a runtime word's linear pixel sample snaps onto its footprint cell on every device (position::plan plans SnapKind::WordCell with no device test), a word of mixed filters is the device's. ArgumentPixelSamplerScaling says it is recorded on every device for any access but a 2D gather and a sample without a comparison, as select.rs pixel_note does. - lower/sampler/select.rs (pixel_note) and lower/sampler/mod.rs (RuntimeSlot::cells, ::texels): the cell snap holds on every device; the slot's word filter fields are read for a half texel's conversion alone, on a MetalSampler device (half_converts requires !device_texels). - device/profile.rs: FunctionsInlinedAtEveryCall lists the routines that exist (wide-integer divisions, precise fmod, texel conversions, filter sums, sampling routines; no face fold); takes_driver_deviation names the route a deviation's docs give for a driver without it. - error/mod.rs: RuntimeInput::ColorWrites says what the color-write map decides (the conversion that records a note, and NearestEven's half rounding), not a rounding of every output. - bind/color_resolve.rs and its tests: drop the citation of resolve_rounding's cost test, which is deleted. - device/mechanism.rs: drop the trailing comment on the deleted ExactFormsOverCompilerLimit fact. Verified by reading position::plan, select.rs pixel_note and the half_converts branch, spirv/builder/module.rs's routine kinds and every mb.routine site, pipeline/color_writes.rs, and git grep for each cited item. * Describe texel conversion, YCbCr filtering and depth comparison as the device's Translator docs still named the deleted linear-filter emulation, the shader's own depth comparison and the depth twin: - lower/texture/half.rs: off MetalSampler devices the device's sampler filters and the half is its float texel rounded to nearest even (device_texels), not this routine's; the only fetch-computed filter that skips the routine is the in-place YCbCr one. - lower/texture/mod.rs (half_texels): drop the example of a runtime sampler's sRGB raw-code emulation for the `arm` clauses. - metal/format/mod.rs: a two-plane YCbCr texture's linear sample is the device's filter, noted, but where its planes are read in place. - pipeline/artifact.rs (RestrictedDepthRange) and lower/texture/slot.rs (depth_comparison): every comparison is the device's; no shader-made comparison is left to exclude. - lower/sampler/select.rs: a depth comparison reads the texture's own depth image (no twin). - lower/sampler/mod.rs (Sampling::words): list the terms plain_words sums; no linear emulation, level grid or shader comparison term exists. Verified by reading device_texels, half_texels and both its callers, linear.rs filter_note and metal_filtered_ycbcr, depth_comparison's one caller, in_place.rs, and plain_words. * Describe the runtime's YCbCr filter notice and variant kinds as they fire now - degradation.rs: YCbCrFilterNotExact fires on a device that samples through Metal's own sampler alone (linear.rs metal_filtered_ycbcr is None elsewhere), where the stage records HalfSampleFilter or FloatSampleFilter for any two-plane YCbCr format bound; a native sampler announces device-sampling. The module doc drops the exact forms dropped to fit a compiler word bound, whose kind and fit are deleted. - ycbcr.rs: linear filtering of the converted texels is the device sampler's (Metal's own on MoltenVK, announced ycbcr-filter-not-exact); only planes read in place are Metal's filter exactly. Verified by reading lower/sampler/linear.rs, in_place.rs and the runtime's Kinds::of and degrade_bound_formats. * Describe the lanes' and cases' native forms where they named deleted emulations Docs and comments only; no expectation changed. - validation runtime_lane/driver_deviations.rs: the half quantize, min/max, half arithmetic and half widening bullets say what the module does off the deviation (the device's own conversion or quantize, the same NMin/NMax/NClamp noted native-min-max, narrow::from_bits' decode), not the deleted integer rounding, operand picks and exact_answers decode. - validation observation_contract/comparison.rs: HalfSampleFilter and FloatSampleFilter are a YCbCr texture through Metal's own sampler. - validation runtime_lane/pixel_samplers.rs, conformance cases/pixel_samplers.rs: the pixel coordinates reach Metal's texels through the translator's snaps, filtered by the device's sampler. - conformance cases/snorm_tile_store.rs: no exact tile store and no FAST-PATHS row; only extended-range, padded and bfloat attachments take a load pass. Verified by reading the lanes' assertions, select.rs pixel_note, position::plan and narrow.rs. * State the native forms in the doc pages where they promised exact switches - README.md: the promise that every speed-for-accuracy choice has an opt-in exact switch was false for the device's maths, rounding, conversions and sampler, which have none; it now says those are the device's, recorded, and the runtime's choices keep their switches. - docs/API.md: exact_answers selects the runtime's five switches (as policy.rs's exact_answers sets them), not exact forms of the native arithmetic; an unmeasured driver takes each deviation's documented route, not a conservative one; half widening's NaN and denormal are the device's under its own conversion or the float controls; Depth32Float texels are the depth image's, announced where it clamps or flushes; the catalogue intro names the native forms. - docs/ARCHITECTURE.md: the native forms are the device's on every device with no policy choice; the policy's accuracy switches are the runtime's. - docs/FAST-PATHS.md (after the opening section): a YCbCr texture's image form holds Metal's texels exactly and its linear sample is the device's filter; only the in-place form is Metal's filter. Verified against device/policy.rs, lower/arith/narrow.rs, the depth twin's deletion (c11e653acd) and lower/sampler/linear.rs. * Drop the exact golden table from VALIDATION.md's emitter-stability contract 4bf2c22aad deleted golden_hashes_exact.tsv and its table in golden_hashes.rs; VALIDATION.md still described a second table of every sampling fixture under exact_answers. The contract now names the one table. Verified: crates/metal2vulkan/tests/ holds golden_hashes.tsv alone, and golden_hashes.rs names no exact table. * Re-pin the runtime sources after the doc audit The audit's commits edit doc comments and comments only in files the runtime guard hashes (degradation.rs, ycbcr.rs, and translator files the build lists); no run's behaviour changes, so RUNTIME_VERSION stays. Verified: the_runtime_sources_are_the_committed_ones failed with 81ebd500 committed against 8bc0e06b computed, and passes after this pin. * Drop the 0x7fc00000 hand-off from half_write_nans_converted's doc a6e97e7f93 deleted the NaN canonicalization before storage writes (StorageImageClass::SmallFloatQuietNan among it): a half write to a packed small float hands the device the half widened, as to a 16-bit float channel. The doc still said such a write hands it 0x7fc00000, and tied MetalHalfTexelWrites to both kinds, where it states the 16-bit float store alone (lower/texture/mod.rs half_write_nans). Verified by reading half_write_nans and the write emission (lower/texture/emit.rs), which canonicalizes no small-float NaN. * Re-pin the runtime sources after the half-write NaN doc fix metal/format/mod.rs is a runtime guard input; the preceding commit edits a doc comment there alone, so no run's behaviour changes and RUNTIME_VERSION stays. Verified: the_runtime_sources_are_the_committed_ones failed with 8bc0e06b committed against 279b25d4 computed, and passes after this pin. |
||
|
|
6fba488835 |
Drop the exact golden table, a duplicate of the default one
One work packet, landed as 2 commits (4bf2c22aad..9090d9a1b1 on archive/development-linear-2026-10-28), in order: * Drop the exact golden table, a duplicate of the default one `DevicePolicy::exact_answers()` now sets only the runtime's switches (heap compression, completion, batch order, render lowering, host-page textures), none of which a translation reads: the table's own structural test held its profiles' fingerprints equal to the default table's, so `golden_hashes_exact.tsv` pinned a subset of `golden_hashes.tsv` cell for cell. The table, its comparison test, its structural test and the `samples` filter go; the bless writes the one table. Verified: clippy (workspace, all targets, all features) clean; the golden module's structural tests, fast_paths and published_crates pass (14 tests). * State the native-arithmetic rule in AGENTS.md and the ledger The owner ruled on 2026-10-27: "Just promise the GPU's native arithmetics, no more 'exact' emulation." Rule 1 now says so: arithmetic and value answers are the device's own native form, recorded as a precision note where they can differ from Metal's, and no path or switch emulates Metal's bits where the device has a native form; capability emulation stays; the remaining speed-for-accuracy switches (outside arithmetic) keep both forms, the fast one the default. The "Scope is the device's" honesty rule names the native answer as a recorded near-equivalent. docs/FAST-PATHS.md's opening says the same and what its tables hold. Verified: tests::fast_paths passes. |
||
|
|
4a8edc7bef |
Ledger the device's sampler, conversion and compact twin as device gaps
The sampling, texel conversion, two-plane YCbCr filter and decoded-twin rows left the first table with their switches, and their notes went to fast_paths' Elsewhere class: a reader of docs/FAST-PATHS.md no longer found the device's sampler at all. They come back as device-gap rows (the device's sampler and conversion are the contract; the device lacks the compressed format), with the bounds the rows stated, and DeviceSampling, DeviceTexelConversion and HalfTexelConversion are classed DeviceGap, so tests::fast_paths holds the rows to them. The "All at once" paragraph's costs measured the deleted exact forms; it now points at each row's. exact_answers() now sets only the runtime's switches, which no profile carries, so two tests stated a difference that no longer exists: profiles_that_differ_carry_their_own_fingerprints contrasts an uncontained policy instead, and the exact golden table's structural test states that its profiles' fingerprints are the default table's. Verified: nextest of metal2vulkan's fast_paths, profile_fingerprint_derived and the exact table's structural test (12 passed). Originally 7891bcc04c (archive/development-linear-2026-10-28). |
||
|
|
3c129f4d6f |
Delete the half gather's fetch and the compiler-word-bound fit, which have nothing left to drop
With the NaN lane landed beside this one, two exact-only paths lost their last use. The half gather's fetch (lower::sampler::fetched) read a half-float texel's NaN through TexelNanRoute, which the NaN lane removed: no selection reaches it. Deleted with the Sampling field, the RuntimeSlot word fields it set (filters, fetched, fetched_depth), the shared switch's fetched emulation and its lane constants, the heap fetch in emit, and the helpers only it used (LinearImage, HEAP_WORDS, footprint_from, texel_format_spec, texel_format_const, constant_lanes_by folded into constant_lanes). The compiler-word-bound fit (pipeline::compile::fit) retranslated a pipeline past ANV's 400,000-word bound with its exact forms dropped. No exact form is left to drop, so the fit, fit_render_variant / fit_mesh_variant / fit_compute_pipeline / fit_tile_pipeline, DeviceProfile::module_word_bound, RuntimeFact::ExactFormsOverCompilerLimit, the runtime's Degradation::ExactFormsOverCompilerLimit and its notice, the runtime and validation tests of it, its FAST-PATHS row and its API.md passages go. DriverWorkaround::RegisterAllocatorOverflowsLargeModules stays, recorded on the profile alone. fast_paths loses its FastDefault class, now empty. Verified: cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; RUSTDOCFLAGS='-D warnings' cargo doc --workspace --all-features --no-deps; refusal_surface.py leaves docs/REFUSALS.md unchanged. Originally 50fcff8a4e (archive/development-linear-2026-10-28). |
||
|
|
78ed264c90 |
Drop the normalized vertex attribute's exact division (vertex_normalized)
One work packet, landed as 9 commits (9c0bdbe0d2..41066d87d0 on archive/development-linear-2026-10-28), in order: * Drop the normalized vertex attribute's exact division (vertex_normalized) The owner's ruling of 2026-10-27: the GPU's native arithmetic is the contract, no exact emulation. A normalized vertex attribute is now always the device's fixed-function UNORM or SNORM conversion; the policy-forced pull that divided its codes in the shader goes with DevicePolicy::vertex_normalized, VertexNormalizedPolicy, its profile field, its ledger row and its tests. A format pulled for any other reason (a format the device cannot fetch, alignment, limits, containment, the capture form) still decodes in the shader as before. Verified: cargo clippy --workspace --all-targets --all-features -D warnings clean; nextest of engine_vertex_variants, device::tests::profile, fast_paths, catalogue, degradation and api_surface: 71 passed. api_signatures is re-blessed at the end of the lane. * Keep the compact decoded twin only (decoded_texels) The owner's ruling of 2026-10-27: no exact emulation. A carried ASTC LDR texture's decoded twin now always holds 8-bit codes, and an EAC 11-bit texture's 16-bit normalized codes (its values in floats only where the device does not take those codes' format, a capability fallback). DevicePolicy::decoded_texels and DecodedTexelsPolicy go, with their ledger row, their mentions in the degrade catalogue and the runtime's docs, the policy-keyed fingerprint test, and the validation lanes' exact twins. decoded-texel-precision is announced as before. bind::AstcTexels::Float stays: the conformance suite's cross-check decodes Metal's values with it. RUNTIME_VERSION 1654. Verified: clippy --workspace --all-targets --all-features -D warnings clean, plain and with --cfg m2v_gpu; nextest of fast_paths, device profile, degradation and catalogue, image_plan's decode bands, the conformance ASTC and ETC cases, api_surface: 112 passed. * Take the device's texel conversion only (texel_conversion) The owner's ruling of 2026-10-27: no exact emulation. A read, sample or gather with a float or half result off Apple's GPUs is now always the device's conversion of the texel's codes, recorded as DeviceTexelConversion or HalfTexelConversion. DevicePolicy::texel_conversion and TexelConversionPolicy go, with Metal's conversion by the bound format's class: lower::texture::float_texel (its routine, census entry and tests), the float_texel plan flags of reads and samples, the slots' float_format and the heap's float class, and the field of RuntimeFact::ExactFormsOverCompilerLimit that named it (encoded, so ARTIFACT_FORMAT_VERSION 456; SEMANTICS_VERSION 1873). The ledger row goes; DeviceTexelConversion is now documented in docs/API.md section 9 alone (fast_paths classes it Elsewhere), and the conformance cases cite the note's bound in place of the row. The half routine on Apple's GPUs is untouched. Verified: clippy --workspace --all-targets --all-features -D warnings clean, plain and with --cfg m2v_gpu; nextest of fast_paths, device profile, catalogue, degradation, the fit, mechanism, codec, the snapshot variant, engine_handles, the extended-range heap tests, the texel-conversion test (rewritten for the device's form alone), the conformance ETC, BC and border cases and the runtime's fitted-variant notice: passed (one exact-conversion test deleted). * Take the device's filter of a two-plane YCbCr texture only (ycbcr_filter) The owner's ruling: promise the GPU's native arithmetic, no exact emulation. YCbCrFilterPolicy and its Exact form go: no slot takes a YCbCr variant (RuntimeFact::YCbCrTexture, VariantKey and LoweringInputs::ycbcr_textures, ProfileFields::ycbcr_variant, Linear::exact_only and the binder's ycbcr_variant are gone). A natively sampling device filters such a texture's texels (device-sampling); on MoltenVK Metal's own sampler filters them, noted where the bound format is two-plane YCbCr (ycbcr-filter-not-exact). The planes read in place on a device whose memory is the host's are kept: that is a capability path, Metal's filter exactly. The FAST-PATHS row goes; HalfTexelConversion, which only that row named, is classed Elsewhere (API.md's catalogue states it). The YCbCr tests keep the default's selection and drop the variant's; the uniform-branch test runs at the default policy; the validation lane's Exact draw test goes. Verified: cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu, clean. nextest over fast_paths, device::tests, bind::plan, compile::fit, compile::tests, engine_linear_half, catalogue, degradation, api_surface, codec, cache: 372 passed, 5 failed. The five are engine_linear_half tests of the emulated sampler on lavapipe and MoltenVK under EXACT_SAMPLING (the_emulation_reaches_what_metal_measured, the_linear_sums_run_one_by_a_branch_and_stay_calls, swizzled_packed_texels_are_the_unswizzled_swizzled, a_pipelines_texture_notes_follow_its_bound_format_and_sampler, a_depth_comparison_through_a_filter_is_a_filtered_float_sample); they go with the emulated sampler in the next step. api_signatures is re-blessed at the end of the lane. * Take the device's sampler only (sampling, unorm8_linear_filter) The owner's ruling of 2026-10-27: promise the GPU's native arithmetic, no exact emulation. Metal's sampler emulated by fetches (SamplingPolicy::Exact, a pipeline per bound sampler state) and the device's 8-bit unorm filter at Metal's footprint step (Unorm8LinearFilterPolicy) are gone with their switches: every sample, gather and comparison goes to the device's sampler, Metal's own on MoltenVK (VkProperty::MetalSampler) and the device's elsewhere (VkProperty::DeviceSampling, PrecisionNote::DeviceSampling). Deleted: lower/sampler/compared.rs, native.rs, linear/compare.rs, linear/cube.rs, the nearest and level snaps, the cube face position and fold (face::snapped, FaceWrap), the span and cube bicubic routines, the heap depth class (FLAG_DEPTH_*, HANDLE_DEPTH_*, Lookup::Flagged's depth), the normalized gather snap and the runtime sampler's anisotropic bias route. Notes nothing records any more are deleted with their catalogue and codec entries and the runtime's Degradation kinds: DeviceGatherFootprint, CubeFaceReciprocal, DeviceDepthComparison, DeviceTexelDenormals, DeviceUnorm8LinearFilter. The fit drops the sampling field of ExactFormsOverCompilerLimit and makes every module-growing form native in one reduction. Kept as capability: bicubic, extended range, heap raw reads, YCbCr planes read in place (its tests move to engine_ycbcr_in_place), constexpr pixel samplers' snaps and fetches, the runtime pixel word's gather and footprint cell, Metal's cube face at a tie, the anisotropic emulation without samplerAnisotropy and for an unmeasured cube-gradient route, the VkSampler level clamp on Metal's grid. Validation and conformance follow: the lanes judge the device's filter within two codes where it samples natively, the anisotropic lane runs with samplerAnisotropy withheld, and the conformance cases drop their device-texel-denormals declarations. docs/API.md, FAST-PATHS.md, ARCHITECTURE.md, CONTRIBUTING.md and VALIDATION.md updated. Verified so far: cargo check of the workspace, all targets and features, plain and --cfg m2v_gpu; 1000 of 3664 translator lib tests passed before the run was stopped for the rebase. * Join the device-sampler deletions with development's half and write removals The rebase onto development left two joins only a build shows: - `packed_scales` and `PackedField::small` lost their last readers (the float texel conversion this branch deleted and the normalized write development deleted): both go. - `engine_srgb_raw` takes `DevicePolicy::default()` where development's side named `EXACT_SAMPLING`, so it imports `DevicePolicy` again. Also formats the conflict resolutions (`cargo fmt --all`). Verified: `cargo check --workspace --all-targets --all-features` passes. * Drop the sampler word's snap and level-rule fields with their last readers With every sample the device's own, no function reads a runtime sampler's nearest snap (`SamplerWord::NEAREST_BASE`, `NEAREST_SNAP`, `NEAREST_LEVEL`, `LEVELED_SNAP`) or its level rule (`LEVEL_RULE`); only tests named them. The constants go, with the word test of the base-level mask; the `VkSampler` clamp on Metal's level grid (`clamps_on_grid`) stays, and its docs no longer say the shader reads the rule. The runtime-sampler tests of `engine_sampler` asked, off MoltenVK, for the emulation's linear state, leveled snap and level rule: they now state the device's sample on every committed profile (the pixel fields alone, gated; `MetalSampler` on MoltenVK, `DeviceSampling` elsewhere; no level field). Also matches `SnapKind::WordGather` as the unit variant it is (clippy). Verified: clippy (all targets, all features, -D warnings) passes. * Test the anisotropic, bias and position paths as the device's sampler runs them The tests of these paths compiled under the exact sampling policy, which is gone; under the default each now states what the translation does: - Metal's anisotropic filter is emulated only without `samplerAnisotropy` (and on MoltenVK's unmeasured cube-gradient route), so the emulation's shape tests compile on committed profiles with the feature withheld, and their MoltenVK arms on the profile as described. An isotropic cube keeps the device's gradient sample except on the unmeasured route. - A bias through a sampler without its own is the `Bias` operand on every profile (one test over MoltenVK, RADV, lavapipe and the floor); the compile-time and anisotropic axis-gradient tests take a constexpr sampler with its own bias, the only one that reaches them. The runtime slot's word-chosen axis gradients have no reader left: its test goes, with the helpers only it used. - The position kernel writes three words a lane: its record stride is 12 bytes, not 16, and the by-word gather test's lane floor matches its single pass. Verified: `cargo check -p metal2vulkan --tests --all-features` clean; the tests run after the rebase onto development. * Rewrite the sampling tests and notes for the device's sampler The sampling, texel-conversion and YCbCr-filter emulations are gone, so the tests that pinned them now pin the device's answer, and the note docs that described them describe what the module records today. Tests: the sampler-unk, anisotropic cube, depth-range, bicubic, dynamic-offset, heap half-texel, shared-switch, sRGB raw view, swizzled packed and texture-interpreter families. Deleted the tests of the emulated linear filter over raw sRGB codes (constexpr and runtime), the runtime sampler's one-texel raw sample and its switch, the shader's linear depth comparison, the bicubic small-level comparison against the linear emulation and the depth read's class conversion; the shared switch keeps the bicubic emulation alone. A NaN texel's half read only needs to read a NaN under the default policy. Docs: HalfSampleFilter, FloatSampleFilter, SrgbTexelDecode, AnisotropicFilter, DeviceAnisotropicFilter, ViewBaseTexelOffset and HalfTexelConversion in artifact.rs, RuntimeFact::TexelFormat, the heap class flag, texel_format_spec and a few comments that still named the emulated linear filter, snapped gathers or the shader's comparisons. Verified: plain clippy over the workspace with all targets and features; the touched families under nextest (see the next commits for the full runs). |
||
|
|
79166a74b1 |
Leave NaN bits and min/max picks to the device
One work packet, landed as 6 commits (a6e97e7f93..3919c8c94a on archive/development-linear-2026-10-28), in order: * Leave NaN bits and min/max picks to the device On the owner's ruling to promise the GPU's native arithmetic with no exact emulation, delete the NaN and minimum/maximum switch and every form that only it, or Metal's NaN bits, kept. What goes: - DevicePolicy::nan_and_min_max and NanMinMaxPolicy (exact_answers line, serde, ExactFormsOverCompilerLimit::nan_and_min_max, the fit leg). - The module's selects of Metal's NaN: NanEncoding::Device, ArithStrategy::Nan and lower/arith/nan.rs down to its answer classes. A NaN Metal answers that the device is not measured to answer records NativeNanEncoding. - Metal's operand pick in fmin, fmax, min3, max3, clamp and saturate (metal_min_max, metal_saturate, MinMaxRoute): NMin, NMax and NClamp on every profile, NativeMinMax where MetalMinMax is not taken. - Metal's texel NaN rule (TexelNanRoute, the 0x7e00 keeps, the half texel NaN keep, the NaN classes of reads, samples and gathers). - NaN canonicalization before colour and storage writes: StorageImageClass::HalfQuietNan and SmallFloatQuietNan, the half write NaN classes (HalfNans), the quieted heap small floats, the colour lanes that chose 0x7fc00000, the 16-bit colour outputs (StageIo and StageModule half_bit_colors, IoType::bits, Degradation:: ShaderHalfColorBits), PushField::TextureHalfChannels, RuntimeFact::StorageTextureHalfChannels and the slot word behind it. Such writes record DeviceNanEncoding where the stored NaN may not be Metal's (heap and formatless writes, 32-bit and packed float channels). - The narrow-float vertex fetch's canonical NaN: noted instead. - The runtime's colour NaN clears (nan_clear::NanClears and its texel computation, the inline-first NaN clear refusal, WorkCounts:: passes_not_inline_actions_nan_clear): the device's clear, announced as DeviceNanEncoding. The depth NaN clear and the bit-exact copies stay. - FAST-PATHS rows for the switch, the half texel keep and the half from bits under float controls; the known gap of RADV's sampler NaN; the API.md passages and catalogue entries. Kept: the notes that describe the native answer (NativeNanEncoding, NativeMinMax, DeviceNanEncoding), the measured deviations they read, the copy and depth paths, keeps_nan_sign, the heap half-bits twin, the half rounding and the blended snorm NaN of other lanes. Versions: SEMANTICS_VERSION 1871, ARTIFACT_FORMAT_VERSION 454, RUNTIME_VERSION 1652. docs/REFUSALS.md regenerated. Verified: cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; RUSTDOCFLAGS='-D warnings' cargo doc --workspace --all-features --no-deps; nextest of metal2vulkan filtered to the touched modules, fast_paths, catalogue, degradation, api_surface and profile (see the report for counts), and of the runtime, validation and conformance unit tests touched. No device test was run. * Re-bless the API signatures after the NaN and min/max deletion The table loses the public items the previous commit removed: NanMinMaxPolicy and its variants, DevicePolicy::nan_and_min_max, ExactFormsOverCompilerLimit::nan_and_min_max, PushField:: TextureHalfChannels, RuntimeFact::StorageTextureHalfChannels, StorageImageClass::HalfQuietNan and SmallFloatQuietNan, StageModule::half_bit_colors, Degradation::ShaderHalfColorBits and WorkCounts::passes_not_inline_actions_nan_clear. Verified: python3 scripts/api-signatures/signatures.py --bless; nextest of the api_signatures, api_surface, refusal_surface and feature_vocabulary binaries (21 passed); the previous commit's filtered metal2vulkan run, 1056 passed, plus runtime (53), validation (83 of 84; the failing c3 venue-identity test names the Apple M4 and touches no file of this change) and conformance (38) filtered runs. * Fix the tests the rebase onto development left broken The rebase of the NaN and min/max deletion onto development left two test compile errors: the extended-range samples still round through `half_toward_zero`, which the resolution had dropped with the storage-slot test that used it, and the RGBX storage cases named `HalfQuietNan`, which both sides' deletions removed (a half-float twin is `Identity` now). Verified: cargo clippy --workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; RUSTDOCFLAGS='-D warnings' cargo doc. * Drop a dead dot form and let formatless half slots note conversion twice select_float_fn still computed dot's scalar result form, which only the removed NaN canonicalization read. The half-float storage test asserted that a formatless slot notes DeviceColorConversion exactly when the profile does not round Metal's way; a formatless slot may also reach a normalized image, whose conversion is the device's on every profile, so the note is only required one way there. Verified: cargo check --workspace --all-targets --all-features is clean. * Leave the fast division's NaN to the device in its test The float-maths lane's a_fast_division_answers_metals_nans_on_every_profile asserted Metal's canonical NaN after the device's OpFDiv where the profile does not take MetalCanonicalNans. Under the native-arithmetic ruling the module selects no NaN: the fast division is the device's OpFDiv on every profile, noted NativeNanEncoding where the device is not measured to answer Metal's. The test, now a_fast_division_leaves_its_nans_to_the_device, checks that the module is the same on both sides of the fact, the note where the fact is absent, the device's arithmetic, division and denormal notes on every committed profile, never DeviceNanEncoding, a NaN for each NaN case and 6 / 3 exactly. Verified: cargo nextest -E 'test(/engine_arith::a_fast_division/)' passes (2 tests); the previous form failed on amd-780m-hawkpoint-radv for fast_one_by_negative_nan (0xffc00000, the device's). * Re-pin the runtime sources at the landing tip The landed packet changed a runtime-sources input, so the committed digest no longer described the sources and `the_runtime_sources_are_the_committed_ones` would fail. Recomputed over the same inputs and committed by land-pkt.sh. |