Commit Graph
3751 Commits
Author SHA1 Message Date
Anees Iqbal 7339729f27 Re-bless the authored compile census at a477c5d857
Pin 36's first landings: border texels in handle-table entries (rt_heap_ow, rt_heap_arg now build) and the heap filter note.

Its product fingerprint follows development's versions at a477c5d857. Blessed on the
M3 (s37-pl.sh censusbless --bless).

(cherry picked from commit ca6311c1aa1951ae6f24422031623ef210468097)
2026-11-10 04:55:40 -08:00
Anees Iqbal be57d7d811 Re-bless the engine inventory and golden tables at a477c5d857
Pin 36's first landings: border texels in handle-table entries (rt_heap_ow, rt_heap_arg now build) and the heap filter note.

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 d221187f37292c153967f0ba737383d427c5bcff)
2026-11-10 04:55:39 -08:00
Anees Iqbal a477c5d857 SEMANTICS_VERSION 2018 and RUNTIME_VERSION 2010, with the runtime-sources pin, for border texels in handle-table entries and the heap filter note
What: abborder (steelbrain/abborder fbfb71b163, the six commits before the last) and overnotes
(2) (steelbrain/overnotes dbc8a2781e, the commit before this one), landed together.
- An argument buffer's texture read through a sampler with a border (an opaque border colour,
  a runtime sampler, clamp_to_zero past a swizzled texture's edge) reads Metal's border
  texels: a bordered heap read uses an Indexed handle (element | entry_index << 16) and loads
  the read flags and border texels (FLAG_BORDER_TEXELS, bits 3..14) from the handle-table
  entry, the slot BorderTexels constant's layout. The runtime's handle tables
  (bind/heap.rs entry_flags) now carry each texture's border texels. The entry stays 16
  bytes, so ARTIFACT_FORMAT stays 499. read-through-heap-border and -heap-sampler were
  refused NotImplemented(ArgumentBufferTextures); read-through-rgba8-swizzled read the
  unswizzled out-of-bounds texel.
- An argument buffer's linear sample announces bicubic-filter-arithmetic only where its heap
  can name a raw-held texture of a form we filter (SpecKey::HeapRawTextures carries two bits).
SEMANTICS 2017 -> 2018 (both branches' bumps met development's 2017); RUNTIME_VERSION 2009 ->
2010 for the table entries; the pin follows.

Verified by the branches: abborder: clippy -D warnings (m2v_gpu, m2v_cpu_icd), rustdoc; the
translator negative control (border bits cleared) fails both table tests; the runtime test
heap_border_texels passes on llvmpipe and fails with the border bits cleared; the whole
read-through family replayed: lavapipe exactly the expected 96 rows, M3 6 exact and 7
announced, RADV 780M 12 announced and 1 exact with 0 element differences; release
translations of the six touched kernels on five profiles at most 0.030 s and 44.5 MiB.
overnotes: 141/141 engine tests (lavapipe cfg), the fix reverted fails all 4 touched tests;
heap_extended_reads and half_write_nans lanes 11/11, the RGBA8 and bfloat dispatches
announcing no note. Here: refusal surface, conformance and Metal coverage regenerated,
api-signatures --check clean. Owed: the M3 re-bless of the engine inventory (rt_heap_ow,
rt_heap_arg) and golden tables, and the two cases' cost records.
2026-11-10 04:46:19 -08:00
Anees Iqbal ff45556bcc An argument buffer's sample filter note holds only where its heap can name a filtered raw texture
What: a heap sample the function emulates (`sampler::heap_raw`) recorded
`PrecisionNote::BicubicFilterArithmetic` whatever the command's heap held: unconditionally
through a constexpr linear sampler, and under the bound sampler's word through a runtime
slot. A command whose heap holds no raw texture samples through the device's own sampler,
and a bfloat form's sample reads the nearest texel, so neither filters by the device's
arithmetic. `SpecKey::HeapRawTextures`' value now carries two bits, which the plan gives
from the command's heap members (`slots::heap_raw`): `heap_raw::HELD` (1, a raw-held
texture: the decode's `DevicePackConversion`, unchanged) and `heap_raw::FILTERED` (2, a
raw-held texture of a form the function filters: not a bfloat one). The filter note's
clauses each test `FILTERED` (beside the bound word's test through a runtime slot).

Runtime: `degrade_bound_values` reads the clause at each draw or dispatch, so a command
whose heap holds only RGBA8Unorm or RGBA16Bfloat textures no longer announces
bicubic-filter-arithmetic for a linear heap sample; one holding a BGRA10XR texture still
does. No runtime code changed (the path is generic).

Tests: heap::a_heap_sample_s_filter_note_follows_the_raw_texture_and_the_bound_sampler_word
(artifact clauses on every committed profile), heap::a_heap_sample_s_filter_note_holds_where_its_command_can_name_a_filtered_raw_texture
(plan values 3/1/0 and the notes bound under them), the decode-note plan test's values
(3 for BGRA10XR, 1 for RGBA16Bfloat), engine_sampler's argument-buffer stage check, and the
lane heap_extended_reads::a_heap_sample_s_filter_note_is_announced_where_its_command_can_name_a_filtered_raw_texture.
Docs: SpecKey::HeapRawTextures, the note's rustdoc, API.md.

SEMANTICS_VERSION 2018 (renumbered at landing).

(cherry picked from commit dbc8a2781ef6170f797d5b7a7a83b46264c5e4e2)
2026-11-10 04:45:12 -08:00
Anees Iqbal 51177a4e20 heap_border_texels: an entry with clear border texels reads (0, 0, 0, 0) past the edge
The module doc said such an entry reads a four-channel format's neutral texel; the negative
control (job m3-max-13584, the binder's border bits cleared) read (0, 0, 0, 0) past every edge
of the R32Float texture through clamp-to-border opaque white. Doc only.

(cherry picked from commit fbfb71b163234dc796f42113911615d5b16ad563)
2026-11-10 04:45:05 -08:00
Anees Iqbal 6b6a6801a3 Runtime device test: an argument-buffer texture reads Metal's border texel through the runtime's table entry
The runtime writes each texture's handle-table entry with handle_entry_flags, which now carries the
texture's border texels (bind/heap.rs). This device test runs that path end to end: it makes an
R32Float texture and an RGBA8Unorm texture swizzled (G, R, 1, 0), names each by its resource ID in
an argument buffer, and dispatches kernel_read_through.ll's rt_heap_ow and rt_heap_zero through
the runtime. It asserts the texel inside and Metal's border texel past each edge: (1, 0, 0, 1)
through clamp-to-border opaque white and (0, 0, 0, 1) through clamp-to-zero for R32Float,
(0, 0, 1, 0) through clamp-to-zero for the swizzled texture. An entry without border texels reads
a four-channel format's neutral (1, 1, 1, 1) and (0, 0, 0, 0).

Compiled under --cfg m2v_gpu or --cfg m2v_cpu_icd. Verification (lavapipe run, the negative
control with the binder's border bits cleared) is in the job named in the report.

(cherry picked from commit 71101c3b3bc4add0717e85519b3b0736e5c9a23d)
2026-11-10 04:45:05 -08:00
Anees Iqbal f5f0075840 read_through: the heap allowance's comment names the argument-buffer texture cases the M3 measured
Verified: M3 Max MoltenVK replay of read-through-heap-border, read-through-heap-sampler and
read-through-rgba8-swizzled (job m3-max-13551): all three announced, set-past-layout-support
alone, REPLAY_RC 0.

(cherry picked from commit 0248252d54da96dfca9e76544394530106c20fc8)
2026-11-10 04:45:05 -08:00
Anees Iqbal 3c5ab3cec6 through.rs tests: as_chunks for the constant-size chunks clippy names
Verified: clippy's chunks_exact_to_as_chunks lint on gem10 (job m3-max-13547) named these three.
(cherry picked from commit 61413e4ea7d981d871fd11bda36b7b30c6a37e18)
2026-11-10 04:45:05 -08:00
Anees Iqbal 6f8456cafe Test: a heap read through a sampler skips only a device's missing heap features, and runs every entry
What: the end-to-end interpreter test of argument-buffer textures read through a sampler skipped
any ArgumentBufferTextures refusal, so a NotImplemented refusal of rt_heap_ow or rt_heap_arg (the
bug it guards) would have passed it unseen. It now skips only a device's missing descriptor-indexing
features and asserts all three entries ran.

Verified: not yet built.
(cherry picked from commit c9e822b7c4a16412f3b4c592bd4a1e5d1ab1e867)
2026-11-10 04:45:05 -08:00
Anees Iqbal 24025b3866 Argument-buffer textures read through a sampler: border texels from the handle-table entry
What: a Metal 4.1 read(sampler, ...) of a texture held in an argument buffer now hands back
Metal's border texel of the resident texture, its pixel format's through its swizzle, for every
sampler: a constexpr one of any border colour, a runtime [[sampler(n)]] and an argument buffer's
sampler (the colour from the sampler's word).
- The binder writes each texture's border texels (metal::sampler::border_texels of its format
  and swizzle, the layout of a slot's BorderTexels specialization) in its handle-table entry's
  flags, bits 3 to 14 (memory::handles::FLAG_BORDER_TEXELS); handle_entry_flags carries them, so
  a consumer's own table of every ID gets them too.
- A module with such a read searches the table in a new indexed form (Lookup::Indexed): the
  handle is the element with the found entry's index in its top 16 bits (HANDLE_ENTRY). The read
  loads the entry's border texels by it (handles::border_texels); every use that reads another of
  the entry's flags (texel class, red-blue order, out-of-bounds alpha) loads them from the entry
  into the flagged handle's layout (handles::flagged_handle), through one typed value
  (texture::emit::HeapFlags) so no reader sees the entry index in those bits.
- through::finish selects the border texel for slots and heap elements alike; a heap member read
  by its raw texels (an extended-range form) takes its border and its zero past the level or
  layer from its own image's addressing inside the raw arm, not the float array's neutral's.
- The old heap path, which selected the out-of-bounds texel (transparent black, unswizzled) and
  refused every other border colour and runtime sampler NotImplemented(ArgumentBufferTextures),
  is gone, with ReadSampler::transparent and the forced alpha flag of such reads.

Why: the M3 runs all three (conformance cases read-through-heap-border, read-through-heap-sampler,
and read-through-rgba8-swizzled's rt_heap_zero, where (G, R, 1, 0) reads (0, 0, 1, 0) past the
edge and we read (0, 0, 0, 0)). A 32-bit heap handle had no room for 12 border bits beside the
element, class, red-blue and alpha fields; the entry does (bits 3 to 14 were unused).

SEMANTICS_VERSION 2017 (translation output changes). ARTIFACT_FORMAT_VERSION unchanged: no
encoded type changed. RUNTIME (for the orchestrator's bump): the runtime's handle tables
(heap_sets.rs, through bind::handle_entry_flags) now carry the border-texel bits.

Ledger: the three rows of these gaps go; llvmpipe's rt_heap_zero row of the swizzled case keeps
only llvmpipe's 8-bit unorm conversion. FAST-PATHS known gap removed; REFUSALS.md,
CONFORMANCE-COVERAGE.md regenerated (METAL-COVERAGE.md unchanged).

Verified: not yet built (next: Linux build, clippy and the touched tests).
(cherry picked from commit bc000fa475e572131248b908541dbe29f1f5996c)
2026-11-10 04:45:05 -08:00
Anees Iqbal acfb2e8d70 Host RAM test: the room at the limit counts the runtime's own pooled blocks made meanwhile
an_allocation_at_the_limit_waits_for_the_untaken_chunks_to_go_back failed on the M3 Max under
MoltenVK (4/4 in full runtime gpucfg suites at 81d7268023; m3-max-13593 at e72579a8b7): 2
buffers made of a room of 3, the next refused at the limit.

The M3 runs (m3-max-13619, alone 3/3 and in the suite, with the work counts printed around the
window) show the give-back itself did its work: all 3 untaken chunks went back before the first
allocation's retry (host_imports_live 4 -> 2, host_ram_chunks_live 2, one wait for the
give-back), and the live count then stayed at the limit for 2.5 s after the refusal, so no free
lagged. The third allocation of the room went to the device's first pooled block, a block of
buffers made ahead that a placement waited for, made once the give-back left room past the
margin (pooled_memory_blocks_made 0 -> 1, buffer_blocks_made_ahead 0 -> 1,
blocks_ahead_waited_for 0 -> 1, memory_blocks_live 0 -> 1). allocations.rs's room_ahead lets the
runtime's own work take that room by design; lavapipe makes no block in this window. So the
test's arithmetic assumed lavapipe's order, not a path the fix misses.

The test now counts the runtime's pooled blocks live at the refusal that were not live before
the object (memory_blocks_live + empty_memory_blocks_live) with the objects' buffers against the
room, prints them, and keeps every other assertion: the untaken chunks went back, only the
objects' chunks were live at the refusal, an allocation waited for the give-back, and the
refusal came at the limit.

Verified: the next potluck jobs (M3 alone and in the suite, a control with the give-back wait
removed, lavapipe).

(cherry picked from commit 75de915a59ff3a3a6d3eb74eeb3d374e1388ae1b)
2026-11-10 04:30:07 -08:00
Anees Iqbal 7b41681b7e Regenerate CONFORMANCE-COVERAGE.md after triage-a's ledger rows
The llvmpipe 3D mirror rows' text and the RADV row of pass-bytes-srgb-decode-all-bytes
(the two commits before this one) change what the coverage document derives.
Verified: scripts/conformance-coverage/coverage.py regenerated it.
2026-11-10 04:15:23 -08:00
Anees Iqbal 248f048fbe known-gaps: the RADV row of pass-bytes-srgb-decode-all-bytes, within device-pack-conversion's bound
The last unlisted RADV line of the conformance replay (log 11-07): the sRGB
decode of every byte diverges on RADV as on the other venues, the MSL
transfer through the device's Pow against Metal's twelve-bit table. Replayed
on gem10's Radeon 780M (RADV PHOENIX, potluck m3-max-13594) and RX 7900 XTX
(RADV NAVI31, m3-max-13588), Mesa 26.2.6: both 'divergent at case/output/words,
1262 elements differ (U32), the largest difference 16318465', not listed (replay
rc 1), and a scratch lane probe shows the two GPUs answer identical bytes.
Element by element against the committed recording: every colour float within
1.22055e-4 of Metal's (half a twelve-bit step is 1.22100e-4), the 126 differing
alpha floats one f32 ulp off (OpFDiv's bound is 2.5), every half within half a
step plus 0.75 half ulp, the alpha halves exact, so within the note's recorded
bound: Open: nothing. Venue 'RADV' names both GPUs, which hold the same answer.

(cherry picked from commit 522e648edc3eadea2041c19d5e053dca8a26bdbe)
2026-11-10 04:15:05 -08:00
Anees Iqbal 0f5d246482 known-gaps: llvmpipe's whole-texel 3D rows are its mirror of a whole-number coordinate
The six llvmpipe rows of sampler-r-address-modes and sampler-axis-mode-triples
whose sites read whole texels other than Metal's said the run could not tell
the device's addressing from a coordinate of ours. A lane-by-lane read of a
replay's bytes against the committed recordings (a scratch probe, lavapipe on
gem10: Mesa 26.2.6, LLVM 23.1.4, x86-64 AVX-512; potluck jobs m3-max-13573,
-13583) settles it: every whole-texel difference is the runtime sampler's
nearest sample at a lane whose coordinate on a mirror-mode axis is a whole
number of texels (1.25 and -0.25 of 4 texels, u = 5 and -1), where Metal reads
the texel Vulkan's wrap of floor(u) names and llvmpipe the one past it, since
it mirrors the normalized coordinate before scaling (25 lanes a mirrored axis,
61 with all three; 1, 4 and 16 apart along s, t and r, 21 where all three
do). No other lane differs by a texel, and RADV and NVIDIA read Metal's texels
at the same lanes (no such rows of theirs), so the texel is the device
sampler's own answer, not a coordinate of ours. The rest of each site is the
constexpr linear sampler's weights, as in the rows that do not mirror.

Description column only: the rows' identities (case, venue, verdict, site,
answer) are unchanged, so the replay holds them as before (the same job's
replay of both cases on gem10's llvmpipe: 'exactly the open gaps
known-gaps.tsv expects', rc 0). The LLVM 21.1.8 rows (repeat 48, borders 5)
were not run here; their values match RADV's diagnosed subnormal -r lane,
unverified.

(cherry picked from commit 93b8e4b2d98ec4c8aa09b2db18e9d718308704bb)
2026-11-10 04:15:05 -08:00
Anees Iqbal 5e51dc6023 METAL-COVERAGE names the macOS 27.2 SDK its table was checked against
coverage.py's SDK line still said the macOS 27.0 SDK (Xcode 27.0, 27A266a),
while the M3 has Xcode 27.2 (27B52) and its MacOSX27.2.sdk; the generated
enum tables already name 27.2. The table needed no row change: on the M3,
coverage.py --sdk against MacOSX27.2.sdk answered 'coverage.tsv names every
SDK item (2135)', rc 0 (potluck job m3-max-13567). docs/METAL-COVERAGE.md
regenerated (coverage.py), coverage.py --check current.

(cherry picked from commit ca8424427caaa8636587eb5593e7b91b68afe9b1)
2026-11-10 04:15:05 -08:00
Anees Iqbal e72579a8b7 Re-bless the authored compile census at 1e763e3d52
Pin 35's final census, after its cost re-bless.

Its product fingerprint follows development's versions at 1e763e3d52. Blessed on the
M3 (s37-pl.sh censusbless --bless).

(cherry picked from commit 28701b61b5f8fabd50d21c48966a7f084e923173)
2026-11-10 03:57:53 -08:00
Anees Iqbal 1e763e3d52 Conformance: no case owes a cost record after the re-bless at 24ae90feb3; the census figures it reads
The whole-set cost --write at 24ae90feb3 (85612a40d0) recorded the 13 cases AFTER_THE_LAST_RUN
named (11 padded-fetch, 2 extended-range mipmaps), so the list is empty again; with it left,
every_case_carries_a_cost_recording fails as it did at edabbc0b2c.

cost.rs's census figures are read off the re-blessed recordings (a Python reading of the same
rows census() builds: creation_pipelines_made > 0, classed by the records' cmd_draw and
cmd_dispatch bounds): 607 rows, 1,485 made, 958 taken, 527 by none (64.5%); the draws class
222 rows, 894 made, 863 taken, 31 by none (96.5%); the other classes unchanged. The two
render-then-sample-magnified rows composed 2 made and 2 taken, but their bounds still read 3,
so the draws ceiling stays 31 and WASTED 595.

Verified: the Linux conformance suite at the next tip.
2026-11-10 03:44:30 -08:00
Anees Iqbal 85612a40d0 Re-bless the cost records at 24ae90feb3
499 recording(s) whose bounds moved. The records after pin 35's landings: smallfix2 makes one pipeline per half-converting creation (render-then-sample-magnified-nearest and -linear, 3 made -> 2), unknowns-491 drops the bicubic note from the 10 nearest-sample cases, sparechurn keeps its spares, and 13 cases were owed records (11 padded-fetch, 2 extended-range mipmaps).
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 ccaf4936104237b9c6838ef1cfb3b679461ffa4d)
2026-11-10 03:42:53 -08:00
Anees Iqbal 81d7268023 The runtime-sources pin for the memory comments that match the staging path
c8b76505d6 (smallfix2) changes comments only in memory/ready.rs and texture/host_copy.rs
(and tests/zeroed_start.rs): the XTX's host-path figures scoped to where they were measured,
and the suspend bullet pointing at the device-resume known gap. No behaviour: RUNTIME_VERSION
stays 2009, only the pin moves.

Verified: pin-compute over the tree; smallfix2's clippy with --cfg m2v_gpu and --cfg
m2v_cpu_icd at c8b76505d6 (m3-max-13554).
2026-11-10 03:41:45 -08:00
Anees Iqbal e3608008ac Runtime docs: the suspend and host-copy figures say which path they hold for
memory/ready.rs, tests/zeroed_start.rs and texture/host_copy.rs still
described a texture's first CPU write after a runtime suspend through a
host copy on the RX 7900 XTX, and ready.rs's last bullet pointed at a
FAST-PATHS known gap (the moves back after a suspend) that no longer says
so. The XTX copies its color textures on the staging queue
(texture/staging_copy.rs; tests::cpu_copy_times asserts it and job
m3-max-13545 printed "copied on the staging queue"), so the host copies'
pool holds no image there.

- ready.rs: the kernel's clear and its trace figures (516 to 684 ms, 160 us
  awake) are stated as measured in the XTX's device-local memory, with the
  note that the pool serves no image on that GPU and that a first touch's
  wait is unmeasured on the devices whose color textures copy on the host.
  The suspend bullet now says what holds: the next submission after a
  runtime suspend waits for the kernel's resume, which no block made ahead
  spares (docs/FAST-PATHS.md's known gap, measured in m3-max-13545).
- zeroed_start.rs: drops the instruction to run after a 5 s idle to see the
  suspend case (that case is no longer on the XTX's path) and says what the
  test holds where a color texture copies on the staging queue (NVIDIA's,
  the XTX's).
- host_copy.rs: the same figures scoped the same way; the 516 to 684 ms
  sentence goes, its reason kept as "a first touch may wait for the
  memory's kernel work".

Comments only. Verified: cargo fmt; clippy for the runtime under
--cfg m2v_gpu and --cfg m2v_cpu_icd at this commit (job below).

(cherry picked from commit c8b76505d664cd23091f0b233f208ab8decfdf9e)
2026-11-10 03:41:31 -08:00
Anees Iqbal 2c31428f3c Measure a texture's first CPU copies after a runtime suspend; the known gap is the device's resume
The XTX's first get_bytes after the GPU idled into runtime suspend took 4.7 to
5.2 s. A run decides whose that is: any first submission after the suspend
pays it, so it is the kernel's resume of the device, not our staging queue.

tests::cpu_copy_times gains an ignored measurement, run by name: per size
(1920 x 1080 in a pooled block, 4096 x 4096 in a block of its own) it makes a
Shared BGRA8Unorm texture, copies it awake once, then for three sequences,
each twice, waits for the PCI function's power/runtime_status to read
suspended and times each step: replace_region then get_bytes; get_bytes then
replace_region; a fill command buffer on the program's queue (commit timed
apart from its wait) then both copies. It prints the status after each step
and the staging submissions made.

Evidence, RX 7900 XTX on gem10 (Mesa 26.2.6, autosuspend delay 5000 ms),
job m3-max-13545, two runs, 24 suspends:
- the program queue's command buffer: commit 0.12 to 0.52 ms, its wait 4.83
  to 4.86 s;
- the staging queue: replace_region returned in its awake time (0.48 to 12.74
  ms at 1080p, 5.02 to 5.58 ms at 4096^2) with the device still suspended,
  and the get_bytes after it, the first staging submission, took 4.73 to
  4.79 s; get_bytes first took 4.76 to 4.88 s;
- after the command buffer woke the device, get_bytes took 3.2 to 4.0 ms
  (1080p) and 18.7 to 20.8 ms (4096^2).
The kernel's log of the run's last resume: SMU resumed at :09, "Wait for DMUB
auto-load failed" at :10, 16 "DMCUB error" lines to :13, "Cannot find any crtc
or sizes", then the rings: the card has no display attached.

Paying it ahead off the caller's path: a commit already hands its batches to
the scheduler thread and returns in under a millisecond, so only a wait or a
synchronous read waits. A wake started when a replace_region queues its copy
would win only the time between that call and the next submission (none in
the measured sequences) against a 4.8 s resume, and the program's queue and
the staging queue pay alike, so no queue choice avoids it. A keep-alive is
out. No runtime change.

docs/FAST-PATHS.md's known gap is rewritten with these numbers; its 86 ms
and 73 ms first replace_region of the host path no longer apply on the XTX,
whose Shared textures copy on the staging queue (replace_region now
returns in its awake time after a suspend).

(cherry picked from commit 112b405a9167666407ae15cd08b7bdf76d09d038)
2026-11-10 03:33:55 -08:00
Anees Iqbal 8acaad4eb5 Allocations test: the slow give-back's thread starts through exit_guard::spawn, and the pin
an_allocation_at_the_limit_waits_for_the_give_back_under_way (d93fecb6ad's test, in
allocations.rs's unit tests) started its thread with std::thread::spawn, which
tests::exit_guard::threads_and_the_program_s_code_go_through_the_guard reads as a runtime
thread started outside the guard. It now starts through crate::exit_guard::spawn. Test-only:
RUNTIME_VERSION stays 2009; the pin follows the file.

Seen: dv-suites and dv-lvp at c79814eb0d (jobs m3-max-13533 and 13534), the one failure in
each: "threads started elsewhere: allocations.rs: thread::spawn(move||...". Verified: no
thread::spawn( or .spawn( left in runtime sources outside exit_guard.rs and src/tests; the
suites at the next tip run the test.
2026-11-10 03:32:45 -08:00
Anees Iqbal 24ae90feb3 SEMANTICS_VERSION 2017 for an extended-range sample's filter note that follows the bound sampler word
What: the three commits before this one (unknowns-491, steelbrain/unknowns-491 5f6a65c35c).
An extended-range or padded sample through a runtime sampler slot (the slot's variant and the
argument-buffer raw-element path) specializes BicubicFilterArithmetic on the bound sampler
word (linear::filtering_word, as the YCbCr filter note does); the level blend tests the linear
mip filter alone. A constexpr linear sampler keeps the note; a constexpr nearest one records
none. No runtime code changed. SEMANTICS 2016 -> 2017 (the branch's 2016 met development's).

Why: rgb10a2-srgb-samples announced bicubic-filter-arithmetic through a nearest sampler (an
over-note, triage 491).

Verified (unknowns-491): on the M3 (13478) the lanes 7/7, nearest samples announcing no
bicubic and linear ones announcing it; lavapipe (13512) lanes 37/37, replay of the 20 sample
cases exit 0 (the allowance on all 10 linear cases, no nearest case), negative controls
(select.rs and linear.rs reverted) failing both new translator tests and the rgb10a2 lane,
metal2vulkan suite 3428/3429 before the test-only fix 5f6a65c35c. Here: pin unchanged;
refusal, conformance and Metal coverage generators unchanged; api-signatures --check clean.
Owed: the 10 nearest cases' cost records still list the note until the whole-set re-bless.
2026-11-10 03:18:31 -08:00
Anees Iqbal 2f60a30a45 Test: an argument buffer's runtime-sampler stage holds its filter note under the bound sampler's word
engine_sampler::normalized_and_cubic_stages_record_no_note_their_states_cannot_run listed
BicubicFilterArithmetic among argument_buffer_runtime_sampler's unconditional notes on
moltenvk-m3. Since the note follows the bound sampler's word, it is specialized there; the test
now checks that every specialized BicubicFilterArithmetic clause tests SpecKey::BoundSamplerWord.
Found by job m3-max-13512 (the only failure of 3429 metal2vulkan tests).

(cherry picked from commit 5f6a65c35c4d82c81ec832f3b028a802e63a0983)
2026-11-10 03:17:34 -08:00
Anees Iqbal 7187a74c6b Test: the bound-word note test's words table no longer shadows the constexpr words helper
(cherry picked from commit 5624d76f19f8f0b8738b5d81642fccfecb794d6b)
2026-11-10 03:17:33 -08:00
Anees Iqbal 445d410eda An extended-range sample's filter note through a runtime sampler follows the bound word
What: a sample of an extended-range or padded texture that the module filters itself
(`sampler::extended`, through the slot's variant, and `sampler::heap_raw`, through an
argument buffer's raw element) recorded `PrecisionNote::BicubicFilterArithmetic`
unconditionally through a runtime sampler slot. It is now specialized on the word of the
sampler bound at that slot (`NoteOn::BoundSampler`, `SpecKey::BoundSamplerWord`), with the
two tests `linear::filtering_word` gives, as the YCbCr filter note does: a linear
minification or magnification filter, anisotropy or a cubic filter (any of those bits), or
a linear mip filter. The level blend of a word-stated mip filter holds on the linear mip
test alone. A constexpr sampler keeps its rule (linear: unconditional; nearest: none).

Runtime: the clauses test a bound value, so `Device::degrade_bound_values` reads them at
each draw or dispatch of the variant (no runtime code changes: the path is generic, and
`slots::record_noted` already records the word for a noted key). A nearest runtime sampler
over such a texture no longer announces bicubic-filter-arithmetic; a filtering one still
does.

Why: a nearest sample is the decoded texel at Metal's position (no filter arithmetic), yet
it announced the note, so the conformance suite's nearest cases
(`rgb10a2-srgb-samples-nearest-*`, the eight `xr-two-plane-samples-*-n*-*`) declared it.

Tests: engine_extended_range::samples::a_runtime_sampler_s_filter_note_holds_only_where_the_bound_word_filters
(every form, half and float, runtime / constexpr linear / constexpr nearest, on lavapipe,
moltenvk-m3 and the RTX 5080 profile: clauses hold for linear, linear min, linear mag,
linear mip, anisotropic and cubic words, not for nearest or nearest-mip ones; bfloat forms
record none) and heap::a_heap_sample_s_filter_note_follows_the_bound_sampler_word. The
rgb10a2_srgb lane now checks its nearest samples announce no filter note. The conformance
allowances of the rgb10a2 sRGB and two-plane sample cases name the note for the linear
cases only. Docs: the note's rustdoc and API.md's catalogue entry.

SEMANTICS_VERSION 2016: an artifact's notes change.

(cherry picked from commit fd5212bee216b823ba18d3c5ba5e5a74a4b12073)
2026-11-10 03:17:33 -08:00
Anees Iqbal c79814eb0d Re-bless the engine inventory and golden tables at ab281552db
Pin 35's landings: the padded-fetch fixture's engine inventory (pfx_fetch), the census after SEMANTICS 2016 and RUNTIME_VERSION 2009.

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 8ace05dc4496ef0498cc38c046fd6f12c5d9b5f4)
2026-11-10 03:16:55 -08:00
Anees Iqbal 7c5a6901aa Read the kept-block counts once the blocks made ahead are made
What: tests::memory_frees::a_buffer_with_a_block_of_its_own_keeps_it_for_the_next_of_its_size
failed once in 22 runtime-suite runs on the Iris Xe (ms01), "left 5, right 4". The device's
first creation call (the test's first new_buffer) starts blocks made ahead on a thread of their
own (memory/ready.rs), each a vkAllocateMemory that the device's counts hold, and the test
reads object_churn.vk_memory_allocations before and after the next buffer of its size to say
that buffer allocated nothing. Under load a making still pending at the first reading landed
between the two: "the next buffer of its size took the kept block", left 5, right 4. The test
now waits until no block is being made ahead (Memory::readying_ended, as tests::zeroed_start
does) before its readings.

Verified on the Iris Xe (ms01, Mesa 26.2.6, --cfg m2v_gpu, jobs m3-max-13493 and 13525):
- Not reproduced as committed: 0 of 40 alone and 0 of 568 beside a runtime-suite run. A scratch
  probe of the counts at each reading showed readying_ended false at all three, and
  vk_memory_allocations at 5 in a run alone against 4 beside the suite: a making ahead still
  pending through the whole test.
- Negative control, a scratch copy of the old test with that pending making let land between
  the two readings (a wait for readying_ended there): failed 6 of 40 alone and 145 of 222
  beside the suite, every time with this commit's message, "the next buffer of its size took
  the kept block", left 5, right 4 (allocations 4 at the first reading, 5 at the second).
- This test: 0 of 40 alone, 0 of 222 beside the suite (2029 of 2029 passed).

(cherry picked from commit 448c3ce0a20d02a00d4156c5f5d481abc6425d13)
2026-11-10 03:16:30 -08:00
Anees Iqbal ab281552db RUNTIME_VERSION 2009 and the runtime-sources pin for the predicted plain half arm kept in a key's general form
What: the two commits before this one (smallfix2 items 4 and 1, steelbrain/smallfix2
0c4c87e6b0). PlainHalfTexels is no longer a general-form constant: the predicted key is its
own general form, so a half-converting pipeline creation on MoltenVK makes one pipeline, not a
predicted one plus a general form that no draw takes. A BC/ASTC draw still takes a pipeline at
once (its general form is the predicted key); a YCbCr-on-grid-8192 draw makes its own key at
the draw. And a test-only fix: dirty_pages_device's loaded-area test fails at once when its
pass panics. RUNTIME_VERSION 2008 -> 2009; the pin follows.

Why: render-then-sample-magnified-{nearest,linear} made a general-form pipeline no draw took
(conformance cost.rs named it an open bug); the dirty-pages test hung instead of failing on
the XTX.

Verified (smallfix2): M3 (13511/13518) magnified-nearest and -linear creation_pipelines_made
2 against the record's 3, drawn 2 against 2, both in order and alone; whole-set conformance
replay exit 0, exactly the expected open gaps; 77 touched tests under m2v_gpu; um790 clippy;
tests::general_form fails with the old residual.rs (negative control). XTX (13517): with a
panic injected the old test ran until the 94.7 s timeout, the new one failed in 0.21 s; the
real test passes in 0.57 s. Here: pin-compute, api-signatures --check, refusal surface
unchanged. The cost records still read 3 made until the next whole-set re-bless.
2026-11-10 03:08:36 -08:00
Anees Iqbal 7ba3245f34 Let a_pass_storing_its_loaded_area_keeps_a_cpu_write_beside_it fail at once when its pass panics
What: the test runs a writer thread inside std::thread::scope that stores until a flag is
raised, and raised the flag only after pass() returned. A panic in pass() (getbytes saw one on
the RX 7900 XTX) unwound past the store, and the scope, which waits for every thread it started
before it unwinds, waited for the writer for ever: the test hung instead of failing. The flag
is now raised by a guard (Stops) as the main thread leaves the scope, a panic's unwind
included, and the main thread's wait for the writer's first store also ends where the writer
ended (a writer that panicked never starts), whose join then fails the test.

Verified on the RX 7900 XTX (gem10, RADV, Mesa 26.2.6, --cfg m2v_gpu, job m3-max-13517), with
two scratch copies of the test that panic in place of pass(), each run alone under
`timeout 90`:
- the old shape (negative control): still running past 60 s, killed by the timeout after
  94.7 s (rc 124);
- this shape: failed after 0.21 s (rc 101), the injected panic's message reported;
- the test itself passed in 0.57 s (8 of 8 merge dispatches in whole blocks).

(cherry picked from commit 0c4c87e6b02656b86ee9f43ef4d67b0d391bd864)
2026-11-10 03:07:56 -08:00
Anees Iqbal 6be4be9791 Keep the predicted plain half arm in a key's general form: a creation makes one pipeline, not two
What: on a device that samples through Metal's own texture unit (MoltenVK), a texture slot a
function converts to `half` declares SpecKey::PlainHalfTexels and SpecKey::UnmeasuredTexels.
The general form (render/residual.rs) zeroed both, so a state's creation made its predicted
key's general form (the class routine's arm, PlainHalfTexels 0) and handed the predicted key
itself (the plain arm, 1, as an unbound slot takes) to the pool right after. Every draw of a
plain class takes the predicted key, so the general form served a draw only while the
predicted key was still being made; the conformance cases render-then-sample-magnified-nearest
and -linear made it and no draw took it (cost.rs named it an open bug). PlainHalfTexels is no
longer a constant of the general form: a key keeps the plain arm its binding gives it. The
predicted key is now its own general form, and the creation makes that one pipeline.

What still takes a general form: a draw binding a class whose `half` conversion is not
measured (BC4 to BC7, the linear ASTC formats) keys UnmeasuredTexels 1, which no instruction
reads; its general form is the predicted key, made at creation, so it draws at once and runs
its own key's instructions while its own is made on the pool, as before. A draw binding a
YCbCr field on the grid 8192 (PlainHalfTexels 0) makes its own key at its draw, as any key the
creation did not predict; on a device whose memory is the host's such a slot reads its planes
in place in a variant of its own (VariantKey::ycbcr_in_place), which no creation predicts
either.

Tests: tests::general_form now expects the plain arm kept ([1,1,1,5,3] -> [0,1,0,5,3], an
unmeasured plain class's key -> the predicted key, a YCbCr class keeps the routine's arm); the
made_at_creation lane expects one making at creation on every device (it expected two on
Metal-sampler devices) and the unmeasured-class draw to take the predicted key as its general
form; ycbcr_textures' and runtime_lane's comments follow. Docs: residual.rs, predicted.rs,
WorkCounts::residual_form_draws, API.md's general-form bullet, and cost.rs's open-bug
paragraph (the recordings read 3 made until the rows' next measurement; WASTED_BY_CLASS's
draws ceiling can then drop by 2).

Verified on the M3 Max (MoltenVK 1.4.2), the same diff at 3e0db77c6f over 6f7bb169d2:
- conformance cost --runs 8 --show, each case, in order and alone (jobs m3-max-13511,
  13518): render-then-sample-magnified-nearest and -linear read creation_pipelines_made 2,
  creation_render_pipelines_made 2, variant_pipelines_made 2 (the record holds 3 of each),
  creation_pipelines_drawn 2 (the record's 2): the pipeline no draw took is gone, every
  pipeline made is drawn.
- conformance replay, the whole set (70 s): exit 0, "the 391 row(s) above are exactly the
  open gaps known-gaps.tsv expects on this venue": no case's answers moved.
- 77 touched tests under --cfg m2v_gpu passed: made_at_creation, ycbcr_textures' creation-made
  slot, pipeline_creation's pool draws, draw_work, general_form, uniform_bind_offsets,
  draw_again, draw_shape_notices.

(cherry picked from commit 56ddedfc3498c9376384a3ad4b57e7607d78594a)
2026-11-10 03:07:56 -08:00
Anees Iqbal 78bc51ad11 RUNTIME_VERSION 2008 and the runtime-sources pin for spares that keep their last seconds' uses
What: the three commits before this one (sparechurn, steelbrain/sparechurn 554f658f3b). A
command pool given back keeps, per level, the most of its last 8 uses, its current 1 s span
(RECENT_FOR) and the span before, so a primary a submission records every few dozen uses is
kept rather than freed and remade. A peak falls back two spans later. HELD (4,096) and the
10 s idle shed are unchanged. RUNTIME_VERSION 2007 -> 2008; the pin follows.

Why: since ac9e2adf62 a steady workload freed and remade a command buffer about every 30 ms
(record_raw's extra primary, freed past the 8-use window): scroll_bos on the 780M counted
501 and 509 scheduler-thread RADV command-buffer pairs in 15 s (11-16 before ac9e2adf62).

Verified (sparechurn): scroll_bos on the 780M 501/509 -> 19/14 pairs, frees past recent uses
487/496 -> 4/3; tests::spares 17/17 on lavapipe, the 780M, the Iris Xe and the M3; the
control (the spans keeping nothing) fails exactly the 3 new tests on the 780M and the Iris;
held count grows to 65 (128 on the M3) and falls to 2 after idling; HELD still 4,096;
runtime fmt, clippy (three configurations) and rustdoc clean. Here: pin-compute,
api-signatures --check, refusal surface unchanged.
2026-11-10 03:04:36 -08:00
Anees Iqbal d0462a4aa2 Spares latency: each round waits past its burst's spans
The measurement's last command buffer of each round is the one whose give-back
frees the burst's command buffers. A pool now keeps what its uses in its
current and last span of RECENT_FOR handed out, so the round waits two spans
after its burst, where it waited SETTLE, for that give-back to free them still.

Not run: an ignored measurement, compiled by the m2v_gpu clippy leg.

(cherry picked from commit 554f658f3b48cfe5c7158bff4260c491683951d2)
2026-11-10 03:03:57 -08:00
Anees Iqbal 0114346817 Spares: a pool keeps what its uses in the last one to two seconds handed out
Kept by its last eight uses alone (RECENT_USES), a command pool freed what a
use took again a few dozen uses later, and made it again then: under
tests::scroll_bos a RADV command buffer (an 80 KiB IB and a 16 KiB upload BO)
was freed and made again about every 30 ms on the scheduler thread, 505-510
pairs in 15 s where 11-16 were before ac9e2adf62.

A pool given back now also keeps, of each level, as many command buffers as
the most one of its uses in its current and its last span of RECENT_FOR (1 s)
handed out. A peak still falls back: two spans on, and once it left the last
eight uses. The HELD bound (4,096) and the idle shed are unchanged.

Tests: the window test now gives its small uses past the large one's spans;
new CPU tests for the spans' bounds and for a steady workload whose every
15th use takes a second primary (2 made, 0 freed; 167 made without the
spans); a device test of a steady workload (every 30th command buffer of
two blit encoders) that makes no command buffer once warm; the burst test
grows to its burst and idles past the spans before falling back, and the
kept-barriers test idles past them too.

(cherry picked from commit 318e36ab8df1926f2eda4892bc07d09deffb7980)
2026-11-10 03:03:57 -08:00
Anees Iqbal 45f0a2adc5 Spares tests: the command buffers allocated by place and freed by cause, printed by the scroll
A device's command buffers are counted by the place that asked for them
(DeviceShared::allocate_command_buffers and the calls that hand theirs on,
track_caller under test alone), and its spares' frees by why: past a pool's
recent uses, past the bound, shed (Spares::churn, for the crate's device
tests). tests::scroll_bos prints them beside the command buffers begun for a
batch's barriers, for kept barriers and ahead: ac9e2adf62 made the scroll's
scheduler thread allocate a command buffer pair about every 30 ms, and these
say which give-back freed what the next use made again.

(cherry picked from commit 5ebbfd9e6df343b65fc18d4bf3acfbe750ad7ece)
2026-11-10 03:03:57 -08:00
Anees Iqbal eff1d8794e Runtime lane: the device-commands and two YCbCr in-place tests take the queue plan
Each places a second command queue (device_commands' overwrite commits on a new queue; the
two YCbCr tests make a queue per surface), so under the lane's queue limits (one round-robin
VkQueue) the device announced metal2vulkan-queue-limits-reached, which fails a run. As
LANE_QUEUE_LIMITS' doc says, such a test makes its device at its plan (at_plan). Test-only.

Seen: the M3 lane at edabbc0b2c (job m3-max-13497), 1907/1912, these 5 failing on the
announcement alone (layer_claim.rs:293). Verified by the M3 lane at this commit (below).
2026-11-10 03:02:55 -08:00
Anees Iqbal 51ae45ea4c SEMANTICS_VERSION 2016 and RUNTIME_VERSION 2007, with the runtime-sources pin, for the triage's decided entries
Translation (2016; xrblend2 took 2015): a float ldexp records no NativeNanEncoding, since its
lowering answers Metal's NaN itself; a half read of a 32-bit or small float texel records no
NaN note where the device's half is Metal's; a mesh pipeline's required object size answers
as Metal's first compile.
Runtime (2007): an allocation at maxMemoryAllocationCount waits for the untaken ahead chunks'
give-back instead of being refused; a head held for a kept group's signal goes with the
group; the mesh pipeline's required-size state follows Metal's first compile.

Verified by the branch (steelbrain/unknowns, gate m3-max-13466 on gem10 at the pre-rebase
tree): metal2vulkan suite 3427/3427, lavapipe lanes 33/33, runtime tests 36/36,
conformance 1050/1050, negative controls failing as they should; M3 runs 13458 and
others. Here: pin-compute, refusal/conformance/Metal coverage generators unchanged after
the stack, api-signatures --check clean.
2026-11-10 03:00:58 -08:00
Anees Iqbal e14253045b CONFORMANCE-COVERAGE.md regenerated for the extended-range mipmap cases and their ledger rows
Regenerated by scripts/conformance-coverage/coverage.py in job m3-max-13466 at 94a89c5273
(gem10, lavapipe cfg): two more recordings (1265), 23 more ledger rows (3484), and the
blit_encoder_commands family's case count (11). The conformance crate's tests passed against
it there (1050 of 1050).

(cherry picked from commit 0bbbd5f379db297f84df60b129b15a4e6e1222d5)
2026-11-10 03:00:00 -08:00
Anees Iqbal a8246e9b25 Conformance: the extended-range mipmap cases' timings
conformance times --runs 8 --write over the two cases on the M3 Max (m3-max-13458, both legs,
load average 16.46 on each, as each record says): 2 within 10x. every_case_carries_its_timing
now finds a record for every case.

(cherry picked from commit 889f5424a0e5679305ba8a58dd7d750f4178f45c)
2026-11-10 02:59:43 -08:00
Anees Iqbal 782da3582b A half read of a 32-bit or small float texel records no NaN note where the device's half is Metal's
On MoltenVK on the M3 Max (m3-max-13447, default policy) half-texel-nans-r32f, -rgba32f,
-rg11b10f and -rgb9e5f answered every value as Metal does and still announced
device-nan-encoding; runtime_lane::half_texel_nans read 0 differing half lanes. The profile takes
DriverDeviation::MetalHalfConversion, whose measurement covers the half result of a read, sample
and gather of every float word of RGBA32Float (NaNs among them) and 16,384 random words each of
RG11B10Float and RGB9E5Float.

half_texel_nans now records DeviceNanEncoding on such a profile only where the bound class is a
half-float one (packed field 0) or of no family, and requires VkProperty::MetalHalfConversion;
elsewhere it keeps the one clause of TexelFormat::NAN_FREE. The 16-bit float formats keep the
note: no deviation records their NaN payloads as measured.

Test: engine_texture's half-read test checks both forms per committed profile (clauses, formats
that hold, the property) and that a profile of the deviation ran. Docs: the note's rustdoc,
API.md's exemptions, the storage_properties doc. Under the branch's SEMANTICS_VERSION (2015).

(cherry picked from commit b03555f8c9f05e382f744593cfaa01f2dc3bbb20)
2026-11-10 02:59:43 -08:00
Anees Iqbal 9eae0f923a Conformance: the extended-range mipmap cases' lavapipe rows, and their owed cost records
Replayed on lavapipe (llvmpipe, LLVM 23.1.4, gem10, m3-max-13428): the round trip and level 0 of
blit-generated-mipmaps-bgr10xr and -bgra10xr are Metal's bytes; levels 1 to 5 (BGR10_XR) and 1 to
6 (BGRA10_XR) differ by one code of a 10-bit field, the device's blit-chain filter announced as
device-filtered-mipmaps. Eleven llvmpipe rows record those measures with the M3 rows' words.

every_case_carries_a_cost_recording names the two cases among those authored after the last
whole-set cost --write, which pays their records.

(cherry picked from commit d1145f9ad875ef352f94a346f24efdbd3ec59274)
2026-11-10 02:59:43 -08:00
Anees Iqbal 987e29f36a A head held for a kept group's signal goes with the group: the group's doc says so, the lane test takes its plan
The kept-group test's two queues now take the device's queue plan (at_plan): under the lane's
limits the M3 placed the second queue on the shared VkQueue and announced
metal2vulkan-queue-limits-reached, which the layer claim refuses (m3-max-13447). On lavapipe's
one VkQueue the scenario is unchanged. The test now also reads what it printed only: Y completes
after X, and on a shared VkQueue no group went for a waiting head.

group.rs says what the test measured: a head of another queue held only for a value a batch of
the kept group signals (HeldFor::EventValue) does not send the group; it goes once the group
does, at the completion turn that leaves one submission in flight at the latest, its wait then
on the VkQueue. Its "for a signal to land" is a checked head's landing wait. No behaviour
changes.

Evidence (lavapipe, gem10, m3-max-13428 at 9b2076ec54): kept 1, sent while B ran, Y 504 us after
X, group ends [0, 0, 0, 0, 1, 0, 1] (none for a wait).

(cherry picked from commit d8bfd83a3e09aaa2d6731390037c5e4abf19389c)
2026-11-10 02:59:32 -08:00
Anees Iqbal d8fa749f3d Runtime lane: the mesh test's required-size state follows the limited state's last check
The required-size state was made between the limited state's two required-size checks, so the
mesh one read the new state (no required mesh size) on the M3 (m3-max-13447: left 0,0,0, right
32,1,1). It now comes after both; its own answers were already as expected there
([64, 1024, 32, 32, 1048576]).

(cherry picked from commit 07a944946dd9fc53bb4077002b9956f46540d033)
2026-11-10 02:59:31 -08:00
Anees Iqbal 85b896a7e1 Mesh pipelines: a required object size answers as Metal's first compile, as the mesh stage's does
Metal's answers here depend on what its compiler compiled before, which it keeps across processes
keyed on the function's AIR. With the probe's salt now in the AIR (d49370d732), an M3 Max under
macOS 27.0.1 answered, twice over, each sequence one fresh salt (m3-max-13430):

- required-object-32-max-64: refused on a first compile ("Kernel specified max total threads per
  threadgroup (32) must match compute pipeline specified max total threads per threadgroup (64)"),
  refused again, and again after required-object-32x2 or plain; made only after
  required-object-64-max-64. required-mesh-32-max-64 the same, made only after
  required-mesh-64-max-64. The object stage was made here because an earlier compile let it be.
- A required size gives its stage its threads on a first compile: required-object-32x2 answers an
  object maximum of 64 (we answered 1024), required-mesh-16x2 a mesh maximum of 32, and a
  required 32 beside a function's [[max_total_threads_per_threadgroup(64)]] 32 in either stage.

So the object stage now refuses a required size of other threads than its maximum
(MaxThreadsDiffer { stage: Object }), as the mesh stage already did, and each stage's thread
limit is the least of the descriptor's maximum, the function's, the required size's threads and
1024. RUNTIME behaviour: new_mesh_render_pipeline_state refuses an object maximum beside a
required object size of other threads, and maxTotalThreadsPer{Object,Mesh}Threadgroup answer a
required size's threads. The translator's mesh answers change, under the branch's
SEMANTICS_VERSION bump (2015).

Tests: engine_mesh's refusal test adds the object cases (32 and 16x2 under 64) and makes 64
under 64; its answers test checks a required size alone in each stage and below a function's
maximum; the runtime lane's mesh test does the same on a device. docs/API.md's accepted
difference, the error's and the getters' docs and the probe's measurements say the first-compile
rule and what later compiles answer.

(cherry picked from commit 3b05b274aec46c172fd0a38276c5ca45a1ade4ca)
2026-11-10 02:59:31 -08:00
Anees Iqbal 532fa9ac1c mesh_pipeline_limits probe: a salt the AIR records, so a fresh salt is a first compile
A comment salt left the AIR as it was, and Metal's compiler keeps its output across processes
keyed on the AIR, so a 'fresh' comment salt could read an earlier compile: the same
required-object-32-max-64 was refused seven times in one M3 run and made six times in the next.
The salt's FNV-1a hash is now the source's SALT, which every function compares a thread's index
with; unsalted, SALT is 0 and the comparison folds away.

(cherry picked from commit eee7dd1e7e53e3ad935ffdbe353cd3f66c7ceaf6)
2026-11-10 02:59:31 -08:00
Anees Iqbal ca3a20c37c Test: the margin helper lets go of its fields by name, so none reads as unused
lavapipe's build of the runtime's tests warned that AtTheMargin's opener, used and ram are never
read: let_go dropped them through the whole struct. It now takes them out by name and drops them
in the same order, objects first.

(cherry picked from commit 6ed67830696a855c7eda362c6c476e666793aa15)
2026-11-10 02:59:31 -08:00
Anees Iqbal 0b94f4196f Conformance: Metal's recordings of the extended-range mipmap cases, and their M3 ledger rows
blit-generated-mipmaps-bgr10xr and -bgra10xr were recorded on the M3 Max
(macOS 27.0.1, 26A434): three runs, one outcome, validated.

Replayed on the M3 under MoltenVK 1.4.2, both policies: the round trip and
level 0 answer Metal's bytes exactly; levels 1 to 6 differ by one code of a
10-bit extended-range field, the device's own filter of the blit chain
(vkCmdBlitImage, VK_FILTER_LINEAR), which the replay announces as
device-filtered-mipmaps. The twelve rows record those measures for the
Apple M3 Max venue; the open item is the note's bound.

(cherry picked from commit 2a32b05c1e01eec0c3bde5aad954ffe272d56c8d)
2026-11-10 02:59:23 -08:00
Anees Iqbal 5bb3d04838 A float ldexp records no NativeNanEncoding: its lowering answers Metal's NaN itself
The 11-02 carve-out run flagged ldexp as possibly over-noted. A float
ldexp is lowered on the bits (math::ldexp_bits): an infinity or a NaN
operand is selected as the result bit for bit, which is Metal's answer
(NanAnswer::Operand: ldexp returns a NaN operand itself). No NaN of the
device's reaches the result on any device, yet float_call left the
answer to the device and recorded NativeNanEncoding everywhere,
MoltenVK included.

FloatFn::metal_nans now includes ldexp on float lanes, so the call
leaves no NaN answer and records no NaN note. A half ldexp multiplies by
2^k, so its NaN is still the device's product's where Metal answers the
canonical half NaN, and stays noted where the device does not answer
that. PrecisionNote::NativeNanEncoding's docs and docs/API.md's
catalogue say so.

Verified: lower::arith::tests::float_ldexp_answers_metals_nan_itself
(fails without the metal_nans change: call.nan is Some(Operand) and
NativeNanEncoding is recorded). SEMANTICS_VERSION 2014: a module
calling float ldexp records one note fewer.

(cherry picked from commit c4b748c1e63cee2a32400145a3665387a8ca72cf)
2026-11-10 02:59:23 -08:00
Anees Iqbal b72b34e36f mesh_pipeline_limits probe: a salt argument for a first compile of the same source
The probe's header says a required size's answer changes with what the
compiler compiled before; a SALT appended as a comment makes a source the
compiler has never seen (a salt never used) or has (the same salt again),
so a run can ask Metal's first-compile answer and its later one apart.

(cherry picked from commit 6e0813d9a4d5282ae1cc2019f5673fc2e1f2917d)
2026-11-10 02:59:23 -08:00
Anees Iqbal 114cc478fa Conformance: generateMipmaps over 64x64 BGR10_XR and BGRA10_XR, the upload's round trip first
reims's 11-02 triage at 9f5776bf31 (MoltenVK on the M3) saw a 64x64
BGRA10_XR level 0 not round-trip through upload and readback, and
BGR10_XR's generated level 1 differ from Metal's; no case covered
either. Two rows of the blit family: a Shared 64x64 texture of seven
levels, every level under 0 written BEFORE by replaceRegion:, level 0
with counting bytes (the fields' padding bits among them) and read back
by getBytes: before the filter, then generateMipmapsForTexture: and
every level read back. Metal's answers are recorded on the M3 Max.

(cherry picked from commit 3c960778e43fc134798541f96a1d659d3b6b1a7a)
2026-11-10 02:59:22 -08:00