Commit Graph
7477 Commits
Author SHA1 Message Date
Anees Iqbal 2fe8ac55c1 matrix: a host-time row past its limit by less than old's own move is VOID for the round
The frozen arm's second rule, beside FROZEN_DRIFT (the planner's ruling of 2026-11-19, reading
(a)): a row judged by its host time, and not by re-timed pairs, whose excess over its limit
(ratio over limit, less 1) is smaller than its own old time's move from the base in the round
is VOID, since the old runtime's drift alone could carry it there. GPU-time rows and rows judged
by their re-timed pairs are never voided by it. Neither rule makes a row red; the paired re-time
judges a red row.

harness_budget parks such a row as VOID with its excess and the move; the report's table reads
VOID for it (over_lines, through excess_voids); each leg's lines name the rows each rule voided
(print_leg). docs/VALIDATION.md states the rule.

The venue-wide reading was withdrawn: the frozen arm's largest moves sit on cold creation rows
(create_4KiB/device_first +88% on one leg of 7cda47f536) and would void nearly every host-time
row.

Verified: test_a_host_time_row_past_its_limit_by_less_than_old_s_own_move_is_void, in the
matrix unit job named in the next commit or the landing message.
2026-11-19 00:58:05 -08:00
Anees Iqbal 4fa157187f matrix: status.tsv drops the 14 entries whose rows were within their limits
The round at 7cda47f536 named 14 entries for removal (results.entries_within): every row of each
was within its limit on every leg of its card that timed it. Removed by exact card and row: ten
of memory2's create_* records, three of the planner's 2026-11-18 gaps (a7a0 create_state/first,
and 1e87 and 2204 create_private_16MiB/first_take; 1e87 frame_5cb), and identity's a7a0
sampling_deep_64x64x16. The known gaps they cite stay in the runtime guide; a row that goes over
again reads NEW, as the file's rule says.

Verified: the round's report in ~/.cache matrix log for 7cda47f536 lists exactly these 14.
2026-11-19 00:52:09 -08:00
Anees Iqbal 6b535f55c9 rt tests: copy_over's gauge read does not take the name of its held helper 2026-11-19 00:49:43 -08:00
Anees Iqbal c8e65bd9cb REPLAY-STREAM.md: the report's textures over buffers line 2026-11-19 00:49:43 -08:00
Anees Iqbal 296e110c0f rt: Gauges::textures_copied_over; the player counts its textures over buffers in place and copied
Gauges::textures_copied_over is the live textures over a buffer the runtime holds in an image of
their own (where the device's linear image does not take the texture, or the buffer's bytes are
imported), Managed device copies' included: it rises at such a texture's making and falls at its
drop, as copied_overs does for the Shared ones, and reads zero at device drop like every gauge.
Its doc line names the over-copy metrics, and over_copies' names it.

The player's rt backend counts each texture over a buffer it makes (not substituted) as in place
or held in an image of its own by the gauge's rise across the making, and reports them on a
textures over buffers line; the gauge goes out with the drop gauges and the frames' live ones.
Tests: copy_over's device test asserts the gauge rises with its texture; the player's no-copy
test asserts its texture over an import counts in an image of its own, and its drop gauges
(this one included) read zero. Verified so far: signatures.py --check; the build and tests run
in the check job.
2026-11-19 00:49:42 -08:00
Anees Iqbal 01d40ad5fc replay: a descriptor-form no-copy buffer inside a recorded block is a buffer of it; others import
The product's no-copy buffers are not all imports. A newBufferWithDescriptor: with noCopy whose
recorded address and length lie inside a live block's recorded range (m2v.newBlockWithLength:
storageMode:) is the program's buffer in that block's storage, a pool buffer on rt; it now plays
as a buffer of that block at that offset, as m2v.newBufferInBlock:offset:length:options: does
(the in-block buffer path is one method both use), its bytes at its making put there first. Only
a descriptor-form one outside every block (the program's own no-copy memory) and the bytes form
(the host's own buffers in the recordings, never the program's) go through the import.

The backend keeps each live block's recorded range (imports::NoCopies) and counts the three
kinds; the report's no-copy buffers line replaces the no-copy imports line. REPLAY-STREAM.md says
which plays how. The no-copy device test adds a block recorded at an address and a
descriptor-form buffer recorded inside it: it reads the bytes written into the block there, and
the line counts it in the block, beside one descriptor-form and one bytes-form import. Verified
so far: nothing; the build and tests run in the check job.
2026-11-19 00:49:42 -08:00
Anees Iqbal 4521865fe5 rt: a stored slot bound to a texture with no storage element is Gap::StorageElement
A draw or dispatch whose function writes a texture slot, or reads one through
its storage image (access::read_write), bound to a texture made for shader
writes that has no storage element, dropped the writes and read zeros. Such a
texture is one whose format the device does not store through a storage image
without a format (the 8-bit sRGB formats, RGB9E5Float or BGR10A2Unorm where the
device lacks their storage), or holds through a view of another (A8Unorm in
red, the extended-range formats).

That draw or dispatch is now refused with Gap::StorageElement { slot,
pixel_format }, found where the swizzled read_write gap is found: at the
dispatch's bind check and at the draw's Facts::find. Which slots count is the
bound function's own access (a write, or a storage read), not the texture's
ShaderWrite usage bit. A texture made without ShaderWrite (and not of Metal's
unknown usage) is outside documented Metal when written, and is not refused.
A texture an argument buffer reaches by its resource ID is not seen at the
bind; its writes stay dropped, recorded in the runtime README's known gaps.

The refusal stands until the alias storage element lands: a view of the
nearest format whose storage Vulkan requires of every device, with the
translator's conversion.

docs/REFUSALS.md regenerated; api_signatures gains the variant.

Test: storage_element::every_device_refuses_a_stored_slot_bound_to_a_texture_
with_no_storage_element binds a 2x2 RGBA8Unorm_sRGB texture to a write slot
and a read_write slot, and expects the gap exactly where the device's optimal
tiling lacks STORAGE_IMAGE with STORAGE_WRITE_WITHOUT_FORMAT, a dispatch
elsewhere, and a read slot dispatching everywhere.
2026-11-19 00:48:41 -08:00
Anees Iqbal 5250b8dd7b rt: the over-copies over imported blocks are counted on their own side
Metrics::over_copies_imported and Metrics::over_copy_bytes_imported count the copies between a
texture over a buffer and its image of its own where the bytes shaders reach are in an imported
block (host memory or a dma-buf), beside over_copies and over_copy_bytes, which still count every
such copy; the rest are over the runtime's own blocks, where the device's linear image does not
take the texture. One mechanism: OverCopy carries whether its buffer's bytes are imported, and
Counters::over_copied adds the imported side where it is. A first-boot report can then read the
imports' copies alone, and a play the pool buffers' copies (total less imported).

The api_signatures rows, the doc lines (Metrics, over.rs, the README) and the player's per-frame
counters carry the two. Tests: copy_over's device test asserts its texture over a buffer in a
taken block moves neither imported counter; the import test asserts every copy of its texture
over an imported block counts on the imported side, its texels' bytes each; the player's no-copy
device test asserts its one copy is imported. Verified so far: signatures.py --check; the build
and tests run in the check job.
2026-11-19 00:45:36 -08:00
Anees Iqbal f6a3e3fc77 rt: a pipeline state answers its texture slots' accesses, from its hazards' interface
ComputePipelineState::texture_accesses() and RenderPipelineState::texture_accesses(stage) answer
each texture slot a function uses, by index, ascending, with the BindingAccess (MTLBindingAccess,
the translator's, re-exported) a dispatch or a draw of the state marks in its encoder's hazards
for the texture bound there: the getters read the very slot list the hazards read (the kernel's
whole-grid module's Interface::textures; a render content's Draws::textures of the vertex or
fragment table), converted by Access::binding (Read -> ReadOnly, Write -> WriteOnly, ReadWrite ->
ReadWrite). A compute module lowered later for a dispatch that needs it (emulated SIMD groups,
partial threadgroups, rows) now also needs whole's texture slots and accesses in covers(), or it
is refused as a module of other samplers is, so no dispatch marks a slot list the state did not
answer. The translator's Stage is re-exported for the render getter's argument; a stage other
than Vertex or Fragment answers nothing.

The access is what the function's operations do (sample or read -> read, write -> write, an
atomic both, a size query read), not the access:: qualifier Metal's reflection answers: a
read_write slot only written is WriteOnly. The consumer uses it to decide whether a slot may
write a bound texture.

Docs: both getters name their Metal counterpart (reflection's MTLBinding.access, which the
consumer builds itself) and what differs; the rt README's compute and render state sections.
api_signatures gains the two methods and the two re-exports.

Test: tests::texture_accesses::every_device_answers_a_state_s_texture_accesses. The harness's
sample_down (samples texture 0, writes and queries texture 1) answers [(0, ReadOnly),
(1, WriteOnly)]; a render state of colored_vertex and first_texel_fragment (reads texture 0)
answers [(0, ReadOnly)] for Fragment and nothing for Vertex or Kernel.
2026-11-19 00:39:41 -08:00
Anees Iqbal 4e45da51d9 rt: a texture reached only through its views takes no index of its own
Device::new_texture_for_views(descriptor) makes a texture as new_texture does, of any usage, with
no index: shaders reach it only through its views, each at an index of its own. It is the one
image under textures a consumer makes as its views, as the surface cache's entry texture is under
the guest's textures over an IOSurface plane (twins are two views). Its gpu_resource_id answers
index 0, so a slot that binds it reads the nil texture.

new_texture, new_heap_texture, new_managed_texture and Buffer::new_texture keep
Refusal::TextureIndex for a texture shaders reach made without an index: texture() takes a
private Reach (Index(Option<u32>) or Views) in place of the index, and only Views skips the check.
Views of a shader-reached texture still take an index (view()'s own check, unchanged).

The rt README states the call, its Metal counterpart (none of its own: the textures
newTextureWithDescriptor:iosurface:plane: makes are its views) and what differs (no index;
index 0 in a slot reads nil). TextureIndex's doc points to the new call; docs/REFUSALS.md takes the
first sentence, which is unchanged (--check clean). api_signatures gains the method's row.

Test: tests::sampling::every_device_samples_and_writes_a_texture_through_its_views. Two textures
for views of Metal's unknown usage (RGBA16Float) take no descriptor slot and answer index 0; views
at 4096 and 4097 (twins), a view of the second at 4098, and the target's views at 1 and 2 answer
their own. sample_down samples the view at 4096 and writes the target's view at 1; with the
target zeroed through itself, a second samples the view of a view at 4098 and writes the target's
view at 2; each time the target, read back through itself, holds the linear filter's mean of the
source, filled through itself. new_texture of ShaderRead usage with no index, and a view of the
source with none, are still Refusal::TextureIndex.

Verified: compile 50631; KosmicKrisp 50633, UHD 630 50641; Linux legs at f2a278938c (to follow)
2026-11-19 00:39:41 -08:00
Anees Iqbal 67dc804be6 conformance: the rt ledger's event rows take the planner's reasons
event-wait-behind-a-running-signal's shared-event rows are a bug of metal2vulkan-rt's, waiting on
memory2's fix (Scheduled and the scheduled handlers once the waited value is reached), so their
reason is "refused: not built yet (memory2)" and they count as the cutover's remaining work.
scheduled-handler-order's row is undefined in Metal: Apple promises the completion handlers to
waitUntilCompleted and nothing of the handlers to waitUntilScheduled, so the row quotes both and
nothing changes.
2026-11-19 00:36:22 -08:00
Anees Iqbal a03c4e25ca conformance: the rt ledger lists the two event-order differences the new side's probes found
With the event probes ported, three sites of two cases diverge from Metal on lavapipe, the RX 7900
XTX (RADV) and the RTX 2080 (NVIDIA) alike, so each row names every venue:

- event-wait-behind-a-running-signal, the MTLSharedEvent row: a command buffer waiting for a value
  whose signaller is submitted and still running reads Scheduled and has run its scheduled
  handler; Metal holds it at Committed with no handler run, as Apple's header defines Scheduled
  ("All dependencies have been resolved..."). A gap of metal2vulkan-rt's submit path. The plain
  MTLEvent row matches.
- scheduled-handler-order: rt's waitUntilScheduled returns while its scheduled handler still runs,
  where Metal's returned after it. Apple's header documents neither order, so the row says so.
2026-11-19 00:36:22 -08:00
Anees Iqbal 38416befcd conformance: the new runtime's side makes the event and scheduled-handler probes
rt_side left six Side calls at the trait default: event_cross_queue_wait,
event_highest_signal, held_command_buffer, signal_before_a_wait,
event_wait_behind_a_running_signal and scheduled_handler_order. Their six cases read refused
(Unavailable) without running rt, so the orders they measure (a wait held across queues, a signal
landing before a wait, a command buffer held by an event, a wait behind a signal still running,
a held scheduled handler against waitUntilScheduled) were never compared against Metal on rt.

rt_side/events.rs makes each probe as the old runtime's side makes it, on rt's events
(Device::new_event, new_shared_event), encode_signal_event/encode_wait_for_event, its handlers
and its statuses. rt's waits have no bound, so each wait for a command buffer is waited_for's on
a thread of its own, recorded as the probe's negative fact where it never returns. A command
buffer held by an event the host raises is released by a guard (Raise) wherever the probe
returns, so no refusal past its commit leaves it held.

The device test rt_side::answered now replays these six cases too.

Verified: pending (compile job and replays follow).
2026-11-19 00:36:21 -08:00
Anees Iqbal 4197923467 rt: a command buffer's GPU times are never later than the completion seen, and keep their span
The completion thread placed a command buffer's two timestamps on the host clock by the last
calibration and nothing bounded them: on the RX 550 a GPU end time fell after the host time its
own completed handler read. A calibration pairs the GPU's tick with a host time that Mesa's
drivers read after it (vk_common_GetCalibratedTimestampsKHR reads the domains in the order asked,
the device's first, bracketed by the host clock), so every time placed by it runs late by the
time between the two reads, and nothing held the end before the completion.

Now the thread reads host_time() when the wait says the completion is reached, and placing moves
the pair together: where the placed end would fall after that time, the calibration's host time
moves earlier by the excess, for this command buffer and every later one placed by it, then both
times are placed with it. So the end is never later than the completion seen, end - start is the
timestamps' own span (Ticks::span, which the end is now placed by: start + span), and later
command buffers keep their order against this one. The calibration's host time is late, and
every completion bounds it from above, so the move takes it toward the moment of the tick and
never past it.

A device test (every_device_places_gpu_times_by_the_completion_seen_and_keeps_their_span) reads
each calibration a second late through a test hook on Core (calibration_lateness, added in
Calibration::read), lets the first completion calibrate again, and asserts for eight command
buffers that start <= end <= the host time in its completed handler, and that end - start is the
span of its two timestamps (recorded by the thread under the test cfg, Core::tick_spans). The
gpu_start_time and gpu_end_time docs and the README's times paragraph say the times are placed
through the calibrated timestamps and never later than the completion observed.
2026-11-19 00:19:05 -08:00
Anees Iqbal f8909e682d conformance: the new runtime's side answers heapBufferSizeAndAlignWithLength:options:
rt_side left Side::heap_buffer_size_and_align at the trait default, so the 40 sites of
device-heap-buffer-sizes read refused (Unavailable) without asking rt. The side now asks
Device::heap_buffer_size_and_align, rt's own answer (the length at 256, reading no option bit).

A device test (rt_side::answered, under --cfg m2v_gpu or m2v_cpu_icd) replays each case of a call
the side answers through the rt side and fails where a site records that call as unavailable.

Verified: pending (compile job and replays follow).
2026-11-19 00:18:03 -08:00
Anees Iqbal 67d621ce0b matrix: a Linux job's tree carries Metal's observations, which the stream device tests read
The GPU legs' tree was laid out without any observations, on the reasoning
that nothing the legs ran read them. Since b28b4975b5 the legs also run the
replay player's stream device tests, and two of them
(a_pointer_written_at_a_recorded_address_reaches_its_node and
a_private_buffer_takes_its_bytes_before_a_dispatch_and_is_compared_after)
take a public case's Metal output from the committed Metal observations. Every
Linux rt leg of the matrix at 7cda47f536 failed both with NeedsMetal { gap:
Missing } (jobs 50451-50454), and nothing else.

The tree now carries corpus/observations/metal (37 MiB of the 1.5 GiB) and
still none of the other backends' observations.

Verified: test_matrix's new
test_the_tree_carries_metal_s_observations_and_no_other_backend_s; the
legs' re-run follows on development.
2026-11-19 00:15:35 -08:00
Anees Iqbal 92166344f6 replay: the host-import query iterates the device's extensions without a conversion 2026-11-19 00:14:01 -08:00
Anees Iqbal 324cfb72cf replay: the new runtime's player imports no-copy buffers' memory; rt counts over-copy bytes
Both no-copy creators (newBufferWithBytesNoCopy:length:options:deallocator:, and
newBufferWithDescriptor: with noCopy) now make their buffers over zeroed host pages of the
player's own, each imported as a block of its own through rt's import_host_memory, as the
product imports the program's pages; the import's release frees the pages once the runtime has
freed the import. A texture over such a buffer is then the runtime's counted copy, so a play's
frames count those copies. A device without host-memory import refuses a no-copy buffer by name.
Two-copy forms keep their second copy: the import holds the CPU's copy where the runtime keeps a
GPU copy, and the copy shaders reach where the player keeps the second copy itself. Release and
command-buffer use tracking now cover a buffer with no place of its own but a device copy or an
aside.

rt gains one deterministic metric, Metrics::over_copy_bytes: the bytes of the copies between a
texture over a buffer and its image of its own, still counted in bytes_copied
(Counters::over_copied adds all three; the now unused Metric::OverCopies is gone). The player's
per-frame counters carry it, its drop gauges and live gauges carry rt's imports gauge, and its
report gains a no-copy imports line.

Tests: rt's copy_over device test checks each copy adds the texture's bytes to both byte
metrics; a new rt_replay device test plays both creators, a texture over the first, a blit of
the texture checked against the stream's bytes, one over-copy of 64 bytes, the imports line and
the imports gauge at zero at device drop. Verified so far: signatures.py --check passes; the
build and tests run in the check job.
2026-11-19 00:14:01 -08:00
Anees Iqbal 716a4fd856 rt: a drawable's move home starts where its acquire found it, decided at the acquire
The submit thread records an acquire's move home when it takes the upload, which is after the
commit of the command buffer that presents the image; that commit marked the drawable presented,
so the first acquire's move was recorded from PRESENT_SRC_KHR while the image was still undefined.
The validation layer said so on every floor driver tried (lavapipe, XTX, 2080, the UHD 630,
KosmicKrisp): "command buffer expects VkImage ... to be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED", once per image, at its first frame.
A raw probe with no runtime in it (an image moved to PRESENT_SRC by one submission and read out of
it by the next, with and without a binary semaphore between) drew nothing on the same layer and
lavapipe, which put the cause in the runtime.

The turn now has New (never presented) apart from Engine (presented since the last acquire), and
drawable_acquired stores from_present before it owes the move, under the work lock that the
submit thread reads it under. The present tests, which failed with that message, are the test
that fails without this; they run next.
2026-11-19 00:08:47 -08:00
Anees Iqbal 137c468f4b rt: the present tests name a drawable's kind in their messages, as Vulkan's flags print no Debug here 2026-11-19 00:08:46 -08:00
Anees Iqbal 90c1ed6e8f rt: the present tests present through a real headless swapchain where the driver offers one
Where the instance offers VK_EXT_headless_surface and the device presents to it, a new test makes
a real swapchain of such a surface (FIFO, the surface's least image count, B8G8R8A8_UNORM where
offered, else R8G8B8A8_UNORM) and presents with vkQueuePresentKHR on with_present_queue: frames
until each image is acquired twice (fenced acquire, drawable_acquired, a clear the first time and a
load after, present_drawable with a semaphore per image), two in three presented from the test's
thread after wait_until_scheduled beside a sleeping scheduled handler, every third from the
command buffer's own scheduled handler; then the swapchain goes as the README orders it
(command buffers complete, presents waited for with vkQueueWaitIdle in with_present_queue,
textures dropped, swapchain destroyed before the views go), for a render-target and then a
shader-read drawable, a second swapchain on the same surface. Each run prints M2V-SURFACE with
the surface it had. The stand-in tests still run on every device, as they read the presented
texels back.

Not yet run: potluck jobs next.
2026-11-19 00:08:46 -08:00
Anees Iqbal 4a393990fa rt: a presenting command buffer is scheduled once its submission passed vkQueueSubmit2
What: the planner's change to the presenting design, and its additions.
- Scheduled means, for a command buffer that presents a drawable, that its submission has passed
  vkQueueSubmit2: the submit thread no longer schedules it as its last segment joins the group
  (the group goes at once anyway), but in submit(), between queue_submit2 and
  core.done.submitted, which is where the completion thread first learns of the batch
  (complete.rs, Done::submitted). Its status, kernel times, scheduled handlers and
  wait_until_scheduled all follow the call, with no window and no wait across threads, and its
  scheduled handlers still run before its completed handlers. A failed submission schedules
  nothing: its handlers run as it retires, as an ended command buffer's do. The split wait
  (CbState::signal_unsubmitted) is gone.
- A present from the command buffer's own scheduled handler is valid now; the docs still say to
  present from the consumer's thread, as the handler runs on the submit thread.
- Several drawables in one command buffer each signal their own semaphore; the same semaphore
  twice is Refusal::DrawableSemaphoreRepeated (new), the same drawable twice
  Refusal::DrawableNotAcquired.
- The Safety texts of the three unsafe calls name the Vulkan rules the runtime cannot check (the
  image is that swapchain's; `ready` unsignalled with no signal or wait pending; the swapchain not
  destroyed while in use).
- The README's "Destroying a swapchain": which completions and drops come first
  (VUID-vkDestroySwapchainKHR-swapchain-01282); views may outlive the image, as Vulkan's object
  lifetime rules let a child of the device outlive the image it views.

Tests: the render test's second frame presents from the scheduled handler, the first and third
from the test's thread beside a handler that sleeps 100 ms; both drawables' teardowns follow the
guide, destroying the stand-in image before the views go; a new test presents two drawables from
one command buffer and checks the two refusals. Not yet run: potluck jobs next.
2026-11-19 00:08:46 -08:00
Anees Iqbal e5157492d7 rt: drawables' textures over a swapchain's images, their acquire, and a present that signals the consumer's semaphore
What: the two presenting pieces the new runtime lacked, so a consumer can present on the
runtime's own device.
- Device::new_drawable_texture (unsafe): a texture over an image of the consumer's swapchain,
  checked against the swapchain's create info (2D, one level, its extent and one layer; the format
  the runtime holds the pixel format in; usage holding the texture's, transfer included). Its home
  layout, views, set 1 elements and hazards come from the existing plan (form()). The image is
  never destroyed by the runtime: Backing::Drawable, and the reaper frees only the views.
- Texture::drawable_acquired (unsafe): re-arms the existing homing, so the upload of the next
  submission moves the image home ahead of every later commit; from UNDEFINED the first time and
  from PRESENT_SRC_KHR after a present (texels kept).
- CommandBuffer::present_drawable (unsafe): at commit the last segment's end barrier also moves the
  image home -> PRESENT_SRC_KHR, and that segment's submit info signals the consumer's binary
  semaphore beside the progress semaphore; the group goes at once, as an event signal's does.
- wait_until_scheduled of a presenting command buffer returns once its submission passed
  vkQueueSubmit2: rt marks a command buffer Scheduled, and runs its scheduled handlers, before the
  submit, so a present made after the wait could otherwise wait on an unsubmitted binary signal
  (VUID-vkQueuePresentKHR-pWaitSemaphores-03268), on the shared and on the reserved present queue.
- Refusals with their basis: DrawableDescriptor, DrawableFormat, DrawableUsage, NotDrawable,
  DrawableAcquired, DrawableNotAcquired. docs/REFUSALS.md regenerated, api_signatures blessed
  (9 records added, none removed or changed). The README's presenting section replaces the
  "not built yet" lines, with its known gaps (no acquire semaphore; no present from the presenting
  command buffer's own scheduled handler; a presenting command buffer that never runs leaves the
  image acquired).

Tests (src/tests/present.rs, device cfgs, validation layer): an image made as a swapchain's
stands in for one; three frames of acquire, pass, present and a stand-in present that waits on
the semaphore on the presenting queue and copies the image out of PRESENT_SRC_KHR, for a
render-target and a shader-read drawable; the presenting command buffer's sleeping scheduled
handler must have returned before wait_until_scheduled does; each refusal. Not yet run: built
and run in potluck jobs next.
2026-11-19 00:08:18 -08:00
Anees Iqbal d06e4b56db conformance: the new runtime's side makes the wait from a command buffer's own handler
The three handler-waits rows read "never-returned" in 49672 (f82dd9c768, lavapipe) without
running rt at all: rt_side left Side::handler_wait at the trait default, which answers
Unavailable("handler_wait"), and an Err where Metal never returned is the compliant verdict. So
these rows covered nothing of rt's.

- rt_side::handler_wait makes the shape as the old runtime's side does (runtime_side.rs): a
  command buffer with one 64-byte fill, whose scheduled or completed handler waits on that same
  command buffer and sends back what the wait answered; the side's own wait for the command
  buffer and for the answer are each bounded (WAIT, 60 s), so a wait rt neither refused nor
  returned from reads as never returning instead of hanging the suite.
- rt answers at once in each: a wait in a scheduled handler is Refusal::InScheduledHandler; a
  completed handler's waitUntilCompleted on its own command buffer returns, the command buffer
  being complete. The planner ruled that answer kept (no rt change), so known-gaps-rt.tsv holds
  handler-waits-completed-until-completed on every venue as an accepted difference, quoting
  Apple's sentence for waitUntilCompleted, and rt's wait_until_completed doc names where Metal's
  call never returns.

Verified: nothing yet; conf-check.sh (clippy x3, the conformance tests, and a lavapipe replay of
the three cases) follows.
2026-11-18 23:50:58 -08:00
Anees Iqbal 7cda47f536 matrix: an owned row fails only 3% past its owned ratio; a one-pass outlier is timed again
An open record in status.tsv now names the ratio its row was owned at (the new `owned` column,
filled for the existing entries from the matrix note of b0c08e51b5). The harness budget names a
row past its limit that an open record holds and fails nothing while the ratio it is judged by,
after its re-time, is within 3% of the owned ratio (results.OWNED_WORSE); more than 3% worse, the
row fails its leg again. A known gap's row fails only past a ceiling a ruling gave it
(HARNESS_CEILINGS), as before; one without a ruled ceiling is listed and fails nothing. The
report's table shows the owned ratio and whether the row is within it, and after the table names
every open record and gap whose rows are within their limits on every leg of their card that
timed them, for removal (results.entries_within).

A cross-GPU outlier of a harness row's time on the new runtime no longer fails a leg from one
pass: once every leg is in, the legs with one have their harness timed once more (Run.retime: a
node's legs in turn, the nodes at once, each job holding its node alone), and an outlier fails
only where both passes agree (results.time_outliers with the first pass); one that only one pass
has is parked and named. Outliers of other records fail at once, as before.

Verified: the matrix's unit tests (test_results.py, test_matrix.py), run from scripts/matrix in
a potluck job; new tests cover the owned verdicts (within, worse, re-timed, a first take), the
gaps with and without a ruled ceiling, the removal list, the two-pass outlier rule and the
re-time's jobs.
2026-11-18 23:45:49 -08:00
Anees Iqbal 2db8331d56 command-replay: the new runtime's gauges at device drop go out as the matrix's lines
After the play, the new runtime's backend ends its device (NewRuntime::end) and now hands back
what it read once the device dropped (Ended: every rt::Gauges field by name, threads as the
slots still held, whether all read zero, whether it quiesced). command-replay writes one line per
gauge into the report, "M2V-MATRIX gauge replay-rt/device/GAUGE@drop N", the matrix's own record
form (scripts/matrix/results.py's RECORD pattern; its rule fails a gauge not 0 at @drop), so any
play job's output can be checked by that rule. The teardown error now names only the gauges not
at zero. The old runtime's counts end with its device, so its plays print none.

Tests: a unit test of the lines' form and the error's naming; the rt device test of a play that
ends with a command buffer held asserts every line is "M2V-MATRIX gauge KEY@drop 0". The stream
guide's report section says so. Checked by the lane's check job (named in the report to main).
2026-11-18 23:41:05 -08:00
Anees Iqbal 5505cf436f rt tests: the layouts recorder records blits and stops recording when its test ends
On the UHD 630 leg (Windows, libtest: every test in one process, one at a time) the test binary
aborted at tests::mipmaps (m3-max-50267 at ec4a540e1b, m3-max-50304 at 63fe797d12): "Unable to
load cmd_blit_image", a panic in an extern "system" function, which cannot unwind. The layouts
test set RECORDING and never cleared it, so every device made after it in the process took the
recorder's table, in which vkCmdBlitImage was an unrecorded command left unloaded; since
4df69ca062 rt records vkCmdBlitImage (generateMipmapsForTexture:). nextest runs each test in a
process of its own, so the Linux legs never met it.

- The recorder records vkCmdBlitImage (its source and destination layouts), as the module's
  contract asks of every layout-naming core command rt records; vkCmdBlitImage2 stays unrecorded.
- The test sets RECORDING through a guard that clears it when the test ends, unwinding included.

Verified: nothing yet; the UHD leg follows.
2026-11-18 23:38:06 -08:00
Anees Iqbal feec58e2f5 rt: a texture over a buffer in an imported block is the counted copy, on every device
replay's census C: the window server (b3) makes 425 textures over its no-copy buffers, and every
no-copy buffer is now an import, so refusing them (Gap::TextureOverBuffer in d335594515) would
refuse the window server's textures. They take rt's existing copy form instead: an image of its
own, which the device copies the buffer's bytes into before the submissions that use it and back
after a command writes it, counted in Metrics::over_copies. The buffer stays the import itself.

The runtime makes no image in imported memory. Such an image would be made for the import's
handle (VUID-vkBindImageMemory-memory-02728), so in the undefined layout
(VUID-VkImageCreateInfo-pNext-01443). An acquire from VK_QUEUE_FAMILY_FOREIGN_EXT is not used: it
needs a matching release (7.7.6), which host writes do not make (host memory imported by its
address is shared with the host as host access), and it leaves an aliasing resource's contents
undefined (7.7.6). Whether an in-place form exists stays open with the planner until the copy's
cost is measured.

- check_over answers the copy for a buffer in an imported block; Gap::TextureOverBuffer's doc
  goes back to its old cases; new_texture's doc and the README say how such a texture is made,
  and the README records it as a known gap.
- Tests: the import device tests run on every platform (host memory from std::alloc; the
  shared-file mapping test unix-only), so the Windows UHD leg runs them. A texture over imported
  host memory is copied on every device, reads the host's own bytes, its writes reach the host,
  and both copies count in over_copies.
- REFUSALS regenerated for the import limits (the rebase took development's at d335594515).

Verified: nothing yet; the check job and the device legs follow.
2026-11-18 23:38:06 -08:00
Anees Iqbal d29a50fbcb rt tests: the import tests' release is crate::memory::Release, which clippy's type_complexity takes
c80eae3e98's check (m3-max-49028) passed everything but clippy under --cfg m2v_gpu and
m2v_cpu_icd: releasing() returned (Option<Box<dyn FnOnce() + Send>>, Arc<AtomicBool>), a type
clippy::type_complexity refuses. The crate's own alias for that box names it.

Verified: nothing yet; the next check job follows. The device legs run on c80eae3e98's archives,
whose test code differs from this commit's only in the alias.
2026-11-18 23:38:06 -08:00
Anees Iqbal 92578bb1e4 rt tests: the import tests' release helper is releasing(), which no release binding shadows
m3-max-48960 (73dd097c82) failed CLIPPY_GPU and CLIPPY_CPU_ICD with E0618 at tests/import.rs:316
and :465: a second release() call in a scope whose first bound release. Renamed; tests only.
Product code compiled there (CLIPPY_ALL, CLIPPY_NOFEAT, DOC, the rt and harness suites 0).
2026-11-18 23:38:06 -08:00
Anees Iqbal a3b089dad9 rt README: the 2 GiB buffer cap against the M3's 38.88 GiB, the allocation count, and a kept block's region
Three consumer-facing statements of what rt does now:

- Known gap: rt caps a buffer at MAX_BUFFER_LENGTH (2 GiB) where the M3's Metal allows
  38.88 GiB (maxBufferLength 41,747,087,360 bytes, measured by reims), about twenty times as
  much. The cap is the translator's 32-bit offsets from a bind address, which bought 4.3-6.6% on
  AMD and more on the RTX 3090 in the constant-reads probe, where a 64-bit sum without them was
  8.9% slower on the RX 7900 XTX (the planner's figures). Nothing changes in code.
- maxMemoryAllocationCount: imported blocks count too, and why rt counts its own (Vulkan leaves
  an allocation past the count undefined, VUID-vkAllocateMemory-maxMemoryAllocationCount-04101,
  and VK_ERROR_TOO_MANY_OBJECTS is not promised). The count, its typed refusal
  (Limit::MemoryAllocations) and its gauge (Gauges::blocks) were already built
  (memory::allocate; device tests in tests::memory); 4,096 is the lowest venue (Mesa's Mac driver).
- The consumer's mappings: a kept block keeps its region; BlockMappings::unmap runs only when the
  block ends (its allocation freed, or its bytes given back for a take of another length), so a
  take of its length hands back the same block, mapped already. Read from memory.rs: retire()
  is called only from the unkeep path, a spilled block's give-back, free_idle and teardown.

Docs only.
2026-11-18 23:38:06 -08:00
Anees Iqbal c9896fc325 rt: a no-copy buffer's memory is imported as a block, a dma-buf or host memory, each by its own type rule
Metal's newBufferWithBytesNoCopy:length:options:deallocator: is the memory it was made over. rt
had no import; reims refused every no-copy buffer. Two calls now make a block over the
consumer's memory, which the consumer places buffers in with new_buffer as in a block it took:

- Device::import_host_memory(pointer, len, release) (unsafe; VK_EXT_external_memory_host):
  the first type the pointer's query offers that is host-visible, host-coherent and listed by
  the buffer's requirements. contents is the pointer.
- Device::import_dma_buf(fd: OwnedFd, len, release) (unix; VK_KHR_external_memory_fd and
  VK_EXT_external_memory_dma_buf): only the FIRST type the fd's query offers, and only where it
  is host-visible, host-coherent and listed; otherwise Limit::ImportType with nothing attempted.
  On NVIDIA (620.70.06) one failed dma-buf import into a later offered type broke every later
  ordinary allocation of that type, rt's Shared type among them (probe fail4, job 48691-era),
  so the rule attempts nothing it is not sure of. The fd: the driver owns it after Ok; after a
  refusal or a failed query rt closes it; after a failed import rt closes it only where it
  still names the same file (fstat dev and inode), as a driver may close it itself.

Both return the block with the memory type index taken, and refuse before any allocation:
Limit::NoImport (extensions not enabled, or vkGetPhysicalDeviceExternalBufferProperties not
IMPORTABLE for rt's buffer usage), Limit::ImportType, Limit::ImportAlignment (0 bytes, off
minImportedHostPointerAlignment, or below the buffer's requirements), Limit::BlockLen. Each
import is one VkDeviceMemory through memory::allocate, so it counts against
maxMemoryAllocationCount (Limit::MemoryAllocations before the driver is called) and
Gauges::blocks; Gauges::imports counts the live ones. The last handle's drop hands the block to
the block-maker thread, which destroys its buffer, frees the memory (counted as a free for
submissions_during_frees) and then runs release, Metal's deallocator; at teardown the thread that
tears down does. BlockMappings::unmap never runs for an import. The three extensions join
floor::OPTIONAL_EXTENSIONS (enabled where listed). new_buffer's zeroing goes by whether the host
maps the block (a dma-buf block is zeroed by the GPU fill), and a texture over a buffer in an
imported block is Gap::TextureOverBuffer (an image bound to imported memory must be made for
its handle).

Tests: unit tests of both rules over the venues' measured answers; device tests (unix) of a host
import (GPU fill reaches the pointer, release only after the free, gauges back), an ordinary
32 MiB Shared allocation after an import of a shared file mapping whatever its answer (RADV
refuses it at the import), the import counted against a faked maxMemoryAllocationCount, and
(Linux, /dev/udmabuf) a dma-buf imported into its first offered type or refused at the query
with a Shared allocation and a host import after it.

README (Imported blocks, the floor's extensions, the known-gap line), REFUSALS.md and
api_signatures.tsv regenerated. Verified: nothing yet (no local builds); the check job and the
device legs follow.
2026-11-18 23:38:06 -08:00
Anees Iqbal 39baffa540 conformance clocks: the Windows CPU clocks move by the scheduler's tick, as the Windows run read
clocks.rs said the Windows CPU clocks' step "was not measured". The first Windows run measured it:
job m3-max-50344 (homelab-mac-mini-2018, Intel UHD Graphics 630, driver 101.2145, Windows 11),
`conformance times --leg ours --runs 1 --show host-page-writes-kernel-store-writable`, read the
thread clock as 0 us for five calls (buffer, host_buffer, library, read_buffer, render) and as
exactly 15,625 us, 1/64 s, for a compute_pipeline call whose wall time was 8,465 us.
GetThreadTimes counts in 100 ns units but moves by the scheduler's tick, so a per-call `on cpu`
figure there is 0 or whole ticks, not the call's CPU time. The doc now says so; the code is
unchanged. Docs only.

Verified: the figures are job m3-max-50344's output; no build needed for a doc comment (fmt run).
2026-11-18 23:36:38 -08:00
Anees Iqbal 22960472a7 translator test cli: the unix-only bundle test imports its own three types, so Windows clippy passes
CI's Windows clippy line (`cargo clippy --target x86_64-pc-windows-gnullvm|msvc -p metal2vulkan
... --all-targets --all-features -- -D warnings`) failed in crates/metal2vulkan/tests/cli.rs:
`Mutability`, `RenderPipelineDescriptor` and `ReproBundle` were imported at the top of the file,
and their only user, `a_runtime_bundle_replays_the_refusal_on_the_device_it_names`, is
`#[cfg(unix)]` (it runs a bundle's `repro.sh`), so on Windows the three imports were unused and
`-D warnings` stopped the build. They are now imported inside that test. Nothing else changes.

Verified: job m3-max-50254 (msi, at a55a6945bb) showed the failure, STEP
clippy-x86_64-pc-windows-gnullvm EXIT=101 and clippy-x86_64-pc-windows-msvc EXIT=101, three
unused imports each, while the Linux steps were 0; the re-check at this commit follows as a job.
2026-11-18 23:36:38 -08:00
Anees Iqbal dea5618aa7 conformance: the CPU clocks and host pages have a Windows form; Windows answers no load average
The conformance command did not build for Windows: `src/clocks.rs` read the two CPU clocks with
`libc::clock_gettime` and the load average with `getloadavg`, and `src/host_pages.rs` mapped a
no-copy buffer's pages with `libc::mmap`, none of which `libc` has on Windows. So the Windows host
(a supported metal2vulkan-rt host) could not replay the suite.

On Windows the thread's and the process's CPU clocks are `GetThreadTimes` and `GetProcessTimes`
(kernel plus user, in 100 ns units), and the pages are a committed `VirtualAlloc` released with
`VirtualFree`, the forms metal2vulkan-runtime already uses. Windows keeps no load average, so
`host_load` answers `None` there, which the timing report already reads as "this host answers no
load average" and the per-call gate already judges on what the host does answer. `libc` is now a
unix-only dependency and `windows-sys` a Windows-only one, as in the runtimes.

A new unit test holds both CPU clocks to answering and moving while the thread computes, so a host
form whose call fails or reads a constant is seen. CI's Windows clippy now names the conformance
crate, so the Windows build is held from Linux.

Verified: unverified at this commit; the compile check and the Windows run follow.
2026-11-18 23:36:38 -08:00
Anees Iqbal bc6dc40a14 player: the old runtime plays a recorded heap as its buffers and its textures apart
On the old runtime's player, a heap with a recorded range is now made by what the stream places
in it (read ahead), whatever its type:
- its buffers go in a heap at the recorded address and of the recorded size, each at its
  recorded offset, never laid out again (a pinned span never grows);
- its textures go in a heap outside the pinned space, laid out for the runtime's sizes as the
  texture-only rule did. It is one heap, so textures placed at one offset still share.
Buffer-only = the pinned heap alone, texture-only (or nothing placed) = the outside heap alone,
mixed = both. Backend::holds_no_buffer becomes Backend::split_heap(heap, HeapSplit); the old
backend holds a split heap as Object::Heap(buffers' heap, textures' heap), and useHeap: uses
both. A buffer the runtime refuses at its recorded offset in its heap now stops the play typed
(PlayError::Unpinned with the runtime's reason) instead of as a Runtime error.

Why: u4's old arm stopped at f1033 on mixed heap #188906 (4 MiB placement, 2600 buffers and 1000
textures over its life): the relayout grew it for the runtime's texture sizes, and the pinned
heap's grown span met #188909, recorded 0x8968 bytes past the heap's Metal span. u2 and u3 carry
the same heap twice each, u4 again at f1059.

The report line becomes "pinned N of N; K heaps' textures outside; S textures whose recorded
range (by the runtime's texture sizes) met a live buffer's". S comes from the read-ahead: a
texture's range is the heap's recorded address plus its offset for the runtime's size answer
(the stream holds no texture size), a buffer's its recorded range; reported, not a stop. The
heap code moves to replay/heaps.rs (relay, placement helpers, HeapSplit, Overlaps).

Safe by census (jobs 50282-50286, every stream on five nodes, 29 names): every heap is a
placement heap; no call takes a heap as receiver except the placements, none names a heap as an
argument, and no heap or size getter is recorded; the only calls on heap resources are
m2v.privateBytes on heap buffers and texture views of heap textures, neither compared. The
automatic-heap half rests on its unit test, as REPLAY-STREAM.md now says.

Tests: unit tests for the three shapes (textures alone, buffers alone with an alignment that
would move them, mixed with a larger texture and a met buffer) and for automatic heaps; a
lavapipe device test of a mixed heap whose texture the runtime makes larger, with a buffer
pinned right past the heap's recorded span that keeps its address. The negative control (no
split told, the whole heap relaid) must fail them; the check job and its inner codes are named
in the report to main.
2026-11-18 23:34:38 -08:00
Anees Iqbal 4b272889dd rt: pixel_format_info's doc says the description is an Apple GPU's and a format the device lacks is refused at creation
The planner's ruling on the format capabilities: nothing is built until a
count shows a guest asking for a format the device lacks; what is true today
is said where the method is read. The description, flags included, is an
Apple GPU's; a format this device lacks is still described, and is refused
where a texture of it is made, with Gap::TextureFormat.

Doc only. Verified: this commit's tree is 33d80430d7's, whose check
m3-max-50365 passed every inner code (clippy x3, rustdoc -D warnings,
rt lib tests 117/117, doctests, api_signatures).
2026-11-18 23:31:04 -08:00
Anees Iqbal 968fae700e rt: Device::heap_buffer_size_and_align, Metal's measured answer: the length at a multiple of 256
The new runtime answers heapBufferSizeAndAlignWithLength:options:
(Device::heap_buffer_size_and_align(length, options) -> SizeAndAlign) so a consumer places its
heap buffers by rt's answer. The answer is Metal's measured one: the conformance recording
device-heap-buffer-sizes.json (an Apple M3 Max, macOS 27.0.1, three runs) answers the length
unrounded and an alignment of 256 for lengths 1, 15, 255, 256, 257, 511, 4096 and 1 MiB under the
default, Private, Managed, write-combined and untracked options; the old runtime answers the same.
The size is therefore the length, not the length rounded up to 256.

The alignment is a constant, HEAP_BUFFER_ALIGNMENT in buffer.rs, with its reason beside it: rt
takes a buffer at any byte of a block, and every per-use rule it has holds for a buffer at a
multiple of 256 of its block (whose own first byte lies at a multiple of 64 KiB of its
allocation): a bound argument's alignment of at most 16 (Refusal::BufferOffsetAlignment),
indirect arguments at a multiple of 4 and indices at a multiple of their size
(Refusal::ArgumentPlace), a fill's 4-byte words and a copy's texel block. Vulkan bounds
minUniformBufferOffsetAlignment, minStorageBufferOffsetAlignment and minTexelBufferOffsetAlignment
at 256 (the required limits table, "max"), so no device asks more. An answer that moved with the
host would buy nothing, and a later placement rule changes it in one place. The options are
Metal's raw MTLResourceOptions, which the answer does not read. The doc names the Metal
counterpart and what differs: nothing, but that the answer is the same on every device.

A unit test holds the answers for 0, 1, 15, 255, 256, 257, 511, 4096, 1 MiB, MAX_BUFFER_LENGTH
and u64::MAX. The rt README names the call beside new_buffer and among the heap answers the
consumer takes from rt. api_signatures.tsv blessed: one record added. docs/REFUSALS.md
regenerated with no change.

Verified: unverified at this commit; the compile check and the tests follow as a job.
2026-11-18 23:28:15 -08:00
Anees Iqbal 0792238038 rt: Device::pixel_format_info and Device::texture_level_info, moved from the old runtime
The new runtime answers Metal's two format SPI calls, MTLPixelFormatGetInfoForDevice
(Device::pixel_format_info(raw) -> PixelFormatInfo) and
MTLGetTextureLevelInfoForDeviceWithOptions (Device::texture_level_info(&TextureLevelQuery) ->
TextureLevelInfo), so a consumer's textures piece can take them from rt. They are moved as they
are from metal2vulkan-runtime's pixel_format_info.rs: the measured table of the 264 values an
Apple M3 Max describes under macOS 27.0.1, the level rule, the three public types (PixelFormatInfo
and TextureLevelInfo non_exhaustive with public fields, INVALID, describes_a_format, words,
TextureLevelQuery with plane_2d) and their tests (src/tests/pixel_format_info.rs). Both are pure
functions: no Vulkan call, no device query, the same answer on every device. The old runtime is
not touched and keeps its copy until the cutover deletes it.

What changed in the move: rt has no device generations, so the methods call the functions
directly; the old crate-private helpers no rt code uses (describes, depth_or_stencil and its
DEPTH_OR_STENCIL bits) are not carried, and the one test that read describes reads
pixel_format_info itself. Two doc examples on the methods compile as a crate outside rt and read
every field of both answers and build a TextureLevelQuery field by field, so a consumer can use
every answer. The rt README's Textures section names both calls, and its known gaps of textures
the values 630 to 645, which an Apple M4 describes and these answer INVALID. api_signatures.tsv
is blessed: 34 records added, none removed or changed. docs/REFUSALS.md regenerated with no
change (no refusal moved).

Which PixelFormatInfo fields are capabilities rather than byte layout, from the code and the
tables we hold (nothing built for this):
- name is the format's identity; words are layout (a block's bytes, width, height and depth for
  a format of blocks; else the texel's bytes, a packed word and two words Metal does not name).
- cast_class is the class of formats a view may reinterpret the format as: a view capability,
  but Apple's GPU's, fixed per format.
- flags is Apple's word. The code names three bits only: 0x400 (a format of blocks: layout) and
  0x20 and 0x40 (depth and stencil aspects). No document and none of our code names the rest; they
  are the bits that may carry Metal's per-format capabilities on that GPU (render, blend, filter,
  multisample, write), and nothing here decodes them.
Does any field say yes where rt says no on a floor driver? At the level of the description,
yes: a described format answers a full description (describes_a_format, its name and words)
where rt makes no texture of it. The driver profiles under
crates/metal2vulkan-validation/profiles report textureCompressionASTC_LDR and
textureCompressionETC2 false on RADV, NVIDIA and lavapipe, so rt's Device::new_texture answers
Gap::TextureFormat there for the 48 ASTC formats and the ETC2 and EAC formats (expected from
texture.rs's plan(), which takes the translator's format table and the device's image format
query; not run). On every device rt makes no texture of a format whose texels the shader converts
(the extended-range BGRA10_XR family, the 4:2:2 formats GBGR422 and BGRG422), nor of PVRTC, which
Vulkan has only through an IMG extension; all of them are described here. For the unnamed flag
bits the question cannot be answered from what we hold: it needs a probe on the Mac naming the
bits, and rt's per-format answers on each floor driver, which the profiles do not record (they
hold features and properties, no format feature tables), so a floor-driver run of the format
feature queries would be needed as well.

Verified: unverified at this commit; the compile check and the tests follow as a job.
2026-11-18 23:26:24 -08:00
Anees Iqbal b28b4975b5 matrix: the GPU legs run the replay player's stream device tests; status rows lose closed owners
The GPU legs' archive held metal2vulkan-rt alone, so the replay player's
stream device tests (metal2vulkan-validation's runtime_lane::replay_streams,
17 on the old runtime, and runtime_lane::rt_replay, 24 on the new) ran on
lavapipe only. A break in the player or a runtime's stream path that only a
GPU shows waited for a lane's play of a recorded stream to find it, as the
old arm's pin stop did. The archive now holds the validation crate too, and a
leg runs the runtime's tests and those two modules (DEVICE_TEST_FILTER). The
Windows leg is unchanged until the validation crate is shown to build there.

status.tsv, by the planner's ruling of 2026-11-18:
- 10de:1e87 frame_5cb is a gap row: the runtime guide's known gaps carry it
  (crates/metal2vulkan-rt/README.md, NVIDIA's latency per submission).
- 8086:a7a0 frame_5cb and 10de:2204 create_state/first are within their
  limits; their closed lanes' names are cleared (a row gets an owner when it
  goes over).
- identity's rows wait for their card's native table, the guest-visible test;
  "Iris swing unresolved" was stale.

Verified: see the check job named in the landing message (unit tests of the
matrix script, the archive built with both packages under --cfg m2v_gpu, the
filter's selection listed, and the selected tests run on a GPU).
2026-11-18 23:14:02 -08:00
Anees Iqbal 1ee16e6a0f command-replay: every report line, the frame lines among them, goes to the standard error too
identity's scripts lost 50152's record when they deleted the job's temporary directory, where
report.txt lay. The planner ruled that the player prints each report line and each frame-end line
to stderr as well as to report.txt, so no script can lose them.

ReportFile, the one writer of report.txt, now implements Write. Each write goes to the file and
then to stderr, and the player's frame lines go through it (with_frame_lines takes the report
rather than its file). A failed stderr write never fails the file's. REPLAY-STREAM.md section 10
and the binary's docs say where the lines go.

Test: the range test's helper runs command-replay and asserts that its stderr carries every
report.txt line, in order. All its plays stop before a device opens, so no device is needed.
2026-11-18 22:53:43 -08:00
Anees Iqbal a08126dc97 player: the old backend holds the heap without buffers in a Cell, as its device calls borrow it shared 2026-11-18 22:52:47 -08:00
Anees Iqbal 331ff7bcba player: the old runtime makes a heap the stream places no buffer in outside the pinned space
glbench-3090-r4's old arm stopped at f198: buffer #22759, pinned at 0x4020086d8000 (32 KiB past
heap #22754's recorded end), met the span the old runtime held for #22754. #22754 is a placement
heap that holds six RGBA16Float textures and no buffer. The player lays placement heaps out again
for the runtime's texture sizes, and grew it from 2 MiB to about 2.5 MiB; pinned at its recorded
address, the grown heap held #22759's pages. In Metal the two never meet.

The rule (the planner's): on the old arm a heap is pinned only where the stream places a buffer
in it. A texture has no address and a heap answers none, so no address the program holds lies in
a heap without buffers, and pinning it buys nothing. The read-ahead finds those heaps from the
stream alone, never from the runtime's size answers or what the space holds, so the old arm's
address layout is the same on every card. The player tells the backend before the making
(Backend::holds_no_buffer). The old backend makes the heap outside the space, and the address map
keeps its recorded range at its recorded address, so the address census is unchanged. A heap that
holds a buffer keeps its recorded address and the typed stop where its grown span meets another
pin.

The report's pinned line now says "pinned N of N; K heaps without buffers outside: ...".
REPLAY-STREAM.md sections 5, 9 and 10 say so.

Tests:
- a_heap_without_buffers_is_made_outside_the_recorded_addresses (player, no device). The test
  backend pins. A texture-only heap is told and made outside; a heap with a buffer, and its
  buffer, are made at their recorded addresses. A word into the outside heap's range is still
  counted, and no word moves.
- a_heap_without_buffers_leaves_the_next_pin_its_address (old runtime, device). A 64-KiB pinned
  heap holds only a 256-KiB texture, and a buffer is pinned at the first granule past the heap's
  recorded span. Without the fix the grown heap's span holds the buffer's and the play stops.
2026-11-18 22:52:47 -08:00
Anees Iqbal 5daf865187 rt: a render state without rasterization takes its discard as dynamic state
A state of Metal's rasterizationEnabled NO was a VkPipeline of a static
rasterizerDiscardEnable, which leaves the fragment shader and fragment
output state out of the pipeline: its colour formats then count as none
against the pass's (VUID-vkCmdDraw-colorAttachmentCount-06179), and the
depth, stencil and blend state the encoder records as dynamic before every
draw is no state of the pipeline at all (VUID-vkCmdDraw-None-08608). The
validation layer reported both at the draw of a vertex function that stores
with rasterization disabled (rt's new device test, at d79a8faf73: the UHD
630 in m3-max-50124 and the M3 Max in m3-max-50120); the stores reached
their buffer.

Such a state now takes VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE (Vulkan
1.3's, no feature), always gives its colour blend state, and the encoder
sets the discard where it binds the pipeline, since a bind of a pipeline
whose discard is static leaves the dynamic value undefined. A state with
rasterization keeps its static discard and is made as before. The README's
list of a pipeline's dynamic state names it.
2026-11-18 22:51:46 -08:00
Anees Iqbal dd65f111e1 rt: vertexPipelineStoresAndAtomics joins the floor
A vertex or post-tessellation vertex function may write and atomically
update device memory in Metal. rt never enabled
VkPhysicalDeviceFeatures::vertexPipelineStoresAndAtomics, so the translator
refused every such render state as StageStoresAndAtomics, "needs
AnyOf([[Feature(VertexPipelineStoresAndAtomics)]])": 13 tessellation
conformance cases, whose post-tessellation vertex functions record their
domain points and patch tags with stores, were refused on every rt venue.
Every floor driver reports the feature: lavapipe (Mesa 26.2.4), RADV 26.2.6
(RX 7900 XTX, 780M Phoenix, 780M HawkPoint, RX 550), NVIDIA 620.70.06 (RTX
2080, RTX 3090) and 615.71.09 (RTX 5080 Laptop), ANV 26.2.6 (Iris Xe),
Intel's Windows driver (UHD 630) and KosmicKrisp 26.3.1 (M3 Max): venue
dumps m3-max-48727 to 48731, 48736 and 48737, and query m3-max-50101 for
the RX 550. So it joins the floor's required features, BelowFloor naming it
where a device lacks it, and the README's floor table names it.

Tests: the floor test's device at the floor states it and its
missing-feature case names it; a device test draws
rvc_draw_bases' draw_bases_in_a_vertex_function with rasterization
disabled, each vertex of two instances storing its ids and the draw's bases
to its own slot, which fails without the feature (the state is refused).
2026-11-18 22:51:46 -08:00
Anees Iqbal 1909948db5 player: the old backend plays setLineWidth:
glbench-780m-r2's old arm stops after 379 frames at setLineWidth:, Apple's private
line width ("not played on a render encoder"; play 50122, player 8fd5b8b587).
The old runtime has RenderCommandEncoder::set_line_width, which draws the width
as Metal does. The backend now plays the call through it. This is a player
change only.

Test: render_encoder_setters_play_with_their_effects gains a pass. A line 3
wide crosses the 4 by 4 target through row 1's centres, and rows 0 to 2 are
checked green, where a line 1 wide draws row 1 alone.
2026-11-18 22:25:56 -08:00
Anees Iqbal b0c08e51b5 player test: the render setters doc ends its list before its last paragraph; its cases take a type
Clippy (check 50096, --cfg m2v_gpu and --cfg m2v_cpu_icd) refused the doc
paragraph after the list as list items without indentation, and the cases'
tuple type as too complex. A blank doc line ends the list, and the tuple is
the local type Case.
2026-11-18 22:14:29 -08:00
Anees Iqbal ad54f7ed6b player test: the render setters stream names its attachment arguments apart from the case's
render_encoder_setters_play_with_their_effects bound the colour attachment
setter's arguments as `args`, shadowing the case's draw arguments, so the
draw call passed an array where a slice was meant (E0308 under --cfg m2v_gpu
and --cfg m2v_cpu_icd, check 50080). The attachment arguments are `attachment`.
2026-11-18 22:14:29 -08:00
Anees Iqbal 9ad315df70 player: the old backend plays the render encoder setters the new backend plays
The old arms stopped one render-encoder call at a time:
- glbench-3090-r4 after 335 frames at setViewports:count: (play 50055,
  player 90298cb0df);
- earlier, setColorStoreAction:atIndex: and setDepthStoreAction:.
Comparing the selectors the two backends play gives sixteen render-encoder
calls that the new backend plays, the old backend refused, and the old runtime
has. The backend now plays all of them through the old runtime's own calls:
- setViewports:count:, setScissorRects:count:;
- setCullMode:, setFrontFacingWinding:, setTriangleFillMode:,
  setDepthClipMode: (and SPI), setDepthBias:slopeScale:clamp:,
  setBlendColorRed:green:blue:alpha:;
- set{Vertex,Fragment}Bytes:length:atIndex:, setVertexTexture:atIndex:;
- the single vertex and fragment sampler forms, with and without LOD clamps;
- setVertexSamplerStates:withRange: and its form with clamps;
- drawPrimitives:...:baseInstance:;
- drawIndexedPrimitives:...:baseVertex:baseInstance: (a negative base vertex
  as recorded).
The single-viewport, single-scissor and sampler-list parsers became shared
helpers. This is a player change only; drawPatches, the tessellation factor
buffer, parallel encoders, setStageInRegion:, synchronizeTexture: and
optimizeContentsForGPUAccess: stay refused.

Test: render_encoder_setters_play_with_their_effects (device,
runtime_lane::replay_streams, on the old runtime). Eight passes draw the owned
fixture cof_offsets, each into a 4 by 4 target cleared red, and each target is
checked for its setter's effect: bytes, a left-half viewport, a top-half
scissor, culling under each winding, lines around the target, base instance 1,
base vertex -3. The setters with no visible effect play before the first draw.
rt_replay's metallib helper now takes the fixture's path (library_of).
2026-11-18 22:14:29 -08:00
Anees Iqbal 3228fbc9d6 tables: re-bless the engine inventory, golden hashes, printouts and authored compile census at a3ff94f510
The tessellation-rendered-patches case (d0317d17a6) added the public fixture
engine/tess_rendered_patches: its inventory and golden-hash rows and its
air_input printout are new. The authored compile census re-blesses six rows
whose artifact hashes moved with the translator commits since the last bless;
no row's status changed (the two StageStoresAndAtomics refusals stand).

Verified: bless job m3-max-50098 (inventory=0 golden=0 printouts=0) and
census job m3-max-50099 (census-exit=0), both at a3ff94f510 on the M3.
2026-11-18 22:09:29 -08:00