Commit Graph
443 Commits
Author SHA1 Message Date
Anees Iqbal 81ced9a1cb Extended-range fetch and blend refused: what needs Metal's tile half is NotImplemented(Format)
Metal's tile memory holds an attachment of Apple's extended-range formats (BGR10_XR, BGRA10_XR,
RGB10A8_2P_XR10 and their _sRGB twins) as half through a render pass and rounds it to the codes
only at the store. A fetch of such an attachment, or a blend onto it after an earlier draw of the
pass wrote it, sees that draw's half. The attachment holds the codes. With the half shadow gone
(the commit before), such a read or blend would take the stored codes, which is wrong but valid
output. Both are now a typed refusal, NotImplemented(Format) at Attachment::Color(n), on every
device and in either fetch form. This is the same boundary as the runtime's own refusal of every
extended-range texture: Gap::TextureFormat (crates/metal2vulkan-runtime/src/error.rs:1011),
raised in texture.rs's form() (texture.rs:2416, `if !viewed(mapping.emulation)`), so rt never
makes such an attachment.

Where (lower::fragment::fetch::codes_round_the_tile names the forms: an extended-range form that
is neither padded nor bfloat):
- A fetch: color::select_param, beside the bfloat fetch's refusal. It runs for the storage form
  and the input attachment alike. An integer read stays Metal's pipeline error
  (InvalidDescriptor(ColorAttachment)).
- A blend into one the function writes, under any write mask:
  - fetch::blended_extended_range, which both ordered devices' plans call (the interlocked storage
    form, and input_blend over rasterization-order input attachments);
  - stage_io::extended_color::plan, on a device that orders fetch in neither form. It is checked
    before the orderings' refusal, since no device would make the blend.
- The public door metal::format::extended_range_blend answers NotImplemented(Format) for those
  forms on every device.

Unchanged: an unblended write and a masked merge (a kept code is the encode of the half the tile
keeps there). Padded forms (R10Unorm_X6, RG10Unorm_X12, their _sRGB twins, RGB10A2Unorm_sRGB):
their fetches and blends are built as before. Bfloat: its fetch is refused as before, and its
blend is Metal's error.

Dead with it: the source-range clamp only those blends took. Every caller of
extended_range::blend::native now passes a padded form's None. Removed: blend::extended_ranges,
clamped_lanes and native's ranges parameter, extended_range::source_range, and blend_color.rs
(SOURCE_RANGE, SRGB_SOURCE_RANGE). The validation build script's runtime inputs list
blend_color.rs no more, and the runtime pin moves. In the CPU-model tests: the XR forms' blend
cases and EVERY_FORM; the padded blends keep their model.

Docs: fetch's module docs (the extended-range paragraph, plus one on Apple's forms in place of the
"across draws" one), color's and stage_io::extended_color's, input_blend's, ExtendedRangeColor's,
PrecisionNote::ExtendedRangeBlendSource and ExtendedRangeFloatBlendSource (now padded only), the
door's, and docs/API.md (section 4's framebuffer fetch, and the two notes' catalogue entries).
docs/REFUSALS.md regenerated, api_signatures blessed.

Conformance (crates/metal2vulkan-conformance/known-gaps-rt.tsv), by expectation: the next round's
conformance replay on every card confirms them. 260 rows change their answer from "unsupported:
FramebufferFetch; needs AnyOf([[Feature(FragmentShaderPixelInterlock)],
[Feature(RasterizationOrderColorAttachmentAccess)]])" to "unsupported: Format; needs
NotImplemented", at the same metadata and color attachment. Their explanation now names the
refusal:
- xr-blend-* (108);
- xr-gamut-* (108);
- xr-gradient-*-blended (24);
- xr-masked-*-over (20).
The unblended masked rows (xr-masked-bgr10xr-red, -blue-green and their sRGB twins) keep the
orderings' refusal. The runtime's floor orders fetch in neither form, so its stage_io refusal is
what these rows record. docs/CONFORMANCE-COVERAGE.md is regenerated.

Tests:
- fetch::tests: the door's case splits Apple's forms (NotImplemented) from the padded blended
  ones; on runtime-floor, R10Unorm_X6 keeps the orderings' refusal and BGRA10_XR is
  NotImplemented; the moltenvk-m3 FragmentStoresAndAtomics case takes R10Unorm_X6.
- engine_extended_range::blended_pipelines: a `refused` helper (Format, NotImplemented,
  Color(0)); the wide-gamut client pipelines are refused on every venue and runtime-floor; the
  unwritten and masked test expects the refusal for every written blended shape.
- engine_extended_range::targets: a blended attachment, and lavapipe's fetch, expect the refusal.
- engine_fragment: a_fetched_extended_range_attachment_is_refused (every Apple form on every
  committed profile, exf_fetch_three, and the whole pipeline on moltenvk-m3) replaces the made
  fetch; the fast source-alpha-over sRGB XR blend and the input-attachment XR blend go, as they
  covered refused forms only; the premultiplied blend test and the blend note's test move to
  padded forms (RG10Unorm_X12 and its sRGB twin). con_fetch_coverage, the second-source blend and
  tsw_fetch_discard keep their storage-form and coverage mechanics on RGB10A2Unorm_sRGB, the
  four-channel padded form, where the guests' pipelines had RGB10A8_2P_XR10; their docs say so.
- lower::arith::extended_range::tests: the padded forms' blend model alone.

SEMANTICS_VERSION 2225 (after guestgaps' 2224, on development 81bd82fdaa): the refused inputs'
cached artifacts must not be served. Every made pipeline lowers to the same words: native's clamp
ran for XR forms alone. The old render key test is re-pinned by the commit after this one, from
the check job's printed key. ARTIFACT (569, the shadows' deletion) and RUNTIME stay; the runtime
pin moves with the sources.

Consumer check (consumer-uses.sh, consumer development b955213d27, 64 refs): extended_ranges,
SOURCE_RANGE, SRGB_SOURCE_RANGE, blend_color, clamped_lanes and codes_round_the_tile have 0 hits.
source_range's hits are the consumer's own field (CopyIndirectCommandBuffer::source_range,
unrelated); ours was a private fn.

Verified, at the earlier base 453eec0373 with this change: check 60853 (4406 tests, 10 failed:
the render key, the tests above and the coverage doc, all changed here since; 60899 then showed a
closure type in the new engine_fragment test, fixed here). A states-only play of that tree over
the recordings (60871, 60872, 60873, 60893, 60900) refused 0 render and 0 compute states. The
check and the play at this tree are named in the next commit and the report.
2026-11-20 17:26:22 -08:00
Anees Iqbal a950689934 Extended shadows go: no variant reads and writes an extended-range attachment's half shadow
Metal's tile memory holds an extended-range color attachment (BGR10_XR, BGRA10_XR,
RGB10A8_2P_XR10 and their sRGB twins) as half through a render pass and rounds it to the codes
only at the store. The binder offered a variant for a draw whose render pass instance held a
half shadow of such an attachment (BindState/BindShape::extended_shadows,
VariantKey::extended_shadows, LoweringInputs::extended_shadows). Its fragment function read and
wrote an Rgba16f storage image beside the codes (ResourceKind::ExtendedShadow), either in the
interlocked storage form or, on a device that fetches through rasterization-order input
attachments, beside the input attachment (lower::fragment's input_shadow). metal2vulkan-runtime
never asks for the variant and makes no extended-range texture (Gap::TextureFormat), so nothing
reached it.

Now no such variant exists. A function compiled with no shadow (every function, as before for
every rt draw) is unchanged: a blend or fetch onto an earlier draw's write reads the codes that
draw stored (extended_range::tile_value). Those differ from Metal's half where it is not a code's
value, and fetch's module docs say so.

Removed:
- lowering: lower/fragment/input_shadow.rs (InputShadow and its plan, read, store and words),
  FragmentPlan::input_shadows, Declared::extended_shadows, the storage form's shadow
  (StorageColor::shadowed, declare_shadow, shadow_and_texel, shadow_read, the shadowed branches of
  texel, value, the write and its blended and merged forms, and their word estimates), and the
  input-attachment blend's, color read's and stage_io write's shadow branches. The loop over
  covered samples no longer has a shadow refusal. The blend's doc, which sat above
  merged_extended, now sits on blended.
- pipeline: LoweringInputs::extended_shadows and its key bytes, VariantKey::extended_shadows,
  ResourceKind::ExtendedShadow, BindingSource::ExtendedShadow and its link arm, the fetch inputs'
  shadowed reads and writes and their tests and coverage (the input-attachment form passes no
  depth, stencil or coverage state, as before for an unshadowed draw), and the requirements
  trace's ExtendedShadow arm. MovableStorageWrites' doc loses the shadow.
- binder: BindState::extended_shadows, BindShape::extended_shadows, WriteSource::ExtendedShadow,
  and the graphics binder's choice of the shadowed variant (its refusals of a mesh, layered,
  amplified or multisampled plain writer's shadow included).
- tests: engine_fragment's four shadow tests and their helpers (image_accesses,
  shadow_image_types, execution_modes, interlocked); engine_moved_writers' shadow move (its Move
  enum goes, and the writers are checked with the interlocked move alone); the shape round-trip,
  the variant round-trip fixtures, the compile-key test's shadow arm, and the requirements test's
  ExtendedShadow kind.

No SEMANTICS_VERSION bump: an input without shadows (every input a consumer can now state)
lowers to the same words. Removing the shadowed branches leaves the instruction order of the
unshadowed paths as it was, and the key appended shadow bytes only when the set was non-empty.
ARTIFACT_FORMAT_VERSION 569 (after guestgaps' 568 on 81bd82fdaa): the codec loses
ResourceKind::ExtendedShadow and BindingSource::ExtendedShadow. RUNTIME_VERSION stays: no run of
an unchanged artifact and plan does anything else, since no consumer set the field, so this
commit updates the runtime pin alone. api_signatures is regenerated, and so is docs/REFUSALS.md
(FramebufferFetch: 18 sites to 15).

Consumer check (consumer-uses.sh, consumer development b955213d27, 64 refs; on development 81bd82fdaa): extended_shadows,
ExtendedShadow, InputShadow, input_shadow: 0 hits (code).

Verified: nothing yet; the two fix-forward commits after this one make it build (60740, 60749),
and the check job of the series is named with the refusal commit.
2026-11-20 17:26:22 -08:00
Anees Iqbal b90e0565da The floor: from_queries refuses a push window below 256 bytes, the runtime's floor requires 8 fragment outputs, and runtime-floor replaces the profiles below it
What: Device::from_queries refuses a description whose maxPushConstantsSize is below the 256
bytes every stage's push window is lowered for, with a typed Unsupported{PushWindow} naming the
MaxPushConstantsSize limit (crates/metal2vulkan/src/device/derive.rs, the floor checks of
from_queries). The runtime's floor (metal2vulkan-runtime's floor list) requires
maxFragmentOutputAttachments >= 8. All 15 committed device profiles report 8, and so does every
matrix card.

The committed profile set keeps only devices at or above the floor:
- roadmap-2022 and lunarg-desktop-baseline-2023 are deleted;
- vk12-floor and swiftshader move to profiles/below-floor/, inputs of the from_queries refusal
  test only;
- runtime-floor, derived from the runtime's floor by scripts/regen-device-profiles and held
  equal to it by a test, is the floor every test compiles on.

A test of a below-floor form now runs on runtime-floor without the feature that form stands in
for, labelled "below the runtime's floor" (pipeline::testing::profile_without, PROFILE_F,
device_f, FORMATLESS_FLOOR). The validation tests name runtime-floor, or derive the device they
need from it (no tessellation, no formatless writes, robustImageAccess alone, no device
addresses).

Why: the runtime refuses every device below its floor, so translating for those profiles tested
forms no device the runtime opens can ask for. A push window below 256 bytes cannot hold what
the lowering puts there.

Consumer check: no public item of a published crate is deleted. The one removed constant,
FORMATLESS_FLOOR's old value, is in the crate-private pipeline::testing.

Not in this change, re-blessed on development: the golden hashes table
(tests::golden_hashes) and the public fixture expectations (tests::public_fixtures_engine). The
runtime-sources pin (candidate::engine::artifact) follows from the test run at this tree.

Verified: cargo fmt. The suites, clippy and the CPU-ICD run are potluck jobs on this tree, named
when the branch is handed over.
2026-11-20 16:35:52 -08:00
Anees Iqbal 75c9d080a3 YCbCr writes go: a function's writes to a 4:4:4 two-plane YCbCr texture are refused
Metal stores a function's writes to an unpacked 4:4:4 two-plane YCbCr texture into both its
planes. The translator held such a slot through an R32G32B32A32_UINT write shadow
(StorageImageClass::YCbCrWrite), and a heap's float storage class held such a member through an
R32G32B32A32_SFLOAT view of its shadow, flagged in its handle-table entry (FLAG_YCBCR_WRITES).
The consumer then encoded the shadow into the planes with bind::ycbcr_write_module. The same
module's second mode stored a render pass's YCbCr attachment (FormatEmulation::YCbCrRendered) into
the planes. metal2vulkan-runtime refuses every YCbCr texture (Gap::TextureFormat), so neither mode
ever ran, but every heap write of a float or half texel through a 2D handle carried the flag's
test and select under its own specialization constant.

Now a slot that writes such a texture keeps the format's refusal (storage_choice,
NotImplemented(Format)), as the other 4:4:4 formats' writes did, and a heap member of one has no
storage choice, so the heap refuses it (ArgumentBufferTextures, NotImplemented). A heap write no
longer tests the flag, and its handle-table search no longer carries it. FormatEmulation::
YCbCrRendered stays as the pipeline's form: a pipeline into such an attachment is made as before,
so no new pipeline-state refusal appears. Its doc now says the pass's store into the planes is not
implemented and that the runtime refuses such textures.

Removed:
- lowering: StorageImageClass::YCbCrWrite (slot.rs's write-only check, emit's ycbcr_write_texel
  and YCBCR_WRITE_WORDS), the heap mark (heap_ycbcr_mark, HEAP_YCBCR_WRITE_WORDS,
  Write::heap_ycbcr, lower::texture::heap_ycbcr_writes), AccessPlan::heap_ycbcr_writes, and the
  YCbCr element mask in heap_element_index.
- memory::handles: FLAG_YCBCR_WRITES, HANDLE_YCBCR_WRITES, Lookup's ycbcr field in Flagged and
  Indexed, carries_ycbcr, ycbcr_writes_spec, ycbcr_flag_mask, ycbcr_element_mask,
  ycbcr_writes_set, k32_const, and Table's stage (only the YCbCr carry read it). carry takes the
  form alone. The search tests lose the YCbCr forms and
  a_search_carries_the_ycbcr_flag_only_under_its_constant. The test tables keep an unused bit 15.
- pipeline: SpecKey::HeapYCbCrWrites; HeapStorageReads' doc loses the write shadow.
- binder: plan/resources' write-shadow choice, bind::heap's shadow view, its entry flag and the
  reads_unmeasured case, plan::slots::heap_ycbcr_writes and its two specialization arms (compute
  and graphics). bind::ycbcr_write goes whole: ycbcr_write_module, YCbCrWriteModule, and the CPU
  models ycbcr_write and ycbcr_store, along with their tests. bind::ycbcr_convert loses
  words_buffer and scalar, which only the write module used.
- metal::format: ycbcr_writes_stored. The YCbCr, YCbCrRendered, writes_dropped, ycbcr_renders
  and held_storage_choice docs say what holds now.
- tests: engine_heap_ycbcr_writes, engine_extended_range's
  ycbcr_write_slots_store_each_texel_s_bits_and_mark, and engine_handles' word allowance for the
  mark (100 words). owned_divisions loses the write module; api_surface loses five rows.

SEMANTICS_VERSION 2223 is in this commit (placeholder; main renumbers): every heap write of a
float or half texel through a 2D handle loses the mark's code, and the plans of such slots
change (a refusal). ARTIFACT_FORMAT_VERSION 566: SpecKey loses HeapYCbCrWrites in the codec.
RUNTIME_VERSION 2545: bind::heap's handle-table entry flags lose bit 15. The runtime pin is
updated. api_signatures is regenerated, and so is docs/REFUSALS.md (one site fewer for
ArgumentBufferTextures and one for Format).

Consumer check (consumer-uses.sh, consumer development 12b87d3d6b, 64 refs): YCbCrWriteModule,
ycbcr_store, ycbcr_write, ycbcr_write_module, HeapYCbCrWrites, YCbCrWrite, FLAG_YCBCR_WRITES,
WRITTEN_BINDING: 0 hits (code). ycbcr_writes_stored: 0 hits on development. It is used on 39
consumer lane branches (steelbrain/quiesce and others, the newest 17 hours old), in
crates/reims-vgpu-vulkan/src/gpu/ycbcr/sampling.rs:2527, a test of the old runtime's YCbCr write
path. That directory is not on the consumer's development.

Verified: nothing yet (a check job is owed).
2026-11-20 16:11:26 -08:00
Anees Iqbal f7279104ae Emulated meshes go: a device without VK_EXT_mesh_shader refuses mesh and object functions
The planner's ruling: a mesh render pipeline is native or refused. With VK_EXT_mesh_shader and
meshShader (taskShader for an object function), the stages are task and mesh shaders, as before.
The emulation was a second form for devices without them: the object and mesh functions ran as
compute entries, which wrote each threadgroup's vertices and primitives as records into a
per-draw buffer or the command buffer's records pool, and a synthesized vertex stage drew those
records. The runtime never takes that path. Now a mesh or object function on such a device is
refused at lowering (Unsupported{MeshShading}, needing VK_EXT_mesh_shader and the stage's feature
where the profile lacks them), and so is its pipeline. The command line compiles no mesh pipeline
and answers FALLBACK for a mesh or object function on every device, as before.

Removed:
- lowering: lower/mesh/work.rs (the work buffer layout), lower::mesh::emulates, the emulated
  compute entries and their wrappers, the record stores, Layout/layout/records/emulated_payload,
  the RECORDS/WORK/OBJECT_* slots; MeshPlan's emulated and payload_words. Also dispatch.rs's
  WrapperGroups and the wrapper_groups field, emit's GLCompute arm for meshes,
  stage_io::flat_primitive_inputs, and the requirement trace's record writes. The payload is
  always TaskPayloadWorkgroupEXT (memory::arena::declare_payload). lower::mesh::mesh_stages states
  the native test that folds_object_grids reads. The mesh builtins are a const.
- pipeline: MeshRecords, RecordField, RecordValue; GraphicsState::mesh_records and mesh_corners;
  StageInterface's mesh_records, mesh_corners and emulated_payload (vk_stage loses its COMPUTE
  arm); the synthesized vertex stage (link::mesh keeps the payload check) and link's record
  slots and push-range hull; SyntheticBinding::MeshRecords and MeshWork;
  RuntimeFact::MeshLastFirst; VariantKey::mesh_last_first. Varyings hold mesh outputs to
  maxMeshOutputComponents only. The link contract's compute-entry records check goes, and
  compile/api's mesh_info reads the task and mesh limits only.
- binder: bind/mesh_scan (mesh_scan_module, mesh_object_arguments_module, MeshScanModule; its
  div_ceil and for_range move to mesh_arguments, their one other reader), MeshDispatch,
  MeshGroups, MeshRecordsRegion, DrawCommands::mesh_dispatch, MeshTemplate::records and
  RecordsTemplate, GroupStage::Compute (GroupLimits.total is a plain u32), the emulated mesh
  stage flags, BindState and BindShape's mesh_last_first, WriteSource::MeshRecords and MeshWork,
  and DrawReplayRule::DispatchesFirst. Status: StatusBits::MESH_RECORDS_OVERFLOW,
  StatusReport::mesh_records_overflow, MeshRecordsFault, and the words MeshRecordsCursor and
  MeshFault{Draw,Objects,Groups}. The buffer keeps its 32 bytes, with SeqCstFences at word 7:
  words 3 to 6 are not written, and bit 5 is unreported.
- runtime: the synthesized-stage test no longer reads mesh_records; the SynthesizedStages doc
  loses "mesh records".
- tests: engine_mesh's emulated tests (the compute entries, the records pipeline and its object
  draws, the last-first variant) are replaced by two refusal tests, one per function and one per
  pipeline. The tests that also ran the emulating profiles run the profiles with the extension.
  engine_mesh_barriers loses its interpreter run of the emulated object entries; the
  round-trip, link and module-sweep fixtures and api_surface lose the rows.
- validation: build.rs's runtime inputs lose lower/mesh/work.rs; a companion test's comment.
  The 15 authored mesh and object cases stay untouched. The authored compile census is
  re-blessed on development.

Docs: API.md's mesh section states the refusal and loses the emulation's paragraphs, and two
lists lose "an emulated object or mesh function". Varyings docs lose a stale emulated
post-tessellation mention. docs/REFUSALS.md and api_signatures are regenerated. README and the
command's help name no mesh pipeline and need no change.

SEMANTICS_VERSION 2221 is in this commit (placeholder; main renumbers): what the translator emits
for a mesh or object function on a device without the extension changes (a refusal), and the
mesh draws' plans change. ARTIFACT_FORMAT_VERSION 565: the codec loses MeshRecords,
RecordField, RecordValue, StageInterface's three fields, GraphicsState's two, two
SyntheticBinding variants and RuntimeFact::MeshLastFirst. RUNTIME_VERSION stays at this series'
2543. The runtime pin is updated.

Consumer check (consumer-uses.sh, consumer development 12b87d3d6b, 70 refs):
MeshDispatch: 0 hits (code); link-order lists only.
MeshGroups, MeshRecordsRegion, mesh_scan_module, mesh_object_arguments_module, MeshScanModule,
MeshRecordsFault, mesh_dispatch, MESH_RECORDS_OVERFLOW, MeshRecordsCursor, MeshFaultDraw,
MeshFaultObjects, MeshFaultGroups, DispatchesFirst, mesh_last_first, MeshRecords, RecordValue,
mesh_records, mesh_corners, emulated_payload, MeshWork, MeshLastFirst, POOL_WORDS, DRAW_OFFSET,
DISPATCH_OFFSET: 0 hits (code).
mesh_records_overflow: 0 hits on development. It is used on consumer lane branches
(steelbrain/quiesce and others), but only as the name of a local function in
reims-vgpu-vulkan/src/gpu/command.rs, which answers the old runtime's
CommandBufferError::MeshRecordsOverflow. It does not read this field.

Verified: nothing yet (a check job is owed).
2026-11-20 15:28:31 -08:00
Anees Iqbal b14c6a7101 Emulated tessellation goes: a device without tessellationShader refuses the function
The runtime's floor requires tessellationShader, so on every device the runtime opens a
post-tessellation vertex function runs through the device's tessellation stages. The emulation
was a second form: it ran the function as a plain vertex stage that drew Metal's tessellator's
triangles itself, from the draw's records, which a compute scan wrote before each patch draw. Now a
device without tessellationShader refuses the function (Unsupported{Tessellation}, needing
VkFeature::TessellationShader), and the command line answers FALLBACK there.

Removed:
- lowering: lower/tessellation/{emulated,tessellator,work}.rs, wrap_entry, Emulation, emulates;
  EvalPlan's base_instance and emulated; Declared's emulated globals; the emulated
  [[base_instance]] source; PushField::TessellationChunk; stage_io::primitive_id_varying.
- pipeline: EmulatedTessellation, GraphicsState::emulated_tessellation, TessellationStage::emulated,
  LoweringInputs::tessellation (and InputsFrom::Vertex's tessellation field and its key bytes),
  link's emulated_state, RuntimeInput::TessellationDescriptor, SyntheticBinding::TessellationWork
  and TessellationRecords; primitive_id_carried_on is primitive_id_varying_on again.
- binder: bind/tessellation_scan (tessellation_scan_module, TessellationScanKernel,
  TessellationScanModule), TessellationDispatch, TessellationRecords,
  DrawCommands::tessellation_dispatch, WriteSource::TessellationWork and TessellationRecords,
  StatusBits::TESSELLATION_RECORDS_OVERFLOW and RECORDS_FAULTS, StatusReport's
  tessellation_records_overflow and TessellationRecordsFault. FactorTemplate keeps only the
  control stage: FactorSite goes, and its fields are push_offset and factor_binding, with the
  patch index binding always present. The mesh scan's first-fault test reads its own bit. Bit 8
  of the status word is unreported.
- tests: tests/tessellator (the emulated tessellator against its model), the emulated tests in
  engine_tessellation (now asserting the refusal on profiles without the feature), the emulated
  fixtures in api_tests and graphics tests, owned_divisions' scan sweep, and api_surface rows.
  The key test keeps its native half: a vertex function's key is the same for every
  tessellation state.
- validation: build.rs's runtime inputs lose tessellator.rs and work.rs (factors.rs stays: the
  binder sizes factor ranges by factor_bytes). The acceptance and coverage tests expect the typed
  refusal on roadmap-2022, vk12-floor and swiftshader.

Docs: README and the command's help say a post-tessellation function needs tessellationShader;
API.md's tessellation section states the refusal; the two tessellation precision notes no longer
mention the emulation; docs/REFUSALS.md and api_signatures regenerated (Tessellation now names
VkFeature::TessellationShader instead of MaxStorageBufferRange).

SEMANTICS_VERSION 2220 is in this commit (placeholder; main renumbers): what the translator emits
for a post-tessellation function on a device without tessellationShader changes (a refusal), and
the vertex key loses the tessellation state. ARTIFACT_FORMAT_VERSION 564: the codec loses
EmulatedTessellation, TessellationStage::emulated and three enum variants. RUNTIME_VERSION stays
at this series' 2543. The runtime pin is updated.

Consumer check (consumer-uses.sh):
consumer: development 7ea4edc2fb; 72 refs (development + steelbrain/* younger than a day)
TessellationDispatch: 0 hits (code); link-order lists only
TessellationRecords, TessellationRecordsFault, tessellation_scan_module, TessellationScanKernel,
TessellationScanModule, TESSELLATION_RECORDS_OVERFLOW, RECORDS_FAULTS, tessellation_dispatch,
TessellationWork, EmulatedTessellation, emulated_tessellation, TessellationChunk,
RuntimeInput::TessellationDescriptor, scan_kernel, max_patch_triangles, wrap_entry, FactorSite:
0 hits (code)
tessellation_records_overflow: 0 hits on development. It is USED on consumer lane branches
(steelbrain/quiesce and others), but only as the name of a local function in
reims-vgpu-vulkan/src/gpu/command.rs, which answers the old runtime's
CommandBufferError::TessellationRecordsOverflow. It does not read this field, and this tree's
runtime has no such error.

Verified: nothing yet (a compile job is owed).
2026-11-20 15:26:56 -08:00
Anees Iqbal 158d918e91 Flat dispatch goes: a flat or folded variant's indirect dispatch outside a device replay
flat_dispatch_module read an indirect Metal dispatch's arguments on the device and wrote the
record and VkDispatchIndirectCommand a flat (or folded) variant then ran at, for a dispatch
outside the device replay. The runtime never takes a binding plan, and no consumer records the
module. The plan now builds a flat variant's direct Threads dispatch alone (its record is
DispatchCommands::region_record, as before); its indirect dispatch, and any dispatch of a folded
variant, whose records only the device replay's preprocess writes, is
Unsupported{GpuEncodedIndirectCommands, NotImplemented}, already the answer for the variant's
other forms. The device replay keeps its flat and folded variants and flat_dispatch, the
derivation its preprocess shares.

Removed: bind/replay/flat.rs (flat_dispatch_module, FlatDispatchModule, FlatIndirect,
FlatArguments), its tests, and the folded variant's read_records in instantiate_dispatch_into;
the dispatch test now asserts the flat variant's indirect dispatch is refused; the replay
modules' overflow test reads the preprocess alone (its want of 26 already counted the shared
derivation's 23). Records' docs say what they hold now (the Binder doc lost its clamp too).

RUNTIME_VERSION stays at this series' 2543 (the plan's answers change); runtime-sources
re-pinned, api_signatures and REFUSALS.md regenerated.

Consumer check (consumer-uses.sh):
consumer: development 7ea4edc2fb; 68 refs (development + steelbrain/* younger than a day)
flat_dispatch_module: 0 hits (code)
FlatIndirect: 0 hits (code)
FlatArguments: 0 hits (code)
FlatDispatchModule: 0 hits (code)

Verified: nothing yet (compile check owed).
2026-11-20 15:15:26 -08:00
Anees Iqbal 53e1535ee3 Indirect clamp goes: an indirect dispatch reads Metal's group counts from its buffer
The runtime reads an indirect dispatch's group counts where Metal wrote them (its README:
a count above maxComputeWorkGroupCount is the GPU's to read, which Vulkan leaves undefined),
and its path never takes a binding plan's clamp prepass. The plan now does the same: an
indirect region reads IndirectArgs::Buffer on every device, its use is the 12 argument bytes
vkCmdDispatchIndirect reads in DRAW_INDIRECT, and IndirectGroupCount's mechanism is None.

Removed: bind/indirect_clamp.rs and its tests (IndirectClamp, IndirectClampModule,
indirect_clamp_module), DispatchCommands::indirect_clamp, IndirectArgs::ClampScratch, the
template's storage_alignment, Mechanism::IndirectClamp, StatusBits::OVERFLOW (bit 0 stays
unused) and StatusReport::overflow. The validation executors lose their clamp checks
(compute.rs, replay.rs, device_replay.rs), which valexec confirmed only refused the clamp, and
the engine's overflow verdict. The engine_binder harness runs an indirect dispatch from its
buffer at counts within the test device's limit.

ARTIFACT_FORMAT_VERSION 563 (Mechanism's codec list loses a variant), RUNTIME_VERSION 2543
(the dispatch plan's indirect region and uses change), runtime-sources re-pinned,
api_signatures and REFUSALS.md regenerated.

Consumer check (consumer-uses.sh):
consumer: development e6414dd601; 70 refs (development + steelbrain/* younger than a day)
IndirectClamp: 0 hits (code)
IndirectClampModule: 0 hits (code)
indirect_clamp_module: 0 hits (code)
ClampScratch: 0 hits (code)
indirect_clamp: 0 hits (code)
OVERFLOW: 0 hits (code)
StatusReport: 0 hits (code)
StatusBits: 0 hits (code)

SEMANTICS_VERSION 2219 is in this commit too: the artifact records IndirectGroupCount's mechanism,
which moves from IndirectClamp to None (the planner's rule: an emitting commit carries its own
bump); main renumbers it at the landing.

Verified: nothing yet (compile check owed).
2026-11-20 15:15:25 -08:00
Anees Iqbal 193a9a6e95 Builders, batch 3: the resolve draws, the visibility combine and the texture shadow's modules go
color_resolve.rs (color_resolve_modules and its format, channel, rule and source types),
depth_stencil_resolve.rs (depth_stencil_resolve_modules, DepthPick, ResolveWrite and the draw
types), visibility_combine.rs (visibility_combine_module, VisibilityCombine, ContinuedResult) and
the texture shadow's four files (shadow_merge_module, shadow_merge_image_module,
shadow_merge_kept_image_module, shadow_copy_back_module, shadow_copy_in_module and their
types): no non-test code outside them names any of their items (the runtime, the harness,
validation and conformance included; test items stripped one by one, wherever they lie), and no
plan, variant key or lowering input asks a consumer to run them. They go with their tests,
re-exports, api_surface rows and owned_divisions builds.

Metal's sRGB resolve tables (SRGB_RESOLVE_LINEAR, SRGB_RESOLVE_THRESHOLDS) move into the tile
test, their one reader, as private constants with their measured docs. depth_stencil_copy's
binding map loses the resolve draws' arm. bind's module map, metal/format/word.rs and the
msaa_word_formats probe's note no longer name the resolve. The runtime-sources table drops
lower/arith/extended_range.rs, which only the color resolve reached, and its SPIR-V builder row no
longer names the visibility resolve.

No run or translation changes (nothing called them): the versions stay; api_signatures,
REFUSALS.md and the runtime pin are regenerated.

Consumer check: ~/.cache/m2v-orch/consumer-uses.sh, consumer: development b7929d6936; 73 refs
(development + steelbrain/* younger than a day), 0 hits for color_resolve_modules
ColorResolveFormat ColorResolveModules ResolveChannel ResolveRule ResolveSource
SRGB_RESOLVE_LINEAR SRGB_RESOLVE_THRESHOLDS depth_stencil_resolve_modules DepthPick
DepthStencilResolveDraw DepthStencilResolveModules ResolveWrite visibility_combine_module
ContinuedResult VisibilityCombine VisibilityCombineModule shadow_copy_back_module
ShadowCopyBackModule ShadowTexelView shadow_copy_in_module ShadowCopyInModule
shadow_merge_module ShadowMergeModule ShadowMergeStores shadow_merge_image_module
shadow_merge_kept_image_module ShadowMergeImageModule ShadowMergeRead (ColorResolveFormat,
ResolveSource and DepthPick appear in link-order lists only).
2026-11-20 15:15:25 -08:00
Anees Iqbal 46cd581525 Builders, batch 1: thirteen bind files no code names go with their tests
dynamic_views, extended_canonical, extended_shadow, icb_reset, pages_copy, plane_bytes_copy,
plane_copy, plane_words, rotate_texels, rows_copy, tiled_texels, ycbcr_refresh and ycbcr_sample:
no non-test code outside each file names any of its public items (the runtime, the harness,
validation and conformance included), so each file goes whole, with its tests, its re-exports,
its api_surface rows and its owned_divisions builds. The docs that named them say what is true
now: bind's module map, the depth clamp's tiled-texel note, the written-flag docs (a consumer may
reset only the flagged records), the input shadow's runtime file, conformance's two-plane note.
The runtime-sources row of lower/arith/extended_range.rs names the color resolve, which still
reaches it, in place of the deleted half-shadow load.

No behaviour of a run or a translation changes (nothing called them), so neither
RUNTIME_VERSION nor SEMANTICS_VERSION moves; api_signatures, REFUSALS.md and the runtime pin are
regenerated.

Consumer check: ~/.cache/m2v-orch/consumer-uses.sh, consumer: development 62b3227c74; 67 refs
(development + steelbrain/* younger than a day), 0 hits for DynamicViewsModule
dynamic_views_module ExtendedShadowModule extended_shadow_module IcbResetModule icb_reset_module
PagesCopyModule PagesCopy pages_copy_module PlaneWordsModule plane_words_module
RotateTexelsModule rotate_texels_module RowsCopyModule rows_copy_module TiledTexelsModule
TiledLevelMove tiled_texels_module YCbCrRefreshModule ycbcr_refresh_module YCbCrSampleModule
ycbcr_sample_module; consumer: development 62b3227c74; 68 refs, 0 hits for
ExtendedCanonicalModule extended_canonical_module extended_range_canonical PlaneBytesCopyModule
plane_bytes_copy_module PlaneBytes PlaneSource PlaneCopyModule plane_copy_module. PlaneRows:
its hits are the consumer's own `struct PlaneRows` (reims-vgpu-video's vaapi/va/frame.rs:333,
re-exported from vaapi.rs), none of them ours.
2026-11-20 15:15:25 -08:00
Anees Iqbal 3653240b57 runtime: a point-size function's state is refused under the line and triangle class
Metal's pipeline creation fails for a vertex function that writes `[[point_size]]` under the line
or the triangle input primitive topology class ("Vertex shader writes point size but
inputPrimitiveTopology is MTLPrimitiveTopologyClassLine", measured on an M3 Max, macOS 27.0.1,
the conformance crate's topology_classes probe), and makes it under the point and the
unspecified class. The runtime made all four, so the round's
topology-class-point-size-function on the RX 7900 XTX recorded render-pipeline:line and
:triangle true where Metal recorded false, and drew lines and triangles Metal never drew
(drawn:, target:line and :triangle).

RenderCompiled::of now refuses such a state with the new
Refusal::PointSizeTopology { class }, read from the translator's graphics.writes_point_size and
the descriptor's class, before any Vulkan object is made. The descriptor key already covers the
class, so a cached content of another class never answers for it.

The ledger's row for the case's drawn:unspecified refusal ("a draw with Points is not built") is
stale: points are drawn now, and the round reports it no longer refuses. Dropped.

The runtime README's point bullet states the refusal and the 1.0 stored for a size not greater
than 0 (the previous point-size commit); docs/REFUSALS.md regenerated and the api_signatures
table blessed (one variant row).

Test: draw's every_device_refuses_a_point_size_function_under_the_line_and_triangle_class
(`draw_point_size_class`): rt6_point's state is refused with the class under Line and Triangle and
made under Unspecified and Point.
2026-11-20 14:38:09 -08:00
Anees Iqbal f473ccdb72 runtime: a pass resolves into a colour texture of any usage, as Metal does
Metal resolves into a texture of any usage. Probe resolve_texture_usage.m (M3 Max, macOS 27.0.1,
job m3-max-59768) showed this, and a guest's walk met it twice: a map view's 900x900 pass
resolves a 4-sample BGRA8Unorm_sRGB colour, beside a 4-sample Depth32Float_Stencil8 and with
every load Load, into a 1-sample BGRA8Unorm_sRGB Shared texture of ShaderRead usage. The runtime
refused that as RenderPassKind::ResolveUsage and skipped the pass, so the view missed its drawing.

Form A, as ruled: every one-sample colour texture (2D, 2D array or cube) whose image is optimal
now takes the colour attachment usage on every device where its format renders, whatever
Metal's usage. A pass resolves into it by Vulkan's own resolve, as into a render target.
- texture.rs plan() sets Plan::resolves for a one-sample colour texture of those types made
  without the attachment usage, where the format's features hold the attachment
  (plan.supported). The optimal image's format query runs with the usage. Where it refuses the
  image or the image does not fit the texture's samples, extent and layers, the image is made
  without the usage. Plan::image_usage gives image_info and the texture's Image the usage. Such
  a texture is no render target: it takes no feedback usage or shadow for attachment reads,
  and a pass that renders into it is still Refusal::AttachmentUsage.
- A linear image in place over a buffer (linear_usage, check_over, linear_layout, the plane
  checks) is unchanged. It takes no attachment usage for a resolve alone, so it stays in place
  and is never copied to gain one, and a resolve into it stays ResolveUsage. A texture over a
  buffer in its own optimal image (the counted copy) takes the usage like any optimal image, and
  the pass's write of it is copied back as a render target's is.
- pass.rs resolve() reads the image's own usage (TextureObject::resolve_attachment) in place of
  Metal's. ResolveUsage remains for an image with no attachment usage: a depth or stencil
  texture (macgaps measured no depth format), a colour texture of another type or of a format
  the device's optimal image does not render, and a linear image in place.

Memory: macgaps' table (jobs m3-max-59774, m3-max-59775, m3-max-59776) shows the worst pair on
the Radeon 780M (RADV): a 1920x1080 one-level RGBA8Unorm image grows from 8,847,360 to 8,896,512
bytes (1.0056). On the RX 550 the same image reaches 8,882,200. The Iris Xe, RTX 3090, llvmpipe
and KosmicKrisp show no growth.

Docs: RenderPassKind::ResolveUsage, resolve_texture's doc and the runtime README's resolve
paragraph and known gap say what is true now. docs/REFUSALS.md regenerated (the attachment
view's function is now attachment_view). No public signature moved.

Tests (lavapipe): every_device_resolves_into_a_texture_of_shader_read_usage is the probe's case.
A 4-sample BGRA8Unorm_sRGB attachment cleared to (0.25, 0.5, 0.75, 1) is resolved into a
1-sample Shared texture of ShaderRead usage, and of ShaderRead | ShaderWrite. The image has the
attachment usage, Metrics::resolves rises by one, and every texel reads the clear colour within
one code. A depth resolve into a ShaderRead Depth32Float texture is ResolveUsage. A ShaderRead
texture over a Shared buffer in place has no attachment usage, and a resolve into it is
ResolveUsage. every_device_resolves_a_loaded_pass_beside_depth_and_stencil_into_a_shader_read_texture
is the walk's shape: 900x900, colour beside a 4-sample Depth32Float_Stencil8, every load Load,
resolving what an earlier pass cleared. The old check that ShaderRead and ShaderRead |
ShaderWrite resolves are ResolveUsage is gone, since both now resolve.
2026-11-20 13:42:24 -08:00
Anees Iqbal 569b32b49a RuntimeDriverDefect goes: an identity-keyed table no runtime code reads
The enum listed 33 defects of named drivers in commands a runtime records, keyed on the driver's
identity and release (rule 2). The runtime constructs none and reads none: no crate of ours, and
none of reims's, names a variant. With it go Needs::RuntimeDriverDefect,
Unsupported::runtime_driver_defect, validation's UnsupportedReason::DriverDefect ("driver_defect"
keys; the stale census rows that carry one go at the next re-bless), the conformance verdict's
device-gap arm, the error and engine key tests' entries, the API guide's Needs entry and the
refusal surface script's constructor.

Since nothing reads a variant, no ladder rung follows from one: no site becomes a precision note or
a typed gap. The four docs that cited a variant now state what Vulkan or the module does without
it: the depth/stencil copy modules (maintenance8's copies), the generated-commands replay (the
explicit preprocess form, which the runtime does not take), the validation executor's set-layout
query note (MoltenVK's understated answer), the pipeline-cache probe's comments (MoltenVK compiles
a seeded cache's shaders at load), and SeparateMultisampledDepthStencil's refusal (maintenance8
alone).

NativeHalfConversion's bound adds NVIDIA 620.70.06's measurement on the RTX 3090: the pair is
dropped under the 16-bit RTE, DenormPreserve and SignedZeroInfNanPreserve too, every float that is
no half coming back unchanged over all 2^32 inputs. The bound already covered no rounding at all.

REFUSALS.md and api_signatures.tsv regenerated.

Verified: nothing yet; the gate follows.
2026-11-20 13:39:49 -08:00
Anees Iqbal 82abe62334 Fix forward: the API signature table and REFUSALS.md at the dead-variant batch's landing over the orphans
The dead-variant batch (cutxlate-dw) and the translator orphans (cutcheck) deleted items on both
sides: the orphans removed CompensatedViewport, is_permanent_for and the ViewportCompensation
path; the batch removed the offset-0 class (ZERO_OFFSET_CLASS, ZERO_OFFSET_TOLD,
storage_view_buffers), Needs::DriverDefect and the dead DriverWorkaround variants. The landing's
rebase kept both deletions, so the generated tables are regenerated from the merged sources:
scripts/api-signatures/signatures.py --bless and scripts/refusal-surface/refusal_surface.py.

Verified: both scripts ran on the merged tree; the table holds no ZERO_OFFSET row.
2026-11-20 11:59:14 -08:00
Anees Iqbal 8252854871 SEMANTICS 2208 for the dead driver variants; the runtime pin, REFUSALS.md and api_signatures follow
SEMANTICS_VERSION 2208: the batch changes what a module holds on devices that took the deleted
variants (the clipping notes and the denormals note on every device, one serializer form, a
constant slot's storage view, the half rounding bound) and no longer defers discards or guards
helper branches anywhere.

runtime-sources.sha256 moves without a RUNTIME_VERSION bump: the binder's edits in the batch drop
forms no plan reaches (the uniform texel view's class, the offset-0 class no consumer set, the
mesh limit's always-zero staged bytes), so it binds every plan it can be handed as before.

REFUSALS.md and api_signatures.tsv are regenerated (signatures.py --bless, refusal_surface.py).

Verified: nothing yet; the gate follows.
2026-11-20 11:58:40 -08:00
Anees Iqbal 912bf785ce Simdgroups: the vertex grouping note goes, with its fact's reader
The planner's ruling: no VertexSimdgroupGrouping. lower/simd recorded it for a vertex function's
simdgroup or quad operation where the stage takes no required subgroup size and the profile
carried DriverWorkaround::VertexGroupingNotApples (ANV's 8-vertex interleaved subgroups); no
profile carries that variant since the fact tables went, so it was recorded nowhere. The note,
its reader (regroups_vertices), its codec tag, its conformance degradation and code, its
validation allowance, deferral and bound text, API.md's catalogue entry and the engine_simd and
c3 tests that named it go.

The public surface moves with this commit and the batch's earlier ones: the api_signatures table
(regenerated by signatures.py) drops PrecisionNote::VertexSimdgroupGrouping (the translator's
and the runtime's re-export), Feature::PixelCoverage and Feature::CentroidVarying (link's split
refusal), and DescriptorView::UniformTexel (the views' rung 1); REFUSALS.md (regenerated) drops
the two features, and the reach table their rows.
2026-11-20 11:56:55 -08:00
Anees Iqbal 4bc57a20e3 WIP orphans: ResidentPart, the harness's simdgroups assert, and the docs that named deleted items 2026-11-20 11:54:24 -08:00
Anees Iqbal 92ce7950fc Docs: "the runtime", not "the new runtime"
There is one runtime, so the prose of the harness, validation, devtools,
the translator's lockstep module, .config/nextest.toml and the refusal
surface and conformance coverage generators says "the runtime"
(scratch newrt.py: a word replacement, identifiers such as new_runtime
and NewRuntime untouched). docs/REFUSALS.md and
docs/CONFORMANCE-COVERAGE.md are regenerated from the edited scripts.

Four harness passages said the runtime makes no heap and no texture
over a buffer, and has no Managed mode. The runtime has all three
(Device::new_heap_buffer and heap textures, Buffer::new_texture,
Device::new_managed_buffer); the harness's own backend refuses the two
texture sources. They now say the harness makes neither on the runtime,
and the Managed note names Device::new_managed_buffer. The refusal
strings keep the words the harness's described test matches ("makes no
heap", "makes no texture over a buffer").

Left: three fixture comments (.metal under validation's public
fixtures, whose text keys the golden tables and the committed AIR) and
scripts/matrix, whose keys (harness-new) carry the same naming.

Verified locally: the refusal surface, Metal coverage, conformance
coverage and API signature checks pass.
2026-11-20 11:52:56 -08:00
Anees Iqbal c48ad2340c rt: a copy within one subresource of one image: regions apart in GENERAL, the same region none
A guest's Mac walk (58383, then m3-max-59593) met Gap::TextureCopy 1,904 times, two RGBA8Unorm
256x256 2D textures, 29x1x1 texels at level 0 and slice 0. On KosmicKrisp every RGBA8Unorm
texture is R8G8B8A8_UNORM (its optimal tiling has every feature form() asks), so the format
condition cannot fire there; the one left is one subresource of one image: a texture view shares
its parent's image and id, so a copy between a texture and its view, or two views of one
texture, at one level and slice was refused, as a texture into itself was.

- blit: within one level and slice of one image, regions apart copy with one vkCmdCopyImage, the
  subresource in GENERAL (VUID-vkCmdCopyImage-srcImage-09460, -pRegions-00124): one barrier
  moves it there and one home, three barriers as any copy. The same region copies nothing and
  records no command, every texel already its own. Overlapping regions, which Metal leaves
  undefined (Apple's copy(from:sourceSlice:...) page: "Copying data to overlapping regions
  within the same texture may result in unexpected behavior."), stay Gap::TextureCopy.
- texture: a copy's barrier home from GENERAL makes its writes available.
- Gap::TextureCopy's doc and basis, docs/REFUSALS.md, the runtime README and the
  copy_from_texture doc say so.
- tests (blit): the rules (two slices, regions apart along each axis, the same region, three
  overlaps); on every device, a texture's region into another of its level and slice, from its
  view and from itself, lands exactly, everything around kept, one submission and three
  barriers; the same region records nothing and keeps every byte; overlapping regions are the
  gap.
2026-11-20 11:13:47 -08:00
Anees Iqbal e15d067fe0 rt: a texture view the image's own Vulkan format holds is made without PixelFormatView usage
A guest's Mac walk (58383) met Refusal::TextureViewFormat once: an A8Unorm view of an R8Unorm
texture made without PixelFormatView usage. Metal's validation layer stops such a view ("texture
usage (0x01) doesn't specify MTLTextureUsagePixelFormatView (0x10)"), and plain Metal makes it,
a blit out of it reading the texture's bytes (probe texture_view_rules.m, an Apple M3 Max under
macOS 27.0.1, jobs m3-max-43677 and m3-max-59523: R32Uint, RGBA8Uint, BGRA8Unorm and
BGRA8Unorm_sRGB of RGBA8Unorm; A8Unorm, R8Snorm and R8Uint of R8Unorm; R16Unorm of RG8Unorm).

- texture: without PixelFormatView usage, a view of a format Metal views the texture as with
  that usage (views_with_usage) is made where the view's Vulkan format is the image's own and only
  its component mapping differs, as plain Metal makes it: A8Unorm over R8Unorm is R8_UNORM with
  red read as alpha on every device (rt never exposes A8_UNORM). A view that needs another Vulkan
  format stays Refusal::TextureViewFormat: making every image mutable for it would cost every
  texture (rule 3).
- error: TextureViewFormat's doc and basis say so, with the probe's pairs; docs/REFUSALS.md
  regenerated. The runtime README records the divergence from Metal's validation in one sentence,
  of the form of the scissor and tessellation-factor-offset precedents.
- tests (view): on every device, an A8Unorm view of an R8Unorm texture of ShaderRead usage
  alone is made, and a draw sampling it (sampled_fragment into RGBA8Unorm) reads each texel's red
  byte as alpha, (0, 0, 0, r), exactly; an R8Uint view of it, another Vulkan format, is still
  refused, as is the R32Uint view of RGBA8Unorm without the flag. draw's CONSTEXPR is shared.
2026-11-20 11:12:35 -08:00
Anees Iqbal b975f6ddf7 rt: draws of points, through a point-class pipeline, with largePoints on the floor
A draw of points was Gap::Draw (DrawKind::Points) on every device; a guest's Mac walk met it
324 times. It now draws.

- render: a content keeps a point-class VkPipeline beside its line-class one, made with the
  state where the descriptor names the point class (inputPrimitiveTopology), else at the first
  draw of points, a first-use wait (Metrics::first_use_point_waits, FirstUse::Points). The
  vertex module writes PointSize (the function's [[point_size]], at most Metal's 511, or 1.0).
- render_encoder: Metal rasterizes a point of a function without [[point_size]] only under the
  point class; under another it rasterizes nothing and runs the vertex function, so such a draw
  records an empty scissor and the next draw the encoder's again. Points take no depth bias, as
  lines do not.
- floor: largePoints is required, so a written size draws (without it a device draws only 1.0).
  rt's floor is Vulkan 1.3; Vulkan 1.4 lists largePoints among the features it requires
  (vkspec 1.4.366, 55.1 Feature Requirements) and the committed roadmap-2022 profile holds it.
  Every card we run reports it, from vulkaninfo today (device, job, pointSizeRange):
  KosmicKrisp 26.3.1 on the M3 Max m3-max-59492 [1, 511]; RX 550 RADV POLARIS12 59525 [0, 8191.88];
  780M RADV PHOENIX 59525, 59527, 59528 [0, 8191.88]; RX 7900 XTX RADV NAVI31 59527 [0, 8191.88];
  RTX 2080 NVIDIA 620.70.06 59527 [1, 2047.94]; RTX 3090 NVIDIA 620.70.06 59528, 59526
  [1, 2047.94]; Iris Xe RPL-P ANV 59526 [0.125, 255.875]; RTX 5080 Laptop NVIDIA 615.71.09 59529
  [1, 2047.94]; UHD 630 Intel's Windows driver 59532 [0.125, 255.875]; lavapipe 59525..59529
  [0, 256]. The README's floor list says so.
- DrawKind::Points is deleted; docs/REFUSALS.md and the API signature table regenerated.
- tests: on every device, points of [[point_size]] 4 cover their 4 by 4 pixels, the point
  pipeline made once at the first draw of points; a point-class state makes it with the state
  and draws a function without a size 1 pixel wide; under no class such points rasterize
  nothing and a triangle after them draws; a vertex function that stores runs for a draw of
  points as for triangles; floor: largePoints missing is named. The replay player's draw of
  points plays.
2026-11-20 11:12:35 -08:00
Anees Iqbal be2c5d567e Fragment: the multisampled in-shader depth test is one typed gap on every device, Feature::MultisampledShaderDepthTest
The planner's ruling. A fragment function that runs its draw's depth test itself at more than one
sample, without returning its depth, needs each sample's depth. The two forms that gave it were
keyed on measured facts (VkProperty::SampleFragCoordDepth on RADV, CenterFragCoordDepth on
MoltenVK) that no query produces, so development already refused it on every device, as
Unsupported(FramebufferFetch, NotImplemented) at the depth attachment, which a play cannot count
apart from framebuffer fetch's own refusals. It is now its own kind.

- error/mod.rs: Feature::MultisampledShaderDepthTest.
- lower/fragment/depth_test.rs: depth_test_form refuses with it; the module docs say why.
- docs/REFUSALS.md regenerated with its reach row (--check passes); api_signatures.tsv blessed
  (it also takes the extrapolation commit's removal of DriverWorkaround::PerspectiveReadsExtrapolated).
- Tests: engine_fragment's per-sample depth and stencil-before-depth refusals, and
  engine_fragment_imageblock's multisampled tested write, assert the new kind at the depth
  attachment.

The forms keyed on the two never-produced properties, and the window-depth varying that feeds the
computed one, go with the other never-produced vocabulary.
2026-11-20 10:36:12 -08:00
Anees Iqbal 56d93ffbc7 Validation: a texture buffer an argument buffer holds stops only the candidate (texture_buffer_member)
The authoring-capability census counted six rows under texture_buffer_literal, a requirement in
the authoring set, so it stopped the Metal oracle as well as the candidate. The schema does
express these texture buffers: an argument-buffer texture or a texture-array element takes
`texture_type: buffer`, and the oracle makes one through make_texture (a
MTLTextureTypeTextureBuffer view of its bytes) and binds it with setTexture:atIndex:. The oracle
stop was stale tooling.

The candidate's stop is the product's limit. The binder's planned heap makes no texture buffer a
member, so a handle naming one misses, and the runtime makes no texture buffer at all
(Gap::TextureBuffer).

What changes:
- The requirement is renamed texture_buffer_member and stops engine_candidate only.
- It qualifies on Metal, as mesh_render_pipeline does: the checker admits its cases with Metal
  alone, and the candidate refuses them, typed.
- The analyzer version is now structural-triage-v84, because classification output changes.
- The runtime's TextureBuffer basis, and the README's mesh known gap, now say that no replay stream
  or live session has used either, and that harvested guest functions declare them. REFUSALS.md
  is regenerated.

Both families stay unresolved in the census. The candidate cannot run them, and each is a tooling
gap (Limit::Tooling).

Verified: the build, clippy and the tests run in the jobs the landing note names.
2026-11-20 10:33:28 -08:00
Anees Iqbal f3b9e0253a Pull-model interpolation: a sample or offset read where the quad may have left is one typed gap on every device
The planner's ruling. interpolant_reads refused a read at a sample or an offset outside the
fragment function's first block, or after a discard in it, only on a driver with
DriverWorkaround::InterpolationNeedsTheWholeQuad, which nothing sets since the driver-fact tables
went: development lowered the shape on every device, RADV included, whose InterpolateAtSample and
InterpolateAtOffset read garbage where the quad's other invocations have left.

- lower/stage_io/plan.rs: the structural test stays as it was (Sample or Offset, past the first
  block or after a discard in it) and refuses on every device, as its own kind:
  Unsupported::not_implemented(Feature::DivergentInterpolation), so a play counts it apart from
  PullModelInterpolation's select, phi and store refusals.
- error/mod.rs: Feature::DivergentInterpolation; PullModelInterpolation's doc points at it.
- device/profile.rs: DriverWorkaround::InterpolationNeedsTheWholeQuad deleted.
- The coverage loop's rung-1 form, beside it: lower/fragment/coverage.rs read the fact nothing
  set, so development read a looping function's sample-qualified varyings inside the loop on
  every device, where the helper invocations of a partly covered quad have left. The entry now
  reads each such varying at every sample a pipeline of the device may have before the loop, on
  every device (samples_before_loop, stage_io::read_at_every_sample).
- SEMANTICS_VERSION 2205.
- docs/REFUSALS.md regenerated (scripts/refusal-surface, with the new reach row); --check passes.
- Tests:
  - rt's every_device_refuses_interpolation_where_the_quad_may_have_left (lavapipe): a sample
    read in a branch, an offset read in a branch and reads after a discard in the first block
    are refused, Unsupported(DivergentInterpolation), NotImplemented; the same reads in the first
    block, and before a later discard, are made and draw the colour.
  - engine_pull_model: pm_offset_after_discard (reads past the first block) is refused on every
    committed profile at 1 and 4 samples, before what its reads need is asked.
  - engine_coverage_loop: a looping function's sample-qualified varying is read at every sample
    by constant index from 0, a power of two of them and at least the pipeline's samples, and at
    no computed sample.
2026-11-20 09:53:17 -08:00
Anees Iqbal 9a1c8fe6dc metal2vulkan-rt takes the runtime's name: metal2vulkan-runtime, published
The cutover's last mechanical step. The old runtime is deleted, so its name is free: the crate
moves to crates/metal2vulkan-runtime, its package is metal2vulkan-runtime and its library
metal2vulkan_runtime, and every reference in the tree follows (sources, tests, scripts, CI,
generated tables and docs).

It is now a published crate, as AGENTS.md said it would be once it took the name: version 0.2.0
with the other two, the translator pinned exactly (=0.2.0, as the translator pins the AIR front
end), documentation, keywords and categories, and copies of the repository's four license files,
which the published-crates test now holds equal to the root's for three crates. CI packages it
with the others. Prose that said it was unpublished, or counted two published crates, says three.

AGENTS.md: facts only. The crate table row, the published-crates and version sentences, and the
paragraph on the old runtime, whose name the runtime now carries (listed for the owner).

Made by one script run on this tip. Verified by the job
named in the landing note.
2026-11-20 09:10:02 -08:00
Anees Iqbal 97b5c1b65b Translator cutover: SEMANTICS_VERSION 2202; the API signature table and REFUSALS.md regenerated
The profile and the lowering of every device made through the removed constructor change, and
the removed switches' outputs go: the version bump misses every cached artifact. The signature
table drops the removed public items (blessed by scripts/api-signatures/signatures.py, source
only); REFUSALS.md loses the stage bound's defect site and the absent read's device refusal.
2026-11-20 09:08:21 -08:00
Anees Iqbal 98895eb6d2 rt: Gap::KernelInput names what the kernel reads, a KernelInputKind
A guest boot (arm64 macOS 15) met one Gap::KernelInput refusal at
newComputePipelineStateWithDescriptor:options:reflection:error:. The refusal said no more than
"the kernel reads an input the compute encoder does not supply yet", so it could not be ranked
by its cause.

Gap::KernelInput is now KernelInput { kind: KernelInputKind }. Its text ends with the kind, and
the kind is decided at the site that finds it:
- interface()'s six checks of the translator's pipeline: PointerTranslation,
  HandleTranslation, CommandBuffers, StageIn, DescriptorSet (a set that is not the device's),
  StageFlags (flags other than full or varying subgroups);
- its later checks: RuntimeFact (a fact the encoder does not name), Slot, PushField,
  ConstexprSampler, ArgumentBlock, PushBytes, Specialization, Workgroup;
- Kernel::new's entry point with a NUL byte: EntryPoint.
A variant that samples a constexpr sampler its module does not, and a constexpr use whose
sampler the translator cannot state, are ConstexprSampler.

interface() returns the kind itself, and Kernel::new returns an Unmade (the kind, or
vkCreateShaderModule's result). So a variant's lowering keeps the kind in
Lowered::Unsupplied(kind), and nothing has to tell a module's failure from a refusal by a
wildcard. Each variant's doc comment names its Metal counterpart.

docs/REFUSALS.md is regenerated and api_signatures.tsv is blessed. Its one changed line is
Gap::KernelInput, now a struct variant: a breaking change to rt's public surface, which is
meant.
2026-11-20 08:47:42 -08:00
Anees Iqbal b50bf56b3e rt and the translator's prose name no deleted crate; REFUSALS regenerated
- rt's error.rs: three Basis citations named the deleted runtime's view plan, mipmap plan and
  RenderPassProblem; each keeps its Metal evidence without them. docs/REFUSALS.md regenerated.
- rt's submit.rs: the group bounds' docs drop "the old runtime's bound".
- rt's alpha-test module doc cites its 413 probed rows without the deleted lane's test name.
- rt's Cargo.toml comment and README line 3: unpublished until it takes the name
  metal2vulkan-runtime.
- The translator: repro.rs and the cli test say a runtime writes repro bundles through
  `metal2vulkan::repro`; build.rs names a runtime's shader cache; api_surface.rs says
  `api_signatures` pins metal2vulkan-air and metal2vulkan-rt (its table is unchanged: no public
  item moved).

Verified: the compile job is named in the hand-off.
2026-11-20 07:58:57 -08:00
Anees Iqbal 5d725aeec7 Delete metal2vulkan-runtime, with every test and script that read it
The cutover deletes the old runtime: crates/metal2vulkan-runtime and its workspace member go.
Nothing in the workspace depends on it any more: the harness and conformance lost their old arms,
and validation dropped its dependency in its own commit.

Adapted in this commit, so no gate reads the deleted tree:
- CI and scripts/linux-gate-ci: the crate's per-feature clippy group, its `-p` in the Windows
  clippy and the test step, and its private-doc-links row go. Packaging needs no edit: the
  workspace's published crates are now metal2vulkan and metal2vulkan-air.
- The published-crates test lists those two; devtools' carried trees and the five nextest groups
  of the old crate's tests go.
- scripts/api-signatures: the crate leaves CRATES, FLOORS and the header, its self-test trees name
  rt (read by the same rules), and the table is re-blessed (the old crate's 4555 rows go);
  api_signatures.rs pins the three crates left.
- scripts/refusal-surface: the old crate's tree and its sections go (RuntimeGap, AppleOnly,
  Problem and the problem enums it forwards to), with their 87 reach rows, the `--delegations`
  verb and the test that counted the old Problem's delegations; docs/REFUSALS.md is regenerated.
  The basis check now holds rt's refusal enums alone, which it already required.
- scripts/api-cost-coverage goes: it measured only the old crate's surface.
- feature_vocabulary.rs: the old crate's two enable tables go; the Khronos and validation tables
  stay held to the vocabulary.
- The conformance coverage generator's by-hand roots read rt instead of the old crate, and
  docs/CONFORMANCE-COVERAGE.md is regenerated (MTLResourceOptions' row, which only the old crate
  modelled, gives way to rt's MTLCommandBufferError).
- scripts/matrix: the harness times the new runtime alone (`--runtime new`), so the rules that
  judged it against the old one go: the new-over-old budget with its floors (floors.tsv,
  gpu-floors.tsv), ceilings, card variance and status table (status.tsv), the frozen arm, the
  base spread and the timing once more it set off, the re-timed pairs, the five creation rounds
  and the old runtime's parked tests and records. A harness row's time is judged as a cross-GPU
  outlier, with its alone runs as before, and the frame and burst rows by their stored
  instruction counts; the creation rows run once, in their own process. docs/VALIDATION.md's
  matrix section says these rules.

Checked locally (python, no build): signatures.py --check and --selftest, refusal_surface.py
--check, --selftest and --missing-basis, coverage.py --check and --selftest, and scripts/matrix's
49 tests pass. The compile gate (fmt, clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, Windows
clippy for gnullvm and msvc, workspace Rustdoc, packaging, the touched crates' suites on the host
and on lavapipe) runs on this sha as potluck jobs that the landing note names.
2026-11-20 07:01:01 -08:00
Anees Iqbal 779eb522b4 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 06:59:54 -08:00
Anees Iqbal 6833eba8e2 identity domains: a 2D bicubic sample reads its slot's format treatment from a pushed word
Under the identity domains (Device::from_queries, the new runtime's translator device) every
kernel that sampled a texture through a bicubic constexpr sampler was refused as
Unsupported{IdentityDomains} ("a bicubic filter"), because the filter's treatment of the bound
format (its inner taps, its clamp and its border texels) was a SpecKey::BicubicTexels
specialization the old binder sets from the bound texture. One compute pipeline of every macOS
guest boot met that refusal; the old runtime builds it.

The treatment is now one u32 field per bicubic slot, PushField::BicubicTexels(SlotRef), placed
and filled as TextureIntegerChannels is. The 2D routine already took the bits as a run-time value
(Bits::Value), so a sample reads the field instead of the constant; no per-format pipeline, no
new descriptor. metal::format::bicubic_texels_word(pf, swizzle) gives the word the binder
specializes the constant to (BICUBIC_TEXELS_UNBOUND for a slot bound to nothing), and None for a
format of no measured family or of 8-bit sRGB codes. rt fills the field from the bound texture
when the slot's texture changes, and refuses a dispatch whose bicubic slot holds a texture with no
word as Gap::BicubicTexels, naming the slot and the pixel format. The static precision note
BicubicFilterArithmetic stays.

Still refused under the identity domains, each the refusal it was: a bicubic sample of a 1D
texture or at pixel coordinates (and the in-place two-plane routine), an argument buffer's
texture, an array of samplers. The default domains (Device::new, the frozen old runtime's path)
are unchanged: they still specialize SpecKey::BicubicTexels and state RuntimeFact::BicubicTexels,
and the binders refuse the new field.

SEMANTICS_VERSION 2199 -> 2200, ARTIFACT_FORMAT_VERSION 554 -> 555 (a new push field tag).
docs/REFUSALS.md regenerated; api_signatures table blessed; docs/API.md and the rt README's known
gaps say what is lowered and what is refused.

Tests:
- engine_identity::a_bicubic_kernel_reads_each_slots_format_treatment_from_its_pushed_field
  (replaces the refusal test; fails without the change): bcu_formats on lavapipe and moltenvk-m3
  profiles under the default domains keeps its 10 facts and 10 spec keys and no push field; under
  the identity domains it compiles, passes L3, pushes the 10 slots' fields, declares no spec key
  and no fact, and keeps the precision note; bcu_forms (1D) and bcu_address (pixel) still compile
  on the default domains and are refused under the identity domains.
- rt tests::bicubic (device cfg): each format bound at every slot of bcu_formats pushes its word,
  its arm asserted per format (R32Float linear; RGBA8Unorm, RGBA16Unorm, R8Unorm the [0, 1] clamp;
  RGBA8Snorm the [-1, 1] clamp; RGBA16Float no clamp), an unbound slot the unbound word, and an
  RGBA8Unorm_sRGB texture at slot 3 is Gap::BicubicTexels naming slot 3 and the format.
2026-11-20 02:55:02 -08:00
Anees Iqbal b506518794 rt: prepare_dispatch's tests, README and surface; the player's read-ahead encoder a struct
Tests: the pre-pass grid against each call's own (a saturated dispatchThreadgroups axis, a
dispatchThreads grid of u32::MAX on a size that does not divide it, indirect), GPU-free; on a
device, prepare-then-dispatch of an observing kernel for each kind, each call making exactly one
pipeline (and the ragged grid its one lowering) and the dispatch then waiting for nothing; a
second call making nothing; what the dispatch records nothing for or refuses making nothing; the
emulated-SIMD-group variant prepared; a square-form grid eight deep prepared; and the same
counts recorded and submitted with the calls and without, on two devices.

README: the hook in the compute pipeline states section, and the translation bound the caller's
width multiplies. api_signatures blessed; REFUSALS.md regenerated (the refusal sites moved into
the shared helpers, no new refusal).

Verified: the check job that follows this commit.
2026-11-20 02:44:56 -08:00
Anees Iqbal e4de7cc44e rt: undo the per-slot refill and the changed-words push; a draw and a dispatch refill every slot again
What. Reverts the refill series (68740984ba, 5b164777bd, 71ef1ba14b and its tests b97d37c104,
c076e8d17b, cd134b0995) on development, keeping everything landed since. A render or compute bind
marks the encoder changed again, and the next draw or dispatch finds and fills every slot's facts
and fields and writes every spilled block into the ring, as at f44fb795ae. A draw or a dispatch
whose push bytes the command buffer already holds pushes nothing; any other pushes the whole
window. Rebound, the per-slot facts, Pushed's span and mark, Metrics::push_bytes and
tests/refill.rs go; the push and push-window tests of f44fb795ae come back. rtover's over check
stays as it landed: the texture setters keep their over count (Tables::set_texture, the compute
encoder's `copied`), and the draw keeps Overs' reached form. docs/REFUSALS.md re-derived: the
refusal sites move back from `refilled` and `find` to `dispatch`.

Why. The planner's bar for the series, as amended: instructions a draw and a bind at or below
f44fb795ae's for the refill's own share. If the bar fails, the bookkeeping is undone, and the
push of changed words stays only if it alone meets the bar. Neither does. Harness, own user
instructions, 780M (um870, one round, m3-max-57484; the exclusive rounds m3-max-57397 on gem10
and m3-max-57398 on the 3090 read the same):

  arm                                      a draw   a bind
  f44fb795ae (the bar)                        842      739
  92b9cbb232 (the series alone on it)         963      874
  7096fa7de3 (development)                    958      887
  3cc134e439 (the series' fix)                943      835
  24dd31af87 (this undo, on 3cc134e439)       836      751
  05cca3d165 (the undo + changed words)       887      770

The series alone adds 14.3% a draw and 18.3% a bind. Its fix still left 11.9% and 13.0%. The
push of changed words on its own adds 5.3% a draw: comparing the window word by word costs more
than the whole-window compare it replaces. The undo is 0.7% under the bar a draw and 1.6% over it
a bind; the commits besides the series account for the +12 a bind (rtover's over count in
set_texture; bind_2000 sets a fragment texture before every draw). At the fix, bind_2000 was
18.7% slower on the 780M and 15.6% slower on the 3090. The gain the form was ordered for did not
come: on the video stream (vaapi-780m, lavapipe, m3-max-57454 and m3-max-57460), fields filled a
bind fell from 1.42 to 1.22, but the bind redo (fill_push, Facts::find and the held block) rose
from 901 to 1,079 instructions a draw.

Verified: the table above (m3-max-57484: each arm one harness process on a fresh cache, release).
24dd31af87 is this commit's rt, translator and validation tree but for dfb00c74c6's import test.
cargo fmt; the refusal surface regenerated with scripts/refusal-surface/refusal_surface.py.
2026-11-20 01:13:26 -08:00
Anees Iqbal f631d9081d Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 00:05:53 -08:00
Anees Iqbal bda9935e09 rt: VK_NV_linear_color_attachment where listed; a plane renders through its bit only as a LINEAR image, marked, in a pass of such planes alone
The RTX 3090 and the RTX 5080 Laptop GPU (NVIDIA 620.70.06) give every plane format's linear
tiling, and its DRM_FORMAT_MOD_LINEAR modifier where listed,
VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV in place of the colour attachment feature.
Query::plane asked the image format query alone, which offers the colour attachment usage there,
so rt rendered NVIDIA's in-place planes through that bit with the extension off.

- Floor: VK_NV_linear_color_attachment joins OPTIONAL_EXTENSIONS (enabled where listed), and its
  linearColorAttachment feature (LINEAR_ATTACHMENTS) is enabled where the device lists the
  extension and reports it, which Vulkan requires of a device that lists it. Vulkan 1.3 needs no
  other extension for it (its dependency is VK_KHR_get_physical_device_properties2 or 1.1). The
  translator is told of neither. Core::linear_attachments carries the enabled feature.
- The plane test (surface::held_usage): a usage is offered where the image format query offers it
  AND the plane's own tiling's format features (LINEAR's for an opaque handle, the
  DRM_FORMAT_MOD_LINEAR modifier's for a dma-buf, read through VkDrmFormatModifierPropertiesList2EXT)
  hold what the optimal image has for that usage (texture::kept_features, the test a texture over a
  buffer takes), and for rendering the colour attachment feature itself
  (VUID-VkImageViewCreateInfo-usage-08931). The NV bit stands for the colour attachment feature only
  where linearColorAttachment is enabled AND the image is VK_IMAGE_TILING_LINEAR: Vulkan sets it
  "for renderable color formats in the linearTilingFeatures" alone. So NVIDIA's opaque fd planes stay
  in place on the enabled path and its dma-buf planes take the copy form (SurfaceCopy::Tiling).
- The condition, held by rt: a plane accepted through the NV bit is marked at its make
  (surface::linear_alone, SurfaceImage and Image linear_attachment, Attachment::linear). A pass's
  begin (Pass::check, pass::linear_shape, one mark read an attachment) refuses with the new
  Gap::LinearPlanePass { kind: LinearPlanePassKind }: OtherColor, a colour attachment that is not a
  marked plane (the extension's rule: "as long as all the color attachments in the render pass
  instance have VK_IMAGE_TILING_LINEAR tiling"); DepthStencil, a depth or stencil attachment (not
  Vulkan's rule: an RTX 3090 lost the device on that shape, and rt recovers from no loss, so by the
  ladder's third rung it is not used; the words name the driver); Resolve, a multisample
  attachment resolving into a marked plane. Every colour attachment marked (both planes of a
  picture in one pass among them) with nothing else set renders.
- Unchanged: a texture over a Shared buffer keeps its plain-bit test and its counted copy; the old
  runtime is not touched.

The rt README: the surface test and the marking (Exported surfaces), NVIDIA's dma-buf planes as a
copy-form known gap, the refusal among the render encoders' known gaps, the extension row and a
Linear attachments feature table (Floor); the clear-reach slip "inside the Metal's render area"
fixed. docs/REFUSALS.md regenerated; api_signatures.tsv blessed: the new variant and enum,
floor::Features::linear_attachment, OPTIONAL_EXTENSIONS' value.

Tests: tests::floor (the extension and feature enabled where listed and reported, the README
table); tests::surface::verdicts (NVIDIA's linear word: held and marked only as LINEAR with the
feature, the copy form without it and under the modifier either way, the plain bit unmarked,
blend and filter held to the optimal image); tests::pass (linear_shape: one and two marked planes
render, the three shapes refused); tests::linear_planes on device (a draw into one plane and both
planes in one pass rendered and compared on every device; the three shapes refused where the
plane is marked and rendered, compared, where it is not).
2026-11-19 22:13:45 -08:00
Anees Iqbal b676eda182 rt: a colour render target takes an index, and a draw reads it as an attachment as it reads a shader-read one
Metal fetches any render target, and its header gives every texture a handle with no tie to
usage (MTLTexture.h: gpuResourceID, "Handle of the GPU resource suitable for storing in an
Argument Buffer"). rt took an index only for shader-read or shader-write usage, so a colour
target made for rendering alone had no second element and every fetch from it was
Gap::Draw(FetchedAttachment): guest 26's 4,792 refusals, all of that shape.

- The index rule: shaders reach a texture made for shader reads or writes, or a colour render
  target (render-target usage of a pixel format with no depth or stencil), which takes an index
  exactly where it does (Refusal::TextureIndex), at every maker: new_texture and the heap, buffer
  and Managed makers, views, drawables and surface planes. A depth or stencil target made for
  neither is unchanged.
- A colour render target not read takes what a shader-read one takes for attachment reads: the
  sampled usage, and the feedback usage where the image format query offers both beside its
  usage; the shadow on a device without the loop; neither where the query refuses them, and its
  draws that read it stay Gap::Draw. Its home stays the attachment layout, so a pass that does
  not read it records no move of it, and a fetching pass moves it home, feedback, home with the
  existing move code.
- Only its second element is written: its sampled-texture element stays the null one, so a slot
  that binds it reads nil as before. place_texture takes the view its second element names in
  place of a flag.
- A linear image in place over a buffer takes no sampled usage for a target shaders do not read.
- The in-tree consumers take the rule: the replay player's texture class, the harness's and the
  conformance suite's rt side. rt's own tests make their unindexed colour targets with
  new_texture_for_views, and give indices where a test needs new_texture's path.
- docs/RESOURCE-ID.md, the runtime README and Refusal::TextureIndex's doc say the rule; docs/REFUSALS.md is regenerated.

Also rides along, from the planner, in the README's known gaps of memory blocks: a block freed
before a submission used it waits on the block-maker thread for its bind, and a ring take that
needs a new ring block can wait behind it.

Verified: see the check job named in the landing.
2026-11-19 21:40:56 -08:00
Anees Iqbal 7934b405d8 fetch (draft): surfaces read through the loop where their query offers it; loop reads counted; tests and docs
A surface plane whose texture is a shader-read render target takes the feedback
usage where the handle's image format query offers it with the export features
alike (Query::plane; a D3D11 import's query the same), and the in-place make
retries without it where the images with it do not hold the layout; a plane
without it reads through its shadow, the counted copy. The fetch and the texture
read choose the loop or the shadow by the image, not the device.
Metrics::attachment_loop_reads counts every draw that reads an attachment of its
own pass through the loop. Device tests (tests/fetch.rs): N fetching draws exact,
N-1 barriers or copies more than one; a surface plane of each fetched format.
RenderPipelineKind::FramebufferFetch removed. SEMANTICS_VERSION 2193,
ARTIFACT_FORMAT_VERSION 550 (PushField::FetchedColor). REFUSALS.md and
api_signatures regenerated; README and API.md.

Draft: the old render key re-pin follows the compile check.
2026-11-19 17:22:28 -08:00
Anees Iqbal 6eac85e79c rt: the resolve tables after the resolves metric and the resolve-format basis
m3-max-55101's REGEN and BLESS at 4153392249.

Verified: see the check job named in the landing.
2026-11-19 16:56:17 -08:00
Anees Iqbal 4dd8d707d1 rt: the resolve tables, the resolve-format basis the old runtime's records, and the resolve test's target usage
docs/REFUSALS.md and the API signature table regenerated for the resolve
items (m3-max-54897's REGEN and BLESS). Refusal::ResolveFormat's basis named a
device the cluster has no record of; it now cites what metal2vulkan-runtime's
RenderPassProblem::ResolveFormat records: Metal's validation assert for an
integer resolve target. The color resolve test's target took SHADER_READ,
which a texture made without an index refuses (lavapipe, m3-max-54897); a
resolve target needs RENDER_TARGET alone.

Verified: see the check job named in the landing.
2026-11-19 16:56:16 -08:00
Anees Iqbal 3fc316d576 identity domains: a render pipeline's functions spill past their shares of the floor's push range
Under the identity domains a vertex or fragment function whose push fields passed its share of
the floor's one 256-byte range was refused (Unsupported{IdentityDomains} needing
maxPushConstantsSize). Once containment added each checked slot's length (SlotRemaining) and the
zero range's address (ZeroAddress), pairs reached 272 bytes and were refused: 3 render states of
windrag-780m-b2 (223 draws) and 4 of syncview (259 draws), and the guest's GL-layer pipelines on
reims's walks. A render function now spills as a kernel does: it pushes its parameter block's
address first (PushField::ArgumentTableAddress) and reads every field past its window from the
block, each loaded once, in the function's first block (EmitCx::load_push_fields). The refusal and
its REFUSALS.md row are gone.

- Order: the check's fields are last in the derived Ord of PushField, after
  TessellationFactorAddress (ZeroAddress, then each SlotRemaining), so what every access reads is
  placed ahead of what only a checked access reads, and the check's fields are the first to move
  to the block. The codec's list is unchanged.
- The vertex function's floor window is [0, 248) (push::VERTEX_FLOOR_END). A vertex function is
  lowered without knowing its fragment function, and a fragment function that spills pushes its
  block's address (8 bytes, 8-aligned) from the vertex function's end, so the vertex function
  leaves that room. Cost: only a vertex function whose own fields pass 248 bytes spills where it
  used to fill the last 8.
- metal2vulkan-rt: Draws holds each field's place (the push range or its function's block) and
  each function's block (length, the push offset of its address). A draw that fills its pushed
  values anew writes each block into the parameter ring and its address into the range;
  ring_writes counts it. A block longer than a ring chunk stays Gap::RenderPipeline(DrawInput).
- SEMANTICS_VERSION 2194 (placement changed).

Tests: push.rs's edges (a vertex function ending at 248 with a spilling fragment function, whose
address goes at 248; a fragment base of 244, whose address is still at 248; a vertex function
whose fields would reach 252, which spills); engine_identity_spill: a vertex function of 25 slots
pushes its block's address first and every slot's address, spills only the check's fields, passes
L3, and loads each spilled field once in its first block; the pair with a fragment function from
248 compiles and validates on every identity profile; on the interpreter its sums are Metal's, and
lengths pushed one word short, in the window and in the block alike, read zero.

Docs: push.rs's module text, docs/API.md (section 1) and the rt README state the shares, the 248
and its reason, and the spill.
2026-11-19 15:59:29 -08:00
Anees Iqbal a69cb43486 translator: threadgroup memory reads zero until the program writes it, on Device::from_queries
On the new runtime's profile every Workgroup variable that holds a
function's threadgroup memory has a null initializer: the threadgroup
arena (declared threadgroup variables, [[threadgroup(n)]] regions and the
imageblock, memory::arena) and the typed threadgroup objects
(lower::access::local). One form on every device: the Vulkan 1.3 floor
requires shaderZeroInitializeWorkgroupMemory; a profile without it
refuses such a function, Unsupported{ZeroedThreadgroupMemory}.
Device::new's profile is unchanged (ProfileFacts::ROWS keeps
ThreadgroupStart::Unwritten), so the old runtime's SPIR-V is too.

The translator's own Workgroup words get none, as it writes each before
any read: the emulated SIMD-group scratch and vote word, the object
stage's mesh grid, the mesh wrapper's count and staged indices, the
emulated payload and the binder's scan and merge kernels.

The builder refused a null of an array whose length is a specialization
operation (spirv/ir/constant.rs, ConstRule::NullType); an arena with
regions, and the emulated scratch, have such lengths. spirv-val's
IsTypeNullable reads an array's element type alone, so the builder now
takes it. That refusal is what made rt report a probe's emulated variant
as missing (Gap::PartialSimdgroups after Later::lower's Refused).

The profile verifier also refuses a Workgroup initializer other than a
null (VUID-StandaloneSpirv-OpVariable-04734).

docs/API.md states the form with Metal's words on threadgroup memory;
SEMANTICS_VERSION 2192; REFUSALS.md and api_signatures regenerated.

Tests: engine_zeroed_threadgroup (null initializers through from_queries
on four profiles, zeros on the interpreter in both orders and two
threadgroups, the emulated variant's arena zeroed and scratch not,
Device::new uninitialized, the vk12 floor refused),
a_specialization_sized_array_has_a_null, a_workgroup_initializer_is_only_a_null,
the profile facts' fingerprint.
2026-11-19 13:52:35 -08:00
Anees Iqbal d65374348e rt: a Managed buffer's copy-in is a GPU copy from the consumer's block, and the capture ring goes
Metal's contract for a Managed buffer (MTLBuffer.h, didModifyRange:): a CPU write makes the range
undefined for the GPU until a didModifyRange: and a commit of the command buffer that reads it,
and it does not reach a command buffer committed before. The capture ring met that by copying
the bytes on the committing thread into 64 MiB of Shared staging, and the commit then waited for
the GPU whenever the ring was full. One recording on an RTX 3090 waited 258 times for 6.7 s
(m3-max-53409). The ring also kept a Managed buffer over an imported dma-buf, a block the runtime
does not map, refused (Refusal::ManagedBlockNotShared). On the XTX that refusal bound nil 2,804
times, and 28.8 million draws were then refused.

The planner ruled one form. The commit records the copy-in into a command buffer of its own:
vkCmdCopyBuffer of each named range from the consumer's block into the device copy, ahead of the
command buffer's commands in its submission, after the copies back owed to textures over the
ranges and before the copies into them. Vulkan's host write ordering guarantee makes the
consumer's writes made before the submission visible to the copies. The copy reads the bytes as
it runs, so a write after the commit may reach it, which Metal leaves undefined. The copy-in
holds each consumer's block and device copy until the command buffer retires.

What goes with the ring:
- capture.rs keeps the named ranges and the copy-in, and loses the ring, Chunk, Overflowed and
  the staging blocks of its own;
- submit.rs loses the commits' turn (capture now records under the work lock), the streams of
  ring-fulls, the waits and the ring's spans;
- the counters lose capture_waits, capture_streams, capture_overflows, capture_overflow_bytes,
  capture_copy_nanos, capture_wait_nanos, Gauges::capture_bytes and the capture ring's site, and
  managed_bytes_captured counts the bytes the copies take;
- the player's report and the API table lose the same fields.

A Managed buffer's bytes may be in any Shared block, mapped or not: contents is None over an
import. A Private block is refused as Refusal::ManagedBlockPrivate, since a Managed buffer has a
CPU-side copy ("the data pointer of this buffer's shared copy", MTLBuffer.h) and a Private block
has no pages the consumer can write. docs/REFUSALS.md is regenerated. The rt README's memory
contract says when the copy runs, and its known gap of the ring's waits goes.

Tests:
- the snapshot tests now hold the header's contract: write, didModifyRange:, commit, and that
  command buffer reads the bytes, here also behind an event wait with the consumer's handles
  gone before it runs. Nothing is asserted of a write under a pending command buffer;
- the ring's tests go;
- a range of three 16 MiB units arrives whole at one commit, with no staging and no allocation;
- a Managed buffer over an imported, unmapped dma-buf (Shared, contents None) reads what the
  consumer wrote through its own mapping, on a two-copy card and on a unified one;
- a Managed buffer over a Private block is refused;
- the first named range allocates nothing at any site;
- the commit's lock-wait test marks the start of its count with a test-only flag, where it read
  the turn.

Verified: see the check job named in the landing.
2026-11-19 13:47:06 -08:00
Anees Iqbal 7834c2afe6 rt: import a picture's Direct3D 11 textures as a surface, in place, with no make-time submission
Device::import_d3d11_surface was a typed refusal (Gap::D3d11Surface). It now imports each plane's
NT handle (VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT) into a dedicated allocation bound to
an optimal image of the Direct3D 11 texture's own format, mutable and listing the descriptor's
format where the two differ (two formats a plane: R16Uint under RG8Unorm), into the first
device-local type the handle's properties and the image's requirements share. Usage is each of
sampled, rendered, copied and storage the import query offers and the view format's features
hold. Each import counts in Gauges::surface_imports, now on every host.

No submission and no wait at the make: Vulkan 1.4 section 12.5.2 says such images "can be
assumed to be in that layout when they are accessed in Vulkan after external access", and its
table gives the D3D11 texture handle VK_IMAGE_LAYOUT_GENERAL. The plane textures start homed in
the general layout; external_writes_done acquires from VK_QUEUE_FAMILY_EXTERNAL in GENERAL
(VUID-VkImageMemoryBarrier-srcQueueFamilyIndex-12332) and release_surface_to_external releases to
it in GENERAL (dstQueueFamilyIndex-12331). No keyed mutex. The consumer's precondition (Direct3D
11 wrote the plane before rt's first use, and external_writes_done follows that work) is stated
in the call's doc and the rt README.

Surface gains an imported kind: Surface::handle is Option<ExportHandle> (None for the import),
and Surface::buffer is Gap::D3d11SurfaceBuffer, its planes lying in memories of their own.
ImportHandle::D3d11Texture names the handle in Limit::NoImport and Limit::ImportType.
Refusal::SurfacePlanes covers no plane or more than four. REFUSALS.md and the signature table
are regenerated.

The tests: on every device, the import's typed refusals (no plane, five planes, a one-byte image
format under a two-byte view). Under m2v_gpu on Windows, two shared Direct3D 11 textures (R8_UNORM
64x32, R16_UINT 32x16 viewed as RG8Unorm) on the DXGI adapter of the device's LUID, bound by hand
from the SDK headers' vtables: the import submits nothing; Direct3D 11 writes picture 1 and rt
reads it exactly; Direct3D 11 writes picture 2, unlike picture 1 at every byte, and rt reads it
exactly and unlike picture 1 at every byte (the negative control); rt writes picture 3 and
releases it, and Direct3D 11 reads it exactly through staging copies.
2026-11-19 13:36:21 -08:00
Anees Iqbal 7a064aca1b Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-19 12:53:25 -08:00
Anees Iqbal 5a31141d47 rt texture views: Metal's casts of a cube, a cube array and a 2D texture over the same image
The replay streams' gap substitutes were all one view: newTextureViewWithPixelFormat:
textureType:levels:slices:swizzle:resourceIndex: as a 2D array of a cube's six faces, which rt
answered Gap::TextureView (TextureType) and the old runtime makes. Vulkan views a cube-compatible
image, as a cube's and a cube array's are, as a 2D, 2D array, cube or cube array of its layers, and
any image as a 2D array of one layer, with no query, so each is one form on every device.

Texture::new_texture_view now builds those of Metal's casts (Apple's makeTextureView page): a cube
or a cube array to a 2D texture, a 2D array, a cube or a cube array, a cube array's whole cubes as
a cube array, and a 2D texture to a 2D array of its one slice, beside the 2D array to 2D it built.
A cube or cube array view of a 2D array needs a cube-compatible image the 2D array is not made as,
and stays a gap that says so (TextureViewKind::CubeOfArray). A slice count the view's type does not
take (one for 2D, six for a cube, a multiple of six for a cube array) is Metal's validation's stop,
now Refusal::TextureViewSlices where it was a gap. The descriptor answers Metal's: the type, the
extent of the first level, the levels, and the array length in cubes for a cube type.

The device test every_device_views_a_cube_s_faces_as_metal_casts_them makes seven such views and
reads each one's first level and slice by a blit against the parent's bytes under them; the old
expectations move with the rule. REFUSALS.md, the API signature table and rt's README follow.

Verified: built and tested in the jobs the landing message names.
2026-11-19 12:51:50 -08:00
Anees Iqbal 54d43118a9 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-19 12:25:05 -08:00
Anees Iqbal de3acd5e61 rt import: the several-dma-buf import's tests, docs and tables
A device test reads and writes a block over three dma-bufs of one memfd (one, two and one
granule) across both chunk boundaries: add reads across the first and writes across the second
through the GPU addresses, then a blit reads across the second and writes across the first through
the buffer; every byte of the memfd is checked after. Refusals (no dma-buf, a length off the
granule) import nothing; a device with no granule refuses typed. A second device test times
vkQueueSubmit2 beside 40 live dma-bufs of one block and beside 40 one-dma-buf blocks against none.
A unit test holds the granule rule.

README (imported blocks, the extension table, sparseBinding beside the optional features, the
known gaps with the Iris's dma-buf type), REFUSALS.md, api_signatures, and the player's
sparse_binds counter.
2026-11-19 12:24:12 -08:00
Anees Iqbal 60eff8b12a Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-19 12:22:14 -08:00
Anees Iqbal 42993be0bc rt surface: Device::import_d3d11_surface's signature, refused typed until the import is built
The Windows surface import's public shape, so a consumer can build against it now:
#[cfg(windows)] Device::import_d3d11_surface(&self, planes: &[D3d11Plane<'_>]) ->
Result<Surface, Error>, with D3d11Plane { handle: BorrowedHandle, image_format, descriptor,
index } per plane: the Direct3D 11 texture's shared handle and own format, and the texture rt
makes over it. Until the import is built every call answers the new Gap::D3d11Surface (basis
ours), whose Metal counterpart is a texture over an IOSurface's plane.

A Windows device test holds the refusal for no plane and for one. REFUSALS.md and
api_signatures regenerated; the rt README's surfaces section names the call.
2026-11-19 11:48:29 -08:00
Anees Iqbal ac678d7d1e rt surface: Surface::buffer, a buffer over an exported surface's own memory
What: Surface::buffer() answers a Buffer over the surface's memory, of the export's size, at the
layout the SurfaceExport states. In place it is made at the first call, never at the surface's
make: of an opaque handle, a buffer bound at the first byte of the one allocation the planes are
bound in (memory::surface_view; the allocation now takes device addresses, which the buffer's
binding needs); of a dma-buf, a buffer on one more import of the dma-buf (import::surface_import)
into the memory type the planes' imports took, through a duplicate of an fd the surface keeps,
attempted only where the device's buffers import a dma-buf and the fd's query and the buffer's
requirements list that type. The copy form answers its block's buffer. The first call records
the buffer's acquire from the other API's queue family; external_writes_done acquires it with
the planes and release_surface_to_external releases it with them, writing back the copies of
textures over it first.

The surface, its planes and their views, and its buffer are one unit in the hazard sets: the
planes take a HeapId::unit at the make and the buffer takes the same one, so a kernel's write
through the buffer orders the next kernel's read through a plane as a heap's resources do.

Counted in the new Gauges::surface_buffers (a dma-buf's also in surface_imports); refused with
Limit::ExportType, Limit::NoImport and the new Error::Fd (no duplicate of the fd). The doc comment
quotes Vulkan 12.11 Memory Aliasing and the fd import's multiple-import sentence, and names the
same-instance reading the dma-buf form takes.

Test: every_device_carries_each_form_of_surface gains the buffer round (two pictures the second
device wrote read through the buffer, one at its make and one after external_writes_done, with a
one-byte-off negative control; a picture blitted into the buffer read through the planes and the
handle) and, on 1080p with llvm-as, the compute round (a kernel writes through the buffer, the
next reads plane 0 through a view; texels exact, and in place one barrier more than a control
whose first kernel writes a buffer of its own). Each device prints whether its buffers import a
dma-buf. Not yet run.

docs/REFUSALS.md and api_signatures.tsv regenerated; the rt guide states the contract.
2026-11-19 10:50:42 -08:00