RenderCommandEncoder::set_line_width refused every width but 1
(AppleOnly::LineWidth). Measured on the Apple M3 Max under macOS 27.0.1
(probes/line_widths.m): each encoder starts at 1 and the width holds
across draws and pipeline states; Metal draws w' = floor(16 w) / 16
clamped to [0, 16] (NaN and negatives as 0, infinity as 16); at w' = 1
its ordinary diamond-exit lines; at every other w' Vulkan's non-strict
parallelogram (major axis the larger extent, x on a tie; minor-axis
edges through the endpoints, w' long and centred; ends not extended;
centres inside, top-left ties; the width not rounded); at 0 exactly the
pixel centres on the segment; one parallelogram per strip segment with
no joins; triangles in fill mode Lines draw their edges so; at 4
samples every width is the parallelogram at the sample positions.
The runtime (render/line_width.rs) keeps the quantized width in the
encoder state and routes each draw at w' != 1:
- the device's own lines (lineWidth w', no Bresenham mode) where it
enables wideLines and w' lies in lineWidthRange above 0: exact where
strictLines is unset, nonStrictWideLinesUseParallelogram set, w' > 1
and on lineWidthGranularity; elsewhere announced device-wide-lines
under the default DevicePolicy::wide_lines = WideLinePolicy::Device,
and the band under WideLinePolicy::Exact (exact_answers() selects it);
- the pipeline's band variant otherwise (no wideLines, MoltenVK among
them; w' outside the range; w' = 0 at half a width of
2^-subPixelPrecisionBits): cull none, the band's front face, fill
mode, a PATCH_LIST of two points, viewport 0's half extent pushed
with the half width; strips and loops listed as their segments
(ListGap::WideLines), flat inputs under the last provoking vertex
read from the list led by the last vertex, which covers the same
pixels.
Refused: Unsupported(WideLines) needing tessellationShader where neither
route draws a line; NotImplemented(RuntimeGap::WideLines) for a
triangle's edges or a mesh draw's lines the device's lines do not draw,
an amplified band, a rate-mapped pass and an execution's commands.
Counted: WorkCounts::device_wide_line_draws, line_band_draws.
The lane test runtime_lane::line_widths draws the probe's cases through
owned fixtures and compares every pixel with Metal's answers
(line_widths_m3_max.txt, the probe's output), checks each wide draw took
a route, and that every fragment is front-facing; its site WIDE_LINES
holds the new kind in the lane's degrade-notice closure.
Docs: FAST-PATHS.md's row for wide_lines and a known-gap bullet (edges
and mesh lines on devices without wideLines, near-plane cuts, band
fragments' inputs uncompared, width 1 on multisampled targets off
MoltenVK); API.md's policy bullet and degrade catalogue; the runtime
README's Line widths; RUNTIME-PORTING's row; REFUSALS.md regenerated
(reach rows for feature and gap WideLines, apple LineWidth gone).
Validation: the line limits the device description gained describe
execution and are not compared in a profile's subset check; the
generator's CORE_PROPERTIES and roadmap-2022's m2v_layer_presentation
state them at the reader's absent values; opened_chains reblessed (one
member more, wide_lines, on every device with it); golden_hashes'
profile fingerprints reblessed (no output cell moved); api_signatures
and api_surface name WideLinePolicy and LineBandState.
RUNTIME_VERSION 1712; the runtime-sources pin rewritten.
Verified on the M3 Max under MoltenVK 1.4.2 through maclock with the
validation layer: runtime_lane::line_widths, 4 tests pass. Default and
exact policies each: 102 cases, 100 matched pixel for pixel, 2 refused
(the two fill-mode Lines cases at width 4, NotImplemented(WideLines)),
0 announced; 46 draws took the band, 0 the device's lines (MoltenVK has
no wideLines). a_band_needs_tessellation (tessellationShader withheld:
width 0 refused needing it, width 2 refused, width 1 matches) and
the_lane_s_maps_tell_the_widths_apart pass. Negative control: the band
widened by 1/16 of a pixel fails both runs at LANE lines 0.5. Also
cargo clippy --workspace --all-targets --all-features -D warnings, plain
and with --cfg m2v_gpu; nextest of metal2vulkan, -air, -runtime and
-devtools (4954 run, the one failure the missing lane site, now
declared), of metal2vulkan-validation (the failures the profile rules,
chains and pin fixed here, rerun green) and of metal2vulkan-conformance
(1007 pass). Not run: lavapipe, RADV, ANV and NVIDIA lanes, which take
the device route.
(Carried to development from steelbrain/reims-graphics-kext b16d03150c.)
A Core Image kernel library (metal -fcikernel, metallib -cikernel) is a
metallib of file type 1 whose kernels (!air.ci) are listed as function
TYPE 5 over one shared module. The container refused the file type
(Unsupported LibraryKind(1)), so newLibraryWithData: failed where Metal
succeeds; the consumer's graphics-kext lane hit it on Core Image's own
helper library in a macOS 26 guest, so every Core Image path stopped
there.
What Metal answers, measured with kernels written from scratch on an M3
Max under macOS 27.0.1 (probe programs over Metal's API and objc's message
log of a CIColorKernel render):
- newLibraryWithData: takes it as MTLLibraryTypeExecutable; functionNames
is empty; the private externFunctionNames lists the kernels in the
reverse of the table's order (libraries of two and four kernels);
- newFunctionWithName:, newFunctionWithDescriptor: and the private
newExternFunctionWithName: make each kernel with functionType 4 (no SDK
enumerator; its description prints "Unknown"); newExternFunctionWithName:
answers as newFunctionWithName: for any library, a kernel of an
executable one included, and nil for a missing name;
- a compute pipeline made from an extern function fails ("Function tint
was not found in the module");
- Core Image fetches each kernel and its own helpers with
newExternFunctionWithName: and links them on the CPU, in Metal.framework's
base device class, into an ordinary executable library holding one
kernel, ciKernelMain, of which it builds a plain compute pipeline.
So now:
- container: file type 1 is read (executable; its functions may share one
bitcode range, hashed once, as a dynamic library's); TYPE 5 is the new
FunctionStage::Extern, no stage: the ABI cross-check refuses it as a
mismatch, Library::Function compiles it as no entry (EntryNotFound,
available 0). Unobserved file types stay LibraryKind refusals.
- FunctionType gains the private enumerator Extern = 4
(regen-metal-enums PRIVATE); reflection maps Extern to it.
- runtime Library: function_names leaves extern functions out;
extern_function_names (reverse table order) and
new_extern_function_with_name are new.
ciKernelMain itself was refused next: Lowering(Arith) at its first
load, `load [4 x <4 x float>], ptr addrspace(2)`, a whole array loaded
from the constant buffer and passed by value to a helper. Lowering reads
and writes buffer and threadgroup memory a scalar or vector at a time.
The new canon pass `aggregates` (after SCCP, beside the other expansions)
replaces each non-volatile, non-atomic load or store of a pointer-free
array or struct in device, constant or threadgroup memory by its members'
accesses in layout order (a getelementptr i8 at the member's distance, the
access's alignment lowered to what the distance allows, joined by
insertvalue or split by extractvalue), at most 256 members, 8 deep.
Thread memory, pointer-holding aggregates (handles), volatile accesses
and larger types stay whole as before. The same-type pointer bitcast
beside the load was never the problem (verified alone).
Public surface: metal2vulkan-air FunctionStage::Extern; metal2vulkan
FunctionStage::Extern and FunctionType::Extern; runtime
Library::extern_function_names and new_extern_function_with_name
(api_signatures blessed: 5 added, none changed or removed). devtools
gains core_image_metallib. The metal-enum generation now records the
macOS 27.2 SDK (the host's Xcode); no SDK value changed, only Extern was
added. LibraryKind's doc and reach note name what it refuses now.
No cache version moves: file type 1 and aggregate accesses outside thread
memory were refused before, so no key reached them, and
golden_hashes_match_the_table passes unchanged (every public fixture
assembled: this Mac's Xcode 27.2 now has its Metal toolchain). The
runtime-sources pin moves (runtime library.rs): re-pinned here to
23766690fd75227c5333e976bfc1fdfafa6ff78f43e0c5ba8fa5183574cd9371.
Verified (M3 Max, macOS 27.0.1):
- Metal versus this tree's runtime on MoltenVK: Core Image's linked
ciKernelMain for a tint color kernel and for a sampler kernel (both
from-scratch CI kernels; the linked libraries captured from Metal in
scratch and deleted after), same constant buffer, source texture and
sampler, 4x4 RGBA32Float target: byte-identical texels, the early-out
column untouched on both. The parent tree answers FALLBACK (Lowering
Arith) for both. Release CLI: 0.01-0.03 s, 11 MiB each.
- Release CLI, parent vs this tree, largest public fixtures
(hfb_filter_bank render pair, tns_mm_flags), three runs each:
0.12-0.13 s vs 0.12-0.16 s and 0.05-0.06 s vs 0.04-0.05 s, 27 MiB both
(runs beside a test suite; the same within noise).
- New tests: canon aggregates (split loads, stores with nested arrays and
lowered alignments, threadgroup; volatile, pointer-holding and
300-element aggregates stay whole), an engine test running a
ciKernelMain-shaped kernel on the CPU interpreter on three profiles,
core_image_libraries (container types, stages, shared hash, functionType
4, EntryNotFound), and a runtime device test on MoltenVK (names, extern
names, both lookups, pipeline refusal, an executable library's kernel
through the extern lookup). Negative controls: the split and execution
tests fail with the pass disabled; the library tests fail with file
type 1 refused.
- cargo nextest -p metal2vulkan -p metal2vulkan-air -p metal2vulkan-runtime
-p metal2vulkan-devtools --all-features: 4927 passed (golden hashes and
the metal-as fixture parts included); -p metal2vulkan-validation
-p metal2vulkan-conformance: 2369, all passed after the re-pin; doctests
ok; clippy --workspace --all-targets --all-features -D warnings and the
runtime's under --cfg m2v_gpu: clean; rustdoc -D warnings and
scripts/api-docs: clean; REFUSALS, METAL-COVERAGE and
CONFORMANCE-COVERAGE re-derived (MTLFunctionTypeExtern is listed as not
yet compared by a conformance case). Not run: a corpus translation
census, and the device suites beyond the new runtime test.
Rule 1 (owner, 10-29): where the device has a native form, it is the only form.
An extended-range attachment's raw codes are something no blend unit reads, so the
shader still blends it (capability), inside the pixel interlock or over lavapipe's
input attachment. Its arithmetic used to be Metal's compiler's: lerps, common
factors, fusing by factor rank, half rounding at every step, a separate float4
model and computed-output tables. Now it is a blend unit's arithmetic: S*Fs op D*Fd
in float, in the order of the blend equation, with the source, second source and
blend color clamped to the form's range first (`extended_range::blend::native`).
- computed.rs is deleted. blend_color.rs keeps only the two source ranges.
- input_blend.rs and fetch.rs call native().
- The blend color is pushed as raw f32 bits (HalfBlendColor), so
PushField::BlendColor is gone.
- Every blended extended-range output that stores a channel now records
ExtendedRangeBlendSource (half) or ExtendedRangeFloatBlendSource (float).
- The refusals ConstantColorDifference, SrgbForm and FloatOutput are gone, as is
the fast-math DualSource refusal for extended range. Every factor, operation
and mask is built; only outputs other than four half or float lanes are
still refused (Output).
The 32-bit float storage-form blend (`Blend::float32`, `fetch::float32_blended`)
computed Metal's fused forms in float. Every committed profile except
roadmap-2022 and vk12-floor sets COLOR_ATTACHMENT_BLEND on R32/RG32/RGBA32_SFLOAT,
so that form copied Metal's bits where the device blends natively. It is removed:
- a fetched 32-bit float attachment takes the generic float blend
(UnmeasuredFetchBlend);
- one that is not fetched gets the device's blend after the pass splits.
The float4-output paths of the half/unorm8 model (Atom::Sf, Arith::Kept,
round_inner, Blend::float/narrow/takes_float) were dead after this and are pruned.
Removed:
- the Metal blend-table validation lane (extended_range_blend_table.rs)
- devtools xr_blends
- the xr_blend_table*.txt fixtures
- lower/arith/tests/blend32.rs
- the extended_range tests that pinned Metal's forms
Added:
- every_blend_is_the_devices_arithmetic: every form, 19 factors, 5 operations,
rotating masks and adversarial sources, bit-exact against a float model of
S*Fs op D*Fd
- every_blend_is_built_but_a_placeholder
Docs:
- FAST-PATHS: the "Metal's rounding per shape" fast row is removed. The
extended-range blend is now a device-gaps row with the two notes. The
32-bit float row and the interlock section are fixed.
- artifact.rs note docs and the API.md catalogue are rewritten.
- REFUSALS is regenerated, reach.tsv updated and api_signatures blessed
(removed ExtendedRangeBlend::{ConstantColorDifference, FloatOutput, SrgbForm},
PushField::BlendColor).
- Conformance: the two notes join replay::NATIVE_NOTES, and 16 Apple M3 Max
known-gaps rows hold the xr-blend add/premul sites the device's arithmetic
moves: one code, two at the sRGB premultiplied sites.
- SEMANTICS_VERSION 1923, ARTIFACT_FORMAT_VERSION 479.
Size: a premultiplied half4 fill into RGB10A8_2P_XR10 on moltenvk-m3 goes from
3275 to 1937 SPIR-V words (the blend itself from 2133 to 795). The float4 fill
goes from 3435 to 1951 words, and BGRA10_XR_sRGB premultiplied from 7992 to 6654.
Verified:
- metal2vulkan lib, touched modules: 511/511.
- Sabotage: rounding the source to half in native() fails
every_blend_is_the_devices_arithmetic; restored, it passes.
- clippy, plain and with --cfg m2v_gpu; rustdoc -D warnings.
- M3 Max conformance replay of 25 cases: half-output-blends-*,
blend-interaction-format-float32 and xr-blend-*-one-zero are justified; the 16
xr-blend add/premul sites are held by the new rows.
The replay exits 0 with the ledger held exactly. The conformance crate
passes 1007/1007, CONFORMANCE-COVERAGE is regenerated, and runtime
degradation/catalogue and api_signatures/api_surface/refusal_surface pass.
- M3 device tests (memcap + maclock, --cfg m2v_gpu): 11/11 of
runtime_lane::extended_range_blends and framebuffer_fetch::generic_blend.
The renamed blends_of_half_outputs_into_extended_range_texels asserts
Metal's bytes for one-zero and prints the 16 add/premul outputs the device's
arithmetic moves.
One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 808143ef80, then 18431ee908 (the re-pin).
The device's depth bias unit on every format, and the device's store of untouched texels in
place of the unused-bits load pass (deleted with its capture machinery); the NaN depth
discard documented as capability. SEMANTICS 1910, RUNTIME 1682.
One work packet, landed as 7 commit(s) (88bcfeaea8..6aec9db4e9 on archive/development-linear-2026-10-28-evening), in order:
* Take the device's depth bias on a Depth16Unorm depth
Rule 1: the device's depth bias is its native form, so it is the only one. A
constant bias (or a slope alone) on a Depth16Unorm depth was recorded through
VK_EXT_depth_bias_control's depthBiasExact as Metal's own rule, c + 1 units of
1/65535 for c of 0 or more and c - 1 below (one unit for a slope alone), in
depth (floatRepresentation) or in 2^-16. Now `metal::state::depth_bias` hands
Metal's constant to vkCmdSetDepthBias in the device's own unit r on every depth
format; Vulkan leaves a fixed-point format's r to the implementation, at most
2 x 2^-16 ("Depth Bias", primsrast.adoc).
Deleted, nothing reading them any more: `depth16_units`, `DepthBiasUnit` and
`DepthBias::unit`, the `depth_format` parameter of `depth_bias` and of the
runtime's `vk_depth_bias`; the runtime's vkCmdSetDepthBias2EXT path
(`DepthBiasCommand`, `depth_bias_command`, the record's pinned representation,
the device's command, its priming and `DEPTH_BIAS_CALLS`, the exit guard's and
recorder's `CmdSetDepthBias2`, `Logged::SetDepthBias2` and its thunk, so
`CommandsReplayed::cmd_set_depth_bias2` goes). VK_EXT_depth_bias_control is
still described but no longer consumed, so the core recommends enabling neither
it nor its three features.
RADV on the 780M no longer takes DriverDeviation::MetalDepth16BiasedStores: it
was measured through the exact unit. MoltenVK keeps it (it hands Metal its
constant, by construction). Elsewhere `unorm-depth-bias` announces the device's
bias; its cost text, docs/API.md's entry, the deviation and property docs and a
new FAST-PATHS device-gap row state it.
Tests: `metal::state::a_unorm_depth_bias_is_metals_constant_in_the_devices_unit`
(the constant as given on lavapipe, NVIDIA and MoltenVK, which have
depthBiasExact or not); the recommendation test leaves the extension and its
features out; the driver-facts test drops RADV's row; the exit-guard tests lose
the priming group and render_state.rs as a keeper of the device's functions.
api_signatures blessed (DepthBiasUnit, DepthBias::unit, depth_bias's signature);
the refusal surface is unchanged. Not bumped here: RUNTIME_VERSION (the versions
commit) and the runtime-sources pin (landing).
Verified: cargo clippy -p metal2vulkan -p metal2vulkan-runtime
-p metal2vulkan-validation --all-targets --all-features -D warnings; nextest of
metal::state, device::tests::{enables,driver_facts,profile}, tests::fast_paths,
api_surface, api_signatures, exit_guard, render_state, degradation_catalogue,
draw_shape_notices and ash_interop: 159 passed.
* Cite the spec that leaves a NaN fragment depth undefined, which makes its discard capability
The native-arithmetic audit asked whether `clamp_depth`'s discard of a positive NaN
depth, on every profile, emulates Metal where the device has a native form. It does
not: Vulkan defines no answer for such a depth. "Depth Clamping and Range
Adjustment" (fragops.adoc, 35.10.1): "If zf is not in the range [zmin, zmax],
then zf is undefined following this step", with or without depthClampEnable, and a
NaN lies in no range; only depthClampZeroOne, which no profile enables, keeps a
float depth unchanged (and then the comparison of a NaN would still pass ALWAYS
and NOT_EQUAL, where Metal's fails every test). So the discard stays, as
capability, and the comment says why, so a later audit does not re-raise it.
Docs only (a doc comment); no behaviour changes.
Verified: cargo fmt --all.
* Drop the cube's unmeasured gradient route from the anisotropic tests' profile comment
The route was deleted with the native cube gradients; the comment still named it as a second
home of the anisotropic emulation. Only a profile without samplerAnisotropy emulates it now.
Verified: comment only; git grep finds no other mention of the unmeasured gradient route.
* Keep the device's store of an extended-range, padded or bfloat attachment's untouched texels
What: a render pass that loads and stores a color attachment of an extended-range, padded
10-bit or bfloat format now keeps the bytes its draws do not write, the device's own load and
store (VK_ATTACHMENT_STORE_OP_STORE of a loaded attachment), on every device. The runtime no
longer reproduces Metal's tile store: the load pass that rewrote the texels' unused bits before
the pass (render/unused_bits_load.rs, bind::unused_bits_module), the capture replay that found
the tiles a pass's draws reach for it (render/capture.rs, bind::capture_assembly_module,
capture_settle_module, tile_reach_module, the translator's capture form
LoweringInputs/VariantKey::captured_positions, CaptureForm, RuntimeFact::CapturedPositions,
PushField/PushHole::CaptureAddress, Feature::TileReach, StatusBits::CAPTURED_REACH_UNMEASURED,
StatusReport::captured_reach_unmeasured) and the pipeline states' capture forms are deleted, with
ExtendedRange::load_code, Degradation::UnreachedTilesRewritten and the WorkCounts fields
unused_bits_load_passes, unused_bits_load_texels and capture_reach_*. Every draw in such a pass
announces extended-range-bits-kept, naming the attachments (render/tile_store.rs, the renamed
module); its catalogue entry, the FAST-PATHS device-gap row and the format docs state what
differs: the unused bits, BGRA10_XR's alpha clamp, a padded sRGB twin's table and a bfloat code
through half, which Metal's pass rewrites in each tile a draw reaches. snorm-minimum-kept and
shared-exponent-kept are unchanged (TileStoreIsMetals still says where the device's store is
Metal's).
The de-indexed and private list forms keep the index read the capture form shared
(PushField::CaptureIndexAddress, CaptureLayout, CapturedIndex); the binder's de-indexed draw no
longer goes through the capture draw, and the vertex function's strip restart return, which only
the capture form's layout could take (a de-indexed strip is NotImplemented(PrimitiveId)), is
gone.
Why: the owner's rule 1. The device has a native load and store; reproducing Metal's tile store
emulated Metal's bits where the device has a native form. The difference is recorded and
announced (rule 2).
Verified: cargo clippy -D warnings, all targets and features, over metal2vulkan,
metal2vulkan-runtime, metal2vulkan-validation and metal2vulkan-conformance, plain and with
--cfg m2v_gpu: clean. api_signatures blessed, REFUSALS.md regenerated. The test runs (translator
and runtime suites, the touched validation lanes on lavapipe and on the M3 Max's MoltenVK) follow
this commit and are reported with the lane.
* Bump the semantics and runtime versions for the device's tile store and depth bias
What: SEMANTICS_VERSION 1907 -> 1908 and RUNTIME_VERSION 1681 -> 1682.
Why: SEMANTICS_VERSION, because the translator's output changes under unchanged keys: the
de-indexed and private list vertex forms no longer carry the strip restart return, and the
capture form, its runtime fact and its push field are gone. RUNTIME_VERSION, because runs of
unchanged artifacts now do something else: a Depth16Unorm depth takes the device's depth bias
(no depthBiasExact or unit rescale), and a pass that loads an extended-range, padded or bfloat
attachment keeps its untouched texels' bytes (no unused-bits load pass, no capture replay) and
announces extended-range-bits-kept. ARTIFACT_FORMAT_VERSION stays: the codec tags variants by
name, and the removed ones (CaptureForm, PushField::CaptureAddress,
RuntimeFact::CapturedPositions) leave their tags unused, so an old entry holding one is a miss.
Verified: the constants alone change; the golden tables and the runtime-sources pin are
re-blessed at landing.
* Hold the lanes and the fact census to the device's store of untouched texels
What: three runtime lanes still expected Metal's tile store after 5e710fb988 made the device's
store the only form, and the mechanism test still counted the deleted
RuntimeFact::CapturedPositions.
- extended_range_blends::a_pass_of_extended_range_and_padded_colors_names_each_loaded_color:
the padded colors, which the function does not write, keep their bytes (all ones), where
Metal's pass leaves each word 0xffc0.
- extended_range_blends::a_fetched_two_plane_attachment_written_unblended_stores_metals_write:
color 2, loaded and unwritten, keeps its bytes, where Metal's pass zeroes its color words' top
two bits.
- extended_range_blend_table::a_memoryless_color_2_blends_as_a_stored_color_does: the stored
color 0's bands are compared with the unused bits as Metal's pass leaves them
(as_metal_leaves), the codes exactly, as the table's other passes already are.
- device::tests::mechanism: the variant census is 0..89 (MergedDraws takes the freed index).
Why: the lanes held the deleted exact form; the device's store is now the contract and
extended-range-bits-kept announces the difference.
Verified: on the M3 Max (MoltenVK, --cfg m2v_gpu, under maclock and memcap) the three lanes and
the rest of extended_range_blends pass (11 of 11, with waiter_submits, which failed once under a
load of 40 and passed on its rerun); on plain, device::tests::mechanism and tests::fast_paths
pass (12 of 12); clippy -D warnings clean, plain and --cfg m2v_gpu, over the four crates.
* Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
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.
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.
The owner asked for the M4 profile to go: no venue runs an M4 (the M4
venue was dropped on 2026-10-11), and its capture differed from the M3
Max's only in the identity and the allocation sizes, so every test that
named it repeated the M3 Max's case.
- crates/metal2vulkan-validation/profiles/moltenvk-m4.json is gone, with
its regen-device-profiles source, its README row and paragraph, and its
four opened_chains.txt rows.
- MOLTENVK_CAPTURES holds the M3 Max alone. Tests that looped over both
captures take the M3 Max's; loops over that one capture are unrolled
(clippy's single-element rule). Tests that took the M4 as a device of
the pixel interlock, of fragment stores, or of the family audit take
the M3 Max's capture, which has the same features.
- validation: a_run_on_the_m4_at_the_m3_max_venue_stops_on_its_name_alone
is gone; the C3 venue test builds its second GPU's device from the M3
Max's capture under another name.
- Docs and a probe comment no longer name the capture.
Left red here, fixed in the next commit (which removes the per-release
driver table these tests pin): driver_facts tests that measure the M4's
identity (an_unmeasured_identity_takes_its_drivers_defects_alone,
moltenvk_1_4_2_is_measured_on_the_m3_max_alone,
moltenvks_linear_attachment_features_are_left_out,
the_profile_takes_the_deviations_its_driver_release_is_measured_with) and
two arith tests whose measured device was the M4
(half_arithmetic_on_the_device_follows_the_profile,
the_fused_multiply_add_route_follows_the_profile). The golden tables'
M4 columns are re-blessed after the change.
Verified: cargo clippy --workspace --all-targets --all-features
-D warnings is clean; the core suites ran (failures above, the run
continuing against this tree).
Originally bfdfe81d37 (archive/development-linear-2026-10-28).
The steps this packet landed as, in order:
- Name a device-lane shard by the whole area it starts in
- Read a nextest listing by what its filterset takes, not by what it holds
- Say in --help what a slice marks in the report
- Keep the lane runner's lines and its verdict readable
- Say what the device lane's ignored tests actually are
- Align the shard table's header with its rows
- Hold each shard to the tests it had to run, not to nextest's skipped figure
- Say why no shard run builds under the wrap
- Compile each device-lane shard before it takes the GPU lock
- Say why both halves of a shard keep the workspace scope
- Say what a shard's wrapped seconds are, and what they are not
Content: the tree of `development` at 48daef6735, unchanged.
The steps this packet landed as, in order:
- Name BGRA4Unorm's packed-16 attachment and its color input in the API guide
Content: the tree of `development` at ebd18b3408, unchanged.
The steps this packet landed as, in order:
- Keep the quoted Metal messages out of rustdoc's link syntax
- Record the runtime sources' hash after the sub-problem basis lines
Content: the tree of `development` at 3ade9d9999, unchanged.
The steps this packet landed as, in order:
- Read the selectors the suite's Metal leg sends by hand
- Type the receivers the suite's Metal leg binds by pattern
- Read the receiver, the chain and the closure the leg actually writes
- Say what still costs an unresolved call site
- Re-bless the golden tables after the extension vocabulary grew
Content: the tree of `development` at 1116f3a6d0, unchanged.
The steps this packet landed as, in order:
- Record the runtime sources' hash after the refusals' basis lines
Content: the tree of `development` at 75f847189a, unchanged.
The steps this packet landed as, in order:
- Hold the committed TOOLCHAIN files to the byte order the script writes
Content: the tree of `development` at 83ad1605e6, unchanged.
The steps this packet landed as, in order:
- Pin the published crates' public surface by signature
Content: the tree of `development` at e46d17fe41, unchanged.
The steps this packet landed as, in order:
- Hold the off-four execution range to an offset inside its buffer
Content: the tree of `development` at 15b0982f8c, unchanged.
The steps this packet landed as, in order:
- Say so when a conformance-coverage module is run as a command
- Order the TOOLCHAIN fixture lines by byte value, not by the host's locale
Content: the tree of `development` at b5a0b1378b, unchanged.
The steps this packet landed as, in order:
- Flag what moves between runs of one replay selection
- Read a leg function handed to a combinator as an edge
Content: the tree of `development` at f3069fdc8e, unchanged.
The steps this packet landed as, in order:
- Hold the venue memory notice in one place, beside notice_allowance
- Declare the discrete-card memory notice in eleven families that named none
- Declare the discrete-card memory notice in eight families that already named others
- Declare the discrete-card memory notice in sixteen more families
- Declare the notices a non-Metal driver provokes in the rest of the a-l shard
Content: the tree of `development` at 1df59f5add, unchanged.
The steps this packet landed as, in order:
- Declare the crossings two pass families already hold
Content: the tree of `development` at a4805b6ba1, unchanged.
The steps this packet landed as, in order:
- Re-derive the generated documents at the landing tip
Content: the tree of `development` at fc6bb53c97, unchanged.
The steps this packet landed as, in order:
- Re-derive the generated documents at the landing tip
Content: the tree of `development` at 2c1636399f, unchanged.
The steps this packet landed as, in order:
- Measure compressionType, and say why no case states it
Content: the tree of `development` at 2eb1d1baf1, unchanged.
The steps this packet landed as, in order:
- Take an indirect command's buffer at or past the declared bind count
- Re-derive the generated documents at the landing tip
Content: the tree of `development` at dd2238827d, unchanged.
The steps this packet landed as, in order:
- Credit a container's own row, and state what no binding can reach
- Stop dropping call edges, and read a class message broken after `::`
- Report a site name held twice, instead of pairing the two by luck
- Give the hand-declared Metal enums an SDK denominator
- Read a braced `use`, which named values this axis counted nowhere
- Separate what Metal answered from what a case named a site
- State the two floors as what they are, not as what they were
Content: the tree of `development` at 15adea8261, unchanged.
The steps this packet landed as, in order:
- Wrap the option-space axis's two overlong lines
- Blank a source for the hand-modelled scan only where a match needs it
- Remove the self-test's trees when it is done with them
- Say that a sweep by ordinal states no value by name
- Record why an ordinal-stated value must not be resolved by field name
- Re-derive the generated documents at the landing tip
Content: the tree of `development` at 9e1c5a54d5, unchanged.
The steps this packet landed as, in order:
- Say why a called selector can be missing from the coverage map
Content: the tree of `development` at eed0293b78, unchanged.
The steps this packet landed as, in order:
- Say in the refusal surface what a 16-bit depth copy really waits on
- Copy a multisampled 16-bit depth, which plain Metal copies exactly
Content: the tree of `development` at 688b62deab, unchanged.
The steps this packet landed as, in order:
- Compare what a compute and a drawing pipeline state say about themselves
- Stop the coverage derivation dropping a Metal-leg function whose signature holds a semicolon, and type three receivers it could not
Content: the tree of `development` at 35b3d026d4, unchanged.
The steps this packet landed as, in order:
- Take Metal's answer for the argument-encoder and function-binding cases
- Name the receiver that reads a texture an argument buffer holds, and cut what nothing calls
- Declare the three notices the sampling cases announce on a software renderer
- Keep the argument-encoder module's docs inside what rustdoc will publish
Content: the tree of `development` at ae72eece5c, unchanged.
The steps this packet landed as, in order:
- Give AstcDecode its first check against Metal rather than against itself
- Inventory what the conformance suite verifies, not what we implement
- Leave no bytecode cache beside the coverage script
- Group the conformance inventory by SDK header as well as by container
Content: the tree of `development` at 0375c9b833, unchanged.
The steps this packet landed as, in order:
- Ask the device for the sample positions it is actually given
- Hold a rotated IOSurface texture's pitch to the texture's own row
- Take a PVRTC whole level at any pitch Metal takes it at
- Recompute the runtime sources pin on this base
Content: the tree of `development` at 575917bf7b, unchanged.
The steps this packet landed as, in order:
- Adopt the fragment quad's lavapipe divergence, scoped to that venue
- Name the device's own gap where the vocabulary could not, and the notice in a notice-only difference
- Pin the sparse sample-count chain as the device's gap, with lavapipe's measurement
- Recompute the runtime-sources pin after the rebase
Content: the tree of `development` at fb88ec8599, unchanged.
The steps this packet landed as, in order:
- Stop a running predicated loop at the GPU's recovery from a fault or a hang
- Resolve multisampled extended-range targets by Metal's measured rules
- Run the emulation's indirect mesh draws with an object function
Content: the tree of `development` at 60cf488339, unchanged.
The steps this packet landed as, in order:
- Say whether the multisampled sparse lane ran on a sparse image
- Answer per indirect command buffer whether its identifier is unmeasured
- Bump the semantics, artifact format and runtime versions for the ninth stack
- Pin the runtime sources of the ninth stack
Content: the tree of `development` at 9e2387685c, unchanged.
The steps this packet landed as, in order:
- Run any object grid Metal runs, in pieces within the task stage's limits
- Upload a folded object draw's fold when it launches nothing too
- Run an unfolded object stage's direct grid as Metal does when its threads wrap
- Bump the semantics, artifact format and runtime versions for the seventh stack
- Pin the runtime sources of the seventh stack
- Bless the golden hash tables over the seventh stack
Content: the tree of `development` at a6f6b269ad, unchanged.
The steps this packet landed as, in order:
- Give the private-writes fixture its golden printout and inventory rows
- Draw an indirect render command's private primitive types as the encoder's draws of them
- Count an injected page fault or hang toward a queue's revocation, as the error it stands for
- Drop a unit's ungated dispatches at its unbalanced first record, as Metal does
Content: the tree of `development` at 8e08f4d248, unchanged.
The steps this packet landed as, in order:
- Regenerate the refusal surface after the indirect mesh draws
- Read the task limits through the profile's public limits in the mesh draws lane
- Name VK_EXT_post_depth_coverage in the candidate's enable list
- Re-bless the opened chains, and let a late depth test behind an imageblock writer link
- Withhold the mesh shader extension's features with it in the mesh lane
Content: the tree of `development` at 3e1d7fbbe1, unchanged.
The steps this packet landed as, in order:
- Draw private types in a pulled list form where the indexed list differs from Metal
Content: the tree of `development` at d3fc3a5794, unchanged.