Commit Graph
6926 Commits
Author SHA1 Message Date
Anees Iqbal cbd4644463 rt tests: the hold test commits the held command buffer before the bytes are named
What: every_device_takes_staging_of_its_own_behind_a_held_command_buffer commits the command
buffer that waits on the event before it makes and names the Managed buffer.

Why: on every discrete leg of edfa66f02e (jobs 45072-45074) the held command buffer's own
commit captured the bytes named at the buffer's making, streaming them with nothing held ahead,
so the later commit named nothing and took no staging of its own (0 overflows, 1 expected); the
bytes checks passed.

Tests: legs rerun.
2026-11-18 01:23:02 -08:00
Anees Iqbal 2c524be253 rt capture: a chunk ends in place and becomes a copy-in after; the upload is made before a stream
What: Chunk::end records and ends the command buffer in place, and Chunk::ended makes the
copy-in, so a failure gives the chunk up through its one path; the capture takes or makes the
upload before WorkState::stream, which can no longer fail. ManagedOvers::into_after and
capture::into are renamed copies_in_after and copies_in.

Why: clippy's result_large_err and wrong_self_convention lints on 20073b5d43 (check 45026).

Tests: check rerun.
2026-11-18 01:23:02 -08:00
Anees Iqbal 76042ac0b8 rt capture: a commit's ring-fulls stream as copy submissions of their own; behind a host hold, staging of its own
What: the planner's ruling on a full capture ring, replacing the live read.
- A capture that finds the ring full waits for the oldest span's submission. Where the oldest
  span is of a copy not yet submitted, every queue's held group goes at once and the commit waits
  (on a new condvar the submit thread notifies after each pass) until nothing committed before
  can still go. Then, where everything committed is submitted, the capture's own ring-full is
  ended as a copy-in and goes in the upload's submission (after the upload's commands and any
  copy-ins carried from a failed commit), flushed at once; the commit waits for it to complete
  and reuses the ring. The ring is all the staging a capture holds, whatever it names.
- Where a command buffer committed before waits on the host (an unmet host event wait, or an
  enqueued, uncommitted command buffer ahead of it), nothing can go: the rest of the capture is
  copied into Shared staging blocks of its own from the pool (at most 256 MiB each), which the
  committing command buffer holds and gives back as it retires, so the pool's idle rule governs
  their release. Every byte is still as of the commit.
- The live read and Metrics::managed_bytes_live are gone, with their README known gap. Metrics
  gain capture_streams, capture_overflows and capture_overflow_bytes; Gauges gain capture_bytes
  (the ring once made, plus live overflow blocks), also in the replay's per-frame counters.
- Copy-ins are recorded through capture::Chunk: one vkCmdCopyBuffer per run of copies from one
  source into one device copy. Copies back owed to textures over the ranges go at the head of the
  capture's first copy-in, copies in at the tail of its last (ManagedOvers::captured is split into
  backs_before and into_after). Copies read the buffer's mapped contents, which the naming keeps.
- The API signature table is blessed for the new Metrics and Gauges fields.

Why: the planner ruled that a commit's own captures stream and that only a host hold, where
waiting could deadlock, takes one-off staging; no byte may be read after its commit.

Tests: managed.rs's past-the-ring test now names three rings' worth with nothing held and checks
that it streams (two or more streams, no overflow, capture_bytes equal to the ring after the
commit) and that the bytes arrive; the hold test commits behind an unsignalled event with a ring
and a half named and checks one overflow of half a ring, the commit's bytes (a write and a
didModifyRange after the commit are not seen), and the staging given back after retirement.
2026-11-18 01:23:02 -08:00
Anees Iqbal 8780c1da83 rt managed tests: the image peek commits first; the past-the-ring buffer holds both parts
Texture::image_bytes (test-only) read a texture's image once the upload had run, which carried a
Managed buffer's changed ranges before; the ranges now wait for a commit, so the peek commits a
command buffer first. The over test's image over a Managed buffer failed on the XTX and the 2080
without it (job m3-max-44933, archive of 6a8b901008). The past-the-ring test's buffer was shorter
than its two three-quarter parts (a slice past its end on the same legs); it is a ring and a half.

Verified: the next check and legs.
2026-11-18 01:23:02 -08:00
Anees Iqbal 0d22e7958e rt managed tests: the past-the-ring test's Shared buffer asks no zeroing in new_buffer's new form
Development's new_buffer takes the offset to zero from (None for none); the rebase over it left
one call in the old form, which failed to compile (job m3-max-44925).

Verified: the next check job compiles it.
2026-11-18 01:23:01 -08:00
Anees Iqbal 246df18113 rt capture: copy-ins live in the command buffer's first segment; carried ones are taken last
The Gpu field pushed the completion item's command variant past clippy's large-variant bound,
so the copy-ins move to the first segment, ahead of whose commands they go. A capture that
fails before its end leaves the carried copy-ins carried. Retire reads every copy-in field it
gives up (the images were never read, a dead-code error), and the drains are mem::take, as
clippy asks (job m3-max-44896).

Verified: the next check job compiles it.
2026-11-18 01:23:01 -08:00
Anees Iqbal 1389f31a19 rt capture: the ranges a capture takes are named apart from each buffer's
The loop variable shadowed the list the unwind calls give back, so the build failed (job
m3-max-44888). The past-the-ring test also prints each three-quarter-ring commit's time and the
rate of its copy into the ring.

Verified: the next check job compiles it.
2026-11-18 01:23:01 -08:00
Anees Iqbal d330e61475 harness: a Managed buffer on the new runtime is the runtime's Managed buffer
What: the rt backend places a Managed buffer in a Shared block and makes it with
Device::new_managed_buffer (bytes zeroed through a zeroed Shared buffer over the range, nothing
copied), and forwards did_modify_range. constant_managed, refused on rt so far (no CPU copy),
now runs there, through the capture at the commit on a two-copy device.

Why: the planner sizes the Managed capture ring on the harness's own workloads; the harness
compares rt's commit time with the old runtime's on them.

Verified: the check job that compiles it (clippy, harness tests).
2026-11-18 01:23:01 -08:00
Anees Iqbal 692606f978 rt capture: the capture's unwind helper is named apart from the queue's abandon
The two methods of Work shared a name, so the build failed (job m3-max-44878).

Verified: the next check job compiles it.
2026-11-18 01:23:01 -08:00
Anees Iqbal 92adb7ffac rt: a Managed buffer's named ranges are taken at the commit, through a capture ring
What: didModifyRange (and a new Managed buffer's first bytes) only names a range, merged per
buffer; it submits nothing. The next commit of a command buffer with commands copies every range
named since, once, into a 64 MiB host-visible capture ring on the committing thread, and records
the ring-to-device-copy copies into a command buffer of its own (a copy-in) that goes ahead of the
committing command buffer's first segment, after its waits, between barriers. Textures over the
ranges in images of their own take their owed copies back before the copies and their copies in
after them, in the same copy-in. Commits take turns (a turn mutex taken before the work lock) so
command buffers keep the order of their captures while a capture copies without the work lock.
A full ring waits for its oldest span's submission; where the oldest span is of a command buffer
not yet submitted (held, possibly on a host event, or the capture's own), the held groups go and
the rest is copied from the consumer's bytes when the copy runs, counted in
Metrics::managed_bytes_live (a README known gap). Metrics gain managed_bytes_captured,
managed_bytes_live and capture_waits. Managed is one copy when Vulkan's device type is integrated
or CPU (Core::unified_memory, the answer Device::has_unified_memory gives), two otherwise, in
place of the Shared type's DEVICE_LOCAL flag.

Why: the planner's ruling. The old live read at submission let a write made after a commit reach
a command buffer committed before it (gb's Managed traffic); Metal takes the bytes shortly after
the commit, before scheduling, and a write while the command buffer runs does not reach it. The
deviceType rule makes the 780M (whose Shared type is not DEVICE_LOCAL) one copy, as reims reports
hasUnifiedMemory from it.

Also: queue abandonment and commit-time errors give the ring spans of copy-ins never staged back
and name their ranges again; the submit thread's end forgets named ranges and carried copy-ins
(they hold device copies, which hold the core); a texture over a Managed buffer joins its buffer's
entries only after its move home is recorded.

Tests: managed.rs gains the at-commit test (written, named, committed behind an event wait,
written and named again before the event: the kernel reads the commit's bytes on a two-copy
device; a write after naming and before the commit is read on both forms) and the past-the-ring
test (a range 16 MiB past the ring arrives whole, part live; two commits of three quarters of the
ring arrive whole); the changed-ranges test checks that changes submit nothing.
2026-11-18 01:23:01 -08:00
Anees Iqbal af28fabe97 rt floor: independentBlend and fragmentStoresAndAtomics required and enabled
In Metal, each of a render pipeline's color attachments blends by its own
state, and a fragment function may write and atomically update device memory.
The translator asks Feature(IndependentBlend) for the first (it refuses with
Unsupported(IndependentBlending) without it) and Feature(FragmentStoresAndAtomics)
for the second. The floor enabled neither, so the translator, which sees only
what device creation enables, refused them. Vulkan 1.4 requires both of every
graphics device (55.1), Roadmap 2022 lists both, and every lab profile
reports both (RADV, ANV, NVIDIA, lavapipe). The planner ruled them required
floor features.

The README's floor table names them. The floor test's at-floor device reports
them; the test refuses a device that lacks either one, and checks that device
creation and the translator's enable set include both.

Found by the render census under the floor's real enable set (job 45000, on
the draws branch with robustBufferAccess): gb translated 144 of 274 render
pipelines, with 123 refused as IndependentBlending and 1 needing
FragmentStoresAndAtomics (b2: 141 of 266, 118 and 1). With both enabled
(job 45063), gb translates 267 and b2 259, the same counts as under the
profile's whole feature set.

Verified: lint of this commit (floor tests); census 45063 for the counts.
2026-11-18 01:07:05 -08:00
Anees Iqbal c15cebf4d1 rt: a take finds a block given back before the block-maker thread has kept it
The create_64MiB regression (matrix 61f2799088: next_take 7-27x old on RADV, NVIDIA and the
Iris). Each create in the harness's loop takes a 64 MiB Shared block, which takes an
allocation of its own, and gives it back; the next create takes again straight away. A take
looked only at the kept blocks, and the block-maker thread keeps a given-back block only when it
gets to the queue. While the thread was inside a driver call (a 16 MiB vkAllocateMemory or a
vkFreeMemory, 3-70 ms on the NVIDIA cards), the take found nothing, allocated a fresh 64 MiB
on the guest thread (fresh pages, their first touch in the memset), and the block it missed
left its allocation idle and over the window's peak, to be freed: a free that kept the thread
busy for the next take. Shown by the new test at the parent of this change
(every_device_takes_a_long_block_given_back_again_at_once, draft at 30cc1a0b69): on the RTX
3090 (m3-max-45044) rounds 3-19 each allocated one and freed one; on the RX 550 (45043) round
16 did; lavapipe (45042) none.

- Pool::take, after the kept blocks, takes a block from the give-back queue that the thread
  would keep (not spilled) and of the length asked: its allocation stays in use throughout, so
  no bookkeeping changes but the reuse count and the window's note.
- The block-maker thread holds the lock from popping a kept block off the queue to pushing it
  on the kept blocks (it dropped it in between, with nothing to do for a kept block), so a take
  finds the block in one or the other.
- The test: 20 takes of a 64 MiB Shared block, each given a zeroed buffer and given back, each
  take straight after the give-back before: only the first allocates, 19 reuse, none is freed.
2026-11-18 01:04:47 -08:00
Anees Iqbal 4d803e2a33 rt tests: a long block given back is taken again at once (diagnostic draft) 2026-11-18 01:04:47 -08:00
Anees Iqbal 871c54fc5f rt tests: the pending-upload test counts the allocations in use in the pool, not from the gauges
every_device_bounds_the_pending_upload failed now and then on the Iris (ms01 jobs 44922 and
44970; passed in 44962): "copy 0: 4 allocations live, at most 3 expected". Its count of the
allocations in use was the Blocks gauge less the idle gauges' allocations. The Blocks gauge
rises in allocate() before vkAllocateMemory, and the allocation joins the pool (and the idle
gauge) only once make_allocation returns; and it falls in free_allocation after vkFreeMemory,
where the idle rule took the allocation out of the pool (and the idle gauge) before. So while
the block-maker thread makes or frees an idle allocation, that count is one more than the
allocations with a block in use.

The test now counts the allocations with a block in use where the pool keeps them
(Pool::in_use, test-only), which neither window touches. The bound itself is unchanged.
2026-11-18 01:04:47 -08:00
Anees Iqbal 366ff410a3 replay: the old runtime's backend tells a texture's storage mode too, for the texture_writes line 2026-11-18 00:55:17 -08:00
Anees Iqbal 48f7079244 replay: the report counts CPU writes into Managed textures a committed user may still be using
Whether rt must capture a Managed texture's bytes at replaceRegion (rather than when the GPU copy
is next used) turns on how often a program writes one while a command buffer that used it may
still be running. The report now says.

- The player keeps, from the stream alone (replay/texwrites.rs): the textures and each view's
  texture; each encoder's command buffer; the textures each command buffer used (an encoder call
  naming the texture or a view of it, or an encoder made with an MTL...Descriptor object, or one
  made on such an object, that names one); each texture's latest committed user per queue; and the
  completions the stream records, which are only the program's CPU waits (waitUntilCompleted of a
  command buffer or a later one of its queue, waitUntilSignaledValue:timeoutMS: reaching a value
  one of its queue's command buffers signals). The play itself waits at each commit, so this is the
  recording's order, not the play's.
- At each call on a texture that carries bytes (replaceRegion:...), blobs resolved, it asks the
  backend whether the texture is Managed (Backend::managed_texture, default None; the rt backend
  answers from the texture's descriptor) and counts the write, and where a committed user has no
  recorded completion, counts it by the presents since that user's commit (0, 1, 2, 3+) and names
  the first eight.
- Report::texture_writes (TextureWrites) carries the counts and the report's texture_writes line
  says them, with the writes into textures whose storage the backend does not tell.

REPLAY-STREAM.md section 10 documents the line.
Verified: a replay test (Kept backend) writes a Managed texture used through a view by a committed
command buffer, before and after a present, writes a texture that is not Managed, and writes again
after the CPU waited: 3 writes, 2 with the user not seen complete (one per present bucket), the
first two named; clippy and the plays in the check job.
2026-11-18 00:55:16 -08:00
Anees Iqbal 4814a3356c rt README: a Managed texture's replace after a commit is seen until the GPU reaches the upload
A replace_region on a Managed texture lands in its named bytes at the call, and the upload
that copies them into the image reads them when the GPU reaches it. On a discrete Mac (Radeon
Pro 5300M, macOS 26.7.1, API validation off) a replace made after the commit is seen by that
command buffer only until it is scheduled; one made after the GPU started it is not (the
consumer's oracle runs 45008/45010; the UHD 630 control saw the replace in every step). So rt
can show a replace that Metal would not, in the window between Metal's scheduling and rt's
upload. The replay streams make no such write: every Managed texture replace in gb (301) and
b2 (111) precedes the texture's first use (replay census 44999/45028). Recorded as a known
gap; nothing built.
2026-11-18 00:50:12 -08:00
Anees Iqbal 714e21400a harness: texture_read, a texel read out to a buffer over 2048x2048 in 16x16 threadgroups
Each thread of a 2048x2048 grid, in threadgroups of 16x16, reads its texel of an RGBA16Float
texture and stores it as a float4 at y * 2048 + x: the harness's own texels_out kernel as a timed
workload, 64 MiB stored, the reference the texels themselves (sixteenths, exact in half).

Why: on Intel's Windows driver (101.2145) for the UHD 630 this shape took 2.05 times the old
runtime's time when rt ran it in 16x16 workgroups through its device address (7614 against
3711 us), and 0.98 in the tiles the landed rule gives a kernel that does not observe its
partition and is not image-only. No harness row held it, so nothing in the matrix would catch a
change that put such kernels back in a declared 16x16 workgroup. The kernel reads its grid
position alone, so it takes the tiles; the matrix's 1.03 budget now guards it on every leg.

Verified: see the jobs named in the landing message (clippy and the harness suite, and the row
under both runtimes on the UHD 630 and the RX 550 at this commit).
2026-11-18 00:44:57 -08:00
Anees Iqbal 77b4f7b91a rt store: a 128 MiB default cap, its measured costs in the README, and a test of a process exiting in a removal
The default cap where the consumer names none was 512 MiB. Half the cap is what the store is
sure to keep, and the larger of the two recorded sessions filled 15.4 MB (379 pipeline files,
6.25 MB; 282 lowerings, 9.16 MB), so 128 MiB keeps about four times that.

The README quotes the store's measured costs, which do not grow with the number of files: the
scale probe (4229ae3525, whose cache.rs is this one's but for the default cap) at 100,000 and
1,000,000 files of 100 bytes, release build, on btrfs (msi, m3-max-44602) and NTFS (the Windows
host, m3-max-44612 and m3-max-44627).

A new test runs a child process that makes generation 3 young with its last write and exits at
once, while its removal thread has generation 1 to remove; the parent finds generation 1 still
there, and the next open removes it with the state whole and no listing.
2026-11-18 00:39:31 -08:00
Anees Iqbal 2b034aa3b0 rt tests: the render device test finds the pipeline's file under its generation
Its cache directory helper read pipelines/ at the directory's root, where the generation store
no longer keeps it, so it found no file (lavapipe, job m3-max-44584). It now reads each
generation's pipelines/ directory.
2026-11-18 00:39:31 -08:00
Anees Iqbal ca46749b95 rt: the cache directory's docs and device tests follow its generations; the stress test proves each child ran
The rt README's cache directory section, its teardown paragraph and the pipeline_cache_dir and
pipeline_cache_cap docs say what the generations keep: half the cap is what the store is sure
to keep (a set used over and over that is larger thrashes), at most the cap on disk plus what
is left of a generation a removal is taking, a file larger than half the cap is not kept,
devices on one directory share one count and should pass one cap. The device tests that read
the directory's files skip the state file and find pipeline files under their generation. The
multi-process stress reads each child's output and requires its one test to have passed, so a
child that matched no test cannot pass silently.
2026-11-18 00:39:31 -08:00
Anees Iqbal dd26d127bd rt: the pipeline store keeps two generations, counted in a shared state file, with no scan, no per-file memory and no search to evict
The landed store scanned the whole directory at open and kept every file in a map, so at
100,000 / 1,000,000 entries an open took 128 ms / 1.07 s and 18 / 164 MiB, a write at the
cap 424 us / 16.2 ms (a linear search for the oldest), and an open that evicted 1,000 files
0.49 s / 30.6 s (probe c09cae29ce on 8cfda4b5e1, job m3-max-44067). The consumer passes a
25 GiB cap, one store per host user, several processes at once.

The files now live in two generation directories, g<N> (young) and g<N-1> (old). A lookup
tries young, then old; a hit in old is renamed into young (its mark of use, with no bytes
rewritten and no file time read). A write goes into young. The bytes young holds are counted
in `state` (young's number, its bytes, a checksum), read and written under the file's lock
(flock / LockFileEx through std's File::lock), which each store holds open for its life,
beside an in-process mutex, since threads sharing one open file share its lock. The write
that takes young past half the cap makes the next generation young, in the same locked
state write; a thread of the store's own (at most one, not joined) makes the state durable
and removes every generation below old, so no thread that submits, waits for or completes
work removes files. Bytes are counted before they are written and given back when the write
fails, the write goes into the generation read under the lock, and the generation's own
directory is made only at the move under the lock, so a write into a removed generation is a
miss. Every file is checked before use (the translator's encoding, the pipeline data's
checksum); one that does not check is a miss and is removed. A state file that is missing or
does not check is rebuilt from the generations' names with young counted full; an open looks
for the generation below old (one stat) and finishes a removal a process left.

Gone: the map of every file, the scan and the eviction at open, the hourly time touch and its
stat on every hit, the stale temporary file sweep (a temporary file leaves with its
generation), and the pipelines directory made at device creation.
2026-11-18 00:39:31 -08:00
Anees Iqbal 1d9ceb87c8 rt: the compute encoder's use_heap keeps the heap's block for its command buffer, and the new-runtime player plays useHeap
Metal's useHeap: names a heap the encoder's work may reach. rt had no such call, so the player
skipped and counted each one. ComputeCommandEncoder::use_heap takes the heap's block number (a
HeapRange's block, or the block a placement heap's buffers sit in) and keeps that block in the
command buffer until it retires, exactly as use_resource keeps a buffer's block (keep and the new
keep_block share one list). Metal states no retention for useHeap:, so keeping is the safe
reading. The call declares no access: a kernel that reaches a heap's resources through addresses
outside its slots already orders against every write since the last barrier. A number no handle
names answers Error::NoSuchBlock, as new_buffer's does.

The player's compute encoders now call use_heap with the heap's block, and still skip and count
a useHeap: of a skipped object. REPLAY-STREAM.md's skip list and the rt README say so.

Test: heap::every_device_holds_a_used_heap_until_its_command_buffer_retires takes a Private
block, uses it twice in one encoder (the command buffer holds it once), releases it while the
encoder is open (the command buffer still holds it, and a new use of its number answers
NoSuchBlock), commits, and waits for the block's last holder to go once the command buffer
retires. api_signatures.tsv regenerated (one new method); REFUSALS.md unchanged.
2026-11-18 00:37:03 -08:00
Anees Iqbal c3e10e5ba9 runtime_lane replay_streams: two plays compare the counts the stream fixes, not the executed ones
The matrix's lavapipe leg at aaf4d16993 (job m3-max-44768) failed
a_pointer_written_at_a_recorded_address_is_relocated: the test played one stream twice on the old
runtime and asserted the two whole reports equal. Since 2ac0ea6799 the old backend's executed
counters carry its vkCreate*Pipelines and shader-cache nanoseconds
(compute_pipeline_create_nanos 9055654 against 5423492, shader_cache_read_nanos 24416 against
27420 in that run), so two plays never report equal executed counts. REPLAY-STREAM.md section 10
already says executed counts differ between plays and only the stream's counts compare.

The test now compares each report with its executed counts (groups, frames, total, the split's)
and frame ends left out: the stream's counts, checks, IDs, private bytes and the rest still have to
match.

Verified: the test on lavapipe (--cfg m2v_cpu_icd, LP_NUM_THREADS=1) in the job named in the
hand-over.
2026-11-18 00:35:00 -08:00
Anees Iqbal 0280c19285 rt: the block-maker thread frees idle allocations one at a time, only in quiet gaps
The planner's ruling (free when quiet), replacing "free whenever the window lets go": a driver may
hold every submission of the process for the whole of a vkFreeMemory, and on the NVIDIA cards we
measured in Thunderbolt enclosures freeing host-visible memory takes about 1.1 ms per MiB (15-17 ms
for one 16 MiB allocation), where an internal NVIDIA card frees 16 MiB in about 0.5 ms (store lane
and planner rows). Under the 10 s window a give-back freed every surplus allocation at once, back
to back, beside the guest's submissions.

What changed:
- The idle rule (which allocations are surplus: the window's peak, the cap, the reserve) is as it
  was. It now answers one allocation at a time (Rule::Free), and the block-maker thread frees it
  only once no commit or submission has come on any of the device's queues for 20 ms
  (QUIET_NANOS), then looks again. CommandBuffer::commit and the submit thread's vkQueueSubmit2
  stamp the pool (one atomic fetch_max of host_time, nothing else on those paths).
- The rule runs on the block-maker thread's own time too: it sleeps until the next change, the
  end of the quiet time where it has an allocation to free, or the second the window's peak can
  fall where it keeps idle allocations. So a program that goes quiet gives its idle allocations
  back without a call of its own (before, the rule ran only on a take or give-back).
- A spilled allocation that empties retires: no take lands in it, its bytes are not free bytes,
  and it is the rule's next to free, through the same quiet path (it was freed at once).
- Metrics::allocations_freed counts the frees; Metrics::submissions_during_frees counts the
  submissions made while the thread was inside a free's vkFreeMemory. The replay's per-frame
  counters carry both.
- README: the idle paragraph, and a known gap of memory blocks in the planner's wording.
  release_block's doc. api_signatures gains the two fields.

Tests:
- every_device_frees_idle_allocations_as_the_window_s_peak_falls: the three oldest freed one at
  a time when the clock passes the window, and the fourth freed five seconds later with no take
  or give-back (the timer path); four frees counted.
- every_device_frees_idle_allocations_in_quiet_gaps: command buffers committed every 2 ms while
  four idle allocations are surplus; every free begins at least 20 ms after the last commit before
  it (checked against the test thread's own commit times, whatever its gaps); the four are freed
  once the commits stop. Then a free held open: a submission during it is counted, one after it
  is not.
- The spill test exercises the retiring path (it failed while a newly made spilled allocation was
  taken for an emptied one: 3090, 2080, RX 550 in m3-max-44872/44873/44874; fixed).

Verified at d7918e27fa (this commit's code on a6520161e8; the tree here is the same diff applied on
development 61f2799088): check m3-max-44879 (clippy all-features, --cfg m2v_gpu, rt under
--cfg m2v_cpu_icd, translator no-feature; rt and harness suites); legs 3090 m3-max-44882,
2080 44883, RX 550 44884, lavapipe 44885: 174/174 each. The old runtime and the translator are
untouched.
2026-11-18 00:20:41 -08:00
Anees Iqbal 61f2799088 replay: --until-frame, frame lines as each frame ends, and the rt backend's unwritten line
A play that hangs (gb's fault at frame 1095, b2's at 312) wrote no report: report.txt got its frame
and end lines only at the play's end, so every hung play left 0 frames in its timing table, and the
cold and warm plays of the frames before each fault could not be read.

- Player::until_frame(F) stops after frame F's present (frames counted from 0 as Report::frames
  counts them), completes the work committed so far and reports as at the stream's end;
  command-replay's --until-frame F sets it and says `until-frame F`.
- Player::with_frame_lines(out) writes each frame's lines (Report::frame_lines: its frame and end
  lines) to out as the frame ends, flushed; command-replay passes its open report.txt and writes
  the rest at the end (Report::lines_but_frames). Report::lines keeps every line, the completed
  groups' first.
- The rt backend's report gets an `unwritten N` line: the Shared buffers made without bytes that a
  compute encoder bound or used and whose command buffer committed before any recorded write,
  upload or GPU pass reached their bytes since their making, with the first few named and the
  command buffer that read each. It is where a recording that missed the program's writes shows
  (b2's uniform ring #58725 had no recorded byte in its life). What reaches a buffer: an m2v.write
  into it, into its block over it or into another buffer of the block over it; a blit or render
  encoder call naming it or such a buffer (skipped encoders included); the commit of a dispatch
  binding it. It counts and stops nothing (new_runtime/unwritten.rs, hooks in the make paths,
  write, release, the encoder calls and the commit).

REPLAY-STREAM.md section 10 documents --until-frame, the per-frame lines and the unwritten line.
Verified: replay tests for the frame stop and the per-frame lines (Kept backend) and for the
unwritten count (the tracker alone: block writes, a blit naming, a write before the commit, a
release, a later commit, an alias made later); clippy and the device plays in the check job.
2026-11-18 00:16:31 -08:00
Anees Iqbal 3f4b0154c5 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-18 00:14:48 -08:00
Anees Iqbal 89bf650d2e conformance: time buffer-bind-off-alignment on the M3 Max
conformance times --runs 8 --write buffer-bind-off-alignment (job m3-max-44858 at a574b72781, an
Apple M3 Max, macOS 27.0.1) writes both legs' figures into the case's recording, so
times::every_case_carries_its_timing holds the new case as it holds the rest. The case is within
the 10x margin over 8 rounds. The run reported its margin unjudged: the instrument's own cost
moved 2.31x during Metal's leg.

Verified: the recording only gains its times; coverage.py --check passes.
2026-11-18 00:14:01 -08:00
Anees Iqbal 92f773ba0a conformance: record buffer-bind-off-alignment on the M3 Max
Record mode (job m3-max-44847 at 09c51a35ef, an Apple M3 Max, macOS 27.0.1) took the case's two
Metal facts:
- Plain Metal ran the pass: every step answered Ok, and the command buffer is Completed with no
  error, over 3 runs folded into one outcome.
- Metal's API validation stopped it at the pass: "Compute Function(vwp_words): the offset into the
  buffer src that is bound at Buffer index 0 must be a multiple of 4 but was set to 2.", and the
  same for dst at index 1.

docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py): 167 case
modules, 1,282 recordings.

Verified: the recording's facts as listed (read from the file); coverage.py --check passes.
2026-11-18 00:14:00 -08:00
Anees Iqbal 5bc1835719 conformance: buffer-bind-off-alignment, a uint buffer bound at byte 2, which Metal's API validation refuses
The planner asked for a conformance case built from the bind Metal's API validation refuses, beside
the new runtime's Refusal::BufferOffsetAlignment. One compute pass runs vwp_words (the owned
fixture vector_word_phases) over src and dst bound at byte 2, where its uint * arguments take a
multiple of 4: the uint-2 bind of probes/vector_access_placement.m. Record mode keeps plain
Metal's outcome of the pass and, as the validated fact, the validation's words ("must be a
multiple of 4 but was set to 2"). The case compares the pass's outcome and reads no bytes back:
where plain Metal places each element of such a bind is probes/misaligned_buffer_binds.m's
question and docs/API.md section 10's entry, and this case is about the refusal.

The case's own test holds the recording to both facts. It is listed among the cases authored after
the last whole-set cost run. Its recording follows in the next commit, taken on the M3 Max.

Verified: cargo fmt only; the build and the recording are the next potluck jobs.
2026-11-18 00:14:00 -08:00
Anees Iqbal 9bec8a977e rt: a dispatch that reaches a buffer bound off its argument's alignment is refused
The planner ruled that the bind-offset mask becomes a typed refusal. The binder pushed a bound
buffer's address, its gpuAddress plus the offset, rounded down to the alignment the kernel takes
it to have (FieldValue::BufferAddress's mask, from RuntimeFact::AddressAlignment), where Metal's
API validation refuses the bind offset ("must be a multiple of 4 but was set to 2" for a uint *
argument, probe vector_access_placement.m in the conformance crate). Plain Metal runs such a
dispatch at addresses of its own: an M3 Max reaches each element at its address rounded down to
the smaller of its alignment and 4. That is not the rounding the binder did for 8- and 16-byte
arguments.

The dispatch now refuses it with Refusal::BufferOffsetAlignment { index, offset, alignment }
before it records or keeps anything. check_alignment runs after the threadgroup size check and
before a kernel without effects returns, so both direct and indirect dispatches take it.
fill_parameters pushes each address as it is. A set_bytes copy sits at a multiple of 16 in the
ring, which every mask divides, so it is never refused.

Docs:
- docs/API.md: the identity-domain paragraph and the section 10 entry (renamed: "A dispatch that
  reaches a buffer bound off its argument's alignment is refused"); no case names its slug.
- RuntimeFact::AddressAlignment's doc and the mechanism comment.
- The rt README paragraph and FieldValue::BufferAddress's doc.
- docs/REFUSALS.md regenerated (44 rt refusals); api_signatures.tsv gains the variant's row.

Tests (device, under --cfg m2v_gpu or m2v_cpu_icd):
- every_device_refuses_a_bound_address_off_its_alignment (was ..._rounds_a_bound_address_down_...):
  at alignments 2, 4, 8 and 16, each of 17 binds 1 to 15 bytes past a multiple of 16 that the
  alignment does not divide is refused and leaves the buffer unchanged, and the same buffer bound
  at 48 runs. Without the check every one of the 17 dispatches returns Ok.
- an_argument_bound_off_its_alignment_is_refused (was ..._runs_at_the_address_rounded_down):
  the translated vector_word_phases kernels with one argument off its alignment are refused,
  naming the index, offset and alignment, and the command buffer completes with every buffer
  unchanged.
2026-11-18 00:14:00 -08:00
Anees Iqbal a6520161e8 replay: the one-copy Managed placement that came in since takes new_buffer's zero_from
13bb9a0a4e plays a Managed buffer in a block as a plain Shared range where
the recording device kept one copy, written for the old zeroed flag
(false). A placement zeroes nothing, as before: None.
2026-11-18 00:01:20 -08:00
Anees Iqbal 8db74d6f4e rt tests: the zero-fill ordering test's texture takes a granted index
every_device_fills_a_zeroed_private_buffer_before_a_copy_into_it_in_the_next_command_buffer
failed at its last check on every device (3090 m3-max-44735, 2080 44736,
RX 550 44737, lavapipe 44738): it made its texture with no index, and a
texture shaders read or write takes one ("a texture shaders read or write
takes an index, and none was given"). Every ordering check before it had
passed on all four: the bytes zeroed for each zero_from, and every byte of
the span for the four cases of copies into [0, zero_from) and into the
zeroed tail in the command buffer after the buffer's making. The test now
grants one texture index and places the texture at it, and waits for the
gauges to fall after teardown, as the other tests that make textures do.
2026-11-18 00:00:43 -08:00
Anees Iqbal 3ddf146fe1 rt, replay: the callers that came in since take new_buffer's zero_from
development brought three new_buffer callers written for the old zeroed
flag: the replay's staging copy (nothing zeroed: it writes the range
itself, so None), the upload bound test's second fill and the
buffer-to-buffer blit test (zeroed whole, as before: Some(0)). The mapping
is the one the zero_from change used everywhere: true is Some(0), false
is None.
2026-11-18 00:00:42 -08:00
Anees Iqbal 60882b6955 rt: zero only what new_buffer is asked to zero, from a start offset
Documented Metal promises zero only for a buffer from
newBufferWithLength:options:. It is silent on heap memory and on the
bytes a placed texture sees. rt zeroed more: every new allocation whole
(Shared by host writes through the mapping, Private by a GPU fill in a
submission of its own, waited for), every block given back on the
block-maker thread, and then the buffer's range again at new_buffer.
Measured raw call against fill, 16 MiB, at e34c0d0ed7:
- UHD 630: the Private fill is 9.8-11 ms against 0.08-0.10 ms for the
  call. Iris Xe: 2.8-4.3 ms against 0.01-0.11 ms.
- NVIDIA: the call dominates (Shared 2.9-4.0 ms, Private 0.55 ms).

Both whole fills are gone. A taken block's bytes are undefined, new or
taken again. Device::new_buffer takes zero_from: Option<u64> in place
of zeroed: bool. Some(z) zeroes the buffer's bytes [z, length), through
the mapping for Shared, by the upload's fill for Private. None zeroes
nothing (heap buffers, or a range the consumer writes itself), and an
offset at or past the length zeroes nothing. reims's Managed device
copy passes zero_from and copies [0, zero_from) itself, so the head is
no longer filled and then overwritten. Metrics::bytes_zeroed counts the
bytes, a Managed device copy's zeroed tail among them.

With no fill of its own, the filler keeps only the zero source: its
command pool, command buffer and fence are gone, and make_allocation
reads the buffer requirements from the device instead of making and
binding a buffer.

Tests:
- A zeroed buffer zeroes exactly [zero_from, length), counted as the
  buffer's bytes. Shared and Private, offsets of 0, 3, 5, 12, 4000, and
  one past the length.
- A kept block taken again holds its bytes as written. A Private one
  the GPU wrote holds the GPU's bytes, and reads zero only in a buffer
  zeroed over a range of it.
- A zeroed Private buffer's fill lands before a copy into it encoded in
  the same command buffer, for reims. The upload is the first command
  buffer of the next submission and ends with an ALL_COMMANDS/
  MEMORY_WRITE barrier. Cases: copies into [0, zero_from) and into the
  zeroed tail, both holding.
- A texture placed in a block zeroes nothing.
- The harness gains create_private_16MiB: a Private buffer's creation
  plus one command buffer that reads its ends, through to completion,
  checked zero. That time holds the fill, wherever the runtime does it.

The replay's per-frame counters gain bytes_zeroed. README, REFUSALS and
api_signatures are regenerated or updated.
2026-11-18 00:00:42 -08:00
Anees Iqbal b41210d4d2 rt tests: the upload bound test counts the allocations in use, and takes blocks of the bound's length
The upload bound test came to development (5b52afb17b, eb46c7fa2c) written
for the old pool: a Private block of 64 MiB, the upload's bound. Under the
range pool a Private block is 16 MiB, so the released block no longer
filled the bound alone and "a fill past the bound" kept 16 MiB and more
pending: upload.rs:265 on the 3090 (m3-max-44811) and the 2080 (44813),
at b261e44947. The released and filling blocks now ask for UPLOAD_BYTES,
the bound's length, which the test's comment already names; a take that
long makes an allocation of its own.

On lavapipe (44809) and the RX 550 (44814) the test timed out earlier,
waiting for the released textures' allocations to come back to the count
before them. A texture made while earlier ones are still being freed can
take a second 16 MiB texture block (64 textures of 256 KiB fill one); once
empty it goes back to the pool, which keeps the allocation idle for its
window, so the raw count of allocations stays one higher. The test now
counts the allocations in use (all of them less the idle ones, from the
idle-bytes gauges) for that wait and for the copies' ceiling, waits for the
textures and the allocations apart so a timeout names which, and prints
the gauges after the released textures.
2026-11-18 00:00:18 -08:00
Anees Iqbal ca3236b12f rt tests: the idle-freeing test waits for the allocations' gauge, which falls after each free
every_device_frees_idle_allocations_as_the_window_s_peak_falls read the blocks
gauge as soon as the third hook had run and the Shared idle gauge had fallen.
The block-maker thread settles the idle gauge under the pool's lock, then, for
each allocation the idle rule takes out, runs the kept block's hook and only
then frees the allocation and lowers the blocks gauge. So the read raced the
third vkFreeMemory and saw one allocation too many (5 for 4) on the 3090
(m3-max-44731), the 2080 (44732) and lavapipe (44734); a 16 MiB system-memory
free on NVIDIA takes about 17-20 ms, so those legs read inside it every time,
while the RX 550's cheap frees passed (44733). Every assertion before it (the
three oldest unmapped in order, on the block-maker thread, and the idle gauge)
passed on those legs: the rule was right, the test's read order was not.

The test now waits for the blocks gauge to reach the zero source, the reserve,
the fourth and the Private allocation, then checks the three unmaps, their
order and the idle gauge, all final by then. A rule that made or kept an extra
allocation still fails it (the wait times out), and one that freed the wrong
allocations fails the order check.
2026-11-17 23:59:06 -08:00
Anees Iqbal 895b897238 rt: the block-maker thread takes given-back blocks in the order they came back
The pool's returned blocks were a stack: blocks given back while the
block-maker thread was busy were taken newest first, so the emptied
stamps that order the idle rule's frees depended on when the thread
woke. On every device leg (3090, 2080, RX 550, lavapipe at b3dec72137)
every_device_frees_idle_allocations_as_the_window_s_peak_falls freed
block 5 first where it gave back 3, 4, 5, 6 in that order. A queue makes
the allocation emptied first the first freed, whatever the timing.

The texture-over-buffer test took a Shared block of 128 KiB and placed
a Managed buffer at 128 KiB in it: before 16 MiB allocations a small
take was a 16 MiB block, now it is the length asked, rounded to 64 KiB.
It takes the 192 KiB it uses.

Verified: the two tests' failures on lavapipe (44659) and the RX 550
(44663) name these causes; the legs run again on this commit.
2026-11-17 23:59:06 -08:00
Anees Iqbal 406060e78c rt: the allocation length's doc says where the UHD 630's hold lies: the new allocation's zero fill, not vkAllocateMemory
A raw Private vkAllocateMemory on the UHD Graphics 630 (Intel's Windows driver 101.2145) took
0.08 to 0.20 ms at 16, 32 and 64 MiB, three trials each, and round trips on the queue during it
took as long as before it (0.32 to 0.48 ms against 0.36). The 0.4 to 0.75 ms per MiB that rt's
fresh Private take held submissions for is the making's zero fill, the memory's first use.

Verified: potluck job m3-max-44513 (the raw probe at d4a739dd7b, cross-built in m3-max-44352);
cargo fmt.
2026-11-17 23:59:06 -08:00
Anees Iqbal 59bfc85604 harness: its blocks are 16 MiB chunks, the first state's time holds its buffer's take, and rt's allocations on the caller's thread are reported
- The harness's rt heap takes a block of MemoryClass::block_len (16 MiB) when no block it holds
  fits a buffer, the way a guest's allocator takes chunks of that length. Under the range pool, a
  take of the span alone carved 64 KiB, which no consumer does.
- create_state's first now includes the creation of the 16-byte buffer its dispatch writes, so a
  take of memory and the pipeline creation it may hold beside it are timed together, in both
  runtimes.
- Each creation row prints the runtime's allocations on the caller's thread during the first
  creation (count, time, the longest since the device was made), with matrix lines, where the
  runtime counts them (rt: Metrics::consumer_allocations).
- rt counts each class's first allocation in Device::new with the block-maker thread's, as
  allocations made ahead of need, so the consumer's figures start at zero.

Verified: cargo fmt; api_signatures --check passes. Clippy and the rows follow as potluck jobs.
2026-11-17 23:59:06 -08:00
Anees Iqbal add7d98d1f rt: the pool's lints: split_off and append in place of drain, no unused test helper
Clippy (all features, and --cfg m2v_gpu) refused be6c48e94a: a drain into a new Vec, two
extend-from-drain moves, the unused Pool::allocations test helper, and a manual is_multiple_of in
the memory tests. Behaviour is unchanged.

Verified: cargo fmt; clippy follows as a potluck job.
2026-11-17 23:59:05 -08:00
Anees Iqbal d1e9062b5f rt: blocks are ranges of 16 MiB allocations; the block-maker thread allocates only while a class's free bytes run low
The pool handed a take of up to a block length a whole pooled block and kept one ready block per
class, which the block-maker thread made again as soon as a take used it. A 16-byte Shared buffer
took the ready block, and the 16 MiB allocation that followed held the consumer's next pipeline
creation for its whole length on NVIDIA's driver.

Now each block is a range of one of its class's allocations, with its own VkBuffer:
- A take is a kept block of its length, else the first free range that fits, else the start of an
  allocation made in the call: 16 MiB, or the block's own length where that is longer. Lengths
  round up to 64 KiB (or bufferImageGranularity); a block starts at its length rounded up to a
  power of two, up to 2 MiB.
- Device::new makes one 16 MiB allocation per class. After that, the block-maker thread makes
  another only while the class's free bytes are under 8 MiB. A take never waits on it for memory.
- A take that no free range fits, while the class keeps blocks of other lengths, allocates at once.
  It also asks the block-maker thread to give those blocks' bytes back, after the consumer's hook.
  Only when its own allocation fails does it wait for those bytes, then look for a free range once
  more.
- An allocation holding no live block is idle. A class keeps its idle allocations while their
  bytes plus those of its allocations in use stay at or under the most bytes it had in use over the
  last 10 seconds, and within an eighth of its memory type's heap. Past that it frees the oldest,
  except the reserve that keeps 8 MiB free. The rule runs at takes and give-backs on an injectable
  clock; there is no timer.
- Removed: the dedicated path, fits-and-fills-half, the 256 and 128 MiB idle bounds and the 64 MiB
  Private block.
- Metrics: blocks_reused replaces dedicated_blocks_reused. New metrics: block_bytes_made, and the
  vkAllocateMemory time on the consumer's threads (count, total, longest) apart from the
  block-maker thread's.

Tests:
- Unit: rounding, base alignment, and the window and surplus rule.
- On device:
  - the first allocations, and the trigger at 8 MiB free;
  - kept blocks taken again with their number, address and mapping;
  - an allocation beside kept blocks of other lengths, with their bytes given back;
  - the failed-allocation path, at an answered maxMemoryAllocationCount;
  - idle allocations following the window down, the reserve kept;
  - a seeded 300-step stress of mixed takes and releases across both classes, each step under a
    one-minute timeout.
- Tests that took a block of 1 byte and used more of it now take what they use.
- The replay's rt counters read the new metrics.

Verified: cargo fmt; api_signatures blessed; REFUSALS.md regenerated. Clippy, the suites and the
device legs follow as potluck jobs.
2026-11-17 23:59:05 -08:00
Anees Iqbal cee11ce35e harness: a buffer creation row reports the device's first take and the next one apart
create() made its first buffer of the row's length untimed, so a runtime's
first take of memory for that length, which may allocate where later takes
reuse, was hidden in the steady times. The first creation and the second, the
first after the first buffer's release, are now timed and reported apart for
both runtimes: the row's line says 'first take X us, the next Y us', and the
matrix gets harness-<runtime>/<row>/first_take and next_take. Both are checked
zero at every 4th byte as before.

Verified: built by job (pending).
2026-11-17 23:58:56 -08:00
Anees Iqbal 13bb9a0a4e replay: Managed buffers play in the recording device's form, from its identity record or --managed
How a Managed buffer behaves depends on the recording device's hasUnifiedMemory: one copy where
it is true (a CPU write needs no didModifyRange), a GPU copy made at the buffer's making and
changed only by didModifyRange where it is false. The stream did not say which, and the rt backend
always made the runtime's Managed buffer: gb, recorded on a discrete GPU, wrote its no-copy
Managed buffers (#368205, #368202, #368214) once before first use with no didModifyRange, so their
GPU copies never got the bytes; b2, recorded with unified memory, relies on such writes legitimately.

The player now takes the form from the stream's new m2v.deviceIdentity record (it plays as nothing
and tells the backend hasUnifiedMemory through Backend::recorded_unified_memory), or for a stream
without one from command-replay's --managed one-copy|two-copy. One copy: every Managed buffer plays
as a Shared one. Two copies: the runtime's Managed buffer, its GPU copy from the bytes it was made
with: a copied buffer's, or the new create-time bytes a no-copy one's making now carries
(newBufferWithBytesNoCopy's first argument, a no-copy descriptor's contents). A stream with no
identity record gives none, so a no-copy buffer's GPU copy takes the writes recorded before its
first use (the commit of a command buffer whose encoder names it). With neither the record nor the
setting a Managed buffer stops the play with an error saying so. The report's managed line names
the form and its source, counts the Managed buffers and the no-copy ones with contents from first
use, not from create, and notes a two-copy recording played on a unified-memory device.

REPLAY-STREAM.md documents the identity record, the create-time bytes and the player's rule.
Verified: a replay test plays an identity record as nothing and sees the backend told
hasUnifiedMemory; the rt paths need a device play (gb on the 3090 next).
2026-11-17 23:55:48 -08:00
Anees Iqbal b1eeec6981 rt blit tests: the buffer-to-buffer copy test prints which form each device's Managed buffer took
So the leg output shows the device-copy form ran where the Shared memory type
is not device-local, rather than leaving it expected (main's ask after the
b2b legs).

Verified: the legs print it.
2026-11-17 23:45:50 -08:00
Anees Iqbal 2868c3946d rt error: the BufferCopyOverlap variant and its Display arm closed again after the rebase over the b2b copy
Rebasing the render encoder over 3201e09737 put both sides' Refusal
variants after HeapTexturePlace; the resolution kept both but dropped the
closing "}," of BufferCopyOverlap and the ")," of its Display arm, which the
two sides shared outside the conflict. The file did not parse
(signatures.py --check fell back to the translator's Limit). REFUSALS.md is
regenerated from the repaired file; signatures.py --check passes.

Verified: signatures.py --check rc=0 and refusal_surface.py locally; the
lint job compiles it.
2026-11-17 23:45:50 -08:00
Anees Iqbal e7f7f22940 rt render pass: the descriptors without Debug (Texture has none), the translator's aspect flags, profile limits by their accessor
Lint m3-max-44560 at 619f22dc36 failed to build: the attachment descriptors
derived Debug over Texture, which has none; the stencil format check compared
the translator's ImageAspectFlags with ash's; the profile's limits are a
method; the action-mapping test printed ash enums, which carry no Debug here.
The color attachment descriptor's Default is now derived (its fields' defaults
are Metal's), the view lookup copies the kept view out before the push, and
the api_signatures table is re-blessed for the dropped derives.

Verified: the rerun lint is the check.
2026-11-17 23:45:50 -08:00
Anees Iqbal 4d1b0bf113 rt: the render encoder, one dynamic rendering a Metal render encoder with its load and store actions one to one
CommandBuffer::render_command_encoder(&RenderPassDescriptor) is
renderCommandEncoderWithDescriptor:. It begins one vkCmdBeginRendering (dynamic
rendering, in the floor: floor.rs requires vulkan13.dynamicRendering) into the
pass's attachments, and end_encoding ends it with vkCmdEndRendering. Load and
store actions map one to one (Load/Clear/DontCare, Store/DontCare). A clear
color is a float in a float, normalized or sRGB channel (the device converts
it), and an integer channel's is truncated toward zero and saturated, NaN 0,
as Metal's; rotated formats and A8Unorm held in R8_UNORM go through the
format's rotation; a clear stencil keeps its low 8 bits. The render area is the
smallest attachment's level, cut to renderTargetWidth/Height where set.

Each attachment is one level and slice of a 2D texture, 2D array, cube or cube
array of one sample: the texture keeps an identity-swizzled image view of that
level and layer, made at the first pass and freed with the texture through the
reaper (new gauge attachment_views). A pass orders itself as a blit copy does,
two barriers: the first after every earlier command, moving shader-read-only
homes to the attachment layout (general and attachment homes render in place)
and paying an owed barrier; the second after the rendering, moving them home
and making the writes visible to every later command.

Refused as Metal's validation stops them: Refusal::AttachmentUsage,
AttachmentPlace, AttachmentFormat; past maxColorAttachments,
Limit::ColorAttachments. Not built, Gap::RenderPass naming RenderPassKind: a
depth attachment, more than one sample, a resolve, a 1D or 3D attachment, the
Unknown and CustomSampleDepthStore store actions, a clear of a format only a
shader clears, a pass with no attachment. The replay streams' passes (pass
census over gb and b2, counts only): one or two color attachments plus a
stencil in 11,187 of them, every attachment a level of a 2D texture of one
sample, no depth, no resolve, loads Load/Clear/DontCare, stores Store/DontCare.

Tests: tests::pass's host tests pin the action mapping and the clear values;
on_device clears a mip level of a shader-read texture (moved and back), an
integer texture and a stencil, loads and keeps, cuts the area, clears one
slice of a 2D array, and counts one pass alone as one submission, three
barriers, one pass and no bytes copied; each view is made once and freed with
its texture; refusals leave the command buffer open. README render encoder
section and known gaps; REFUSALS.md and api_signatures regenerated.

Verified: the lint job and the device legs are the check.
2026-11-17 23:45:50 -08:00
Anees Iqbal 669358f707 rt README: an index past a set 1 array's length is a known gap beside the bad address
A kernel indexes the heap arrays with the resource ID's index as given, with no
clamp, so an index past an array's length (a Texture-class index of 4,096 or
more through the 4,096-element storage-image array, for one) reads a descriptor
from past the array: undefined in Vulkan, as Metal leaves an ID naming no live
resource of the access undefined, and it can fault as a bad address does. The
planner ruled it a README gap in the bad-address class, with no clamp.
2026-11-17 23:42:57 -08:00
Anees Iqbal eb46c7fa2c rt tests: the upload bound test reads the upload's own count at the bound, not the device's submissions
The block-maker thread's zero fills of the blocks it makes and is given back
are submissions too, and come when they come: on llvmpipe one came inside the
fill-at-the-bound step (check m3-max-44699: 15 submissions against 14). The
upload's pending bytes say what the step asks: the released block still counts
at the bound, and past it the send starts the count again.
2026-11-17 23:37:22 -08:00