Three corrections, each checked against the tree:
- runtime/src/visibility.rs said Metal's visibility-result behaviour was
measured on an M4, which is not one of our venues. The conformance
suite's visibility cases record Metal's answers on an Apple M3 Max with
macOS 27.0.1 (recordings/visibility-*.json); the doc now names that venue.
The 5300M and UHD 630 answers it cites beside it are unchanged.
- docs/FAST-PATHS.md's DeviceSampling row (and docs/API.md's device-sampling
entry) said Metal reads any subnormal coordinate as the zero of its sign
before addressing. That holds for a normalized coordinate (measured on the
M3 Max on R32Float, PrecisionNote::DeviceSampling's documentation); a
negative subnormal pixel coordinate addresses texel -1, as the M3 Max's
recording of pixel-samplers-subnormal-border answers (the border at
-2^-149, -2^-140 and -2^-127, known-gaps.tsv). Both now say so, and the 27
known-gaps.tsv rows that quoted the old reading quote the new one.
- SharedEvent::reserve_vk_signal's Safety text lacked the same-VkQueue rule
that Event::reserve_vk_signal states. A shared event's command-buffer waits
are held on the host (event_timeline.rs: a settable timeline never hands
a wait to Vulkan), but a command buffer that signals the event after the
reservation waits on its VkQueue for the reserved index before its own
signal (EventTimeline::signal's `after`, the order wait in
command_buffer/submit.rs), so the caller's signalling submission must not
go behind it on one VkQueue, and a texture copy on the first VkQueue behind
it waits for the signal too. The rule is now stated, scoped to those
signalling command buffers.
Verified: rustdoc and the runtime's degradation_catalogue test over the
edited text; no behaviour changes.
(cherry picked from commit 12bac3fafd3d3e66dc0b88d01231dd30e2694ffb)
The cpu-block-decode notice said the call waits for the decode where a
command buffer that may read the texture is submitted and not yet complete,
or the texture is untracked. The call has waited for no GPU work since the
decode moved to the device's decode thread (texture/twin_decode.rs): it waits
only for room, while 256 MiB of written blocks wait for the thread (a 4:2:2
carrier's partial-row write also reads its rows back first), and the
scheduler holds the first command buffer that may read the texture, every
command buffer where the texture is untracked.
The declaration's rustdoc, its announced cost and docs/API.md's catalogue
entry now say that. A test ties the stated bound to the queue's QUEUED_BYTES
(made pub(crate) for it), so the text follows the constant.
Verified: tests::degradation::the_cpu_block_decode_cost_states_the_calls_
only_wait and tests::degradation_catalogue (the catalogue states the cost).
(cherry picked from commit f128722f1b2197f52833080eca738fd498cf6ce5)
A mesh function that writes a vertex's point size recorded
PrecisionNote::DevicePointSize whatever primitive its mesh outputs. The
rasterizer reads a vertex's size for points alone, so a line or triangle
mesh's size draws nothing on any device, and the runtime already announces
the note only at draws that rasterize points (7715a47be3). The note is now
recorded only where the mesh type's topology (air.mesh_type_info) is points,
a structural test, so the artifact carries no note its draws can never meet.
Apple's compiler refuses [[point_size]] in a triangle mesh's vertex, so the
case arises only for AIR not compiled from MSL. The test derives the
triangle mesh from the owned fixture's point mesh (mesh_outputs_points) by
its topology word alone.
SEMANTICS_VERSION 2008: an artifact's precision notes change. docs/API.md's
catalogue entry and the note's rustdoc say which mesh functions record it.
Verified: engine_mesh::a_mesh_point_size_is_noted_only_where_the_mesh_
outputs_points on every committed mesh profile with the largest point set
below Metal's: the point mesh is noted, the triangle mesh is not, both store
the size; the test fails with the topology check reverted.
(cherry picked from commit adc0435c64495e2f3a3355becf055941fc529fc3)
SEMANTICS 2008 (4d187515d7): the new owned fixture engine/dfk_dead_fetch adds 76 golden-hash cells (0 moved), 4 inventory rows and its air_input printout; the census follows the new product fingerprint.
Blessed on the M3 (s37-pl.sh bless: bless_engine_inventory, the air_input printouts,
bless_golden_hashes, then the check step).
(cherry picked from commit 9f5e7e55221cfb111408a5e0784cf282cc2c0f7b)
What: device/create.rs and device/keeper.rs changed (the cherry-picked commit
before this one): an instance's making reads the loader's instance extension
list once and the keeper asks the loader nothing. The pin follows; no
RUNTIME_VERSION bump: the extensions enabled, every answer, announcement,
record and submission are the same; only the number of loader calls drops
(4 per process's first device -> 1, 3 per later instance -> 1).
Verified (smallfix, um870 job m3-max-13113): clippy of metal2vulkan-runtime
(all targets, all features) clean; tests::listed_extensions (a counting fake
loader: 1 read, the three extensions still enabled) and tests::keeper pass.
Pending on the branch: its negative control, rustdoc, m2v_gpu/m2v_cpu_icd
clippy and the release timings on lavapipe and um790. Generators and
api-signatures --check unchanged at landing.
The making of an instance asked the loader for its instance extension list
once per question: portability enumeration, debug utils and layer settings,
three vkEnumerateInstanceExtensionProperties calls, and the drivers' keeper
asked a fourth time for portability on the process's first device. Each such
call makes the loader scan its driver and layer manifests again and ask each
driver it finds; reims measured about 7 s per process on a host with several
manifests.
Now the making reads the list once (ListedExtensions) and answers every
question from it, and the keeper takes portability from the extensions the
device's instance enabled (the runtime enables it exactly where the loader
listed it), asking the loader nothing: four reads per process's first device
become one, and three per later instance become one.
Verified: tests::listed_extensions builds a fake loader that counts the reads
and refuses the instance; it reads 1 at this commit (3 before it, the
negative control).
(cherry picked from commit a58d2cd51a2fbe17326ce09c8a718ffec5d43776)
clippy -D warnings under --cfg m2v_gpu and --cfg m2v_cpu_icd flagged
chunks_exact(4) with a constant size (gem10 job m3-max-13089); as_chunks
gives the same texels.
(cherry picked from commit 94dd2382170212f76e685add4fa427c211a9c5b8)
runtime_lane::framebuffer_fetch::dead_reads draws dfk_dead_fetch's
dfk_branch and dfk_scaled, specialized with the read dead, over a 16²
BGRA8Unorm target blended one over one minus the source alpha, on the
device the cfg selects under the validation layer. On every device the
translator's pipeline for the descriptor has no storage and no input
attachment and color 0 keeps the blend; a pass of two draws stores
Metal's texels (each channel within one code asserted, the exact ones
counted), takes no storage form for the target
(WorkCounts::storage_forms_taken), splits no instance for interlocked
writes and announces none of the fetch's notices. On a device with a
fetch form the live specialization's pipeline takes that form
(asserted), and its pass's notices and counts are printed as the
contrast, one DEAD-FETCH line per function.
(cherry picked from commit fb39956c6942324fdb34330a9e725098d7058359)
What: the render pipeline's framebuffer-fetch state (pipeline::compile's
fetch_inputs) named every attachment the specialized fragment entry
declares a [[color(n)]] input for, used or not. The lowering then put
each such attachment the function writes through its first output in
the interlocked storage form (fetch::plan reads the state's attachments
as colors the pipeline moved there), so a function whose read the
function constants make dead (a branch on a bool constant, a fast-math
product a zero constant makes +0) still took the pixel interlock and,
for a blended attachment, computed the blend in the shader, its color
left out of the subpass. It now names a color input only where an
instruction of the specialized, canonicalized body uses it, the reading
the lowering itself plans parameters by: a dead read is a plain color
write that the device blends.
The used-parameter walk is one helper (params_used), which the vertex
attributes and the kernel stage-in attributes already did inline.
tests::engine_moved_writers' unread-color-input test pinned the old
form (smw_unread, a declared input it never reads, took the storage
form as compiled); it now checks that such a writer takes no storage
form under either write mask, color 0 stays a color attachment, it
states no store before the tests, and every draw that moves no color
runs it as compiled. The fixture's comment says so.
SEMANTICS_VERSION 2008: such pipelines' modules, graphics state,
facts and precision notes change.
Verified (debug, homelab-gem10-1): tests::engine_dead_fetch at the base
(6962601ac4, job m3-max-13077) failed: 48 of 114 dead pipelines took the
storage form with color 0 out of the subpass (dfk_branch and
dfk_scaled, blended and unblended, on all 12 interlock profiles;
dfk_gated, whose input the constant removes, never did).
(cherry picked from commit d9160036035a456a5371d5e80fe1f070a28a1e85)
Each dead pipeline's difference from a pipeline without a color input
(a storage form, an input attachment, color 0 missing or without the
pipeline's blend) is collected by kind and printed before the test
fails, so a run states how many dead reads took a fetch form, not only
the first.
(cherry picked from commit 6962601ac4a4e86f6316e2defed401728aea797d)
tests::engine_dead_fetch compiles the owned fixture dfk_dead_fetch's
three fragment functions (the read behind a branch on a bool constant,
scaled by a half constant under fast math, gated with its input) behind
dfk_vertex, color 0 BGRA8Unorm blended one over one minus the source
alpha or unblended, on every committed profile. Specialized with the
read dead, each pipeline must have no storage and no input attachment,
color 0 an ordinary attachment carrying the pipeline's blend, and pass
L3; specialized live, each reads color 0 in the device's fetch form
(storage under the interlock, an input attachment under
rasterization-order access) or is refused where there is neither.
This commit adds the test alone, the negative control at the base.
(cherry picked from commit 5f6a494dd747029b6e8f910b6a135b1692dd73a1)
scripts/regen-air-fixtures/regen-air-fixtures.sh dfk_dead_fetch on the
M3 (potluck job m3-max-13074; Metal 32023.922, SDK 27.2, LLVM 21.1.8);
TOOLCHAIN records the fixture under that toolchain. The branch on
dfk_reads compiles to a select on the loaded constant, and dfk_scaled's
product to an fmul fast of the loaded half constant.
(cherry picked from commit ac3447ff8745c1aad462d99472b16ec3109ab7bb)
Owned MSL: three fragment functions that read color 0, the read behind
a branch on a bool constant, scaled by a half constant (a fast-math
product a zero constant makes +0), and gated with its input by the bool
constant, beside a fullscreen vertex function. The companions follow
from scripts/regen-air-fixtures on the M3.
(cherry picked from commit c77c87b4ff1eb43eeb8a2f3a9b3c9e56fc1911ca)
What: the spare command pools now hold at most 4,096 command buffers across all pools,
counting pools that are out (taken, being freed, beginning a primary ahead). Over the
bound, the oldest spares free their command buffers on the free thread; if that is not
enough, the pool given back frees its newest past the bound. RUNTIME_VERSION 1997 -> 1998
and the runtime-sources pin follow.
Why: on the Iris Xe (ANV below Xe-HP, Mesa 26.2.4) each command buffer that records a
binding table takes a 64 KiB block of a 1 GiB pool: 16,384 per device, and the next
recording fails with VK_ERROR_OUT_OF_DEVICE_MEMORY. The spares held 9,716-9,771 before the
failing frame in all 6 failed loaded runs of checked_frames_merge_once.
Verified (exitcrash, at 9ddb267dbd on 8636a26f43):
- loaded Iris, the iris-flakes shape: checked_frames_merge_once 0 of 76 vs 6 of 79 at
base; runtime suite 16/16 loops; teardown threads 0 of 6,528.
- new device test, spares held after three big command buffers alive at once: 4,096 on
lavapipe, M3 MoltenVK and Iris; with the bound disabled 12,417 / 12,675 / 12,417 (fails).
- Iris cost, the test alone, 5 runs each: spares max 4,096 vs 7,787-7,793; frees on the
free thread 220 vs 14-17; test time 13.6-14.0 vs 13.6-13.9 s.
- tests::spares 14/14 on the three venues; lavapipe runtime suite 2025/2025; clippy and
rustdoc clean. Generators and api-signatures --check unchanged at landing.
Not run: the full gate and the other venues (development's checks).
The module docs now state what the bound of 4,096 costs where it was measured. The numbers
come from tests::linear_runs::checked_frames_merge_once run alone on ms01's Iris Xe (Mesa
26.2.6), five runs each way, alternating, in a debug build. The base runs used development's
spares.rs; the fix runs used 8ab6915d69. Probe branch, not for landing: steelbrain/iris-held-
probe, job m3-max-13123.
- Spares held at most 4,096 against 7,787 to 7,793.
- Pool frees ran on the free thread 220 times against 14 to 17.
- Command buffers allocated: 12,559 in four runs and 9,864 in the fifth, against 10,193 in each.
- The test took 13.6 to 14.0 s against 13.6 to 13.9 s.
Verified for the bound (8ab6915d69), each with a negative control (past_held answering nothing,
so no bound):
- tests::spares::device::command_buffers_alive_at_once_leave_the_spares_holding_at_most_held:
the spares held 4,096 at the fix and 12,417 at the negative control on lavapipe (job
m3-max-13065), 4,096 and 12,675 on the M3 Max through MoltenVK (m3-max-13070), and 4,096 and
12,417 on the Iris Xe (m3-max-13071).
- The unit test the_spares_and_a_pool_given_back_hold_at_most_held_command_buffers passes at
the fix and fails at the negative control on all three.
- All 14 tests::spares tests pass at the fix on all three.
- The runtime suite on lavapipe (--cfg m2v_cpu_icd): 2,025 of 2,025 passed (m3-max-13073).
- Clippy -D warnings (plain and --cfg m2v_gpu) and rustdoc -D warnings for the runtime are
clean (m3-max-13068).
The loaded Iris run (m3-max-13072, iris-flakes-run shape, 30 min) put two loops of
checked_frames_merge_once and one of the teardown-threads test beside the runtime suite looped
under --cfg m2v_gpu:
- Checked frames: 0 of 76 runs failed (38 and 38), against 6 of 79 (39 and 40) at the base in
the same shape (m3-max-13027).
- Runtime suite: 16 of 16 green, 2,019 tests each, 110 to 116 s against 111 to 116 s at the
base.
- Teardown-threads test: 0 of 6,528 failed.
(cherry picked from commit 9ddb267dbd2ccf8942ac1a78ee3fee44fdc4f01d)
A command buffer keeps what its recording took of the driver's device-wide pools until it is
begun again, reset or freed, and the spare command pools kept each pool's peak over its recent
uses with no bound across pools. On ANV below Xe-HP each command buffer that records a binding
table takes a 64 KiB block of the device's 1 GiB binding-table pool, so a device holds at most
16,384 of them, and the next recording fails with VK_ERROR_OUT_OF_DEVICE_MEMORY with no driver
message. tests::linear_runs::checked_frames_merge_once failed so on ms01's Iris Xe (6 of 79 runs
beside the runtime suite, job m3-max-13027): its frames of 707 and 1,413 render passes, each a
command buffer whose pool kept its peak, left the spares holding 9,716 to 9,771 command buffers
in every failed run (2,786 to 7,747 in sampled passing runs) before the frame that failed. A
probe on the same Iris Xe (job m3-max-13053, twice): one command buffer of render passes, each
a primary and a secondary beside a cleared depth target, failed at the end of its 8,087th pass
with the spares holding 424, 2 x 8,086 + 212 = 16,384.
A give-back now counts the spares, the pool given back, and what each pool out of the spares
held as it went out (taken by a command buffer, out for frees, or beginning a primary ahead:
CommandPools::out, kept under the spares' lock). Past HELD (4,096) the oldest spares that hold
any shed all their command buffers on the free thread as an idle spare does and go back as the
oldest; where that is not enough, the pool given back frees its last made past the bound, a
secondary kept, never the primary begun ahead (past_held, CommandPool::past). On ANV the frees
do not trim, as before, so kept barriers stay valid. HELD leaves three quarters of the binding-
table pool to the command buffers committed and in recording.
Tests: tests::spares::the_spares_and_a_pool_given_back_hold_at_most_held_command_buffers (the
policy, no device) and tests::spares::device::
command_buffers_alive_at_once_leave_the_spares_holding_at_most_held (three command buffers of
2,112 blit encoders alive at once, each in a pool of its own). docs/FAST-PATHS.md records the
remaining ceiling: one command buffer of about 8,000 such passes still fails on ANV below Xe-HP.
Verification follows in the next commits' messages and the report: build and clippy, the
spares tests on lavapipe, the M3 and the Iris Xe with a negative control, and a loaded Iris run.
(cherry picked from commit 8ab6915d698cdaf29e2aa8bfd50c77cd8922d507)
runtime_lane::kept_variants::the_least_recently_released_variants_go_first made 64 public
kernel states and expected the first made again to have gone past the bound. With KEPT at 256
(63ccc9da0d) all 64 stay kept, so the first took its variant back and the test failed ("the
first went past the bound") in the M3 lane at 63ccc9da0d. The premise moved, not the product.
The test now makes 512 states, twice the bound, each a specialization of the owned engine
fixture's kernel unspecialized_guarded with its function constant optional_count at 0..511:
each value is its own compiled pipeline (the compile key holds the constant values), so the
states need no public corpus, are cheap to compile on every driver, and can be raised past a
later bound by changing MANY alone. MANY's doc names the bound it is twice of.
No other premise of a bound of 16 remains: the file's LINEAR (16, 16, 256) is a texture's
width, height and row pitch; the runtime's own kept_variants tests read KEPT.
Verified: see the lane runs reported with the tip (M3 MoltenVK and lavapipe, with MANY at 64
as the negative control).
(cherry picked from commit 6c0b4f7853a3fc98c1d9494e8f0deb29a9cdf3af)
491 recording(s) whose bounds moved. Pin 33 at 63ccc9da0d: cost --check on the M3 (job 13018) moved 130 gated counts. 126 went down:
RUNTIME_VERSION 1997 keeps 256 released variants (was 16), so within a round, which runs the whole set on one
device, a case takes back the variants an earlier case released (shader modules, pipeline layouts, variant
pipelines, pooled dispatch pipelines, and command buffers that made them). The 4 that went up are
device_memory_allocated, +4 or +8 MiB each (pass-bytes-srgb-decode-all-bytes, indirect-mesh-commands-object-
threadgroup-lengths, texture-pairs-storage-crossings, sparse-tails-by-texture-type): RUNTIME_VERSION 1995's 68 MiB
blocks of images (were 64 MiB).
Measured on the M3 (s37-pl.sh rebless: cost --runs 8 --write over the whole
set, then cost --runs 8 --alone --write over the changed cases).
(cherry picked from commit b1acd456f0d20e73b1c286d6e30e333d40e0a424)
Its product fingerprint follows development's versions at 63ccc9da0d. Blessed on the
M3 (s37-pl.sh censusbless --bless, dv-m3).
(cherry picked from commit e7e5067da205aa05c836e617b9d9569dc6c387f8)
The landed kept-variants change (exitcrash, steelbrain/kept-bound d6202a9741, 8 commits) changes what a
run of an unchanged artifact does:
- pipeline/kept.rs holds 256 released variant instances (was 16), so a state made again within the
working set takes its Vulkan objects and pipelines back with no driver call. The consumer's arm64
guest (macOS 26.6.2, CoreAnimation's RenderBox) made 8455 repeats of 255 keys per cold boot at about
1 ms each, 98% of it in this runtime; an LRU replay of that boot's log holds 157 repeats at 16, 8308
at 128 and all of them at 256 (largest reuse distance 223).
- A sampler refused at the device's SamplerLimit first evicts the least recently released kept instance
that holds samplers, then retries (in a program's call only).
- settle_device_maps settles graphics pipeline libraries first, then modules, layouts and sampler sets,
so an evicted instance's samplers are freed in the same settle (a linked pipeline held its layout and
its samplers past it; found by the sampler test on lavapipe).
Verified by exitcrash, release builds, base = the tests at KEPT 16 with the old product files:
- tests::kept_variants::released_states_made_again_take_their_variants_back and
a_sampler_past_the_limit_evicts_a_kept_instance_first fail at base and pass at the fix on M3 MoltenVK
(13002), lavapipe (12978) and the 780M RADV PHOENIX (12999).
- Repeat create median, base -> fix: M3 142-151 -> 26-29 us; lavapipe 73-107 -> 31-40 us; 780M 87 ->
35-38 us (trivial functions, made on the creating thread).
- Memory per kept instance (trivial functions): lavapipe 333 KiB RSS, 780M 1022 KiB GTT, M3 792 KiB
physical footprint; at 256, about 83 / 256 / 198 MiB.
- fmt, clippy (plain, m2v_gpu, m2v_cpu_icd), rustdoc, and the runtime kept/sampler/memo tests 133/133
at 8667e0874c (msi 12986); later commits are kept.rs doc text only.
Pin recomputed with pin-compute.py; signatures --check and the generated docs unchanged.
Job m3-max-13002 ran three more benches on the M3 (MoltenVK, release):
815.9/23.4, 815.4/22.9 and 814.4/24.1 KiB of physical footprint per
state while the kept set fills and evicts. That is 792 KiB per kept
instance, matching the 794 KiB of the warm run in 12964. The 158 KiB of
the first run (12943), whose functions Metal compiled cold, is the
outlier. The Bounded line now gives 792 KiB, about 198 MiB at the bound.
In the same job, at tip 85a8f6a915, both device tests fail at the base
(KEPT 16, no eviction) and pass at the fix. A repeat took 28 us at the
median against 147 us at the base, and 26-27 us at the full bound.
(cherry picked from commit d6202a9741d7881e11dc4e8223586cd0bd6031ce)
The kept_variants bench on a Radeon 780M (RADV PHOENIX, job
m3-max-12999, two runs alike) reads 1022 KiB of GTT per kept instance
while the kept set fills, and none while it evicts. That is about 256 MiB
at the bound for pipelines of trivial functions. In the same job both
tests fail at the base (KEPT 16, no eviction) and pass at the fix; a
repeat took 38 us at the median with the fix against 87 us at the base.
(cherry picked from commit 85a8f6a91551286de99be1d9802269dc87102d82)
The module's Bounded line now records what a bound of 256 costs and
saves:
- Hit rate: over the guest's 8455 repeats, 16 instances held 157, 128
would hold 8308, and 256 hold all of them. This is an LRU replay of the
boot's key sequence, read in place.
- Memory per kept instance, from kept_variants' release bench (slope
while the kept set fills minus slope while it evicts):
- lavapipe: 333 KiB resident, three runs alike (m3-max-12939, 12960,
12978);
- MoltenVK on the M3: 158 KiB physical footprint in a run that compiled
the functions cold (12943), 794 KiB in a warm one (12964).
- A state made again from a kept instance: 26 to 40 us median, with 64 or
256 kept. Where its VkPipeline was made again (base, KEPT 16): 73 to
151 us. The deque's linear scan does not show at 256, so it is not
indexed.
(cherry picked from commit 2ae24f246570076e79561f0f3ed74d4030ef5192)
On lavapipe the sampler test still failed at the fix (job m3-max-12960).
A diagnostic build (m3-max-12968) showed the kept instance evicted while
the live sampler count stayed at the limit. Where the device links render
pipelines from graphics pipeline libraries, the evicted instance's linked
pipeline is the device's (libraries.rs) and holds its layout, and the
layout holds the samplers it bakes (shared_layouts.rs). settle_device_maps
settled the libraries last, so the layout and its samplers outlived that
settle and the retried sampler was refused. MoltenVK links no libraries,
which is why the test passed there.
settle_device_maps now settles libraries, then modules, layouts and
sampler sets. This also changes kept_or_create's settles: an evicted
instance's linked layout now goes in the same settle instead of the next
program call's.
(cherry picked from commit 8667e0874cda03bd1c282dbee1fb1d02db45bd78)
On lavapipe (job m3-max-12939) the sampler test failed at the fix with
SamplerLimit when making the second state. The first state's kept
instance was not there yet: its creation hands a making to the pool
(pipeline/predicted.rs; the fragment has a texture slot), and that making
holds the variant until it is made. A diagnostic run on lavapipe
(m3-max-12947), with other creations in between, evicted the kept
instance at the limit as intended.
The tests now wait for the device's pipeline pool to hold no piece
(uniform_bind_offsets::idle) after each release, so the variant's release
has reached the kept variants' queue.
(cherry picked from commit 81e905fba89c158ce7c7153cd9e30a3f73e2518e)
A guest's RenderBox made 8455 repeated render states on one cold boot,
each about 1 ms inside our creation, because pipeline/kept.rs held only
16 released variant instances. The distinct keys between a key's use and
its next use were p50 51, p90 74 and max < 256, so every instance was
gone before its key came back (157 of 8455 within 16).
- KEPT 16 -> 256, the guest's whole working set. The memory per kept
instance and the cost at the bound are measured by kept_variants'
bench and go in the module's Bounded line next.
- Each kept instance holds its immutable samplers, counted against the
device's limit. A sampler the device refuses at the limit now evicts
the least recently released kept instance holding any
(Kept::evict_for_samplers), settles the device's maps
(evict_kept_for_samplers), and is made again. This covers a layout's
sampler set (objects::sampler_set) and a sampler state's sampler, after
that state's own spares (SamplerState::vk_sampler). The eviction runs
only in a program's call, where the kept queue is applied in the
program's order; elsewhere the refusal stands as before.
- kept_or_create's four settles are now settle_device_maps, which the
eviction shares.
Tests: kept_variants' two device tests (ec425422d3, 93eb5a8938). Not run
yet.
(cherry picked from commit 4cb4b1e642b49e9021daac5a7275259f447e116b)
Each kept instance holds its immutable samplers, which count against the
device's maxSamplerAllocationCount (SamplerCount) while kept. A larger
bound must not leave a program's sampler refused while a released
state's kept instance holds the room.
a_sampler_past_the_limit_evicts_a_kept_instance_first:
- makes and releases a state whose fragment samples through a constexpr
sampler (device_level's dl_nearest_mips), so its kept instance holds
one sampler;
- takes the rest of the device's count to its limit;
- makes a state over another constexpr sampler (dl_linear_mips), which
must succeed by evicting the kept instance, then releases it;
- makes the first state again, which must evict the second's instance.
Neither state may be taken back. A Taken guard gives the count back
whatever the asserts did.
Without eviction, the second creation is refused with SamplerLimit; the
eviction comes in the next commit. Not run yet.
(cherry picked from commit 93eb5a8938ed8436d4a42d3cee92c1bf7bf065e8)
A guest's CoreAnimation process (RenderBox) releases render states and
makes equal ones again. Over one cold boot, the distinct keys between a
key's use and its next use were 51 at the median and fewer than 256 at
most. kept.rs holds at most 16 released variant instances, so every
instance is evicted before its key comes back. The repeat then makes its
VkPipeline again, about 1 ms each, where Metal answers from its cache.
released_states_made_again_take_their_variants_back makes 64 states of
distinct compiled pipelines (the fixture unspecialized_stage_functions,
fragment_tint 0..63), releases each as it is made, and makes them all
again in the same order on an Exact-wait device. The second round must
take every variant back and make no VkPipeline, shader module or
pipeline layout. The first round makes each predicted VkPipeline at
creation, so the zeros are not vacuous. At KEPT = 16 the test is
expected to fail; the bound comes in the next commit.
what_a_kept_instance_holds, an ignored release benchmark, measures memory
per kept instance from the slope while the kept set fills against the
slope while it evicts, and the cost of a creation at the bound.
spares_bench::process_memory is now shared with these tests, and it
reports VmRSS where /proc/self/status has it, for a CPU ICD that opens no
DRM file.
Not run yet.
(cherry picked from commit ec425422d36ef7eca71e001c6db80ded46b58157)
The float-fold landing (SEMANTICS_VERSION 2007) adds three engine fixtures (sfold_fast, sfold_precise, sfold_fast_poison) and two authored cases, and moves the translations SCCP's float folds reach.
Its product fingerprint follows development's versions at 25401533b9. Blessed on the
M3 (s37-pl.sh censusbless --bless).
(cherry picked from commit f4f5dc9557d97b85e7a1a137680e8ac9326f21c3)
A released state's release now only notes the device's reaper; the first piece giving back after the
release starts the reaper's thread, on the pool's thread (b6aa117ac5, cherry-picked here). A run of an
unchanged artifact differs in which thread pays the reaper's start, so the version moves.
Verified on the Iris Xe (ms01, ANV, Mesa 26.2.6), job m3-max-12868 at b6aa117ac5 (development a59bc7c442
plus the fix), the shape of the job that found it (the runtime suite looped beside the test, 20 min):
- tests::teardown_threads::a_making_running_in_the_pool_leaves_its_release_at_once_and_the_device_to_the_reaper:
0 of 4558 runs failed. The same shape at fc31ffddb7 failed 12 of 4530 and 8 of 4125 (releases 16-32 ms).
- the runtime suite beside it: 11 runs, 2020/2020 each, piece_holds' new assertion (the release starts no
thread, the piece does) among them.
- tests::linear_runs::checked_frames_merge_once failed 1 of 26 with OutOfMemory(Device) at
linear_runs.rs:1024, as before the fix: a separate open bug, not this one.
On an Intel Iris Xe (ANV, Mesa 26.2.6) beside the runtime suite, 20 of 8,655 releases of a render
or compute state whose pool piece was still running took 16 to 32 ms: the release started the
device's reaper thread on the releasing thread, and in the 8 runs timed by part the thread start
took all of it but 0.1 ms, the releasing thread asleep (one voluntary switch). Metal's release
never blocks, and teardown_threads' release bound failed there (12 of 4,530 and 8 of 4,125 loaded
runs).
The release now only notes the device's reaper (an Arc) in the state's holds; the first piece that
gives back after the release starts the reaper's thread, on the pool's thread and outside the
holds' lock, and hands it what it gave back. Where no thread can be started the piece lets go of it
itself, as before. The reaper's thread still starts at the default class (exit_guard::spawn).
Test: piece_holds' release-while-a-piece-runs test asserts the release started no thread and the
piece did. Iris A/B under load: see the land commit.
(Fix written by exitcrash on steelbrain/iris-flakes-wip 78fcea640e, unrun there.)
(cherry picked from commit b6aa117ac559d7b819d885f200d54a66424df61b)
The float-fold landing (SEMANTICS_VERSION 2007) adds three engine fixtures (sfold_fast, sfold_precise, sfold_fast_poison) and two authored cases, and moves the translations SCCP's float folds reach.
Blessed on the M3 (s37-pl.sh bless: bless_engine_inventory, the air_input printouts,
bless_golden_hashes, then the check step).
(cherry picked from commit 26624ae3dccf489e5879c3880de30d8f9c8c1ddd)
The landed block policy (nvreds, steelbrain/nvreds-block-policy caa2b45263, 11 commits) changes what a
run does on an unchanged artifact:
- Pooled blocks are 64 MiB again, 68 MiB for blocks of images (a 2048x2048 RGBA8 texture is 16 MiB +
64 KiB at 64 KiB alignment on RADV and ANV, so 64 MiB holds 3 and 68 MiB holds 4); the making-rate
rule is removed. The small blocks of RT 1984/1993 were the pin 32 regression reims measured.
- Where DriverFact::PlainAllocationsHoldSubmissions holds (RADV on the 780M), a block of plain memory is
first filled through an exportable allocation, freed, so the plain allocation takes the kernel pool's
pages (0.1 ms instead of 9.0-9.5 ms of page fill that held the device's submissions). New counters
WorkCounts::plain_block_fills_saved / plain_block_fills_missed. FAST-PATHS rows rewritten.
Verified by nvreds (jobs named in the branch's commit bodies): 780M A/B 12798, turnarounds >= 8 ms per
phase 12-14 -> 0-2, slowest 32.1 -> 13.8 ms, hold 125-201 -> 0.7-21 ms; tip runs 12852/12860; the
packing test fails without the slack (negative control); clippy, rustdoc, api_signatures, driver_facts,
fast_paths 32/32 (gem10 12903); block_fills, blocks_ahead and memory 27/27 on the 780M (12891); fill
absent with 0 fills on Iris Xe and lavapipe (12851). Pending: Iris Xe + lavapipe on the rebased tree
(12904). Pin recomputed with pin-compute.py; signatures --check and the generated docs unchanged.
tests::block_fills on the Radeon 780M (RADV PHOENIX, Mesa 26.2.6) missed 4 of its 5 fills in job
12841 and 2 of 5 in job 12891 (at the rebased tree of this branch); the fill row said "mostly"
from the first run alone. Documentation only.
(cherry picked from commit caa2b45263277b2696184602298e329291c8b5dd)
The row said a fragmented phase had 1 to 4 turnarounds of 8 ms or more and 1 or 2 missed fills;
job 12852's second run of the bursts arm had neither (0 and 0), so the ranges are 0 to 4 and 0 to
2. Documentation only.
(cherry picked from commit e20985fc7ff241c40edcd55b3c21506b715bb899)
The fill row's numbers were of 64 MiB blocks of images. With the 68 MiB ones made now, on the
Radeon 780M (RADV PHOENIX, Mesa 26.2.6), the kernel's page pools drained before each run, the
reclaim bench's arms (jobs 12852, two runs, and 12860, one run with the fill-window print): a
quiet phase 0 or 1 turnarounds of 8 ms or more, no fill missed, the makings' vkAllocateMemory
1.2 to 2.0 ms in all; a fragmented phase 1 to 4 (the slowest 33.1 ms, behind a missed block
whose allocation took 29.4 ms), 1 or 2 of its 12 or 13 fills missed. Of the 957 submissions
begun while a fill ran (12860), 1 turned around in 8 ms or more (14.0 ms, fragmented); in 12852
a 24.0 ms one began within a 32 ms fill on the fragmented host. The row also says that in a
process that submits nothing the fill mostly misses (tests::block_fills on the 780M, job 12841:
of 5 fills, 1 saved and 4 missed), the cause not measured, and the fill's cost for a 68 MiB
block (about 16 ms on the quiet host, at most 17.3 ms).
(cherry picked from commit 30108c53759b9f76e25c0994e7db3cd4f7de7731)
Verified at the tree of "Memory: pooled blocks stay 64 MiB, 68 MiB for images" (job 12840 on
ms01, the Iris Xe; job 12841 on gem10, the 780M) and at that of "Memory: a block's making time is
the tests' alone" (job 12851 on ms01, the Iris Xe and lavapipe):
- tests::blocks_ahead::a_block_of_images_holds_four_textures_of_a_quarter_block_each passes on
the Radeon 780M (RADV PHOENIX, Mesa 26.2.6; 12841), on the Iris Xe (ANV; 12840 and 12851) and
on lavapipe (12851): eight RGBA8Unorm textures of 2048x2048 lie in 2 blocks of 68 MiB. Each
took 16842752 bytes at an alignment of 65536 on the 780M and the Iris Xe, 16777216 at 64 on
lavapipe. With the slack taken out (a negative control, image blocks of 64 MiB), the test fails
on the 780M (12841) and the Iris Xe (12840): the eight lie in 3 blocks. So the sixteenth stays,
for images.
- tests::block_fills passes on all three: the 780M fills every block of images first (types
0x15864: of 3 blocks of images, 5 plain blocks filled first, 1 made under 1 ms and 4 not, in a
process that submits nothing; 12841); the Iris Xe and lavapipe fill none (types 0x0, 0 fills;
12851).
- The memory, blocks_ahead, zeroed_start, clip_bursts, exported and freed memory,
device_recovery and host_copy tests pass on the 780M (51 of 51; 12841) and the Iris Xe (51 of
51; 12840); blocks_ahead and block_fills on the Iris Xe (8 of 8; 12851), and blocks_ahead,
block_fills and memory on lavapipe under --cfg m2v_cpu_icd (27 of 27; 12851).
- clippy with no cfg, with --cfg m2v_gpu and with --cfg m2v_cpu_icd, the runtime's Rustdoc, the
API signatures and the driver-fact tests (9 of 9): clean (12851). The conformance crate's suite:
1029 of 1029 (12840).
(cherry picked from commit 458aa4a23c3359cc6b44f01812d53a88260f29ba)
The tip's first bench runs on the 780M left turnarounds of 8 ms or more in phases whose blocks'
own allocations took 3.4 ms at most: each phase now says how many submissions began while a fill
ran (its exportable allocation and its free) and how many of those turned around in 8 ms or
more, so that a hold of the fill's own shows apart from the block's allocation.
(cherry picked from commit f2e834c53761892f73865a1771f312fd7765ec39)
Block::took was read outside tests only by the making-rate rule, gone in the commit before, so a
build without tests failed on a field never read (clippy on ms01, plain and under m2v_gpu): the
field, its initializers and the making's start are now cfg(test), as their readers are
(longest_making, makings_took).
device::tests::driver_facts::a_radv_gpu_no_row_names_takes_radv_s_driver_wide_fact_alone read the
780M's own facts without PlainAllocationsHoldSubmissions (job 12840 on ms01: left had it, right
did not); the 780M's set now names it, and the GPUs no row names still take RADV's driver-wide
fact alone.
(cherry picked from commit 0b6b6c49af49a468e0cffe4208f20b3fcd94bb43)
The rule that made a device's later pooled blocks of plain memory smaller once a making took
longer than 8 ms (MAKING_BOUND, MIN_PLAIN_BLOCK_BYTES, Memory::plain_block_made) is removed,
with what existed only for it: placements larger than a pool's small blocks taking blocks of
their own power of two (pooled_block_bytes, Pool::large, took_large), the block's worth of small
blocks kept ahead (ahead_sizes' count), the call's upper bound on the blocks it takes
(ready::Need's most; a call now takes a block of its least bytes or more), and nearness by the
largest block a pool holds (Pool::ahead_room). Every pool's blocks are one size: 64 MiB, or the
device's largest allocation, and a pool of images' 68 MiB, a sixteenth besides
(IMAGE_BLOCK_SLACK, formerly PLAIN_BLOCK_SLACK, now on images alone): a driver's image takes more
than its texels, so that four images of a quarter of a block fit in one.
The hold that rule shortened is taken away by the exportable fill of the commit before, where
the driver holds submissions in plain makings, with the blocks kept at 64 MiB: the 17 MiB blocks
made 45 to 55 makings a phase on the 780M against 13 to 15, holding 138 to 230 ms against 125 to
201 ms, and put every texture past 17 MiB in a block of its own (docs/FAST-PATHS.md).
Tests: tests::plain_blocks goes; blocks_ahead's small-blocks tests go (the reserve of four small
blocks, the large placements' block, the mixed-sizes run made smaller partway); its packing test
now packs four RGBA8Unorm textures of 2048x2048 (a quarter of 64 MiB) to a block of images;
the first-block test runs on 64 MiB blocks. A new device test, tests::block_fills, holds that a
device with DriverFact::PlainAllocationsHoldSubmissions fills every block of images it makes
exportable first, counted, and that a device without it fills none. The reclaim bench's
small-blocks arms go. The conformance cost gate gates device_memory_allocated again (the
BLOCK_SIZE reason goes): block sizes no longer follow how long earlier makings took.
docs/FAST-PATHS.md: the RADV plain-blocks row is rewritten (blocks stay 64 MiB, the hold
measured), a row for the fill is added (its kernel dependency, its counters, the 780M A/B and
its cost), and the NVIDIA memory-block row says one block is kept ahead.
Verified: not yet compiled; the clippy, Rustdoc and device runs follow.
(cherry picked from commit 2cc9b21cb99b3fa7ac3b4199ae2aca88a99e014e)
On RADV on the Radeon 780M a plain allocation's vkAllocateMemory holds every submission of the
process while the kernel fills its pages, under the reservation of the process's GPU address space;
an exportable allocation, a buffer object of its own reservation, holds none, and a freed
allocation's pages reach the kernel's page pool, from which the next allocation of their kind takes
them in a fraction of a millisecond. So on a device with the new cost fact
DriverFact::PlainAllocationsHoldSubmissions (RADV on the 780M, held on the GPU measured alone) that
exports pooled memory as an opaque file descriptor, a pooled block of plain memory of a heap that is
not device-local is made after an allocation of its size and type exportable as an opaque fd, freed
at once (memory.rs, "Blocks filled exportable first"). The block stays the plain one it was. Where
the kernel hands it other pages its allocation fills them as before: performance only.
WorkCounts::plain_block_fills_saved and plain_block_fills_missed count the blocks whose own
allocation then took under 1 ms, and those that took longer. Everywhere else blocks are made as
before.
The reclaim bench's making parts gain the fill, and its phase line the two counts.
Measured on a Radeon 780M (RADV PHOENIX, Mesa 26.2.6, Linux 7.3.1), the kernel's page pools drained
before each run, the reclaim bench (a Private texture made every 16.7 ms beside a command buffer
committed about every millisecond, a quiet phase and one whose free memory lies in single pages),
two runs of each arm, plain blocks of 64 MiB, (b), against (b) with the fill (job 12798; scratch
trees 02e13b7fb and 1cec1742e, this commit's fill over the next commit's 64 MiB blocks, blocks of
images 64 MiB in both). Turnarounds of 8 ms or more a phase (run 1 and run 2), of 17 ms or more, the
slowest of both; the hold, the makings' vkAllocateMemory in all (without the fill the whole making
holds every submission; with it, only the plain allocation after the fill); the blocks' making time
in all. The makings were 13 to 15 a phase, 3 to 5 in the scrolled arm's quiet phase, none in its
pressed one, the same with and without the fill:
| Arm, phase | (b): >=8, >=17, slowest, hold | (b)+fill: >=8, >=17, slowest, hold | Making, (b) / (b)+fill |
|--------------------|---------------------------------|------------------------------------|------------------------|
| 1024x1024, quiet | 13/13, 0/0, 10.9 ms, 126-132 ms | 0/0, 0/0, 1.5 ms, 1.4 ms | 124-130 / 189-195 ms |
| 1024x1024, pressed | 13/12, 1/1, 27.5 ms, 135-139 ms | 1/0, 0/0, 8.8 ms, 2.6-11.1 ms | 136-139 / 242-266 ms |
| bursts, quiet | 12/12, 0/0, 11.2 ms, 125-127 ms | 0/0, 0/0, 1.0 ms, 1.7-1.8 ms | 123-125 / 190-195 ms |
| bursts, pressed | 13/13, 1/0, 17.6 ms, 133-135 ms | 1/0, 0/0, 13.8 ms, 2.2-16.9 ms | 134-136 / 249-250 ms |
| mixed, quiet | 13/13, 0/0, 11.6 ms, 136-141 ms | 0/0, 0/0, 1.6 ms, 1.5-1.6 ms | 125-130 / 189-192 ms |
| mixed, pressed | 13/14, 3/5, 32.1 ms, 184-201 ms | 1/2, 0/0, 9.8 ms, 11.8-20.9 ms | 185-202 / 268-301 ms |
| scrolled, quiet | 2/3, 0/0, 11.6 ms, 36-38 ms | 0/0, 0/0, 1.3 ms, 0.7 ms | 24 / 41-42 ms |
| scrolled, pressed | 0/0, 0/0, 2.8 ms, no making | 0/0, 0/0, 2.9 ms, no making | - |
The turnarounds of 8 ms or more left with the fill are mostly its misses (1 or 2 makings of a
pressed phase whose block filled its own pages, 8.6 to 14.0 ms). Cost per making, on the making
thread (the ready thread, off every submission's way), 1024x1024 quiet: without the fill a 64 MiB
block's vkAllocateMemory took 9.0 to 9.5 ms, 8.5 to 8.9 ms of it on a CPU; with it the exportable
allocation and its free took 13.8 to 14.2 ms first and the plain allocation 0.1 ms, 0.04 to 0.12 ms
on a CPU. Over every arm a block's making took 45 to 74% longer on the quiet host and 33 to 96%
longer on the pressed one. How much of the fill's time is on a CPU was not measured apart.
With this branch's 68 MiB blocks of images (job 12852, two runs, at the tree two commits on, and job
12860, one run with the bench's fill-window print, at the tree three commits on): a quiet phase 0 or
1 turnarounds of 8 ms or more, no fill missed, the makings' vkAllocateMemory 1.2 to 2.0 ms in all; a
pressed phase 0 to 4 (the slowest 33.1 ms, behind a missed block whose allocation took 29.4 ms), 0
to 2 of its 12 or 13 fills missed; of 957 submissions begun while a fill ran (12860), 1 turned
around in 8 ms or more (14.0 ms, pressed). A fill costs about 16 ms a 68 MiB block on the quiet
host, at most 17.3 ms.
Where the fill stays off: tests::block_fills (added in the next commit) on the Iris Xe (ANV, Mesa
26.2.6) and on lavapipe, ms01, job 12851 at the tree two commits on: the fact absent, fill types
0x0, no block filled; on the 780M (job 12841, at the next commit's tree) the fact present, types
0x15864, 5 blocks filled first for 3 blocks of images, 1 saved and 4 missed (a process that submits
nothing; why it misses there was not measured). device::tests::driver_facts holds that only the
780M's RADV identity carries the fact. Not run on the RTX 5080: its NVIDIA identity takes no RADV
fact.
(cherry picked from commit 70d21f2c6eda2f271b186b233e5a614e3e9c2e69)
The remade arm's second making (right after the free) took 9.8 ms at the median on a quiet
780M with the kernel's page pools drained, while the first of each later round took 0.17 ms: a
freed block's pages reach the pool only once a later ioctl finishes its release, and the next
round's first making took them. Two arms ask what follows:
- "remade after a pause" allocates the second REMADE_PAUSE (20 ms of the bench's submissions)
after the free: whether a plain making then takes the freed block's pages;
- "filled exportable" makes the first allocation exportable as an opaque file descriptor, a
buffer object of its own reservation whose making holds no submission, and the second plain
after the pause: whether a plain block takes pages an exportable making filled outside the
reservation the submissions take.
Test-only. Verified: cargo fmt; the runs are in the next 780M job.
(cherry picked from commit b00a1c014f85854185c091a3d9884b142a4c33fd)
To say how long a block's making holds the device's submissions, and which part of it does: a
bench-only record (memory/making_parts.rs, compiled under all(test, m2v_gpu, target_os =
"linux")) of every making in BlockMaker::make_as: the buffer of addresses, vkAllocateMemory with
the time its thread ran on a CPU and waited for one (/proc/thread-self/schedstat), the mapping,
and the buffer's binding, and whether the ready thread made it. Each phase prints those summed
and their slowest, and its slowest makings by vkAllocateMemory, each with the submissions begun
while it ran and the longest of their commit_and_submit and turnaround.
A new arm, "system heap, 64 MiB, remade", frees each 64 MiB allocation at once and allocates it
again, the three timed apart: a making whose pages the kernel kept from the free against one
whose pages it fills.
The ready thread's name is a constant (ready::THREAD_NAME) so the record tells its makings apart.
Verified: cargo fmt; the build and runs are in the next 780M job.
(cherry picked from commit c2104429052ed0abc9f09598dab2a63964bada0a)
For the block-size A/B on the fragmented 780M: each phase now prints, besides the reclaim counts
it had, the kernel's compaction counts (compact_fail, compact_success, compact_migrate_scanned,
compact_free_scanned, compact_isolated), the time some and all of the host's tasks stalled on
memory (/proc/pressure/memory totals), the time every block added took to make summed (a
bench-only Memory::makings_took beside longest_making), the memory the runtime allocated and the
process's VmRSS at the phase's end. /proc/meminfo and /proc/self/status share one field reader.
Test-only: the bench and the counter compile under all(test, m2v_gpu, target_os = "linux").
Verified: cargo fmt; the build and runs are in the A/B job.
(cherry picked from commit a66a789d476550dacab76d84cd73643be8424ba6)
API.md, section 10, Function constants: an fadd, fsub, fmul or fdiv under
nnan whose operand is a function constant bound to a NaN is poison in the
AIR. The translation answers the NaN operand unchanged, as it does without
fast math, where that NaN is Metal's answer. On the M3 Max, Metal drops a
kernel's store of it.
Measured in job m3-max-12877 with case 2d9a7e3091e1f9d9..., which is the
fixture sfold_fast_poison in a scratch corpus:
- Metal on apple-m3-max-macos27.0.1 left every poison row's float and
half store at the 0xCD fill, and wrote the run-value row.
- MoltenVK with the folds wrote the NaN operand unchanged in every poison
row (ffc12345, 7f800321, fd21).
- MoltenVK with the base translator dropped the float rows, and wrote ff21
and 0 in the half rows.
The case is not committed: the corpus compares exactly.
ARCHITECTURE.md: the canon row now says a NaN operand is as it is beside a
value the run computes, and quieted where every operand is a constant.
(cherry picked from commit cddef968a3a8a971341fafcc5469e141fb97b434)
Regenerated by scripts/regen-air-fixtures on m3-max (job m3-max-12874),
Metal 32023.922 with SDK 27.2, as the TOOLCHAIN line already records.
(cherry picked from commit 4da5c5666f7df5f44553153219db4165871434d0)
Metal on the M3 drops the store of every poison row (job m3-max-12861:
"Metal left the selected output exactly as authored"), so the case
observed no effect and could not qualify. A last float row stores the run
value unchanged, which every device writes, so the case qualifies and the
poison rows' answers can be read beside it.
Companions regenerate in the next commit.
(cherry picked from commit bf96b4f9e7e065cc56e6dc23c1552a8d93f00911)
Two cases over the sfold fixtures, each binding both float zeros, a quiet
NaN with a sign and a payload (0xffc12345), a signalling NaN (0x7f800321)
and a signalling half NaN (0xfd21) as function constants. Their outputs
are compared exactly.
What the M3's Metal answers: a fast-math product of a run value by a
zero is +0, half included. A NaN constant beside a run value, without
fast math or in a fused multiply-add, comes out unchanged, signalling
NaNs included. When every operand is a constant, the result is the first
NaN in operand order, quieted.
Verified on m3-max (job m3-max-12861, tip f5ca0e7347):
- sfold_fast b315adcc... qualified on apple-m3-max-macos27.0.1 (output
2869705760...). It matches on apple-m3-max-moltenvk with the folds,
and mismatches with the base translator (d21208a18d, environment kept
out of the corpus).
- sfold_precise ef24dc06... qualified (output dd4385291b...). It matches
with the folds and mismatches with the base translator.
Only the cases, the Metal observations and the apple-m3-max-moltenvk
rows are committed. The base translator's rows were a negative control.
(cherry picked from commit 51355ec9ec71afe81a28721fc43f9848bc23c937)
FloatFmt::widen_bits took a half constant through f64 and back to f32, and the host's float
conversions quiet a signalling NaN: a half constant 0xfd21 was held as 0xffa42000's quieted
twin and stored as 0xff21. Metal keeps the constant's bits (sfold_precise on the M3: a
signalling half NaN beside a run value reads 0xfd21, m3-max-12857, where MoltenVK read 0xff21
before and after the fold). A NaN now widens bit for bit: its sign, and its payload moved
up 13 bits.
Test lower::arith::tests::narrow::a_half_nan_constant_widens_with_its_bits: every half NaN
pattern widens to a NaN that narrow_bits takes back to the pattern (to run).
(cherry picked from commit f5ca0e73479f07761820d8c60a383f2accef6e92)