Commit Graph
8258 Commits
Author SHA1 Message Date
Anees Iqbal 241472b6fe conformance: the texture-view probe's views of another format of the same component layout, with and without PixelFormatView
Eight cases of a 2D parent of ShaderRead usage: an A8Unorm view of R8Unorm (and with
PixelFormatView as the control), R8Snorm and R8Uint of R8Unorm, RGBA8Uint, BGRA8Unorm and
BGRA8Unorm_sRGB of RGBA8Unorm, and R16Unorm of RG8Unorm. A case names its parent's format and
texel size; the others keep RGBA8Unorm's.
2026-11-20 11:12:35 -08:00
Anees Iqbal fd73fcf635 nextest: the runtime's memory-return test runs in a slot of its own
tests::places::every_device_returns_to_its_fixed_private_memory_within_a_second_of_going_idle
assumes an idle device: it releases everything it held and reads the Private gauges back to
their fixed values within a second. A GPU that other tests share is not idle.

In the round at 96d335ef46 the test failed on the RTX 3090 (3090:rt, m3-max-59566). That job
ran 16 test threads, all on that one card. A second after the release the gauges read
[151060480, 117506048, 16777216, 16777216] where [33554432, 16777216, 16777216, 16777216] is
the fixed state. That is five 16 MiB idle allocations and the test's long one, not yet freed.
The test took 8.56 s.

Run alone on the same card (m3-max-59626), it passed. The gauges were fixed 264 ms after the
release (the 250 ms idle age, then the frees), and the test took 0.61 s. memory.rs, device.rs
and places.rs are the same at that run's archive (96d335ef46) as at development.

So the test takes `threads-required = 'num-test-threads'`, as the 2 GiB access test does, and
keeps its 1 s deadline. Nothing in the runtime changes: no memory is kept to dodge a free.
2026-11-20 10:58:25 -08:00
Anees Iqbal 988cb99106 Identity domains: the sample form's refusal is asserted by a translator test, not run on a device
The fix in the previous commit makes an identity-domain sample of an argument buffer's texture stop
at the form the function holds, "a sample, gather or comparison of an argument buffer's texture"
(lower/select.rs, now HEAP_SAMPLE_FORM), where it named a raw member's decode, which it never
reads. That form is a known gap of the runtime (its README, Known gaps of pipeline states): the
identity domains lower no sample of an argument buffer's texture. No guest has met it (0
IdentityDomains refusals over the 35 streams of the last play), so it stays a typed refusal.

The runtime's device test of the bare shape cannot pass until that form is lowered, so it goes.
Its fixture, examples/heap_samples, now feeds the translator test
an_argument_buffer_textures_sample_is_refused_as_the_sample_form_under_the_identity_domains
(tests::engine_identity): on lavapipe and moltenvk-m3 the kernel compiles on the default domains
and is refused under the identity domains as Unsupported{IdentityDomains}, not implemented, naming
HEAP_SAMPLE_FORM. The README's 'no test yet' for that form names the test.

The old render key re-pinned at SEMANTICS_VERSION 2207: 0eee6bc3..., the value m3-max-59647 read.
2026-11-20 10:54:50 -08:00
Anees Iqbal e6f274b0e2 Sampling: an argument buffer's texture sampled under the identity domains takes no raw-member decode
On the identity domains (the runtime's, on every device), an argument buffer's texture is the
element its resource ID names in its class's array, read in the class the shader declares; no
unsigned integer class holds a raw member to decode. Yet a float or half 2D sample or gather of
such a texture, without comparison, through a constexpr sampler of one filter and no mip filter or
anisotropy or through a sampler slot, planned the raw-member decode (sampler/select.rs
select_heap_raw, then texture::heap_raw::plan), which select.rs's identity-domain check then
refused: "unsupported: IdentityDomains (an argument buffer's texture read as the raw texels of an
extended-range member); needs NotImplemented". Every such sample on the runtime was refused.

select_heap_raw now returns None where texture::tabled is false (a heap image under the identity
domains), as the other decode paths do. The paths that plan the decode, each now testing heap &&
!identity through tabled: a texture read (texture/mod.rs, heap_raw::plan from the read's
selection), a level or size query of one sample (texture/mod.rs, reads_raw), and a sample or
gather (select_heap_raw, the only caller of heap_raw_sample, whose heap_raw::plan call is the only
other). No other sample or gather path plans it: heap_raw::plan has those two callers, and
reads_raw is set only by it and the query path.

Test: tests::heap_samples (runtime, device cfg), over the owned fixture examples/heap_samples
(regenerated by regen-air-fixtures): a kernel samples a texture2d<half> over RGBA16Float and a
texture2d<float> over RGBA32Float, both in an argument buffer, through a constexpr nearest sampler
and through a sampler slot bound a nearest sampler state, and every answer must equal its texel
exactly. Without the fix, pipeline creation fails with the refusal above. The runtime's
lost_writes discard test, which samples a texture2d<half> in an argument buffer through a
constexpr nearest sampler, was failing the same way on lavapipe (m3-max-59606).

SEMANTICS_VERSION 2207: a refusal became a module.
2026-11-20 10:54:50 -08:00
Anees Iqbal edf0d0abed replay player tests: the report line of the stream's counts holds noted_words
What: the_stream_fixes_its_calls_commits_encoders_draws_and_dispatches also checks the report's
first line, which lists every stream count. That line now has noted_words=0 between
misaligned_address_words and relocated_words.

Why: gate m3-max-59584 failed this one test on that line. Its validation suite ran 1457 tests,
1456 passed and 1 failed. Every other check in that gate passed.

How verified: the lane's compile gate with the validation suite on lavapipe.
2026-11-20 10:50:42 -08:00
Anees Iqbal fbf7d24b5b replay player tests: the stream's fixed counts hold noted_words
What: frames_releases_and_splits and the_stream_fixes_its_calls_commits_encoders_draws_and_dispatches
list every count the stream fixes. Both lists now include noted_words, 0 in both streams, which
hold no escape note.

Why: the previous commit added noted_words to FIXED, and gate m3-max-59520 failed these two tests
on the missing key. That run's validation suite: 1457 run, 1455 passed, 2 failed. Every other
check in that gate passed.

How verified: the lane's compile gate with the validation suite on lavapipe.
2026-11-20 10:50:42 -08:00
Anees Iqbal c120b74608 replay player: a noted buffer's address in written bytes moves with the buffer
What: once the stream notes a buffer escaped (m2v.bufferEscaped), the player no longer stops at a
written word whose value lies in that buffer's recorded range (PlayError::NotedWord, now deleted).
It moves the word with AddressMap::move_noted to AddressMap::relocated(value), the address the play
gave the innermost live range the value lies in plus the same offset, the same move an address
argument gets. This happens after the census counts and before the bytes reach the backend, on
all five write paths:
- set*Bytes data;
- a copied buffer's contents;
- m2v.write;
- the m2v.copyFromGuestRam pieces;
- the m2v.privateBytes bytes before a dispatch.
A new stream count, noted_words, counts the words moved. The census counts are still taken from
the bytes as the stream holds them.

Why: the runtime backend makes objects where it has room, so a pointer the program wrote into
memory held the recorded address and pointed at nothing in the play. The stop ended every replay
of a stream whose buffers escape (one of reims's plays stopped at frame 216). Every live range has
the address the backend made its object at; a make without one already stops at the make. So
every noted word can be placed, and the stop has no case left. A pointer into memory no live
range holds cannot be told from data and plays as recorded, as before. This runs on every
backend and device; nothing is keyed by identity.

Docs: REPLAY-STREAM.md section 5 (written words and the escape note) and section 10 (the stream
counts and the addresses line), VALIDATION.md, and command-replay's addresses line, which gains
noted_words.

Tests:
- Unit (mock backend), a_word_into_a_buffer_noted_escaped_moves_with_it. After the note, a word
  in an m2v.write and a word in setBytes data each move to the mock's base plus their offset,
  and are counted as noted. The same word written before the note, and a word into a buffer with
  no note, play as written.
- lavapipe, a_noted_buffer_s_address_in_written_bytes_moves_and_a_kernel_follows_it. A block at a
  recorded address holds a data buffer noted escaped (kind 0) and a buffer whose written word is
  the data buffer's recorded address plus 16. The fixture kernel ab_address (out[i] = held.p[i])
  follows the moved word, and out holds the data words from the fifth on, exactly.
- Negative: the two tests on development's tip without the move. The play stops with NotedWord.

How verified: the lane's compile gate with the validation suite on lavapipe, and the negative job.
2026-11-20 10:50:42 -08:00
Anees Iqbal e5c2bef203 Conformance: the rt ledger's KernelInput answers name their kind
1c26e1dc54 made Gap::KernelInput's text end with its kind ("...does not supply yet: StageIn").
The ledger keys a gap by its answer, so its 95 KernelInput rows still held the text without a
kind. In the round at 96d335ef46 every GPU's conformance replay failed with 190 lines, two per
row: the old row no longer held, and the new answer unlisted. Those were the replays on the
RX 550 (m3-max-59571), RX 7900 XTX (59570), Iris Xe (59575), 780M (59586), RTX 2080 (59591)
and RTX 5080 (59592). The replays reported nothing else.

Each row takes the answer the six replays report for its case, expectation and site; all six
agree on every one: StageIn 82, Slot 12, RuntimeFact 1. Venues and notes are unchanged.

The conformance stub test a_refused_stage_in_row_is_its_refusal_alone now refuses with the
runtime's text as it reads, kind included.
2026-11-20 10:50:06 -08:00
Anees Iqbal d02300e85a Bless: the golden hash table and the engine inventory after cutxlate's deep and follow-up batches
The deep batch (binder: a mixed dispatch checked against the emulated variant's rules with its
deep threadgroups, RUNTIME_VERSION 2542) and the follow-up batch (SEMANTICS_VERSION 2206: the
multisampled in-shader depth gap, ExtrapolatedInterpolation on every device, the two rung-1
arithmetic forms) moved the golden hashes and the engine inventory's part 1, the two reds their
gates (m3-max-59432, m3-max-59480) showed and nothing else.

Blessed on the M3 by m3-max-59594 at f8d1d15c96 (bless_engine_inventory, bless_golden_hashes,
bless_engine_goldens). Tip check m3-max-59595 at f8d1d15c96: clippy plain, m2v_gpu and
m2v_cpu_icd, workspace Rustdoc, the runtime suite on lavapipe 476/476.
2026-11-20 10:46:31 -08:00
Anees Iqbal f8d1d15c96 Follow-up fix forward: the mask extract's and the depth gap's tests; the old render key re-pinned at 2206
Gate m3-max-59374 (the batch before its rebase onto development 2258522299) found four reds of
this batch's own, each a test still asserting the old form:
- device::tests::from_queries::from_queries_keeps_the_narrow_mask_on_ga10x asserted no
  OpBitFieldUExtract; the extract is now the one form, so it is
  from_queries_clears_a_narrow_value_by_an_extract_on_ga10x and asserts one (59374: 3 extracts).
- tests::engine_tessellation::ushort_patch_and_instance_indices_are_masked looked for an
  OpBitwiseAnd by 0xffff; each load is now cleared by OpBitFieldUExtract of offset 0, count 16.
- tests::engine_fragment::a_returned_stencil_and_sample_mask_are_tested_in_the_shader expected
  FramebufferFetch; the refusal is Feature::MultisampledShaderDepthTest (59374's own answer).
- pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value: SEMANTICS_VERSION 2206
  gives e937cf25c6060126a5de54f612b5ca4bd30b2eb78ddc64801c3e65c6105bfd57 (59374).
2026-11-20 10:36:12 -08:00
Anees Iqbal be2c5d567e Fragment: the multisampled in-shader depth test is one typed gap on every device, Feature::MultisampledShaderDepthTest
The planner's ruling. A fragment function that runs its draw's depth test itself at more than one
sample, without returning its depth, needs each sample's depth. The two forms that gave it were
keyed on measured facts (VkProperty::SampleFragCoordDepth on RADV, CenterFragCoordDepth on
MoltenVK) that no query produces, so development already refused it on every device, as
Unsupported(FramebufferFetch, NotImplemented) at the depth attachment, which a play cannot count
apart from framebuffer fetch's own refusals. It is now its own kind.

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

The forms keyed on the two never-produced properties, and the window-depth varying that feeds the
computed one, go with the other never-produced vocabulary.
2026-11-20 10:36:12 -08:00
Anees Iqbal 6bc2f6d9fe Arithmetic: the profile's driver workarounds import goes with the last arm that read them
m3-max-59326 at a7888602ba: lower/arith/mod.rs's DriverWorkaround import was unused once the
product and mask forms stopped reading the profile's workarounds (-D warnings).
2026-11-20 10:36:12 -08:00
Anees Iqbal 64045848c4 SEMANTICS_VERSION 2206 for the follow-up batch; the runtime sources re-pinned
The batch changes what the translator emits on every device: a constant -0.0 factor multiplied as
+0.0 and negated, a narrow mask by extract, and ExtrapolatedInterpolation recorded where a
perspective input is read at a sample or an offset. device/profile.rs, a runtime input, loses
PerspectiveReadsExtrapolated, which nothing read: no run's behaviour changes, so the runtime
sources' hash alone moves (RUNTIME_VERSION stays 2542).
2026-11-20 10:36:12 -08:00
Anees Iqbal b86c98460a Precision note: a perspective read at a sample or an offset records ExtrapolatedInterpolation on every device
The planner's ruling (the note YES). The note was recorded only on a driver with
DriverWorkaround::PerspectiveReadsExtrapolated, which nothing sets since the driver-fact tables
went: RADV answers such a read with the pixel center's value extrapolated along the quad's coarse
derivatives, and no device query says which devices do, so every module that reads a perspective
input at a sample or an offset (an interpolant's interpolate_at_sample or interpolate_at_offset,
or a coverage loop's sample-qualified varying) records it, on every device.

- lower/stage_io/plan.rs: note_extrapolated_read records the note unconditionally.
- device/profile.rs: DriverWorkaround::PerspectiveReadsExtrapolated deleted (nothing reads it).
- Docs: PrecisionNote::ExtrapolatedInterpolation, API.md's catalogue entry, the interpolate and
  coverage module docs.
- Tests: engine_pull_model, every function that reads its perspective interpolant at a sample or
  an offset records the note on every committed profile and no other does; engine_coverage_loop,
  every looping function's module records it.

SEMANTICS_VERSION is bumped once at the end of this follow-up batch; the runtime sources' pin
follows device/profile.rs in the commit after.
2026-11-20 10:35:57 -08:00
Anees Iqbal e709d20810 Arithmetic, rung 1: a narrow integer's high bits are cleared by OpBitFieldUExtract on every device
The planner's ruling (rung 1). ops::mask cleared the bits above a narrow width with
OpBitwiseAnd by the width's mask, and took OpBitFieldUExtract(x, 0, N) only on a driver whose
compiler dropped the mask after a signed clamp (MaskForm::Extract, NVIDIA 615.71.09 on Ampere
GA10x answered sign-extended words). The extract is right on every device and the fact that chose
it is gone, so it is the one form.

- lower/arith/ops.rs: mask always extracts in a 32-bit container; MaskForm, ArithPlan::mask and
  the builder's choice deleted.
- Tests: lower/arith/tests.rs's a_narrow_mask_after_a_signed_clamp_is_an_extract; rt's
  every_device_zero_extends_a_narrow_clamped_sum also asserts the translated kernel's narrow
  results are cleared by four or more extracts and no OpBitwiseAnd by a 16- or 8-bit mask.

SEMANTICS_VERSION is bumped once at the end of this follow-up batch.
2026-11-20 10:35:27 -08:00
Anees Iqbal f2e00db52c Arithmetic, rung 1: a product by a constant's -0.0 component multiplies by +0.0 and negates on every device
The planner's ruling (rung 1, one form on every device). The form was taken only on a driver with
DriverWorkaround::OppositeZeroProductsMerged, which nothing sets since the driver-fact tables
went, so development multiplied by -0.0 itself, which a driver that keeps one multiply for
products of one value by zeros of opposite sign answers with the wrong sign.

- spirv/builder/ops/arith.rs: product_by_positive_zeros is the form of every f32 product by a
  constant with a -0.0 component; ProductForm::PositiveZeroFactors deleted; ArithPlan::product is
  NegativeZeroFma or Multiply.
- Tests: lower/arith/tests.rs asserts no -0.0 factor in any form; engine_zero_factors pins a
  negated +0.0 product on every committed profile; rt's every_device_answers_products_by_zeros_of_either_sign
  (lavapipe and every GPU): the module holds no -0.0 factor, and each product's IEEE bits are
  Metal's for 16 inputs. tests/mod.rs gains spirv_instructions, the walk the rt tests share.

SEMANTICS_VERSION is bumped once at the end of this follow-up batch.
2026-11-20 10:35:27 -08:00
Anees Iqbal 9b0d460a47 Validation: MoltenVK's two pipeline-creation warnings, keyed on MoltenVK's driver ID
The cutover removed the driver facts that told the executor's message
sink which driver diagnostics to withhold. MoltenVK 1.4.1 still reports
two warnings where Vulkan states nothing wrong, so the sink keeps them
in validation, keyed on the queried driver ID
(VK_DRIVER_ID_MOLTENVK), never in a published crate:
- a warning per color-attachment format the device lists without
  COLOR_ATTACHMENT_BLEND, reported as it makes every pipeline, naming
  the format (MessageSink::making);
- inside vkCreateGraphicsPipelines, its warning of a pipeline whose
  primitive restart is dynamic for a strip or a fan, or whose topology
  is dynamic too (expecting_diagnostics, per thread, per call).
Each must match id name, number and text exactly; anything else still
fails the row. The test an_expected_diagnostic_fails_no_row_inside_its_call_alone
covers the per-call scope.

A follow-up after the main land; not compiled yet.
2026-11-20 10:35:27 -08:00
Anees Iqbal 96fac6c5a9 Validation: a public case reads a texture buffer an argument buffer holds, qualified on Metal
abt_frag_texel_buffer, from the owned abt_descriptor_sets fixture, reads member bones of argument
buffer 0. That buffer is a SPIRV-Cross descriptor set: a constant buffer pointer, a depth texture,
a sampler, a read-only texture buffer and a read_write texture buffer. The function reads bones at
a flat varying index. The case binds every member and reads texel 2 of a 4-texel rgba32_float
texture buffer, so every pixel of the 2x2 target holds (3, 30, 300, 0.5).

It carries texture_buffer_member, so the checker admits it with Metal alone, and the engine's
candidate refuses it, typed.

Verified: corpus-case-check accepted and installed it, and corpus-metal qualified it on the M3
(apple-m3-max-macos27.0.1, job m3-max-59498). The output's sha256 2e70c40a... is that of four
(3, 30, 300, 0.5) float texels.
2026-11-20 10:33:28 -08:00
Anees Iqbal 56d93ffbc7 Validation: a texture buffer an argument buffer holds stops only the candidate (texture_buffer_member)
The authoring-capability census counted six rows under texture_buffer_literal, a requirement in
the authoring set, so it stopped the Metal oracle as well as the candidate. The schema does
express these texture buffers: an argument-buffer texture or a texture-array element takes
`texture_type: buffer`, and the oracle makes one through make_texture (a
MTLTextureTypeTextureBuffer view of its bytes) and binds it with setTexture:atIndex:. The oracle
stop was stale tooling.

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

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

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

Verified: the build, clippy and the tests run in the jobs the landing note names.
2026-11-20 10:33:28 -08:00
Anees Iqbal f23817253e Binder tests: the emulated variant runs a region deeper than DEEP_THREADGROUP as one row
The two binder tests asserted the old up-front check, which refused a partial dispatch's region
of z past the device's 64 (the test rules' maxComputeWorkGroupSize z) on the emulated-simdgroups
variant. The variant declares SpecKey::DeepThreadgroup and runs such a region as one row, so
[1, 1, 65] and [1, 1, 96] now fit the variant, a deep region past maxComputeWorkGroupSize[0] as
one row is refused at x, and a mixed dispatchThreads grid of interior z 96 or 64 is answered with
the variant, whose own plan (declaring DeepThreadgroup) runs both regions.

Found by gate m3-max-59339 (bind::dispatch::tests::{local_sizes_are_checked_against_every_d4_limit,
a_partial_simdgroup_asks_for_the_emulated_simdgroups_variant}, both on the old expectation).
2026-11-20 10:31:35 -08:00
Anees Iqbal 2f1c5e77cb The runtime sources re-pinned at RUNTIME_VERSION 2542 (bind/dispatch.rs's emulated_rules) 2026-11-20 10:31:35 -08:00
Anees Iqbal 2f127db94b Binder: a mixed dispatch is checked against the emulated variant's rules with its deep threadgroups
The question: does the emulated-simdgroups variant's plan let a [1, 1, 96] threadgroup through on
a device whose maxComputeWorkGroupSize z is 64? It does, and rightly: the variant is a kernel of
the Spec form without compute derivatives (a flattened tier refuses them,
lower::dispatch::plan_kernel), so it declares SpecKey::DeepThreadgroup, and its plan runs a
threadgroup deeper than DEEP_THREADGROUP as one row (sx*sy*sz, 1, 1). The flattened plan's
up-front check of a mixed dispatch's regions (emulated_rules) copied deep = false from the
flattened tier's rules, so it refused, with LocalSize Z, a dispatch the variant runs. The wrong
side was the up-front check.

- bind/dispatch.rs: emulated_rules sets deep: true, with the reason in its doc.
- RUNTIME_VERSION 2542 (a mixed dispatch of a deep interior now runs instead of being refused).
- Tests: engine_simd_emulated's a_mixed_dispatch_is_checked_against_the_variants_limits on
  nvidia-rtx50-linux (Direct, z at most 64): an interior of [1, 1, 96] and of [1, 1, 64] asks for
  the variant, whose plan runs both regions. rt's every_device_runs_a_threadgroup_deeper_than_the_floor:
  simd_sum_k (engine/simd_ops.ll) as one threadgroup of [1, 1, 96] answers Metal's simdgroups of
  32 consecutive threads.
2026-11-20 10:31:21 -08:00
Anees Iqbal e9dcf9ed50 AGENTS.md: the deleted switches and FAST-PATHS leave the facts; "No switches." stays as the rule
The cutover deleted the translator's speed-for-accuracy switches, the driver-fact tables, the
device checks, docs/FAST-PATHS.md and tests::fast_paths. AGENTS.md still said they "stay correct
until the cutover deletes them", listed FAST-PATHS.md in the doc table, and named it among the
honest trade-offs that change with behaviour. Those three passages now say what is true:

- the doc table loses the FAST-PATHS.md row;
- the old-runtime paragraph becomes "No switches. Never add a policy switch, a fact-table row,
  a device check or a ledger row.";
- "The honest trade-offs stay current" names REFUSALS.md, METAL-COVERAGE.md,
  CONFORMANCE-COVERAGE.md and API.md's catalogue, without FAST-PATHS.md.

DevicePolicy itself stays: it now holds only the consumer's domain, containment and isolation
choices, none of which trades accuracy for speed.

Verified: git ls-tree shows no docs/FAST-PATHS.md and git grep finds no fast_paths under crates/
at the parent; the diff touches AGENTS.md only.
2026-11-20 10:30:29 -08:00
Anees Iqbal 3ed573c4a0 rt tests: own image moves print where T75's image lands, never assert it
On the Windows UHD 630 (m3-max-59485) T75's RGBA16Float image landed at 65536-73728 while the
BGRA8Unorm composite's freed places ran 0-20480: the sixteen 1x1 textures took them first, at
that driver's sizes and alignments. Where an image lands is the places' first-fit policy over
the driver's requirements, not an invariant, so the test now prints whether T75 took a freed
place, with the places, and asserts only the invariants: no two live places meet, both targets
read the CPU's texels, and the queue-order ledger holds no step out of order. The ledger's line
is printed before its checks, so a failing run's log carries it too.

Verified: cargo fmt; the lavapipe run and clippy go in potluck jobs.
2026-11-20 10:28:52 -08:00
Anees Iqbal 67bcab6e17 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-20 10:27:47 -08:00
Anees Iqbal 58beab6630 REPLAY-STREAM: the player as it plays now, on the runtime alone
The player's one backend is the runtime's (replay/new_runtime, through
rt_replay, from command-replay play). The doc still described a second
backend over the deleted runtime and every rule where the two parted:

- Section 5's recorded-address placement (pins, heaps split by their
  buffers and textures, PlayError::Unpinned) is deleted; the backend
  places each object where the runtime has room and moves the address
  arguments. The resource-ID rule says the runtime's own placement.
- Section 9's heap note on the old player goes.
- Section 10: one copy rule for Managed buffers, one announced-bytes
  rule, no old backend refusal list; the snapshot procedure is replaced
  by what the backend does (it takes none, so each named dispatch plays
  as it is, on the unsnapshotted line) and the split line goes with it;
  the executed counts are the runtime's metrics (Device::counters, as
  new_runtime's counters() reads them); the tiled-texture stand-in and
  the video-surface pages no longer name the old forms; the report's
  device line reads 'runtime rt', and its pinned line and the old
  runtime's gauges and covers go.
- 'the new runtime' and 'either runtime' read 'the runtime'; two plays
  compare across devices or commits.

Not built; docs only. The gate for the whole pass follows.
2026-11-20 10:27:18 -08:00
Anees Iqbal 0f4c56e5ba Docs: no decoded twins; ASTC and ETC read as the device decodes them
The runtime keeps no decoded twin: a format whose block the device's
format query lacks is Gap::TextureFormat, and a format it holds is read
through the device's decode, the static note compressed-texel-decode.
The ASTC and ETC cases' module docs said the runtime keeps a carrier and
a twin it fills and announces carried-decoded-twin and
decoded-texel-precision; they now say what the cases' own allowances
already hold (an ASTC LDR channel within 1/2048, everything else
exact), and that the decode models are a cross-check of Metal's
recorded texels. The deleted lane's twin-refresh paragraph goes.

bind::AstcDecode, the block decode shape and the ETC and 4:2:2 decodes
no longer name the deleted runtime's files; they hold a twin's texels
for a consumer that keeps one. format_footprints, compare, the BC
decode and moves cases, a plan comment and a format test say the same.

Not built yet; the gate for the whole pass follows.
2026-11-20 10:27:18 -08:00
Anees Iqbal ae946adea7 Docs: the deleted switches, codes, fact rows and FAST-PATHS links go
With the old paths deleted, DevicePolicy holds the two domains,
containment and isolation, the translator reads no driver identity, and
docs/FAST-PATHS.md is gone. API.md sections 1 to 8 and 10 said
otherwise:

- The policy section's switch bullets (YCbCr in-place, half chains, batch
  order, render lowering, pipeline waits, wide lines, extended-range
  blits, queue sharing and turns, unstored DontCare loads) and
  exact_answers() are deleted.
- The measured-driver section said rows keyed on driver identity decide
  answers; Device::from_queries reads none, so it now says the device's
  own answer is taken and noted. The deleted runtime's host-page,
  Managed-copy, shadow and bit-20 prose that followed it is deleted.
- Section 10's heap-answer and DontCare-policy bullets are deleted, and
  its DriverFact clauses with them.
- The notice codes no live Degradation names (shader-resolve,
  word-resolve, zeroed-index-fetch, released-command-state,
  surface-texels-tail and the rest) are dropped from sections 1 to 8
  and 10.
- 'the new runtime' reads 'the runtime'.
- Every FAST-PATHS.md link outside AGENTS.md is dropped: API.md, the
  translator's bind, lower and metal docs, a validation mesh case, a
  conformance case and probe. AGENTS.md's three go to the owner as text.

Not built yet; the gate for the whole pass follows.
2026-11-20 10:27:18 -08:00
Anees Iqbal fce83ac2cf Docs: what the runtime does now, where a line named the deleted one
The rename gave metal2vulkan-runtime to the new runtime, so every line
written while the name meant the deleted runtime read as a claim about
the live one. Each was read against the new runtime's code:

- The precision notes no longer say the runtime announces a kind or a
  code of its own (it announces none; the conformance suite maps notes to
  codes), nor what a device Device::new made records (only
  Device::from_queries remains). The notes the runtime carries stay:
  DepthStencilState::precision_note, RenderCommandEncoder::DEPTH_BIAS_NOTE,
  BlitCommandEncoder::GENERATE_MIPMAPS_NOTE,
  RenderPassDescriptor::precision_note, Texture::precision_note.
- An inert kernel's dispatch: the runtime records it like any other.
- API.md: the runtime takes no unit-axes variant, and runs a
  partition-oblivious kernel's every direct dispatch in its tiles (from
  the runtime's pipeline module docs).
- The translator's profile docs: no runtime announces mesh draws, reads
  YCbCr in-place facts, keeps a bind-offset key or runs a view check.
- An aliased-import defect: the runtime has no use_host_ram.
- derive.rs: no runtime reads the allocation limits.
- texel_rows.metal names the test that runs it now (aliased_encoders).
- docs/RUNTIME-PORTING.md is deleted with its README row: 216 of its
  351 runtime items no longer exist, and each runtime item's rustdoc
  names its Metal counterpart.
- CHANGELOG 0.2.0: no fast-path switches, announced codes or
  queue-switch check.

Not built yet; the gate for the whole pass follows.
2026-11-20 10:27:17 -08:00
Anees Iqbal ffc3208151 Docs: delete the cites of the deleted runtime lanes
The runtime_lane tests went with the old runtime, so every cite of one
was false. Each cite is deleted outright, in the conformance cases and
probes, the engine fixtures README, the translator's precision-note and
profile docs, one engine test comment and the i915 counter's header.
Where a sentence only restated what a deleted lane held or showed (the
"what the port changes" paragraphs, the "stays a lane assertion"
sentences, the lane's own model kept "exactly as" it stated it), the
sentence is deleted; the Metal facts the cases record stay.

Two runtime claims beside the cites were false of the live runtime and
now say what it does: a command queue of 0 command buffers is
Refusal::NoCommandBuffers, and a heap texture's size is the device
image's own requirement, held by its property.

Verified: git grep runtime_lane finds nothing. Not built yet; the gate
for the whole pass follows.
2026-11-20 10:27:17 -08:00
Anees Iqbal 9ea53f7acd rt: translation_nanos times the read of whether a kernel observes its partition
What: the compute make's kernel_observes_partition call, which decodes the function, now goes
through pipeline::translating, the same as the other calls into the translator.

Why: the previous commit missed it, because its receiver sits on the line before the call. A
check of the translator's compile API (pipeline/compile/api.rs) against the runtime's calls finds
no other untimed call apart from the cache digests (function_compile_key,
compute_pipeline_key, queried_render_descriptor_key), which translation_nanos leaves out by its
doc.

How verified: the lane's compile gate, with the runtime suite on lavapipe.
2026-11-20 10:12:13 -08:00
Anees Iqbal 33cdabd1fd rt: Metrics::pipeline_creation_nanos and translation_nanos, a make's two sides
What: two always-on relaxed counters that split a pipeline's make between the driver and the
translator.
- pipeline_creation_nanos: the summed time of the vkCreateComputePipelines and
  vkCreateGraphicsPipelines calls, timed in made_through_cache, which every pipeline the runtime
  makes goes through, failed calls included.
- translation_nanos: the summed time of the runtime's calls into the translator, timed by a new
  pipeline::translating wrapper around each of them:
  - kernel_inputs_read and render_variant_key, which decode the functions;
  - compile_function_from_entries, the AIR-to-SPIR-V lowering that Metrics::translations counts;
  - compile_compute_pipeline at its three sites, and compile_render_pipeline (link and plan).
  The cache digests (function_compile_key and the like) and lowerings loaded from the cache
  directory are not timed.
No earlier counter gave the translation side: the first-use and made-ahead waits time whole
makes, and translations only counts lowerings. This adds that one counter beside the creation
time.

Why: reims measured that its makes arrive one at a time, so a concurrency maximum would have no
reader. What the walk needs is how much of a make's time is the driver's and how much the
translator's.

Docs: the Metrics fields, the README's Counters paragraph, and the signatures table re-blessed
(two new fields).

Test, on lavapipe: every_device_times_a_make_s_pipeline_creation_apart_from_its_translation.
Making one compute state (a1_bool_from_float) on a settled device creates a pipeline. Both
counters rise above 0, and their sum stays below the make's wall time on its one thread.

How verified: the lane's compile gate, with the runtime suite on lavapipe.
2026-11-20 10:12:13 -08:00
Anees Iqbal 96d335ef46 rt tests: own image moves: T11 takes an index, the index-less targets are for views
A render target is reached by shaders (attachment reads), so a texture over a buffer with
that usage needs an index: T11 is ShaderRead and RenderTarget (usage 0x5, as the compositor
makes it) at the fifth granted index, and the churn's targets and the 1x1 textures are made
with Device::new_texture_for_views. 59358 failed at T11's make in every arm.

Verified: cargo fmt; the run goes in a potluck job.
2026-11-20 10:07:39 -08:00
Anees Iqbal c0e1b47df5 rt tests: own images move home once, before any copy into them, in places of their own
The 3090 failure: a texture over imported pages sampled zeros and NaN, as if its image of
its own never received the CPU's bytes, though its one copy in was counted and submitted.
An own image is never zeroed, so until its copy in lands it reads what its place last held;
NVIDIA can drop an image's bytes on a move from the undefined layout, lavapipe never does,
so an order bug between the move home and the copy in is invisible to lavapipe's values.

tests::layouts now also keeps each image's steps in the queue's order: each command buffer's
barriers, copies, blits, clears and attachments as recorded, taken in the order
vkQueueSubmit2 hands the command buffers to the queue (vkBeginCommandBuffer, vkCreateImage,
vkGetDeviceQueue and vkQueueSubmit2 recorded too). An image made while recording moves home
once, from the undefined or the preinitialized layout of its first level; a second such move,
or any command that names it before that move, is noted against the device (layouts::moves).
Recording moves to the module so other tests start it.

imported_aliases gains the compositor's process in its order: a composite in BGRA8Unorm whose
textures all go, sixteen 1x1 textures, then the composite in RGBA16Float: T75 over the
compositor's buffer, T11 over the drawer's over the same bytes, two Private 8x8 targets, a
reference in place, one command buffer whose two passes draw T75's texel at each pixel over
the backdrop. Alone, then beside a thread that makes, clears and drops render targets on a
queue of its own. It checks that no two live textures' places meet (rt's own placement
records), that alone T75's RGBA16Float image takes a place the BGRA8 composite held, that each
target reads the CPU's texels, and that the queue-order ledger holds no step out of order,
with moves home and copies in counted.

Verified: cargo fmt. Build and the lavapipe run go in a potluck job.
2026-11-20 10:07:39 -08:00
Anees Iqbal 3d93acd6be rt: Metrics::held_starts and held_start_gap_nanos, the sends of held groups and the GPU time behind them
What: two counters for the group a queue holds while three of its submissions are in flight
(IN_FLIGHT):
- held_starts counts each submission of a group that was held as a submit-thread pass ended and
  went with fewer than three of its queue's submissions in flight, so after a completion left
  fewer. It is counted in close(), before the vkQueueSubmit2 calls. A group that goes while three
  are running (its sixteenth member, an event's signal, a host wait, send_now) counts none, and
  so does a command buffer sent at once.
- held_start_gap_nanos sums, for each of those submissions, the GPU's span from the latest end
  timestamp of the command buffers submitted before it to the start timestamp of its first
  command buffer with both, where the start is the later. It uses the raw timestamps and the
  device's period (Ticks::span), not the calibrated host times.
Both are relaxed atomics and always on.

How:
- A Batch's new `held` is set for every group still open when a pass ends; unheld() found none
  of them free to go, so each waits for its queue's in-flight submissions. close() narrows it to
  "goes with fewer than IN_FLIGHT in flight" and counts it there.
- submit() hands the flag to the completion thread with the submission's value, in a new
  complete::Sent, which keeps Done::submitted at seven arguments. Each retiree of the submission
  carries the flag.
- The completion thread keeps the latest end timestamp across rounds, since retirees come in
  submission order. It takes a held submission's gap at its first command buffer with both
  timestamps, before that command buffer's handlers run.

Why: the planner's ruling, which keeps the in-flight grouping rule in this pin. The walk measures
what the rule costs: these counters let a scene's sum of gaps be read against its length.

Docs: the Metrics fields, the README's Counters paragraph, and the signatures table re-blessed
(two new fields).

Test, on lavapipe: every_device_counts_a_held_group_s_start_and_not_one_sent_at_once.
- A fill on an idle queue counts nothing.
- A fill committed behind the busy work's three submissions is staged in the held group. The test
  then waits for the submit thread's pass to end by taking the work lock, and checks that nothing
  is counted yet.
- The busy work is opened, and the group's status is polled rather than host-waited, since a
  host wait would send the group.
- Then held_starts rose by exactly 1 and held_start_gap_nanos rose above 0.

How verified: the lane's compile gate, with the runtime suite on lavapipe.
2026-11-20 10:03:45 -08:00
Anees Iqbal c919913869 rt: the wait deletion's leftovers, in docs and one check
What: the runtime README's queue paragraph no longer says a waiting segment leads a new group; the
docs of Metrics::submit_infos, Staged and the shared-submit-info test say that only an event
signal separates submit infos; submit() no longer keeps a part for its waits, which no segment
has there any more (the sparse bind's wait is added to the first part after that check).

Why: the deletion (a075319ea1) removed both the submitted event waits and the rule that a waiting
segment leads its group, and these texts and the check were left describing them.

How verified: the lane's compile gate, with the counters commit after it.
2026-11-20 10:03:45 -08:00
Anees Iqbal 2258522299 Interpolant ruling fix forward: the old render key re-pinned at 2205; the API signature table blessed
m3-max-59315 at d0a1445d2e (msi): clippy (all features, --cfg m2v_gpu, both Windows targets) and
workspace Rustdoc passed; the metal2vulkan and metal2vulkan-runtime suites ran 3799 tests, 3795
passed, 4 failed:
- the_old_render_descriptor_key_keeps_its_value, which follows SEMANTICS_VERSION: re-pinned at
  2205 from the job's value.
- api_signatures: Feature::DivergentInterpolation added and
  DriverWorkaround::InterpolationNeedsTheWholeQuad removed, as intended; the table rewritten by
  scripts/api-signatures/signatures.py --bless.
- golden_hashes_match_the_table and the engine inventory's part 1 (pm_offset_after_discard on 19
  profiles: ok -> Unsupported{DivergentInterpolation; NotImplemented}, the ruling's answer): the
  tables re-bless on the M3 after the land.
2026-11-20 09:53:17 -08:00
Anees Iqbal 7aa9abf911 The runtime sources re-pinned: DriverWorkaround::InterpolationNeedsTheWholeQuad's deletion from device/profile.rs
device/profile.rs is a runtime input of the validation guard. The deleted variant was set by
nothing (the driver-fact tables that set it are gone), so no run's behaviour changes: the hash
alone moves, computed with the build's runtime_files walk replicated over the tree (141 inputs).
2026-11-20 09:53:17 -08:00
Anees Iqbal f3b9e0253a Pull-model interpolation: a sample or offset read where the quad may have left is one typed gap on every device
The planner's ruling. interpolant_reads refused a read at a sample or an offset outside the
fragment function's first block, or after a discard in it, only on a driver with
DriverWorkaround::InterpolationNeedsTheWholeQuad, which nothing sets since the driver-fact tables
went: development lowered the shape on every device, RADV included, whose InterpolateAtSample and
InterpolateAtOffset read garbage where the quad's other invocations have left.

- lower/stage_io/plan.rs: the structural test stays as it was (Sample or Offset, past the first
  block or after a discard in it) and refuses on every device, as its own kind:
  Unsupported::not_implemented(Feature::DivergentInterpolation), so a play counts it apart from
  PullModelInterpolation's select, phi and store refusals.
- error/mod.rs: Feature::DivergentInterpolation; PullModelInterpolation's doc points at it.
- device/profile.rs: DriverWorkaround::InterpolationNeedsTheWholeQuad deleted.
- The coverage loop's rung-1 form, beside it: lower/fragment/coverage.rs read the fact nothing
  set, so development read a looping function's sample-qualified varyings inside the loop on
  every device, where the helper invocations of a partly covered quad have left. The entry now
  reads each such varying at every sample a pipeline of the device may have before the loop, on
  every device (samples_before_loop, stage_io::read_at_every_sample).
- SEMANTICS_VERSION 2205.
- docs/REFUSALS.md regenerated (scripts/refusal-surface, with the new reach row); --check passes.
- Tests:
  - rt's every_device_refuses_interpolation_where_the_quad_may_have_left (lavapipe): a sample
    read in a branch, an offset read in a branch and reads after a discard in the first block
    are refused, Unsupported(DivergentInterpolation), NotImplemented; the same reads in the first
    block, and before a later discard, are made and draw the colour.
  - engine_pull_model: pm_offset_after_discard (reads past the first block) is refused on every
    committed profile at 1 and 4 samples, before what its reads need is asked.
  - engine_coverage_loop: a looping function's sample-qualified varying is read at every sample
    by constant index from 0, a power of two of them and at least the pipeline's samples, and at
    no computed sample.
2026-11-20 09:53:17 -08:00
Anees Iqbal 5004f224a7 Validation: nine tests take Device::from_queries' answers after the translator's old-path deletion
The translator's old path (16c831165d) took its driver-fact tables with it, so no profile
carries a workaround or a float model by its driver's identity. Nine validation tests asserted
answers only those tables gave (development a5bac845b8, job m3-max-59286). Each one's decision:

- c3::bound::tests::the_products_own_approximations_are_its_near_equivalents,
  fast_atan2_past_the_divisors_domain_is_unstated, a_denormal_the_device_keeps_stays_open:
  the MoltenVK arms asserted that MoltenVK's float functions are Metal's own (no
  DeviceArithmetic, no DeviceDenormals). That was the deleted driver table's answer. They now
  take from_queries' answer: MoltenVK's profile records what lavapipe's records, and the
  verdicts are near_equivalent on both.
- candidate::platform::profiles::tests::a_restricted_context_runs_only_on_a_device_that_has_and_reports_its_profile:
  the workarounds followed the identity that ran the module (lavapipe's split triangles and mesh
  index stores, SwiftShader's buffer atomics). Both identities now take every device's two,
  ClippedCoverageNotMetals and TessellatorNotMetals.
- candidate::platform::profiles::tests::the_intel_venue_allows_the_rplp_alone_and_stops_the_rpls:
  the RPL-P's PushReadsLengthenThreadPayload is gone, so the RPL-P and the RPL-S derive one key.
  The RPL-S stops on its identity alone, and its allocation size is unread.
- c3::tests::a_venue_profile_is_a_capture_of_the_venues_own_device: the RPL-S's own capture
  derives the venue's key, so the venue may take it. The arm that expected a refusal ("needs a
  venue of its own") now asserts check_profiles accepts it.
- c3::tests::each_answer_gap_is_decided_from_each_venues_profile: this one caught a real loss,
  on the validation side. C3's split-quads answer gap was read from the profile's
  ClippedTrianglesSplitPixelFragments, which no profile carries now, so lavapipe's venues lost
  the gap that names their split-quad mismatches. The product may not decide by a driver's
  identity, but validation already does for the clipped-primitive split (not MoltenVK). So the
  gap is now decided from the venue's driver as well: lavapipe (VK_DRIVER_ID_MESA_LLVMPIPE),
  the same devices as before. The test is unchanged.
- coverage::tests::the_out_of_bounds_fixtures_contain_each_target_as_declared: SwiftShader's
  BufferAtomicsUncontained was a driver-table answer. A buffer atomic there is now left to its
  robustness, as on every device whose robustness contains buffers (descriptor-view:robust).
- integration pipeline_selection::engine_selection_reads_only_the_selected_row_and_names_its_engine:
  only the deleted in-shader zeroing compiled the fixture's zeroed threadgroup memory on
  vk12-floor. From_queries refuses it there, because vk12-floor lacks
  shaderZeroInitializeWorkgroupMemory, which the runtime's floor requires. The test now selects
  through the lavapipe profile, which is on the floor.

Verified: before the fix, job m3-max-59312 ran the nine tests and showed each panic above.
After the fix, the gate job named in the landing message.
2026-11-20 09:48:01 -08:00
Anees Iqbal a075319ea1 rt: no semaphore wait is submitted for an event's value
What: stage() no longer adds a semaphore wait to a segment for its waits on events' values. The
rule that a waiting segment leads its group goes with it. Unchanged:
- ready(), which holds a wait until the host's value meets it or a signal of its value is
  submitted;
- the events' signals, which signaled_value, host waits and listeners read;
- the presenting command buffer's binary signal;
- the sparse bind's timeline wait.
A segment that only waits now adds nothing to its submission.

Why: every wait rt submitted named a signal earlier in the same VkQueue's submission order:
- every guest queue submits on core.queues.runtime;
- ready() passes a wait only once its signal is staged, and staging a signal sends its group at
  once.
Every segment with commands ends in a global VkMemoryBarrier2 (record::end), from ALL_COMMANDS
with MEMORY_WRITE to ALL_COMMANDS with MEMORY_READ|MEMORY_WRITE, plus HOST where the segment
signals. A signal sits at the end of its segment, so its barrier orders every later command after
the signaller's, the waiter's TOP_OF_PIPE start timestamp included (vkspec 9465, 9481,
42773-42775). So the semaphore pair defined no dependency the barriers did not. The submitted wait
only made the driver wait on a value. On the RTX 2080 walk that came to a waiter starting 0.38 ms
p50 after its signaller's GPU end, against a 0.2 ms GPU run. The sparse bind's wait stays because
sparse binding is "not automatically ordered against command buffer execution, even within a
single queue" (vkspec 70233).

Tests: three tests held the GPU by waiting on a pretended signal that the host later gave; that
form no longer holds anything. They now hold the device with the busy work's gate batch, whose
wait holds every later command:
- the scheduled-as-submitted test: the waiter's value is now a real signal of another queue,
  submitted and not yet run;
- the device-loss test: its in-flight command buffer is held the same way;
- the chain test: each link copies the words of every link before it from the previous link's
  buffer and writes its own, so a link run before the one it waits on leaves wrong words. It
  checks that the links complete in order with every word right.
pretend_submitted_for_test had no other use and is deleted.

Docs: encode_wait_for_event, CommandBufferStatus::Scheduled, Device::new_shared_event, the
runtime README's submission and event paragraphs, and the infos() and stage() docs.

Effect on presents per second: not known until the walk at the pin.

How verified: the lane's compile gate (fmt, clippy in three cfgs, Windows clippy, Rustdoc,
signatures, the runtime suite on lavapipe).
2026-11-20 09:46:52 -08:00
Anees Iqbal a640235b0c Bless: the golden hash table after the tessellation push spill
Re-blessed on the M3 at 7d8a13ade2 (job m3-max-59327, bless-job.sh: inventory, golden and printouts each
0; only the golden table moved). 12 rows of four post-tessellation fixtures move (icb_render_patch_template,
rvc_draw_bases, tessellation and vertex_amplification, each in its .ll and .air.ll forms): a post-tessellation
vertex function's push window now starts at 24, so their modules' push offsets move. The engine inventory and
the printouts did not move.
2026-11-20 09:45:57 -08:00
Anees Iqbal 7d8a13ade2 Push fix forward: the address-form tessellation test pins the control stage at 0; the old render key re-pinned at 2204
m3-max-59292 at 8cc9127c94 (msi): clippy (all features, --cfg m2v_gpu, both Windows targets) and
workspace Rustdoc passed; the metal2vulkan and metal2vulkan-runtime suites ran 3798 tests, 3795
passed, 3 failed:
- pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value, which follows
  SEMANTICS_VERSION: re-pinned at 2204 from the job's value.
- tests::engine_tessellation::under_the_identity_domains_the_control_stage_reads_the_factors_by_address
  asserted the control stage's push offset past the vertex function's fields; it is now 0, below
  the post-tessellation function's window, which the test asserts starts at TESSELLATION_BASE.
- tests::golden_hashes::golden_hashes_match_the_table: the post-tessellation modules move; the
  table re-blesses on the M3 after the land.
The engine inventory (llvm_as parts 1 to 8) passed unchanged.
2026-11-20 09:30:13 -08:00
Anees Iqbal 0eecb4512b rt test: the full-range patch test reaches the pair's refused end and a fragment spill
Fragment functions of 4, 12, 19 and 24 buffers: at 19, behind a post-tessellation function whose
window started at 0, the pair's fields end at 252, where the factors' 8-byte address no longer
fits above them (the refusal "required 260, available 256"); at 24 the fragment function's fields
spill into its block. Every state is made before any draw, so a refusal names its width. Buffer k
holds 2^(k / 4) in channel k % 4, which holds up to 32 buffers.

At 8cc9127c94 (fragment functions of 4 to 16 buffers), m3-max-59297 on lavapipe: the five patch
tests passed, the pair's push ranges 156, 188, 220 and 252 bytes, no fragment block.
2026-11-20 09:30:13 -08:00
Anees Iqbal 23d6572c18 Push placement: a post-tessellation vertex function's window starts past the control stage's range
A tessellation render pipeline whose vertex and fragment functions' push fields filled the
floor's 256 bytes was refused at link ("unsupported: Tessellation; needs AnyOf: Limit
MaxPushConstantsSize, required 260, available 256"): link places the synthesized control stage's
push range (8 to 24 bytes) at the first free offset beside the two functions' ranges, and since
the tail placement (0cd2ad765d: each stage's push ends with its tail, 24 bytes above its other
fields) the pair's ranges can end within 8 bytes of 256. Metal makes the pipeline, and the device
lacks nothing.

The form, one on every device: a post-tessellation vertex function's window is [24, 248) instead
of [0, 248), so the control stage's range, at most control::PUSH_BYTES (24) in either form, is
placed at 0, and the fields the pair cannot push spill into their parameter blocks, the form a
function's fields past its window already take. The tail and its 24-byte hole are unchanged. A
fragment function behind such a vertex function that pushes nothing starts at 24 too.

- lower/push.rs: window(Vertex, base) starts at base; TESSELLATION_BASE (= control::PUSH_BYTES);
  base(cx), the start of a function's fields (24 for a post-tessellation vertex function, else
  LoweringInputs::push_base); fragment_base(), the vertex function's push end or its window's
  start, used by CompiledFunction::fragment_push_base, compile::vertex_push_end and link's
  check_push_base.
- select and access place and census the fields from push::base.
- SEMANTICS_VERSION 2204 (a post-tessellation vertex function's and its fragment function's
  placements move).
- Tests: push.rs pins the vertex window from either start, and that the control stage's range in
  every form (bound and address, each factor step, scale on and off) fits below 24 and a
  fragment base behind an empty post-tessellation placement is 24. rt's
  every_device_draws_patches_whose_fragment_fills_the_push_range: a patch state behind fragment
  functions of 4, 8, 12 and 16 buffers is made, pushes the factors' address at 0, and draws its
  patches with every buffer's bits; the widest pair's fields end past 248.
- Docs: API.md section 5, the rt README's push range, PushPlacement::push_range,
  LoweringInputs::push_base, CompiledFunction::fragment_push_base, the tessellation link docs.

The line band's evaluation stage (16 bytes, WideLines) and the fan-out probe's geometry stage (4
bytes, RasterizationRateMap) are still placed by tessellation::push_offset beside the pair's
ranges and refused where those fill the floor: the same shape, not changed here.
2026-11-20 09:30:12 -08:00
Anees Iqbal 82e7c39216 rt: ComputePipelineState::dispatch_variant, the key of the VkPipeline a dispatch runs
What: ComputePipelineState::dispatch_variant(dispatch, threads_per_threadgroup,
threadgroup_memory_lengths) -> Option<DispatchVariant> takes prepare_dispatch's arguments.
DispatchVariant is an opaque key: Copy, Eq, Hash, Debug. It holds the compiled content's number,
the module, the workgroup size and the threadgroup memory lengths, which are exactly what a
kernel's VkPipeline is made from. It comes from Compiled::dispatched, the function
prepare_dispatch uses, which calls encoder::decide and encoder::threadgroup_memory as the
dispatch does, so the key and the encoder's own choice cannot drift. None comes back where
prepare_dispatch makes nothing whatever was made before (a refused size, variant or memory, or
nothing recorded). The call takes no lock, makes nothing, and allocates nothing where it answers
a key.

The threadgroup memory lengths are now held inline (encoder::Lengths, 31 words and a count)
instead of in a Vec, in the encoder, prepare_dispatch and the key alike. A kernel takes at most
31 of them, the indices setThreadgroupMemoryLength:atIndex: sets (BUFFER_SLOTS). A module with
more is refused at its state's make as KernelInputKind::Specialization, and the kind's doc says
so. Each Compiled takes a process-unique number (CONTENTS), so keys of different contents never
compare equal, even after a content is gone.

The key names the content, not the state. The states of one content share its VkPipelines, so
their keys compare equal, and one prepare_dispatch serves both. That keeps keys equal exactly
when the VkPipeline is.

Why: a consumer's pre-pass keyed its prepare_dispatch calls by the whole grid. The VkPipeline
depends on the grid only through decide, so its cap of hands per command buffer went on grid
variants of pipelines already made. With this key it can call prepare_dispatch once for each
pipeline.

Docs: the runtime README beside prepare_dispatch, and api_signatures.tsv.

Tests (lavapipe):
- every_device_keys_a_dispatch_by_the_pipeline_it_runs, over icb_replay_grid_template, an
  observing kernel with a threadgroup memory argument:
  - over a table of eight dispatches, two keys are equal exactly when the entries run one
    pipeline. Whole grids of different extent and call, indirect included, share one; ragged
    ones share the partial variant's; a different threadgroup size or length gives another;
  - prepare_dispatch on each entry in turn makes one pipeline for each key not met before, and
    none for one met (made_ahead_variants and pipelines_created);
  - a second state of the same content answers the same keys and makes nothing;
  - a state of another content (a required threadgroup size) answers another key and makes its
    own pipeline;
  - a refused or empty dispatch has no key.
- every_device_keys_a_tiling_kernel_s_dispatches_by_the_pipeline_they_run, over tiles_mark:
  - every direct dispatch, whatever its grid or threadgroup size, shares the tiles' key;
  - indirect dispatches run without tiles, one key for each size;
  - the state's creation and the preparations make one pipeline for each key.

How verified: the lane's compile gate (fmt, clippy in three cfgs, Windows clippy, Rustdoc,
signatures, the rt suite on lavapipe).
2026-11-20 09:29:14 -08:00
Anees Iqbal 05541e1332 rt places tests: the long-block test picks a shape that leaves room past it
On lavapipe a 4096x1025 RGBA8 image pads to 16,842,752 bytes, 257 x 64 KiB,
so its texture block had no free bytes past it and the test's negative control
passed (job m3-max-59267). The test now takes the first of a few shapes whose
block leaves 16 KiB past the long texture, and says so where a device's images
leave none.
2026-11-20 09:24:38 -08:00
Anees Iqbal 542a43af44 rt places tests: import TextureObject for the texture accessors
The device cfgs' build of the new places tests failed (job m3-max-59255,
E0599): image_size and place are TextureObject's, which the module did not
import.
2026-11-20 09:24:38 -08:00
Anees Iqbal 0277c68696 rt uploads: a held release sends the upload, for every texture and block
What: the release of a texture or block that an upload not yet submitted holds
now has every unsent upload go at once, with no wait (Work::release flushes and
wakes the submit thread). Surfaces and exported blocks already did this; now
every texture and block does, and the surface-only case (Held::shared) is gone.

Why: a released texture or block an unsent upload held kept its memory until
the next commit with GPU work, a flush, or an upload call past the bound. Only
the next upload call tested the 64 MiB / 4,096-call bound, so with no later
call (a guest gone quiet after a scene closed) the memory stayed until the
device dropped. Metal frees a released resource once no work uses it. The cost
is at most one added submission per upload holding a released object;
Metrics::held_release_starts counts them.

How verified: the upload device test now releases four 4 MiB textures, each
after a 64-byte copy, and a Private block after a zero fill, each while the
upload holds it alone. Each is freed with no later call, and starts stay at most
one per release. The Managed texture upload-hold test now sees the named block
come back with no flush. Both run in the branch's compile-gate job. The rt README's
known gap for such releases is removed, and the upload bound paragraph and the
held-release metric docs say what is true now.
2026-11-20 09:24:38 -08:00
Anees Iqbal 61949e8ba4 rt texture blocks: a long block holds its one texture
What: a place of at most 16 MiB goes first-fit in the 16 MiB texture blocks
alone; a longer place goes only in the empty block taken for it. No other
texture lands in the bytes past it (up to the pool's 64 KiB granule).

Why: first-fit scanned every block of the set, long ones included, so a small
texture could take a long block's tail. The long block (one texture's length,
tens of MiB) then outlived its texture, and its freed bytes went on serving
later places. Now a big texture's memory goes back exactly when the texture
does: the block returns at its release and the pool frees the long allocation
at its idle age.

How verified: device tests every_device_frees_a_long_texture_block_with_its_texture
(a 4096x1025 RGBA8 texture's long block has free bytes past it; a 32x32 texture
made next lands in a 16 MiB block; the long allocation is freed 250 ms to
1.25 s after the long texture's release, the small one still live) and
every_device_returns_to_its_fixed_private_memory_within_a_second_of_going_idle
(160 textures of mixed sizes, four longer than a block, and 65 Private blocks,
one longer than a unit, all released; with no call, within a second the Private
allocations are the reserve and the kept texture block, 16 MiB each), in the
branch's compile-gate job, with a negative control of the first test on the
places.rs before this commit. README's texture placement text made current.
2026-11-20 09:24:37 -08:00