Commit Graph
28 Commits
Author SHA1 Message Date
Anees Iqbal ed70015809 🐛 Answer nil where the runtime refuses an object for a gap
On the Vulkan platform, a runtime refusal at a creator for a gap of its own
or of the device's (Unsupported, but by a GPU family or a device Metal
itself refuses it on; NotImplemented; AppleOnly; a compile's Unsupported)
ended the process at the creator, where Metal makes the object. A Flutter
app's BGRA10_XR render pipeline on an RTX 5060 Ti took a macOS guest down
this way (Unsupported { feature: Format, needs: NotImplemented }).

Behaviour change, for the guest and the host: by default the creator now
answers nil, a pipeline state or a library creator with the runtime's
refusal as its NSError, so core's nil-without-error death never fires;
textures, views, buffers, heaps, functions, sampler and depth-stencil states,
argument encoders, indirect command buffers and rate maps answer nil. Apple's
guest framework then fails the work that names the object, as where Metal
answers nil: what was a VM going down is that exec faulting. In strict mode
(REIMS_VGPU_STRICT=1) each still dies at its selector with the same line.

This keeps the owner's rule on runtime gaps: the gap stays visible, relayed
as the new kind inexact-refused-create (the first of its kind writes a line
naming the refusal and the descriptor's formats, each one is counted) and a
death in strict mode, and it is handed to metal2vulkan. Nothing here makes
the missing feature. A lost device, a Vulkan failure, no memory, an answer
the runtime cannot prove and every other refusal still die at the creator.
The library's own pipelines and shader library are unchanged.

The kind is placed in every_inexact_kind_is_placed_once, the placement test
of this platform's own kinds, which also checks its code is no runtime
kind's. The accuracy ledger lists it.
2026-11-05 21:59:35 -08:00
Anees Iqbal d225c9528f ⬆️ Build on metal2vulkan 52969c03d7's runtime
Pin move 14: stacks 28 to 30 on top of c7d79b43ef, in place of pin 13.
RUNTIME_VERSION 1769.

A host-replayed indirect command buffer keeps a step's chunks where two steps
read its records alike, draws whose plans list the same resident uses share
them, and a host step compares and decodes its records in place: on the RTX
5080 Laptop GPU the renderBundles page's host step took about 8.9 s a frame
at pin 13, 35-40 ms after stack 29, and about 33 ms after stack 30's cuts
(the runtime's measurements, the last before its own last two steps). A
device-local allocation that fails lies in system memory instead, announced
(device-memory-overflow, a performance kind). A pass that reads the clear
alone before any draw reads a copy cleared to it instead of splitting the
pass. A new Private texture starts as the Mac the device presents keeps it
(DeviceProperties::lossless_compression). On MoltenVK, whose blits through two
imports of the same pages are not ordered, a no-copy object over a guest RAM
chunk binds in the chunk's import. A batch waits for a staging submission only
where no earlier batch on its VkQueue did. A half read through an argument
buffer keeps the texel's half bits. A mesh the device draws takes its mesh
type's primitive, so a mesh of filled triangles draws no line.
max_buffer_length is three quarters of the largest device-local heap, rounded
down to 16 KiB: the RTX 5080's answer falls from 2^40, and the M3 Max's under
MoltenVK stays Metal's own 41,747,087,360, below its 48 GiB bound. The
graphics lane already answered at most three quarters of the device-local
heaps' sum.

New notices: device-line-ties at each draw of width-1 lines on a driver not
measured to break a diamond-vertex tie as Metal does, device-subpixel-snap at
each draw the band draws on a driver not measured to snap a half 1/256-pixel
step up, and device-nan-encoding for every half colour output to a half-float
channel on NVIDIA. MoltenVK on the M3 Max announces none of these anew: it
takes both facts, and it already noted every such half output.

The API grows by Degradation::DeviceMemoryOverflow, DeviceLineTies and
DeviceSubpixelSnap; RuntimeDriverDefect::AliasedImportBlitsUnordered;
DriverFact::LineTiesAreMetals, SubpixelSnapIsMetals and
ColorClearTakesEitherCode; DeviceProperties::lossless_compression and
MacClass; GraphicsState::mesh_corners; DriverDeviation and VkProperty
MetalUnaryDenormals; WorkCounts' new counters (device_memory_overflows,
attachment_read_clears, resident_uses_again_checked among them);
RecordView::record_into; and Device's Drop and hand-written Clone. It loses
VkProperty and DriverDeviation::MetalHalfColorNans, which nothing here used.

Cargo.lock is unchanged: the runtime's manifests are the same at both commits,
and the lock keeps its metal2vulkan source lines stripped.

The new kinds are placed by answer.rs's rules:
- device-memory-overflow is relayed, by its Exact statement.
- device-line-ties dies where its tie is not measured on MoltenVK, and a
  native device relays it, on the rule for native devices: the pixel a width-1
  line covers at a vertex two pixels' diamonds share is the driver's, which
  Vulkan's open diamond leaves to it with no control over it, and its only
  exact form is Metal's line rule run in the fragment function, an
  interpreter's. Every width-1 line draw on NVIDIA, lavapipe, RADV and ANV
  announces it.
- device-subpixel-snap dies on every device, as wide-edge-depth-bias does: the
  band is the runtime's own, and its endpoints snapped to Metal's grid before
  it offsets them would leave the rasterizer nothing to round, so the hardware
  allows the exact form. Only a band draw announces it, which on a native
  device under the default is a line below 1/16 pixel or past lineWidthRange.
- device-nan-encoding moves from what stays a death on a native device to what
  it relays, in the class of a native device's own maths and sampling: it
  differs in a NaN's bits alone, and there the runtime gives the device's NaN,
  its native form, and builds no path to Metal's bits where the device has one
  (its rule since 79166a74b1), as native-nan-encoding and
  device-texel-conversion's NaNs are relayed already. It still dies on
  MoltenVK. The placement test's list of the kinds that stay deaths on a
  native device loses it and gains device-subpixel-snap.
The accuracy ledger lists the device's width-1 lines among the device's own
answers and the band's snap under the wide_lines form.

Outside strict mode no new kind ends a run: a kind of DIES is relayed and
counted, and none of these is of DIES_BY_DEFAULT. The last good boots on the
RTX 5080 already relayed device-nan-encoding, at a draw that binds an
RG16Float texture, and relayed no kind of line.

Two tests pinned the runtime's old answers, and take its new ones:
- refused_icb_records_die_naming_the_execution: the runtime holds a commit's
  refusal of the records of a buffer the command buffer made resident for
  writing for the command buffer's host step, as a command buffer of another
  queue that this one waits for through an event, encoded after the commit,
  may still write the records before the work runs, and Metal runs what it
  wrote. Such records die as the command buffer ends, at the execution's
  selector, as at pin 11; records only the CPU wrote die at the commit, as
  before.
- the_default_filter_samples_within_its_bound_of_metals: the runtime gathers
  a two-plane 4:2:0 texture's planes in place too, so on MoltenVK a function
  that samples and gathers a YCBCR8_420_2P texture reads them in place: its
  floats and halves are Metal's bit for bit, and nothing that dies is
  announced (measured on the M3 Max). Its _sRGB twin keeps the default
  filter, within its bound, and dies of ycbcr-filter-not-exact in strict
  mode as before. The test gathers every observation before it asserts.
2026-11-05 21:59:33 -08:00
Anees Iqbal f1c0dc8cad ⬆️ Build on metal2vulkan 209b375767's runtime
Pin move 7: the draw-fast round and stack16 on top of 9ec100ba7c. A kept
draw is drawn again with only its rebound slots rewritten after buffer,
offset, bytes, texture and sampler binds; recorded commands are counted in
per-thread shards; a rebind counts only the stage tables it reads. VkQueue
sharing now marks a queue long by its command buffers' own GPU time, and a
device without calibrated timestamps does not share. RUNTIME_VERSION 1752.

The accuracy ledger's queue_sharing row now says a device without calibrated
GPU timestamps does not share.
2026-11-05 21:59:26 -08:00
Anees Iqbal 55cdab6483 ⬆️ Build on metal2vulkan e71efbe0e9's runtime
metal2vulkan e71efbe0e9 is c8a0481cf8 plus three stacks (RUNTIME 1747):
- Command queues share VkQueues where the device's own check finds the GPU
  idles at each switch between queues (the 5080), with an unshared form for
  a queue that must never wait behind another's long command buffer:
  new_command_queue_unshared. The graphics lane's WindowServer queues
  (RGFX_QUEUE_UNSHARED) now take it through unshared_queue, which made the
  plain queue until the runtime had one; on a device that shares no VkQueue
  it is the queue every create makes. The runtime's exact answers keep every
  queue on its own VkQueue, so REIMS_VGPU_EXACT gains queue_sharing
  (QueueSharingPolicy::PerQueue), with its accuracy-ledger row; docs/api.md
  now also lists extended_range_blits there.
- Noted textures' pattern reads and writes are logged once each, with no
  allocation per draw.
- A command buffer joins its ended encoders' resources into its residency
  where its work reads them, not as each encoder ends (end_call with 4096
  resident: 205 to 7.2 us on the RTX 5080); a sampler state's creation prunes
  the live states' map only once it has doubled (1.97 to 0.56 us at 1000
  live, 16.75 to 0.48 us at 10000, on the M3 Max); a commit counts its
  buffers' host imports in place, and the translator's spec_key makes its
  lists once.
2026-11-05 21:59:25 -08:00
Anees Iqbal 1aef0afbcc 📝 Record the cost of extended-range blits in Metal's encoding [ci skip]
metal2vulkan measured DevicePolicy::extended_range_blits Canonical against
Kept on the RTX 5080 and on the M3 Max under MoltenVK. Every blit costs
measurably more, up to 3x on a Shared 2048x2048 copy out, so by the
ledger's rule the accurate form stays behind its switch. The row now
carries the numbers in place of "not measured".
2026-11-05 21:59:21 -08:00
Anees Iqbal e2d5416387 ⬆️ Build on metal2vulkan cd578f9cbc's runtime
The runtime brings two things here.
- The video API: extra queues, shared-event waits and signals through
  the event's timeline semaphore, textures over a plane of the caller's
  multi-planar image, and where a no-copy buffer's bytes lie in the
  device's import. It sits behind options nothing here sets yet.
- MoltenVK carve-outs: on the M3 Max under MoltenVK, half and float moves
  through registers and the measured pack conversions are Metal's own and
  no longer record NativeNanEncoding or DevicePackConversion. What still
  differs keeps its note.

It also adds an exact form for extended-range blits:
DevicePolicy::extended_range_blits, Canonical where a blit into or out of
a BGRA10_XR texture Metal keeps compressed is rewritten to Metal's
encoding. Its cost is not measured, so it is a switch, as the accuracy
ledger's rule has it: REIMS_VGPU_EXACT=extended_range_blits, with a
ledger row. The default keeps the bytes the device's copy moves and
announces extended-range-bits-kept, as before. RUNTIME 1731, SEMANTICS
1948. No degradation kind is added or removed.
2026-11-05 21:59:21 -08:00
Anees Iqbal eeeb52f6f0 ⬆️ Build on metal2vulkan 9f5776bf31's runtime
Move the runtime from 7da81ee3d8 to 9f5776bf31. What changes for the guest:
- ASTC HDR textures are made where Metal makes them: native where the device
  decodes them, else in a carrier with a decoded twin of halves. ASTC's 4x2
  and 8x4 footprints are held the same way.
- A pass drops ASTC attachments, and a draw or dispatch that binds an ASTC
  texture at a storage slot binds the slot's neutral, where such bindings
  died before.
- Multisampled packed 16-bit colour textures are held in their word's format,
  where they were refused, and their resolves follow Metal's rules.
- Per-draw work: a draw's shape is kept across scissor changes and carried to
  a later encoder's first draw of the same values. A pass counts its tiles
  only where a count or a clear reads them, and a pass of one instance leaves
  out pass-end work nothing reads.

metal2vulkan commits: b5e51a65 eb6828ad 9193d3e0 3c3681c8 ad8b94cd fbc08602
287319c4 2a8dd25c 68a29658 a37ab781 8f62289f efc3c67b a5a8ddf9 603c78fc
d25c36c7 521c5ee8 19241610 9f5776bf.

Two degradation kinds are new, and both die in strict mode (DIES, 137 -> 139):
WordResolve (a multisampled word-format attachment's resolve, within one code
of Metal's per channel) and AstcStorageNeutral (an ASTC texture at a storage
slot its function writes). Runs of either died or were refused before this
runtime, so placing them there ends no run that went on. The accuracy ledger
has a row for each.

Checks: on the Mac, rustfmt, clippy with the tested features and for x86-64
Linux, and cargo nextest of reims-vgpu-vulkan, reims-vgpu and reims-graphics,
1160 tests: 1047 pass and 113 fail, the same 113 that fail at cd511955f7 on
this Mac's MoltenVK. On msi's RTX 5080, the same packages on Linux, 802 tests:
3 fail, the 3 known NVIDIA encode_render cases (memoryless slot, ICB draws,
protected texture).

Not run: the VA-API leg (the homelab hosts did not answer) and a guest boot.
The change does not alter what device info, GPU families or feature queries
answer. The two new kinds end the process only on runs that died before.

The pinned commit is metal2vulkan's local development, not yet published.
2026-11-05 21:59:21 -08:00
Anees Iqbal 0064af053c ⬆️ Build on metal2vulkan 7da81ee3d8's runtime
The runtime now answers supports32BitMSAA (32-bit integer MSAA textures and
32-bit float resolves, from the device's own formats) and
supportsPullModelInterpolation (interpolant inputs and Metal's
interpolate_at_* functions, lowered to the GLSL.std.450 interpolation
instructions). The Vulkan platform passes both through, where it answered
neither before: the AMD, Intel and M3 Macs all answer yes to both, so a no
was outside every measured Mac. The runtime also draws fill-Lines triangles'
wide edges as bands, and at the nearest width where it refuses a band.

metal2vulkan commits: 7a1dae2b87 be2d725fdb 06f08298fd 130513884f f18cf358da
2376157b3b 70e01b4bd6 e9f45f7c85 2dcbbf39b6 313d45dc1c a27c863842 7da81ee3d8.

Two degradation kinds are new, and both die in strict mode (DIES):
WideEdgeDepthBias (a wide triangle edge under a depth bias, which each band
triangle takes by its own slope) and DeviceInterpolationOffset (a read at an
offset, on the device's offset grid). Draws of either kind died before this
runtime, so placing them there ends no run that went on. The accuracy ledger's
wide-line row now says the band draws triangles' edges too.
2026-11-05 21:59:20 -08:00
Anees Iqbal 15eee48dbc ⬆️ Build on metal2vulkan 45b3427434's runtime
metal2vulkan 45b3427434 is 4ba981e668 plus two things the guest's Metal
reaches. Its encoder draws setLineWidth:'s every width as Metal does (the M3
Max, macOS 27.0.1): floor(16 width) / 16 clamped to [0, 16], width 0 as 1/16,
by the device's own lines or a band of two triangles over each segment. What
neither draws at the width (on MoltenVK, which has no wide lines, a triangle's
edges in fill mode Lines and a mesh draw's lines) it draws by the device's
lines at the nearest width they draw, 1 pixel there, announcing it. A draw of
too few vertices for one primitive draws nothing, as Metal's. And binary
functions linked into a pipeline give plain Metal's answers: a direct call to a
function only binaryFunctions holds fails as an unresolved call, a function in
both lists is made, and one not compiled to a binary fails with Metal's code 2.

The Vulkan platform drew every line 1 pixel wide after another width, and
relayed it (inexact-line-width), or died in strict mode. It now sends the
width to the runtime's encoder, and the relay kind is gone. A new Metal-twin
test draws lines and line strips at widths 1, 3, 2.5 and 0 pixel for pixel as
the Metal platform does on MoltenVK. Its first vertex is white: the flat
vertices' first colour is the clear's black, which hid the line it provokes.
Two tests that died at a draw after a line width now leave what such a draw
draws to the runtime's tests.

The runtime announces two new kinds, placed with the kinds that die: relayed
by default, a death in strict mode. device-wide-lines: a device's own wide
lines that are not Metal's parallelogram (a strict device's rectangle, lines
Vulkan does not state as parallelograms, a width off its granularity), the
runtime's default. lines-at-nearest-width: lines drawn at another width than
Metal's, where neither route draws it. REIMS_VGPU_EXACT's new name wide_lines
takes the runtime's WideLinePolicy::Exact, the band over Metal's
parallelogram, on a device with tessellationShader. The accuracy ledger lists
the trade in place of the 1-pixel row.

A pipeline whose function calls a visible function that only binaryFunctions
holds now answers the guest Metal's code 3, where it was made. The Metal-twin
test of linked functions drops that exception, and adds a function in
binaryFunctions alone and in both lists, compiled to a binary and not. It
makes the binary copy after the cases of the function made by name: while the
copy lives Metal answers one object for both, of options 1 (measured on the M3
Max, macOS 27.0.1), so the cases after it linked the binary where they named
the plain function.
2026-11-05 21:59:19 -08:00
Anees Iqbal c3aac4c217 ⬆️ Build on metal2vulkan 0a1851164d's runtime
Move the runtime from eeb7934025 to 0a1851164d, six commits of
metal2vulkan's development.

What changes for the guest:

- A draw, compute dispatch or tile dispatch whose pipeline the driver is still
  making 4.5 s after its command buffer's commit runs nothing, and the command
  buffer runs on (PipelineWaitPolicy::Bounded, the runtime's default, announced
  draw-dropped-still-making or dispatch-dropped-still-making). A state's
  creation likewise returns after 4.5 s with its predicted pipeline still being
  made. Before, a cold compile (11.59 s on an M2 Pro's MoltenVK boot) held the
  command buffer past the guest's 10 s check of its FIFO.
- A draw whose pipeline the driver failed to make after the draw returned runs
  nothing, and the command buffer runs on (draw-dropped-unmade), where it
  failed before.
- A no-copy buffer, heap or buffer rebind whose import fails (out of memory, or
  a driver out of mappings) is made over a copy of the pages in the device's
  own memory (copied-host-pages), where the call was refused before.
- Nothing else in the span moves what a guest observes. On NVIDIA's driver on
  the RTX 5080 Laptop GPU, the 2.2 to 3.7 ms stall the driver spends in every
  1,024th signalling submit of a queue is taken by empty submits while the
  queue is idle, not by a batch. A discrete GPU zeroes new buffers by a fill.
  A warm render state is linked from its recorded stages. The shader cache is
  keyed by its translator, so a runtime-only change no longer turns it cold.

The four kinds are placed in DIES: by default each is relayed and counted, and
in strict mode it ends the process, where a difference the guest can see
does. Unplaced, they fail every_degradation_kind_is_placed_once.

A strict process, every test of this crate among them, waits for each pipeline
until it is made (PipelineWaitPolicy::Exact), so a slow compile under the
check's load never dies there as a dropped draw. REIMS_VGPU_EXACT names the
same exact form as pipeline_waits, and the accuracy ledger records the fast
form's bound.

A no-copy buffer over host memory with a page not mapped, or mapped without
read access, is answered nil before the runtime is asked, as Metal answers it,
where development asked the runtime and answered nil at its refusal. At
0a1851164d a placed buffer the runtime refuses keeps its range held, so the
next buffer Metal places at that address met a conflict and died (measured on
the M3 Max: no_copy_buffers_over_pages_without_access_are_nil_as_metals).
Those pages are the only refusal there answered without dying, so nothing else
meets the held range. metal2vulkan has the report.

The import gate the runtime now takes (HostMemory::with_import_gate) is wired
in the next commit.
2026-10-29 00:48:36 +02:00
Anees Iqbal 12765ee8ae 🐎 Copy again only the guest pages written since the last copy
Where the Vulkan runtime keeps copies of guest memory in GPU memory (a
discrete GPU's, and an iGPU's whose driver cannot use the guest's pages in
place), it copied each one whole at each use, as nothing told it which pages
the guest wrote. Under KVM the host now gives the device a dirty source, and
the runtime copies only the row bands of the pages written since its copy.

- Core keeps the dirty log: a stamp per watched 4 KiB guest page (8 bytes),
  read without a lock, fed by the harvests and by the library's own writes
  into guest RAM (every GuestPtr write, the IOSurface byte copies, the video
  decoders' lends), each stamped after its bytes land, so a copy racing a
  write takes the page again. With no log a write costs one relaxed load.
  Waits are bounded (about 4 ms) and refuse at once while the device resets,
  pauses, stops or suspends; an answer the log cannot give is a whole copy,
  never a missed write.
- The C API, additively: RvgDeviceConfig's fourth version (72 bytes) carries
  an RvgDirtySource: the KVM VM's fd and four callbacks (start, flush_vcpus,
  for_each_slot, take_host_writes), and rvg_dirty_slot, which for_each_slot
  calls for each logged slot. The device's thread reims-vgpu.dirty
  runs each harvest: the vCPUs' page-modification logs flushed where PML is
  on, one KVM_GET_DIRTY_LOG and one KVM_CLEAR_DIRTY_LOG of exactly the
  watched pages written per slot, then QEMU's own DMA. QEMU's side is 154
  lines (vendor/qemu 01650c7f08).
- The Vulkan platform answers the runtime's DirtyPages per import, in the
  import's offsets, and leaves a shadow's own copy back out of its next copy
  in (REIMS_VGPU_DIRTY_WRITERS=0 counts it). The EFI framebuffer is never
  logged, so the firmware's presents never start the KVM log.
- REIMS_VGPU_DIRTY_PAGE_TRACKING=0 turns the source off.
- The runtime moves from metal2vulkan 0db5825a60 to eeb7934025, its release
  with the dirty-band copies, the discrete GPU's device copies of sampled
  textures and one wait per log per submission. It also fixes the MoltenVK
  failure the owner hit on the M3 Max with a macOS 26 guest ("Vulkan failure
  -3 (the pipeline of draw 0 of the command buffer's render encoder 0)" after
  a 4K HEVC decode): Core Animation's fragment that samples the in-place
  Y'CbCr texture in a loop had its push field's uvec4[2] materialized with an
  OpCopyObject, whose SPIRV-Cross copy Metal's compiler refused; 751c861c15
  copies it element by element. And it takes the device's native forms: its
  own depth bias on every depth format, its store of an extended-range,
  padded 10-bit or bfloat attachment's untouched texels, a half colour output
  declared 16-bit where the device enables storageInputOutput16, and its own
  Y'CbCr conversion for 4:2:2 twins and planes read in place. Its semantics go
  from 1907 to 1911, so every cached shader compiles again on the first boot.
- With the runtime's unused-bits load pass and its capture replay gone, a
  pass that loads and stores such an attachment keeps the bytes its draws do
  not write, and each draw announces extended-range-bits-kept; the
  unreached-tiles-rewritten kind is gone. The Vulkan platform's answer table,
  its tests of the extended-range formats and its docs follow, and the test of
  the captured reach goes with the machinery.

Measured on an RTX 5080 Laptop GPU with an x86-64 macOS 26 guest
(docs/qemu.md, "Linux hosts: the dirty source"): a window drag at 3840x2160
went from 18.0 to 26.1 fps with 439 MB a frame host to GPU, from 938; at
1680x1050 the drag stays at about 56 fps with 98 MB a frame, from 182, and
SM use 46%, from 65%. Pixels are unchanged. Nothing changes on macOS, nor
where the runtime uses the guest's pages in place.
2026-10-28 21:55:55 +02:00
Anees Iqbal c8ec271abc ⬆️ Build on metal2vulkan 0db5825a60's runtime
Move the runtime from a759d0e88f to 0db5825a60, metal2vulkan's development
re-cut into one commit per work packet (tree 22aab1ece6, the same as its linear
history's d0f1b87e2e, which is the public repository's development; 0db5825a60
is not on it yet). Runtime version 1648 to 1681, semantics 1907, artifact format
475; its runtime sources pinned as 4314cee1. Every cached artifact and plan is
made again.

What changes for the guest:

- Answers come from one macOS release, 27.0.1, on every host. MoltenVK on a
  macOS host of another release answers as 27.0.1 too. MetalLevel, the
  metal_level of DeviceOptions and DeviceProperties, and the degradations
  metal-level-below-host, metal-level-not-macos and mipmaps-as-apple-m4 are
  gone, and so is our side of the levels: the OS's METAL_LEVEL, the
  level-dependent answers of format_info, the deaths on a host whose release the
  runtime did not measure, and Inexact::MetalLevel (the same adaptation as
  development-performance's e47f89760).
- The device's own arithmetic and value answers are the contract, with a
  precision note where they can differ from Metal's (the owner's
  native-arithmetic rule): BC and sRGB texels, half precision, fast-math
  grouping, maths functions, sampler details and pixel samplers, two-plane
  YCbCr (the device's Y'CbCr sampler), clears and fills, multisample resolves,
  mipmaps (the device's blit chain) and vertex conversions. The runtime's exact
  emulations of these are deleted, so REIMS_VGPU_EXACT loses sampling,
  ycbcr_filter, float_maths, texel_conversion, vertex_normalized, half_rounding,
  nan_and_min_max, rounding_order, half_blend, half_texel_bits,
  multisample_depth_twin, decoded_texels, tile_store and resolve: such a name
  now writes the stderr line and changes nothing. It keeps batch_order and
  host_page_textures and gains half_chains (each half operation of a fast-math
  chain rounded on a device without shaderFloat16). docs/api.md and the
  accuracy ledger say so; the ledger lists the deleted forms' bounds as the
  device's own answers.
- Degradations: 17 kinds retired, which leave DIES, NATIVE_RELAYED and the
  relayed lists. DevicePackConversion, DeviceVertexConversion and
  DeviceAlphaCoverage, notes of the device's own maths, vertex input and
  coverage, join DIES and NATIVE_RELAYED, as the other device-maths notes are
  placed. DeviceFilteredMipmaps, announced on every device, MoltenVK included,
  is relayed, never a death. None of them is in DIES_BY_DEFAULT, so by default
  nothing new ends the process.
- The read-only store mask is gone: on macOS a read-only view drops the store,
  as Metal does; off macOS, GPU writes into read-only memory land (the
  runtime's known gap). set-past-layout-support is announced at every bind past
  the driver's support.

Tests: the YCbCr comparisons and the resolve test run on the platform's own
device, as the exact-form devices are gone (device_with_policy and
device_with_ycbcr_filter with them); the mipmap tests no longer check the
retired tie kind.

Checked:
- on the M3 Max: rustfmt and the three clippy passes cargo xtask check makes
  (all features, the tested features without the defaults, and
  x86_64-unknown-linux-gnu), clean;
- the Vulkan crate on gem10's RX 7900 XTX and Radeon 780M, 432 of 432 each;
- reims-vgpu's and the C API's video and scaler tests on the XTX, the 780M and
  msi's RTX 5080 Laptop GPU, 50 of 50 each.

Failing, not fixed, at the owner's word (strict mode is not a concern):
- the Vulkan crate on the RTX 5080, 429 of 432: three encode_render tests read a
  channel one code off the byte they assert (0x7f where 0x80), the device's own
  colour conversion;
- reims-vgpu-vulkan's and reims-vgpu's 898 tests on MoltenVK, 796 passing: 102
  fail, 57 of them the YCbCr comparisons with Metal, most dying in strict mode
  at the device notes MoltenVK now announces where the exact forms answered
  before (device-nan-encoding, native-half-conversion), the rest comparing
  Metal's exact bits.
Not run: the rest of cargo xtask check (core, the Metal, window and video
crates, the header) and the suite, which the runtime does not reach; no boot.
2026-10-28 17:59:34 +02:00
Anees Iqbal aaec87ae4f ⬆️ Build on metal2vulkan a759d0e88f's runtime
Move the runtime from f6a96b7da8 to a759d0e88f, the tip of metal2vulkan's
development (runtime version 1643 to 1648; its runtime sources pinned as
abac6049).

metal2vulkan's gate on a759d0e88f was still running when this was committed;
the owner chose not to wait for it.

What changes for the guest:

- A 2D texture over host pages whose usage only samples or reads it is a linear
  image over the pages, with no shadow and no copy in at each command buffer's
  first use, on a device whose startup check passes: on that device, an image's
  first move keeps every byte while the CPU writes beside it, checked for
  pointer imports, fresh pages and dma-bufs each, and kept in the shader cache
  by driver and runtime version. Vulkan does not promise that move (an image
  over imported memory starts UNDEFINED), so this relies on the driver, by the
  owner's ruling of 2026-10-26. REIMS_VGPU_EXACT gains `host_page_textures`,
  which keeps every such texture a shadow, as before, and `all` names it; the
  accuracy ledger and docs/api.md say so. Render targets, written textures and
  two-plane YCbCr surfaces keep their shadows.
- A memoryless texture bound at a texture slot is taken, as plain Metal takes
  it, where the runtime refused the setter and this platform died there (an RX
  580 user's guest, at setFragmentTextures:withRange:). A command whose function
  uses the slot, a useResource of it or a blit of it fails the command buffer
  with MTLCommandBufferErrorInvalidResource (9) from the Metal submission that
  holds it, as Metal's GPU does (measured by metal2vulkan on the M3 Max). This
  platform passes the new CommandBufferError::InvalidResource to core as one of
  Metal's failures: the fourteenth it lists. A memoryless texture's CPU reads
  and writes move nothing, and its views are nil, as on Metal.
- new_texture_with_vk_image takes IdPlacement::Outside; nothing here passes it
  yet, so the window's swapchain images still take texture IDs.
- Nothing else in the span moves what a guest computes or observes: the
  in-place check's dma-buf pages come from cached memory, and the rest is
  counts, docs, tests and the sources pins.

The public surface gains CommandBufferError::InvalidResource,
DevicePolicy::host_page_textures and its HostPageTexturePolicy, and WorkCounts'
in-place and shadow-cause counts. No Degradation, RuntimeGap, refusal or notice
kind moved, so DIES and the relayed kinds stand. Device info, GPU families and
feature queries answer as before. The Vulkan platform ends the process at one
site fewer: the memoryless binding.

docs/video/bugs.md says what the pin carries for B73: the in-place textures and
the counts that tell them from the shadows that stay.

New tests, of the memoryless binding, on every platform:
a_memoryless_texture_at_a_fragment_slot_fails_only_a_draw_that_uses_it; and on
the Mac, memoryless_slots_fail_as_metals, which measured Metal's lines
(macOS 27.0.1): a draw whose function ignores the slot completes; one that
samples it fails the command buffer with code 9, the blit before its pass run
and neither its clear nor the blit after it, the signal after them not firing.

Checked, every test passing in its full run:
- on the M3 Max (macOS 27.0.1): rustfmt, the three clippy passes cargo xtask
  check makes (the Mac's, its tested features', and x86_64-unknown-linux-gnu's),
  and the 900 tests of reims-vgpu-vulkan and reims-vgpu on MoltenVK;
- the Vulkan crate's 434 tests and reims-vgpu's and the C API's 50 video and
  scaler tests on gem10's RX 7900 XTX and Radeon 780M, with no amdgpu reset.
The RTX 5080 Laptop GPU's run was skipped at the owner's word: the GPU was busy
with the owner's VM.
Only those crates link the runtime, so the rest of cargo xtask check (core's
tests, under Rosetta too, the Metal, window and video crates, and the header)
and the suite, which drives the C API on the Metal platform, do not
reach the change and were not run.
2026-10-26 21:45:46 +02:00
Anees Iqbal 103fe60299 🐛 Ask the runtime's slot writes what a draw may write
On Linux the runtime imports read-only guest memory through a writable
twin, so a draw or dispatch that may write a read-only object dies where
it is encoded (kept_write). Whether it may was read from the pipeline's
reflection here; it is now the runtime's answer per slot, which knows what
each function may store through.

For the guest: those runs now draw where they died. Nothing else changes.
Metal completes such draws and drops the writes (measured by metal2vulkan
on the M3 Max), so the deaths left are this platform's divergence until
the runtime drops them.

Source: fda51104a
2026-10-26 12:24:31 +02:00
Anees Iqbal d527b7257c ⬆️ Build on metal2vulkan 6c9cad047a's runtime
Move the runtime from 6b67bd44af to 6c9cad047a (runtime version 1520 to
1643), through dc80eb2bd4, 67c64f99d8 and 27935d575e, and hold three tests
to the runtime's answers at the pin.

For the guest:
- a draw whose state's reflection the runtime could not finish asks per
  slot what a function may store through, where every read-only object
  counted as written and a user's Linux guest died in kept_write;
- a detach in a completed handler of an object the last submission used
  answers YES, Metal's answer once the use retired;
- shareable padded 10-bit formats are made in Private storage, and the
  packed ones answer nil and 0 bytes, as Metal's;
- a command encoded again at a replace no longer writes the pages it was
  encoded over;
- a shadowed texture copied back by a dispatch stores wide texels whole.

The runtime's identity of the GPU device, which the video devices use to
find their GPU, comes with this pin.

Source: 7ad52b99b 0e37d329c cb582881c 94d2b0ef6 5ee2d000e 221176d06 051c64ebb
2026-10-26 12:24:31 +02:00
Anees Iqbal ef986e9799 ⬆️ Build on metal2vulkan 6b67bd44af's runtime, taking its calls
Move the runtime from 13f38b8d42 to 6b67bd44af (runtime version 1520),
through ee0b90d176, 6ca8b9005a and 2e3af38041, and take the calls it now
offers in place of our own: encodeSignalEventScheduled:value:, guest bytes
uploaded in place through HostBytes, a heap texture's allocatedSize, whether
a command buffer uses a detached object, a rate map with its resets, and an
ICB render command's draw and type.

For the guest, each relayed and dying in strict mode where the runtime
still differs:
- an indirect command's draw of private types 5 to 8 draws as Metal's;
- a multisampled XR attachment resolves, a sample-mask function runs once
  per covered sample, and a mutable rate map resets to another size's
  identity, where each died;
- a texture buffer fills with patterns up to 32752 bytes, and a state that
  rasterizes nothing binds in a pass of other colours or sample count;
- a 512th cross-queue handler wait hangs, as Metal does, where it died;
- the relays of a YCbCr texture's 2D array view and of a NaN resolve after
  a draw of nothing go, and ICB identifiers and lengths relay only where
  the runtime's are unmeasured or differ.

Source: 239fed964 e819c311b 5556e6652 3ca34960c 2d5612c0e 7c71da2cd 0926e93c9
        3c16a141a 0c63accac 760a156ac c70d82493 423859703 c7256291d 9f8324229
        577d51990 a801c4803 504ca0c76 28f2b6270 e1a4934c3 d1b9fa485 7e564d6b9
        d4303b3a4 9916f7658 f72d1a292
2026-10-26 12:24:31 +02:00
Anees Iqbal d61baf80cb 🔥 Number ICBs, and leave reservations and records to the runtime
Our copy of Metal's pool of indirect command buffer IDs gave the guest its
numbers, and the runtime's parted from them in the window a release in a
completed handler leaves. Our checks of which ID reservation Metal ignores
or spins at, our threadgroup lengths past a record, and our tracking of the
state a GPU-written record names duplicated the runtime too. Each now goes
to the runtime, and ours go.

For the guest: ICBs are numbered by the runtime's IDs; a reservation Metal
spins at parks where the runtime says; the uniqueIdentifier of an ICB made
after an encoder is relayed as inexact; and a released state's program runs
where the buffer keeps it.

Source: 67a3cde33 fcad222f3 30a05109f 3dad06e0b 57174cd91 4f8119240 f867d0f9b
        70d36241b
2026-10-26 12:24:31 +02:00
Anees Iqbal dd4c92a742 🔥 Fill colours, bytes and multisample textures by the runtime
The runtime's fills pack a colour, stage a fill's bytes and fill texture
buffers and multisample textures by Metal's measured rules, which our own
packer, staging and gates duplicated or refused. Every fill goes to it, and
ours go.

For the guest: a colour fill in a format Metal packs no colour in is filled
as the runtime fills it, where it died; a
texture buffer's fill runs its pattern across the buffer's bytes, and a
multisample texture's fill writes every sample, where both died; YCbCr and
padded fills over surfaces and memory write Metal's bytes.

Source: 25bd6742e d099e150b 2edf18fa5 6dfff12ec 34f462261 9c741fd51 f171ed69c
        c370e9661 fe8fbef50 465e68bd3 b84e123b5
2026-10-26 12:24:31 +02:00
Anees Iqbal cc2dc8dc57 🐛 Draw private primitive types and provoking vertex via the runtime
The runtime now draws setProvokingVertexMode:, primitive type 9 and Metal's
private types 5 to 8 itself, at every draw form, so our own forms go: the
rotation of triangle lists and strips, the type-9 hang's failure and the
index lists of the private types.

For the guest, compared with Metal on the M3 Max:
- at mode 1, triangles under a state that reads a flat input or selects a
  layer or viewport take Metal's vertex over indices, indirect arguments
  and private types 6 to 8, and strips reading barycentrics take Metal's
  weights; each drew at the first vertex;
- a mode from 2 up goes to the runtime as set, drawn Metal's third way;
- a type-9 draw, over vertices, indices or arguments, fails its command
  buffer as Metal's GPU does, holding the hang as long as Metal's;
- quads give Metal's primitive IDs, private types draw under a writing
  vertex function and from vertex starts past i32::MAX, and a line draw
  that makes no line relays nothing.

Source: 4815498a2 c5a593fc6 dc1577205 0e0716eeb 985bf7e1f 093110465 2ffea80ea
        587ca73e8 10348eb75 0ce046c79 1b10b04a6 7d1f97d81 d3bff2270
2026-10-26 12:24:31 +02:00
Anees Iqbal 4f5c3e4859 ⬆️ Build on metal2vulkan 13f38b8d42's runtime
Move the runtime from a62e8a365f to 13f38b8d42, through 2fde63f27f and
45da448770. The library builds on its API: a checked execution names what
it checks, the shared-event listener is made by the infallible constructor,
the crate's recursion limit rises to 256, and every new degradation kind is
placed, each inexact one relayed with a ledger row. Metal's failures pass
to core with Metal's codes.

For the guest: an indirect sparse mapping update whose arguments Metal's
validation stops maps as Metal's, and a laid command-predication loop runs
on past its copies and its queue's release, as Metal's, where each died.

Source: e4125110c fbd53b16a f60445995
2026-10-26 12:24:31 +02:00
Anees Iqbal f62fc6c1ef 🔥 Take caps, formats and uniqueIdentifiers from the runtime
The runtime answers what several stand-ins here answered: the write
rounding modes, Metal's private answers the device lacks, the two-plane
formats 505 and 543, the nil for two-plane XR10 cubes, a write swizzle and
texture buffer levels, Metal's sizes of depth and stencil placements, an
indirect command's buffer slots, and ICBs' and pipeline states'
uniqueIdentifier. Each is asked of it, and our models and their table rows
go.

For the guest: a pipeline state's uniqueIdentifier follows Metal's reuse
of a released state's, where our counter never handed a number out twice;
an ICB's is the runtime's model of Metal's address; info 460 of an
ICB-capable state answers the runtime's identifier, relayed as inexact,
where it was Metal's address. The caps docs say which runtime gaps and own
notices they know of.

Source: 93fa68087 e1c879cc2 d87dc4e82 6d7b4c83d b72fa5773 903d4a639 fd4b2fe4f
        0706d9cd8 cac5a14a4 bf8ed1e1c 6d31b19ee a5ef5a77c b329ac2cf 74b230dcc
        21c45c0a4
2026-10-26 12:24:31 +02:00
Anees Iqbal 9ec337e528 🔥 Leave render keys, NaN clears and mode-2 writes to the runtime
The runtime at the pin does what several workarounds of its earlier
refusals did here: it holds Metal's private render keys, completes a
command buffer behind a type-9 hang as Metal does, records nothing of an
empty draw, stores Metal's bits for a clear to a NaN, and builds texture
write rounding mode 2. Each goes to it, and our forms go.

For the guest:
- a render blob with sampleMask, pointCoordLowerLeft, pointSizeOutputVS,
  twoSideEnabled, vertexDepthCompareClampMask or
  needsCustomBorderColorSamplers at another value is made and draws as
  Metal's, where the process died at the deserializer;
- a command buffer committed behind a type-9 hang runs nothing and
  completes with no error, its signals firing, where the process died;
- a draw of no instances with no state, or a tile state, dies at the draw
  as plain Metal ends the process, where it went on;
- a clear to a NaN stores Metal's bits.
Unknown stores and unused resolves were already Metal's, and stay so.

Source: 5d49e0653 bea16d1ab 655237161 0012ee787 055c68344 53bbb9e3f 333d154da
        fa6bf7117 aa032c241
2026-10-26 12:24:31 +02:00
Anees Iqbal 9f2e1c2c34 🐎 Move metal2vulkan to 62cad6be54: per-sample reads, ANV fits
62cad6be54 lands metal2vulkan's bug-fix wave on its development, 55 commits
past 6b322fb50f (SEMANTICS_VERSION 1759 -> 1798, RUNTIME_VERSION 1314 -> 1496).

What changes for the guest:
- A multisampled fragment function that reads its colour attachment (so runs
  per sample) and [[position]]'s w, [[point_coord]], [[barycentric_coord]] or
  a centroid varying now compiles, those reads taken where Vulkan evaluates
  them for the sample and announced as multisample-position, where link
  refused it, which killed the guest at every launch of Claude Desktop
  (0a34e8c7).
- On ANV, mesh render, tile render and compute pipelines whose largest stage
  passes the compiler's word bound under exact forms are fitted, as render
  pipelines were, where brw's allocator faulted the process (33e89bd4).
- The UHD 770 splits an interlocked pass as every GPU measured does, faster
  there (affd8a5e). lavapipe records a dispatch of a variant that
  bakes samplers in a command buffer of its own, which 26.0.8 sampled as
  Repeat after a copy (ImmutableSamplersLostAfterCopies, 84ba0af3).
- A texture over a no-copy buffer's host pages, padded rows included, is the
  runtime's shadow on every device, MoltenVK too: a CPU write to bytes a
  command buffer does not write is kept, as Metal keeps it, where an image's
  first move could undo it (e35bf78b).
- ASTC LDR, ETC2/EAC and PVRTC textures read through decoded twins where the
  device lacks the format, A8Unorm through R8, and 4:2:2 through a twin on
  every device.
- New fast defaults, each bounded, logged and behind an exact switch, none of
  which applies on MoltenVK: the device's resolve (resolve), the device's tile
  store of loaded snorm and RGB9E5Float attachments (tile_store), compact ASTC
  and EAC twins (decoded_texels), and batches ordered by their ends
  (batch_order).
- Every device takes the runtime's exact completion, each command buffer seen
  complete at its own end as Metal's, not its new default of Mesa's grouped
  submissions: when work completes is the guest's to observe, and ip34
  measured no frame rate gained on the Iris Xe (15.7-17.3 fps grouped,
  16.4-17.6 exact).
- Every device takes uncompressed heap textures too, not the new default of
  ANV's compressed image, which would change the heap size query's answers
  (0x4100 bytes at 0x10000 for a 64x64 BGRA8Unorm texture on the Iris Xe,
  where the guests booted with 0x4080 at 0x1000) and could hide writes through
  aliases.
- A device's teardown no longer races the watch of the program's queue marks
  or the release of freed memory: the last drop tears the device down on its
  own thread before it returns (6898b52e).

Here: REIMS_VGPU_EXACT names four of the new DevicePolicy fields, with their
ledger rows and docs/api.md's list; completion and heap_compression have none,
and the ledger and docs/api.md say every device takes their exact forms, and
why. padded_reads, whose field and fast form are gone, falls to the path
docs/api.md gives a name that is no field: nothing changes, and stderr says so.
Its ledger row goes. The runtime's six new kinds are placed: CarriedDecodedTwin
relayed (a performance kind); DecodedTexelPrecision, HeapTextureCompressed,
SnormMinimumKept, SharedExponentKept and GroupedCompletion in DIES,
GroupedCompletion and HeapTextureCompressed never announced under the exact
forms, DecodedTexelPrecision also relayed on native devices as the runtime's
default sampling. DeviceRoundedResolve moves from HEARD to DIES and is relayed
on native devices too (class (e), the device's rounding of an average, as
measured on RADV, ANV, NVIDIA and lavapipe), so Inexact::RoundedResolve and
device_rounded go: a strict run on Mesa's drivers, this crate's tests among
them, no longer dies at a grouped submission or a resolve the device averages,
and MoltenVK, which resolves as Metal, announces neither. None dies by default.
The retired UnorderedFramebufferFetch and UnrestoredFirstMoveBytes leave DIES.
The docs of the runtime's VK_EXT_metal_objects, the first move's keep and the
fitted pipeline kinds are brought up to date.

Tests: the resolve test, a_device_resolve_ends_its_pass, ends passes under both
resolve policies (device_with_policy). A texture over a surface's memory is now
the runtime's shadow, so the runtime may free the surface buffer's import as it
goes, a command buffer still running; the Linux test of the surface's memory
hold, renamed
a_released_surface_texture_keeps_the_surfaces_memory_while_imported, checks that
the memory stays mapped while the device imports it, in place of until the
command buffer completed. a_type_9_hang_is_in_flight_as_long_as_metals commits
its queue's command buffer right after the hang's, before another queue's runs:
under the suite's load that run took 42 to 98 ms on the Iris Xe, past the 40 ms
hang, on 6b322fb50f too.

Checked at this tree, built on c662e1c78b, metal2vulkan's commit whose tree
62cad6be54's equals. On the M3 Max: cargo xtask check, 3517 of 3528 tests
passed; the 11 that failed under its load (nine YCbCr sampling sweeps, and
detach_backing's detached_in_flight on Metal and on Vulkan) passed alone. On the
Iris Xe (homelab-ms01, ANV, Mesa 26.2.4, strict): the Vulkan crate's tests, 388
of 388. Cold boots on the M3 Max's Vulkan platform (MoltenVK), each with an
empty translation cache: arm64 macOS 27 to its login window and macOS 26 to its
desktop, with no fatal line or refusal. x86-64 macOS 26 with the ported GPU
kexts, headless at 1920x1080, opened 69 apps in turn on the Iris Xe (ANV), the
RTX 5080 Laptop and the Radeon 780M (RADV), the last two from an empty
translation cache: no QEMU death, fatal line, refusal or crash report on any of
the three. Not run here: the suite, which drives the Metal platform alone.
2026-10-19 01:04:01 +03:00
Anees Iqbal a0b288ed52 🐎 Move metal2vulkan to 6b322fb50f: YCbCr filter, ANV halves
6b322fb50f is metal2vulkan's development, three commits on 29d3ebb22e's line:
the fetched 8-bit blend for every factor, mask and blend color (01841476dd),
the device's filter of a two-plane YCbCr texture by default (b7da00074a), and
the cut of ANV's and RADV's cold making of half-heavy shaders (6b322fb50f).

What changes for the guest:
- Intel (ANV) builds the guest's big A2X pipelines cold in about 4 s, where
  it took about 14 s plus two 38 s remakes at a draw, past the guest's 10 s
  GPU watchdog: a cold first boot of the x86-64 port on Iris Xe stalled with
  19,572 FIFO resumes, and now boots with none. RADV's 780M takes 0.39-0.43 s
  where it took 0.80 s. A computed half rounds through an f32->f16->f32 pair
  under Vulkan's 16-bit float controls, exact by the spec, and a half read
  from its bits widens by the device's conversion, every value but a NaN
  exact (its bits the device's, announced as NativeNanEncoding). NVIDIA keeps
  its forms (DriverWorkaround::HalfConversionPairFolded).
- A linear sample of a two-plane YCbCr texture is the device's own filter by
  default (the owner's ruling, 2026-10-17: the fast form, logged, the exact
  one behind a switch): within 1.18 codes of Metal's on the RTX 3090, 0.88 on
  RADV, 1.06 on ANV and 0.1245 on MoltenVK on the M3 Max, so a draw binding
  one makes no pipeline of its own. REIMS_VGPU_EXACT=ycbcr_filter, and `all`,
  take Metal's filter, byte for byte as before.

Here: the switch's name in platform.rs, its docs in docs/api.md and its row
in the accuracy ledger, with the half-rounding and NaN rows brought up to
date. The runtime's seven new kinds are placed (AttachmentReadInPlace,
NotMipmappedAnisotropicSampler and -Filter, UnmeasuredGroupSpeculation and
DeviceSampleLevel in DIES, DeviceSampleLevel also relayed on native devices;
FloatTininessAfterRounding and ExactFormsOverCompilerLimit relayed); none dies
by default. The Mac's YCbCr comparisons run on a device under
YCbCrFilterPolicy::Exact, compared exactly, and a new test holds the default
to its bound and its notices.

Checked at this tree (metal2vulkan's e742fe531c, the same tree): cargo xtask
check on the M3 Max (the 11 load-sensitive failures passed alone), the
Vulkan crate's tests on um780's RX 7900 XTX and 780M (388/388 each), and the
port's cold boots on ms01's Iris Xe and gem10's 780M with no fatal line.
2026-10-17 11:18:09 +03:00
Anees Iqbal 6ebfb6d9d9 🐛 Move metal2vulkan to 29d3ebb22e: no boot death, no Mac hang
29d3ebb22e is metal2vulkan's development: one commit on 0175289314 whose
tree is development-fast c66863112e's. It fixes what 0175289314 broke here:
- An image's first move wrote its kept bytes back over the host's pages
  unconditionally, so on read-only pages it raised SIGBUS (7 Vulkan tests on
  the Mac) and hung the Mac's Vulkan boots of arm64 macOS 26 and 27 under
  QEMU. It now writes back only the bytes the move changed, and only where
  the pages are writable.
- A no-copy buffer released with a keep-alive under a live buffers' table
  announced host-deallocator-delayed, which dies by default, so a cold
  x86-64 macOS 26 boot on Intel (ANV) died. With a keep-alive the
  deallocator now runs at the release, unannounced.

Two new kinds go in DIES (strict mode dies, the default relays): each lets a
value Metal's never gives reach the guest, and each has an exact form the
hardware allows, so a native device does not relay them either.
- UnrestoredFirstMoveBytes: a first move's changed byte on pages the host may
  not write, left as the move wrote it. Not among DIES_BY_DEFAULT: the
  driver's move writes the bytes, and no run has met it.
- The note TessellationTriangleOrder: the device tessellator's triangle
  order, on every device but MoltenVK on an Apple GPU. A patch draw there now
  dies of it first, ahead of TessellationFactorEdgeCases, so the two
  patch-draw tests expect the kind the device's tessellator decides.

HostDeallocatorDelayed's doc and the ledger's padded_reads row say what the
runtime now does.

For the guest and the host: x86-64 guests boot on Intel again, and the Mac's
Vulkan path boots again. In strict mode a patch draw off Apple's GPUs dies of
the tessellator's note.

Checked at c66863112e, the same tree: cold boots of x86-64 macOS 26 on the
780M and Iris Xe and of arm64 macOS 26 and 27 on the Mac's Vulkan path, with
no fatal line; Vulkan and core tests 2711/2711 on both Linux hosts; the
Mac's cargo xtask check, whose only failures pass run alone.
2026-10-16 13:07:17 +03:00
Anees Iqbal e946214f8f 🐛 Match metal2vulkan 0175289314's kinds, levels and resolves
The pin move to 0175289314 left the Vulkan platform out of step with the
runtime: seven new degradation kinds unplaced (so
every_degradation_kind_is_placed_once failed and the notice path relayed
them unreviewed), a changed macOS 27.0.1 level, resolve rules that now cover
every 16-bit float resolve, and a 16-bit float blend the runtime now
announces.

New kinds, placed by the answer layer's rules, with docs from the runtime's
text at the pin:
- In DIES (strict mode dies, the default relays), where a value the guest
  reads can differ from Metal's: unorm-depth-slope, signed-depth-test,
  visibility-count-per-color and the note color-attachment-groups.
- Relayed as Metal's answer at a cost: shader-unorm-depth,
  synthesized-geometry-stage and emulated-tessellation-draws, whose
  records-pool overflow now dies named (TessellationRecordsOverflow).
- The docs of the kinds the pin changed say what the runtime does now
  (Depth16 deviations, FunctionStorageAssumed, DeviceInterpolation,
  CubeGradientFootprint, DepthDenormals, HostDeallocatorDelayed).

The MacOS27_0_1 level answers as the M3 Max under 27.0.1 (26A434), where it
answered as an Apple M4: 630 to 645 are described by neither level, and
newSharedTextureWithDescriptor: of 630 to 650 at Private storage answers
nil there, as Metal on the M3 Max does, where it died at the creator. The
tests assert the levels as the runtime answers them.

The runtime's resolve rules now cover R16Float, RG16Float and RGBA16Float at
2 and 4 samples, so device_rounded's exemption for them could match no pass;
it now relays (strict mode: dies) every DeviceRoundedResolve it hears.

A safe-math output blended One and Zero into a 16-bit float attachment is
announced as HalfOutputPrecision, as Metal keeps the zero factor's product
there; half_apart now counts every 16-bit float blend but Min and Max as
past the bound.

The accuracy ledger's padded_reads row says the runtime now keeps an image's
bytes over host pages across its first move, with its known gap.

For the guest and the host: by default nothing changes but the nil answer at
the 27.0.1 level. In strict mode a draw announcing one of the four DIES
kinds, or a One/Zero 16-bit float blend, dies at its selector, naming the
kind.
2026-10-16 12:10:23 +03:00
Anees Iqbal 2631a11edc 🐛 Move metal2vulkan to 720ef1ce9a: exact padded surfaces
metal2vulkan fd22785008..720ef1ce9a (18 commits, one per work packet) brings:
- padded guest surfaces, whose rows lie with bytes between them (a browser's
  tiles): on every device but MoltenVK, one a pass draws into or a shader
  writes is the runtime's shadow, as a render pass may write back any byte of
  its attachment and Metal never writes those bytes (measured on the M3 Max);
  a loaded colour attachment copies back only the rectangle bounding its draws'
  scissors, and a pass that reaches no tile copies nothing. One that only reads
  stays an image over the buffer's bytes, and REIMS_VGPU_EXACT's new
  `padded_reads` takes the shadow for it too;
- scheduler fixes: a commit left to the scheduler is taken in before its next
  check, and a commit's passes are bounded;
- function storage measured on the RTX 3090 (128 KiB) and RX 7900 XTX (96 KiB),
  where FunctionStorageAssumed no longer fires;
- threads a runtime thread starts no longer inherit its utilization floor;
- the execution status through a binding where the device addresses no
  buffer, the macOS 27 fixes on the M3 Max, and a half texel's NaN as Metal's
  under nan_and_min_max on MoltenVK, which the docs now say MoltenVK answers
  only under that switch;
- RUNTIME_VERSION 1211, SEMANTICS 1698.

Checked on the same runtime sources before metal2vulkan squashed its history:
cargo xtask check on the M3 Max (only the known macOS 27 failures); the Vulkan
and core crates' tests on Iris Xe, two 780Ms, the RX 7900 XTX, the RTX 3090
and the RTX 5080 Laptop GPU (nothing new but load flakes that pass alone); and
a cold boot of the x86-64 guest on each, with no fatal line. Iris Xe's steady
frames/s at the users' scheduling class matched the last round's.
2026-10-14 20:32:08 +03:00
Anees Iqbal 98fe2a3bd5 🆕 Replace the tree with libreims_vgpu and its C API
This repository now holds libreims_vgpu, a Rust library that is the host
side of the paravirtualized GPU macOS guests drive, in place of Apple's
ParavirtualizedGraphics.framework: the library and its C API
(reims_vgpu.h), the PCI device's option ROM, QEMU's apple-gfx on that API
(vendor/qemu), the behaviour-lock suite that drives the C API as QEMU
does, and reims-ctl, the VM manager users run. README.md says what it is
and how it is laid out, and AGENTS.md how to change it.

Every file of the earlier tree is replaced. vendor/qemu moves to the
steelbrain/reims-vgpu branch of the same public repository.
2026-10-11 20:27:17 +03:00