2137a20004e2b5658aedd0bdfdafc99e043606ce
1530
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0db5825a60 |
Take mesh-barrier-readers' lone-run contrast now its writers bind no store sink
What. The case's Apple M3 Max cost record takes the lone-run contrast (conformance cost --alone --runs 8 --write mesh-barrier-readers): shader_modules_made is bounded at 10, written as its ceiling, where the record held 9. The fold also moves four counts into the ones the selection decides: batches_held_past_a_look and heads_held_for_host_steps (0 alone, 1 and 2 in the set), queues_sharing_a_vk_queue (0 alone, 1 in the set) and new_buffer_bytes_cleared (3416 alone, 3800 in the record). The record's in-set bounds stay as committed. Why. The extra module is a different module, not a missed share. A variant's stage module is shared only between byte-identical SPIR-V words (the device's map is keyed by the words' digest, pipeline/objects.rs shader_module). The one that is now made twice is the emulated mesh draw's vertex stage, the 524-word shader that pulls the mesh outputs from two storage buffers. Its words name those buffers' set-0 bindings, which come after the pipeline's own set-0 bindings (numbered densely). Before a31d02e99a the two writer pipelines (mesh writer, fragment writer) bound the control buffer at 0 and the store sink at 1, so their vertex stage read the outputs at bindings 2 and 3, the same as the grid readers, whose set 0 holds the control buffer and the grid's one-word uniform. With the sink gone, the writers read them at 1 and 2 and the grid readers still at 2 and 3. The two modules differ in exactly two Binding decorations. The old sharing was a coincidence of the sink filling one binding. variant_pipelines_made stays 27 and pipelines per state 2.25. new_buffer_bytes_cleared falls by 384 bytes, the six writer draws' 64-byte sink regions. A whole-set measurement of the current tree (8 runs, not kept) reads 3416 in the set as well, so this difference comes from the deletion, not from the selection. The fold's rule reports every count the two shapes read differently, so it is reported now, with the 3800 bound taken before the deletion. That whole-set measurement also moved counts the deletion does not touch (command_buffers_replayed_inline 45 to 9, scheduler_wakes_host 4 to 6, scheduler_sleep_slices gone). Keeping it would have gated those at one process's reading, so the committed in-set bounds stay. Verified, MoltenVK 1.4.2 on the M3 Max: - a temporary probe (not committed) logged each module's digest and whether it was made or shared, with the case alone at c0ffb238b1 and d791928640, and spirv-dis of the dumped words: 9 made / 30 shared against 10 / 29, the only new digest the vertex stage at bindings 1 and 2, the old one byte-identical to the grid readers' (2 and 3), and the writers' old stages carrying the sink at binding 1; - the lone run reads shader_modules_made 10 in each of 8 runs; - the full replay exits 0: 1112 cases within their cost bounds, 10 unmeasured for the venue's recorded reasons, and the 173 gap rows exactly the ones known-gaps.tsv expects; - lavapipe (arm64, linux-gate): replay --cpu exits 0, its 891 gap rows exactly the expected ones; - the conformance host tests pass (1007/1007, the contrast and cost-coverage tests among them); clippy --workspace --all-targets --all-features -D warnings is clean. No version moves: no product behaviour changed. Originally d0f1b87e2e (archive/development-linear-2026-10-28). |
||
|
|
6d603cb412 |
Read a commit's status where Metal fixes it in the deferred-commit test
a_commit_after_an_end_in_flight_returns_and_keeps_its_order read the pass's status right after commit and required `Committed` under both render-lowering policies. Under AtCall nothing holds that command buffer: commit hands it to the scheduler's thread and returns, and the thread's transition to `Scheduled` races the read. Metal's commit also returns before scheduling and promises no `Committed` read after it, so the runtime matches Metal's contract and the test raced. On lavapipe it failed 7 of 25 and 4 of 25 runs of the deferred_calls group, every failure under AtCall; Worker's held lowering already fixed its read. The pass now commits behind a command buffer of its queue that waits for an unsignalled shared event, raised once the answers after the commit were read. Metal reads `Committed` for a command buffer committed behind one an event holds (conformance case event-held-command-buffer, M3 Max, macOS 27.0.1), so the read is deterministic under both policies without a sleep or a retry. Runtime behaviour is unchanged. Verified: 50 consecutive runs of the deferred_calls group on lavapipe (linux-gate arm64, --cpus 4, --cfg m2v_cpu_icd), all 14 tests passing each time. Negative control: the same loop with the gate raised right after the holding command buffer's commit (patched inside the container) failed 6 of 25 runs, all under AtCall. MoltenVK on the M3 (--cfg m2v_gpu): 14 of 14 passed. clippy -D warnings clean, plain and with --cfg m2v_gpu. Originally 00a2d72a85 (archive/development-linear-2026-10-28). |
||
|
|
505dfb9437 |
Upload an inline constant per dispatch in the arena sweep, now the store sink is gone
a_command_buffers_fixed_clear_is_not_a_chunk measured the arena's per-dispatch term through the dropped-store sink, a region each dispatch took and the GPU alone wrote. a31d02e99a deleted the sink, so the dispatches uploaded nothing and the test's own precondition failed on lavapipe at 46c3156d42 (0 arena bytes at one dispatch and at sixteen). Each dispatch now sets scale_and_offset's constant inline (set_bytes at index 2, a distinct value a dispatch), a 16-byte region whose 12 bytes past the data the region clears. What the test holds is unchanged: a command buffer's fixed clear is not a chunk (0 bytes), and a dispatch clears its own region's tail and no more. Verified: lavapipe (arm64 linux-gate) and MoltenVK (M3 Max) both pass the two upload_chunk_zeros tests (lavapipe 3 runs of 3; 1x1 12, 1x16 192, 4x1 48, 4x16 768 bytes cleared); clippy -p metal2vulkan-runtime --all-targets --all-features with --cfg m2v_gpu clean. Originally d791928640 (archive/development-linear-2026-10-28). |
||
|
|
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. |
||
|
|
4c07cde4d2 |
Announce set-past-layout-support at every bind of a variant past its driver's support
One work packet, landed as 9 commits (332aebcc0c..c0ffb238b1 on archive/development-linear-2026-10-28), in order:
* Announce set-past-layout-support at every bind of a variant past its driver's support
What. A variant's kinds (`Kinds::of`), which a bind tests before it
announces anything at every occurrence, now hold `SetPastLayoutSupport`
where a set of the pipeline's layout is past the least
`maxPerSetDescriptors` (1024) on a driver that understates its layout
support (`RuntimeDriverDefect::SetLayoutSupportUnderstated`, MoltenVK):
`pipeline::objects::may_pass_support`, the same test `set_support` makes
before it asks the driver.
Why. The kinds held the stages' notes and the vertex-simdgroup property
alone, though `Device::degrade_pipeline` announces the layout notice too.
So a device announcing it at every occurrence (`announce_each`, which the
conformance suite's device sets) announced it only for a variant that
also recorded a precision note: the heap set of a kernel reaching a
texture through an argument buffer (65536 descriptors per array on the M3
Max, which MoltenVK's `getDescriptorSetLayoutSupport` refuses at a sum of
1212 or more) went unannounced until the native-arithmetic round gave 36
conformance cases' kernels a note (device-nan-encoding,
pixel-sampler-scaling), and then it surfaced in exactly those. The notice
is true of the driver: the layer reports VUID-09582 for each such layout.
Without announce_each nothing changes: the making announces it once.
RUNTIME_VERSION 1820 (placeholder, to be renumbered at landing): a bind
can announce what it did not.
Verified: tests::driver_defects::a_set_past_the_drivers_support_is_among_its_variants_kinds
(hsw_held compiled for the committed MoltenVK profile: sets of 4 and
65536 descriptors; the kind held where the driver understates, not where
it does not; the kinds' test agrees with set_support's Understated) passes,
and fails with the kind's addition disabled ("sets of [4, 65536]
descriptors, the driver understating its support: true"). A full MoltenVK
replay (M3 Max, 1.4.2) with the change reads the same 152 unlisted lines
as without it: the 36 cases that announce it already did.
* Declare set-past-layout-support where a case's kernel reads an argument buffer's texture
What. replay::set_past_layout_notice(), a declaration like
shared_memory_notice, and its use by the cases whose kernels reach a
texture or a sampler through an argument buffer: every pixel-samplers and
pixel-downscales case (the arg source), every norm-storage case (the held
route), the three half-storage-writes held rows, read-write-tier-held, and
the two argument-encoder cases that dispatch.
Why. Such a kernel takes the handle heap, set 1, of 65536 descriptors an
array on the M3 Max. MoltenVK 1.4.2 answers vkGetDescriptorSetLayoutSupport
by the sum of the counts against maxPerSetDescriptors (1212), so it refuses
the set though it makes and runs it; the runtime makes it and announces
set-past-layout-support, and the layer reports VUID-09582 for it. That is
a notice of what the driver lacks, which NATIVE_NOTES leaves to each case
to declare. The query is a true one, asked of the create info the layout
is made from, so the runtime keeps announcing it. The 36 cases' MoltenVK
replay read it as undeclared (42 sites, the argument-encoder cases' four
each, since their shared-memory declaration loosened the notices site with
nothing announced to justify it).
Verified: the MoltenVK replay of the 36 cases on the M3 Max (1.4.2) exits
0, 27 announced and the 9 divergent at their ledger rows, nothing
unlisted.
* Ledger the M3 Max's own NaN bits at 37 half-NaN sites
What. Apple M3 Max rows for the sites where this venue answers the
canonical quiet NaN 0x7E00 for a `half` NaN Metal keeps the bits of:
attribute-format-fetches' 29 attribute3 sites (a Half or Half2 attribute
fetched through stage_in into a half2 and reinterpreted), the three
half-write-nans 16-bit float stores, the three half-texel-nans `read`
sites, and math-frexp-ilogb-half's two frexp mantissa sites.
Why. Read off every element of each site (both sides' bytes dumped from
the replay): every differing element is a NaN on Metal's side -- 0x7E01
and 0xFE01 for the attributes, the stored halves' own codes, the texels'
own codes, frexp's 0x7E01, 0xFE55 and 0x7C01 -- and 0x7E00 on ours; no
other code differs. This M3 widens a half NaN to the canonical one, so
the bits are gone at the device's widening (the attribute's and texel's
reads, the store's widened conversion) or at the device's NaN result
(frexp). Each is announced and recorded: native-nan-encoding (a module
reading a half from its bits; an operand's bits where Metal answers
them) and device-nan-encoding (a half texel's write; a half texel's
read), both native notes whose bound is the device's sign and payload,
validation deriving no tolerance from them. The `read` rows carry the
words of the M3 rows at the family's two other sites, now that the read
also goes through the device's decode. So the 32769 the attribute rows
show is the negative NaN's sign and payload, not wrong data.
Verified: MoltenVK replay of the 8 cases on the M3 Max (1.4.2) exits 0
with nothing unlisted.
* Ledger the M3 Max's sRGB pack and unpack at the device-pack-conversion bound
What. Apple M3 Max rows for pass-bytes-srgb-decode-all-bytes and
pass-bytes-srgb-encode-sweep, at their one site each.
Why. The module decodes and encodes sRGB by the MSL transfer function
through the device's Pow (device-pack-conversion, a native note, recorded
on every device for the sRGB forms), where Metal goes through its
twelve-bit table. Read element by element off the replay's bytes against
the committed recordings: every decoded float is within 1.2205e-4 of
Metal's step (under half a twelve-bit step, 1/8190), every decoded half
within that and one half ulp (at most 0.97 of the sum), the alpha lanes
exact; every encoded colour channel that differs (1,821 of them) is one
code from Metal's, no alpha. That is the note's recorded bound. The
largest raw differences (0x00F90001, 0x00010101) are a small half 249
ulps off beside a one-ulp half, and one code in each colour byte.
Verified on the M3 Max (MoltenVK 1.4.2) by the replay of the two cases,
after the rows' rebuild (see the next commit's run).
* Ledger the M3 Max's own half-output blend at the fast-math-blend bound
What. The 18 Apple M3 Max half-output-blends rows go and 52 come: every
site the three 16-bit float formats now differ at, none for the 32-bit
float formats. The family's module docs say what each side does now.
Why. The exact shader blend of a half output is gone (the
native-arithmetic ruling), so the device blends. Read word by word off
the replay's bytes against the committed recordings and the case's own
source sweep and destination generator: this M3 blends the half widened
to float in float and converts into a 16-bit float format toward zero
(every word of the 43 divergent sites whose sum adds no blend-colour
product, 97 to 99.6 per cent of the other nine's), where Metal's compiler
folds the blend into the function (round(round(Sf*S) + Df*D) at the sites
the case's tests measure). Every differing word, 52 sites of 6 to 559
words, is within 2 half ulps of Metal's at the operands' magnitude (the
largest of the source, the destination, a factor and the two products'
magnitudes summed; the worst exactly 2), which is
half-output-fast-math-blend's recorded bound; the case declares that
note and it fired. Raw-code distances up to 1,582 are results near zero.
The 32-bit float formats now store Metal's codes at every word, so their
8 rows are stale, and the 10 old 16-bit rows' counts no longer hold.
Verified: MoltenVK replay of the six blend cases and the two sRGB cases
on the M3 Max (1.4.2) exits 0, nothing unlisted and nothing stale; the
32-bit float cases read announced.
* Ledger the M3 Max's same-command-buffer read of a dropped kernel store
What. One Apple M3 Max row for host-page-writes-kernel-store-read-only
at case/bytes-in-the-same-command-buffer-bytes, an open bug of ours.
Why. Metal drops a kernel's stores into read-only backing, and a later
command of the same command buffer reads them back from the GPU's caches
(every one of the 8 recorded runs); ours reads the pages' own bytes.
Measured cause: the shader drops its own stores through a slot bound to
such a buffer (StageTable::dropped_store_buffers, SpecKey::DroppedStoreSlots),
so the store never reaches the caches, though on macOS the read-only view
the pages are imported through already drops the write. With that word
forced to zero (a local probe, not committed) the case is exact on this
M3, 3 runs of 3, its later-command-buffer and CPU sites still the dropped
write. The gap predates the native-arithmetic round: the same divergence
replays at
|
||
|
|
89f7752907 |
Re-bless the conformance cost records on the M3 Max after the native-arithmetic round
The round's landings announce more notes and move what the runtime does on MoltenVK (the device's clears and fills, the sRGB-twin resolve, the pixel samplers' notes), so 143 cases read over their bounds, nearly all on bound_notices_made. conformance cost --write (8 runs of the whole selection on Apple M3 Max, MoltenVK 1.4.2) re-takes the in-set bounds and the degraded sets of 823 recordings; every case already carried a record and its contrast (AFTER_THE_LAST_RUN is empty), so no --alone contrast is owed. Verified: the MoltenVK replay after the write reads 1112 cases within their bounds and 10 unmeasured (the venue's recorded reasons), none over; the conformance host tests pass (1007/1007). Originally 25ec241210 (archive/development-linear-2026-10-28). |
||
|
|
099edf8c80 |
Re-bless the golden tables after the alpha-coverage note
One work packet, landed as 2 commits (eb7f5192f1..9f8dd950c9 on archive/development-linear-2026-10-28), in order: * Re-bless the golden tables after the alpha-coverage note The new MetalAlphaCoverage driver deviation moves the moltenvk-m3 profile's key (one row 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 7ec539ceb2. * Re-bless the authored compile census after the alpha-coverage note corpus-triage --audit authored-compile --bless: 0 differences, 0 regressions, 0 failed, 0 artifacts moved; only the product stamp moves. Slowest compile 599 ms, slowest case across all profiles 18.4 s, peak worker RSS 231 MB. Verified: the census run above at 7ec539ceb2. |
||
|
|
7f3f0a2f36 |
Mend the private intra-doc links the round's deletions broke, and lower the runtime's ceiling
One work packet, landed as 2 commits (a206cc110f..951b13189a on archive/development-linear-2026-10-28), in order: * Mend the private intra-doc links the round's deletions broke, and lower the runtime's ceiling CI's private intra-doc link step holds each crate to the diagnostics rustdoc --document-private-items still reports. At 7ec539ceb2 the translator reported 6 against its ceiling of 0 and the runtime 75 against 73, links to items this round deleted or narrowed: - the translator: DeviceProfile::edit (built for tests alone), the bicubic Span (gone; the packed line caller is gone with it), word_filters and Linear::words (gone with the device sampler), and StageInFetch::of (in pipeline::stage_io, linked by its path); - the runtime: an unescaped [0,1] in ycbcr_device's quoted spec text, LARGE_SURFACE_TEXELS, Device::inform and Needs::AnyOf linked by their paths, and DIRECT_ARGUMENTS_FROM_AIR (built for device tests alone) named without a link. Docs only; no behaviour changes, so no version moves. Verified: --document-private-items with -Dwarnings reports 0 for the translator and 70 for the runtime (the ceiling now says 70); the public rustdoc build of both crates with -D warnings is 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. |
||
|
|
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. |
||
|
|
59c3e0b9fd |
Clear a plain colour fill in place, else from a kept tile, making no image a fill
One work packet, landed as 3 commits (5719a77786..c29af6a42e on archive/development-linear-2026-10-28), in order: * Clear a plain colour fill in place, else from a kept tile, making no image a fill A plain fillTexture:...color: of a format the device renders became the device's clear (vkCmdClearColorImage) of a scratch image the size of the region, made for every fill and copied into the region. Measured, that cost more than the host packing it replaced: a command buffer of 1000 16 x 16 fills made 968 VkImages (32 recycled) and took 69 ms to complete on MoltenVK (M3 Max) against 26 ms packed, and every single fill added about 200 us of commit-to-completion there. Now, keeping the device's conversion and the same notes: - a fill of whole subresources (every texel of a level's layer, a 3D level's depth images) whose image is the texture's own, of that extent, made with TRANSFER_DST usage in a format whose tiling has TRANSFER_DST (VUID-vkCmdClearColorImage-image-00002, -image-01993; the image rests in GENERAL, -imageLayout-01394) is one vkCmdClearColorImage of that image: nothing is made, no copy. It is written as a blit copy writes it (covered boxes for heap shadows, decoded twin, sparse scrub, the compressed-blit note); - any other region copies a tile the device cleared, of the texture's image format, samples and dimension, side by side from the region's origin. The encoder keeps its last 4 tiles: a fill of a colour a kept tile holds only copies; another colour makes a tile while fewer than 4 are kept and clears the least recently used one again past that. A tile's sides are powers of two of at least 16 texels, bounded by the texture's first level, halved to 1 MiB at most, so near sizes share one and a larger region takes several copies. An encoding again starts with none (the replay clears again). RUNTIME_VERSION 1800 (placeholder): the commands recorded change. The seven lavapipe texture-fills known gaps name the new mechanism in their prose. Measured, release, median of 21 command buffers after 3 warm-ups (encode per fill / commit to completion; images made or recycled per command buffer), a037828e54 -> development -> this: MoltenVK 1.4.2, M3 Max (host load 8-10): whole 256^2 RGBA8Unorm 232us/266us/0 -> 3.8/463/1 -> 1.5/423/0 16x16 of it 2.7/269/0 -> 4.9/459/1 -> 2.9/447/1 whole 2048^2 3673/745/0 -> 3.8/465/1 -> 1.3/446/0 1000 x 16x16, 1 colour 2.0/26.2ms/0 -> 3.7/69.4ms/1000 -> 0.9/24.8ms/1 1000 x 16x16, 2 colours 2.1/26.4ms/0 -> 3.7/70.0ms/1000 -> 1.0/24.9ms/2 whole 256^2 sRGB, half ~236 and 421/~265 -> ~5/~450/1 -> 1.4/~420/0 lavapipe (llvmpipe, LLVM 21, arm64 container, 4 CPUs; GPU times in brackets, its small commit times vary about 2x run to run): whole 256^2 600us/36us[9]/0 -> 6.3/97[33]/1 -> 3.3/152[27]/0 whole 2048^2 9658/481[357]/0 -> 7.6/1599[1506]/1 -> 4.8/1365[1216]/0 1000 x 16x16, 1 colour 3.4/1.01ms/0 -> 1.6/1.55ms/1000 -> 0.8/0.57ms/1 The host packing staged a write-combined buffer per fill (936 made per 1000). What stays: on MoltenVK the device's clear itself (a render pass) costs about 160 us of completion over a buffer copy, in place or not. MoltenVK's clear stores other codes in a 1 x 1 image than in a 16 x 16 one (the 1 x 1: sRGB and 16-bit-unorm ties, half NaN 0x7e00, RG11B10Float 186 and RGB9E5Float 150 texels a code apart; the 16 x 16 tile: Metal's bytes but for RG11B10Float NaNs), every one inside what the fill announces. Tests: color_fills::plain_color_fills_are_the_device_s_clear now fills every colour of every format twice, into a texel of a level (a tile) and into a whole 1 x 1 slice (in place, asserting no image made or recycled), each held to Metal's within its notes. color_fills::whole_subresource_fills_make_no_image asserts WorkCounts' vkCreateImage plus recycled images stay 0 across whole fills of a 2D level, an array slice and a 3D level (texels checked, the rest kept) and are 1 and 2 for 64 part fills of one and two colours; it fails on the parent's per-fill scratch. Unit tests for tile_extent and tile_copies. Verified: runtime_lane color_fills, texture_fills, rgbx_textures, sample_fills, surface_fills, texture_buffer_fills and two_plane_copies pass on MoltenVK (--cfg m2v_gpu, 31 tests) and lavapipe (--cfg m2v_cpu_icd, 31); the lavapipe conformance replay shows exactly the 891 listed gaps (0 unlisted, 0 stale); runtime fill unit tests and conformance gap tests pass; clippy (workspace, all targets and features; and validation with --cfg m2v_gpu) and rustdoc clean. * Number RUNTIME_VERSION 1678, past development's The fill change took the placeholder 1800; development is at 1677. * 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. |
||
|
|
52ac4c192c |
Hold the kept-resolve lane's twin texels to the device-rounded-resolve bound
Since a037828e54 the crate-owned resolve into an sRGB twin decodes and encodes through the device's own sRGB view, and device-rounded-resolve states each color channel within two codes of Metal's. The kept-resolve lane still compared every texel to Metal's codes byte for byte, so it failed its first pass on lavapipe (Mesa 26.0.8), the one failure of the full lavapipe run at 20c64bb22c (4591 of 4592). The lane now holds its texels through resolves.rs's twin_resolved, the check the twin-resolve lane already uses: the color channels within the note's two codes, alpha exactly. What the lane is about, the kept and made resolve objects, is unchanged. Verified: on lavapipe (arm64 linux-gate) kept_resolves fails before and passes after, with the twin and dont-care sRGB lanes still passing; clippy -p metal2vulkan-validation --all-targets --all-features with --cfg m2v_gpu clean. Originally cdba7f84f2 (archive/development-linear-2026-10-28). |
||
|
|
8a2b057c3b |
Re-bless the golden tables at the native-sweep round's tip
One work packet, landed as 2 commits (0ae4976a0d..20c64bb22c on archive/development-linear-2026-10-28), in order: * Re-bless the golden tables at the native-sweep round's tip The pixel samplers' device coordinate (255f93b252) and the round's other landings move the translated modules' hashes. bless_engine_inventory and bless_engine_goldens wrote nothing new; bless_golden_hashes moved 206 rows of golden_hashes.tsv. tests::air_input's ignored bless found nothing to change. Verified: the three bless runs and air_input exit 0 at bad631efa8. * Re-bless the authored compile census at the native-sweep round's tip corpus-triage --audit authored-compile --bless over 2253 cases and 21 profiles (47313 cells): 0 differences, 0 regressions, 0 failed, 1441 artifacts moved by hash alone. Slowest compile 677 ms, slowest case across all profiles 18.5 s, peak worker RSS 229 MB. Verified: the census run above at bad631efa8. |
||
|
|
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. |
||
|
|
8fb8b51f4e |
Hold the kept compressed-blit encodings to the ledger on the M3 Max
One work packet, landed as 2 commits (4a74bd7248..aa6286b711 on archive/development-linear-2026-10-28), in order: * Hold the kept compressed-blit encodings to the ledger on the M3 Max Since 62c7d7a9f5 a blit through a texture Metal keeps losslessly compressed is the device's copy, which keeps the bytes Metal's compression rewrites into its canonical encoding. dbd18ad126 held the lavapipe replay to that; the MoltenVK replay on this M3 Max read 24 value sites the ledger did not list. Each is now a known-gaps.tsv row (venue Apple M3 Max) naming the note that records it: - compressed-blits-bgra10xr and -srgb, all seven sites: the runtime holds the format in an R16G16B16A16_UINT image, whose blits under MoltenVK keep the bytes. extended-range-bits-kept. - compressed-blits-rg11b10f and -rgb9e5f, the five sites through the Shared texture (blit-in-cpu-out, cpu-in-blit-out, out-of-compressed, into-compressed, over-a-buffer): MoltenVK makes that texture's image of PixelFormatView usage, which Metal keeps uncompressed, so its copies keep the bytes. device-nan-encoding and shared-exponent-kept. The Private compressed sites (tall, level-3-padded) are MoltenVK's own blit through Metal's compression and match Metal there. This is the same value in another encoding, not wrong data. The bytes the case feeds, set against Metal's recorded words site by site, give exactly the replay's counts and largest differences at all 24 sites (for example tall 8191 words, largest 1610547199: Metal's alpha code clamped up to 384 from below). Every texel of those bytes decodes to Metal's value: the top ten bits of each field with alpha read clamped for BGRA10_XR, NaN for NaN for RG11B10Float, the exact value for RGB9E5Float. Nothing is open: rule 1 rules out a pass that writes Metal's encoding. docs/CONFORMANCE-COVERAGE.md regenerated (the ledger's row count). Verified on the Apple M3 Max, MoltenVK 1.4.2: - conformance replay of the four cases at 46bd06ec2f (the parent of 62c7d7a9f5): all four announced, every value exact. - the same replay at 19b0dafb5a: 24 unlisted divergent sites, exit 1; with these rows: exit 0, the 24 rows exactly the ledger's. - runtime_lane::compressed_blits under --cfg m2v_gpu: passed; every kept site held byte for byte, ExtendedRangeBitsKept, DeviceNanEncoding and SharedExponentKept each announced, MoltenVK's own copy of the Private compressed images rewrote 374 (RG11B10Float) and 507 (RGB9E5Float) words. - cargo nextest -p metal2vulkan-conformance known_gaps, compressed_blits and coverage tests (19 passed); clippy -D warnings; coverage.py --check. * Say in the notice catalogue that a compressed RG11B10Float blit announces device-nan-encoding The catalogue's device-nan-encoding entry named only float arithmetic's NaN results, while PrecisionNote::DeviceNanEncoding's doc and the runtime also announce it for a GPU blit through an RG11B10Float texture Metal keeps losslessly compressed, as the extended-range-bits-kept and shared-exponent-kept entries already say for their formats. Docs only. |
||
|
|
e656074087 |
Name no native note in any conformance case, at the notices site or at a value
One work packet, landed as 5 commits (647aeae138..19b0dafb5a on archive/development-linear-2026-10-28), in order:
* Name no native note in any conformance case, at the notices site or at a value
The suite declares every note of the device's native answers for every case
(replay::NATIVE_NOTES), so a case's own declaration of one stated the suite's rule a
second time, and a value tolerance justified by one was the suite deriving a tolerance
the note's own documentation says validation derives from none.
What changed:
- 237 notices-site declarations of native notes, over 180 cases from 28 case modules
(depth-denormals 76, device-color-conversion 33, float-sample-filter 31,
device-nan-encoding 27, srgb-texel-decode 25, signed-depth-test 17,
device-arithmetic 10, device-sampling 8, device-texel-conversion 8, one each of
device-transcendentals and unorm-depth-rounding), are gone. The shapes that existed only
to choose them go too: fresh_contents' per-row notices, half_write_nans' `packed`,
render_chains' and compute_render_chains' `divides_a_float`, alpha_coverage_pairs'
separate on/off and single-sample sets, and sampler_filtering's name-keyed branch.
- Four value tolerances justified by native notes are removed: border_swizzles'
one-word `Absolute` and compressed_decode's and etc_textures' one-ulp `Ulps`
(device-texel-conversion, whose note says validation derives no tolerance from it), and
pass_bytes' `Unchecked` tanh column (device-transcendentals, device-arithmetic). Those
sites compare exactly; where a venue's device answers otherwise the site is a
known-gaps.tsv row, which the ledger commits that follow carry. border_swizzles'
word-range test, which existed only to make its tolerance mean one ulp, goes with it.
- tests::no_case_names_a_native_note holds it: it failed listing 765 allowances before
this change and passes after.
- docs/CONFORMANCE-COVERAGE.md regenerated (tolerances 12 to 8, `Ulps` no longer used).
Verified: cargo nextest run -p metal2vulkan-conformance --all-features, 1007 passed;
clippy -p metal2vulkan-conformance --all-targets --all-features -D warnings clean.
* Count no native note in the cost and times halves' degraded-set rule
The rule is there because a notice can say the device lacked the exact form and the
runtime did something cheaper, so a count or a time taken with it is of a different amount
of work. A native note (replay::NATIVE_NOTES) never says that: the native form is the only
one the runtime builds, under either policy. Counting them made a cost record incomparable
with the same work whenever a run did or did not provoke one (the MoltenVK replay before
this change read 45 cases `unmeasured` for native notes alone: device-color-conversion,
device-filtered-mipmaps, device-nan-encoding, native-nan-encoding, native-half-conversion,
fast-math-rewrites), and withheld a times verdict from every case that computes, converts
or samples.
replay::degrading filters them out, sorted and once each. run.rs takes it for the replay's
cost row, the cost measurement and the times round; cost::judge and times::classify apply
it to the stored side as well, since records and figures taken before still hold native
codes (fast-math-rewrites in 56, device-nan-encoding in 33 of the committed ones), so no
re-bless is needed for the rule itself.
Tests: tests::the_degraded_set_rule_counts_no_native_note (a record holding a native note
judges `within` against a run that announced none, and the other way, while a non-native
difference stays `unmeasured`) and times::tests::a_leg_that_announced_only_native_notes_is_judged.
README's two statements of the rule say so.
Verified: cargo nextest run -p metal2vulkan-conformance --all-features, 1007 passed;
clippy -p metal2vulkan-conformance --all-targets --all-features -D warnings clean.
* State the measured bounds of the device's texel and colour conversions
device-texel-conversion's recorded bound named 8- and 16-bit codes and said a
4-bit channel's widening is exact, so two lavapipe ledger families had no
stated bound: a 10-bit BGR10A2Unorm code read one f32 ulp low, and ABGR4Unorm
codes read one ulp high (the device converts by the reciprocal product, where
it does not replicate bits). The bound now covers 8-, 10- and 16-bit codes and
a 4-, 5- or 6-bit channel converted by the reciprocal, within one f32 ulp.
device-color-conversion stated only that near a tie the device may store the
other code. On lavapipe it stores past one code in three shapes, which the
note now states: a blend into an 8-bit unorm attachment within 2 codes, a
fetched-and-rewritten 8-bit sRGB attachment within 2 codes once a later draw
reads an earlier one's code, and a blend into an 8-bit sRGB attachment within
4 codes. Another device is not bounded past one code; the NVIDIA RTX 5080
Laptop GPU ledger rows record up to 11 codes at an sRGB blend.
The same text goes into the translator's PrecisionNote docs, the runtime's
Degradation docs (DeviceColorConversion gains one) and docs/API.md's
catalogue. Docs only; no behaviour changes.
Verified: the lavapipe replay (scripts/linux-gate, arm64, LLVM 21.1.8) shows
every row of those families within the stated figures (the ledger's answers);
rustdoc -D warnings for metal2vulkan and the runtime; the runtime's
degradation and catalogue tests.
* Reword the ledger rows that proposed emulating Metal's bits, and list lavapipe's exact rows
Under the native-arithmetic contract, the device's blend, conversion and
sampler are the answer. Some known-gaps.tsv rows still proposed reproducing
Metal's bits: folding the blend into the fragment function, encoding through
Metal's table, or emulating an argument buffer's sampler. Those rows now name
the note that covers the difference and its stated bound, or the open work
where there is some. Only field 6 changes, and no row moves.
- Apple M3 Max half-output-blends (18 rows) and NVIDIA half-output-blends
(39): half-output-fast-math-blend and its stated bound, with no fold. The
sign-bit sentence is kept only where an NVIDIA bound is the sign bit.
- NVIDIA a2one (2) and argb8-targets (23): device-color-conversion. The
llvmpipe argb8 rows at 2 codes (9) now cite the bound the note states.
- blend-interaction-format-srgb8 (14, both venues): device-color-conversion.
lavapipe's sites are within its 4 codes. NVIDIA's 11- and 5-code sites are
past it and need an element-by-element read.
- fetch-ordered sRGB (8), ABGR4Unorm swizzles (26) and the BGR10A2Unorm
round trip (1) cite the bounds the notes now state.
- RADV sample-fills (3): depth-denormals is a native note the suite declares
for every case, not one the case declares.
- NVIDIA pixel-samplers nearest norm (6): device-sampling's nearest-boundary
bound. Open: an element-by-element read.
- a2c-on-1-alpha-50 (2): no note covers the device's coverage mapping. Open:
the owner's call between recording it and computing Metal's floor rule.
- format-footprints-plain-stragglers: the raw sRGB path and
`texel_format::srgb_raw` are gone. The row names the UNORM twin path that
is there today (`srgb_raw_twin`, `srgb_twin_on`, `RuntimeFact::SrgbTexture`)
and drops the todo-list wording.
Removing the old one-ulp and as-words tolerances showed lavapipe's own
conversion at exact sites. That adds 64 rows beside their families
(border-swizzles rgba8/bgra8 30 each, ETC2/EAC 8-bit 3, pass-bytes
fast-float-tanh 1) and updates 35 BC rows' answers, their counts now
including the one-ulp elements.
Verified: the lavapipe replay through scripts/linux-gate (arm64, 4 CPUs)
went from 99 unlisted and 35 stale before these rows to 0 unlisted and 0
stale ("the 882 row(s) above are exactly the open gaps known-gaps.tsv
expects"; 818 before the tolerance removal). The conformance host suite
passes (1007 tests), and docs/CONFORMANCE-COVERAGE.md is regenerated.
* 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.
|
||
|
|
b8c010d53a |
Make mipmapped textures on the engine executor's own context
The runtime lane's render census failed on lavapipe for
clamped-lod-sits-on-metals-grid-whatever-the-min-and-mag-filters: since
sampler LOD clamps reach the device as given (noted DeviceSampling), the
runtime's output differs from Metal there by design, so the lane runs the
fresh candidate, the executor's own context, and that context refused every
texture of more than one level (executor_not_implemented).
The own context now makes a bound texture's image with the texture's levels
and uploads each level from its bytes (`LiteralTexture::level`), one copy
per level of every layer, each level's start aligned to the texel size and
4 as a copy's bufferOffset must (zero padding only where a level ends off
it). A whole-texture view holds every level, a level view its one; the
upload, initializer and readback barriers cover every level. The sampler
side was already the plan's (constexpr samplers are the layout's immutable
ones, runtime samplers bind::sampler_desc), so filters and LOD clamps are
the translator's. Levels stay refused, typed, for a multisampled, sparse or
read-back texture, which the case checker never admits (`case::mips`).
One-level images get the same images, views, copies and barriers as before.
No version bump: ENGINE_EXECUTOR_ABI's rule exempts a change only cases the
executor refused can observe. The own context refused every mipmapped
texture, no committed observation row comes from it for one (the 13
mipmapped cases' rows are the runtime path's), and the one-level path is
unchanged. The requirement vocabulary and the classifier's inputs are
unchanged (mipmaps were already authorable; case/mips.rs is no classifier
input, its edit is a doc line), so the authoring-capability census needs no
rerun.
Verified:
- New test candidate::tests::engine_textures::
each_level_of_a_mipmapped_texture_holds_its_own_texels (msf_mip_levels'
2D, 3D, cube and 2D-array kernels, nearest at each level; an r8_unorm 6x6
texture whose level 2 needs padding). Passes on lavapipe and MoltenVK
(M3 Max); with this commit's plan_resources.rs reverted it fails on
MoltenVK with the old NotImplemented refusal.
- lavapipe (linux-gate arm64, m2v_cpu_icd): engine_textures, the renders
census and the 16 kernel-texture shards, 26/26 pass. Renders: 151 match
Metal, 15 match the fresh candidate (the clamped-LOD case among them), 51
refused, 0 failed, of 223; no executor_not_implemented anywhere in the
run. Then candidate::, runtime_lane::{argument_buffers, mip_levels,
kernel_lod, runtime_levels}: 264/264 pass.
- MoltenVK (M3 Max, m2v_gpu, under maclock): the same 25 tests pass (one
nextest LEAK flag on kernel shard 10, which ran no candidate). Renders:
207 match Metal (the clamped-LOD case matches Metal there), 4 match the
fresh candidate, 6 refused, 0 failed.
- clippy --workspace --all-targets --all-features -D warnings, plain and
--cfg m2v_gpu; rustdoc -D warnings for the validation crate.
Originally 5b329021ef (archive/development-linear-2026-10-28).
|
||
|
|
03252d4a6b |
Say what color_resolve_modules refuses instead of linking a private function
One work packet, landed as 2 commits (50ed55b895..63942a4e4b on archive/development-linear-2026-10-28), in order: * Say what color_resolve_modules refuses instead of linking a private function fragment_typed_module is not exported from bind, so the public doc's intra-doc link failed RUSTDOCFLAGS='-D warnings' cargo doc on development (79c82de838). The sentence now states the refusal itself. Verified: RUSTDOCFLAGS='-D warnings' cargo doc --workspace --all-features --no-deps clean; scripts/api-docs renders. * 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. |
||
|
|
996b662204 |
Re-bless the golden tables and the engine inventory at the native-maths tip
One work packet, landed as 2 commits (930b3b5dbf..79c82de838 on archive/development-linear-2026-10-28), in order: * Re-bless the golden tables and the engine inventory at the native-maths tip The native-arithmetic series that landed on 10-28 (half reads and narrowing, the pulled 1010102 decode, BC and sRGB device decode, YCbCr, runtime values, fast-math order and half chains, maths instructions, sampler details) moved 812 golden cells on the committed profiles, each under a bumped SEMANTICS_VERSION; the bless refused none. The engine inventory loses the 28 rows of the fixtures the fast-math change deleted (fmx2_contract_*, regroup_chain, sum_regroup, sum_regroup_precise, unm_contract_chain); no other row and no status changed. Verified: nextest of public_fixtures_engine, air_input and golden_hashes, 28 passed. * Re-bless the authored compile census at the native-maths tip 47 cells differ from the last bless, none a regression: 24 compile that were refused (the sampler, YCbCr and pixel-coverage changes reach them), 20 are refused for another stated reason (PixelCoverageAtSampleRate's refusal now names the device's missing raster sample count or lavapipe's pixel-coverage defect), and 3 belong to the authored cases the fast-math change deleted. 22,879 artifacts moved under the bumped versions. Verified: corpus-triage --audit authored-compile (with --private-corpus at the main checkout's corpus) reports 0 failed cells and 0 regressions before the bless. |
||
|
|
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. |
||
|
|
12cd1535a8 |
Keep the device's copy for blits through a texture Metal compresses
One work packet, landed as 9 commits (62c7d7a9f5..378d636d2f on archive/development-linear-2026-10-28), in order:
* Keep the device's copy for blits through a texture Metal compresses
Metal's GPU blit into or out of a texture it keeps losslessly compressed
writes three families' texels in its compressor's canonical encoding:
BGRA10_XR (and its sRGB twin) with each field's low six bits cleared and
the alpha code clamped, RG11B10Float with a NaN made the quiet NaN, and
RGB9E5Float with the shared exponent lowered. The runtime reproduced that
with a crate-owned compute rewrite of the copied rows (bind::CompressedBlit
and its module) after every such blit.
That is Metal's compressor's encoding, not the format's: Metal's own
uncompressed texture of the format keeps the bytes through the same blit,
and every rewritten texel reads the same value either way. The device's
copy, which keeps the bytes, is now the only form. A blit through such a
texture announces the note of the encoding it keeps, once per device:
extended-range-bits-kept (BGRA10_XR), device-nan-encoding (RG11B10Float)
and shared-exponent-kept (RGB9E5Float), each existing kinds; no new kind.
Where the device's own copy already writes Metal's encoding (MoltenVK,
RuntimeDriverDefect::CompressedImageCopiesRewriteTexels) nothing is
announced; the defect's PixelFormatView usage, which keeps CPU copies
byte-exact there, stays.
Removed public items: bind::CompressedBlit, bind::CompressedBlitModule,
bind::compressed_blit_module, WorkCounts::compressed_rows_rewritten.
RUNTIME_VERSION 1740. The conformance recordings' runtime cost records
that count compressed_rows_rewritten (compressed-blits-*, fresh-pattern-*,
xr-clear-routes-*, xr-draw-*) move at the next re-bless.
The compressed-blits lane now asserts the bytes are kept and each format's
note is announced; the conformance case declares the note where it is not
one of the suite's native notes.
Verified: cargo clippy --workspace --all-targets --all-features -D warnings;
RUSTFLAGS='--cfg m2v_gpu' cargo check of runtime and validation; nextest
of blit_plan, degradation, degradation_catalogue, conformance
compressed_blits, unused_bits, fast_paths, owned_divisions, api_surface,
api_signatures and refusal_surface (77 passed). Device lanes and replay
run after the whole series.
* Resolve a fetching pass's sample planes by the device's average
A color attachment whose sample planes held its samples as the pass ended
(framebuffer fetch in the pixel interlock on a device without multisampled
storage images: ANV, MoltenVK) was resolved from the planes by the
crate-owned resolve, which computes Metal's closed rules for every unorm,
snorm, sRGB, 32-bit float, half, packed 16-bit, RG11B10Float and
RGB9E5Float format. Every other color attachment resolves by the device's
AVERAGE. The average is the device's native answer, so it is now the only
form here too: the planes merge back and one more instance of no draws
resolves the attachment, announced device-rounded-resolve where the
driver's average is not measured to be Metal's (on MoltenVK it is,
DriverFact::ColorResolveAverageIsMetals, so nothing is announced there).
The crate-owned resolve keeps the two resolves no device's average writes:
into the attachment's format's sRGB twin (the 8-bit unorm and sRGB rules)
and of an extended-range attachment. Its rules for every other format, and
their tests, are deleted. ColorResolveFormat::of names the twin's eight
formats; sample planes are read only for an extended-range form, and a
module of a twin format from planes is refused.
Removed public items: ResolveRule::{HalfUnorm, Snorm, Float32, Float16,
SmallFloat, SharedExponent}, ResolveRule::bits, ResolveRule::resolves,
ColorResolveFormat::resolves; ResolveRule::Unorm loses its bits field.
Cost: such a pass now merges its planes back and resolves in one more
render pass instance, where it drew one resolve pass from the planes; a
memoryless attachment the pass only fetches and resolves needs a backing.
The ColorResolveAverageIsMetals docs, the shader-resolve and
device-rounded-resolve entries (degradation.rs, docs/API.md) now say what
resolves where. The fetch lanes expect no shader-resolve for a fetched
attachment.
Verified: cargo check --workspace --all-targets --all-features; the GPU
cfg check of runtime and validation; nextest of color_resolve,
sample_planes, degradation, driver_facts, fast_paths, api_surface,
api_signatures, refusal_surface (84 passed). Device lanes run after the
series.
* Clear a float attachment to the clear color as the device converts it
A render pass's Clear of a normalized, sRGB, packed 16-bit, half, float or
small-float color attachment computed Metal's texel on the CPU (its
rounding, its trip through half for the packed 16-bit formats, its
truncated small-float and shared-exponent mantissas) and handed the device
a value that converts back to it; a Depth16Unorm clear took a quarter step
above Metal's truncated code. The conversion is the device's native
answer, so the clear value is now the color (or depth) as a float, which
the device converts.
Where the device's conversion can stand a code from Metal's it is
announced, once per device: device-color-conversion where a normalized
channel's scaled value lies within 1/1024 of a midpoint between two codes
(a packed 16-bit channel's within Metal's half step too), an sRGB channel
lies inside (0, 1), or a half, small float or shared exponent does not
hold the value exactly; unorm-depth-rounding where a Depth16Unorm depth's
scaled value lies at or above a midpoint, which Metal truncates and a
device rounding to nearest takes up. Vulkan asks for rounding to nearest
and leaves ties, sRGB encodes and float rounding to the device. A NaN in a
normalized or RGB9E5Float channel still clears as 0 (Vulkan states no such
conversion); integer, extended-range, word and YCbCr attachments keep
Metal's conversion, which no device makes for them.
Metal's measured conversion moves into the tests as the model they compare
with. The renders lane accepts a device texel a code from Metal's where
the note is announced and prints it; the cleared sRGB resolve lane
compares the resolve with the device's own 1x clear.
UnormDepthRounding's docs and cost, PrecisionNote::DeviceColorConversion's
docs and both docs/API.md entries say so.
Verified: cargo clippy --workspace --all-targets --all-features -D
warnings; the GPU cfg check of validation; nextest of clear_value,
heap_tiled, fresh, nan_clear and degradation (55 passed). Device lanes and
replay run after the series.
* Expect the device's clear conversion in the lanes that clear at a tie
Since 5925c303f8 a clear converts the clear color (and a 16-bit depth)
the device's way, announcing device-color-conversion where a channel
lies at a rounding question (0.5 on an 8-bit unorm channel is 127.5
codes, a tie; any sRGB channel's encode) and unorm-depth-rounding where
a Depth16Unorm clear's fraction reaches the midpoint (Metal truncates).
Lanes that hold exact notice sets or Metal's truncated depth codes now
expect them:
- dont_care_stores: every pass clears through color_pass or earlier()
at 0.5; clear_tie() adds the note to each expected set (MoltenVK's
pipelines record no color-conversion note, so it showed there first).
- resolves: the depth stand-in clears Depth16Unorm to 0.5 (32767.5
codes): Metal's 0x7fff or the device's 0x8000, and the note announced
exactly for that format.
- buffer_depth_samples: the 16-bit clear to 0.25 (16383.75 codes)
announces unorm-depth-rounding.
- buffer_texture_blits: the planar depth clears (0.375, 0.625, 0.875)
hold Metal's truncated code or the one above it, the note's bound.
Verified: the four lanes' failing tests on lavapipe (linux-gate
halfnative) failed before these edits; on MoltenVK (Apple M3 Max,
maclock) dont_care_stores, resolves' depth stand-in,
buffer_depth_samples and the planar depth lane pass with them.
* Merge a fetched attachment's sample planes back before its twin resolve
A pass whose last draws fetch a multisampled attachment through sample
planes (the pixel interlock without multisampled storage images: ANV,
MoltenVK) left the planes unmerged after it under MultisampleResolve
wherever the crate-owned resolve drew the attachment's resolve, on the
reading that that resolve reads the planes. A resolve into the
attachment's sRGB twin is crate-owned but reads the attachment itself
(color_resolve.rs filters its planes out), so it resolved samples the
pass never wrote: on MoltenVK a 4x RGBA8Unorm attachment cleared to 0,
fetched once and resolved into RGBA8Unorm_sRGB read all zeros, where
the same pass stored too resolves (255, 225, 0, 0).
The planes steps now skip the merge only for a resolve that reads the
planes, an extended-range attachment's (the flag is renamed
planes_resolve to say so); a twin resolve merges first, as a stored
attachment does.
Test: runtime_lane::framebuffer_fetch::planes::
a_twin_resolve_of_a_fetched_attachment_reads_its_samples holds the
MultisampleResolve answer to the StoreAndMultisampleResolve one.
Verified on MoltenVK (Apple M3 Max, maclock): the test failed without
the fix (zeros) and passes with it, beside the planes, memoryless,
kept_resolves and twin-resolve lanes (18 passed); the runtime's
sample_planes unit tests pass.
* Expect the clear note in color_reformat's passes, through one helper
color_reformat's passes clear to (0.5, 0.25, 0.75, 1.0), whose red is a
tie in an 8-bit unorm channel, so the device's conversion of the clear
announces device-color-conversion at the device's first such pass.
Lavapipe's pipelines record the note already; MoltenVK's record none
(VkProperty::MetalColorWrites), so its exact notice sets failed there.
degrade_notices::tie_cleared() names that note for every lane whose
passes clear at a tie; dont_care_stores' local helper moves there.
Verified on MoltenVK (Apple M3 Max, maclock): color_reformat and
dont_care_stores pass (they failed in the full runtime_lane run before
this change).
* Hold the kept compressed-blit encodings to the ledger, and declare their notes
Since 01f733c6f0 a blit through a texture Metal keeps losslessly
compressed is the device's copy, which keeps the bytes Metal's
compression rewrites into the canonical encoding. The lavapipe replay
then read 46 rows the ledger did not expect:
- 28 value sites of compressed-blits-{bgra10xr,bgra10xr-srgb,rg11b10f,
rgb9e5f}: the device's bytes against Metal's canonical encoding. Each
is now a known-gaps.tsv row (venue llvmpipe) naming the note that
records it: extended-range-bits-kept, device-nan-encoding,
shared-exponent-kept, whose bound (the same value, another encoding)
covers it. Nothing is open: rule 1 rules out writing Metal's encoding.
- 18 notice sites of fresh-pattern-{552,553,93}, xr-draw-bgra10xr*
and xr-clear-routes-bgra10xr*: their read-backs blit out of such a
texture and announce the note, every value exact. They now declare
it through compressed_blits::kept_encoding_notice, the one table of
which format announces which note (device-nan-encoding is native and
declared for every case already). fresh_contents' row-notice test
counts the three pattern rows' second allowance.
docs/CONFORMANCE-COVERAGE.md regenerated (the ledger's row count).
Verified: conformance replay --cpu on lavapipe (linux-gate halfnative,
arm64): exit 0, 751 rows, exactly the ledger's (723 before the series
plus these 28), 0 unlisted and 0 stale; cargo nextest -p
metal2vulkan-conformance (1005 passed); clippy -D warnings.
* Format owned_divisions' bind import after the rebase
The rebase onto development dropped both CompressedBlit (this series)
and BlockDecode (development's BC twin removal) from the import, which
rustfmt now joins onto one line. No behaviour changes.
Verified: cargo fmt --all --check.
* 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. |
||
|
|
04f6fb57b8 |
Read a half by UnpackHalf2x16 and narrow one by the bare quantize without float16
One work packet, landed as 4 commits (91d9e38f75..80ca8d6abd on archive/development-linear-2026-10-28), in order:
* Read a half by UnpackHalf2x16 and narrow one by the bare quantize without float16
On a device with 16-bit storage but no shaderFloat16 (QuantizeForm::Device: Pascal, the
lunarg-2023 baseline, vk12-floor, SwiftShader), the GPU's native arithmetic is the contract
(AGENTS.md rule 1), so neither the read nor the narrowing of a `half` emulates Metal's bits any
more:
- A `half` read from its bits (a load, a reinterpretation, a texel's or snapshot's bits, a
vertex fetch) is GLSL.std.450 UnpackHalf2x16 of the bits as the low half of a 32-bit word
(component 0), or of both halves for a pair (`narrow::from_bits`, `from_word_halves`). The
exact integer decode (`half_bits_to_f32_bits`) is deleted: UnpackHalf2x16 is core and needs no
capability, so no device lacks a native form. The module records NativeNanEncoding (a NaN's
bits) and NativeHalfConversion (the widening is neither under DenormPreserve 16 nor measured,
so a denormal may flush), by the rules 860ad1489f set for the float16 widening;
`narrow::widens_bits` counts the unpack.
- Every narrowing to `half` through `narrow::round` (fptrunc, every `half` operation, function,
sum, multiply-add, mix step, division, square root, dot, simd and matrix reductions, stage I/O,
color and fetch narrowing, texel rounding through `round_texel`) is the bare OpQuantizeToF16,
recorded NativeHalfQuantize on every such device, measured or not. The denormal arm (quantize,
compare, RoundEven of x * 2^24, select) and `device_round`, `scaled` and
`flushes_below_normal` are deleted; `native_rounding(form)` now depends on the form alone, so
`native_half` holds on every Device-form module. `round_integer` stays exact: it is the
workaround for NVIDIA 615.71.09 keeping an integer conversion unrounded under the quantize.
- No module requires VkProperty::MetalHalfQuantize any more (compile.rs drops the requirement);
DriverDeviation::MetalHalfQuantize and the property are kept and documented as measuring only.
Devices with shaderFloat16 are unchanged.
Integer roundings to `half` that never took `narrow::round` are unchanged: the extended-range
blend's `half_of` (every form but the controlled one), the extended-range color encodes, the
sampler's level and the bicubic routines (Metal's directed roundings among them), and the texture
routine's grid families, which round an integer code's ratio.
Docs: PrecisionNote's NativeHalfConversion, NativeHalfQuantize and NativeNanEncoding, the
runtime's declarations of the three, docs/API.md section 9 and docs/HOWTO.md state the new reach;
`fetch.rs`'s `half()` no longer says "exactly". SEMANTICS_VERSION 1886 -> 1887. The runtime
sources change in doc comments only, so RUNTIME_VERSION stays; the runtime-sources pin moves.
Tests (the arith interpreter harness now builds in QuantizeForm::Controlled unless a body sets a
form, so routine references stay Metal's; a half NaN through the device's widening is accepted as
a NaN, the interpreter's widening being canonical):
- `narrow::device_half_rounding_is_the_quantize_alone`, `engine_native_half::
a_half_below_the_smallest_normal_takes_the_devices_quantize` and `engine_arith::
a_half_rounding_without_float16_is_the_quantize_alone`: no RoundEven or compare after the
quantize, NativeHalfQuantize on every Device profile, sums and narrowings below 2^-14 answer
the signed zero on the interpreter. Negative control (the denormal arm restored in `round`):
all three fail, and `half_rounding_follows_the_operation`.
- `narrow::a_half_decode_is_the_devices_widening_in_every_form` and `engine_native_half::
a_half_read_from_memory_is_the_devices_widening_on_every_profile` and the loop decode test: one
UnpackHalf2x16 per word, no 16-bit type, no integer decode, NaN and conversion notes. Negative
control (the integer decode restored in `from_bits` and `from_word_halves`): all three fail.
- The texel tests accept the quantize's signed zero for a half denormal in the Device form; the
16-bit grid comparison runs the Device form under native rounding only (its one production
setting); the wide tests validate on vk12-floor in its own form.
Verified on this Mac (no GPU): cargo nextest -p metal2vulkan -p metal2vulkan-runtime
-p metal2vulkan-air -p metal2vulkan-devtools --all-features: 5014 run, 5013 passed, the one
failure golden_hashes_match_the_table (hashes moved; not re-blessed here). cargo clippy
--workspace --all-targets --all-features -D warnings, plain and with --cfg m2v_gpu; cargo doc
-D warnings for metal2vulkan and metal2vulkan-runtime. Every fixture below translated with
spirv-val (vulkan1.2, vulkan1.4) passing.
Words (instructions), the CLI on the public engine fixtures, before -> after:
hfb_filter_bank (fragment) Pascal 198141 -> 147460 (38283 -> 28981)
lunarg-2023 176378 -> 124545 (34510 -> 24920), same on
swiftshader and vk12-floor
unm_contract_chain Pascal 46258 -> 34491 (9333 -> 6952)
lunarg-2023 48303 -> 36536 (9699 -> 7318)
swiftshader, vk12-floor 48364 -> 36597 (9928 -> 7547)
fmx2_contract_fast Pascal 24177 -> 18912; lunarg-2023 25107 -> 19842
a1_half_denormals Pascal 4230 -> 3071; lunarg-2023 4353 -> 3194
hwd_half_reads Pascal 2647 -> 2194; lunarg-2023 2688 -> 2235
dsm_half_live_built Pascal 6782 -> 5988; lunarg-2023 6799 -> 6005
sum_regroup unchanged (Pascal 1047, the others 879)
* Hold the native half lanes to each rounding's bound, and bound the quantize's flush by its input
On SwiftShader (no shaderFloat16, so every half narrowing is the bare OpQuantizeToF16) two
native_maths lanes broke the note they check:
- half_rounding_answers_within_its_recorded_bound held half(a) + half(b) to one ulp of Metal's
sum, but the note bounds each rounding: SwiftShader's quantize rounds toward zero, so two
roundings land two ulps off (thread 30: -45.0625 for Metal's -45.125; failing on development
too), and a flushed denormal operand moves the sum by itself. The sum is now held to the bound
of the sum of operands each rounded within it (half_within_sum).
- native_maths_answers_within_its_recorded_bounds held a half fma below 2^-14 to one ulp; where
the stage records NativeHalfQuantize or NativeHalfConversion, the zero of its sign is the
note's bound.
The quantize tests the value it rounds, not the rounded result: SwiftShader answers -0 for
-6.1005354e-5, which Metal rounds to -2^-14. PrecisionNote::NativeHalfQuantize, the runtime's
declaration, docs/API.md (its section 9 entry and the device-answers paragraph, which still said
the widening was the device's only with shaderFloat16) and docs/HOWTO.md now bound a value below
2^-14, not a result, and the lane tests the input.
Verified: scripts/linux-gate --icd swiftshader, runtime_lane::(driver_deviations|half_|
native_maths|sum_regroup|math_routines): 26 run, 22 passed. The four failures fail identically
on development 60fe70fb12 without this branch (sum_regroup 3863 of 4096 pixels, RG11B10 small
floats 2005 of 71505 fields, the slice NaN lane's 17 stored halves, 86 and 484 float NaN words),
so they are SwiftShader's, not this change's; development there fails six, among them
half_loads_the_device_widens_answer_as_metal, which passes here. The same lanes on lavapipe:
26 of 26. clippy -p metal2vulkan-validation --all-targets --all-features --cfg m2v_gpu
-D warnings; the runtime's degradation catalogue tests.
* Number SEMANTICS_VERSION 1889, after development's 1888
The half read and narrowing change (91d9e38f75) bumped SEMANTICS_VERSION, and each rebase onto
development took development's own bump for it (1887 for the MoltenVK vertex fetch, 1888 for the
blend sweep's one compile), so this change shared a number with another. 1889 keys its modules
apart: Device-form modules read a half by UnpackHalf2x16 and narrow one by the bare
OpQuantizeToF16, with their precision notes.
Verified on the rebased tree: the core suites, clippy plain and --cfg m2v_gpu (see the change).
* 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.
|
||
|
|
b8529b6e09 |
Compile a blend sweep's fragment once where the device converts its colors
Eleven runtime device tests failed on lavapipe (Mesa 26.0.8, arm64). Four causes. 1. A blend sweep translated its fragment function twice (render_sibling_work, render_directory_trips, render_stage_digests x2, shader_cache_off_thread). The color-write map (`LoweringInputs::color_writes`) named Metal's 8-bit unorm rule where an attachment stores the output as written (no blend, or factors one and zero) and the device's conversion elsewhere. The fragment's lowering treats the two the same on a device that does not store Metal's codes (lavapipe, ANV, RADV, NVIDIA): both record DeviceColorConversion and emit the same words. But the map is part of the compile key, so the one-and-zero sibling of a sweep whose first state blended compiled again, to a byte-identical module (no new shader module, one more translation, digest, directory question and memo entry). MoltenVK keeps only half-float rules in the map, so it never showed there. Now `color_writes` names each rule as the lowering tells it apart (`lowered`): an unorm, snorm, sRGB or small-float rule whose channel the device converts is `ChannelWrite::Device`, and Metal's rule stays where the lowering reads it (half-float, nearest-even, blended nearest-even, and the measured MetalSmallFloatColorWrites and MetalNorm16ColorWrites rules). Link no longer reads the function's map to decide whether a blend of one and zero takes a Vulkan blend. It reads the pipeline's own rules (`takes_metal_rule`), so that choice is unchanged. SEMANTICS_VERSION goes to 1900 (a placeholder to renumber at landing): a fragment compiled under a hand-built map with such a rule now links as NeedsInput(ColorWrites), a changed refusal under an unchanged key. 2. driver_pipeline_compile assumed whole-pipeline makings. lavapipe links render pipelines from graphics pipeline libraries (fast linking), so a sibling makes only its fragment output's library, which takes no cache, and caches_shared stays 0. The test now takes the library route where the device has one: each sibling links once, makes one library, and makes no library of shaders. 3. Set-0 counts assumed allocated sets (neutral_zeros_shared x2, dynamic_multi_variable). On lavapipe set 0 is pushed: 64 draws record one push and no bind, and the dispatches push their writes. The tests now read the route from the push counters. The four-variable no-push test left 17 written slots unbound, and each of those takes a 64 KiB region of its own per dispatch. On a device that makes every binding dynamic (lavapipe) that stopped any set reuse, whatever the sink did. It now binds all 25 slots, so the sink is the only per-dispatch descriptor. 4. host_import_counts raced the device's in-place check. Its first texture over host pages starts the check (policy InPlace on lavapipe), whose own imports were read apart for a texture while the test read the gauge (1 became 2). The texture tests now settle the check and wait for its imports to go before reading. 5. multisample_buffer_copy required a 2-sample Depth16Unorm texture. lavapipe lists 1, 4 and 8 samples and no 2 anywhere, and supportsTextureSampleCount answers no, so a refusal is the honest answer. The test now requires the shapes of the sample counts the device takes, and fails on a missing texture at such a count. Verified: - metal2vulkan suite on macOS: 3394 of 3397 passed before the test updates. The three that failed held the old map, and they pass now, along with the 90 colour-write and blend tests. - New test a_blend_sweep_of_a_rule_the_device_converts_compiles_under_one_map. Negative controls: with `lowered` as identity it fails, and color_writes_are_the_pipelines fails too. With link reading the lowered map, a_rounded_one_zero_blend_takes_no_vulkan_blend fails. - lavapipe (linux-gate arm64, 4 CPUs): the eleven plus their families, 28 of 28 passed, the route lines printed. The whole runtime crate: 1365 of 1368 passed. The 3 that failed (cpu_copy_layouts, waiter_submits x2) are the grouped-submission stream's, and failed before. - lavapipe, the whole validation crate: 3200 of 3212 passed. All 12 that failed are on the 5a1a62bb0e baseline list and belong to other streams (event_round_trips, grouped_submissions, resolves, sync_coverage, parity hazard). - MoltenVK 1.4.2, M3 Max (maclock, m2v_gpu): the same 28 families, 28 of 28 passed. - clippy -D warnings plain and with --cfg m2v_gpu; rustdoc of metal2vulkan. Originally cb759a4c4a (archive/development-linear-2026-10-28). |
||
|
|
bd1861cf3d |
Keep the samples a resolve after the pass reads on a framebuffer-fetch-by-input device
One work packet, landed as 5 commits (8ec20af606..60fe70fb12 on archive/development-linear-2026-10-28), in order: * Keep the samples a resolve after the pass reads on a framebuffer-fetch-by-input device A multisampled color attachment resolved by the crate-owned resolve after the pass (the sRGB twin, an extended-range format) under `MultisampleResolve` is meant to render through an image its texture keeps, so the texture keeps the samples it held before the pass, as Metal's does (`resolve::keep_samples`). The pass asked it whether a draw took a view of the attachment with the linear rule's `taken`, which on a device whose framebuffer fetch reads input attachments (`PassLayout::fetch_inputs`: rasterizationOrderColorAttachmentAccess, lavapipe's) counts every color of every pass. So on such a device no pass ever kept its samples: the attachment held the resolving pass's clear and draw (lavapipe: `80808080` where Metal keeps `bf4080ff`; BGRA10_XR `c09f...` where Metal keeps its earlier clear). keep_samples now takes `viewed`, the colors a draw actually read (input attachment, pixel interlock, sample planes, another format's view, the extended-range shadow), as `kept_bytes::settle` asks it of the attachment it renders apart. The subpass's input references name the framebuffer's attachments, which take the kept image's view, and a stand-in takes input attachment usage on such a device (`attachment_stand_in.rs`), so nothing a draw recorded refers to the attachment's own image. The linear rule keeps `taken`. RUNTIME_VERSION 1700 (to be renumbered at landing). Verified: runtime_lane::resolves::samples_a_twin_resolve_reads_are_kept_as_metal_keeps_them and ::samples_an_extended_range_resolve_reads_are_kept_as_metal_keeps_them failed on arm64 lavapipe at 742b94ac06 (diagnostic print: every pass's color counted taken, `fetch_inputs` true, including a pass with no draw) and pass with this change; both pass on MoltenVK (M3 Max), where `fetch_inputs` is false and nothing changes. * Wait on the GPU for the signal a checked head's shared-event wait is held for Since |
||
|
|
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. |
||
|
|
73b6a7a134 |
Wait for a plain event in the grouped-submission event scenarios
One work packet, landed as 4 commits (9671b1adc4..377f9da0fd on archive/development-linear-2026-10-28), in order:
* Wait for a plain event in the grouped-submission event scenarios
Three `runtime_lane::grouped_submissions` tests failed on the gate's lavapipe (Mesa 26.0.8)
once it took the release-free `DriverFact::SubmissionsWithoutSignalsMerge` row
(a1f70a4962): `a_command_buffer_that_waits_leads_its_group`,
`a_wait_on_the_same_queue_for_a_held_signal_goes_after_its_group` and
`a_wait_on_another_queue_for_a_held_signal_goes_after_its_group`. Before that, llvmpipe at
26.0.8 did not group, so their merging branch was never run on the gate.
Cause: the scenarios' event `E` was a shared event. Since the scheduler holds a shared
event's wait until its value is reached and never hands it to Vulkan (`event_timeline.rs`,
|
||
|
|
3501e41448 |
Expect the served blit out of a plane whose GPU rows share bytes
One work packet, landed as 8 commits (8f359821ba..742b94ac06 on archive/development-linear-2026-10-28), in order: * Expect the served blit out of a plane whose GPU rows share bytes |
||
|
|
a3c550ca33 |
Read a half from memory by the device's widening, and sum one by its quantize
One work packet, landed as 3 commits (860ad1489f..46ec3ad81f on archive/development-linear-2026-10-28), in order: * Read a half from memory by the device's widening, and sum one by its quantize The owner's ruling on native half arithmetic, applied to the reads and sums that still emulated Metal's bits. A half read from memory or from its bits is the device's widening wherever the module holds 16-bit floats (every QuantizeForm but Device, i.e. every profile with shaderFloat16): the bits read as f16 (an OpBitcast of the word or words, a 16-bit storage unit read as a half itself) and one OpFConvert, with no use analysis. The module records NativeNanEncoding (the widening's NaN bits are the device's; a half stored unchanged keeps its bits through the noted bits). Its denormals are kept under the 16-bit float controls (ANV, RADV: DenormPreserve), read as Metal's by the measured MetalHalfArithmetic on MoltenVK (the module then requires the property), and elsewhere (NVIDIA, lavapipe) may flush, recorded as NativeHalfConversion. Without shaderFloat16 the integer decode stays: no 16-bit float type exists to read the bits as. The use analysis (lower/arith/widening.rs), ModuleBuilder::set_widens_halves, the loop-free offers it fed and the UnpackHalf2x16 decode are deleted. A half sum or difference (and the mix, muladd, fract and sqrt results that round the same way) takes the device's rounding alone (narrow::device_round): on a device without shaderFloat16 the bare OpQuantizeToF16, whose result below the smallest normal half may be a zero, noted NativeHalfQuantize whether or not the quantize is measured (narrow::flushes_below_normal). round_exact_below_normal is deleted. An integer's half stays exact (round_integer), documented as the workaround for NVIDIA 615.71.09 keeping an integer conversion unrounded under OpQuantizeToF16. SEMANTICS_VERSION 1883 -> 1884. The runtime-sources pin moves for doc comments only (device/driver_facts.rs, device/requirements.rs), so RUNTIME_VERSION stays. The golden hash table moves (2704 cells) and is re-blessed on development, not here. API signatures and REFUSALS.md are unchanged. Words (instructions) of the release command line's output, before -> after: hfb_filter_bank NVIDIA 5080 159876 -> 147962 (31488 -> 29438), lavapipe 160444 -> 148530, MoltenVK 153283 -> 148284, ANV 164906 -> 159903; unm_contract_chain NVIDIA 34516 -> 33048 (6985 -> 6769), MoltenVK 35366 -> 33666; fmx2_contract_fast NVIDIA 18983 -> 18272; sum_regroup pascal 3356 -> 3286, vk12-floor 2506 -> 2436. Every module passes spirv-val. Verified: the core suites (metal2vulkan, -air, -runtime, -devtools): 5056 of 5057 pass, golden_hashes_match_the_table the one failure (moved hashes, as above); a touched-test pass of 318 in metal2vulkan and the validation crate, the runtime pin included; clippy -D warnings with all features, plain and with --cfg m2v_gpu. New tests fail without the change (checked for the 16-bit unit read by disabling its note). Device lanes on lavapipe follow. * 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 the half reads' native widening 860ad1489f reads a half by the device's widening on every shaderFloat16 profile and sums one by the bare quantize elsewhere, so 288 rows' cells moved. bless_engine_inventory, bless_golden_hashes and bless_engine_goldens at 9ac9892868; public_fixtures_engine, air_input and golden_hashes: 28 passed. |
||
|
|
ce0ffcb27a |
Ledger the llvmpipe mipmap chain's one-code bytes under device-filtered-mipmaps
blit-generated-mipmaps now takes the device's blit chain on llvmpipe and announces device-filtered-mipmaps (a native note); two bytes of its levels are one code from Metal's. The note states no bound against Metal's answer, so the row says the open item is that bound. CONFORMANCE-COVERAGE.md regenerated. Verified: conformance replay --cpu on lavapipe (linux-gate arm64, LLVM 21.1.8) at 1af72fc0d8 plus this row: the 723 rows are exactly the open gaps known-gaps.tsv expects (exit 0); before the row, the one unlisted divergence was this site. coverage.py --check: as derived. Originally f3ff805eb4 (archive/development-linear-2026-10-28). |
||
|
|
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. |
||
|
|
041cdad847 |
Declare the device's native answers at the notices site for every case
One work packet, landed as 7 commits (8c74f645e2..5a1a62bb0e on archive/development-linear-2026-10-28), in order: * Declare the device's native answers at the notices site for every case Under the owner's native-arithmetic ruling the device's own answer is the contract wherever it has a native form, and the note that says so fires in almost every case that computes, converts or samples: on llvmpipe 270 cases differed only by announcing such notes (2,123 unlisted gaps in all, against 62 before the exact paths' deletion). The suite now holds a fixed set of those notes declared for every case (replay::NATIVE_NOTES), chosen from the PrecisionNote and Degradation docs: the native maths, half and sampling classes, the device's denormals, NaN bits, functions and precision bounds, tiny-product rounding, depth conversion and depth test, texel and colour conversions, sampling level and filters, and the device's resolve. compare_run holds them beside a case's own allowances under the same rules (the notices site alone, justified only where the code was announced), and they never count among a case's named or unfired allowances. They declare nothing about a value: every value still compares field by field, and the README says a value the device's answer moves is a known-gaps row where the note derives no tolerance. Notes of what the device lacks, of an emulation's own precision, or of a Metal form not measured or not built stay each case's. Also: Policy::Exact and the replay docs now say what DevicePolicy::exact_answers() selects (the five runtime switches) and that no switch touches arithmetic. Tests: a native note is declared for every case and counted nowhere; it declares no value and excuses no other notice; every native-* kind is in the set, each once, each a precision kind. The first two fail with the set emptied (checked by chaining an empty iterator). The undeclared-notice test moves off two kinds that are now native. Verified: cargo nextest run -p metal2vulkan-conformance --all-features (1006 passed); on lavapipe in linux-gate (arm64) the replay's unlisted gaps fall from 2,123 to 584. * Drop the shader-color-conversion declarations that can no longer fire Since color writes were left to the device's own conversion, the runtime announces shader-color-conversion only for a half-float attachment of a pipeline under TextureWriteRoundingMode::NearestEven (StageModule's rounded_colors), whatever the device. No case of the suite sets that rounding mode, so the 18 case files that declared the notice for normalized attachments declared something no venue can announce: the lavapipe replay reported 81 such declarations as never fired. The normalized store is now the device's colour conversion, a native note the suite declares for every case. The declarations, the comments that explained them, the one helper only they used (blend_interactions' converts_in_the_shader) and the tests' allowance counts go; rotated_targets also drops its per-state choice, since blended and unblended states both store through the device's conversion. Verified: cargo nextest run -p metal2vulkan-conformance --all-features (1006 passed) and clippy on the crate clean. * Declare three cases' own notices; keep unannounced native declarations out of loosening reports read-write-tier-descriptors now names carried-decoded-twin and decoded-block-twin, read-write-tier-held names unnamed-texture-unviewable beside the shared-memory notice, and texture-pairs-usage-crossings' usage row names decoded-texel-precision. Each fired on llvmpipe (LLVM 21.1.8) at the notices site and nowhere else; they are not the device's arithmetic, so they stay per case. The walk tried every covering allowance and, where none held, reported the first unjustified one as "the case loosens this site". With the native-note declarations covering case/notices/* for every case, a case that named nothing read as loosening its notices site with native-transcendentals. Only the case's own allowances can be such a loosening now; a native declaration the run did not announce is as if absent. Verified: cargo nextest run -p metal2vulkan-conformance --all-features, 1007 passed; the new test an_unannounced_native_note_is_no_unjustified_loosening fails with the guard removed. The arm64 lavapipe replay (linux-gate) before the guard and after the declarations shows no notice-site row left: 576 unlisted, 573 divergent values and 3 refusals, all in value sites. * Hold the device's vertex conversion among the suite's native notes device-vertex-conversion, which landed on development, is the device's fixed-function conversion of a normalized vertex attribute's codes: a conversion the device answers natively, as the texel and colour conversions are. The suite now declares it at the notices site for every case with the rest of the set. Verified: the native-note tests of the conformance crate pass (the set test holds every member a precision kind, once). * Bring the llvmpipe known-gaps rows to the device's native answers With the native notes declared for every case, the arm64 lavapipe replay left 576 unlisted sites (573 divergent values, 3 refusals) and 14 rows that looked fixed. Each is now a row that says what differs, which note records the device's answer, whether that note's recorded bound covers the site, and what is open; the header gains a paragraph on such rows, the one kind that is not a bug of ours in itself under the owner's rule 1. - 13 rows take their new answers: half-texel-nans r16f/rg16f/rgba16f at three sites each (472/940/1874 elements, bound 511), the RGB9E5 rows of vertex-format-float4 and -half4 (32, 65407), and blend-interaction-format-srgb8 one-one-add (55) and one-one-reverse-subtract (90). - sampler-mip-linear's clamp-float-max row is dropped: the site is exact now. - 19 rows scoped to the CI venue (LLVM 23.1.1) whose answer the arm64 venue matches exactly are widened to every llvmpipe; blend srgb8 one-one-subtract, which differs (78 on CI, 81 here), gets a row scoped to the arm64 venue. - 543 new rows, venue llvmpipe, in families: texel and storage NaN encodings, half and vertex conversions, 8-bit one-ulp texel conversions, colour conversions at ties, the device's linear filter, 3D and border addressing (open: unmeasured against the note), digests (open: an element read), and read-write-tier-held's three refusals of a held read-write texture (open: runtime and translator work). - Rows asking for an exact fix the ruling rules out are reworded: the fast-math blend families (half-output-blends, argb8-targets, blend srgb8, blend-sweep-operations), half-texel-nans, and the nine 8-bit normalized vertex rows, which device-vertex-conversion now records within its stated bound. The RGB9E5 rows keep their fix: a missing component's default and a vertex format the device need not offer are capability, not arithmetic. Verified: scripts/linux-gate --platform arm64 replay --cpu on lavapipe (llvmpipe LLVM 21.1.8, 128 bits) exits 0: 0 unlisted, 0 looking fixed; verdicts announced 419, divergent 130, exact 522, lacks-feature 36, never-returned 4, refused 11. The ledger tests of the conformance crate pass. The CI venue's (amd64, LLVM 23.1.1) answers for the new llvmpipe rows are not verified here. * Regenerate CONFORMANCE-COVERAGE.md for the llvmpipe ledger rows The coverage document lists the known-gaps ledger's rows, which the previous commit brought to the device's native answers (298 ledger rows before, 841 now). Verified: python3 -I scripts/conformance-coverage/coverage.py --check passes, and so does the conformance crate's conformance_coverage test. * Say that sampler-border-colours' rows sample a 3D texture The case samples an RGBA 3D texture (sampler_filtering.rs, Family::Border), and device-sampling's probe measured 2D textures only; the six rows now say so. Text only, the waiting-on field, which the replay does not match. Verified: the ledger and coverage tests of the conformance crate pass, and coverage.py --check reads the regenerated document as derived. |
||
|
|
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.
|
||
|
|
8e4efb3bd2 |
Note a float write's half and small-float NaN under the bound format
A kernel's float write to a storage texture slot that its variant states no storage choice for recorded nothing of the device's half or small-float conversion. may_store_half and small_float_storage read "no choice" as "cannot store half", but slot::storage_format declares such a slot formatless, and it views whatever the dispatch binds. Since a6e81074ae dropped the half-bits route, the binder names no storage choice for a half-float texture on a device that writes it without a format (needs_variant: Identity, no alias), so the dispatch ran that module: on lavapipe, R16/RG16/RGBA16Float written by hsw_write, hsw_read_write and hsw_buffer stored 0xffc00000 as 0xfe00 (Metal 0x7e00) with no device-nan-encoding announced. The heap form (hsw_held) was noted and passed. The two predicates now answer where the write stores into such a format, as note clauses (stored_where): always for a heap element; always or never for a slot whose choice declares a format; and for a slot declared without a format (no choice, or a formatless choice), under the class of the format bound there (SpecKey::BoundTexelFormat): BicubicTexels::HALF without a packed field for the half floats, the PackedTexels::SmallFloat field for RG11B10Float. half_storage_facts records DeviceColorConversion and DeviceNanEncoding through note_when (select_write takes the meter for it), and still requires MetalHalfStorageWrites / MetalHalfStorageNans where the profile takes them. The runtime's degrade_bound_formats already announces such a clause at each draw or dispatch that binds a matching texture, so a formatless write to RGBA8Unorm or RGBA32Float announces no NaN note. A formatless choice, which recorded both notes unconditionally, now records them under the bound format too. SEMANTICS_VERSION 1884: recorded notes and requirements change. Test: tests::engine_half_storage_notes plans each direct form's dispatch through the binder on every committed profile that compiles it without a format, compiles the variant the plan names (the key the runtime uses) and checks the notes the runtime would announce for the bound format: half floats noted where the profile lacks MetalHalfStorageNans (property required where it takes it), rounding noted or required, RG11B10Float noted, RGBA32Float and RGBA8Unorm not; and the no-choice module's NaN note holds of exactly the half-float and small-float formats over PixelFormat::ALL. Without the fix it fails (hsw_write of R16Float on amd-780m-hawkpoint-radv: no note). Verified: cargo build; cargo clippy --workspace --all-targets --all-features -D warnings, plain and --cfg m2v_gpu; rustdoc of metal2vulkan with -D warnings; cargo nextest over the touched core modules (engine_texture*, engine_extended_range, engine_handles, engine_imageblock, engine_half*, engine_heap*, engine_swizzled_storage, engine_rgbx_storage, engine_cross_class, engine_specialized, engine_binder, engine_fragment, engine_link, fast_paths, public_fixtures_engine, golden_hashes, cache): 420 passed. On lavapipe (linux-gate arm64, llvmpipe LLVM 21.1.8), runtime_lane:: half_storage_writes: both tests pass; every direct-slot form prints "NaN channels store another NaN (DeviceNanEncoding announced)"; before the fix kernel_writes_store_metals_halves failed on those nine cases. Not run: ANV, RADV, NVIDIA or MoltenVK devices; the full gate. Originally 04135f9282 (archive/development-linear-2026-10-28). |
||
|
|
e63aa8245f |
Let half_slice_nans' making announce the notes its kernels' stages record
One work packet, landed as 2 commits (f2a9975472..a527df636f on archive/development-linear-2026-10-28), in order: * Let half_slice_nans' making announce the notes its kernels' stages record Under the native contract a kernel's translation records the device's own answers as precision notes (half-texel-conversion, device-color-conversion, native-half-conversion for this lane's kernels on lavapipe), and the runtime announces them at the making of the pipeline state. The lane failed every device that records any: it required the making to announce nothing. It now requires the making to announce only kinds the kernels' stages record (compiled through the device's compile layer under the empty variant key, as degrade_notices' stage_kinds does), and the dispatch nothing, as before; the stored and read-back halves are judged as before. * Take the device's stored NaN in half_slice_nans where its dispatch announces it Since the half-bits paths' removal (a6e81074ae) a half NaN a kernel writes to a 16-bit float texture is the device's write: lavapipe stores each signalling, payload-carrying or negative NaN as 0x7e00 or 0xfe00, and the dispatch announces device-nan-encoding. The lane required every stored half to be the one written. It now takes a stored half that differs where both are NaNs and the dispatch announced device-nan-encoding alone; any other difference, or any other kind at the dispatch, still fails. Verified on lavapipe (linux-gate, arm64, --cfg m2v_cpu_icd): half_nans_written_through_the_blur_ keep_their_bits passes; all 48 cases store 14 halves as the device's NaN, each announced at the dispatch, and the first making announces only its kernels' recorded notes. clippy -p metal2vulkan-validation --all-targets --all-features under --cfg m2v_gpu: clean. |
||
|
|
0475fbd8b5 |
Put an optnone call in the uniform-branch fixture's arm, so its test tests the rule
One work packet, landed as 2 commits (bb0da087ac..c31ae5c717 on archive/development-linear-2026-10-28), in order: * Put an optnone call in the uniform-branch fixture's arm, so its test tests the rule a_branch_every_invocation_takes_alike_leaves_no_helper_alone passed vacuously: since the exact linear filter's deletion, rch_uniform_branch's arm (a division by the texture's size) held no instruction SPIRV-Cross writes as an optnone call, so there was nothing to guard or note whatever the uniform-condition rule did. The arm now also takes the high word of a product (mulhi, an OpUMulExtended: spvMulExtended), written to the buffer beside the sample, and the test asserts the module holds it. The three assertions that a census entry "sampler.linear" is absent go: nothing emits that key any more. Verified: the test passes; with the uniform-condition rule disabled (helper_branches.rs, the uniform_branch skip) it fails on the note assertion, and passes again restored. nextest of engine_handles, engine_sampler, the helper tests, public_fixtures_engine, air_input and golden_hashes: 65 and 29 passed. * Re-bless the engine tables after rch_uniform_branch's change bless_engine_inventory, bless_golden_hashes and bless_engine_goldens at the fixture's new source; public_fixtures_engine, air_input and golden_hashes pass. |
||
|
|
52857b0ac2 |
Hold the arithmetic lanes to the native notes the stage records
One work packet, landed as 7 commits (c9cffc401a..859ace726a on archive/development-linear-2026-10-28), in order:
* Hold the arithmetic lanes to the native notes the stage records
The exact half and NaN emulations are gone: a stage now records
NativeHalfConversion, NativeHalfQuantize or NativeNanEncoding where the
device's own conversion, rounding or NaN encoding answers, and
exact_answers() no longer changes any translation. The lanes still
expected Metal's bits everywhere.
driver_deviations:
- half_arithmetic_answers_as_metal: every word Metal's where the profile
takes MetalHalfArithmetic or the stage records none of the native half
notes; under NativeNanEncoding alone, every word without a NaN; under a
native rounding the differences are printed. Each recorded note must be
announced.
- half_loads_the_device_widens_answer_as_metal: drops the exact_answers
device. Per thread, a NaN input may answer any NaN, and under the
device conversion a denormal input may answer the zero of its sign;
compares stay exact.
- float denormals, fused pairs and the owned float fixtures: where the
profile does not take MetalCanonicalNans, a NaN word answers any NaN
(the stage must record NativeNanEncoding and announce it); every other
word stays Metal's.
- float_functions: off MetalFloatFunctions the native-transcendentals
notice must be announced.
cross_class_reads: a half read whose stage records NativeHalfConversion
or NativeNanEncoding may answer a NaN half with any NaN half; the NaN
differences are counted and printed.
native_maths and the candidate docs no longer say exact_answers() takes
Metal's arithmetic.
Verified: clippy with --cfg m2v_gpu clean; the changed lanes on lavapipe
(linux-gate, arm64, --cfg m2v_cpu_icd): 33 passed.
* Hold the sampler lanes to the device sampler off MoltenVK
Off MoltenVK a sample is the device's own (PrecisionNote::DeviceSampling,
announced as device-sampling); only a profile that takes MetalSampler
answers Metal's texels. A heap pixel sample without a comparison records
no ArgumentPixelSamplerScaling on any device.
- pixel_samplers: assert device-sampling is announced exactly off
MetalSampler and that no argument-buffer note is; Metal's texels on
MoltenVK, printed differences elsewhere. The argument-buffer test now
uses a comparison kernel (the one shape that records the note) and
checks the notice waits for a linear pixel state on every device.
- pixel_downscales, mip_levels, runtime_levels: the same split; the
FloatSampleFilter and PixelSamplerScaling expectations are gone.
- kept_resolves: resolves into the format's sRGB twin, which the
crate-owned resolve draws on every device, so the lane no longer
returns early where the subpass resolve answers. It asserts the first
pass made one resolve pass.
Verified: clippy with --cfg m2v_gpu clean; the changed lanes on lavapipe
(linux-gate, arm64, --cfg m2v_cpu_icd): 33 passed. The MoltenVK paths
are unrun.
* Hold the notice-set lanes to the notes their own pipelines record
Under the native-arithmetic contract a pipeline made on a device whose
arithmetic is not Metal's records the device's notes (native-fma,
device-denormals, device-texel-conversion, native-half-conversion and their
kin) and the runtime announces them at its creation. Lanes that asserted an
exact notice set read those as strays.
- absent_reads, sample_positions, extended_range_resolve,
fragment_imageblocks, tile_dispatches: the expected set adds the kinds the
lane's own pipelines record (made_compute_kinds, made_render_kinds and the
new degrade_notices::made_tile_kinds over compile_tile_pipeline).
- degrade_notices::runs_announce_the_notes_their_specialization_keeps_once
and made_at_creation: HalfTexelConversion is specialized only on a device
that samples through Metal's sampler; elsewhere it is a plain note. The
first-draw test now draws an RGBA16Float texture, whose half sample keeps
DeviceNanEncoding specialized on every device, and asserts that the first
draw announces only specialized kinds, each once, and the second nothing.
- pipeline_creation: off MetalSampler no key splits the pool, so one
pipeline is made rather than two.
Verified on lavapipe (scripts/linux-gate, --cfg m2v_cpu_icd): each changed
test passes. Not run on MoltenVK or another GPU.
* Judge the texel and sampling lanes by the device's conversion and filter
Off MoltenVK a texel's float is the device's conversion of its codes
(device-texel-conversion: one f32 ulp for 8- and 16-bit codes, 0.18 of a
code for 5- and 6-bit packed channels) and a sample is the device's own
filter (device-sampling). The lanes asserted Metal's bits, which only the
deleted exact conversion and sampler emulations answered there.
- runtime_lane.rs: converted_holds (Metal's bits, or within the note's one
ulp, NaN for NaN, where the device converts) and half_within (one half ulp,
a value past the range finite).
- compressed_decode, pvrtc_textures, etc_textures, chroma_pairs,
texel_swizzles, swizzled_storage: decoded and swizzled reads are held to
converted_holds, and device-texel-conversion must be announced exactly
where the device converts.
- extended_swizzles: off MetalSampler the reference is the device's
unswizzled answer; channels the conversion moves are counted and bounded
by 0.18/31, with the note announced.
- extended_range_two_planes, alpha_in_red: plane-1 and A8 reads accept the
device's conversion, a half read the device's half rounding where its stage
records native-half-conversion; an A8 resolve the one code
device-color-conversion allows, counted.
- pixel_samplers::own_sampler (moved from runtime_levels) asserts
device-sampling exactly where the device samples itself; mirror_clamp,
nearest_positions and view_base_offsets print the device's differences and
stop there (view_base_offsets still asserts no bicubic notice).
- runtime_data: an edge case of a format the device filter is not measured
on is printed, not asserted; the second sampler's "as Metal" count uses
converted_holds.
- ycbcr_textures: reads use converted_holds and the half reads count the
device's rounding where read_half records native-half-conversion. A linear
sample between texels is Metal's step exactly where the texture's planes
are read in place (made_in_place, WorkCounts::ycbcr_textures_in_place); a
texture that keeps its image is sampled by its filter, held within one grid
step (a half within one half ulp) through Metal's sampler and within
DEVICE_FILTER_BOUND elsewhere, counted (Between). assert_filter_notices
holds the run's notices: ycbcr-filter-not-exact once where MetalSampler
sampled a kept image, none elsewhere, no generic filter notice,
device-sampling exactly off MetalSampler. The unmeasured-filter and
exact-filter tests take device-sampling off MetalSampler.
Verified on lavapipe (scripts/linux-gate, --cfg m2v_cpu_icd): every changed
test passes; the between samples of kept images (sRGB twins, packed
formats) differ from Metal's step in 50646 of 51840 and 100633 of 103680
values, at most 0.0156 and 0.0625 codes. The MetalSampler branches are
unverified: not run on MoltenVK.
* Take the device's half rounding, NaN bits and denormals in their lanes
The deleted half rounding, NaN keeps and denormal flush were what answered
Metal's bits in these lanes on a device whose arithmetic is not Metal's.
Each lane now asks the pipeline what it records and holds the device's
answer to that note.
- cross_class_storage: a read's or write's NaN lane may hold the device's
bits (counted). A read leaves them to the device where either stage
records native-half-conversion, native-nan-encoding or
device-nan-encoding; a write, whose note the pipeline specialized to the
bound format records, where the run announced one of them.
- int_attributes: half rows within half_within are the device's rounding
and require native-half-conversion; the label pipeline draws 4099 rather
than 4100 where its pipeline records that note.
- math_routines: frexp and ilogb words hold where a half NaN's bits are the
device's (native-half-conversion or native-nan-encoding).
- sum_regroup: where the pipeline records native-half-conversion the pinned
sum prints its difference in half units (lavapipe drops the rounding)
rather than asserting Metal's bits.
- depth_denormals: a drawn denormal depth is flushed or kept, kept only where
the white pipeline records device-denormals.
Verified on lavapipe (scripts/linux-gate, --cfg m2v_cpu_icd): every changed
test passes; the float-format writes hold 64 NaN texels of the device's bits
under an announced device-nan-encoding, and the pinned sums differ in 3390
and 3334 pixels. Not run on MoltenVK or another GPU.
* Hold the fetch lanes to the device's colour conversion, the census to notes
Color writes are the device's conversion now: every Vulkan driver measured
but MoltenVK rounds the f32 product with ties to even and encodes sRGB its
own way, so near a tie it stores the other code
(device-color-conversion). The fetch lanes asserted Metal's bytes, which
only the deleted shader conversion answered.
- framebuffer_fetch::device_rounded: where the fetching pipeline records
device-color-conversion a texel whose every channel lies within one code
of Metal's holds, counted and printed. bgra and srgb use it; srgb holds a
case of more than one draw without a failing depth test to Metal's
one-draw map over the bytes the device stored one draw earlier, since
each draw reads what the last stored (llvmpipe's two draws land two codes
from Metal's at the dark end otherwise).
- kernel_textures::census: where the runtime is not Metal and the fresh
candidate executor holds no form of the case on this device
(not_supported: its platform path makes every image in the direct
format, and lavapipe makes no R8_SRGB image the runtime holds in its
UNORM twin), the case passes only where the stages the runtime executed
record a precision note and the output has Metal's length; the differing
words and the notes are printed. Where the candidate runs, the runtime is
still held to its words.
Verified on lavapipe (scripts/linux-gate, --cfg m2v_cpu_icd): bgra, srgb and
kernel_textures shards 6 and 11 pass; the two R8_SRGB cases differ in 1610
and 2923 of 12288 words under {SrgbTexelDecode, DeviceSampling,
DeviceTexelConversion} and {DeviceNanEncoding, HalfTexelConversion,
SrgbTexelDecode, DeviceSampling, NativeHalfConversion, NativeNanEncoding}.
Not run on MoltenVK or another GPU.
* State the normalized vertex gap rows under the native contract
The nine llvmpipe rows of vertex-format-float4 and -instance-step proposed
an exact re-normalization after the fixed-function load, which the
native-arithmetic ruling rules out. They now say what is open: the device's
conversion is the answer, but no precision note records the device's
normalized vertex conversion, so the run announces nothing and the one-ulp
difference stands unjustified.
Text only; the rows' sites and details are unchanged. Verified: the replay
on llvmpipe before this change (development 8e4bfa28b4) reports these nine
sites as the ledger states them.
|
||
|
|
504f26bb80 |
Drop the deleted half-float alias write from five comments
One work packet, landed as 2 commits (16adc36586..9dff7633fa on archive/development-linear-2026-10-28), in order: * Drop the deleted half-float alias write from five comments The half-bits write paths are gone: a half texel write to a 16-bit float storage image is the device's, noted as DeviceNanEncoding where unmeasured. Five comments still described the unsigned integer alias that route took: DriverDeviation::MetalHalfTexelWrites, VkProperty::MetalHalfTexelWrites, the fragment snapshot's raw-view rule (whose raw view is now only an 8-bit sRGB slot's), the cross-class write's alias example, and the doc of every_alpha_code_of_a_texture_whose_alpha_reads_one_reads_one. Comments only; cargo fmt 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. |
||
|
|
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). |
||
|
|
7e86900912 |
Leave half-float texel writes to the device: drop the half-bits paths
One work packet, landed as 4 commits (a6e81074ae..77a585c009 on archive/development-linear-2026-10-28), in order: * Leave half-float texel writes to the device: drop the half-bits paths Under the native-arithmetic ruling the device's own write is the answer for a half-float texture's stored NaN, recorded as DeviceNanEncoding (or MetalHalfTexelWrites / MetalHalfStorageNans where measured). Two paths existed only to store Metal's half NaN bits: - the half-texel write route through the texture's unsigned integer alias (StorageImageClass::HalfBits), which a slot that writes a half-float texture took on a device without MetalHalfTexelWrites, with its alias view (metal::format::half_bits_view), its read and write conversions, its imageblock-slice bits leaf, the read note it recorded, and the own-format-views fact a wrapped image without MUTABLE_FORMAT needed to opt out of it (TextureFacts::own_format_views, TextureShape's field, storage_choice_viewed); - the heap twin: StorageFormatClass::HalfBits and its neutral and heap class, the twin's element view, the own-view heap class indices (heap_own_view_index, HALF_BITS_FORMATS, heap_half_bits_indices), the twin write and its class test, RuntimeFact::HeapHalfTexelWrites, bind::heap_write_nans_converted, metal::format::half_write_nans_converted, and the runtime's NanResidue and its draw-time announcement. What a device needs to write such a texture at all is unchanged: a half-float slot is the format's own Identity choice on every profile. The heap write path now records its notes statically: a float write's rounding and NaN as MetalHalfStorageWrites/MetalHalfStorageNans or DeviceColorConversion/DeviceNanEncoding, a half write's NaN as DeviceNanEncoding. Tests follow the behaviour: the format test asserts Identity for every use, the heap texel write test asserts one storage class and the note, the half-slice test asserts the device's widened halves, the half moves and half texel write tests drop the alias case (the latter now checks a declared RGBA16Float on every profile), and the twin-only tests go. Docs the deletion made false are fixed; REFUSALS.md and api_signatures.tsv are regenerated. SEMANTICS_VERSION 1883, ARTIFACT_FORMAT_VERSION 466, RUNTIME_VERSION 1665. Verified so far: cargo check --workspace --all-targets --all-features is clean; conformance-coverage --check and refusal_surface pass. * Drop the half-bits exact form from the llvmpipe half-texel rows The llvmpipe half-texel-nans rows named the read side of the StorageImageClass::HalfBits aliasing as the exact form behind a policy switch; that aliasing is gone under the native-arithmetic ruling, so the sentence describing it is false. The rows' verdicts and the device-nan-encoding sentence stay. Verified: scripts/conformance-coverage/coverage.py --check passes. * Fix the two tests the half-bits deletion left stale device::tests::mechanism numbers every RuntimeFact densely; with HeapHalfTexelWrites gone the last tag moves into its place. merged_argument_buffer_textures_share_one_heap_class bounded the module at 1,600 words (2,300 with word ids) plus the twin's write words where the profile took the twin. Without the twin the bound shows what that allowance covered: on a device that holds an A8Unorm texture's alpha in red (metal::format::alpha_in_red), the heap write's class-index read and conversion, 87 words on RADV RDNA2/RDNA3, ANV ARL/Iris Xe, lavapipe and NVIDIA, 1,591 words elsewhere. The bound now names that allowance. Verified: both tests pass under cargo nextest; clippy -p metal2vulkan --all-targets --all-features -D warnings is 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. |
||
|
|
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. |
||
|
|
f761b5c152 |
Accept the device's half NaN where a module widens halves natively
One work packet, landed as 7 commits (56d9d6332b..3fb626fab0 on archive/development-linear-2026-10-28), in order: * Accept the device's half NaN where a module widens halves natively Two tests still held a half NaN's bits on profiles whose modules now read a half from its bits by the device's widening (QuantizeForm::Converted, which records PrecisionNote::NativeHalfConversion, whose NaN encoding is the device's): - engine_access::every_leaf_path_is_exact_in_bounds_and_contained_out_of_bounds compared load_half_bytes byte for byte on moltenvk-m3; the pattern 0x7f62 came back 0x7e00. It now accepts any NaN for a NaN pattern where the compile records NativeHalfConversion, as narrow_units_are_exact_at_every_ bind_residual already does (same_halves); every other bit pattern stays exact. - engine_cross_class::accesses_through_another_class_are_the_native_words compared a half result's low 16 bits exactly on lavapipe; the word's low half 0xfcc0 came back 0x7e00. Where the cross-class compile records NativeHalfConversion (both profiles of the test), a NaN pattern need only come back a NaN. The product is unchanged; the reinterpret doc comment in lower/texture/emit.rs no longer claims a NaN's payload survives the cross read's widening. Verified: cargo nextest -p metal2vulkan --all-features over tests::engine_access and tests::engine_cross_class: 31 passed. * Expect the device's NaN notes in the float-call-notes tests The NaN and min/max deletion leaves every NaN Metal answers to the device, noted NativeNanEncoding where the profile is not measured to answer Metal's (NanEncoding::Native). Two tests still held the deleted policy's answer: - a_float_division_is_the_devices_arithmetic_unless_it_is_metals_precise_one asserted that no operator leaves its NaN to the device. It now expects NativeNanEncoding on a NanEncoding::Native profile for Metal's precise division, for the fast float division outside Metal's own fast-math entry, and for the operators Metal answers a canonical NaN for (float and half + - *, the float remainder), and on no other operator; still never DeviceNanEncoding. - exported_float_notes_are_the_ones_a_compile_records set aside only a half kernel's rounding note. Under the float controls (QuantizeForm::Controlled, both RADV classes) a half module that widens a half from its bits by the device records NativeNanEncoding for that widening (compile_kept), which no exported operation note carries: 124 half kernels a class failed so (fast_fabs, fast_sqrt, fmin, frem and the rest). The test now adds that note to the operation's where narrow::widens_bits finds the widening in the kernel's module, so the comparison stays exact. Product unchanged. Verified: cargo nextest -p metal2vulkan --all-features over tests::engine_float_call_notes: 4 passed. * Count one module, two translations, for a narrow-float sweep read as float The NaN deletion replaced the canonical NaN a 32-bit float read of a narrow-float vertex format selected after the device's widening with the note PrecisionNote::DeviceNanEncoding. VertexFetch::FixedFunction's narrow_float bit still keys the projection, since it decides that note, but it no longer changes an instruction, so the sweeps compile one module where they compiled two: - a_float_read_compiles_two_modules_for_the_whole_sweep, now a_float_read_compiles_one_module_for_the_whole_sweep: 2 projections, 1 module (was 2, 2). - a_constant_step_binding_compiles_two_modules_for_the_whole_sweep, now a_constant_step_binding_compiles_one_module_for_the_whole_sweep: (2, 1, 1, 1) where every format is fetched, (3, 2, 2, 2) with FloatRGB9E5 pulled on the Intel profiles (were (2, 2, 1, 1) and (3, 3, 2, 2)). - narrow_float_changes_no_instruction_of_a_half_read, now narrow_float_changes_no_instruction_but_a_float_reads_note: its float4 control asserted that the bit changes the words. It now asserts that the words are the same for both entries, that a half read's notes are the same, and that only a float read with the bit records DeviceNanEncoding, so the projection still keys what the artifact records. The module docs say so. Product unchanged: the second translation is what the per-pipeline note costs. Verified: cargo nextest -p metal2vulkan --all-features over tests::engine_vertex_variants: 8 passed. * Judge the rate-map decoder by the device's denormals, not Metal's flush The float-maths deletion leaves every float + - * and comparison's denormals to the device: Metal's where the profile takes MetalFloatDenormals (MoltenVK), the device's own elsewhere, noted DeviceDenormals. engine_rate_map::the_decoder_answers_as_the_map still ran the module of a profile stripped of that deviation, expecting it to flush denormals itself, and compared the CPU interpreter (which keeps denormals) with Metal's flushing shader decoder: identity layer 2 at (0, 0) answered -3.57e-43 where Metal answers 0. It also asserted that no profile records DeviceDenormals, which every profile but MoltenVK now records. The test now: - asserts no RasterizationRateMap note, DeviceDenormals exactly where denormal::device_flushes is false, and NativeNanEncoding exactly where the profile's NaN encoding is Native; - runs each profile's own module and compares the interpreter, bit for bit (a NaN any NaN), with kept(): rate_map_data's shader decoder with IEEE f32 arithmetic, no operand or result flushed; - checks that this equals Metal's shader decoder at every point of a map's own layers, differing only at layers past the map (their tables are other words read as floats, some denormal), and that both kinds of point occur. The profile helper loses its own_denormals arm. The decoder's docs in canon/rate_map.rs, canon/rate_map_data.rs and bind/rate_map.rs no longer say the module flushes denormals itself: the decoder answers Metal's on a device that reads denormals as Metal does, the device's elsewhere. No code changes. Verified: cargo nextest -p metal2vulkan --all-features over tests::engine_rate_map: 3 passed. * Give the helper-branch fixtures an optnone call the native half leaves The half rounding deletion removed the NoContraction barrier on the device's conversion pair, which SPIRV-Cross wrote as its optnone spvFAdd. That barrier was the only optnone call in the arms of the owned fixtures rch_helper_branch and rch_helper_tangle on moltenvk-m3 (QuantizeForm:: Converted), so the guard of spirv::helper_branches had nothing left to guard there: - helper_invocations_skip_an_optnone_branch_on_a_driver_that_drops_a_ simdgroups_stores: rch_helper_branch had 0 guards where 1 is expected; - a_tangled_instruction_reading_a_helper_call_keeps_the_note_away: rch_tangle_sample_before and rch_tangle_unread recorded no HelperBranchDropsSimdgroupStores (only quad_before kept one, from a kept addition). The product is right not to guard or note a branch with no optnone call; the fixtures lost their trigger. They now take it from mulhi in the same place (an OpUMulExtended, which SPIRV-Cross writes as its optnone spvMulExtended; checked with this host's spirv-cross on a hand-written module): rch_helper_branch's arms add the low bit of mulhi(i, k) to their mix, and rch_helper_tangle's arms take products(v, c), the high words of mulhi of the source's bits and the coverage's, scaled into [0, 1), which the tangled instruction reads in the after functions and does not read in the before ones. A covered pixel takes no arm, so its write, which the device lane runtime_lane::helper_tangle checks, is unchanged. Every expectation of both tests holds again unchanged; only their docs, the fixture comments and the lane's docs say mulhi instead of the half rounding. spirv::helper_branches no longer lists the half conversion barrier among the NoContraction users. Regenerated with scripts/regen-air-fixtures/regen-air-fixtures.sh rch_helper_branch rch_helper_tangle (Metal 32023.921, SDK 27.0, LLVM 21.1.8, the toolchain TOOLCHAIN already records for both), and their air_input goldens re-blessed with tests::air_input::bless_engine_goldens (no other golden changed). The golden hash tables are left for development's re-bless. Verified: - cargo nextest -p metal2vulkan --all-features over tests::engine_fragment, tests::air_input and tests::public_fixtures_engine: 69 passed (the fixture expectation table unchanged); - cargo nextest -p metal2vulkan-validation --all-features over the fixture tests: 28 passed. Not run: the device lane helper_tangle on an Apple GPU, which must show whether spvMulExtended triggers the store loss as spvFAdd did. * 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 the native-arithmetic deletions Blessed on development at ea56fbb83d, after the six native-arithmetic lanes, the unread-fact and macOS 26.7 sweeps, the exact table's removal and the test fixes landed. The engine inventory and the fixture expectations table re-derive unchanged; golden_hashes.tsv moves where the deleted exact forms changed modules. 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). |
||
|
|
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. |
||
|
|
3d4bae2f48 |
Drop MoltenVK's macOS 26.7 identity and the cube route measured there alone
One work packet, landed as 2 commits (783ff7d869..0e2ab5e60a on archive/development-linear-2026-10-28), in order: * Drop MoltenVK's macOS 26.7 identity and the cube route measured there alone MoltenVK's `deviceID` on an Apple GPU is the macOS release and the GPU family, so rows keyed on the M3 Max's macOS 26.7 identity (0x1A060209) were a second macOS release kept in the driver tables. The MoltenVK venue runs macOS 27, where the M3 Max reports 0x1B000209, so those rows matched no committed capture and no venue. - The 17 rows on that identity (deviations and runtime facts) and the `APPLE_M3_MAX` constant are gone. The macOS 27 identity, which the M3 Max and the M4 share, is `APPLE9`. - `DriverDeviation::GraphicsCubeGradientRoute`, measured on that identity alone, is gone with `CubeGradientRoute::AppleSwizzled` and the two footprints only it took (`CubeFootprint::Isotropic` and `AnisotropicSwizzled`, their emitters `transposed_face_gradients` and `normal_and_tangent_length`); `CubeFootprint::Word` loses its `swizzled` field. The graphics route is `GraphicsCubeGradientTangents`' projected form where measured, else as before. - Tests and the cube-route device lane no longer build the 26.7 identity; the swizzled-footprint interpreter test goes with its form. Docs that record where a Metal behaviour was measured (an M3 Max under macOS 26.7) are kept: they are provenance, not a release key. Verified: clippy (workspace, all targets, all features) clean, plain and with --cfg m2v_gpu; 454 touched tests (device, sampler, cube, engine_sampler_unk, fast_paths, catalogue, api_surface, api_signatures, mechanism, published_crates, driver defects, c3) pass; api_signatures re-blessed. * 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. |