Files
reims-vgpu/conformance/expectations/macos-15/driver-errors.txt
T
Anees IqbalandClaude Opus 5 f5b967b6a5 compute: a multisample texture has no bytes to stage, and refusing for want of them cost the guest its dispatch
Component: Vulkan compute execution and its bind resolution. Pathway: x86 macOS /
Linux Vulkan. Rail: macos-15.

## The API contract

A Metal kernel may declare `texture2d_ms<T, access::read>` and call
`read(coord, sample)`. The only thing that can supply such an image is a retained
multisample target: this repository already states the rule, at
`engine::types::SampledResource::multisampled` -- "linear bytes cannot be uploaded
into one with a buffer-to-image copy" -- and the render rail already enforces the
matching invariant in `engine::exec::validate_sampled_resident`, declining a
sample-count mismatch by name.

The render rail therefore had the whole path. The compute rail refused.

## What was wrong, and why the premise did not apply

`spirv_bind::reflected_compute_texture` folded a multisampled 2D sampled binding
into `UnstageableShape { axis: "multisampled" }`, beside 1D, 3D, cube, buffer and
arrayed. For those five the premise holds: the compute rail stages one flat plane
window or one linear GVA level per binding and produces a single-layer 2D image,
so binding it to another declared shape is a descriptor-type mismatch. For this
one the premise is about bytes that were never wanted. There is nothing to stage
and nothing needs staging -- the samples are already in the resident the render
pass wrote.

The cost was the whole dispatch, every time, under a reason naming the missing
bytes rather than the missing resident.

## The owning invariant

`ReflectedComputeTexture` gains a third classification beside `Plain2d` and
`UnstageableShape`. A multisampled *read* binding is neither staged nor refused;
it has a different source. A multisampled *write* binding keeps its refusal under
its own axis name, `multisampled_storage`, so the two classes cannot be admitted
together by accident.

`ComputeSampledSource` replaces `bytes: Vec<u8>` sitting beside
`resident_bind: Option<..>`. Those were an enum's tag and payload stored apart,
and the third source cannot be spelled in them at all, because it has no bytes --
not valid ones, not placeholder ones. The `ResidentCopy` variant no longer carries
a zero-filled placeholder either: its byte weight is derived from the binding's own
geometry, which is what the request validation already checked it against.

`PreparedSampledImage` becomes an enum whose `MultisampleTarget` arm acquires no
transient, uploads nothing and copies nothing. It binds the registry's own view,
places the resident with one barrier, and records the access it left it in.

Two engine declines carry the hazard the staging path used to: `MultisampleSampleAbsent`
(with `prior`, separating a reclaimed resident from one never created) and
`MultisampleSampleUnusable` (not ready / wrong extent / single-sample).

## Which identity door the bind takes, and why that is a property of the shape

`gva_resident_if_current` is the currency test every rail that substitutes a
resident for guest pages shares: it names the resident and then asks whether the
guest's own copy of those pixels still agrees with it. A single-sample GVA target
has such a copy, so that question is the right one for it.

A multisample target does not. No rail of this device writes a multisample
target's guest pages -- the last unguarded one was closed by a65348ed -- and this
device is the only reader of them. With nothing to compare, the witness cannot
answer; it reports no observed write, and `is_quiet()` is false for "cannot
answer". Measured on the first attempt at this change: `gvaw_quiet=0`,
`gvaw_guest_no_stamp=8`, `gvaw_no_entry=9`, and every `texture2d_ms` dispatch
refused as `resident_pages_written` -- a refusal for want of an answer, protecting
nothing.

So the identity half is split out as `gva_span_identity` and the multisample bind
calls that. It is an extraction rather than a second spelling: `gva_resident_if_current`
now calls it too, so the two doors share one derivation of the registry key by
construction, and the difference between them is exactly the witness-and-readiness
gate. `GvaTargetKey::of` also replaces the hand-written key beside it, for the same
reason its own comment already gave.

The absent-or-unready hazard the currency test stands in for on other rails is
carried here by the engine's `MultisampleSample*` declines at bind time.

## Tests

Owner level:

- `a_multisampled_sampled_texture_is_served_from_a_resident_not_refused`
  (`runtime/spirv_bind.rs`) requires the read class to classify as servable while
  the write class keeps a distinct named refusal. It did not compile on the parent,
  because `ReflectedComputeTexture::Multisample2d` did not exist -- the strongest
  red a classification change can have.
- `a_span_can_be_named_without_asking_whether_its_guest_pages_are_current`
  (`runtime/draw/tests.rs`) requires the identity door to answer for a span the
  currency door refuses, and requires `None` from the first to mean exactly
  `NoGeneration` from the second. That is the gate this change removes, pinned so it
  cannot be quietly re-plumbed through the witness again.

Conformance: `msaa4_color_store_host_sample_count`, added in 8449a303 for this
purpose. Native oracle PASS; guest FAIL on the identified control, three batteries
deep; guest PASS on the candidate, three batteries deep. Its expectation entry is
pruned here, which is the improvement the ratchet records.

## Verification

Rust: `cargo fmt --all` then `--check` clean. All three clippy arms `-D warnings`
clean. 2307 tests passed / 0 failed / 1 ignored, serially. Feature matrix PASS.

Conformance, rail macos-15, full battery, control `84452de4` x3 against candidate
`5488cbf3` x3, scored with all six device logs:

  preserved 263, unchanged debt 19, unchanged applicability 11,
  improvements 1, changed detail 1, control-unstable 0, REGRESSIONS 0

  IMPROVEMENT   msaa4_color_store_host_sample_count  FAIL -> PASS
  CHANGED-DETAIL msaa4_color_store_no_resolve

294 cases in every run of both arms, no NOT-RUN, no kernel panic, no probe timeout.

The changed detail is the same case moving from the driver rung to the translator
rung. It reads its samples back through `get_num_samples()`, which the pinned
translator folds to the constant 1 for every operand, so the loop runs once and
samples 1..3 keep the readback buffer's fill. That defect is packaged at
`bugs/compute-multisample-query-reports-one/` and is present in published upstream
as well as the pin, so it is not a stale-pin problem. `translation-errors.txt`
already recorded, in advance, that the case was driver-owned only while this device
refused before translation could execute; that condition no longer holds, so the
case moves to the translator inventory it was pre-classified for. Its raw result
is preserved and no native expectation changed.

Device-reason envelope: `compute_linux` 5->3, `compute_record` 5->3,
`draw_encode_fail` 8->7, all fewer, all the repair. `clear_dropped` 3->4 emitted
lines is not an extra loss -- `note_clear_dropped` dedupes on
`(reason, texture_ref)`, and the candidate holds the first multisample target's
resident alive through a readback dispatch the control refused outright, so the
guest cannot recycle that object slot as early and the second case's texture gets a
fresh ref. `render_multisample_contract`, keyed the same way, shows the identical
3-vs-4 split. Three other reasons moved on one candidate run only, matching all
three controls on the other: run-to-run noise.

## Not verified

The arm64 pathways. Metal is cfg-disabled on this host; the aarch64 clippy arm
cross-compiles that code but runs none of its tests.

The user-visible symptom this belongs to -- Safari images arriving half-rendered --
is not proved fixed by this commit. The mechanism it closes is the one established
for that symptom (a rendered tile becoming a flat clear because the device promotes
an attachment to a sample count its own readback then refuses), and this removes the
compute-side reader from that loop. Whether the remaining
`draw_partial_preserving_unseeded_lost_texels` population also contributes is open.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 19:40:08 +03:00

57 lines
3.4 KiB
Plaintext

# Guest failures owned outside shader translation.
#
# One case name per line, followed by a comment naming the violated API
# relation and the driver owner or rail. An unexplained mismatch does not
# belong here: establish its owner first. Remove an entry when the scorer says
# FIXED-DRIVER.
# A buffer-backed alias used as a compute *storage* image is refused before
# translation (`compute_buffer_texture_storage_unsupported`). The sampled forms
# of the same rail now execute.
buffer_backed_alias_incompatible_widths # buffer storage image refused before translation
buffer_backed_alias_partial_row_range # buffer storage image refused before translation
# The multisample pair is now split across the two inventories, which is the
# whole reason there are two cases. This device serves the `texture2d_ms` bind
# from the target resident, so `msaa4_color_store_host_sample_count` passes and
# has no entry here. `msaa4_color_store_no_resolve` reads the same samples back
# through `get_num_samples()`, which translation folds to 1, and it is recorded
# in translation-errors.txt against its bugs/ package.
# Depth/stencil attachment state or contents are lost in the device model. The
# distinguishing colour shaders pass elsewhere; the log also names a depth
# LOAD with no resident content.
depth_attachment_isolated_across_tasks # task-local depth content aliases or disappears
depth_attachment_clear_without_test_state # stored depth clear is absent on later LOAD
stencil_only_attachment_clear_without_test_state # stencil-only attachment clear is absent
combined_depth_stencil_default_buffer_copy_selects_depth # blit selects the wrong aspect bytes
# `dispatchThreads` is widened to whole threadgroups by the command execution
# rail. The divisible control passes and every non-divisible grid runs threads
# outside the API extent.
dispatch_threads_grid_218x16_tg8 # 96 threads ran past the requested width
dispatch_threads_grid_54x15_tg8 # threads ran past both requested dimensions
dispatch_threads_grid_57x9_tg8 # threads ran past both requested dimensions
dispatch_threads_grid_31x31_tg16 # threads ran past both requested dimensions
# Device API/state reporting; neither result executes translated GPU code.
indirect_command_reset_copy_optimize # device reports indirect command buffers unavailable
pipeline_information_lifetime # pipeline construction-owned information reports zero
# The render path drops the declared array slice and samples slice zero.
texture_view_array_slice_64x32x3_s1 # texture view base slice 1 dropped
texture_view_array_slice_64x32x3_s2 # texture view base slice 2 dropped
# A buffer-backed render target arrives as a texture view; the target resolver
# rejects that object type and the following shaderless blit sees untouched bytes.
srt_blit_buffer_backed_512x512 # rt_wrong_type followed by view_desc_decode
# Direct indexed draw semantics. Both index widths and byte offsets match the
# shared-shader control when baseVertex is zero. Either width fails only when
# the signed base is -1, so the driver loses or misapplies baseVertex. General
# non-indexed baseInstance passes; only the indexed base-instance opcode is
# accepted without an executor and produces no pixels.
draw_indexed_uint16_base_vertex_minus1 # signed baseVertex is lost or misapplied
draw_indexed_uint32_offset_4_base_vertex_minus1 # signed baseVertex is lost or misapplied
draw_indexed_two_instances_base_instance_5 # indexed base-instance opcode accepted without executor