4e7f66642e3bbff7c06c5dfe3bd09af9733302ea
591
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
28c2803429 |
Runtime: an indirect mesh draw of an object function is refused at the draw
What: a new DrawKind::IndirectObjectGrid. MeshCall::of refuses an indirect draw (MeshGrid::Indirect) of a state with an object function with Gap::Draw of it, after the threadgroup checks and before anything is recorded; draw_mesh_threadgroups_indirect's doc says so. Launch::Arguments, the object grid's indirect command the previous commit drew, is deleted with its recording. An indirect draw of a state without an object function is drawn through the launcher, as before. The runtime README's mesh known gap records the refusal, where Metal draws, and that no guest has met it (no replay stream or live session has used a mesh state). Why: the planner's step-4 ruling. An object grid the GPU reads may lie past the device's task limits (maxTaskWorkGroupCount, maxTaskWorkGroupTotalCount), where it runs in pieces whose number only the counts decide; the runtime reads no GPU word on the host (condition 6) and no command inside the pass can write the pieces' records (condition 5), and Vulkan leaves a task grid past the limits undefined (VUID-VkDrawMeshTasksIndirectCommandEXT-TaskEXT-07322). Tests: the parent's red tests pass here, narrowed to the kind: the no-device tests::mesh_draw::an_indirect_draw_of_an_object_function_is_refused_at_the_draw and the lavapipe draw test's indirect draw of mesh_draws' object state. docs/REFUSALS.md, error/basis.rs and api_signatures.tsv are regenerated. Verified: JOBLINE |
||
|
|
a5624a650f |
Runtime: a mesh render pipeline state draws drawMeshThreadgroupsWithIndirectBuffer
What: RenderCommandEncoder::draw_mesh_threadgroups_indirect, Metal's drawMeshThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerObjectThreadgroup: threadsPerMeshThreadgroup:. The arguments (Metal's MTLDispatchThreadgroupsIndirectArguments, three u32s) are checked as a vertex draw's are (OtherDevice, IndirectOffset, IndirectArgumentsPastEnd at 12 bytes, ArgumentPlace; the checks are now one helper, arguments_checked, for both). The draw pushes the arguments' address as the group counts' address, so nothing is written to the ring and nothing read back: - without an object function the state's launcher reads the GPU's counts there and emits the mesh grid where Metal draws it, one task workgroup, vkCmdDrawMeshTasksEXT(1, 1, 1); - with one, the arguments are the object grid's own indirect command, one vkCmdDrawMeshTasksIndirectEXT record (Vulkan's command is Metal's layout). The buffer counts as the draw's read (its hazards, a Managed buffer's copy, kept until the command buffer retires), as a vertex draw's arguments. Call::Mesh carries the arguments; mesh_draw gains MeshGrid::Indirect and Launch::Arguments. README and docs/API.md say the indirect form is drawn. Why: R3 of the mesh build. The object pipeline's indirect form is drawn here as the task grid's indirect command, which is right only within the device's task limits; the planner's step-4 ruling refuses it at the draw, which the next two commits do red-first. Tests: tests::mesh_draw adds the indirect calls' counts, regions and launches; the lavapipe draw test adds three indirect draws through the launcher: 3 groups by 8 at offset 8 (the M3's grid-indirect-3x1-by-8 pixels and words), and an axis of 65,536 and 1024 by 1024, which draw nothing, as on the M3. api_signatures.tsv and docs/REFUSALS.md are regenerated. Verified: JOBLINE |
||
|
|
a08a4fd1da |
Runtime: mesh render pipeline states draw drawMeshThreadgroups and drawMeshThreads
What: the render encoder binds the object and mesh functions' tables (set_object_* and set_mesh_*: buffer, buffer offset, bytes, texture, sampler state with and without LOD clamps) and draws a mesh state directly: draw_mesh_threadgroups and draw_mesh_threads. The device loads VK_EXT_mesh_shader's commands where it enabled the extension (Core::mesh). A new module, mesh_draw, holds the draw's grid: - each threadgroup is checked against Metal's maximum for its stage (Refusal::ThreadgroupSize for no threads or past it) and then against the state's capped maximum, a new Limit::MeshThreadgroupThreads naming the stage, the size, the state's maximum, the Vulkan limit that holds it (a new public WorkGroupLimit, maxTaskWorkGroupInvocations, maxTaskWorkGroupSize[0] or their mesh siblings) and that limit's value, counted in a new Metrics::mesh_threadgroups_past_device. The object size is read only where the state has an object function. - the draw writes three group counts into the ring and pushes their address (GroupCountsAddress), and writes each stage's DispatchRegion: the mesh stage's L, and the object stage's L with Metal's threads per grid and the partial flag for a draw of threads (no grid for a draw of threadgroups, so the object function's is counts times L). - without an object function the counts are the mesh grid (a draw of threads rounds it down, as the M3 recorded in mesh-grid-draws), and the draw is the launcher's one task workgroup, vkCmdDrawMeshTasksEXT(1, 1, 1). - with one, an object grid within the task limits is one vkCmdDrawMeshTasksEXT of its counts; past them it runs in pieces of the most workgroups the limits allow, one piece directly and more as one vkCmdDrawMeshTasksIndirectEXT whose records lie in the ring (stride 12), the folded object function numbering them by DrawIndex. More pieces than one ring chunk holds (5,461) is a new Limit::ObjectThreadgroups. - an empty grid records nothing; a mesh draw with a vertex function's state is Refusal::MeshDraw, whose doc now covers both directions. Each mesh draw fills its push bytes and blocks (its counts and regions are its own); it records no topology (a mesh pipeline holds no input assembly, which leaves the recorded topology as it was) and biases as triangles. No draw ends the pass and nothing reads a GPU word back (conditions 5 and 6 for direct draws). The indirect mesh draw is not built yet: the README's known gap says so, and the consumer refuses it itself. Why: R2 of the mesh build, direct draws, in the ruled order after the state (R1b). Tests: tests::mesh_draw (no device) checks the size refusals and the limit with its Vulkan names, each call's counts, regions and launch against the region helpers, and the pieces on the 780M's and the RTX 50's task grids (cover, minimality, the chunk limit). tests::mesh_state's new device test draws mesh_draws' states into two RGBA32Uint targets and compares every pixel with the fixture's words, which match the M3's recordings (mesh-grid-draws, mesh-object-draws): through the launcher (3x2 groups by 4, 7x5 threads by 2x2), through the object function (2 groups of 2, 3 threads of 2 with a partial threadgroup), empty grids, and the refusals. It also prints each device's task and mesh limits for the known gaps' per-card table. docs/REFUSALS.md, error/basis.rs and api_signatures.tsv are regenerated; README and docs/API.md state the direct draws. Verified: JOBLINE |
||
|
|
36a93dc7ec |
Runtime: a mesh render pipeline state is made, with its VkPipeline and Metal's thread and grid answers
What: Device::new_mesh_render_pipeline_state(&MeshPipelineDescriptor, sampler_ids) makes a RenderPipelineState of a mesh descriptor. - The content is compiled with compile_mesh_pipeline at each creation. The translator gives no key of a mesh descriptor before its compile, so neither the map of contents nor the cache directory holds one. - The draw tables become four: VERTEX, FRAGMENT, OBJECT and MESH, in Draws, OffsetLayout and the render encoder's tables, blocks and dirty offsets. - draws() maps the object stage (or the launcher) and the mesh stage to their tables, takes their threadgroup facts, and maps DispatchRegion, GroupCountsAddress (new FieldValue::GroupCounts) and the mesh stage's layer and viewport counts. - MeshThreads holds each stage's answer: the translator's stated maximum capped by maxTask/MeshWorkGroupInvocations and maxTask/MeshWorkGroupSize[0]. Its workgroup is that answer in one row, rounded up to the stages' LocalSizeConstraint multiple. - stage_module specializes ObjectLocalSize/ObjectFlatLocalSize, with ObjectMultiRegion 1, and LocalSize/FlatLocalSize, with MultiRegion 0, to the two workgroups. A threadgroup memory length stays refused. - make() gives a mesh pipeline no vertex input or input assembly, and drops PRIMITIVE_TOPOLOGY and PRIMITIVE_RESTART_ENABLE from its dynamic states (VUID-VkGraphicsPipelineCreateInfo- pDynamicStates-07065 and -07066). - The state answers maxTotalThreadsPerObjectThreadgroup, maxTotalThreadsPerMeshThreadgroup, objectThreadExecutionWidth and meshThreadExecutionWidth (32), maxTotalThreadgroupsPerMeshGrid (the descriptor's, else 1,048,576) and both required sizes. A state without an object function answers 0 for its object stage, as docs/API.md's accepted differences say. - New Refusal::MeshDraw (basis: ours) refuses a draw of primitives or patches, or an execution of an indirect command buffer, with a mesh state (VUID-vkCmdDraw-stage-06481). The encoder records no mesh draw yet; that is the next step. - The runtime re-exports MeshPipelineDescriptor. Why: step 2 of the ruled order (floor, state, direct, indirect, ICB, adapter), under the planner's cap ruling: a made state answers the capped maxima. Docs: the README's known gap now says mesh states are made and not drawn, each creation compiles, threadgroup memory arguments are refused, and the maxima are capped. The stale identity-domains bullet for object and mesh functions is deleted: 2761e27594 removed that refusal. docs/API.md is updated. docs/REFUSALS.md and error/basis.rs are regenerated. api_signatures.tsv is blessed: new runtime methods, the refusal and the re-export, with nothing removed. Tests: tests::mesh_state, under a device cfg, on every device of the cfg's kind. Where the device has the mesh set: - mesh_pipeline_limits' four states (nothing stated; 64, 32 and grid 8; without an object function, with and without grid 8) are made with their VkPipeline and answer the capped maxima; - a draw of primitives with one is Refusal::MeshDraw; - mesh_draws' rasterizing states into two RGBA32Uint colours, with and without the object function, make their VkPipeline. Elsewhere each state is refused naming MeshShading. |
||
|
|
27a6c1ebd3 |
Translator and runtime: the interface items no path makes since the resident core went are deleted
|
||
|
|
3e3deb25b9 |
Translator and runtime: BGR10_XR and BGRA10_XR render targets take Metal's writes, clears, masks and covered blends
The red commit's test, and the conformance cases that render into either format, which the runtime refused (Gap::TextureFormat on a RenderTarget texture). Attachments. A BGR10_XR or BGRA10_XR color attachment is its texture's UNORM image (FormatEmulation::ExtendedRangeUnorm, now admitted as a color attachment and, blended, as a blended one): A2R10G10B10_UNORM_PACK32, and R16G16B16A16_UNORM with red and blue exchanged. The formats' second, raw candidate and ExtendedRange::of_attachment are gone; the runtime makes a RenderTarget texture of either, and a device whose format query lacks the usages is refused the pipeline, naming them (the runtime's floor does not require R16G16B16A16_UNORM as a color attachment). Writes (lower::stage_io::extended_unorm_color). A fragment function writes Metal's code of its output (rounded to half, nearest even, then encoded as a kernel write encodes it) as the field's value over its maximum, a little above the code (metal::format::extended_unorm_field: 10-bit (c + 0.0005) / 1023, 16-bit (64 c + 0.25) / 65535), which a device's conversion stores as that code whether it rounds to nearest, toward zero, by floor(x 1024) or, as lavapipe does for a 10-bit target, through 16 bits (round(x 65535) >> 6; an offset of 0.25 stored code + 1 for the 251 codes from 772). BGR10_XR's two alpha bits are written as ones, as Metal writes them. Clears store Metal's clear codes (metal::format::extended_unorm_clear, the runtime's clear values). Masks are Metal's on the image's channels (BGRA10_XR's red and blue exchanged; BGR10_XR's alpha bits written with any color channel). A resolve is the device's AVERAGE of the codes, which average as the values do; PrecisionNote::DeviceRoundedResolve now names a BGRA10_XR field's low bits. A fetch of either attachment is refused NotImplemented(Format) at compile, and at link where the function does not write it. Blends (pipeline::extended_blend). Metal's blend into these formats, measured on an Apple M3 Max (macOS 27.0.1) over the xr-blend recordings: the source clamped to the values of codes 0 and 1022 (a NaN to code 0) and alpha to [0, 1], a destination color code to 1022, half arithmetic, the result rounded to a code. That model is every recorded channel's but 9 of 172,032 (premultiplied source-over, one code each, listed in the ledger rows). The function clamps its output as Metal's blend does; a blend that stores its source (one and zero, added) stores the clamped codes exactly. Any other blends the codes in Vulkan with a source factor of one, the function writing the term X that makes Vulkan's blend of the codes Metal's blend of the values; destination factors that read the source read it from a second output (dualSrcBlend, in the floor), BGR10_XR's alpha too, so its alpha bits stay ones. A factor pair the module does not cover (a BGRA10_XR destination alpha among them) is refused NotImplemented(Format). Notes, static per pipeline: PrecisionNote::ExtendedRangeBlend on every blend that does not store its source (the device rounds each draw's result to the field, a BGRA10_XR field keeping the fraction of a code in its six low bits); PrecisionNote::ExtendedRangeBlendWindow where the corrected term or a second-output factor can leave [0, 1], which Vulkan clamps (pipeline::extended_blend::window_holds, from the factors and operations at the corners of the source's range; a unit test classifies every factor pair and operation at both formats). Both are in docs/API.md's catalogue with counts, and the runtime's README records the window as a known gap with its trigger. Ledger: 18 llvmpipe rows of the B cases that differ (the xr-blend addition and premultiplied source-over, xr-gamut, the blended xr-gradient and xr-masked over draws, and xr-gradient's unblended resolve), each citing its note, with counts from a model of our blend whose count of differing elements is lavapipe's replay's to within 11; and the same cases' rows on the RTX 3090 (NVIDIA 620.70.06, m3-max-85796; there xr-gradient-bgra10xr-unblended-x1 too, 39 fields a code off by the device's arithmetic of the gradient), the RX 7900 XTX (m3-max-85797) and the Iris Xe (m3-max-85798), each pointing at the case's llvmpipe row, with that device's counts. Cache key: LoweringInputs::extended_unorm_colors is hashed into the function key where it is set (pipeline::compile::key), so a fragment function compiled for a BGR10_XR or BGRA10_XR attachment never takes another's translation; the key test asserts that the attachment and the format each change the key. SEMANTICS_VERSION 2378 and ARTIFACT_FORMAT_VERSION 612. RUNTIME_VERSION 2577 (XR render targets are made); runtime-sources.sha256 re-pinned. api_signatures blessed and api_surface extended (ExtendedUnormBlend, ExtendedUnormColor, extended_unorm_clear); docs/REFUSALS.md regenerated (the fetch's refusal site). |
||
|
|
549ab0ac23 |
Runtime: a draw that reads the depth through a range past [0, 1] goes through a depth range twin
The partial fix draws through a viewport depth range past [0, 1] where
nothing reads the depth, and refuses every other draw (DrawKind::Viewport).
Metal draws those too (M3 Max, macOS 27.0.1, job m3-max-85617). It reads
[[position]].z = znear + z * (zfar - znear) unclamped. It stores that, and a
[[depth]] output, clamped to [0, 1], and tests the clamped value. Clip
space's 0 <= z <= w clips whatever the range. Vulkan takes no such range
without VK_EXT_depth_range_unrestricted, which the floor does not have.
The translator commits before this one build the fold:
LoweringInputs::depth_range_fold. Under it, the vertex function stores
znear * w + (zfar - znear) * z as its z, from PushField::DepthRangeFold. It
stores z and w - z as two clip distances after its own. Under
depthClampEnable with the viewport at [0, 1], that clips, reads, stores and
tests what Metal does. This commit draws through it.
- RenderCompiled keeps what its content was made for (arrays, words, srgb)
and a OnceLock'd twin. depth_range_twin lowers the content's descriptor
again for the same inputs under VariantKey::depth_range_fold
(lowered_content, factored out of render_pipeline_state). It is made at
the first draw that needs it, counted (Metrics::depth_range_twins), and
timed as a make at encode. It is held as long as its content, and no map
keeps it. The translator's refusal of it is kept, so a later draw answers
it without lowering again. That refusal is the clip-distance limits.
- RenderPipelineState::folded gives the twin's state, its samplers numbered
at the state's indices, cached in RenderInner. It refuses (Viewport) a
vertex function the consumer compiled, and a twin that stores no fold.
- Fixed::fold (RuntimeFact::DepthRangeFold) makes every VkPipeline of the
twin take depthClampEnable. draws() takes the fact, and the vertex push
field as FieldValue::DepthRangeFold. fill_push writes the first
viewport's [znear, zfar - znear] as f32 bits.
- The encoder's route (in place of draws_refused) is found when the
pipeline state, the viewports or the depth clip mode are set. A draw
reads one field, as before.
- Under a past range that the pass's depth attachment or the fragment's
[[position]] z or w reads, draws go through the twin.
- The route refuses under the Clamp mode, and for a function that writes
[[viewport_array_index]] while the viewports set have different ranges.
- Only the viewports a draw reaches count: the first, or every one set
for a function that selects.
- bind_content composes the twin with the content for the draws' bindings
(for_draws). The viewports are recorded at [0, 1] while folded.
- RenderCommandEncoder::DEPTH_RANGE_NOTE (DeviceArithmetic) is the static
note of every draw through a twin. The docs/API.md catalogue says so.
Bounds: a twin holds at most 8 VkPipelines (Clip mode only), and 8 more for
its words twin, so a content holds at most 48 where it held 32, for its
life.
Docs: set_viewport, DrawKind::Viewport, Metrics::translations_at_encode,
and the runtime README's paragraph, Gap::Draw list and a known gap. The
known gap gives the first draw's stall, the twin's pipelines, the limit
refusal and the two refusals. REFUSALS.md and api_signatures.tsv are
regenerated. api_signatures also takes the translator rows of the commits
before (VariantKey and LoweringInputs depth_range_fold, PushField and
RuntimeFact DepthRangeFold). RUNTIME_VERSION 2576. The
runtime-sources pin does not move (pin-compute).
Verified: the READY gives the job lines (red at the commit before, green
here, on lavapipe and an RTX 3090; clippy in three configurations;
rustdoc).
|
||
|
|
8bc3ad5e86 |
Runtime: Gap::CubicSampler goes
The runtime never raises it: Device::new_sampler_state makes a Cubic filter (MTLSamplerMinMagFilterCubic, Metal's undeclared raw value 2) and filters it as nearest. The variant stayed only because the consumer named it. The consumer's public tip no longer does: `git grep -n CubicSampler 7d016acc9c` in reims-vgpu (its pin V move, push #97) has 0 hits. The basis tests that used it as their Ours example use Gap::MemorylessTexture, also Ours. docs/REFUSALS.md regenerated (the runtime's Gap: 31 -> 30 variants); api_signatures blessed (one variant row out). RUNTIME_VERSION unchanged: no run of an artifact does anything else, since the variant was never raised. runtime-sources.sha256 is unchanged: the runtime crate's error.rs is not one of its inputs (computed equal, 1ab29fff…). |
||
|
|
e9e52050d0 |
Runtime and translator: a compute encoder binds a buffer with its attribute stride, and a dynamic stage-in layout fetches at it
What:
- ComputeCommandEncoder gains three methods:
set_buffer_with_attribute_stride (setBuffer:offset:attributeStride:atIndex:;
setBuffers:offsets:attributeStrides:withRange: is a loop of it, as every
other range call of the runtime is), set_buffer_offset_with_attribute_stride
(setBufferOffset:attributeStride:atIndex:) and
set_bytes_with_attribute_stride (setBytes:length:attributeStride:atIndex:).
- Each buffer slot's binding (Slot::Buffer, Slot::Bytes) keeps the stride's
low 32 bits, so MTLAttributeStrideStatic is 2^32 - 1. A new
FieldValue::StageInStride(slot) pushes it. It is mapped from the
translator's PushField::StageInStride, and the interface accepts
RuntimeFact::StageInStride.
- set_buffer, set_buffer_offset and set_bytes bind a stride of 0, which
clears an earlier one. That includes set_buffer of the buffer and offset
the slot already holds, which used to return early.
- Translator: the identity domains accept PushField::StageInStride
(lower/select.rs), as they accept the vertex analogue
PushField::VertexBufferStride. Before, a dynamic layout was their typed
refusal, EncoderValue "StageInStride(1)". The translator test
a_fixed_layout_records_no_stride_and_a_dynamic_one_records_its_own now
makes the pipeline, which records RuntimeFact::StageInStride of layouts 1
and 2 and none for layout 3, the constant step.
- Deleted: StageInKind::DynamicStride, unbuilt_stage_in and its call at
state creation. Gap::StageIn now names only IndirectRegion.
- Conformance:
- The runtime side plays the four attributeStride steps and
setStageInRegion:.
- The four DynamicStride ledger rows of attribute-stride-buffer,
-buffer-offset, -inline-bytes and -plural-buffers are replaced by each
case's dispatchType row (case/outcome/dispatch_type, the consumer's own),
which every compute-pass case carries.
- CONFORMANCE-COVERAGE.md is regenerated.
- Regenerated:
- REFUSALS.md and error/basis.rs;
- METAL-COVERAGE.md and coverage.tsv (the four setters are implemented);
- api_signatures.tsv (three methods added, one variant removed).
- Docs:
- The runtime README's compute section and its known gaps.
- Validation's ToolingRequirement::DynamicStageInStride doc: the runtime
builds the layout, and the engine's candidate does not yet bind with the
stride form. Its classification is unchanged.
- Versions, renumbered at landing: RUNTIME_VERSION 2570 and
SEMANTICS_VERSION 2370, because the
translator's refusal becomes a pipeline. runtime-sources.sha256 does not
move: lower/select.rs, cache/mod.rs and the runtime crate are not among
its inputs.
Why: the planner ruled DynamicStride BUILD. The translator already lowered
the fetch at PushField::StageInStride. The runtime refused the state because
its compute encoder had no attributeStride setter and no field that pushed
the stride, and the identity domains refused that encoder value.
What a plain bind reads: Metal documents no answer for a plain bind of a
slot that a dynamic layout reads, and the debug layer answers differently.
Probe dynamic_stride_plain_binds.m, job m3-max-85456 (Apple M3 Max, macOS
27.0.1), read stride 0 for every plain bind, alone and after a stride bind
(setBuffer:offset:atIndex:, setBufferOffset:atIndex:,
setBytes:length:atIndex:). Its stride-8 control read stride 8. The planner
ruled to build that answer without pinning it against Metal: there is no
conformance row for it. The setter's doc says Metal documents no answer, and
the runtime device test below holds the runtime's own behaviour.
Consumer search (git grep -n -w DynamicStride in the consumer's checkout at
a34e93e4fa): 8 hits.
- Code that will no longer compile:
- rt_platform/diag.rs:3077 and :3085 name rt::StageInKind::DynamicStride
in a test.
- Tests that will fail:
- rt_platform/compute.rs:1394 expects the dynamic-stride state to be
refused (StageIn-DynamicStride).
- Docs and comments:
- rt_platform/compute.rs:18 and :1246.
- rt_platform/diag.rs:7 and :3081.
- docs/accuracy-ledger.md:129.
Per compute.rs:14, the consumer binds the attributeStride selectors as the
calls without them. It can now call these setters.
Tests: every_device_fetches_a_dynamic_stride_layout_at_the_stride_each_bind_gives
makes ten binds and dispatches:
- strides 40 and 80, 2^32 + 40 (reads at 40), and MTLAttributeStrideStatic
(thread 0's element, then zeros);
- set_buffer of the same buffer and offset after a stride bind (stride 0);
- set_buffer_offset after a stride bind (stride 0, one element on);
- set_buffer_offset_with_attribute_stride;
- set_bytes_with_attribute_stride;
- set_bytes after a bytes stride bind, and after a buffer stride bind
(stride 0).
Verified, at this tree (2f654e598c before the fold):
- Device tests, filtered test(stage_in) | test(dynamic_stride), 8 tests
each, every one passed; each card printed the dynamic-stride test's line:
- lavapipe, job m3-max-85611 (998 skipped);
- RX 7900 XTX (RADV, Mesa 26.2.6), job m3-max-85587, --cfg m2v_gpu;
- RTX 3090 (NVIDIA 620.70.06), job m3-max-85588, --cfg m2v_gpu;
- Iris Xe (ANV, Mesa 26.2.6), job m3-max-85601, --cfg m2v_gpu.
- Conformance replay of attribute-stride-buffer, -buffer-offset,
-inline-bytes and -plural-buffers on the same four devices, same jobs:
EXIT=0. Each case's one refusal is its dispatchType ledger row, with no
divergence, so every stride slot read the words the M3 recorded,
MTLAttributeStrideStatic and the 2^32-truncated strides included.
- Suites, job m3-max-85586:
- product: 3471 passed, 4 failed, 24 skipped. One failure is
golden_hashes_match_the_table (the SEMANTICS placeholder; golden tables
are re-blessed on development). The other three are the fixture tables
inventory_lists_every_fixture_in_order,
engine_fixtures_match_their_golden_printout and llvm_as::part_5_of_8.
All three fail on engine/dvw_depth_views, which development's
|
||
|
|
2ec06b93e1 |
Translator: the sparse path goes
The translator kept a second form for a function that observes a texture's residency: a slot's
sparse arm (OpImageSparse* and OpImageSparseTexelsResident under shaderResourceResidency) or its
tile map (a storage buffer of tile bits the consumer would mirror from each mapping), selected by
SpecKey::SparseTexture from the bound texture's MTLTexture.isSparse, with Metal's measured
footprint rule for a sample or gather, writes dropped under the same constant, and
PrecisionNote::SparseResidency where the device answered. With the observed residency now the
constant resident word, nothing builds either form, and nothing can need one: the runtime has no
sparse heap or sparse texture API, and the consumer tells no guest it has sparse textures (every
Apple family's supportsFamily NO, sparseTileSizeInBytes 0, isSparse NO; a sparse heap refused at
newHeapWithDescriptor:). So the path is deleted (rule 4).
Public items deleted, each searched for in the consumer's checkout at 76e6c90369 (0 hits for every
name):
- RuntimeFact::SparseTexture { slot, sparse_arm, tile_map } and its mechanism; the 12-03 cleanup
ruling that kept it in the produced-then-refused group is reversed for it alone;
- SpecKey::SparseTexture;
- ResourceKind::TileMap and BindingSource::TileMap, with pipeline::tile_map, the map's format;
- PrecisionNote::SparseResidency (metal2vulkan-degrade-sparse-residency), with its API.md
catalogue entry, the conformance Degradation and validation's C3 deferred near-equivalent;
- error::Feature::SparseTexture, which nothing constructed;
- bind::TextureFacts::sparse and TextureShape::Texture's sparse, which no binder set.
Crate-internal, gone with them: the texture family's residency use flags, sparse_arm, tile_map and
sparse_writes on a slot plan, their spec constants and tile-map views, resident_access, the tile
decoding (TileLevel), the read's sparse and tile-map arms, the census's ".resident" suffix and
RESIDENCY_WORDS; the sampler's residency and footprint fields and lower::sampler::footprint (Metal's
measured footprint rule, read only to answer from a tile map), the sparse arm in sample, gather and
pixel fetch emission, and lower::texture::residency (every caller sits behind the texture family's
own refusal of a word with another bit observed). The SPIR-V layer loses what only those built:
the builder's sparse_sample, sparse_fetch, sparse_gather, sparse_dref_gather, sparse_read and
texels_resident, the sparse flag of SampleForm and of the fetch, gather and read instructions,
Inst::ImageSparseTexelsResident, its serialization, requirement (SparseResidency, and with it
shaderResourceResidency) and the interpreter's unmapped texels. VkFeature::ShaderResourceResidency
stays: profiles and the device queries name it.
Nothing compiled changes: no module held a sparse instruction or the constant since the previous
commit, so SEMANTICS_VERSION stays. ARTIFACT_FORMAT_VERSION 608 -> 609 (renumbered at landing):
the codec's ResourceKind, SpecKey, RuntimeFact, PrecisionNote and BindingSource lose variants,
which moves later tags. runtime-sources.sha256 moves for bind/state.rs, bind/heap.rs and the
deleted pipeline/tile_map.rs; no run of an unchanged artifact changes. docs/REFUSALS.md, the
runtime's error/basis.rs and tests/api_signatures.tsv are regenerated.
Tests deleted with what they tested: the serializer's sparse sweep, the builder's sparse read
under texel operands, the mechanism table's three SparseTexture rows (the variant indices close
up), C3's SparseResidency deferral (the deferred-row tests now use CubeGradientFootprint).
Verified, on the CPU with no device:
- m3-max-85203, at this change on
|
||
|
|
3758e468a7 |
Runtime: TextureCopyMismatch rests on Apple's documented rule, with the Macs' measured answers
Refusal::TextureCopyMismatch (BlitCommandEncoder::copy_from_texture between textures of two pixel
formats or two sample counts) stated a metal-measured basis: the probe blit_copy_format_pairs.m on
the M3 Max under Metal's validation layer alone, which stops every pair of two formats. A
consumer's probe on a MacBook's Radeon Pro 5300M (macOS 26.7.1) had Metal take ten pairs of one
texel size and copy their bytes, plainly and under the validation layer, so the basis was re-read
and measured on all three Macs.
Apple's page for the region copy says of the destination texture: "The pixel format is the same as
`sourceTexture`. The sample count is the same as `sourceTexture`." Outside that rule the Macs
answer apart (the probe, rewritten to run each pair plainly and under the validation layer, with
the bytes checked):
- Apple M3 Max, macOS 27.0.1, Shared and Private: plain Metal copies the bytes as they are; the
validation layer stops every pair of two formats ("[sourceTexture pixelFormat](...) must equal
[destinationTexture pixelFormat](...)") and two sample counts.
- AMD Radeon Pro 5300M, macOS 26.7.1, Private: Metal copies the bytes as they are, plainly and
under the validation layer, which takes the pairs of one texel or block size (depth and BC1
among them) and stops two texel sizes ("must be compatible with") and two sample counts.
- Intel UHD Graphics 630 of the same MacBook, macOS 26.7.1, Private: the copy completes, plainly
and under the validation layer, and leaves the destination unwritten; the layer answers as on
the 5300M.
So the refusal stays, and its basis is metal-documented, quoting the page; its doc carries the
rows above. Nothing it refuses changes.
The probe now holds every leg that ran: the ten pairs of one texel size and R32Uint into R32Float,
each with Shared and Private textures, plainly and under the layer, with the bytes compared; the
earlier depth, BC1 and sample-count cases and a pair of two texel sizes (the negative control)
under the layer alone, where plain Metal has no defined answer; a device index for a Mac of two
GPUs. Its header states what each Mac answered.
docs/REFUSALS.md and the runtime's error/basis.rs are regenerated (one Refusal moves from
metal-measured to metal-documented). The runtime README's blit paragraph names the documented
rule. The conformance rows whose refusals Justification::MetalValidation documents are unchanged.
Verified:
- m3-max-85147, the Apple M3 Max (macOS 27.0.1), and m3-max-85148, the MacBook Pro's Radeon Pro
5300M and UHD Graphics 630 (macOS 26.7.1): the probe as committed, every leg (the rows above).
- m3-max-85410, on the CPU with no device, at this commit: fmt, the workspace's Rustdoc, the
runtime's private Rustdoc, the refusal surface's check and scripts/api-docs pass; the runtime's
suite ran 230 tests, all passed, 2 skipped.
|
||
|
|
6706d5b97f |
rt and translator: a sampler of Metal's undeclared filter 2 is made and filters as nearest
MTLSamplerMinMagFilter's raw value 2 (SamplerMinMagFilter::Cubic) is declared by no SDK header, Apple page or Metal Shading Language text, and nothing a program asks tells it about the value, so it is undocumented Metal and is not emulated. Metal makes the state on every Mac measured. An Apple M3 Max filters it over a footprint wider than one texel, and a Radeon Pro 5300M and an Intel UHD Graphics 630 read the nearest texel (the conformance case's own inputs: jobs m3-max-85003 and m3-max-85004). The runtime now makes such a state and filters it as nearest on every device: no shader arm, no second pipeline, no query, no note. - rt Device::new_sampler_state no longer refuses a Cubic min or mag filter. Nothing raises Gap::CubicSampler now; the variant stays, documented so, because the consumer names it. - translator: SamplerWord::of sets no bit for a Cubic filter, so its word is the nearest filter's. SamplerWord::CUBIC (bit 30) is deleted (its one reader, the anisotropic word path, is gone on development). SamplerWord::FIELDS is now (1 << 30) - 1. unnormalized_reads compares the two filters as the device's (a Cubic filter's is NEAREST) rather than refusing Cubic. vk_sampler already made NEAREST of Cubic. - SamplerMinMagFilter::Cubic stays, because the consumer converts a guest's raw 2 to it. It is documented through regen_metal_enums.py's PRIVATE_DOCS as Metal's undeclared raw value 2, which the M3 Max filters and the x86 Macs read as nearest, and whose device sampler and word here are the nearest filter's. generated.rs is regenerated against the macOS 27.2 SDK. - docs: the runtime README's sampler line, RESOURCE-ID.md (the word's bit 30 is now 0, and the consumer makes a Cubic state as nearest), resource_words.tsv's three Cubic lines (bit 30 cleared: 0x40000000 -> 0x00000000 twice, 0x58f6ab53 -> 0x18f6ab53), and the comments in select.rs and extended.rs that said the runtime makes no cubic sampler. - reach.tsv's SamplerBicubicFilter row no longer names a runtime cubic sampler as its reach. REFUSALS.md and error/basis.rs regenerated (refusal_surface.py: Gap::CubicSampler has no raise site); api_signatures.tsv blessed (SamplerWord::CUBIC removed, FIELDS changed). - RUNTIME_VERSION: a Cubic state is made where it was refused, so it takes a bump, set at staging (left at development's 2568 here). SEMANTICS_VERSION stays, since no module's words change. runtime-sources.sha256 re-pinned. Consumer search (reims-vgpu development 1913fcbc15 and the steelbrain/* refs from the last day): Gap::CubicSampler, 2 hits (development crates/reims-vgpu-vulkan/src/rt_platform/diag.rs:3071 and :3109, a test that counts the gap's name), kept. SamplerWord::CUBIC, SamplerWord::FIELDS and SamplerMinMagFilter::Cubic by name: 0 hits. The consumer's rt_platform::state::tests::states_on_vulkan, which expects None for min_filter 2, now gets a sampler. |
||
|
|
fa5d051b64 |
Translator: the two-word 64-bit integer forms deleted; every profile holds 64-bit integers in u64s
What: the arithmetic family's word form of 64-bit integers is deleted: Held::Wide and every arm on it, lower/arith/wide.rs (its word arithmetic, division, casts and lane moves) with its tests, ArithStrategy::Wide and ArithPlan's wide and divides, the profile's wide forms (wide_form_on, wide_demote, widen, widen_const, holds_wide), the two-word switch selector (SelectorForm::Words), the chunked vector's two-word lanes, the ulong texel's word form (TexelConv::U64Words loses its flag), the matrix descriptor's word form, and in the access family the two-word address (pointer.rs's Address enum and its helpers, the handle table's word entries and HandleIds, psb.rs's word base). The helpers the u64 paths still use move to arith/ops.rs (low_word, zext_word) and access/psb.rs (Pair, split). Every !int64 refusal goes with them: Feature::Int64Arithmetic, and Feature::PointerCompare, whose one producer was the static guest plan's !int64 arm. LeafCaps::int64 is deleted, and the mesh fold no longer asks for shaderInt64. BinOp::ISubBorrow, which only the word subtraction built, goes with its interpreter and builder arms (the grammar's Op::ISubBorrow stays in spv.rs). Why: Device::from_queries refuses a device without bufferDeviceAddress and shaderInt64 (IdentityDomains), and it is the only way to make a profile, so every profile has shaderInt64 and every arm deleted here was unreachable. This commit's parent is the last that holds the word form. Consumer search: reims-vgpu development cadac770c2 plus its steelbrain refs younger than a day (190 refs): 0 hits each for Int64Arithmetic, PointerCompare, LeafCaps and leaf.int64. The profile's fingerprint changes on every device (the field leaves the profile's Debug text), so the golden cells read "profile changed" until the table is re-blessed; no key stays unchanged, so SEMANTICS_VERSION does not move. The module words do not move: the u64 paths emit the same instructions in the same order (the uvec2 the slot offset builds is the same type the word form's type helper made). Tests: chunk.rs keeps the chunked lane-move and fragment-shuffle bound tests, on 64-bit and 32-bit lanes held whole; the selector test drops the word cases; the tests that asserted or filtered on the int64 field or Int64Arithmetic drop those lines; the dynamic move between slots runs L3 on every profile. docs/API.md (the object grid's needs), docs/REFUSALS.md, scripts/refusal-surface/reach.tsv and tests/api_signatures.tsv are updated; runtime-sources.sha256 is re-pinned. Verified: job m3-max-84770 at this commit (CPU only; the device steps on lavapipe): clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd EXIT=0; rustdoc EXIT=0 and private-item docs of five crates with 0 diagnostics; the translator's suite 2,594 of 2,595 passed, 20 skipped, the one failure golden_hashes_match_the_table (28,950 cells under a changed profile fingerprint, 0 changed under an unchanged key); air, runtime, devtools and harness 872 passed, 4 skipped; validation 1,348 passed, 2 skipped; conformance 1,053 passed; doctests passed; the conformance replay on lavapipe EXIT=0 with 0 ledger drift lines; the refusal-surface and signatures checks EXIT=0. The golden and engine inventory lists at the parent and at this commit show 0 computed cells moved and no inventory line. |
||
|
|
31d8a874f1 |
Translator: the Floor buffer access deleted; every profile reaches buffers by address
What: BufferAccess and ProfileFields::buffer_access are deleted with every Floor arm:
the refusals that named addressed_needs (the Floor arms of DereferenceLoadedPointer,
Int64Atomics, GpuEncodedIndirectCommands in the indirect-command, replay and execution-range
paths, the de-indexed and private list forms, and the addressed function tables), the
memory planner's addressed flag and its loaded-pointer refusal, the plan's needs (MemNeeds:
that refusal read its dynamic_roots, and the handle classes beside it had no reader since the
handle table went), provenance's dynamic_deref field, the Floor mechanism of
RuntimeFact::FunctionTableRange, the Floor values of MetalDeviceProperties (argument buffers
tier, max buffer length), and the null pointer's static escape that only a profile without
device addresses took. Public items gone:
DeviceProfile::addressed_needs and Feature::{ArgumentBufferPointers, PointerToInteger,
BufferRange}, whose only producers were those arms.
Why: Device::from_queries refuses a device without bufferDeviceAddress and shaderInt64
(IdentityDomains), and it is the only way to make a profile, so no profile is Floor: every
arm deleted here was unreachable. This commit's parent is the last that holds the Floor form.
Consumer search: reims-vgpu development f054ad57c1 plus its steelbrain refs younger than a
day (188 refs): 0 hits each for addressed_needs, ArgumentBufferPointers, PointerToInteger
and BufferRange.
The profile's fingerprint changes on every device (the field leaves the profile's Debug
text), so every golden cell reads "profile changed" until the table is re-blessed; no key
stays unchanged, so SEMANTICS_VERSION does not move.
Devtools: the fuzz Target loses its addressed flag; the pointer-select generator draws the
loaded form on every target, the same draw a target with device addresses made.
Tests: the memory plan tests ask whether a buffer pointer is wide in place of the needs, and
drop the handle-table asserts; the profile tests drop the field's asserts (the max buffer
length test keeps its allocation-limit arm); the pointer-cell tests no longer accept
PointerToInteger; the atomic, kernel stage-in and tessellation tests no longer filter on the
field.
docs/REFUSALS.md, scripts/refusal-surface/reach.tsv and tests/api_signatures.tsv are
regenerated; runtime-sources.sha256 is re-pinned.
Verified: job m3-max-84770 (CPU only, no card): the golden and engine
inventory lists at the parent and at this commit show 0 computed cells
moved of 28,950 (every cell re-keyed by the profile fingerprint, which
this commit moves) and no inventory line. The stack's tip ran the whole
gate (see its message).
|
||
|
|
09b6d0fb89 |
Translator: the anisotropic emulation deleted; a device without samplerAnisotropy refuses an anisotropic sampler
What: lower/sampler/anisotropic.rs and its tests, the emulated filter's
routine arm, SpecKey::SamplerAnisotropy, LoweringInputs and VariantKey's
anisotropic samplers, and PrecisionNote::AnisotropicFilter and
DeviceAnisotropicFilter (no producer is left) are deleted.
metal::sampler::check_sampler refuses a sampler of maxAnisotropy above 1
for a use that filters on a device without samplerAnisotropy
(Feature::SamplerAnisotropy, needing the feature): a constexpr sampler
where the function that samples through it compiles, a runtime or
argument buffer's sampler where it is made. A runtime slot's sample
compiles as the plain sample.
docs/API.md's precision-note catalogue loses the two notes,
docs/REFUSALS.md and scripts/refusal-surface/reach.tsv are regenerated
(SamplerAnisotropy is now a device refusal), api_signatures.tsv loses
the deleted items, and the runtime README line on the emulation goes.
SEMANTICS_VERSION 2363 (renumbered at landing: 2360, 2361 and 2362 went to
the seq_cst fence, the argument buffer border texels and the
partial-threadgroups cause). runtime-sources.sha256
is pinned at this tree.
Consumer search (read only), reims-vgpu development 4bb5db49fc and every
steelbrain/* branch younger than a day, 184 refs, git grep over *.rs,
*.toml and *.md: AnisotropicFilter, DeviceAnisotropicFilter,
anisotropic_samplers, SpecKey::SamplerAnisotropy and both degrade ids:
0 hits each.
Why: the planner ruled the emulation deleted directly after G1: under the
one form it is reached only on a device without samplerAnisotropy, where
Metal's anisotropic filter is not the device's, and the refusal names
the feature that device lacks.
Verified: job m3-max-84770 (CPU only, no card): the previous commit's red
test passes at this commit (1 run, 1 passed); the golden and engine
inventory lists at
|
||
|
|
aa15ad6b5b |
Translator and runtime: a refusal of the partial-threadgroups variant names its cause
The translator refuses a kernel's partial-threadgroups variant for five structures, and the refusal named none, so a walk could not tell them apart (a guest library's kernels 5ba5f694ad0576ff #81 and #83 refuse it with no cause) and the runtime reported each as Gap::PartialThreadgroups at site Translator. - error: PartialThreadgroupsCause (ComputeDerivatives, OtherForm, SharedSliceWrite, TileFunction, VoteWord), Cause::PartialThreadgroups and Unsupported::partial_threadgroups. Each site names its cause: compile.rs's analyze_one (the variant beside another form), mesh::plan_partial_groups (a tile function, compute derivatives, an imageblock slice write every invocation shares) and simd::divergent's barriers (the vote word, still needing the maxComputeSharedMemorySize limit). Feature::PartialThreadgroups' doc lists today's causes (the stage-input region and the emulated SIMD-group tier are no longer refused). - runtime: VariantRefusal reads the cause (the vote word's, a structure's, or none) instead of the needs; PartialThreadgroupsSite gains Structure { cause }, the translator's type re-exported; Translator stays for a refusal that names no structure. The cache directory keeps each refusal under a marker of its own (cache::REFUSALS: the old two plus one a structure), so a refusal read back names the same cause. - Tests: the red test, and a runtime unit test that every cause maps to its refusal and its marker and back. README: the gap's sites. REFUSALS.md and basis.rs regenerated; api_surface row; api_signatures.tsv blessed. - SEMANTICS_VERSION 2362 and RUNTIME_VERSION 2567: the refusal and the dispatch's gap say more (renumbered at landing: SEMANTICS 2360 and 2361 went to the seq_cst fence and the argument buffer border texels, RUNTIME 2566 to the seq_cst fence). Verified (jobs m3-max-84834, -84836, -84838, -84839, -85025): - red, the red commit's crates over this commit's target: 3 tests run, 0 passed, 3 failed, each refusal PartialThreadgroups with no cause; green: 4 tests run, 4 passed (the three and a_variant_refusal_keeps_the_translator_s_cause). - product suites: 3495 tests run, 3494 passed, 1 failed, 24 skipped; the failure is golden_hashes_match_the_table, whose table is re-blessed on development. Validation: 1348 passed, 2 skipped. Conformance: 1053 passed, 0 skipped. Doctests pass. - clippy --workspace --all-targets --all-features -D warnings: plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, each EXIT=0. Rustdoc with -D warnings and scripts/api-docs: EXIT=0. Not verified here: which cause the walk's kernels #81 and #83 name (a probe on the walk's library, reported apart). |
||
|
|
4ccbde14e0 |
Byte copies: the sample enums are exhaustive, the draw key derives no Debug; REFUSALS.md, basis and signatures regenerated; the replay counts the copies; the conformance case declares the note
The second build (lavapipe job m3-max-84547) stopped on a match over SampleAspect in the runtime, which #[non_exhaustive] forbids across crates, and on a Debug derive over ash's Format, which has none without its debug feature. SampleAspect and SampleWrite become exhaustive (class E in api_surface): a runtime handles each aspect and makes a draw of each write. The replay's per-frame metrics gain stencil_bit_draws and sample_copies. The conformance side announces Texture::SAMPLE_DEPTH_COPY_NOTE for a copy into a multisample Depth16Unorm, which the buffer-depth-samples d16 rows declare; the case's doc states the current form and its refusal of a 32-bit float depth instead of the old form's -0 difference. |
||
|
|
0ce2f39b71 |
Translator: the resident core deleted; every device compiles the one form, and the tests run it
Every device now compiles the identity domains, the one form: a kernel's
buffer arguments are bound as storage buffers of set 0 where the device
binds them (DeviceProfile::binds_kernel_buffers) and are reached at their
device addresses elsewhere, as every other stage's are; vertex attributes
are fetched by fixed-function vertex input; textures and samplers are
elements of the identity arrays of set 1, named by their resource IDs.
What the one form does not lower is a typed refusal,
Unsupported{IdentityDomains, NotImplemented} with the IdentityCause the
previous commit names.
Deleted, with everything only they reached:
- the device policy (device/policy.rs) that chose the resident-table
domains, and the resident root table, handle table and their facts;
- the heap raw reads (lower/sampler/heap_raw.rs, lower/texture/heap_raw.rs),
sampler footprints, bind/texel_parts.rs and bind/status.rs;
- the lockstep orders' barrier tiers, which no order key adds now
(OrderKey::of orders nothing).
Tests: 274 tests that only the resident-table policy compiled (development's
DevicePolicy::RESIDENT_TABLES, which only tests built) are deleted, among
them 15 whole files (argument tables, cross-class, device replay, dynamic
roots, two extended-range files, image shapes, mesh barriers, profile F,
separate samplers, sparse unmapped, tile, wide, sweep and the footprint
tests); each deletion's reason is listed with the READY. The others are
ported to what the one form compiles and names today: census names,
push fields, refusals with their causes, and run values. A new interpreter
harness (tests/identity_harness.rs) binds a dispatch's buffers at device
addresses and its textures as identity-array elements. Census naming is
unchanged. The validation tests that read compiled modules (coverage,
companions, the authored compile census, specialization) assert the one
form's present strings. The extended-range levels and volume tests, whose
mip filters development built under the resident tables, become two tests
of the one form's answer, which is development's default policy's: a 2D or
3D sample of an extended-range slot texture is refused, TextureState
(lower::texture::identity_class holds no class for it); a padded form's 3D
sample stays the lowering's NotImplemented(Format). Development's new
thread-local test binds through the one form's harness, and its
handle-web test (every_handle_web_an_instruction_observes_is_refused)
compiles on the default profile.
SEMANTICS_VERSION 2355 and ARTIFACT_FORMAT_VERSION 607 (cached
translations and artifacts change). docs/REFUSALS.md is regenerated and
runtime-sources.sha256 is pinned at this tree.
Verified at the stack's tip, which differs from this commit only by the
five commits after it; the jobs and their results are named in the READY.
|
||
|
|
a8ccda7cc6 |
Translator: an identity-domains refusal names the form it met
Feature::IdentityDomains with Needs::NotImplemented covered every form the identity domains do not lower behind one name; only a diagnostic symbol said which, and slot.rs's refusal of a storage texture access without its bound format named nothing. An identity refusal now carries Cause::Identity(IdentityCause), one variant per refused family, the way an access or tessellation refusal names its cause; sites that refuse the same family share a variant, none is named by a file, a line or a string of its own: - ObjectOrMeshStage: a function of a stage other than a kernel, vertex or fragment function (select.rs identity_refusal). - Descriptor: a buffer argument not reached through its device address, or a descriptor beyond a bound kernel's storage views (identity_refusal). - EncoderValue: a push field the identity window does not carry (identity_refusal). - HeapResource: an argument buffer's texture of a type or handle class the identity arrays hold no element for, read as raw extended-range texels, decoded, read through another numeric type, or through a handle that reads its table entry beyond its element (identity_refusal; link.rs's handle-class binding). - TextureState: a texture argument of a type the identity arrays hold no element of, or state of a bound texture or sampler beyond its resource ID (identity_refusal; sampler/mod.rs's identity sampling of a type with no identity class). - SamplerState: a sampler the identity sampling does not take, a minimum level or emulated filter the function specializes, a 1D bicubic filter (identity_refusal), and a reached anisotropic slot sample (sampler/anisotropic.rs). - ConstantBlob: constant data past the module's bound read through memory. - SeqCstFence: a sequentially consistent fence (sync/barrier.rs). - StorageTextureFormat: a storage texture access the device takes only with a declared format, whose bound format no input names (texture/slot.rs, which named no form before). The diagnostic symbols stay. The device-level refusal of a device without bufferDeviceAddress and shaderInt64 (derive.rs) names its needs and no cause. Feature stays IdentityDomains, so validation's outcome key and the census are unchanged, and the golden and engine table cells (feature and needs only) do not move; no version bump. Tests: the error module's Display test of an identity refusal with and without a symbol; the cause asserted at the 1D bicubic, the storage texture without its format, the constant blob, the seq_cst fence and the texture argument refusals (engine_identity) and the replay variant's encoder value (pipeline/compile tests). api_signatures blessed (IdentityCause, Cause::Identity), api_surface lists the enum, REFUSALS.md regenerated (the sites are built through error/mod.rs's Unsupported::identity), docs/API.md's error table and the identity domains' paragraph name the cause. runtime-sources.sha256 unchanged: no runtime input is edited. Consumer uses (consumer-uses.sh, read-only, over the consumer's development 90214271ed and its lane tips of the last day): IdentityCause, Cause and IdentityDomains, 0 hits. The consumer reads Unsupported::cause only through its Display (rt_platform diag.rs refusal_name, unbuilt.rs), so an identity refusal's name there now carries its cause. |
||
|
|
b54d8d46bc |
Docs: the published crates' rustdoc states each measurement by its card and OS, not by our job id
What: every lab job id (m3-max-N) in a doc comment of the three published crates' product sources is removed: 91 ids, and one list written as a range and bare numbers, on 72 lines over 17 files. The card, driver, OS and probe each sentence already names stay. Each changed sentence is rewrapped at 100 columns from the id's line to its paragraph's end. docs/REFUSALS.md is regenerated: its Basis column carries those doc lines' evidence (14 rows). Why: the planner's rule. Docs say the measurement (card, OS), not our job numbers. The ids stay in the commit messages that already carry them. A token comparison of each file against its parent shows only id phrases removed: "(job m3-max-N)", ", job m3-max-N", "potluck job m3-max-N", "(m3-max-N)" and id lists of the same forms. One line that held only "(job m3-max-49358)." in submit.rs is folded into the line above it. Not changed here: the runtime README (217 lines with ids), docs/API.md (20), docs/REPLAY-STREAM.md (2), docs/VALIDATION.md (1), docs/CONFORMANCE-COVERAGE.md (1772, generated from the conformance ledger), plain // comments (blit.rs 3, conformance cases 3, tests 5), test modules' and unpublished crates' doc comments. Verified: refusal_surface.py --check passes. basis.rs regenerates unchanged. runtime-sources.sha256 is unchanged (44066e69...): none of the files is its input. rustfmt --check passes on each file. Rustdoc, private rustdoc and api-docs in the job the READY names. |
||
|
|
bac1ab1bd9 |
Docs: metal-measured covers Metal's validation stop; the bound form's evidence is the real cards
What: the `metal-measured` basis (refusal_surface.py's vocabulary, and `RefusalBasis::MetalMeasured`'s doc, which states it for the API) now says that Metal's API validation stopping the call counts: documented Metal then defines no answer to it, whatever plain Metal does without the validation. docs/REFUSALS.md is regenerated with it. docs/VALIDATION.md's device-test part gains one sentence: the bound form of a compute function's buffer arguments has its evidence in the device tests on real cards whose query takes it (each test's `M2V-FORM` line, `tests::pool_reach`'s assertion of the form the query chose), and CI's lavapipe legs take the address form, since lavapipe's `maxStorageBufferRange` of 128 MiB is below the 2 GiB and 15 bytes the query needs there. Why: the definition said "Metal itself refuses the input", while runtime refusals declare `metal-measured` on the strength of Metal's validation layer stopping the call (in error.rs, among them IndexedPatchDrawWithoutIndexType, PatchIndexBufferOffset, ViewportNotFinite and StencilAttachment), and the conformance allowances say a validation stop "is not Metal refusing it" for their own verdict. The two answer different questions; the definition now says which one the basis answers. The lavapipe sentence records that CI's lavapipe legs never run the bound form, so a reader of a green lavapipe leg does not take it as that form's evidence. The numbers: job m3-max-84123 (lavapipe, release, three runs a workload) printed `bound_dispatches_per_run` 0 for all 48 harness workloads, and `address_dispatches_per_run` above 0 for the 43 that dispatch. lavapipe's limits are those of the committed lavapipe profiles (maxStorageBufferRange 134217728, minStorageBufferOffsetAlignment 16, so the query needs 2^31 + 15). Verified: refusal_surface.py --check passes, and the regenerated basis.rs is unchanged; runtime-sources.sha256 unchanged (error/mod.rs is not an input: 44066e69...). Rustdoc in the docs job the READY names. |
||
|
|
71a5393966 |
Translator: an imageblock refusal names its cause (ImageblockCause)
Feature::Imageblocks covered about ten structures with one untyped refusal, so a walk's counts could not tell them apart. Each site now names the structure it met, in Unsupported::cause (Cause::Imageblocks), as Cause::Access and Cause::Tessellation do: - MultisampleOperation: the front end's undecoded multisample operations (get_imageblock_samples, get_imageblock_num_colors, get_color_coverage_mask, the masked implicit store), set where the front end's refusal converts; - Stage: an explicit imageblock or an imageblock intrinsic outside a kernel or tile function, or an imageblock view outside a fragment function (param_family, use_imageblock); - TwoImageblocks, DataSize, Layout: why the planner gives the kernel's explicit imageblock no region (more than one; no or zero data size; an alignment that is not a power of two, cells past 4 GiB, or an unaliased explicit one beside the implicit one). The planner's imageblock() returns the cause and ArenaLayout keeps it (imageblock_refused) for use_imageblock to refuse with; Missing where the kernel declares no imageblock at all; - DataOperands: air.imageblock_data operands other than (coord, 0, 0); - ParameterValue: the imageblock parameter's value selected (access::select_param); - CellPointer: an imageblock-space pointer that air.imageblock_data does not make, outside a tile function (the planner); - FragmentData: a fragment function's [[imageblock_data]] input (fragment::select_param) or output (stage_io); - SliceWrite: a slice write of a shape not modelled (texture::select, texture::slice). Golden tables are unchanged (their outcome text names no cause). REFUSALS.md regenerated, the signatures table blessed (ImageblockCause, Cause::Imageblocks), the api_surface list and docs/API.md's Unsupported row name the new enum. SEMANTICS_VERSION 2354 (main renumbers at landing): a refusal's text changes. runtime-sources.sha256 follows from the job. Verified: pending (the red tests and the suites). |
||
|
|
69033afcd4 |
rt: a Shared heap's texture on a device without unified memory is an image of its own
The L21 ruling, the third use of rule 2's unified-memory query (Vulkan's device type). On an integrated or CPU device a Shared heap's image texture lies in its heap, as before. Elsewhere it is an optimal image of its own in device memory, made as new_texture makes one but not zeroed (Metal's heap textures are not), and its heap range is left unused. Before, a discrete device either refused the placement (Gap::HeapTexture where its optimal images take no Shared type: the RTX 2080 and 3090 on NVIDIA 620.70.06) or bound the image in system memory, which every read crossed the link for (97 times a Private heap's time on an RX 7900 XTX, job m3-max-79841). How: heap_source decides by core.unified_memory() and the block's class. The own form checks the placement against heap_texture_size_and_align's answers by the same rule the in-heap form uses (heap_place, factored out of make: a heap range past its block, a texture past the heap's end, a byte off the alignment are Refusal::HeapTexturePlace), then makes Source::HeapOwn: Bind::Pooled (a place in a texture block or an allocation of its own, which spills as a texture's does), the heap's hazard id kept, no alias Placement, and Under::Heap with at None, so use_heap still covers it (heap_block) and blits see no shared span (bound). Texture buffers and textures over heap buffers are untouched. Docs: AGENTS.md rule 2's unified sentence gains the clause (the count stays fourteen); the runtime README's heap text and known gaps (the device memory sum beside the heap's block, where it runs out, and the earlier speed row); new_heap_texture(_for_views), heap_texture_size_and_align, has_unified_memory and Gap::HeapTexture docs; docs/API.md and the conformance heap-size side's step 2; docs/REFUSALS.md regenerated (HeapTexturePlace's site is heap_place). RUNTIME_VERSION 2564 (renumbered at landing: development held 2563). runtime-sources.sha256 unchanged (guard PASS, m3-max-84127). Verified: red FAIL / new PASS on the RTX 3090 (build m3-max-84138, run 84144), the RX 7900 XTX (84137, 84221; rt suite under m2v_gpu 993 passed, 4 skipped, 84222) and the Iris Xe (84227, 84238); CPU suites 84127 (conformance + rt 1279 passed, 2 skipped); clippy plain 84180, m2v_gpu 84172, m2v_cpu_icd 84181, rustdoc + api-docs 84182, all EXIT=0; states-only play on lavapipe 84256 equal to the base (gb-3090-r2 10643 render / 15299 compute, windrag-780m-b4-um790 8972 / 225, 0 refused). The consumer's arm64 guest walk on the RTX 3090 at pin S (m3-max-84046) asked for no texture on a Shared heap, so the evidence is the device tests and timing. |
||
|
|
e730fbddbb |
Runtime: AttachmentPlace's basis is Metal's own refusal, measured on the M3 Max
What: Refusal::AttachmentPlace's Basis line said `ours`. It now says
`metal-measured` and cites the committed probe resolve_depth_planes.m
(conformance crate, Apple M3 Max, macOS 27.0.1, job m3-max-73495). With
Metal's validation layer on, a resolve into slice 3 of a 2D texture ends
the process at the encoder ("Slice is 3, but the texture has only 1
slices"), and so does a resolve at depth plane 3 of one ("depth plane is
3, but the texture has a depth of 1 at mip level 0"). With the layer off,
plain Metal writes slice and plane 0 instead. A level past the texture's
was not run, and the line says that part is ours. docs/REFUSALS.md and
error/basis.rs are regenerated by scripts/refusal-surface/refusal_surface.py.
AttachmentPlace's basis() now answers MetalMeasured, and the Refusal
table's counts move one row from ours to metal-measured.
Why: the bug row said plain Metal (layer off) takes resolveSlice 3 into a
2D texture, and the planner's 11-25 ruling was that it needed a read
first, with rule 1 applying if Metal's layer refuses it. The read is the
probe above: the layer refuses it, so the refusal stands under rule 1,
and its basis now cites that evidence. Behaviour is unchanged.
Verified: refusal_surface.py --check exits 0 on this tree. The
runtime-sources fingerprint, recomputed from the tree, is unchanged
(44066e69): the runtime crate's sources are not inputs to it. No
signature changes, so api_signatures.tsv is untouched.
|
||
|
|
ad09d74961 |
Stage input: an indexed step fetches at any step rate, as Metal reads it
What: a kernel [[stage_in]] layout of an indexed step (ThreadPositionInGridXIndexed or ...YIndexed) at a step rate past 1 is now fetched: the thread's position on the axis divided by the rate, clamped to the stage-in region's last element, looked up in the index buffer, plus the region's origin. Step::Indexed carries its rate, and the grid and indexed steps share stepped_position, the one division. Why: an M3 Max read index[min(x / rate, size - 1)] plus the origin at rates 2 and 3 (job m3-max-68668), so the refusal guarded a measured answer. The runtime's Gap::StageIn of IndexedStepRate and the translator's Feature::KernelStageIn refused it; both had no other site, so both variants are deleted. Consumer search for the runtime variant: `git grep -n -w IndexedStepRate development -- '*.rs'` in the consumer's checkout at 40c2b1abeb has 6 hits, all in its refusal-label table and the test that expects this refusal (rt_platform/diag.rs 8, 3079, 3088, 3094; rt_platform/compute.rs 1246, 1382), which change with this answer; Feature::KernelStageIn has 0 hits there. Also: SEMANTICS_VERSION 2350 -> 2351 (the modules of an indexed fetch past rate 1, and a refusal gone). docs/REFUSALS.md regenerated (refusal_surface.py) after reach.tsv lost the feature's row; the signature table blessed (two variants out). The runtime README, the encoder's and pipeline's docs and the gap's docs say the indexed element at any rate. runtime-sources.sha256 unchanged (pin-compute, a92fe0a8...). Verified here: signatures.py --bless moved only the two variants; the refusal surface regenerated with 0 variants unmarked. The red tests of the commit before this one, and clippy, rustdoc and the suites, run in the jobs the lane's report names. |
||
|
|
599da8cacf |
REFUSALS: regenerate after the coherent-image landing
The coherent access beside a storage image no longer refuses (
|
||
|
|
6191bf763d |
Translator: mode-2 fragment storage writes run: Metal's RGB9E5Float word, the device's half and RG11B10 rounding
Under TextureWriteRoundingMode::NearestEven (Apple's textureWriteRoundingMode 2) every fragment storage write now runs; the refusal NotImplemented(PrivateRenderState(TextureWriteRounding)) and the facts RuntimeFact::StorageTextureWriteRounding and HeapWriteRounding are deleted. Measured first, by the probe committed here as crates/metal2vulkan-conformance/probes/texture_write_rounding_storage.m (an Apple M3 Max under macOS 27.0.1, jobs m3-max-82793 and m3-max-82824): a fragment function writes 65,536 texels of float and of half texels into RGBA16Float, RG11B10Float and RGB9E5Float storage textures, once in a pipeline of mode 0 and once of mode 2. Mode 0 rounds every channel toward zero. Mode 2 rounds a half-float channel to nearest even, a value past the midpoint above 65504 to the infinity (262,112 of 262,112 non-NaN channels); an RG11B10Float channel to nearest even, held at the largest finite value (196,583 of 196,583, float and half texels alike); and an RGB9E5Float texel's mantissas half up under the largest clamped channel's exponent, moved up where that mantissa rounds to 512, which is Vulkan's own rule for the format (65,536 of 65,536 texels, float and half alike). Every mode-2 code lies within one unit of mode 0's. - RGB9E5Float: the word is the module's own arithmetic (texture::rgb9e5_word), so under mode 2 it is now Metal's mode-2 word exactly: the product times 2^(25 - e) converted toward zero keeps the half's bit, one added and a shift right round half up, and a largest mantissa of 512 moves the exponent up before every mantissa is rounded again. Write::half_up carries it to a SharedExponentBits slot's write (emit::to_image) and WordsPlan::half_up to the texture-buffer words' write routine. A kernel, tile or other function, a word attachment and the default mode keep the truncation. - RG11B10Float, float and half texels: the device's conversion as at the default mode, recorded as PrecisionNote::DeviceColorConversion (unconditionally for a declared format, under small_float_storage's clauses for a formatless slot or a heap). A half-float channel's note for a float texel stays half_storage_facts's. The note's storage clause and its catalogue line in docs/API.md state the measured counts. Red tests: - lower/arith/tests/color_write.rs rgb9e5_words_are_metals_at_either_mode: the emitted word, run in the SPIR-V interpreter over the probe's 65,536 texels (probe_texels rebuilds them from the probe's SplitMix64; its input and half hashes are checked against the probe's), hashes (FNV-1a) to the texture Metal wrote, bit for bit, for float and half texels at either mode. It is red with the half-up arm disabled. - tests/engine_link.rs mode_two_fragment_texture_writes_round_as_metal_or_the_device replaces mode_two_refuses_fragment_texture_writes_it_would_round. It draws over an RGBA32Float attachment, whose output records no note (the previous test's RGBA8Unorm attachment recorded DeviceColorConversion itself, which made the earlier commit's note check vacuous). Every case compiles and links valid at either mode. A declared R16G16B16A16 slot records DeviceColorConversion at both modes, a B10G11R11 slot under mode 2 alone, and an RGB9E5 word slot at neither. It is red with the product files at the base, which refuse. Public surface: PrivateRenderField::TextureWriteRounding and the two RuntimeFact variants are removed (api_signatures.tsv rows). The consumer's checkout at a20576e1fd has 0 hits for PrivateRenderField, StorageTextureWriteRounding or HeapWriteRounding (git grep). The mechanism test's variant indices move StencilBitDraws and RobustStorageBuffers into the two freed places. docs/REFUSALS.md is regenerated. Not in scope, a follow-up: a texture buffer of half-float or RG11B10Float held as words (texel_buffer_form) converts by the module's own toward-zero routine, recorded under the same note. SEMANTICS_VERSION (refusal removed, notes and words under mode 2) and ARTIFACT_FORMAT_VERSION (two RuntimeFact variants removed from the codec) each move to the next number. runtime-sources.sha256 re-pinned (4361761c): the edited translator sources are runtime inputs. Landed with SEMANTICS_VERSION 2337 (renumbered above development's) and runtime-sources.sha256 4361761c, recomputed on development. |
||
|
|
1ee4cd95d5 |
Runtime: the caller's RestoreFence is called around a restoring make's save, move and write-back
What: Device::texture takes the fence that Buffer::new_texture_fenced and
Buffer::new_texture_in_place_fenced pass. On a restored make alone (in place over host memory's
import, Keep::Restore), after the refusals ahead of the restore, the make runs on its own thread:
it waits for the progress already submitted (Work::progress), calls the fence's before, adds the
image's move home to the upload (Work::home), flushes, waits for that value, and calls after.
before comes ahead of home and not just ahead of flush because a commit from another thread can
carry the upload out as soon as the move is in it (take_uploads). after is called from a drop
guard (Fenced), so it runs on every exit once before returned Ok: the make done, Quiesced from
home, a lost device in the wait, or a panic unwinding. A before that answers Err(reason) refuses
the make with Refusal::RestoreFenceRefused { reason }. Then nothing is recorded, saved, moved or
written back, the texture made so far is dropped, nothing counts, and after is not called: before
undoes its own work, and after always pairs with a before that returned Ok. Every other make, and
every make with no fence, takes the match's other arm, so an unused seam costs one branch. The
make itself is unchanged.
Public shape: a trait object (&mut dyn RestoreFence, before -> Result<(), &'static str> and after)
on two new twins, not an Option argument on new_texture and new_texture_in_place. This tree has
about 90 four-argument calls of those two, and the consumer's development has 6, of which 2 need
the fence; the twins leave every other call unchanged. A &mut trait object lets before keep a guard
or a token in the fence for after to release. The reason is &'static str so that the refusal stays
Copy, as Refusal is.
Docs: the runtime README (Imported blocks, "The caller's fence"; the known gap of memory blocks;
the API list) states the contract. Between before and after the runtime saves, moves and writes
back the block's bytes, so a host write to them in that span is lost; the span holds the whole
submission that carries the upload, a group's included. A caller with such a writer fences it
there; one without passes nothing. Vulkan documents no form that keeps the bytes without the
write-back (sections 12.10.1 and 7.7.6: an acquire keeps bytes only after the other owner's
release; section 11.2.6: host-pointer memory is shared with the host under host access
synchronization). The rustdoc of the trait, the twins, the refusal and Buffer::new_texture says
Metal has no such span. Refusal::InScheduledHandler's doc names the twins. docs/REFUSALS.md is
regenerated (RestoreFenceRefused, one site). Not touched: RUNTIME_VERSION and runtime-sources.sha256,
whose inputs are the translator's listed files (metal2vulkan/src, metal2vulkan-air/src); this change
edits none of them.
Verified, red: at 4e941d8015 (the fence passed nowhere) the new test failed on lavapipe (llvmpipe,
LLVM 23.1.1, Mesa 26.2.4), job m3-max-82710. With no fence, 632 of 86,252 stamped words were lost.
With the unwired fence, 7,507 of 98,879 were lost, 0 writes found the gate held, and before and
after ran 0 times. Green runs and the gate follow in the lane's report.
|
||
|
|
4a96499072 |
Translator: an unknown runtime-library routine is refused as its family, and AGENTS.md allows the families
AGENTS.md's name rule now also allows the body-less runtime-library routines Metal's compiler links by symbol: the ___metal_* maths routines and the __tensorops_impl_* family. Their declarations have no body, so the symbol is the only thing that says what the routine is. An unknown member of such a family is a typed refusal. Both families were already gated on that structure. The bitcode reader classifies a routine name only on a declaration, and the matmul2d lowering takes a __tensorops_impl_matmul2d_op_* function only when it has no body and is in air.externally_defined. Two tests now show that a defined function of either name is the module's own: - a_defined_function_named_as_a_runtime_routine_is_the_modules_own (bitcode, through llvm-as); - a_defined_function_named_as_a_tensor_op_is_the_modules_own (canon). Both tests pass at the base as well. An unknown member used to be refused as Linking, the refusal for an undefined function that linking could supply, which these never are. Now the post-check refuses a surviving call to a body-less declaration as its family: - an unmodeled ___metal_* routine as an unknown intrinsic, the same refusal an unknown air.* name gets; - a __tensorops_impl_* function in air.externally_defined, outside the matmul2d ABI, as Tensors, which is how the matmul2d lowering already refuses its own unmodeled functions. The same name outside that section is not a family member, and still needs linking. intrinsics::is_routine_family and tensor_ops::in_family state the two families. docs/REFUSALS.md lists the new Tensors site. Verified on the CPU with no device, in job m3-max-82525 at a commit of the same tree ( |
||
|
|
11c211ca64 |
Translator, runtime: no texture buffer access takes an own view a texture buffer held as words lacks; the own-view fact and gap go
The planner's ruling (b) after (i): with a read through a sampler built by the words, no access MSL writes leaves a texture buffer on its own view on a device that holds some format as words, so the runtime's Gap::TexelBufferOwnView and its plumbing (the kernel interface's own views, the render content's, the encoders' checks before binds_words) go, and with them RuntimeFact::TexelBufferOwnView, which nothing produces now. Each access the words do not build now has an outcome that is not wrong output: - A read that observes its residency is the words': its status word is 0, Metal's for a texture that is not sparse, as a texture buffer never is (with_word's 0); words::wrap no longer sends it to the own view. - A read of an sRGB texture's codes is never a texture buffer's: srgb_texels answers false for a buffer's shape, so Read::raw is false there. Were one met, the compile refuses it. - A read or write in another numeric class (LoweringInputs::cross_class): the runtime never sets it, and under the identity domains no variant is chosen; on a profile that holds some format as words the compile refuses such an access (Feature::Format, not implemented). - A write of fewer than four lanes: the AIR front end takes a colour texture's write of four lanes alone (texture.rs, texel_ok), so such a call is an unknown intrinsic on every profile. The new authored case a_texture_buffer_write_of_two_lanes_is_refused_on_every_profile (an inline .ll of a8r_buffer_write narrowed to <2 x float>) checks Feature::UnknownIntrinsic on lavapipe and moltenvk-m3 under the identity domains. Docs: words.rs module docs and wrap's doc, the runtime README's known gap rewritten as the refusals; REFUSALS.md and the error basis regenerated (Gap 32 -> 31); api_signatures drops the fact's and the gap's variants. The mechanism test's variant count returns to 87. The fixture census at (i)'s tip, the condition the ruling set before this deletion (scratch job m3-max-81238, steelbrain/scratch-tb-census): 18 fixtures naming texture buffers, 1477 compilations, no own-view fact on any profile that holds a format as words. Verified with (i) at 355c902082 (gate m3-max-82186): fmt, clippy in three configurations, rustdoc, the validation suite 1322 passed (3 skipped), the conformance suite 1050 passed, doctests; the product suite 3723 passed with four reds a bless clears (the golden printout, the golden hashes, the inventory, and llvm_as part_3_of_8 for tb_word_formats.ll, which has no rows until then), the new authored case among them passing; the card legs as (i) lists them. |
||
|
|
c56000f9e4 |
Translator: a texture buffer held as words is read through a sampler by the words
A read through a sampler (MSL 4.1's read(sampler, coord)) of a texture buffer took the texture's own view alone, and where the device held the bound format as words the runtime refused the draw or dispatch (Gap::TexelBufferOwnView). The words now build it: the site reads the sampler's state (through::state), addresses the index against the words' width the way the own view's read addresses it against its size (through::buffer_index, which address() now calls for a texture buffer: the first texel outside, the nearest where a runtime slot sampler's s mode is clamp_to_edge, the border where the t mode is clamp_to_zero or clamp_to_border), calls the read routine at the addressed index, and where it reads the border hands back the border texel of the format the word's code names (words::border_texels), the alpha 1 of a format without alpha included. Such a read no longer records RuntimeFact::TexelBufferOwnView; the remaining own-view accesses are a read that observes residency, a read or write of another numeric class, a read of an sRGB texture's codes and a write of fewer than four lanes. The site's word estimate adds the sampler's addressing again and THROUGH_WORDS (the view's size, the width, the border texels by code). Tests: engine_identity's read-through test now asserts no own-view fact and a words routine where the profile holds formats as words. The runtime test reads rt_buffer (mirrored_repeat), rt_buffer_ow (clamp_to_border, opaque white) and rt_arg_buffer through three runtime sampler states (clamp_to_edge; t clamp_to_zero; t clamp_to_border opaque black) over six formats in either form, against Metal's texel in bounds and outside. Docs: words.rs module docs, the fact's and the gap's docs and Display, the runtime README's known gap, RESOURCE-ID.md; REFUSALS.md regenerated. Verified at the hand-over tip 355c902082, with (b), on development |
||
|
|
c06f7e89db |
Translator, runtime: a texture buffer access the words do not build keeps its own view; a texture buffer held as words there is a gap at the draw or dispatch
The planner's ruling on (A)'s read-through loss, option (ii). Under the identity domains on a
profile that holds some format's texture buffers as words, words::wrap refused the whole module
for a texture buffer access its routines do not build: a read through a sampler, one that
observes residency, one in another numeric class, an sRGB code read, a write of another class or
of fewer than four lanes. The ceilings run (job m3-max-81042) lost three fixture rows that compile
on the base, development
|
||
|
|
5a933f58cf |
Docs: REFUSALS.md regenerated: the render content's stage_module builds RenderPipeline refusals
The words twin moved the stage-module refusals of RenderCompiled::of into stage_module (python3 scripts/refusal-surface/refusal_surface.py). |
||
|
|
0ad55e1468 |
Docs: the texture buffer word, the formats held as words, their notes; test vectors of the texture buffer word
RESOURCE-ID.md gains the texture buffer word (TextureWord::of_texture_buffer: bits 0-1 padding, 2-7 the code, 8-9 texels per word, 10 a texel of two words; the 39 codes in order) and drops its stale line that a texture buffer has no index. The runtime's README says which formats a texture buffer holds as words and which it still refuses; the KosmicKrisp BGRA8Unorm gap is gone. API.md and PrecisionNote's docs say a texture buffer held as words records SrgbTexelDecode and DevicePackConversion for its float reads and writes, and that its other conversions are exact. tests/resource_words.rs writes texture buffer lines (format, width, word); the table is blessed in a later commit. REFUSALS.md regenerated (one more TextureFormat site). |
||
|
|
2b335a8174 |
rt docs: the memoryless refusal's basis says what is true now
Gap::MemorylessTexture's basis read "render passes are not built", which stopped being true when render passes were built. It now names the reason the refusal stays: a memoryless attachment keeps its contents for the whole render encoder, across the renderings the runtime ends and restarts inside one encoder (barriers after writing draws, the feedback-loop barrier, copies for textures over buffers and Managed copies, shadow copies), and the image that would hold them is not built. docs/REFUSALS.md regenerated (scripts/refusal-surface). Docs only: no behaviour changes. refusal_surface.py --check exits 0. |
||
|
|
39423d92f1 |
ICB: a kernel's indexed patch draws into an indirect command buffer, executed through a layout of indexed patch draws
The owner's 3406 order, the planner's next indirect command kind: MTLIndirectCommandTypeDrawIndexedPatches. The records (pipeline::IndirectDrawLayout) grow by 8 bytes a command for every kind. The control-point indices' address is a third u64 that an execution pushes, and VUID 11103 asks each token's offset to be at or past the one before it, with the draw token last (VUID 11100). So the address cannot go after the draw; it lies past the index token's 16 bytes, at index() + 16. Every command's tail is now 16 + 8 + 4 + 20 = 48 bytes: the stride is index() + 48 (was + 40), the sequence index's place index() + 24 (was + 16), and the draw's arguments index() + 28 (the translator's DRAW_AT, was 20). The cost is 8 bytes a command in every buffer: 160 bytes for 7 vertex and 7 fragment slots (was 152, 5% more), 48 for none (was 40), 544 at most (was 536), which the floor's stride and token-offset limits are checked against. One record shape for every kind stays: a kernel cannot know a buffer's kind when it is translated, so it writes one shape whatever buffer it reaches. The main lane accepted this on the condition that the already-landed kinds' rows run again at the new layout. Translator (lower/access/icb.rs): a render_command's draw_indexed_patches writes what draw_patches writes (the draw's VkDrawIndirectCommand of patches, the factors' and the patch indices' Metal addresses) and the control-point indices' Metal address at the new place (CONTROL_POINTS_AT, IndirectDrawLayout::control_point_indices). Its operands are draw_patches's, with the control-point indices at operand 6. Runtime: Device::new_indirect_command_buffer takes DRAW_INDEXED_PATCHES alone (CommandDraw::IndexedPatches), refused as patch draws are on a device whose executions run no tessellation stage (TessellationStages). Its layout pushes the control-point indices' address where the control stage reads it (FieldValue::ControlPointIndices), holds no index buffer token, ends in TOKEN_DRAW and names the tessellation stages. An execution checks the state's control-point index type against the buffer's kind, as a direct draw checks it against the call: patch draws with a state of an index type are Refusal::PatchDrawWithIndexType, and indexed patch draws with a state of none Refusal::IndexedPatchDrawWithoutIndexType. This replaces the patch draws' check through an empty PatchReads. Docs: the runtime README's ICB section (records, tokens, refusals, floor limits); the API guide's section 1; METAL-COVERAGE (coverage.tsv); CONFORMANCE-COVERAGE and REFUSALS.md regenerated (the two refusals gain the draw site); the API signature table blessed for control_point_indices. Tests: the red commit's engine and runtime device tests; the layout's unit tests at the new offsets, the reset command's control-point place among them; a unit test of the indexed patch tokens. |
||
|
|
dcf039d472 |
rt: a copy between two buffers whose bytes meet goes in chunks of the shift, as memmove
Owner 3406 follow-up to L212. A copy between two buffers whose ranges meet in one block was refused (Refusal::BufferCopyOverlap, basis "ours"). Two buffers placed over each other in a heap are aliases. Metal's validation names copies between buffers among the defined copies between aliases in a placement heap (job m3-max-81493), and plain Metal on an Apple M3 Max gives memmove's bytes for them (probe overlapping_alias_copies.m, job m3-max-81544). Form (blit.rs): - buffer_to_buffer takes whether the two are one buffer and answers BufferChunks. - Ranges apart are one chunk. - Two buffers' ranges whose bytes meet are chunks no longer than the shift |to - from|, the last chunk the rest. The chunk at the end the shift points to goes first: the last first where the destination lies past the source, else the first. So no command's source and destination share a byte (VUID-vkCmdCopyBuffer-pRegions-00117, which each one-region command meets on its own), and no chunk reads a byte an earlier one wrote. - copy_from_buffer_to_buffer records one vkCmdCopyBuffer a chunk with the slabs' execution barrier (between) between two, each counted as a blit barrier. Every hazard between two chunks is a write after a read. - Two ranges on the same bytes copy nothing. - One buffer's overlapping ranges stay Refusal::BufferCopyOverlap. Its basis is now metal-documented: Apple's page for the copy allows the same buffer only "if size is less than the distance between sourceOffset and destinationOffset". The conformance case buffer-blit-overlapping-copies is one buffer, so its ledger row holds. Only its note's wording changed; coverage.py regenerated with no change. - A shift of n bytes takes size/n commands, rounded up. That is the fewest any form without an intermediate takes. Unit test a_copy_between_buffers_takes_ranges_inside_both_and_cuts_two_buffers_bytes_that_meet (renamed) expects the chunk orders both ways, a partial last chunk, and nothing for the same bytes. The rest of its cases are unchanged. Docs: the copy's doc, BufferCopyOverlap (REFUSALS.md and basis.rs regenerated), the runtime README's blit encoders, the tests' module doc. Verified: refusal_surface.py --check exits 0. Green under the validation layer, which fails a test on any message, so each one-region chunk met VUID-vkCmdCopyBuffer-pRegions-00117 on these devices: the 27 blit tests pass on lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M (RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671). The runs built the series before its rebase onto development; the patches are the same. |
||
|
|
2416a42d36 |
rt: copies between a heap texture and memory it aliases are Metal's own refusal, but a whole level between two heap textures
Row L212. Metal's API validation stops a copy between aliases in a placement heap unless it copies between buffers, between linear textures of one row stride, or entire texture surfaces. Source: probe overlapping_alias_copies.m on an Apple M3 Max, macOS 27.0.1, jobs m3-max-81486 and m3-max-81493. The runtime refused all of these as Gap::OverlappingCopy. It now refuses what Metal stops as Refusal::AliasingCopy, and records nothing for it. Form (blit.rs): - buffer_copy: a region that meets a heap texture's memory, either way, is Refusal::AliasingCopy (Metal: "blitting between aliasing resources is defined on a placement heap only when using a blit method copying entire texture surfaces, or when copying between buffers"). - texture_copy: two textures whose memory meets, one placed in a heap, that are not both heap textures copying a whole level into a whole level (whole_level: origin 0, size the level's extent, the view's first level taken off) are Refusal::AliasingCopy. A texture in place over a heap buffer against a heap texture is refused even for a whole level (Metal: "... only when both textures are linear and have the same bufferBytesPerRow value"). - The whole level between two heap textures stays Gap::OverlappingCopy, counted, per the planner's ruling. That is how the consumer reaches copyFromTexture:toTexture:, which Metal's validation takes and the M3 answers with the source's bytes at 0, 128 and 8320 bytes apart. No copy command and no cut reads no byte it writes (VUID-vkCmdCopyImage-pRegions-00124). The form through an image of the runtime's, counted, is built once a guest's run counts the gap. Docs: blit.rs's module and copy method docs; error.rs's Gap::OverlappingCopy (REFUSALS.md regenerated); Metrics::overlapping_copies_refused; the runtime README's blit encoders and their known gaps, which carry the M3's answer and the VUID. The README also cites the M3's answer for a surface's buffer and its own plane (job m3-max-81486). No conformance ledger row covers these shapes. Verified: refusal_surface.py --check exits 0. Green under the validation layer, which fails a test on any message: the three tests pass, with the rest of the 27 blit tests, at the series' tip on lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M (RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671). The runs built the series before its rebase onto development; the patches are the same. |
||
|
|
19d642612d |
Tests: copies between a heap texture and memory it aliases are Metal's own refusal, but a whole level between two heap textures
Row L212. These copies were all Gap::OverlappingCopy: a copy between a
texture placed in a heap and a resource whose memory meets it.
On an Apple M3 Max, macOS 27.0.1, the conformance probe
overlapping_alias_copies.m (jobs m3-max-81486 and m3-max-81493) shows that
Metal's API validation stops most of these shapes with
"blitting between aliasing resources is defined on a placement heap only
when using a blit method copying entire texture surfaces, or when copying
between buffers":
- a buffer and a texture over its bytes, either way;
- the region method between two heap textures that alias.
It stops a heap texture and a linear texture over a heap buffer at its
bytes with "... only when both textures are linear and have the same
bufferBytesPerRow value". It passes copyFromTexture:toTexture: between two
heap textures that alias. The consumer copies that as whole levels through
copy_from_texture.
The new Refusal::AliasingCopy (Basis: metal-measured) names the shapes
Metal stops. docs/REFUSALS.md, error/basis.rs and api_signatures.tsv are
regenerated. A whole level into a whole level between two heap textures
stays Gap::OverlappingCopy, per the planner's ruling. Nothing produces the
new variant yet.
Tests:
- textures_whose_memory_meets_where_one_is_laid_out_by_the_device_are_refused_or_copy_in_no_order
(unit, renamed) expects the two heap textures' whole-level copy still to
copy in no order. It expects part of a level, either way and at an offset,
and a texture in place over the heap texture's bytes, either way, to be
Refusal::AliasingCopy.
- a_buffer_copy_over_its_texture_s_own_bytes_copies_in_slabs_or_in_no_order
(unit) expects a region meeting a heap texture's memory, into it and out
of it, to be Refusal::AliasingCopy.
- every_device_refuses_a_copy_between_heap_resources_whose_memory_meets
(device) expects the whole level onto its alias to be the counted gap,
and part of a level onto its alias and the heap buffer either way to be
Refusal::AliasingCopy. Nothing is recorded, and one refusal is counted.
Verified: refusal_surface.py --check exits 0, and signatures.py --bless adds
the one variant row. Red as expected, under the validation layer, on
lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M
(RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and
the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671): the three tests
fail. The device test says "part of a level onto its alias:
Err(Unsupported(OverlappingCopy { pixel_format: RGBA8Unorm }))", the unit
tests "not a refusal: it was checked". The runs built the series before its
rebase onto development; the patches are the same.
|
||
|
|
5f9287e40e |
Runtime: Buffer::new_texture_in_place, a texture over a buffer in place or a typed refusal
The consumer keeps a texture of its own where the runtime would make the counted copy of a
texture over a buffer, and needs the runtime's in-place texture everywhere else. Buffer::
new_texture_in_place makes what Buffer::new_texture makes where that texture is in place, and
refuses with Refusal::TextureNotInPlace { cause } where new_texture would make the copy, naming
the OverCause its copies would count under. A refusal makes no texture and counts no copy.
One decision in one place: Source::Over carries what the making does with a texture it would not
make in place (Unplaced::Copy for new_texture and a surface plane's texture, Unplaced::Refuse for
the new call). Device::texture refuses at the same two points where it chooses the copy: where
check_over names a cause, and where the linear image made does not lie as the texture's bytes do
(Unmade::Unfit). No new form and no new query: over host memory's import the choice is still
row 1's unified-memory query alone. A texture buffer is a view, never copied, and is made as
new_texture makes it.
The doc comment names newTextureWithDescriptor:offset:bytesPerRow: and lists what is refused;
texture_copy_cause's doc and the runtime README name the new call. docs/REFUSALS.md regenerated
(the refusal's two sites in texture); api_signatures blessed at the red commit.
Verified on lavapipe before the rebase onto
|
||
|
|
cbe89f239d |
Runtime tests: a texture over a buffer made in place alone agrees with the ordinary make (red)
The consumer asked for an in-place-only make of a texture over a buffer: the linear image in
place wherever Buffer::new_texture takes it, and a typed refusal naming the cause wherever
new_texture would take the counted copy, so that the consumer keeps those bytes in a texture of
its own and counts them.
This commit adds Refusal::TextureNotInPlace { cause: OverCause } (Basis: ours), its Display arm,
docs/REFUSALS.md and basis.rs regenerated, the api_signatures table blessed, and a stub
Buffer::new_texture_in_place that makes the ordinary texture. copy_cause's test now runs each
device in both forms (an integrated or CPU device through its two-copy view too), makes each
case in place alone beside the ordinary texture, and adds a render target over its texels alone,
an R8Unorm texture of 13 x 3 at the device's pitch, and RGBA8Unorm and R8Unorm textures over host
memory's import. It asserts that the in-place-only make is in place where texture_copy_cause
answers in place, and elsewhere refused for that cause with no texture made and no copy counted.
Expected red on every device: the stub makes the counted copy where the answer is a cause (the
pitch case at least, on every device).
|
||
|
|
6d9706769a |
rt: a surface plane whose image in place lacks a usage its texture asks takes the copy form
new_exported_surface refused a plane whose texture asks a usage that its image in place does
not hold or export, ShaderWrite's storage for one, with Gap::SurfaceUsage. As ruled for row 5,
that plane now takes the counted copy form with its own reason, SurfaceCopy::Usage { plane }.
The copy form's texture over the block's buffer is an optimal image of the usage the texture
asks. The submissions copy it into the image and back (Metrics::over_copies), so a kernel's
write through a view of the plane reaches the exported bytes by that copy before the host or
the other API reads them.
How:
- Query::plane answers usage_verdict's reason in place of the gap. With nothing else to fail,
its return type drops the outer Result and the pixel_format it carried only for the gap.
- The feedback-loop retry skips Usage, as it skips Tiling and NoModifier, since dropping the
loop does not change the usage asked.
- Gap::SurfaceUsage stays for the Direct3D 11 import, and its doc now says that alone.
Docs, in this commit: the runtime README (the guide's storage paragraph, the copy form's list
of reasons, and a fifth case in the known gaps), REFUSALS.md regenerated (SurfaceUsage's row
and its sites) and the api_surface table (the new variant).
Tests:
- Verdict unit test a_plane_whose_tiling_lacks_an_asked_usage_takes_the_copy_form, with
synthetic features: a LINEAR tiling without STORAGE_IMAGE, where the optimal tiling has it,
takes Usage for a plane that asks storage, and lies in place for one that does not.
- The device test every_device_writes_a_surface_plane_through_a_shader_write_uint_view no
longer accepts Gap::SurfaceUsage at the make.
- The write-back through the copy form's own copy is the same copy_form path the device test
already ran at f997a251fc: on the RTX 3090 (NVIDIA 620.70.06, m3-max-81338) the dma-buf row
took Copy(Tiling) and the copy-form row Copy(Pitch); on the RX 7900 XTX (RADV, Mesa 26.2.6,
m3-max-81352) and lavapipe (Mesa 26.2.4, m3-max-81341) the copy-form row took Copy(Pitch).
Each had the kernel's 2,073,600 texels written through the ShaderWrite R8Uint view, read
back exactly from the surface's buffer.
- No device queried takes Usage for an R8 plane (the row 5 queries m3-max-81308, 81309,
81310, 81314, 81318, 81322 and 81353).
|
||
|
|
0c12c606fa |
Translator: the address form's indexed patches name their cause
The last cause-less Feature::Tessellation refusal of the translator, the
address form's in pipeline/link/tessellation control_plan
("addressed && !fits"), now names TessellationCause::IndexedPatchFactors:
a control-point index type beside a per-instance factor step or a factor
scale where pointers are device addresses used directly, where the
control-point indices' address takes the control stage's push words that
hold the factors' instance stride and scale (control::address_fits).
Every Feature::Tessellation NotImplemented refusal now carries a cause:
the translator's through Unsupported::tessellation, the AIR front end's
through its conversion.
Tests: the link test of the commit before this one (each such pair on
every committed profile of the identity domains); the engine test of the
address form's stepped and scaled descriptors asserts the cause too.
api_signatures blessed (the variant), REFUSALS.md regenerated (the
control_plan site moves under error/mod.rs's Unsupported::tessellation).
runtime-sources.sha256 unchanged: neither file is a runtime input.
|
||
|
|
ce337e89a7 |
Docs: the overlap refusal's basis cites the Mac readings; a DontCare store is a known gap
Refusal::BufferCopyOverlap's Basis line kept "ours" with no reading of Metal behind it. It now cites the two: on an Apple M3 Max, macOS 27.0.1, arm64 and x86_64 under Rosetta (job m3-max-80419), and on a Radeon Pro 5300M, macOS 26.7.1 (job m3-max-80501), every overlapping copy equals memmove's, forward and backward, Shared and Private, 64 bytes to 16 MiB, five runs each; on that Mac's UHD Graphics 630 a forward overlap of 64 KiB and up differs from memmove's in each of five runs, at the same first byte and the same count of bytes. Metal's validation layer was on in both and stopped none. The kind stays "ours": the readings show plain Metal takes the copy, which the refusal-surface script calls metal-takes, and the runtime's RefusalBasis has no variant for it, so naming it is a public type change, not this docs commit. REFUSALS.md regenerated. The runtime README's render encoder gaps gain the DontCare store: it stores, because Vulkan fixes a rendering's store operation as it begins and a pass may become several renderings for commands met after it begins, so a tile-based GPU writes back attachments Metal lets a program discard; not measured on a tile-based phone GPU, no such device in the lab. The counts are from the store census over two replay streams (jobs m3-max-80663, m3-max-80681 and m3-max-80720, the last the one the README quotes, after the census also followed descriptors made by renderPassDescriptor): 6,401 of 80,906 passes over 1,115 frames (5.74 a frame, 7.9%) and 4,886 of 73,212 over 1,036 frames (4.72 a frame, 6.7%), each such pass storing one colour attachment and not caring about a second or its stencil attachment. Docs only: a doc comment, the generated REFUSALS.md and the README. refusal_surface.py --check passes. |
||
|
|
dec74d9cf7 |
Translator: a tessellation refusal names the structure it met
Feature::Tessellation with Needs::NotImplemented covered fourteen refusal
sites behind one name, so a walk's log line ("the translator refused the
feature Tessellation, needing NotImplemented", cause None) could not say
which without the AIR. A tessellation refusal now carries
Cause::Tessellation(TessellationCause), one variant per structure the
sites refuse, the way an access refusal names its AccessCause; sites that
refuse the same structure share a variant, none is named by a file, a line
or a string of its own:
- PatchStep: a layout stepping per patch or per patch control point read
by a vertex function that is not post-tessellation (metal/vertex.rs
fetch_as, fixed-function input; lower/stage_io/fetch.rs, the pulled
fetch).
- PatchInterface: a patch input or a patch builtin in a function that is
not post-tessellation (lower/stage_io/plan.rs, two arms).
- UncountedPatch: [[patch(kind)]] with no count, or a count of 0 whose
control points are read (lower/tessellation plan_entry and select).
- InstanceStepRate, AttributeStep: a patch attribute per instance at a
rate above 1; a step the attribute's input has no element for.
- Builtin, VertexInput, SimdGroup: another builtin, a vertex input, or
SIMD-group semantics in a post-tessellation vertex function.
- ControlPointInput: the AIR front end's Tessellation, which is that one
structure (its two arms in canon post_check); the conversion from the
front end's refusal names it, so the front end's types are unchanged.
lower/tessellation's not_implemented() helper takes the cause, so the
compiler makes each of its sites name one; thirteen of the fourteen arms
name a cause. The fourteenth, the control-point index type
on the address form (pipeline/link/tessellation control_plan) is left as
it is: the drawIndexedPatches change removes that arm.
Feature stays Tessellation, so validation's outcome key (feature_key, the
Debug of the feature) and the census are unchanged; nothing stores the
cause (as for the access cause). No version bump.
Tests: the error module's Display test of a tessellation refusal and of
the front end's conversion; the cause asserted at the fixed-function and
pulled patch-step refusals (metal/vertex.rs, engine_vertex_fetch), the
uncounted patch (reflection), post-tessellation SIMD-group functions, and
a new test of a control-point layout stepping per patch, a patch layout
stepping per vertex (AttributeStep) and per instance at 2
(InstanceStepRate). The commit before this one adds those tests against
the cause-less sites.
runtime-sources.sha256 rewritten: metal/vertex.rs's refusal names its
cause, and no run behaves otherwise. api_signatures blessed
(TessellationCause, Cause::Tessellation), api_surface lists the enum,
REFUSALS.md regenerated (the sites are built through error/mod.rs's
Unsupported::tessellation), docs/API.md's error table names the cause.
Consumer uses (consumer-uses.sh, read-only, over the consumer's
development 33784022f1 and its lane tips of the last day):
Feature::Tessellation and TessellationCause, 0 hits.
|
||
|
|
c50fd04219 |
rt: drawIndexedPatches, and patch draws through a patch index buffer
The runtime refused a patch draw through a patch index buffer
(Gap::Draw of DrawKind::PatchIndexBuffer) and had no indexed patch draw.
The viewer draws every patch with drawIndexedPatches, indirectly, through
a nil patch index buffer and a UInt32 control-point index buffer (reims's
walk at development
|
||
|
|
a3fb852de3 |
rt: a heap makes texture buffers in place in its bytes
Metal's heap makes a texture buffer (MTLTextureTypeTextureBuffer): heapTextureSizeAndAlign answers its texels' bytes at an alignment of 16, and newTextureWithDescriptor:offset: lays the texels linearly in place at the offset (m3-max-80369, m3-max-80398). rt refused both with Refusal::TextureBufferNotOverBuffer. Now: - Device::heap_texture_size_and_align of a texture buffer answers width x texel bytes, unrounded, at 16, or at the device's texel-buffer offset alignment for the format where that is larger (minimum_texture_buffer_alignment). No Vulkan call. - Device::new_heap_texture and new_heap_texture_for_views of a texture buffer place a buffer of those bytes at the offset as new_heap_buffer places one, and make the texture buffer over it as Buffer::new_texture makes one, through the same texel_texture: one buffer view, one form on every device, no query. It takes the heap buffer's heap id and placement, so its uses are the heap's in the hazard sets and its writes mark the heap's aliasing textures stale. - Its backing is TextureBacking::Texture, as Metal answers its buffer with nil. - A placement past the heap or off the alignment is Refusal::HeapTexturePlace. A heap in an exported block makes one too: a buffer view needs no image. - texel_texture's descriptor checks move to texel_shape and texel_width, shared with the size answer. TextureBufferNotOverBuffer stays for new_texture, new_texture_for_views, new_managed_texture and new_drawable_texture. The test also checks HeapTexturePlace at offset 8 and past the heap's end. Docs: the runtime's README (textures, heaps, exported blocks), docs/API.md's heap-size accepted difference, the refusals' docs; docs/REFUSALS.md regenerated. Conformance ledger (docs/CONFORMANCE-COVERAGE.md regenerated): - 22 rows of a one-level RGBA8Unorm, R8Unorm or RGBA16Float texture buffer's heap size in the texture-pairs cases are dropped: the replay now matches them; - 6 rows of a texture buffer of 2 or 7 levels now record Refusal::TextureLevelCount, as Buffer::new_texture refuses it, where Metal's heap answers one level's footprint; - 11 rows of RGBA16Float_XR, YCBCR8_420_2P, Unspecialized and BGRA4Unorm texture buffers' heap sizes now record Gap::TextureFormat; - the device's newTextureWithDescriptor: rows keep TextureBufferNotOverBuffer, their reason naming the heap as the other way to make one. Verified (the change at 6d5f748347 on |
||
|
|
5689683788 |
Translator: a fragment function's primitive id behind a post-tessellation function is the patch's position
Behind an evaluation stage, Metal's [[primitive_id]] is the patch's position in its draw, patch start included, the same in every instance and for every triangle the tessellator makes of the patch (an Apple M3 Max, job m3-max-80266: draws of two patches from patch 0 over two instances read 0 and 1 in both instances; two patches from patch 2 read 2 and 3). Vulkan's PrimitiveId there counts the draw's patches from 0 and restarts in each instance (the specification's PrimitiveId: "The index of the first primitive generated by a drawing command is zero ... reset to zero between each instance drawn ... In a fragment shader, it will contain ... the value that would have been presented as input to the geometry shader had it been present"), so it differs once patchStart is not 0. The translator refused such a pipeline at link, NotImplemented(Tessellation), which a walk's pipeline met behind its post-tessellation [[base_instance]]. The fragment function now reads it through the primitive ID's flat varying (IoRole::PrimitiveId), on every device, one form: a post-tessellation vertex function compiled under LoweringInputs::primitive_id_varying writes Metal's patch index, its patch input at PATCH_INDEX_LOCATION, to that varying at each return (stage_io::PrimitiveIdStore::Patch). Without a patch index buffer the patch index is the patch's position; the runtime draws no patches through one (DrawKind::PatchIndexBuffer stays refused), and the docs state the value for draws without one. The same value reaches every vertex of the patch, so the provoking vertex does not matter. Device::compile_render_pipeline and the render keys decide the varying for a post-tessellation vertex stage as they do on a device without a fragment PrimitiveId; the library answers that without decoding the function (a metallib function's TESS tag, a module entry's air.patch), and a compiled stage from its interface. Link refuses a fragment function compiled to read Vulkan's PrimitiveId behind an evaluation stage as NeedsInput(PrimitiveId), where it refused every such fragment as NotImplemented(Tessellation); docs/REFUSALS.md is regenerated. The varying takes a location as any other: the evaluation stage's outputs are held to maxTessellationEvaluationOutputComponents when it is planned, and link numbers the fragment's inputs below maxFragmentInputComponents / 4, each a typed InterfaceComponents limit refusal past it. Tests: a_fragment_primitive_id_behind_tessellation_is_the_patch_index_varying (MoltenVK's and RADV's profiles: the evaluation stage reads the patch-index input, the fragment stage one flat input and no PrimitiveId, L3), the link test of a fragment that reads Vulkan's PrimitiveId, and the runtime test every_device_reads_a_patch_s_position_as_its_fragments_primitive_id, green on lavapipe (llvmpipe), job m3-max-80338. |
||
|
|
4fe41c795d |
rt: a blit copy with a texture buffer on either side copies its buffer's bytes
Metal makes copyFromTexture:...toTexture: with a texture buffer as the source or the destination.
copy_from_texture refused it as Gap::TextureCopy ("A texture buffer's texels are its buffer's
bytes, which no image copy reaches"). Under the rule that a refusal of what Metal makes is built,
it now copies a texture buffer's texels as the bytes of its buffer (texel_texture_copy):
- Checked as Metal checks any copy: one pixel format and one sample count
(Refusal::TextureCopyMismatch), and each region inside its texture's level and slice (`place`,
Refusal::TextureRegion), sizes of 0 taken as copy_from_texture takes them.
- Between two texture buffers: the region's bytes copied between their buffers by
copy_from_buffer_to_buffer, from each one's offset plus origin.x texels. The same bytes copy
nothing, as the same region of one image does, and bytes that meet are
Refusal::BufferCopyOverlap, as that call refuses them.
- Between a texture buffer and another texture: copy_from_buffer into the texture from the texture
buffer's row in its buffer, or copy_from_texture_to_buffer out of it into that row. That is one
vkCmdCopyBufferToImage or vkCmdCopyImageToBuffer region, checked and ordered as those calls are.
The command buffer keeps both textures. Gap::TextureCopy's doc drops the texture buffer case, and
docs/REFUSALS.md is regenerated. Buffer::new_texture's doc, copy_from_texture's doc and the runtime
README's texture buffer contract say what such a copy does. The texture buffer refusal test no
longer expects the gap from a copy of one into itself; that copy of the same bytes now copies
nothing.
|
||
|
|
772441372c |
rt: a blit between a buffer and a texture buffer copies the region's bytes between the two buffers
A guest's 3D model window stayed blank: it fills an RGBA8Unorm texture buffer placed in a heap by
copyFromBuffer:...toTexture:, which BlitCommandEncoder::buffer_copy refused as Gap::TextureBytes
("A texture buffer's texels are its buffer's bytes, which no image copy reaches"). A texture
buffer has no image: its texels are its buffer's bytes from its offset. So a copy between it and a
buffer, in either direction (copy_from_buffer into it, copy_from_texture_to_buffer out of it), is
now checked as any texture's copy is, by the same checker (`buffer_copy`: the region inside its one
row, level 0 and slice 0, Refusal::TextureRegion past it; Metal's measured layout rules,
Refusal::BufferCopyLayout), and then the region's bytes (origin.x and width in texels times the
texel's bytes, at the texture buffer's offset) are copied between the two buffers by
copy_from_buffer_to_buffer. That path keeps both buffers, takes the Managed copies and the heap
places, and orders the copy as any copy between buffers. A texture buffer's uses take its buffer's
id in the hazard sets, so a later kernel's read is ordered after it. The command buffer also keeps
the texture. Two parts of the generic check don't apply: an image's rows or memory meeting the
region (it has none), and a copy command's offset alignment (vkCmdCopyBuffer takes any). The check
runs without them. Bytes of the texture buffer that meet the other buffer's region are
Refusal::BufferCopyOverlap, as copy_from_buffer_to_buffer refuses them.
Gap::TextureBytes's doc drops the texture buffer case and its basis line ("nor a texture buffer's
copy as a buffer copy; no recorded stream copies a texture buffer"), and docs/REFUSALS.md is
regenerated. Buffer::new_texture's doc, copy_from_buffer's and copy_from_texture_to_buffer's docs
and the runtime README's texture buffer contract now say what a blit with a buffer does. The
texture buffer refusal test no longer expects the gap from copy_from_buffer_with_options. A copy
between a texture buffer and a texture (Gap::TextureCopy) is left as it is.
|