Commit Graph
2369 Commits
Author SHA1 Message Date
Anees Iqbal dbc0f04ef3 Conformance: block-writes-only-writes recorded on Metal
The case's Metal answer, recorded on an Apple M3 Max under macOS 27.0.1
(job m3-max-83930): for both usages, ShaderRead | RenderTarget |
BlockWritesOnly (0x10005) and the bit alone (0x10000), the dispatch
completes and every texel holds its four codes (00 ff 00 ff, 10 ef 25
fe, ...), with no notice announced. The coverage table is regenerated
with scripts/conformance-coverage/coverage.py.
2026-12-03 07:45:41 -08:00
Anees Iqbal 62e9d045c3 Validation player: command-replay refuses an option a subcommand does not take
Each subcommand names the options it takes beside its required ones, and
options() refuses any other with "--NAME is not an option of
SUBCOMMAND" before anything runs: exit status 2, the usage printed, as
for any bad command line. Before, an unknown --name VALUE pair went into
the map and was never read, so a mistyped or retired option played as
if absent.

The sets are what each subcommand reads: play its four required options
and blobs, managed, until-frame, past-range, states-only, state-log,
state-threads, state-keys, state-digests, gpu-wait-timeout (the
wait module's flag), video-handle, check-presents, read-device-copies,
prepass-width, dump-command-buffers and dump-dir; dump and shapes
--stream and --blobs (their stream reader reads it; the usage and the
module doc now show it); compare-dumps --a and --b; compare-plays --a,
--b and --frame; snippet video-surfaces --out and --handle. The module
doc and docs/REPLAY-STREAM.md section 10 say so.

The audit in the red commit's message found no caller passing an option
outside these sets except --probe-dump in two lab probe scripts of one
carry, which no commit here ever read.

Verified by the job named in the lane's report: the red test at the
parent and green here, clippy x3, rustdoc, the validation suite.
2026-12-03 07:28:55 -08:00
Anees Iqbal 98435ae812 Validation: the engine candidate runs a kernel case's stage inputs through the runtime
What: a kernel case's stage inputs of a fixed stride, and its dispatch's
stage-in region, now run on the engine candidate as the Metal oracle runs
them (executor_contract::stage_inputs, the derivation both executors
share):
- compute_case takes the checked entry's AIR-layer interface and maps
  each input's data to its own buffer at the slot its location takes;
- ComputeCase carries the stage-input descriptor, the region (the
  dispatch's, or the grid's from the origin) and each slot's location;
- the run through the runtime makes its state with that descriptor, sets
  the region before the dispatch, and guards a stage input's data as its
  OutOfBoundsResource::AttributeBuffer target (guards::buffer_resource);
- the authored compile census compiles the kernel under it
  (PipelineRequest::Kernel::stage_input, variants::compile_kernel).

ToolingRequirement::KernelStageInput ("kernel_stage_input") becomes
DynamicStageInStride ("dynamic_stage_in_stride"): it now fires only for
an input of a dynamic stride. The runtime refuses that layout (Gap::StageIn
of DynamicStride), since its compute encoder has no
setBuffer:offset:attributeStride:atIndex:. Docs say the same:
docs/VALIDATION.md, the requirement's, case_requirements' and
compute_case's. A neighbouring line now says the implicit imageblock is
the runtime's limit, where it said explicit; the code already said so.

Why: the runtime has fetched stage inputs at every step function since
a916e61185 and sets the region (set_stage_in_region), but the candidate
built its state without the descriptor and set no region. So twelve
authored cases stayed Metal-only, the twelve the authored compile census
holds as not_supported{tooling_requirement:kernel_stage_input}.

Also: AUTHORED_COMPILE_CENSUS_VERSION 9 -> 10. Its table is re-blessed
on development. ENGINE_EXECUTOR_ABI unchanged: every case this lets run
was refused before, which its doc says needs no bump.

Verified here: cargo fmt; signatures --check. Tests:
engine_case_families_follow_the_case_literals (red at the commit
before) and stage_inputs_map_onto_their_slots_descriptor_and_region.
Clippy, rustdoc, the validation suite and the cases' runs on a device go
in the jobs the lane's report names.
2026-12-03 07:26:52 -08:00
Anees Iqbal 23193c9bf1 Translator: the padded forms' linear mip filter blends two levels, a bfloat form's reads one
Two measured changes to an extended-range sample's level, each from the M3 Max on macOS 27.0.1:

- A padded form's linear mip filter (R10Unorm_X6, RG10Unorm_X12 and their _sRGB twins) now
  blends its two levels as BGR10_XR's and BGRA10_XR's do, through a constexpr sampler and through
  a runtime one, and records PrecisionNote::BicubicFilterArithmetic. Before, a constexpr sampler's
  was refused NotImplemented(Format), and a runtime sampler's read one level with no refusal. The
  probe extended_linear_mip_blends (job m3-max-82967; 16,384 lanes per form and filter, 2D, five
  levels, random codes) puts Metal's sample within 0.0157 of its own two levels' samples blended
  by mix at the fraction truncated onto sixty-fourths. The note's doc and its docs/API.md
  catalogue line gain that bound.
- A bfloat form's linear mip filter (R16Bfloat, RG16Bfloat, RGBA16Bfloat) is now its nearest mip
  filter, which Metal's equals on every lane whose two levels differ (4,096, 8,192 and 16,384
  lanes, nearest and linear filters). Before, a constexpr sampler's was refused. A runtime
  sampler's already read that level.

What stays refused through a constexpr sampler:
- A two-plane form's linear mip filter (not measured). The probe only shows that a five-level
  texture is made.
- RGB10A2Unorm_sRGB's linear mip filter (not measured). Jobs m3-max-83026 and m3-max-83029
  explain why. A texture of five levels holds each level's own code, which a blit reads back per
  level. Yet the M3 samples level 0's code at every explicit level, at gradients under a nearest
  mip filter, at every level under a linear one, and in a 2D array's layer 1. RGB10A2Unorm, the
  control, samples each level's code. Documented Metal samples the level asked for. So this is a
  driver defect, which is not emulated (an Apple bug report is drafted), and the format's samples
  keep reading the level the mip filter names. No conformance case samples that format's levels
  today.

Docs: three comments named binder refusals that no code makes, and none of the three exists
(ResourcePlanner is gone):
- a runtime sampler word that states mixed filters;
- a runtime linear mip filter's clamp maximum below the last level;
- a runtime linear mip filter of an unmeasured form.
The comments sat in lower/sampler/extended.rs, select.rs and the extended-range tests'
module docs. They now state what happens: the word samples as nearest, the maximum is not read,
and a two-plane form's or RGB10A2Unorm_sRGB's runtime linear mip filter reads the nearest mip
filter's level. They also say this is an open gap that no consumer meets while the runtime makes
no texture of these formats (the runtime's Gap::TextureFormat).

The probe crates/metal2vulkan-conformance/probes/extended_linear_mip_blends.m gains the nearest
mip filter at the point's level, the two-plane question and each texture's level count.
SEMANTICS_VERSION moves to the next number, because refusals are removed and samples' answers
change. runtime-sources.sha256 is re-pinned because metal/format/mod.rs is a runtime input.

Tests (tests/engine_extended_range/levels.rs):
- unmeasured_linear_mip_filters_are_refused now builds a padded and a bfloat linear mip filter,
  and still refuses a two-plane and an RGB10A2Unorm_sRGB one.
- measured_linear_mip_filters_blend_or_read_one_level: every padded and bfloat form's constexpr
  sampler compiles, valid, under either mip filter, with the note on a padded linear one alone.
  On the CPU interpreter, at 64 levels between two, through a constexpr and a runtime sampler, a
  padded form's sample lies between its two levels' nearest-mip samples on every lane and
  strictly between on some. A bfloat form's equals its nearest mip filter's, bit for bit.

Verified on the CPU with no device (job m3-max-83908): with metal/format/mod.rs,
lower/sampler/extended.rs and select.rs at 8e912a905d the two changed level tests fail, and here
the extended-range tests pass; the golden table differs from development's (semantics 2346) in 90
cells here and at 8e912a905d, so the change moves no existing cell by count; the refusal surface
check passes; cargo fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, the API
reference check and the doctests pass; the suites pass 3753 of 3754 (24 skipped), the one failure
golden_hashes_match_the_table, bless due as at 8e912a905d; the validation suite passes 1346 (3
skipped) and the conformance suite 1052. The states-only plays of this tree (m3-max-83910) make
what 8e912a905d's make (m3-max-83909): the gb-3090-r2 stream 10643 render and 15299 compute
states, the 780M windrag stream 8972 and 225, none refused.
2026-12-03 07:25:45 -08:00
Anees Iqbal 4b68322b79 Conformance ledger: the Iris Xe's rgb10a2unorm texture-buffer write matches Metal now
What: drops the known-gaps-rt.tsv row norm-storage-codes-rgb10a2unorm | Iris(R) Xe | divergent |
case/hsw_buffer/texels, and regenerates docs/CONFORMANCE-COVERAGE.md from it.

Why: pin S's real-card round replayed the ledger on the Iris Xe (RPL-P, Mesa 26.2.6) and reported
"now matches: 1": that case no longer diverges there, and the ledger must not outlive the gap it
stands for. Pin R's round passed the same leg (job m3-max-83399), so the change came between R and
S: there a read-write texture buffer whose format's own view reads none without a format became
words (1c68dd10f4), and a texture-buffer storage slot is declared without a format (1ae0e3c302), so
the Iris's RGB10A2Unorm texture buffer is written through the shader's own conversion, which gives
Metal's codes. The other Iris rows of the case (hsw_read_write, hsw_write, hsw_held) still diverge
there, and llvmpipe's and NVIDIA's rows are unchanged.

Verified: the conformance replay on the Iris Xe at 14c37cc76d (job m3-max-83990) listed this row as
its only surprise; coverage.py --check reads the document as derived. The replay after this commit
runs in the next pin's round.
2026-12-03 07:19:29 -08:00
Anees Iqbal 2549c339c6 CI: the runtime's device tests again on lavapipe at 128-bit vectors, with a Mesa shader cache of their own
What: a Linux step after the CPU ICD step runs the runtime's device tests from that step's archive
with LP_NATIVE_VECTOR_WIDTH=128 (lavapipe's subgroups of 4, the width arm64 lavapipe runs at) and
MESA_SHADER_CACHE_DIR set to a directory of the leg's own in the workspace. It prints vulkaninfo's
device name and subgroup sizes first and fails unless they show 128 bits and subgroups of 4, so a
green step shows the width ran. scripts/lavapipe-image's nextest command takes --write and --env as
run does, so the leg's cache directory and variables reach the container. scripts/linux-gate-ci
gets the same step, as docs/VALIDATION.md asks of every Linux step. AGENTS.md's CI line and
VALIDATION.md's note on the width name the leg and the cache rule. Nothing in product code reads
either variable.

Why: the planner wants a stand-in for a device whose SIMD group is 4 wide (tile GPUs are a target).
The lab's 128-bit runs failed because of llvmpipe's disk cache, not our lowering. llvmpipe keys its
texture functions (lp_texture_handle.c) and its cache id (lp_screen.c) without
lp_native_vector_width (Mesa 26.2.4), so a cache that 256-bit runs filled gave a 128-bit shader an
8-wide texture function. A cache of the leg's own cannot collide with the 256-bit one.

Verified on lavapipe (Mesa 26.2.4, LLVM 23.1.1, 128 bits, subgroups 4), at aeb0ca9560, the
runtime's whole cpu_icd suite:
- shared default cache: 989 tests run: 887 passed, 102 failed, 4 skipped (job m3-max-83853);
- the cache off: 989 tests run: 989 passed (2 slow), 4 skipped (job m3-max-83888);
- gdb on two of the crashes stops at the same JIT store, vmovaps of a ymm register, the 4th of
  four plus a byte at 0x80: an 8-wide texel struct written into a 4-wide caller (job m3-max-83878).
The step itself ran in the lab from ci.yml's step text, in the pinned lavapipe image (Mesa
26.2.4-arch1.1, LLVM 23.1.1): deviceName = llvmpipe (LLVM 23.1.1, 128 bits), subgroupSize 4 (min
and max 4); 764 runtime device tests listed; Summary 762 tests run: 762 passed, 231 skipped; job
exit 0 (job m3-max-83928, on the RTX 5080 Laptop machine's lavapipe). scripts/linux-gate-ci's
new step passed bash -n only; it has not run end to end. No Rust changed, so clippy, Rustdoc and
the suites have the inputs they had.
2026-12-03 07:03:08 -08:00
Anees Iqbal 5f1686fb55 Validation: a texture over a heap buffer is covered where its buffer is
The cover rule held a buffer's cover on the buffer alone, so a texture made
over a covered heap buffer read as uncovered: its check was compared and its
dump carried no cover, and compare-dumps could report as a difference the
bytes Metal leaves undefined once a heap texture's write aliased them.

Covers::covered now maps an object to the one whose bytes it holds (a view to
its texture, a texture over a buffer to that buffer), the same mapping the
rule already used to decide whether a texture's write is tracked. The rule
also takes the player's own list of the selectors that make a texture over a
buffer (makes_texture_over_buffer), which adds the tiled form
(newTiledTextureWithDescriptor:offset:bytesPerRow:) the rule had missed.
docs/REPLAY-STREAM.md and dumps.rs say a texture's cover follows its buffer's.

Verified by the test the previous commit added (red there, green here); the
jobs are in the lane's report.
2026-12-03 06:52:49 -08:00
Anees Iqbal 599da8cacf REFUSALS: regenerate after the coherent-image landing
The coherent access beside a storage image no longer refuses (d0665778b7), so
lower/sync/memory_model.rs's not_implemented site of feature::Lowering is gone: 31 sites
become 30. Generated by scripts/refusal-surface/refusal_surface.py at 8e912a905d; the
runtime's error/basis.rs comes out unchanged. Found by lane lowrows's regeneration at that
tip.
2026-12-03 06:52:41 -08:00
Anees Iqbal 5b3bd800c0 Translator: under the identity domains a runtime sampler's LOD query outside a fragment function reads its minimum level from the sampler's word
A clamped calculate_clamped_lod in a kernel or a vertex function through a runtime sampler
argument was refused on every profile under the identity domains ("a sampler argument whose
minimum level or emulated filter the function specializes"): the query read the slot's
SamplerMinLevel specialization, which no binder chooses there.

The query now reads the word of the resource ID the sampler slot already pushes (SlotGuestBase):
0 where the word states no mip filter, else SamplerWord::LEVEL_MIN, the level a nearest mip
filter reads at lodMinClamp, bounded by the texture's last level as before. A bind-time clamp
(setSamplerState:lodMinClamp:lodMaxClamp:) binds a variant whose word is made of the clamped
descriptor, so it is read too. That is the M3 Max's and M4's measured answer
(metal::sampler::query_min_level) for no mip filter and a nearest one, and for a linear one where
lodMinClamp is a whole level or past the texture's last level. Under a linear mip filter with a
clamp between whole levels Metal answers the clamp on its sixty-fourths grid, which the word does
not hold. MSL 4.1 section 6.13 leaves both queries undefined outside a fragment function ("Only
call the calculate_unclamped_lod and calculate_clamped_lod functions from a fragment function or
a function you call with a fragment function; otherwise, the behavior is undefined."). So, per
the planner's ruling, there is no precision note; docs/API.md's accepted differences states the
answer. The resident-table path keeps its specialization.

SEMANTICS_VERSION 2347. The runtime-sources pin does not move: pin-compute.py gives a92fe0a8...
for this tree, the same as before. docs/REFUSALS.md does not move either: the refusal text
remains for an extended-range sample's linear-mip blend. The runtime README's known-gap entry
names the lowered query. Verified by the lane's red/green job, named in the lane's report.

Landed with SEMANTICS_VERSION 2347 (renumbered above development's 2346: written 2343 on its base,
then 2346 at the lane's rebase onto 0f4114c882, which development's HandleUse also took).
2026-12-03 06:46:38 -08:00
Anees Iqbal 011540217d Translator: a mode-2 fragment write to a texture buffer held as words rounds half and small floats to nearest even
A texture buffer of a format a device holds as words is written by lower/texture/words.rs's
write_texel, which rounded a half-float or RG11B10Float channel toward zero at either
textureWriteRoundingMode. Metal's texture buffer rounds those to nearest even at mode 2, as its
storage texture does (the probe below). So a fragment function in a mode-2 pipeline that wrote a
half-float or RG11B10Float texture buffer on a device holding that format as words stored a code
one below Metal's on 36% to 44% of the probe's channels, and 65504 where Metal stores the infinity.

Now, where Write::half_up marks the write (a fragment function's, in a pipeline of mode 2):
- a half-float channel (R16Float and RG16Float, the half-float formats a device may hold as
  words) takes ChannelWrite::FloatNearestEven, a finite value past the largest to the infinity, as
  Metal's RGBA16Float texture buffer stores it;
- an RG11B10Float channel takes nearest even too, and a lane that rounds to the infinity from a
  finite value is held at its format's largest finite value (65024 for the 11-bit channels, 64512
  for the 10-bit one), as Metal's stores it; an infinity stays, and a NaN is the quiet NaN still.
The RGB9E5Float word's half-up rounding is unchanged; the probe shows Metal's texture buffer
storing the same bytes as its storage texture there. A write at mode 0 or 1, and every kernel's
write, still rounds toward zero.

The probe is committed as crates/metal2vulkan-conformance/probes/texture_buffer_write_rounding.m:
texture_write_rounding_storage.m with texture_buffer<T, access::write> targets, made from a Shared
buffer with MTLTextureTypeTextureBuffer and written at texel y * 256 + x, over the same 65,536
texels. On an Apple M3 Max under macOS 27.0.1 (job m3-max-83395), mode 0 matched toward zero on
every channel, and mode 2 matched nearest even on every channel that is not a NaN: RGBA16Float
float texels 262,112 of 262,112 (to the infinity past the largest), RG11B10Float float and half
texels 196,583 of 196,583 each (held at the largest), and RGB9E5Float 65,536 of 65,536 at both
texel types (half up, its hashes equal to the storage texture's).

Docs: words.rs's module doc, Write::half_up and write_texel; API.md's words line names mode 2.

SEMANTICS_VERSION moves above development's: a texture buffer write's answer changes.

Verified on the CPU with no device (job m3-max-83575): the color_write and words tests pass (79), the
golden table differs from development's (semantics 2334) in 109 cells, as at a535f1dc17, and the
refusal surface is unchanged; cargo fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd),
Rustdoc, the API reference check and the doctests pass; the suites pass 3740 of 3741 (24 skipped),
the one failure golden_hashes_match_the_table, bless due; the validation suite passes 1340 (3
skipped) and the conformance suite 1052. The states-only plays of this tree (m3-max-83669) make
what 126ee4fdf5's make (m3-max-83443): the gb-3090-r2 stream 10643 render and 15299 compute
states, the 780M windrag stream 8972 and 225, none refused.
2026-12-03 05:55:06 -08:00
Anees Iqbal 4b328ca9e2 Validation: a fragment function's render-target words are fed by the colour it returns
What: the word scan (check::output_words) now follows a fragment case's render target to the
colour its entry returns for that attachment, as it already followed a kernel's output buffer to
its stores. Before, every render-target word was fed by Family::Unknown, so every recorded note
reached every word of every fragment case by fall-back.

How:
- The scan records a fragment entry's returned value by field (Stores::returned): the
  families of each lane of each field, joined over its returns. Where a return or a
  air.discard_fragment sits in a block that does not post-dominate the entry, every lane is also
  fed by every branch condition, as a conditional store is.
- A render target's words (render_target_words): each channel of a texel takes the families of
  the lane of the returned colour it holds (every lane where the colour has fewer lanes than the
  format has channels), with those of the entry's other live outputs that decide whether or how
  the write lands: a depth, a sample mask, a stencil reference, the second blend source. The
  facts repeat every texel (every word for a texel under four bytes); the word's lanes still come
  from the target's format. A target with no live colour from the entry (an imageblock writes
  it), an attachment index that is not a constant, a vertex case's observed render target, and a
  returned value the scan does not follow keep the fall-back.
- air.quad_is_helper_thread and air.simd_is_helper_thread feed Family::Group: whether a thread is
  a helper is its place in its quad, which FragmentSimdgroupGrouping and QuadsSplitByClipping
  concern. They fed Family::Unknown before.

Tests (check::output_words::tests): a_render_targets_words_take_the_returned_colours_operations
(the public case unclamped-and-clamped-lod-of-a-texture-selected-per-quad: red and green fed by
the texture queries and the position, blue and alpha by nothing, so a texture note reaches the
first two words of a texel and NativeDot none) and
a_helper_query_and_a_discard_feed_a_render_targets_words (helper queries and quad ballots feed
Group alone; a discard the position decides adds the position and its arithmetic). Both read
every word as Unknown without the change.

ENGINE_EXECUTOR_ABI is v216: rows record different word facts for fragment render targets, and
how their differing words are judged changed.

Verified (at 33873ab651, this commit's tree):
- Gate: fmt, clippy with --workspace --all-targets --all-features -D warnings plain, under
  --cfg m2v_gpu and under --cfg m2v_cpu_icd, and rustdoc -D warnings, all exit 0 (job
  m3-max-83339). Validation suite: 1339 passed, 3 skipped (job m3-max-83340); in the same job the
  two new tests pass, and both fail with output_words.rs and words.rs put back to the parent.
- The public cases (1,168), noted / matched only within bounds / mismatch cases (batch-words),
  before at 31b2964425 and after:
  - lavapipe (x86): 156 / 27 / 10 before (job m3-max-83318) and after (job m3-max-83341); every
    row keeps its outcome and gap; 15 rows lose their fall-back words. Cases with a word on the
    fall-back: 571 to 488; with a differing one: 37 to 22.
  - AMD Radeon 780M (RADV PHOENIX, Mesa 26.2.6): 171 / 24 / 16 before (job m3-max-83332), 170 /
    24 / 17 after (job m3-max-83385). Every mismatch is held by a gap, before (21) and after (22):
    no new mismatch. One row moves: three-color-inputs-tag-attachment (c261f487), from a noted
    difference to a mismatch held as ordered_fetch_within_draw. Its target is the r32_uint tag,
    tag * 5 + as_type<uint>(color.x) of the attachments it fetches: no half conversion feeds it,
    so NativeHalfConversion, which reached its 16 differing words only by fall-back, no longer
    excuses them; UnorderedFetchWithinDraw reaches them. Cases with a word on the fall-back: 605
    to 515; with a differing one: 58 to 33.

Landed with ENGINE_EXECUTOR_ABI vulkan-engine-v217 (renumbered above development's v216, the half-arithmetic family); docs/VALIDATION.md merged by hand with that change's half family wording. runtime-sources.sha256 unchanged (a92fe0a8).
2026-12-03 04:36:37 -08:00
Anees Iqbal 9211eb3c10 Translator: half +, -, *, / and fma on the 16-bit instructions record NativeHalfConversion
Under the 16-bit float controls, a half +, -, * or / and a half fused multiply-add run on the
device's 16-bit instructions, between exact conversions. By the Vulkan spec their results are
Metal's. A driver's compiler may still compute them in float and leave them unrounded. Intel's
Windows driver 101.2145 on a UHD Graphics 630 does:

- A standalone tree of three 16-bit OpFAdds, or Fmas of a product, each decorated NoContraction
  under all three 16-bit controls, ran on 4,096 invocations. 2,284 sums and 4,080 products
  matched neither the half tree nor the float tree rounded once (job m3-max-83092).
- The Iris Xe under Mesa ANV 26.2.6 gave the half tree on every invocation (job m3-max-83093).
- In the runtime's quad test on the UHD, 112 of the 1,536 compared halves are the float chain
  rounded once at the store (job m3-max-82918).

Per the planner's ruling, the operation carries the static note on every device, with no device
check. narrow::computes_half_arithmetic looks in the emitted module for a 16-bit OpFAdd, OpFSub,
OpFMul, OpVectorTimesScalar or OpFDiv, or a GLSL.std.450 Fma. Where it finds one, the pipeline
records NativeHalfConversion, beside the conversion pair's existing cases. A Sqrt alone records
nothing, and neither does the simdgroup half tree's ClusteredReduce.

The note's reach in validation narrows to half arithmetic. Until now it reached every word fed by
any float family. The AIR word scan now feeds a new family, HalfArithmetic, beside the
operation's own family, from these operations:
- an fadd, fsub, fmul, fdiv, frem or fneg with a half result;
- a float cast whose result or operand is a half;
- a call of a modelled family whose result or an argument is a half.
NativeHalfConversion reaches only that family. A half word that only float arithmetic fed,
through a move, is no longer reached. The note stays unbounded at the word, now on the
comparison's stay-unbounded list with its reason. A driver may leave the chain unrounded and
round it once at the store, and with cancellation the two answers differ by more than the stored
value's ulps (40 codes measured on the UHD). How far rests on the operands, which a word does
not carry.

Docs:
- The note's API.md catalogue entry and its PrecisionNote doc said those operations "take no such
  rounding". They now say the operations record the note, and give the UHD 630 measurement beside
  NVIDIA's fold and RADV's fusion.
- The DeviceHalfDenormals entry points to it.
- VALIDATION.md names the half family among those the word scan reads.

Tests:
- engine_native_half: the controlled-conversion test's sum kernel now records the note, as every
  kernel there does.
- engine_float_call_notes sets the module-level note aside for 16-bit arithmetic, as it does for
  the conversion pair.
- half_simd_reductions accepts, where the quad pipeline records the note, a quad word whose
  every half is Metal's or the float operations rounded once. The model is the new devtools
  quads_once.
- In validation:
  - the scan's packed-halves test expects HalfArithmetic on the half word alone;
  - a words test shows the note reaching a half word only when half arithmetic feeds it;
  - the reach row is pinned.

SEMANTICS_VERSION 2340 -> 2341 (precision notes added).
ENGINE_EXECUTOR_ABI vulkan-engine-v215 -> v216 (the word scan feeds HalfArithmetic, and the
note's reach narrows to it).

Golden hashes: no cell moves. The cells hash the final SPIR-V, which the note does not touch.
Job m3-max-83293 (Linux) ran golden_hashes_match_the_table twice: at this change, and with
compile.rs and cache/mod.rs at f42e61aa84. Both failed with the same 2 changed-cell lines, 0
lines differing between them: development's table is due its own bless. The fixtures that need
metal-as were skipped on Linux.

runtime-sources.sha256 is unchanged: no edited file is a fingerprint input.

Note-bounds figures (noted / matched within bounds / mismatches over the 1,168 public cases),
each arm built in one job, at 702916d9d3 and at this change on it (6edabebff2):
- lavapipe (Mesa 26.2.4, LLVM 23.1.1; job m3-max-83272): 151 / 27 / 15 before and after;
- Radeon 780M (RADV PHOENIX; job m3-max-83273): 166 / 24 / 21 before and after.
Every case's outcome and bounded line is the same in both arms, so no row is new. Only the per-note
word attribution moves: NativeHalfConversion's noted words fall from 3,267 to 1,168 on lavapipe and
from 3,558 to 1,276 on the 780M, as other notes reaching those words now take them.

Verified, at the probe db2bceb3f6, whose tree is this commit's (gate job m3-max-83293):
- the four red tests pass here and three fail with compile.rs at f42e61aa84 (EXIT=100);
- STEP clippy_plain EXIT=0, clippy_gpu EXIT=0, clippy_cpu EXIT=0;
- doc EXIT=0, privdoc EXIT=0;
- the translator's and AIR's suites minus the bless-due tables: EXIT=0;
- on lavapipe (host Mesa 26.2.6):
  - runtime: 983 passed, 4 skipped; half_simd_reductions 0 differ in all three pipelines;
  - validation: 1338 passed, 3 skipped, the runtime-sources guard among them.
- The conformance replay in the pinned lavapipe image (CI's venue, LLVM 23.1.1), at f42e61aa84
  and at this change (job m3-max-83337): 0 ledger drift in both arms, 4661 rows as expected.
  On the gate job's host lavapipe (Mesa 26.2.6, LLVM 23.1.4) its replay printed 12 drift lines,
  the bicubic-texel-classes rows among them. That run has no base arm.

The device legs of the half test:
- UHD Graphics 630, Intel's Windows driver 101.2145, at 6edabebff2 (this change on 702916d9d3;
  job m3-max-83288): every_device_sums_and_multiplies_half_simdgroups_as_metal passed.
  - The quad pipeline records NativeHalfConversion. 0 of 768 words differ from Metal's, and 96
    more are the float result rounded once.
  - The simd and masked pipelines: 0 differ.
- Apple M3 Max, KosmicKrisp (Mesa 26.3.1), at db2bceb3f6 (archive m3-max-83294, run
  m3-max-83297): passed. 0 words differ in each pipeline and none takes the rounded-once
  admission.

Landed with SEMANTICS_VERSION 2342 (renumbered above development's 2341); runtime-sources.sha256 recomputed on development, unchanged (a92fe0a8). States-only plays at the change (job 83345): gb-3090-r2 render 10643 and compute 15299 made, 0 refused; windrag-780m-b4 render 8972 and compute 225 made, 0 refused, equal to pin R.
2026-12-03 04:14:29 -08:00
Anees Iqbal d0fb4f3381 Translator: delete StageModule::level_reads, which nothing reads
StageInterface::level_reads and StageModule::level_reads stated, per texture slot, the levels of
its bound view the stage's reads reach (LevelReads, SampledLevels, SamplerLevels and the
structural analysis spirv::requirements::level_reads). Nothing reads them:
- the runtime: git grep -nw -e level_reads -e LevelReads -e SampledLevels -e SamplerLevels
  -e finite_texels -e highest_lod -e lowest_lod at 401d9d5949 over every crate but the translator
  finds one hit, the runtime's translator_fields test, which lists the field as a fact the runtime
  does not apply;
- the consumer: the same search at a20576e1fd finds 0 hits.
Under the identity domains, which the runtime ships, the analysis also seeded nothing, since no
variable holds one slot's image there. Rule 4: deleted rather than seeded.

Removed: the two fields, the three public types with their methods, the analysis and its tests,
their codec entries and footprint, their rows in tests/api_signatures.tsv and the api_surface
table, the API guide's "Levels a slot reads" section and HOWTO's mention of it, and the runtime
test's listing. own_pixel's helpers that the analysis shared are private again.

ARTIFACT_FORMAT_VERSION moves to the next number above development's: StageInterface's and
StageModule's encodings lose a field. No translation answer changes, so SEMANTICS_VERSION stays.

Verified on the CPU with no device and on lavapipe (llvmpipe, LLVM 23.1.4), job m3-max-83281 at
the next commit, which holds this one: fmt, the signatures, clippy plain, with --cfg m2v_gpu and
with --cfg m2v_cpu_icd, rustdoc, the private rustdoc, the refusal surface check and the API
reference check passed; the suites 3737 of 3738 passed (24 skipped), the one failure the golden
table, which fails at the base on the same 80 cells (a bless due on development); validation 1337
passed (3 skipped); conformance 1052 passed; the doctests passed.
2026-12-03 04:13:32 -08:00
Anees Iqbal f42e61aa84 Docs: the helper-thread words' four mechanisms, and what a split quad's helper query answers
The read of the ten cases held as helper_thread_words (lavapipe, job 83263; Radeon 780M, jobs
83264 and 83267) explained 454 of their 455 differing words by four mechanisms: Apple's partial
quads, lavapipe's clip seam, RADV's lane order and x86 lavapipe's 8-lane subgroup. The docs said
otherwise in two places:

- QuadsSplitByClipping said each run of a split quad combines fewer active lanes than Metal's.
  Each piece's run keeps all four lanes; what differs is the helper query, which names the other
  piece's covered pixels as helpers where Metal's quad, shaded once, names none. The note's doc
  comment, its API.md catalogue entry and the validation gap's doc now say that.
- FragmentSimdgroupGrouping gains the fill past a subgroup under 32 lanes: it reads an inactive
  lane, which MSL 4.1 section 6.10.2 leaves undefined, and the device reads the calling lane in its
  place (lower::simd's PartialFragment read).

docs/VALIDATION.md's verdict section names the four mechanisms and what lavapipe and the 780M do
under each, where the next reader of a held case looks. The gap's doc in c3.rs no longer says the
cause is unread.

Docs and doc comments only. pin-compute.py over the tree gives the committed runtime-sources
fingerprint (artifact.rs is not one of its inputs), so no re-pin. cargo fmt --all is clean.
2026-12-03 03:48:23 -08:00
Anees Iqbal f683293b4b Docs: a fetch may read the texel from before its draw, so overlapping read-modify-writes leave one
UnorderedFetchWithinDraw's words said a pixel that overlapping fragments of one draw fetch and
write "holds the result of some order of the draw's fragments", "not necessarily Metal's". The
Radeon 780M (RADV, Mesa 26.2.6) shows otherwise. Job m3-max-83259 ran the eight authored cases
the ordered_fetch_within_draw gap holds (n instances of the companion's fullscreen triangle in
one draw, so n identical fragments at every pixel or sample) five times at 702916d9d3. All five
outputs were identical. Every differing word is the fragment function applied once to the
texel as it stood before the draw. Each case's chain f^k(initial), computed from its own inputs,
gives Metal's stored output at k = n on every word, and the 780M's at k = 1 on every word that
differs, all four lanes of each texel alike. All n fragments are identical, so every order of
them gives Metal's value: the 780M's value is no order's result. Lavapipe matches Metal on the
seven cases it runs (job m3-max-83255).

The note now says what a fetch can observe there: it may read the texel from before its draw,
so overlapping read-modify-writes of one draw may leave one application. Changed in docs/API.md's
precision-note catalogue, PrecisionNote::UnorderedFetchWithinDraw's doc comment and the runtime
README's known gap. Docs only, no behaviour change. The runtime-sources pin is unchanged
(pin-compute.py gives a92fe0a8...).

Verified: cargo fmt --all; nothing built.
2026-12-03 03:35:47 -08:00
Anees Iqbal 702916d9d3 Validation: helper-thread words and ordered fetch are answer gaps a row's words decide
FragmentSimdgroupGrouping, QuadsSplitByClipping and
UnorderedFetchWithinDraw only record a device behaviour now: none of
them excuses a word. The cases whose differing words they reach turned
from noted differences into mismatches, and nothing held them open, so
a round's public leg would read them as new mismatches. Two answer
gaps now hold them open. Both are decided by structure (the note and
the words its operations reach), never by case id:

- HelperThreadWords (helper_thread_words): every unexcused word is
  reached by FragmentSimdgroupGrouping, or every one by
  QuadsSplitByClipping.
- OrderedFetchWithinDraw (ordered_fetch_within_draw): every unexcused
  word is reached by UnorderedFetchWithinDraw.

How:
- For each only-recorded note, the word judge counts the unexcused
  words that note reaches (Judgement::recorded).
- AnswerGap::held_by_words picks the gap one of whose notes reaches
  every unexcused word of a mismatch, where both outputs have one
  length. The engine's difference_status calls it for a mismatching
  verdict, and the batch-run line names the gap (held_open_by=).
- Every device has both gaps, since why the device's words differ is
  not read yet. The reviewed list refuses an entry under either gap.
- A row's content check accepts such a gap only on differing bytes from
  a run that recorded one of its notes, and status_holds re-derives the
  gap from the row's words.
- C3 names a word gap as a mismatch's reason after a deferral and after
  a listed gap.
- docs/VALIDATION.md states both gaps.

ENGINE_EXECUTOR_ABI stays vulkan-engine-v215, above development's v214.

The three figures, public cases (1,168): noted cases / cases that
match only within bounds / mismatches, then how many mismatches an
answer gap holds and how many are new.
- lavapipe (Mesa 26.2.4 image):
  - before, development 965e707277, job m3-max-83220: 188 / 0 / 5;
    5 held, 0 new.
  - after, job m3-max-83166: 151 / 27 / 15; 15 held (5
    clipped_primitive_split, 10 helper_thread_words), 0 new.
- Radeon 780M (RADV PHOENIX, Mesa 26.2.6, the device pinned alone):
  - before, development 22861fde72, jobs m3-max-82940 and
    m3-max-82966: 206 / 0 / 5; 5 held, 0 new.
  - after, job m3-max-83177: 166 / 24 / 21; 21 held (5
    clipped_primitive_split, 8 helper_thread_words, 8
    ordered_fetch_within_draw), 0 new.

The after runs ran this commit's library code. Only a C3 test changed
after them.

Verified (tests at this tree):
- gate A, m3-max-83232: fmt check, clippy plain, --cfg m2v_gpu and
  --cfg m2v_cpu_icd, and rustdoc each exit 0.
- gate B, m3-max-83236: the validation suite exits 0, 1337 passed,
  3 skipped. Each red check exits 100 with its fix reverted: the
  engine's word-gap hold, the judge's recorded-note count, the
  denormal boundary, the note reach, the recorded rule-5 notes and the
  recorded review notes.
2026-12-03 03:27:51 -08:00
Anees Iqbal 41712a1ec5 Translator docs: NativeNanEncoding covers a NaN's payload moved through loads, stores and selects
What: NativeNanEncoding's rustdoc and its docs/API.md catalogue entry say what validation now
reads it as covering: a NaN's payload moved through loads, stores and selects as well as one an
operation computes. Validation excuses a word in any float lane only where Metal's answer and
the device's are both NaNs of the lane's format.

Why: the planner accepted reading the note as reaching every float lane, bounded to two NaNs.
The public case nan-model-loads-stores-and-selects-of-nan-halves differs on lavapipe only in
half NaN payloads its entry moves without an operation (e.g. Metal 0x7e01 against 0x7e00,
m3-max-82836), which the note's own text already records at every read of a half from its bits.

Text only: no output and no recorded note changes, so SEMANTICS_VERSION stays; artifact.rs is
not a runtime source input.
2026-12-03 03:27:51 -08:00
Anees Iqbal 2c61e4fc52 Translator docs: NativeFma states that an unfused half product can overflow
What: NativeFma's rustdoc and its docs/API.md catalogue entry state the one case its recorded
bound does not cover: an unfused product can overflow where Metal's fused result is finite, and
the overflow stays the device's answer. A 16-bit product of magnitude 65520 or more rounds to
the infinity of its sign, so the result is that infinity where Metal's is finite, or a NaN
where the addend is the infinity of the other sign and Metal's result is that infinity.

Why: the bound (half an ulp of the product plus half an ulp of the result) read as covering
every input; the public cases fused-multiply-add-rounding-and-fmuladd-without-fast-math and
fused-multiply-add-rounding-and-contraction-under-fast-math show the other answer on lavapipe:
fma(256.0h, 256.0h, -65504.0h) is inf where Metal answers 32, and fma(65504.0h, 65504.0h,
-inf) a NaN where Metal answers -inf (job m3-max-82667's rows against the committed Metal rows
of the Apple M3 Max). No lowering changes; the note stays unbounded in validation.

Text only: no output and no recorded note changes, so SEMANTICS_VERSION stays. artifact.rs is
not a runtime source input, so runtime-sources.sha256 stays.
2026-12-03 03:27:51 -08:00
Anees Iqbal e31bc61172 Validation: a precision note excuses only the words its operations feed, within its bound
What: a candidate's output is judged against Metal's one 32-bit word at a time
(observation_contract::words). An equal word matches. A differing word is excused only by a
recorded note that reaches it: a note with a bound makes a word within it a match, a note with
no bound makes it a noted word, and a word no reaching note excuses is a mismatch.

- Reach is read from the case's AIR (check::output_words): for each output word, the float
  lanes it holds and the operation families whose results feed it, followed byte by byte
  through bitcasts, lane moves and the zext/shl/or that pack two halves. A store placed at
  A * thread_position_in_grid + B bytes gives each thread's words their own facts. A note of the
  module that writes the output reaches the words its operations feed; a note of another module
  reaches every word, and so does every note of a word the scan cannot follow (a load of memory
  the entry writes, a call outside the intrinsic families).
- Bounds a word can carry are checked there, and a word within one matches: DeviceDenormals
  only where Metal's and the device's lanes both lie at or below the smallest normal (2^-126,
  2^-14 for half), of one sign unless one is a zero; NativeNanEncoding only two NaNs of the
  lane's format (it reaches every float lane: a half read from its bits is no operation);
  HalfTexelConversion its recorded one half ulp, or +-65504 beside the infinity; the lane
  tables and the reassociation bound as before.
- NativeFma, NativeDot, NativeMix and NativeDivision keep no value bound (each states its bound
  over the operands, which a word does not carry) and reach only the words their operations
  feed. The fixture knows its inputs, so a per-case bound from the operands is a later form.
- SimdgroupAccessOrder reaches only a word another thread of the kernel may write: one a store
  the scan cannot place in its own thread's bytes writes.
- Rows record the output's word facts (census output_words). The batch report prints, per case
  and in total, the words matched exactly, within each note's bound and only noted, by note,
  the unexcused words, and the cases with a word on the fall-back.
- DeviceDenormals's rustdoc states Metal's measured answer per operation: it flushes before
  rounding on some (a product, fma, dot and mix just below 2^-126 answer a zero) and keeps a
  denormal on others (sin, tan, asin, sinh, asinh, atanh of a denormal), from the public cases
  float-products-flushed-before-rounding and nan-model-float-denormals-per-operation. Its
  recording rule already covers plain multiplies; no rule changed.

ENGINE_EXECUTOR_ABI is v215: how a match is decided changed and rows record word facts.

Why: a noted difference was excused whole by any recorded note, so a note that could not cause
a word's difference (a division's note beside a product, an access-order note on a kernel whose
threads write disjoint words) hid it, and a bounded note never matched.

Verified on lavapipe (Mesa 26.2.4, the lavapipe image), the 1,168 public cases, job
m3-max-82854 (this tree with the next commit's doc text) against m3-max-82667 at b3d7464945: match 746 -> 773, noted_difference
188 -> 161, mismatch 5 -> 5 (each held open by clipped_primitive_split, as before); words
2,859,015 exact, 30,212 within a bound, 352,820 noted, 0 unexcused. Of the 188 cases noted
before, 34 have an output word on the fall-back (26 every word) and 32 a differing one.
Tests: the validation suite at an earlier tree, m3-max-82839 (1,331 passed, 3 failed; the three
are fixed here), and the touched modules at the same tree as m3-max-82854, m3-max-82855 (136
passed).
2026-12-03 03:27:51 -08:00
Anees Iqbal 1c68dd10f4 Texture buffers: a read-write one is words where its format's own view reads none without a format
A texture buffer's form (rule 2's texture buffer formats, metal::format::texel_buffer_form) asked
three accesses of a format's own view: a uniform texel buffer, a storage texel buffer, and a storage
texel buffer written without a format. A function that reads a texture buffer through
access::read_write reads its storage element without a format, which Vulkan asks of the view's
format (VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT, VUID-vkCmdDispatch-OpTypeImage-07030),
so on a device whose own view of a format lacks that bit the runtime refused the draw or dispatch
(Gap::StorageElement, ReadWithoutFormat). ANV on the Iris Xe (RPL-P) lacks it for BGRA8Unorm,
B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm (jobs m3-max-81883, m3-max-82116); its committed profile
(intel-irisxe-rplp-anv) answers the same for RG11B10Float, RGB10A2Unorm and RGB10A2Uint, and so do
intel-irisxe-anv and intel-uhd770-rpls-anv for all seven (job m3-max-82025). Holding those formats
as words for every texture buffer would cost one made to be read 31.6% and 31.7% on that Iris
(texel_buffer_bgra8_read and texel_buffer_b5g6r5_read, job m3-max-82136).

The form now asks a fourth access, the storage read without a format, only of a texture buffer
whose usage, fixed at its making, holds both MTLTextureUsageShaderRead and
MTLTextureUsageShaderWrite, or is MTLTextureUsageUnknown (metal::format::texel_buffer_read_write):
Metal lets a function reach a texture buffer through access::read_write only where its usage holds
both. texel_buffer_form(pf, usage, profile) is one answer per format and usage per device; one made
to be read or written alone keeps the three-access answer. On the three ANV profiles the seven
formats move to words for such a texture buffer and nowhere else. AGENTS.md's rule 2 says so in
the same commit: the three accesses, plus the storage read without a format for a texture buffer
made with both usages, one answer per format and usage per device; it is still one query-chosen
form, and the count of fourteen is unchanged.

The word says the usage, as it says the format, so a shader that meets a texture buffer through a
handle, as one at a slot, tells which answer holds: bit 11 of a texture buffer word of a format
with a word layout, TextureWord::TEXEL_BUFFER_READ_WRITE, is set where it was made both to be read
and to be written. It lies within the 14 low bits an argument buffer's handle carries
(HANDLE_WORD), and the word stays the same on every device. The translator holds the codes a
profile holds as words per usage (WordCodes: alone, read_write); the words twin's held test tests
bit 11 beside the code only where some format is words for the one usage and not the other
(read_write & !alone), and where the two sets are equal the test and the module are what they
were. The runtime asks texel_form of the texture's usage at its making, and
Device::minimum_texture_buffer_alignment, Metal's query of a format alone, answers the larger of
the two forms' alignments: on the three ANV profiles (uniform offset alignment 1, storage 16, a
single texel enough for both) B5G6R5Unorm and BGR5A1Unorm go from 2 to 4 bytes (a word against a
2-byte texel), and BGRA8Unorm, BGR10A2Unorm, RG11B10Float, RGB10A2Unorm and RGB10A2Uint stay 4;
every other profile's two forms are equal, so its answer is unchanged (computed from the committed
profiles' limits, not measured apart).

Public contract, in this commit: TextureWord::of_texture_buffer(pixel_format, width, usage),
texel_buffer_form(pf, usage, profile), the new texel_buffer_read_write and
TextureWord::TEXEL_BUFFER_READ_WRITE (api_surface, api_signatures.tsv); docs/RESOURCE-ID.md's bit 11
row, its texture buffer word section and its test vectors: tests/resource_words.tsv gains a usage
column, each format with a word at read (1) and read-write (3) usage with its widths, and at write
(2) and unknown (0) at width 1. Consumer search: reims-vgpu at 4f46e27e3b (main's) and at its
current e447795571 (mine): no guest computation of words; of_texture_buffer, texel_buffer_form,
TEXEL_BUFFER_ and resource_words have no hit, and TextureWord's one hit is link-order.txt, a symbol
order list naming TextureWord::of. The runtime README's known gap now says the read is served for a
texture buffer made with both usages, and keeps the measured words' cost scoped to those; its form,
alignment and words-cost paragraphs, docs/API.md and docs/REPLAY-STREAM.md name the usage.

The zero for amd-rdna2-apu-radv, intel-arl-anv and nvidia-pascal-linux is unaudited: those
committed profiles report all 39 word formats as words, so no format can move there by this rule
(main opens a row to re-record them).

SEMANTICS_VERSION 2339 (development holds 2338): the words twin's module on the three ANV profiles
and the form's answers move. RUNTIME_VERSION 2558: a texture buffer's form, its word and the
alignment the runtime answers move. runtime-sources.sha256 re-pinned (metal/format/texel_words.rs
and metal/format/mod.rs are runtime inputs). docs/REFUSALS.md does not move (refusal_surface.py
--check passed).

Verified at 0cbe4dfc70, a commit of this same tree on a try branch (tree dd16b6a2f7):
- red: the test before this one (rebased here as 5900eb8642), at ed24bac82a, job m3-max-83041 on
  the Iris Xe (RPL-P, Mesa 26.2.6): every_device_runs_texture_buffers_made_to_be_read_and_written_at_every_slot
  failed with B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm "not dispatched", the read-written slot's
  ReadWithoutFormat refusal;
- the Iris Xe (RPL-P, Mesa 26.2.6), the runtime's texture buffer tests (--cfg m2v_gpu, filter
  test(texture_buffer)), job m3-max-83121: 12 run, 12 passed; the new test alone, job m3-max-83127,
  passed, every one of the 15 formats answering the CPU's at every slot. It asserts, per texture
  buffer made, that the words gauge (Gauges::word_texture_buffers) moved exactly where the form
  answers words for its usage, and that the words twin ran once per dispatch where one bound is
  words; every_device_reads_and_writes_texture_buffers_of_formats_held_as_words printed
  B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm "own view; made to be read and written, words: every
  answer the CPU's", where they were refused before;
- the Iris Xe, rt_replay's texture_buffers_play_with_their_recorded_ids_and_the_cpu_s_texels
  (--cfg m2v_gpu), job m3-max-83115 (at 9eb68e9c2c, which differs from this tree by a test
  helper's name in the runtime's texture_buffer_words.rs alone): BGRA8Unorm and B5G6R5Unorm play
  as "own view, read_write words" with the recorded IDs (each word with bit 11 where made to be
  read and written), the CPU's texels and values, where the play ended in the refusal before;
- the Intel UHD 630 (Windows driver 101.2145, validation layer 1.4.363.0), job m3-max-83145 (the
  win-cross build m3-max-83134): the runtime's whole suite, 985 run: 984 passed, 1 failed, 4
  skipped; every_device_runs_texture_buffers_made_to_be_read_and_written_at_every_slot and
  every_device_reads_and_writes_texture_buffers_of_formats_held_as_words passed. The one failure,
  half_simd_reductions' every_device_sums_and_multiplies_half_simdgroups_as_metal, fails the same
  way at pin Q (m3-max-82853) and at 2e9f9866be (m3-max-83061) and is outside this change;
- job m3-max-83128 (Linux): the runtime's, devtools' and harness's suites 280 run, 280 passed, 2
  skipped; validation 1323 run, 1323 passed, 3 skipped; conformance 1052 run, 1052 passed;
  doctests; on lavapipe (--cfg m2v_cpu_icd) the runtime's texture buffer tests 12 run, 12 passed,
  and rt_replay's texture buffer play passed, every format the same form for both usages there;
- the Linux gate, job m3-max-83122: cargo fmt --check, signatures --check, refusal_surface.py
  --check, clippy -D warnings (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and rustdoc all clean;
  the translator's and AIR suites 3459 run: 3458 passed, 1 failed, 22 skipped, the one failure
  golden_hashes_match_the_table, a bless due of 80 cells under 2339 (the 78 below and
  development's own 2); the runtime guard (the_runtime_sources_are_the_committed_ones) passed;
- golden cells (job m3-max-83165: the golden test's every changed cell at this tree and at
  development's 401d9d5949, the same build, listed in full): 26 cells move on each of
  intel-irisxe-anv, intel-irisxe-rplp-anv and intel-uhd770-rpls-anv (every fixture that reaches a
  texture buffer: a8r_buffers, abt_descriptor_sets, hlf_half_buffer, hsw_storage_writes,
  kernel_read_through, ob1_texel_buffer, rlm_runtime_limits, tb_word_formats, texture_ops'
  texel_buffers, tob_renders, trh_forward, unk_size_queries,
  kernel_texture_variant_leftovers, kernel_write_one_dimensional_textures), and 0 on each of the
  other twelve committed profiles (amd-780m-hawkpoint-radv, amd-780m-radv, amd-rdna2-apu-radv,
  gate-lavapipe, gate-lavapipe-x86_64, intel-arl-anv, lavapipe, moltenvk-m3, nvidia-pascal-linux,
  nvidia-rtx50-linux, nvidia-rtx5080-laptop, runtime-floor): there the two code sets are equal and
  the module is what it was. Development's own two due cells (runtime-floor's a8r_buffer_read_write
  and tb_word_formats) are the same at both. The .air.ll rows need macOS's metal-as and were not
  compared. The table is re-blessed on development;
- the authored compile census (jobs m3-max-83117 at 9eb68e9c2c and m3-max-83118 at
  401d9d5949, checks; m3-max-83148, a bless in its own workspace at this tree, diffed): 0
  differences and 0 failures at both, 21321 cells; 14 artifact digests move, every one on
  intel-irisxe-rplp-anv (a C3 venue), 0 on gate-lavapipe and amd-780m-radv, against 0 at
  401d9d5949;
- the bit test's cost where nothing moves, on the Iris Xe (exclusive, job m3-max-83168): the
  release harness of 401d9d5949 (before, and a copy of it, before2) against this tree's (after),
  built by job m3-max-83124, 8 rounds of 500 runs each, the arms' order rotating: the read-only
  own views texel_buffer_bgra8_read and texel_buffer_b5g6r5_read take a GPU p50 (median of the 8
  rounds) of 9009.0 us and 9215.8 us after against 9009.0 us and 9215.6 us before, +0.00% each,
  before2 against before -0.01% and 0.00%; every run matched its CPU reference.
2026-12-03 03:22:23 -08:00
Anees Iqbal 5eeeb8d752 Conformance ledger: the KosmicKrisp venue's 30 held lines, each under its read cause
The Apple M3 Max venue (KosmicKrisp, Mesa 26.3.1) held 30 lines after its re-record, kept back
until their causes were read. Each now has a row whose text names that cause:

- a2c and a2one, 8 texel sites: KosmicKrisp computes alpha-to-coverage in the fragment shader with
  NIR's nir_lower_alpha_to_coverage (kk_shader.c, msl_nir_lower_common.c). The mask is Mesa's
  mapping, not Metal's. Note device-alpha-coverage.
- half-output-blends-r32f sa-1msa: KosmicKrisp blends in the fragment shader (kk_lower_fs_blend,
  nir_lower_blend), compiled under Metal's fast math, so the products round in Mesa's order.
  Note device-color-conversion.
- pixel-downscales frac/slot digests, 7 sites: ours, not the device's. The slot's pixel
  coordinate goes to the normalized sampler as coordinate over size (pixel-sampler-scaling). The
  norm control matches Metal on this venue.
- The venue's 11 downscale frac/slot head and tail rows, landed with the earlier re-record, now
  carry the same "ours" text in place of "the device's own answer".
- pixel-samplers rgba8 and rgba16f linear-mirror, slot and arg, 4 sites: ours, the same scaling
  under mirrored repeat. KosmicKrisp maps mirrored repeat to Metal's own mode, and norm and const
  give Metal's digest.
- texture-buffer-fill-groups, -fill-streams and -long-fills: KosmicKrisp's
  minTexelBufferOffsetAlignment of 16 (KK_MIN_TEXEL_BUFFER_ALIGNMENT) refuses the offset-4 texture
  buffer typed (Refusal::TextureBufferAlignment), before the fillTexture step.
- texture-fills-41: A1BGR5Unorm is not made on this venue.
- texture-fills-236: KosmicKrisp offers ASTC HDR, so the case reaches fillTexture (Unavailable).

Those five cases' every-venue rows split into llvmpipe, NVIDIA, RADV and Intel rows, since
KosmicKrisp answers otherwise there. In the split texture-fills-236 rows, "on any venue" now
reads "on this venue". docs/CONFORMANCE-COVERAGE.md is regenerated (coverage.py).

Answers taken from the KosmicKrisp replay of job m3-max-82902. The KosmicKrisp replay at this commit
(Apple M3 Max, job 83133) reports 0 unexpected lines. docs/CONFORMANCE-COVERAGE.md re-run with
coverage.py on development: unchanged.
2026-12-03 03:06:36 -08:00
Anees Iqbal 401d9d5949 Translator: an extended-range 3D texture's linear mip filter blends its two levels, under BicubicFilterArithmetic
A BGR10_XR or BGRA10_XR form's (or _sRGB twin's) 3D sample under a linear mip filter now blends
its two levels' 3D filters as a 2D sample blends its levels: the device's FMix at the clamped
level's f32 fraction, through a constexpr sampler and through a runtime sampler whose word states
the filter. It records PrecisionNote::BicubicFilterArithmetic, as every level blend does
(the runtime sampler's under its linear-mip clause). Metal's blend of a 3D texture's two levels
fits no rule tried; the XR mip probe (an Apple M3 Max on macOS 27.0.1) put the closest 284 of
8,192 samples apart. The note's doc and its catalogue line in docs/API.md now state this, with a
new measure committed as crates/metal2vulkan-conformance/probes/extended_linear_mip_blends.m (the
M3 Max, macOS 27.0.1, job m3-max-82944). At 16,384 lanes per form, filter (nearest, linear) and
shape, Metal's own two levels' samples blended by mix at the fraction truncated onto
sixty-fourths lie within 0.033 of Metal's 3D linear-mip sample of BGR10_XR, BGRA10_XR and their
twins, and within 0.031 of its 2D sample, the blend the module has shipped. The module blends at
the f32 fraction instead, which moves its blend by under 1/64 of the two levels' difference from
that rule.

The select_extended doc no longer lists a 3D texture's linear mip filter among the refusals.

Before this change:
- A constexpr sampler's linear mip filter on such a 3D texture was refused
  NotImplemented(Format).
- A runtime sampler's linear mip filter on one had no refusal at all. The emitted sample read the
  nearest level, and its comment named "the binder's refusal", which no binder or runtime code
  makes (ResourcePlanner::extended_sampler no longer exists).

The same gap holds for a 2D sample of a form whose levels' blend is not built (another XR form,
ExtendedRange::blends_levels false) through a runtime sampler that states a linear mip filter. That
case is left to the oracle measure that will build it.

Red test: tests/engine_extended_range/volumes.rs volume_linear_mip_filters_blend_two_levels
replaces volume_linear_mip_filters_and_padded_forms_are_refused. A constexpr linear mip filter
compiles, valid, with the note. On the CPU interpreter, a runtime sampler's linear-mip sample at
64 levels between two lies, on every lane, between the nearest mip filter's samples of those two
levels, and strictly between on some. A padded form's 3D sample stays refused. At the base, the
constexpr case is refused, and the runtime sampler's sample is one level's.

SEMANTICS_VERSION moves to the next number: a refusal is removed and a sample's words change.

Landed with SEMANTICS_VERSION 2338 (renumbered above development's) and runtime-sources.sha256 4361761c, recomputed on development.
2026-12-03 02:55:10 -08:00
Anees Iqbal 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.
2026-12-03 02:55:10 -08:00
Anees Iqbal a03b74c95c Translator: a fragment float write to a half-float or RG11B10Float storage texture under mode 2 is the device's conversion
Under TextureWriteRoundingMode::NearestEven (Apple's textureWriteRoundingMode 2), a fragment
function's float texel written to a storage texture whose slot declares a half-float or
RG11B10Float format was refused NotImplemented(PrivateRenderState(TextureWriteRounding)). It now
runs with the device's conversion, as at the default mode, and records
PrecisionNote::DeviceColorConversion: Metal's mode 2 rounds such a channel to nearest even
(RG11B10Float held at the largest finite value), the device's store toward zero on every measured
driver. The half-float note comes from half_storage_facts, which every float write runs; the
RG11B10Float note from mode_rounded_write, under the clauses of small_float_storage (unconditional
for a declared format, by the bound format for a formatless slot, by the heap's small-float family
for a heap element). The note's storage clause in artifact.rs and its catalogue line in docs/API.md
state the mode-2 case.

The writes whose mode-2 rounding was not measured keep the refusal: a float texel into
RGB9E5Float, and a half texel into RG11B10Float or RGB9E5Float. RuntimeFact::
StorageTextureWriteRounding and HeapWriteRounding stay for a slot whose bound texture decides and a
heap handle, their docs narrowed to those cases; their field `halves` (a float texel, which also
refused half-float textures) is renamed `float`, since a half-float texture no longer refuses
(api_signatures.tsv's two variant rows follow). The consumer's checkout at a20576e1fd has 0 hits
for StorageTextureWriteRounding or HeapWriteRounding (git grep).

Fixed with it: a slot declaring RGB9E5Float through its word alias (R32_UINT,
StorageImageClass::SharedExponentBits, the choice every profile makes for the format) was not
seen as a mode-2 target at all, so under NearestEven it compiled with the default's word, no
refusal and no mode recorded. It now records the mode and is refused under NearestEven, as a
declared E5B9G9R9_UFLOAT_PACK32 was.

SEMANTICS_VERSION 2333 -> 2334: a refusal class changes (mode-2 storage writes), and a fragment
stage writing an RGB9E5Float word slot now records the mode in StageIo.

Red test: engine_link's mode_two_refuses_fragment_texture_writes_it_would_round gains a
SharedExponentBits case (refused under mode 2) and expects the declared R16G16B16A16_SFLOAT and
B10G11R11_UFLOAT_PACK32 cases to compile under mode 2 with DeviceColorConversion, no fact, and to
link valid.

runtime-sources.sha256 re-pinned (2ac17122): lower/texture/mod.rs and the other edited sources
are runtime inputs.

Landed with SEMANTICS_VERSION 2336 (renumbered above development's) and runtime-sources.sha256 2ac17122, recomputed on development.
2026-12-03 02:55:02 -08:00
Anees Iqbal 965e707277 Conformance ledger: the Apple M3 Max venue (KosmicKrisp) re-recorded, but the sites still to be read
The M3's conformance replay on KosmicKrisp (Mesa 26.3.1) at 6989666062 (job m3-max-82902; the
product of development's 13c6ba8a91, which adds one rt test change) printed 269 lines the ledger
did not expect. The venue had 14 rows; every other row it held was another venue's or every
venue's. This commit records what is mechanical and leaves the rest as it is.

- 197 rows added at sites another venue already lists: 158 with that venue's answer, 39 with the
  same answer but for its numbers. Each takes that venue's gap text, except 18 whose text named
  another device:
  - 6 indirect-range cases: KosmicKrisp does not list VK_EXT_device_generated_commands;
  - 11 pixel-downscales frac sites: the device's sampler, within the 2/255 recorded on lavapipe;
  - 1 half-tanh site: the other venue's first-element values are dropped.
- 14 every-venue rows (astc-*-hdr zero-blocks/texture) split into llvmpipe, NVIDIA, RADV and Intel
  rows. KosmicKrisp makes ASTC HDR textures (textureCompressionASTC_HDR in kk_physical_device.c),
  so the M3 now matches Metal there.
- 1 M3 row removed: discard-quad-sum-placement hoisted_known/pipeline, which the venue now reads as
  lacking the feature.
- 15 rows added for refusals no venue listed, each from a device query:
  - 10 surface-textures cases: KosmicKrisp exports no dma-buf, opaque fd or Win32 memory;
  - 2 lines and facing draws: no fillModeNonSolid;
  - 3 A1BGR5Unorm textures (fresh-pattern-41, extended-swizzles-a1bgr5unorm,
    texture-round-trip-41): not made for the usage.
- 6 bicubic-texel-classes M3 rows: the answer is the one the 780M, RX 550, RTX 5080, RX 7900 XTX
  and Iris Xe rows record. The M3 answers it since the Converted half pair is decorated
  NoContraction (699f1167d6).

Left as they are, to be read first (30 lines):
- alpha-to-coverage texels: a2c-* and a2one-*, 8;
- pixel-downscales frac digests, 7;
- pixel-samplers linear-mirror sites, 4;
- texture-buffer fills refused off KosmicKrisp's 16-byte texture-buffer alignment, with
  texture-fills-41 and -236 (5), plus the 5 every-venue rows they no longer hold;
- half-output-blends-r32f sa-1msa, 1.

docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py).
Verified: the edit is derived from that replay's lines; the conformance suite and a replay on the
M3 with this ledger are in the READY note.
2026-12-03 02:50:42 -08:00
Anees Iqbal 699f1167d6 Translator: a Converted half rounding's conversion pair is decorated NoContraction, as the Controlled one is
A `half` rounding in `QuantizeForm::Converted` (a profile with shaderFloat16 whose float
controls do not make the conversion Metal's) was an undecorated OpFConvert to 16 bits and
its widening. Vulkan assumes AllowTransform on every operation not decorated
NoContraction ("Precision and Operation of SPIR-V Instructions"), and Mesa's NIR folds
`~f2f32(f2f16(a))` into `a` wherever the instruction is not exact (nir_opt_algebraic.py;
vtn marks NoContraction exact), so the value went on unrounded. On KosmicKrisp (Mesa
26.3.1, Apple M3 Max) that broke half_simd_reductions: each round of the half tree kept
float precision, and 224 of 256 words differed from Metal's (job m3-max-82540, pin P's
leg). The MSL KosmicKrisp emits showed no half() between rounds; with the pair decorated,
0 words differ (job m3-max-82662).

`narrow::converted` now emits each conversion with `convert_no_contraction`, as
`narrow::controlled` does. The pair relies on Vulkan's environment rule, which reaches a
conversion, where the SPIR-V specification words NoContraction for an arithmetic
instruction only; the docs state that reliance at the Controlled pair's (narrow.rs), on
QuantizeForm::Converted, and in docs/API.md's native-half-conversion entry, and that a
driver which folds a decorated pair leaves the device's own answer, within
PrecisionNote::NativeHalfConversion, which a Converted module already records. NVIDIA's
measured fold of the decorated Controlled pair stays as recorded. SEMANTICS_VERSION 2333
-> 2334: every Converted module's words change (moltenvk-m3 is the committed profile on
that form; KosmicKrisp takes it at run time).

Evidence, all on the arms of this change before the ruling:
- KosmicKrisp conformance replay on the Apple M3 Max: 53 sites that differed from Metal
  at the base now match, none added (job m3-max-82685).
- Cost: +0.46% host wall on half_mix on the M3 under KosmicKrisp, job 82685, three
  alternated rounds of 200, spread 0.03%.
- Golden tables: 216 moltenvk-m3 cells change, no other profile's (job m3-max-82679).
  They re-bless at the next named pin.

The red test (the commit before) asserts both forms' conversions are NoContraction;
it fails before this change and passes with it (the gate's jobs are in the READY note).
2026-12-03 02:10:22 -08:00
Anees Iqbal 333ae1b40f Translator: PrecisionNote::code states each note's stable degrade code
A precision note's stable code, `metal2vulkan-degrade-` and the note's
name in kebab case, was written only in the conformance crate
(degradation.rs), which is unpublished. So no published item gave a
caller the code to announce a note by, and README.md said the runtime
announces each note once with a stable code, which it does not: the
runtime records each state's notes when the state is made, exposes them
through its getters, and prints and sends none (docs/API.md section 9
says so).

- PrecisionNote::code (pipeline/artifact.rs) returns the code, one arm a
  note, as docs/API.md's catalogue names it.
- The conformance crate reads it from there: Degradation::code is its
  note's code, through Degradation::note, the inverse of
  from_precision_note. Each kind's doc names its note, not a second copy
  of the string.
- README.md's "Recorded differences" says what is true: the runtime
  records each state's notes at creation and exposes them with a stable
  code; the caller announces them. docs/API.md's catalogue lead names
  PrecisionNote::code.
- The signature table takes the method under both crates that export
  PrecisionNote.

The 83 codes are unchanged: each equals the conformance crate's string
before this commit (checked by script against its code() table), and
every_kind_is_a_catalogued_precision_note still finds each in the
catalogue. New tests: every_precision_note_code_is_its_name_in_kebab_case
(translator, serde feature: every variant read from the enum's source,
its code the kebab rule, no code twice) and every_kind_is_its_notes_kind
(conformance: note() takes from_precision_note back for every kind).
No translation, runtime or refusal changes; no runtime input changes, so
runtime-sources.sha256 stays.

Verified: rustfmt --check on the four .rs files; the job named in the
handover.
2026-12-03 01:35:25 -08:00
Anees Iqbal 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.
2026-12-03 01:06:30 -08:00
Anees Iqbal b3d7464945 Validation: a threadgroup target is checked nowhere, so its case is refused before it runs
What: executor_contract::out_of_bounds::containment() reports a threadgroup target as the arena
unchecked (Check::Unchecked), on every profile and under either domains. out_of_bounds_run then
refuses the case before anything is made, as not_supported{uncontained:unchecked threadgroup},
as it refuses a loaded pointer under the identity domains. The read rule's in-shader arm no
longer names the arena. The module docs, the Unchecked variant, ContainmentForm::Threadgroup,
the coverage note on which accesses the encodings govern, and docs/VALIDATION.md say so.
ENGINE_EXECUTOR_ABI moves to vulkan-engine-v214: the executor records a refusal for a case it
ran before.

Why: since 990328afe1 no profile checks a threadgroup access (lower::access::local::contained;
docs/API.md, "Threadgroup memory": one past the memory is undefined, as in Metal; the runtime
README states it too). The contract still reported the arena as checked in the shader, so the
candidate ran the only authored case with a threadgroup target, tg-twice (7efae163,
loads-and-stores-past-a-threadgroup-allocation), and read what the device held past the
allocation. On the Radeon 780M (RADV, Mesa 26.2.6) job m3-max-82582 ran it 10 times at
f606e43b30 and got 10 different output hashes: word 6, a load of tg[40], which no thread
writes, held a different value each run. The kernel's SimdgroupAccessOrder note made the failed
zero rule a NotedDifference. Vulkan does not define an access past a Workgroup array either, so
no part of that run is evidence.

What else moves: no other authored case declares a threadgroup target (all case shards
searched for "form":"threadgroup": one hit), so only tg-twice moves from noted_difference to a
refusal. The case, its AIR and its Metal row are unchanged. No classifier input changes
(executor_contract/out_of_bounds.rs, coverage.rs and case/out_of_bounds.rs are not in
build.rs's classifier list), and the authored compile census compiles the case as before
(case_compile reads no containment), so neither census version moves.

Verified: see the green job named with this commit's READY.
2026-12-03 00:30:04 -08:00
Anees Iqbal 7be9f00a3f Docs: only tests build the resident-table domains
The docs of DevicePolicy::RESIDENT_TABLES, PointerDomain::ResidentTable,
HandleDomain::Table, the lockstep module, docs/API.md and three test
comments said the resident form was the validation executor's alone and
that the executor builds the resident root and handle table itself, or
called it "the old runtime's, until the cutover deletes it". Neither is
true: the validation executor (engine.rs), the runtime, the command line
and the compile worker all build their device under
DevicePolicy::default(), and every RESIDENT_TABLES in the tree sits in a
test (the translator's src/tests and device tests, the validation
crate's #[cfg(test)] modules including coverage::tier_table, the
harness's tests and the validation integration tests).

The comments now say that: nothing outside tests builds the form, and
the runtime, the tools and the validation executor take the default.
Comments and docs only; no code changes.

Verified: git grep of RESIDENT_TABLES, PointerDomain::ResidentTable and
HandleDomain::Table at 8140229b9c, each hit outside the translator's own
tests read for its #[cfg(test)] scope; cargo fmt --all; the workspace
rustdoc check with -D warnings, doc 0 and private-items doc 0 on all seven crates (job
m3-max-82621).
2026-12-03 00:23:31 -08:00
Anees Iqbal 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
(4974c671a8):
- an_unknown_runtime_library_routine_is_refused_as_its_family is red with this change's product
  files at a0d2d2efdd (___metal_ldexp_float: Linking, expected UnknownIntrinsic) and green with
  them;
- the two look-alike tests and surviving_calls_are_refused_by_family_naming_the_callee pass in
  both runs;
- the refusal surface regenerates to these files exactly, and its --check passes;
- the metal2vulkan-air and metal2vulkan suites: 3455 passed, 22 skipped.
2026-12-02 23:56:01 -08:00
Anees Iqbal 28e4da1f17 Docs: Metal's resolve rounds a tie as its GPU does, and the alpha-to-coverage note's devices at 8 samples
The planner's ruling on resolve rounding: rule 1 counts a resolve among the device's own answers,
and two Macs round an average that lies exactly halfway between two codes differently, so Metal
fixes no answer there for a guest. An Apple M3 Max (macOS 27.0.1) rounds the tie up, as the
conformance recordings sample-positions-default-2x and -4x hold (red 1/255 over half the samples
resolves to 1); an AMD Radeon Pro 5300M (macOS 26.7.1) rounds it to the even code (red 0 at 1 of
2, 2 of 4 and 4 of 8 samples, an alpha of 127.5 to 128; m3-max-82284). The device's own rounding
stands; no behaviour changes and neither Mac's rounding is emulated.

- PrecisionNote::DeviceRoundedResolve's doc and docs/API.md's catalogue entry name both measured
  answers with their sources.
- The seven known-gaps-rt.tsv rows of sample-positions-default-2x and -4x (Iris Xe, RADV, NVIDIA,
  llvmpipe) say they differ only by how a tie rounds, and why that stands;
  docs/CONFORMANCE-COVERAGE.md regenerated from them.
- PrecisionNote::DeviceAlphaCoverage's doc and its catalogue entry say exactly which devices are
  measured at 8 samples: the 5300M (m3-max-82239); the M3 Max, which renders no 8 samples and so
  has no answer there; no device the runtime runs on. They said before both that the 5300M was
  measured at 8 and that 8 was unmeasured on every device.
2026-12-02 23:19:49 -08:00
Anees Iqbal efe893738c Translator, runtime: supportsTextureSampleCount: answers 8 where the device renders it into a colour, a depth and a stencil attachment
The planner's ruling: raster_sample_counts, which supportsTextureSampleCount:,
getDefaultSamplePositions:count: and programmableSamplePositionsSupported read, is the device's
framebufferColorSampleCounts, framebufferDepthSampleCounts and framebufferStencilSampleCounts,
intersected with 1, 2, 4 and 8. A query answer, not a second form: a device that renders 8 into
all three attachments answers yes for 8, as a Mac's AMD GPU does (an AMD Radeon Pro 5300M under
macOS 26.7.1, job 82204) and Apple10 does, where the Apple9 table answered 1, 2 and 4 alone.
TEXTURE_SAMPLE_COUNTS leaves the apple_gpu table, whose other answers are Apple9's.

Nothing else capped at 4: a texture's samples are its format's own (Limit::TextureSamples), the
pipeline link maps 8, the sample mask takes a word, Vulkan's standard locations hold 8, and
interpolate_at_sample reads index & (n - 1).

Metal at 8, measured on the 5300M (job 82239), and where ours can differ:
- interpolate_at_sample: indices 0 to 9, 15, 16, 100, 2^31 - 1 and 2^32 - 1 read sample
  index mod 8, the runtime's answer; InterpolantAt::Sample's doc says so.
- Alpha to coverage: the 5300M covers a pixel at one sample at an alpha of 1/2 or above, every
  pixel alike, and at two, four and eight samples floor(alpha * n + 1 - t), t 1/8 and 3/8 at even
  and odd x of an even row, 5/8 and 3/8 of an odd one; every pixel floor(alpha * n) or
  ceil(alpha * n). The device's own mapping may differ: PrecisionNote::DeviceAlphaCoverage (and
  docs/API.md's catalogue) now states the 5300M's rule beside the M3 Max's and that eight
  samples are unmeasured on every device.
- Default positions at 8: the 5300M's answer is Vulkan's standard 8 locations.

Docs that said 1, 2 and 4: Device::supports_texture_sample_count and default_sample_positions,
the floor's standardSampleLocations line, RenderPassDescriptor::sample_positions, positions.rs,
the runtime README (default positions, the floor table) and metal_properties' field.

Verified: the stacked gate (m3-max-82337, this change on the (i)+(b) hand-over): fmt, clippy in
three configurations, rustdoc, doctests, the validation suite 1322 passed (3 skipped), the
product suite 3725 passed with the five reds development's next bless takes (none of this
change's), the runtime's lavapipe suite 974 passed (4 skipped); the red commit's tests green on
lavapipe (2 translator, 9 runtime). On an RTX 3090 (m3-max-82314), an RX 7900 XTX and a 780M
(m3-max-82315) and an Iris Xe (m3-max-82316), the same patch on 8a2acc84fb: the runtime's 9
sample-count and sample-position tests pass, each device answers yes for 8 with Vulkan's
standard 8 default positions and answers programmableSamplePositionsSupported yes.
2026-12-02 23:12:42 -08:00
Anees Iqbal c1e6805526 Conformance: the sample positions family at 8 samples, carried from an AMD Radeon Pro 5300M
The oracle, an Apple M3 Max, renders no 8 samples (supportsTextureSampleCount: answers no for 8),
and a Mac with an AMD GPU does. Three rows run the family's pass at 8 samples: the device's own
positions against an edge at 5/8 of the pixel (5 of 8 samples), eight positions at x 0.25 (8 of
8) and one at 0.25 with seven at 0.75 (1 of 8). Their Metal answer is carried from an AMD Radeon
Pro 5300M under macOS 26.7.1, plain and under Metal's API validation layer, which passed the
passes (job 82284, the usage-edges probe sample_positions_8.m): the resolved texels
01 00 00 9f, 01 00 00 ff and 00 00 00 20, record mode forbidden on the oracle.

Each row's coverage avoids a resolve halfway between two codes: there the 5300M rounds to the
even code (4 of 8: red 0, alpha 128; and 1 of 2 and 2 of 4: red 0) where the M3 Max rounds a half
up (red 1), which is the device's own rounding (PrecisionNote::DeviceRoundedResolve), not where
the samples are. The probe's sweep of the default positions, an edge at each even sixteenth,
covered 0 to 8 samples in order, as Vulkan's standard 8 locations do.

The rows are sample-positions-8x-default, -8x-custom-left and -8x-custom-mixed, one prefix that
tests::a_carried_answer_taken_on_another_chip_names_it lists beside managed-named-* as the 5300M's.
Their recordings were written on the oracle by record mode's carried path, which runs no Metal,
with the timing record `times --write` keeps for a case whose Metal leg is forbidden
(m3-max-82412).

Verified: the conformance suite and its clippy (m3-max-82421); the rows replayed through the
runtime on lavapipe (m3-max-82337, m3-max-82421), an RTX 3090 (m3-max-82314), an RX 7900 XTX
(m3-max-82315) and an Iris Xe (m3-max-82316): every byte equal to the 5300M's, each row announced
only by the device's own colour conversion or point size notes. The 2x and 4x default rows, whose
resolve halves a code, stay the known gaps the ledger holds on those cards.
2026-12-02 23:12:41 -08:00
Anees Iqbal 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.
2026-12-02 23:05:54 -08:00
Anees Iqbal 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 8a2acc84fb: clippy in the
three configurations and the translator's tests (gate m3-max-82186; the read-through and words
tests 120 passed, m3-max-82186's focused step); on lavapipe the runtime's texture buffer tests 13
passed and the stream test passed, and the runtime's whole suite 972 passed, 4 skipped; the
read-through test over the three sampler states and six formats on an Iris Xe (m3-max-82187), an
RTX 3090 (m3-max-82193) and an RX 7900 XTX and a 780M (RADV, m3-max-82282), each format in its
form there (B5G6R5Unorm as words on the 3090, the XTX and the 780M); the read-through-buffer
conformance replay on lavapipe, base 8a2acc84fb against the tip, 0 of 1 cases differ
(m3-max-82188).
2026-12-02 23:05:54 -08:00
Anees Iqbal 0cd07d6612 Docs: API.md states the local size contract of a kernel on subgroups, which its shuffles rely on
A translator consumer that is not metal2vulkan-runtime read nowhere in docs/API.md that a
kernel stating RuntimeFact::LocalSizeConstraint runs only threadgroups whose size is a multiple
of it, and that a dispatch at any other size runs the kernel's EmulatedSimdgroups variant. A
half simdgroup sum or product on the Direct and Cluster32 tiers now reads its sibling lanes by
xor shuffles in a block every lane executes, which name an inactive lane in a partial subgroup.
Section 6 now says so, and that the emulated variant gives Metal's answers for the partial
simdgroup, as the runtime's variant choice does (pipeline.rs: a module with multiples gets
KernelVariant::EmulatedSimdgroups).

Verified: docs only; the contract read from device::subgroup::requirement and the runtime's
variant choice.
2026-12-02 22:40:50 -08:00
Anees Iqbal a1f82878ff Translator: a half simdgroup sum or product is Metal's tree of rounded half operations on every tier
Metal's simd_sum and simd_product of half operands work as a tree. In round d (1, 2, 4, 8, 16),
each aligned block of 2d lanes holds its lower and upper halves' results, combined and rounded
to half. A lane that takes no part counts as the identity. Measured on an M3 Max, macOS 27.0.1,
our own MSL, fast math on and off alike:
- sums: m3-max-80839;
- products: m3-max-80879;
- three masks of active lanes: m3-max-80890.

The Direct and Cluster32 tiers folded the f32-held values with OpGroupNonUniformFAdd or FMul and
rounded once. Rounding once misses five of the eight measured sums (0x3c10 where Metal answers
0x3c0f), four of the eight products, and ten of the 48 masked results. The emulated tier's
exchange rounds already were the tree.

group::half_fold:
- New form. Five rounds; each combines the lane's partial with its sibling block's partial
  through half_step.
- In a block every lane executes, the sibling partial comes from OpGroupNonUniformShuffleXor
  by d. A mask below 32 stays inside a Cluster32 cluster.
- Where the group may be partly live, the sibling partial is the first active lane of the
  sibling block, read with the live lanes' ballot. A block with none leaves the lane's own
  partial: the identity, as the masked probe measured.

half_step:
- On a module that computes half under the 16-bit float controls, it is ops::f16_binary. That
  is the device's 16-bit instruction, whose rounding survives a driver that folds a
  conversion's round trip (NVIDIA's does).
- Elsewhere it is ops::float_binary.
- This is the same choice half + and * make.

There is no 16-bit route for group operations: half group ops run on f32-held values on every
profile, so this covers every route.

Other changes in this commit:
- reads_lanes is true for these operations, so partly_live tracks them.
- direct_ops and cluster_ops need the shuffle class; partly_live adds the ballot.
- words() bounds the five rounds.
- A half simdgroup sum or product no longer records PrecisionNote::ReductionOrder. float and
  double sums and products, every float prefix sum or product, and the matrix and AGX
  multiply-adds still record it.
- The note's doc and docs/API.md's catalogue entry say this per route. They also record that
  Metal's half prefix-sum order is not measured: it matches none of f32 rounded once per lane,
  a lane-order chain of half additions, or a Hillis-Steele scan of them (m3-max-80839).
- Validation's REDUCTIONS table drops simd.reduce.fadd.half and simd.reduce.fmul.half, so a
  comparison holds them exactly. Its tests now name the half scan.
- bfloat has no group operations: decode refuses them.

SEMANTICS_VERSION 2325 -> 2326.

Tests:
- lower::simd::tests::half_sums_and_products_are_shuffle_trees covers the classes and the
  lane reads.
- engine_simd's float_sums_record_their_precision now holds that a float sum records the note
  and a half sum does not.
- The red tests of the previous commit carry Metal's bits.

Verified: cargo fmt only on this host. The red and green device jobs, and the timing on a real
half-reduction kernel, follow before landing.
2026-12-02 22:40:48 -08:00
Anees Iqbal cb98ac0cb5 Conformance: srgb-storage-fragment-writes recorded on Metal, the coverage regenerated
Metal's run on an Apple M3 Max with its validation layer (job m3-max-82183, record then times
--runs 8 --write): each fragment's write stores the same bytes the kernel case's writes store, all
four stored sites equal to srgb-storage-writes' recording. On the runtime at development's tip the
case's draw is Gap::StorageElement; the runtime's draw test is red on lavapipe (job m3-max-82181,
filtered, 3 tests: 2 passed, 1 failed, the new one, refused StorageElement Absent).
2026-12-02 22:21:37 -08:00
Anees Iqbal 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 530fb4ea4c: kernel_read_through's rt_buffer, rt_buffer_ow and
rt_arg_buffer, on lavapipe and on the runtime floor.

Such an access now keeps its strategy, the texture's own view, as on a profile that holds no
format as words, and the stage records RuntimeFact::TexelBufferOwnView { stage, texture }: the
slot, or None for a texture buffer reached through a handle. The fact's mechanism is a plan-time
check. The runtime's kernel interface and a render content's draws read it, and a dispatch or
draw that binds a texture buffer held as words at such a slot is Gap::TexelBufferOwnView of the
slot and its format; through a handle, any such dispatch or draw while a texture buffer held as
words is live (the gauge the words twin's handles test reads). Binding no texture buffer held as
words there changes nothing.

Tests: engine_identity's a_read_through_a_sampler_of_a_texture_buffer_takes_its_own_view compiles
the three entries under the identity domains on lavapipe and moltenvk-m3, passes L3, and checks
the fact where the profile holds a format as words and nowhere else (red before this: lavapipe's
compile refused). The runtime's a_read_through_a_sampler_refuses_a_texture_buffer_held_as_words
runs rt_buffer_ow over six formats. Each held directly answers its texels and Metal's white
border: three without a word layout, and three with one, whose border comes from the code. Each
held as words is refused at its dispatch with the gap of slot 0 and its format, and the same
state's next dispatch runs.

docs/REFUSALS.md and the error basis are regenerated. The runtime README's known gaps state the
refusal. api_signatures gains the fact's and the gap's variants.

Verified: not yet built; the ceilings, the gate, lavapipe device tests and the read-through-buffer
conformance replay follow.
2026-12-02 22:11:26 -08:00
Anees Iqbal e46643db97 Translator: a texture buffer's word keeps its border texels unless its format has a word layout
The words change cleared bits 0-11 of every texture buffer's word, on the premise that no texture
buffer is read through a sampler. Metal 4.1 reads one so (`read(sampler, x)`, the fixture
kernel_read_through's rt_buffer, rt_buffer_ow and rt_arg_buffer, the conformance case
read-through-buffer), and under the identity domains such a read takes the border texel from
those bits. So every texture buffer read through a bordered sampler read a zero border on every
device, and one of a format with a word layout read its fields as border texels. The base,
development 530fb4ea4c, kept the bits; found by reading, before any run.

Now TextureWord::of_texture_buffer is the texture word, border texels included, for a format
without a word layout, which is the base's word. A format with a word layout sets bit 13
(TextureWord::TEXEL_BUFFER_LAYOUT, 0 in every other word) and carries its fields in bits 0-10 on
every device. The words' held test requires bit 13, since a plain word's bits 2-7 are border
texels; a handle carries 14 bits of the word (HANDLE_WORD 0x3fff). A slot's read through a
sampler of a texture buffer takes the border texels from bits 0-11 where bit 13 is clear, else
from its format's code (words::border_texels, a choice among the values the word layouts'
formats have, grouped from WORD_FORMATS and metal::sampler::border_texels).

RESOURCE-ID.md and resource_words.tsv state the new word: the texture buffer lines of a word
layout gain bit 13, the others carry their border texels (the texture line's word at the default
swizzle).

Consumer search, the consumer's development 2221a41c20 (git grep -w over *.rs, *.c, *.h, *.m,
*.mm, *.cpp, *.py, *.tsv, *.md): TextureWord, of_texture_buffer, resource_word, resource_words,
BORDER_TEXELS, TEXEL_BUFFER, border_texels, OUT_OF_BOUNDS_ALPHA_ONE, PIXEL_FORMAT_SHIFT: 0 hits
each. The consumer takes each texture's ID from the runtime's gpu_resource_id.

Verified: not yet built. The unit test words::each_code_takes_its_format_s_border_texels holds
each code to its format's border texels; the runtime test and the lavapipe replay of
read-through-buffer come with the next commit.
2026-12-02 22:11:26 -08:00
Anees Iqbal 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).
2026-12-02 22:11:26 -08:00
Anees Iqbal 740d12b3a6 Texture buffers: the twin's docs, the player's twin gauges and metrics, and B5G6R5Unorm harness rows
AGENTS rule 2's texture buffer form and the runtime's README name the stage constant, the words
twin made in the same make as each plain pipeline, what picks it, and its second compile and
memory as the form's known gap; docs/API.md and RESOURCE-ID.md name the gate.

The replay player prints the word pipelines' and word-held texture buffers' gauges and the
twins' makes and time beside pipeline_creation_nanos.

The harness's texel_buffer_b5g6r5_write and texel_buffer_b5g6r5_read rows time a format the lab's
cards hold as words, a 2-byte texel written by two atomics and read through the words' routine,
checked against the CPU's exact conversion and decode.

Not built yet.
2026-12-02 22:11:25 -08:00
Anees Iqbal dc3e5ab673 Texture buffers: the site reads the profile's word codes from the plan; the player's word of a texture buffer; a replay stream of texture buffers
The site test read the codes from the module's declarations, which do not hold them; it reads
the plan's. The player compared a texture buffer's recorded ID with TextureWord::of, whose border
texels a texture buffer's word does not carry; it takes TextureWord::of_texture_buffer of the
descriptor's format and width, as RESOURCE-ID.md and REPLAY-STREAM.md now say. rt_replay gains a
stream of texture buffers of five formats (RGBA8Unorm, R8Unorm, BGRA8Unorm, B5G6R5Unorm,
RGBA16Unorm) over a Shared buffer, read, written and read-written by tb_word_formats with the IDs
the program saw recorded, each played on the cfg's device: no id line, the CPU's texels and
values, and each format's form on that device printed. Unbuilt.
2026-12-02 22:11:24 -08:00
Anees Iqbal 7cdaa1cc3f Texture buffers: each device holds a format as words only where it lacks the format's own view for an access
metal::format::texel_buffer_form is the one place that decides, per format and device: the
format's own view where the device holds it directly as a uniform texel buffer, a storage texel
buffer and a storage texel buffer written without a format; else words where it has a word
layout; else its own view of the first two (whose writes the runtime refuses). The resource ID
word is unchanged and the same on every device; a module takes the codes its profile holds as
words (texel_buffer_word_codes) and tests a word's code against them, emitting nothing of the
words where the profile holds none so. The routines' cases and the precision notes follow those
codes. The runtime's texel_form takes the same answer. AGENTS.md rule 2 gains the fourteenth
form; the runtime's README records the words' cost (7.3x the own view's GPU time for an R8Unorm
texture buffer written on an RTX 3090, job m3-max-80580).

This commit alone was not built; the series is checked at its tip.
2026-12-02 22:11:24 -08:00
Anees Iqbal 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).
2026-12-02 22:11:24 -08:00
Anees Iqbal 432bbb0a60 Replay player: a noted word in a buffer reached only as texels plays as recorded
The player moved every written word whose value lies in a buffer noted
escaped (AddressMap::move_noted), whatever the buffer it was written into.
In rec-m3-max-80463 it moved 3 RG8 mask words of no-copy buffer #1960,
which the program reads only as texels through texture #1962 over it. Each
play wrote its own host address there, so two plays read different texels
(audit lane, m3-max-81898 and m3-max-81914).

Now the move is decided by the stream's structure:
- read_ahead, which already walks the whole stream, notes each buffer's
  life, keyed by the object and its making's position (as recorded_ids
  is):
  - whether a texture is made over it (it receives
    newTextureWithDescriptor:offset:bytesPerRow:, the tiled form or the
    linear form);
  - whether any call names it as an argument, at any depth of lists and
    maps, but a copy between a buffer and a texture (copyFromBuffer:...
    toTexture:..., copyFromTexture:...toBuffer:...), whose bytes are texels.
  A buffer with a texture over it and no such naming is reached only as
  texels.
- At an object's making the play marks it live as such, or unmarks the id.
- place_words takes the write's target (none for set*Bytes data). Into a
  buffer reached only as texels, the words move_noted would move play as
  recorded and are counted as texel_only_words (AddressMap::count_noted,
  which shares move_noted's pass). The census is unchanged.
- Unchanged: a buffer with no texture over it, including one the stream
  never names (the existing noted-word test), set*Bytes data, and any
  buffer bound, encoded, used, copied buffer to buffer or added to a
  residency set.

texel_only_words is a new stream counter: in FIXED, frame and group lines,
and the report's addresses line. Docs: REPLAY-STREAM.md section 5's
noted-word paragraph and section 10's counts and addresses line. The
counter lists the replay tests spell out gain it.
2026-12-02 21:56:36 -08:00
Anees Iqbal 3ecfe8f034 Conformance ledger: the BGRA4Unorm texture buffer's rows follow the device's texel-buffer query
a3fb852de3 (a heap makes texture buffers in place) sizes a heap's texture buffer through the
format's texel form, which takes a format whose buffer features hold both the uniform and the
storage texel buffer. On the Iris Xe, whose ANV holds A4R4G4B4_UNORM_PACK16 so, the heap's size
and alignment of the format-footprints-plain-stragglers BGRA4Unorm texture buffer now answers
(Metal's 128 at 16), and the case reaches its makes-texture site, which the runtime's side refuses
as Refusal::TextureBufferNotOverBuffer, the consumer's contract. The ledger's one row for every
venue refused the size-and-align site, so the Iris's conformance replay went red at pin M
(m3-max-82006: an unlisted makes-texture refusal) while the RTX 3090's held (m3-max-82034).

Now:
- the size-and-align row is one per venue whose device lacks the storage texel buffer of both of
  the format's Vulkan formats (NVIDIA, RADV, llvmpipe, Apple M3 Max, UHD Graphics 630), naming
  a3fb852de3;
- the Iris Xe has a makes-texture row with the consumer's-contract reason the other texture
  buffers' rows carry, naming a3fb852de3;
- each says Metal's validation layer refuses this format for a texture buffer, so what such a
  texture reads is outside documented Metal and no value comparison is owed for it;
- the runtime's README says a texture buffer's answer, the heap's size included, follows the
  format's texel-buffer features: the devices differ by query, not by form.

docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py; --check
clean), as are the metal-coverage and refusal-surface checks.
2026-12-02 21:47:08 -08:00
Anees Iqbal bbdf8d4d90 Conformance recordings: the five managed-named cases, carried from the 5300M's measurement
Each recording holds the case's carried answer as record mode writes a carried case's: the
transcript of the reader's content as an AMD Radeon Pro 5300M under macOS 26.7.1 read it, 8
rounds a reader (jobs 81602 and 81644), measured_on amd-radeon-pro-5300m, validated not run. The
compute slot, the declaration, the vertex slot and the blit source read the bytes as of the
reader's commit; the reach through the address alone reads the bytes the GPU's copy last took.
The oracle's own run is forbidden by the cases (one copy), so nothing here ran on Metal.

They were written by record::carried and record::write, the calls record mode makes for a
carried case, through a scratch test of a CPU-only job's own workspace (job m3-max-81916, at
c098a9848e), never committed. docs/CONFORMANCE-COVERAGE.md is regenerated with them
(scripts/conformance-coverage/coverage.py): 192 case modules, 1347 recordings, 85 carried.

Verified: in the same job the conformance suite ran 1050 tests, 1048 passed; the two failures are
the coverage document, regenerated here, and the cases' missing Metal time records, which the
oracle's times run adds next.
2026-12-02 21:46:14 -08:00
Anees Iqbal 8be5365553 Player: a two-copy stream's announcement is taken at the first commit that names the buffer
The runtime now takes a Managed range at the first commit whose encoders name
its buffer, as Metal on an AMD Radeon Pro 5300M does (jobs 81602, 81644). The
player's own second copy, which a two-copy stream's Managed buffers take on a
device with unified memory, took every range named at the next commit of any
command buffer; it now follows the runtime's rule.

- second.rs: Seconds keeps, for each command buffer not yet committed, the
  buffers with a second copy its encoders named, themselves or through a
  texture over one (made over the buffer, a tiled one, or a view of one), and
  a commit takes only those buffers' ranges. A released buffer with ranges
  pending stays only while a command buffer not yet committed that named it,
  or a texture over it, can take them; otherwise its place goes back at once.
  A command buffer released uncommitted takes nothing.
- mod.rs: each encoder call's named objects, a render pass's attachments,
  resolve textures and visibility result buffer at its encoder's making, and
  the textures and views made over a second copy feed it. render.rs keeps the
  pass's resolve textures and visibility result buffer by stream id.
- encoders.rs: copy_named takes the committing command buffer's ranges alone.
- stale.rs: a didModifyRange: is pending until a commit whose uses name the
  object takes it, with the bytes written by then (an indirect command
  buffer's command takes it where it is encoded); writes between the
  announcement and that commit are not stale.
- docs/REPLAY-STREAM.md says so.

Tests: rt_replay a_two_copy_stream_s_announcement_is_taken_at_the_first_
commit_that_names_the_buffer (zeros announced, a commit of another buffer, 7s
written with no announcement, a copy of the buffer reads the 7s); tests
an_announcement_is_taken_at_the_first_commit_that_names_its_buffer (the
census counts one stale use where it counted two). Not yet compiled.
2026-12-02 21:46:13 -08:00