Commit Graph
274 Commits
Author SHA1 Message Date
Anees Iqbal 83ecf464ec Make a long new host-visible buffer in fresh pages imported by pointer, with nothing written
Content: the tree of `development` at 12606c508c, unchanged.
2026-10-26 13:19:04 +02:00
Anees Iqbal 44f56137e3 Time host_ab's held new buffers and their first CPU write in the memory workload
The steps this packet landed as, in order:
- Time host_ab's first GPU fill of held new buffers, each set held to the end
- Let host_ab run the memory workload's parts alone

Content: the tree of `development` at b41eddf02b, unchanged.
2026-10-26 13:19:04 +02:00
Anees Iqbal 3d9304798d Add host_ab's icb workload: a kernel writes compute commands that a second encoder executes
The steps this packet landed as, in order:
- Run GPU-written compute executions on the GPU alone by indirect dispatches where the device has no generated commands
- Run a concurrent encoder's GPU-alone execution with no barrier between its commands

Content: the tree of `development` at 343b1abcb4, unchanged.
2026-10-26 13:19:04 +02:00
Anees Iqbal b073ccfa4e Read only the slots calls changed when a draw brings a stage table in place
Content: the tree of `development` at 9cbf7c95db, unchanged.
2026-10-26 13:19:04 +02:00
Anees Iqbal f864c34b29 Replay GPU-encoded draws on the device: replay-bound vertex and fragment functions and a draw preprocess
Content: the tree of `development` at bd0d482965, unchanged.
2026-10-26 13:19:04 +02:00
Anees Iqbal cb72ae8d51 Retain an argument table's object once per encoder, whichever slot binds it
Content: the tree of `development` at 9a0e3e697b, unchanged.
2026-10-26 13:19:04 +02:00
Anees Iqbal 7b5fc45e15 Add host_ab's burst workload: calm frames and bursts measured apart
The steps this packet landed as, in order:
- Keep the recycler's proven parked objects through a run of one-off makings
- Remember usage answers by hash, 1024 of them, least recently asked going first
- Pin the runtime sources after the recycler's protected eviction and the usage answers' LRU
- Regenerate the refusal surface at the merged tree

Content: the tree of `development` at bde1abe95b, unchanged.
2026-10-26 13:19:04 +02:00
Anees Iqbal b8dcbe21bc Hold every plain static threadgroup array as a typed object, indexed by its GEP's own operands and clamped by min
The steps this packet landed as, in order:
- Set the runtime version and pin the runtime sources at the merged tree
- Bless the golden output hashes at the merged tree
- Bless the authored compile census at the merged tree

Content: the tree of `development` at 5c643dcf7d, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal a81fe9a689 pipeline_creation: expect two pooled makings on every device, the 16-bit normalized classes keying apart
The steps this packet landed as, in order:
- State the view base alignment in MoltenVK's shapes too, so a run's plan is the executor's

Content: the tree of `development` at 10590d481a, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 651dcbd8f4 Read which commands a function may write into indirect command buffers
The steps this packet landed as, in order:
- State what an indirect command buffer's records may hold, from every route that writes them

Content: the tree of `development` at 9a885fa69c, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 01550595a0 Expect a BGRA8 or RGBA8 shadow's merge to fetch on every device in the pitched-surfaces lane
Content: the tree of `development` at 24e981a489, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 21f996955f Add the hwd_half_reads fixture's golden printout and its engine inventory rows
The steps this packet landed as, in order:
- Pin the runtime sources after a full-cover blit's shadow overwrite

Content: the tree of `development` at 90297e91c2, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal a1c24843d3 Print host_ab's submission counts: completed waits, bare starts, submit infos, finales, pending depth
The steps this packet landed as, in order:
- Composite window surfaces over host pages in host_ab's drag
- Upload window contents into the composited surfaces in host_ab's drag
- Take no copy in and no keep for a blit copy into every texel of a heap shadow

Content: the tree of `development` at c7c1499d07, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal d564d7836f Order a blit encoder's untracked uses by key and range, not as one class
The steps this packet landed as, in order:
- Pin the runtime sources after the blit commands' byte-range order
- Regenerate the refusal surface at the merged tree

Content: the tree of `development` at 1f2b48f345, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal fa19bdd391 Check every half bit pattern through a kernel's moves on every profile
The steps this packet landed as, in order:
- Read a half by the device's widening on MoltenVK where no use reads a NaN's bits
- Set the runtime version at the merged tree
- Bless the golden output hashes at the merged tree
- Bless the authored compile census at the merged tree

Content: the tree of `development` at f9408d00e6, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal bd4499fcd3 Count a typed threadgroup half array's volatile accesses as one each, and keep the arena's covered
Content: the tree of `development` at fc574f50aa, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 07d517d728 Leave the assumed-unmeasured flag out of a profile's capability members
Content: the tree of `development` at e4d849cdd8, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 644e055652 Keep a GPU pool's blocks while in use, and release a command buffer's own objects after its handlers
The steps this packet landed as, in order:
- Count the most GPU pool blocks leased at once
- Share one GPU pool block per queue among its command buffers
- Keep an arena's fitted list on the pools a completing command buffer takes out

Content: the tree of `development` at 0a94bc93a0, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal c1e9b6b2b9 Name a line pipeline's record as its triangle sibling's, so its making converts nothing again
The steps this packet landed as, in order:
- Read no data back from a making the driver found in its record, which MoltenVK rewrote each time
- Hash with sha2 0.11, which runs SHA-256 on ARMv8's SHA2 instructions

Content: the tree of `development` at 457e874745, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 62370dc95a Fetch a BGRA8 or RGBA8 shadow's texels through its own view in cut merges
Content: the tree of `development` at ed95238f3d, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 7f28814948 Destroy a block's buffer of addresses with no vkQueueSubmit under way, and make no buffer in the memory log
Content: the tree of `development` at ff17d7c868, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 8e6905f816 Merge four words an invocation in the shadow merge kernel
Content: the tree of `development` at 1ef6536d6c, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal b238e202a4 Report the encoding thread's CPU time per many_draws frame in host_ab
The steps this packet landed as, in order:
- Measure a frame shaped as the guest's window drag in host_ab
- Keep up to 256 spare descriptor pools, a window server's frames' worth

Content: the tree of `development` at c4853d8383, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 4d9b17a359 Run a batch's first work in its work's VkSubmitInfo, not one of its own
The steps this packet landed as, in order:
- Count render encoders' render pass instances by where they began, and their splits by cause
- Set the runtime version and pin the runtime sources at the merged tree
- Bless the golden output hashes at the merged tree
- Bless the authored compile census at the merged tree
- Regenerate the refusal surface at the merged tree

Content: the tree of `development` at effa414f26, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 3926ac1204 host_ab: a compositing workload of the consumer's frame shape; count the VkSubmitInfos submitted
Content: the tree of `development` at 89ca6673eb, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal ddd339e2a3 Count released objects by kind and shadow keeps by planner, for the residency churn
The steps this packet landed as, in order:
- Count no-copy imports a live import already holds
- Recycle a texture's image and memory for the next texture of the same making
- Add a control build that turns the image recycler off (--cfg m2v_no_recycle)
- Count image, buffer and memory releases by the place that released them
- Recycle the runtime's buffers and their memory for the next buffer of the same size

Content: the tree of `development` at db877e7a50, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 7ef86a35d8 Hold a kernel's static half threadgroup arrays as typed Workgroup objects
The steps this packet landed as, in order:
- Pin the runtime sources after the typed threadgroup step's doc edit
- Take the device's sin and cos as Metal's fast ones in a fast-math module on MoltenVK
- Write the typed threadgroup region test's module as a plain string
- Convert a plain class's half texel by the device's conversion on MoltenVK
- host_ab: compare each gpu kernel's output between the sides
- Share an imageblock slice write out to the whole threadgroup where one invocation writes it
- Copy a half slice's cell bits straight to a half-bits slot

Content: the tree of `development` at b0e2bd6190, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal d01ed34d37 Add DeviceOptions::assume_unmeasured_identity: run a measured device as an unmeasured GPU
The steps this packet landed as, in order:
- Pin the runtime sources at the switch on the development base
- Blend fast-math colors into BGR10_XR_sRGB and RGB10A8_2P_XR10_sRGB as the linear forms do
- Name a placement heap texture the heap does not make at an offset inside it

Content: the tree of `development` at 3386fdcac8, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal f9ebf83b15 Measure a frame of many small draws in host_ab, shaped as m2vbench's draws mode
Content: the tree of `development` at afac0fda19, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 782f13aa8d pipeline_records: a compute state's dispatch leaves a record per making, its creation's too
Content: the tree of `development` at 0f64c799aa, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal b253a0ad98 Convert a two-plane YCbCr texture only where its planes changed since the last conversion
Content: the tree of `development` at b3c5e804ad, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 4d90c98090 Keep the runtime's own kernels' spare descriptor pools apart from command buffers'
Content: the tree of `development` at e1d60ab9d4, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal 0a7b64f41d Bind the last set 0 again, and settle a dispatch once, where nothing it reads changed
The steps this packet landed as, in order:
- Ask a heap texture's image requirements once, and take owned kernels' sets from spare pools
- Find a replayed draw's pipeline where its state's last draws found it

Content: the tree of `development` at 6f29d4516f, unchanged.
2026-10-26 13:19:03 +02:00
Anees Iqbal fab21259b7 Make a compute state's first dispatch pipeline at its creation, and one form per key on MoltenVK
Content: the tree of `development` at 52fe66739d, unchanged.
2026-10-26 13:19:02 +02:00
Anees Iqbal c356f8d13d Check a host step's commands from the records it read, without reading them again
Content: the tree of `development` at 412587dab0, unchanged.
2026-10-26 13:19:02 +02:00
Anees Iqbal f6442761df Let an indirect command buffer's execution check the commands its host step records
Content: the tree of `development` at 480957f307, unchanged.
2026-10-26 13:19:02 +02:00
Anees Iqbal 3a02b6330a host_ab: feature kernels, a host-clock latency split, and per-variant encode runs
Content: the tree of `development` at 61b5179154, unchanged.
2026-10-26 13:19:02 +02:00
Anees Iqbal 9810aff5e0 Add a host A/B benchmark: the same Metal workloads natively and through the runtime
Content: the tree of `development` at 6d4bcda22f, unchanged.
2026-10-26 13:19:02 +02:00
Anees Iqbal a2c440b8bc Drop the ban on behavior keyed to an earlier session from AGENTS.md
The owner lifts it: a device may keep what it checked or learned about
itself in an earlier session (its driver's answers and defects, checked
on the device). The bans on keying behavior to an app, a shader hash or
a corpus census stay. Doc-only; cargo fmt --all run.
2026-10-19 02:43:05 +03:00
Anees Iqbal 62cad6be54 Regenerate the tables and set the versions at the landed tree
The generated and blessed files, and the three version constants, as of the tree this series ends
on. They come last so that no packet commit before this one claims a version or a table, and so
the final tree is exactly the tree verified at the tip.

- docs/REFUSALS.md regenerated.
- crates/metal2vulkan/tests/golden_hashes.tsv and the air_input printouts as blessed (the table
  tests 25 of 25 on the M3 Max host, with xcrun metal-as for the typed-pointer fixtures).
- crates/metal2vulkan-validation/corpus/authored-compile.tsv as blessed: 2256 authored cases on 21
  profiles, 47376 cells, 46245 compiled and 1131 refused, 0 failed, 0 differences, 0 regressions.
- crates/metal2vulkan-validation/runtime-sources.sha256 recomputed.
- SEMANTICS_VERSION 1798, RUNTIME_VERSION 1496, ARTIFACT_FORMAT_VERSION 431.

Verified at this tree: the full suites on the RTX 5080 Laptop, RTX 3090, RX 7900 XTX, Radeon 780M,
Iris Xe and the M3 Max through MoltenVK, the CPU suites (product, validation, lavapipe's CPU ICD),
fmt, clippy in every configuration, rustdoc, the API reference and refusal-surface checks,
packaging and doctests; the failures those runs found were fixed in this series and their lanes
run again green.
2026-10-19 00:16:01 +03:00
Anees Iqbal 58cea0eaa7 Time the scheduler's take-up apart from the driver's submit, and allow the storm tail the host's delivery
New WorkCounts::batch_submit_nanos times each vkQueueSubmit, and the take-up tests bound only the
scheduler's own time: the long take-ups on the RTX 5080 were inside the driver's call. The queue
storm's p99 may exceed the reference's by its margin plus twice the reference's own completion
delivery, for the runtime's two extra host hand-offs per burst.
Verified: the 5080 under load, 22 of 22 (the old bound would have failed 11); the storm on the M3
quiet and under eight default-QoS spinners.

Folds in:
- Time the scheduler's take-up of checked commits apart from the driver's vkQueueSubmit
- Allow the queue storm's tail the host's delivery of a completion for the runtime's two extra hand-
  offs
2026-10-19 00:16:01 +03:00
Anees Iqbal 24d5b9a432 Give each translator test its own allocation count and scratch directory
Under cargo test, whose tests run as threads of one process, three footprint tests counted every
thread's allocations and tests sharing a process-id-named scratch directory deleted each other's.
The counting allocator now counts the measuring thread alone, and one Scratch helper gives each test
a directory of its own, removed on drop, at the 42 sites that named theirs by process id. Test-only.
Verified: two full cargo test runs with no scratch failures, and the touched tests under nextest.

Folds in:
- Count the translator tests' allocations on the measuring thread alone, so cargo test's threads
  leave them alone
- Give each of the translator's tests a scratch directory of its own, removed on drop
2026-10-19 00:16:00 +03:00
Anees Iqbal 33e89bd482 Fit mesh, compute and tile pipelines to ANV's compiler word bound
On ANV a pipeline whose largest stage module passes 400,000 words under the exact forms is
retranslated with those forms dropped until it fits; render pipelines already were, and now mesh,
compute and tile pipelines are too, announced as exact-forms-over-compiler-limit with the kind of
pipeline state named. New Device::fit_mesh_variant, fit_compute_pipeline and fit_tile_pipeline for
pipelines linked from stages compiled ahead. The known gap is gone from docs/FAST-PATHS.md.
Verified: the fit tests for every kind, 188 translator and runtime tests and the device notice tests
on ANV, and 7 of 7 on RADV.

Folds in:
- Fit mesh, compute and tile pipelines to ANV's compiler word bound
2026-10-19 00:16:00 +03:00
Anees Iqbal 0a34e8c743 Read a per-sample fragment function's pixel reads where Vulkan evaluates them, noted, as Metal accepts them
A fragment function that runs per sample (programmable blending reads its attachment) and also reads
[[position]] z or w, [[point_coord]], [[barycentric_coord]] or a centroid varying was refused at
link; Metal accepts it and reads each as the pixel's in every sample's run (M3 Max at 4x, measured).
These reads now read where Vulkan evaluates them for the sample, with
PrecisionNote::MultisamplePosition and its bound (the value's change over half the pixel's diagonal,
or across the covered area for a centroid varying). Chromium's Skia Graphite on Dawn (Claude
Desktop) made such pipelines. The new test shader is its own fixture, engine/multisample_fetch;
engine/multisample is unchanged.
Verified: the guest's pipelines compile on six profiles and Claude Desktop draws in the macOS guest
on the RTX 5080 with no fatal line; the multisample, point_coord and link tests fail without the
change and pass with it.

Folds in:
- Read a per-sample fragment function's pixel reads where Vulkan evaluates them, noted, as Metal
  accepts them
- Move the programmable-blending fixture entry out of engine/multisample into a fixture of its own
2026-10-19 00:16:00 +03:00
Anees Iqbal 84ba0af335 Record a lavapipe dispatch of a variant that bakes samplers in its own command buffer
lavapipe samples a binding with a baked immutable sampler as Repeat when the dispatch follows a copy
in the same VkCommandBuffer. New RuntimeDriverDefect::ImmutableSamplersLostAfterCopies, on every
lavapipe release: there an encoder's dispatch of a variant that bakes samplers records in a command
buffer of its own; WorkCounts::baked_sampler_dispatches_apart counts them.
Verified: the YCbCr constexpr test on lavapipe 26.0.8, 3 of 3 (3 of 3 failing without the fix), and
on 26.2.4; the related lanes 40 of 40 on each.

Folds in:
- Record a lavapipe dispatch of a variant that bakes samplers in its own command buffer
2026-10-19 00:16:00 +03:00
Anees Iqbal e320a1f475 Drop design-record, work-package and evidence codes from comments, and retire vk12-bare from the corpus
Comments, fixture notes and docs lose their design-record numbers, work-package codes and evidence
codes; lines that earlier commits of this series added carry their cleaned text there, so this
commit holds the cleanup of lines that predate the series, the retired vk12-bare profile's corpus
rows (a rationale and two observation rows), and docs/FAST-PATHS.md's measurements stated as they
stand. Thirteen hash-keyed files keep their citations, because their bytes are case or record
identities: eight case-keyed .ll fixtures and five parity sources.
Verified: the CPU suites (4997 of 4997 and 1328 of 1328), clippy, rustdoc and doctests.

Folds in:
- Drop evidence codes, design-record numbers and work-package codes from comments and fixture notes
- Drop the retired vk12-bare profile from the corpus
- Say the fast-path ledger's measurements as they stand, without commits, rounds or host incidents
- Keep the case-keyed .ll fixtures byte for byte
- Keep the parity lanes' fingerprinted sources byte for byte
2026-10-19 00:16:00 +03:00
Anees Iqbal affd8a5eb7 Split an interlocked pass at the fetch on every GPU, and delete the whole-pass reroute
The UHD 770's cost fact said an interlocked pass ran faster kept whole; measured again, splitting at
the fetch wins on every measured GPU (UHD 770, Iris Xe, Radeon 780M, RTX 3090, RTX 5080 Laptop) on
the window server's passes, so the UHD 770 carries InterlockedPassSplitNoSlower like the rest. With
no device keeping a pass whole, the whole-pass reroute is deleted:
DriverFact::InterlockedPassWholeFaster, RenderCommandEncoder::reroute()'s whole branch and
interlocked_colors(). The extended-range half shadow's draw keeping stays.
Verified: the framebuffer_fetch, extended_range and multisample lanes on all seven GPUs, 271 of 271
each.

Folds in:
- Run an interlocked pass split on the UHD 770 as on every GPU measured, by the corrected cost fact
- Delete the whole-pass reroute, which no device reaches since the UHD 770's fact was corrected
2026-10-19 00:16:00 +03:00
Anees Iqbal a95b37d56d Read a calibration pair again while its least deviation stays above 20 us, four readings at most
A GPU-time calibration re-reads the CPU/GPU timestamp pair while the best reading's deviation stays
above 20 us, up to four readings, so a preempted vkGetCalibratedTimestamps under load no longer
skews it.
Verified: the gpu_times lane on the RX 7900 XTX and lavapipe, 11 of 11; the four-reading case by its
unit test.

Folds in:
- Read a calibration pair again while its least deviation stays above 20 us, four readings at most
2026-10-19 00:16:00 +03:00
Anees Iqbal 6898b52edf Hold freed memory for the program's own with_vk_queue submissions, and tear the device down on its own thread
On drivers that park freed memory (MoltenVK among them), memory freed while the program's own
with_vk_queue submissions may still use it now waits for them, by a mark each use signals. The watch
of those marks and the release of freed memory hold only the device parts they use, never the
device, and teardown closes the parking first and waits for the handler threads: the program's last
drop tears the device down on its own thread before it returns, as Metal's last release does
(vkDestroyDevice needs external synchronization and every child object destroyed first).
freed_memory.rs is listed among the modules that may keep the device's functions, with that reason.
Verified: the freed-memory and teardown tests on ANV, lavapipe and the M3 through MoltenVK (14 of 14
each), the two teardown tests fail without the fix, and the presenting test that crashed in the
batch passed 20 of 20 on the M3.

Folds in:
- Hold MoltenVK's freed memory for the program's own with_vk_queue submissions, by a mark each use
  signals
- Hold nothing of the device in the watch of the program's marks and the releases of freed memory
- List freed_memory.rs among the modules that keep the device's functions
2026-10-19 00:16:00 +03:00
Anees Iqbal 8b5d74d9aa Round exact fetched blends to half by the controlled conversion, and code 8-bit values in float
The exact in-shader fetched blends round to half by the controlled conversion and decode and write
8-bit codes in float, which keeps Metal's stored bytes while dropping the integer paths.

Folds in:
- Round the exact fetched blends to half by the controlled conversion, and decode and write 8-bit
  codes in float

Verified by each folded change's own checks; the tree this series ends on is the one verified
at the tip on six GPUs, the CPU suites and lint (see the tables commit).
2026-10-19 00:16:00 +03:00