Commit Graph
26 Commits
Author SHA1 Message Date
Anees Iqbal 92ce7950fc Docs: "the runtime", not "the new runtime"
There is one runtime, so the prose of the harness, validation, devtools,
the translator's lockstep module, .config/nextest.toml and the refusal
surface and conformance coverage generators says "the runtime"
(scratch newrt.py: a word replacement, identifiers such as new_runtime
and NewRuntime untouched). docs/REFUSALS.md and
docs/CONFORMANCE-COVERAGE.md are regenerated from the edited scripts.

Four harness passages said the runtime makes no heap and no texture
over a buffer, and has no Managed mode. The runtime has all three
(Device::new_heap_buffer and heap textures, Buffer::new_texture,
Device::new_managed_buffer); the harness's own backend refuses the two
texture sources. They now say the harness makes neither on the runtime,
and the Managed note names Device::new_managed_buffer. The refusal
strings keep the words the harness's described test matches ("makes no
heap", "makes no texture over a buffer").

Left: three fixture comments (.metal under validation's public
fixtures, whose text keys the golden tables and the committed AIR) and
scripts/matrix, whose keys (harness-new) carry the same naming.

Verified locally: the refusal surface, Metal coverage, conformance
coverage and API signature checks pass.
2026-11-20 11:52:56 -08:00
Anees Iqbal c6ff002ede Devtools: the carried-tree check's floor counts validation's sources alone
The check that the carried trees read the checkout through the runner's directory first asserts
that its walk found the trees, as a floor on the number of sources read. The floor, 500, counted
the old runtime's tests too; with that crate deleted the carried trees are validation's src and
tests, 372 files, and the test failed on the floor alone ("372 sources read") on host and lavapipe
(m3-max-58615). The floor is now 300, under today's count with room for files to move.

Verified: m3-max-58615 shows the failure at the old floor; the fix's run is the gate of this commit.
2026-11-20 07:01:01 -08:00
Anees Iqbal 5d725aeec7 Delete metal2vulkan-runtime, with every test and script that read it
The cutover deletes the old runtime: crates/metal2vulkan-runtime and its workspace member go.
Nothing in the workspace depends on it any more: the harness and conformance lost their old arms,
and validation dropped its dependency in its own commit.

Adapted in this commit, so no gate reads the deleted tree:
- CI and scripts/linux-gate-ci: the crate's per-feature clippy group, its `-p` in the Windows
  clippy and the test step, and its private-doc-links row go. Packaging needs no edit: the
  workspace's published crates are now metal2vulkan and metal2vulkan-air.
- The published-crates test lists those two; devtools' carried trees and the five nextest groups
  of the old crate's tests go.
- scripts/api-signatures: the crate leaves CRATES, FLOORS and the header, its self-test trees name
  rt (read by the same rules), and the table is re-blessed (the old crate's 4555 rows go);
  api_signatures.rs pins the three crates left.
- scripts/refusal-surface: the old crate's tree and its sections go (RuntimeGap, AppleOnly,
  Problem and the problem enums it forwards to), with their 87 reach rows, the `--delegations`
  verb and the test that counted the old Problem's delegations; docs/REFUSALS.md is regenerated.
  The basis check now holds rt's refusal enums alone, which it already required.
- scripts/api-cost-coverage goes: it measured only the old crate's surface.
- feature_vocabulary.rs: the old crate's two enable tables go; the Khronos and validation tables
  stay held to the vocabulary.
- The conformance coverage generator's by-hand roots read rt instead of the old crate, and
  docs/CONFORMANCE-COVERAGE.md is regenerated (MTLResourceOptions' row, which only the old crate
  modelled, gives way to rt's MTLCommandBufferError).
- scripts/matrix: the harness times the new runtime alone (`--runtime new`), so the rules that
  judged it against the old one go: the new-over-old budget with its floors (floors.tsv,
  gpu-floors.tsv), ceilings, card variance and status table (status.tsv), the frozen arm, the
  base spread and the timing once more it set off, the re-timed pairs, the five creation rounds
  and the old runtime's parked tests and records. A harness row's time is judged as a cross-GPU
  outlier, with its alone runs as before, and the frame and burst rows by their stored
  instruction counts; the creation rows run once, in their own process. docs/VALIDATION.md's
  matrix section says these rules.

Checked locally (python, no build): signatures.py --check and --selftest, refusal_surface.py
--check, --selftest and --missing-basis, coverage.py --check and --selftest, and scripts/matrix's
49 tests pass. The compile gate (fmt, clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, Windows
clippy for gnullvm and msvc, workspace Rustdoc, packaging, the touched crates' suites on the host
and on lavapipe) runs on this sha as potluck jobs that the landing note names.
2026-11-20 07:01:01 -08:00
Anees Iqbal 7708b4ba82 conformance, rt test: threadgroup memory read before the program writes it
The conformance case compute-threadgroup-memory-reads-zero runs tgz_reads
in one compute pass: the [[threadgroup(0)]] region's length set once,
then 2048 threadgroups of 256, of 250 and of 30 threads, twice each, each
dispatch into its own 16-byte slot, so later threadgroups of a dispatch
and the second dispatch run where earlier threadgroups stored their
patterns. Its test holds Metal's recorded words equal to
metal2vulkan_devtools::threadgroup_start::answer: nothing read nonzero
before the program wrote it, every pattern read back, Metal's SIMD
groups.

The new runtime's device test
every_device_reads_zero_from_threadgroup_memory_until_the_program_writes_it
runs the same dispatches on every device and holds the same answer; at
a size that is not whole groups of what the plain module runs, it holds
that the emulated SIMD-group module was made and ran.
2026-11-19 13:52:36 -08:00
Anees Iqbal 1dc4565331 devtools: the kernel CPU list's parse is Linux's, built only with the Linux counters that read it
cpu_list (from dd8d1fdf7b) has two callers: the Linux counters' unit lookup and its own unit test.
Off Linux neither is built, so macOS and Windows builds under -Dwarnings failed on dead code
("function `cpu_list` is never used", KosmicKrisp M3 build 47812). The function and its test now
carry the Linux counters' own cfg, all(target_os = "linux", target_endian = "little"); raw_event
stays on every platform, as ProcessEvent::new parses the name before it answers Unsupported.

Checked by clippy of metal2vulkan-devtools, all targets and features, -D warnings, on macOS (M3)
and on Linux.
2026-11-18 12:20:13 -08:00
Anees Iqbal dd8d1fdf7b rt tests: the lock budget, locked instructions per added draw, bind and dispatch
An encoder call's success path executes no locked instruction, since one between two recorded
commands flushes a write-combining command stream (about 490 ns on the RX 7900 XTX). Three GPU
device tests now hold the encoders to that, each as a difference: a recording of 4,000 commands
less one of 2,000, over the 2,000 added, so what a command buffer costs once (its begin, commit,
submission and retirement) drops out:

- draws: 2,000 draws more in one pass;
- binds: 2,000 draws more, each with a vertex buffer and a fragment texture set before it, both
  alternating between two objects, so every set changes its slot;
- dispatches: 2,000 dispatches more, each reading the one before's writes.

The count is the whole test process's in user space, with inherited counters opened before the
instance: the encoding thread's, the runtime's threads' and the driver's. Each length is
recorded twice at the longer length to warm the rings, lists and pools, then 7 times each,
alternating; the least count of each length is compared, and every round's difference is
printed (`LOCKS <device>: ...`) with the bound, 0.02 locked instructions per added command.

The CPU's event is the node's: `M2V_LOCK_EVENT` names it as perf names a raw event
(`cpu_core/r21d0`, an Intel performance core's MEM_INST_RETIRED.LOCK_LOADS; `r1e25`, Zen 4's
locked instructions). A node that names none prints LOCKS-UNMEASURED and passes. The test pins
itself to the CPUs of the event's unit (a hybrid CPU's performance cores) before it starts the
device's threads.

devtools gains the counter it reads with: instructions::ProcessEvent (a raw event of the whole
process in user space on one unit, named `<unit>/r<hex>` or `r<hex>`) and pin_this_thread, with
tests of the name and CPU-list parsing and of rc0 (retired instructions on Intel and AMD alike)
counting the fixed loop on its unit's CPUs.
2026-11-18 11:51:55 -08:00
Anees Iqbal eb16d34f15 matrix: the instructions gate judges the new runtime's own threads, a driver's left beside
The burst rows' whole-process count swung by up to 25 million instructions per run between
processes on NVIDIA, all of it in the driver's own "[vkrt] Analysis" thread, while rt's own
threads held steady (48-50k instructions per command buffer on the 2080, 23k on the XTX). A gate
on the whole count judged the driver.

rt now registers the OS id of every thread it starts in Gauges::threads, at one place: the
spawn helper device::start, which the reaper, block-maker, submit and completion threads and the
cache store's removal thread all start through. A thread holds its slot until it ends. The list
is bounded by construction (5 slots), nothing on a commit or submit path reads it, and
Device::new's paths are untouched. devtools gains ThreadInstructions (per-thread user-space
counters by OS id, a thread that already ended skipped) and this_thread. The harness reads the
runtime's thread ids through Device::threads before a row's timed runs, counts them with its own
thread, and records own_per_run and others_per_run beside per_run. Every counter read now sits
outside the timed wall span.

results.py, per the planner's ruling: EXACT, the new runtime's own count at most 1.03 times its
stored count (instructions.tsv now holds own counts), ratcheting down; LENIENT, named on every
row, the own count at most the old runtime's whole count, old's driver share not separable since
the old runtime names no threads. A whole count with no own count fails the row. The base
comparison skips the harness's counts: the gate judges them.

Verified: scripts/matrix/test_results.py, 42 tests OK locally. Builds and the other suites run
on the check job.
2026-11-18 05:04:14 -08:00
Anees Iqbal d2e5edbd60 harness and matrix: record the whole process's instructions per run and gate the frame and burst rows on them
The harness now counts each timed run's user-space instructions across the whole process. The
counts repeat run to run where the times do not: rt's p50 spread across processes was 0.16 to
0.27%. The matrix gates the frame and burst rows (WALL_ROWS) on those counts, beside the host-time
judgement and floors they keep under the GPU-p50 rule.

devtools: ProcessInstructions opens one user-space instructions counter per core type with
inherit set, so every thread started after it opens counts: the runtimes' and the drivers'
threads too. The harness opens it first thing in main, before any device starts a thread, and
each timed run records the counted delta. A node that refuses perf_event_open, and every
non-Linux host, records none.

harness: each row whose runs were not sized prints
`M2V-MATRIX instructions harness-<runtime>/<row>/per_run <p50>`.

matrix: a frame or burst row with a count on both runtimes passes the instructions gate as well as
its time's limit:
- it fails when rt's count is over old's;
- it fails when rt's count is past 1.03 times the stored count in scripts/matrix/instructions.tsv
  (one column per driver family, `all` where the legs agree within 3%);
- it is named when its count is more than 1% under the stored count, which then ratchets down;
- it is named when no count is stored, and is then gated against old alone.
The single-kernel rows stay judged on their GPU p50 as before, and every row's count is shown
beside its times. The old runtime's harness counts are parked from the per-record
instructions-versus-base check, like its times. instructions.tsv starts empty: a matrix run's
counts seed it. VALIDATION.md describes the time rules and the gate in one paragraph.

Verified: scripts/matrix tests (python3 -m unittest discover, 45 OK) on this Mac, over this rule
and the GPU-p50 rule together. Before the rebase, check m3-max-45591 on msi (at c597bb3603) passed
clippy x4, nextest for devtools, harness and rt (118 passed, with the process counter's test), and
the release harness build. Count job m3-max-45641 on the 2080's node recorded the per_run count of
every row on both runtimes except long_4cb, which is sized.
2026-11-18 03:31:27 -08:00
Anees Iqbal f2cead2c6c conformance: vector-word-phases recordings (Apple M3 Max, job m3-max-41993); rt: every device places each vector access at its own address 2026-11-17 12:15:36 -08:00
Anees Iqbal cbc2a4be13 tests: vector accesses at each word phase claim at most the proven alignment and answer Metal's words on the interpreter 2026-11-17 12:15:36 -08:00
Anees Iqbal b4b22c7b2c matrix: the per-commit matrix runner and the user-space instruction counter (WIP) 2026-11-17 06:19:57 -08:00
Anees Iqbal 52a784770c Validation tests find their inputs and their compile worker under any archive selection
Validation reads the checkout where the test runner names it, everywhere

A lib-only archive of the validation crate, built on msi and run from another root with
--workspace-remap and the build tree's sources moved away (lavapipe, job m3-max-34590), failed
runtime_lane::tests::a_kernel_runs_the_functions_its_descriptor_links (NotFound at tests.rs:697:
crate::engine::profiles_dir() is env!("CARGO_MANIFEST_DIR")/profiles) and
candidate::engine::graphics::tests::public_render_cases_plan_or_refuse_typed ("0 public render
cases planned": a baked corpus root). Both pass when the build tree is present. The scan
39bff0de2a added covered only runtime_lane/, not the library code the lanes call, nor the rest of
the crate a carried archive holds.

Every env!("CARGO_MANIFEST_DIR") read left in the validation crate moves onto
metal2vulkan-devtools' resolvers, mechanically: the crate's own files onto validation_dir(), the
public fixtures onto fixtures_dir()/engine_dir(), the workspace and crates/ onto workspace_dir().
That is 73 sites in src/ (library ones included: engine::profiles_dir, source::corpus_root,
cutover::list_path, library_module's linked fixtures, mesh_cases, corpus-harvest's default
corpus) and 15 in tests/. The runtime pin's include_str! takes a path relative to its file. A
binary run outside cargo names no manifest directory, so workspace_dir() falls back to the checkout
the dev-tools crate was built in: the same directory as before.

The devtools scan (tests::the_carried_tests_read_the_checkout_where_the_runner_names_it) now
covers all of crates/metal2vulkan-validation/src and tests beside the runtime's src; at the base
it lists the 88 sites.

Test harness and validation tooling only; no product file.

The lib's device tests compile through their own test binary

A lib-only archive of the validation crate (cargo nextest archive -p metal2vulkan-validation --lib,
lavapipe, job m3-max-34590) failed 20 runtime-lane tests whether or not it ran beside its build tree:
the 16 kernels_with_textures_and_samplers_match_metal shards, the two argument-buffer censuses,
sparse_cases_match_metal and public_render_cases_match_metal. All panicked at candidate/tests.rs:63:
compile_worker() looked for the corpus-pipeline binary above the test binary, and Cargo builds a
package's binaries only for a selection that holds an integration test, so a --lib build or archive
never has one.

compile_worker() now names this test binary (CompileWorker::lib_tests), which already installs the
counting allocator (alloc::tests) and already served the compile path's limit probes. A
CompileWorker carries the arguments and variables before the worker argument: none for a binary;
for the lib test binary, `--exact worker::compile::tests::compile_worker_fixture --nocapture
--quiet --` and M2V_TEST_COMPILE_WORKER, so the worker argument run_json's caller appends is a
filter after `--`. The fixture serves a compile, or the probe the variable names, through
worker::serve_process as a binary does, on an 8 MiB thread (a binary serves on its main thread;
the harness runs a test on a 2 MiB one), and exits. It refuses any worker argument but the compile
worker's. run_json decodes the last non-blank line of the worker's stdout as its report, so the
harness's "running 1 test" line before it is not read.

The worker keeps every limit of the boundary: its parent is the same compile() path, so it has
its own process group, the 20-s deadline, the process-group RSS kill, the 500-MiB allocator budget
and scratch removal. The limit probes now go through CompileWorker::lib_tests and compile(),
the exact path the device tests use: deadline (timeout), resident memory (oom), budget
(worker_exit) and the uncounted refusal. New tests:
worker::compile::tests::the_lib_tests_worker_returns_the_pipeline_the_public_api_compiles (the same
comparison tests/integration/compile_worker.rs makes through the real corpus-pipeline,
corpus-vulkan and corpus-moltenvk, which stays) and
worker::tests::a_worker_s_report_is_the_last_line_of_its_stdout.

Test harness only; no product file.

mesh_cases borrows its label for the fixture path; run_json's doc rewrapped

The unbake rewrite moved the row's label into the path join (E0382 in the cpu_icd lib test build,
msi job m3-max-34650); it joins a borrow. Compile fix and doc wrap only.

Why: a lib-only nextest archive of the validation crate (as lanes build) failed 22 tests when run off
its build tree, 20 when run on it (m3-max-34590, lavapipe): the compile worker binary is built only
for selections that include an integration test, and 88 env!("CARGO_MANIFEST_DIR") reads lay
outside the tree the 39bff0de2a scan checks.

Verified (m3-max-34662, msi, at 97feb0e0dc): the lib-only cpu_icd archive, run on lavapipe remapped to
another root with the build tree's sources moved away: 426/426 (the commitwait set, every touched lib
test module and worker::), including the 22 that failed at the base; the four limit probes through
CompileWorker::lib_tests (timeout 20.06 s, RSS kill, allocator budget, uncounted refusal); the new
lib-tests worker equality test. Still running when landed: clippy x3 for validation and devtools, the
plain suites (the corpus-pipeline integration comparison), the widened scan's negative control, rustdoc.
2026-11-15 19:16:35 -08:00
Anees Iqbal adb6f3c93c devtools: the tool runner's test module on unix hosts only
Its one test runs /bin/sh; on Windows the module held only an unused import.

Verified: Windows clippy (gnullvm and msvc, --all-targets) reported this as the
only error at 438f0c42cb (job m3-max-31946).
2026-11-15 05:49:35 -08:00
Anees Iqbal 4c6a29c409 Windows: dma-buf items unix-only; dirty pages, residency and rotation on every host
The runtime's first Windows check stopped at its module tree: dma_buf.rs
takes file descriptors (std::os::fd) unconditionally, while dirty_pages,
host_residency and texture/rotation were unix-only modules that every host's
code names.

- dma_buf.rs: every item that holds or makes a file descriptor (the
  sources, requests and chunks, the imports of dma-bufs and their pages,
  images bound to them, exported pages) is cfg(unix). The DRM-modifier image
  items that hold none (ModifierMemory, the explicit-plane and natural-layout
  checks, the format queries) stay on every host: their extension decides at
  run time.
- dirty_pages and texture/rotation hold no unix code: on every host.
- host_residency: the descriptor limit (RLIMIT_NOFILE), the dma-buf form of
  an import made again and its descriptor counts are unix-only; the pointer
  form and the sweeps stay on every host.
- devtools' scratch lock: the file identity on Windows is the volume serial
  number and file index (GetFileInformationByHandle) in place of dev/ino.

Verified: a step of the Windows check iteration (gnullvm, msi job).
2026-11-15 05:24:38 -08:00
Anees Iqbal 39bff0de2a The carried test trees read the checkout where the test runner names it
Every env!("CARGO_MANIFEST_DIR") in validation's runtime_lane.rs and runtime_lane/ and in
metal2vulkan-runtime/src/tests (135 sites) named the directory the test binary was built in. A
nextest archive built on msi and run on another node with --workspace-remap read msi's path there:
teardown_threads panicked reading runtime_examples.ll, and public_cases read no case shard.

metal2vulkan-devtools gets one resolver, workspace_dir(): two levels above the manifest directory
the runner names as the test runs (cargo and nextest name the test's crate; a remapped archive
names it in the running machine's checkout), where that root holds the validation fixtures, else
above the dev-tools crate as built (the fallback fixtures_dir already had). validation_dir() and
fixtures_dir() sit on it; engine_dir() is unchanged. The sites move onto them:
- fixture reads (fixtures/public, engine/ and examples/) onto fixtures_dir() and engine_dir(),
  with the two hand-rolled "runtime variable else built" copies (attachment_reads, encoder_holds);
- committed cases and observations (validation_dir()/corpus), and public_cases and
  public_case_names now read the public source rows through source::public_sources_under on
  fixtures_dir() instead of source::public_sources(), which bakes the path;
- the runtime tests' device profiles (validation_dir()/profiles) and degradation_sites' read of
  the lane's sources;
- the conformance recordings, docs/API.md and the runtime's own src/ through workspace_dir().
The imports of std::path the moves left unused are removed.

Test-only. tests::the_carried_tests_read_the_checkout_where_the_runner_names_it (devtools, the
previous commit) fails before this commit and passes after. Verification: the msi job that builds
both commits, runs the remapped archive at each and lints the tip is reported with this sha.

With 4e06c87523 (the scan check), e9a0927685 (render_state.rs and line_width tests; the scan covers all of runtime/src),
74aa3e44cc and 086962f1fa (fixes; source.rs fixture reads through fixtures_dir). Test code only.

Compiled in m3-max-31605 (msi: clippy x3; scan passes; lavapipe suites 6235 passed, failures all pre-existing pin-97
items or the runtime-sources pin; remapped run with the build tree hidden 201/202, the last needing an all-targets
archive, 31641). Base 4e06c87523 (31508): scan lists 135 sites; remapped run fails 63/202.
2026-11-14 23:21:25 -08:00
Anees Iqbal ea5d2b5dbb The dev tools find the fixtures beside the crate the test runner names
devtools::fixtures_dir() returned the validation crate's fixtures/public beside the dev-tools
crate as it was built (env! of CARGO_MANIFEST_DIR at compile time). A nextest archive built on one
machine and run on another, as the GPU nodes now run every device leg (built on msi, carried to
um790), therefore read the build machine's paths and found no fixtures. It now looks first beside
the manifest directory the test runner names at run time (cargo test and cargo nextest set
CARGO_MANIFEST_DIR for the test's crate; a run with --workspace-remap names it in that machine's
checkout), and falls back to the build-time path where that directory has no fixtures.

Test infrastructure only (metal2vulkan-devtools, unpublished); no product path reads it.

Verified (devcopy, 5c30935a78): validation-lane archives built on msi ran their fixture tests on
um790 (the XTX device_copy run 27511 and the 2080 run 27575 read their fixtures through it).
2026-11-13 18:43:40 -08:00
Anees Iqbal 02341f3157 End to end: the linked-signature fixtures compute Metal's words by position
The owned fixtures engine/linked_signature_caller and
linked_signature_functions (regenerated by scripts/regen-air-fixtures on the
M3, Metal 32023.922, SDK 27.2) are the MSL the probe linked_function_signatures.m
compiles. metal2vulkan_devtools::linked_signatures holds their 28 cases and
word 0 of each: Metal's where the M3 Max stored one (m3-max-3300, which also
matched m3-max-3238 case for case), the translator's own where Metal's read
is undefined, or a refusal for the shapes no adapter passes.

tests::engine_linked_signatures runs every case on the CPU interpreter and
compiles the linking ones on every committed profile through L3;
runtime_lane::linked_signatures runs them through the runtime under the
validation layer, linked in functions, and in privateFunctions for the
stitched and the plain extra-argument cases Metal measured so.

(cherry picked from commit 98d793e667d739cb96c005ec63a0f7680f5129fc)
2026-11-07 05:19:28 -08:00
Anees Iqbal 43ba8cf525 Test stitched functions linked into their caller
Metal's stitcher writes its library only at run time, so the tests get
its structure from a writer of our own: metal2vulkan_devtools::stitched
writes, as LLVM text, the module the probe stitched_function_linked.m
read back from Metal for a graph of float stitchable functions (the
stitched function with its nodes inlined, its air.visible entry and
air.stitching_info naming internal helpers kept by llvm.compiler.used,
and an !air.signature of kind air.stitching_modules_signature listing
the graph in post-order and a digest per stitchable function), and the
executable metallib holding one visible (TYPE 4) module per function.
PROBE_GRAPHS are the probe's `fused` and `fused4`. No Apple-produced
bytes are committed.

The owned fixture engine/stitched_caller (regen-air-fixtures, macOS
27.0 target, as the probe compiled) holds the stitchable sum2 and
product2 and the kernels stitch_caller and stitch_caller4 that call
`fused` and `fused4`.

tests::engine_stitched checks Metal's answers: through the public API
the stitched library's functions are visible and each kernel's compute
pipeline links its function in privateFunctions and in functions; on the
SPIR-V interpreter the kernels store the probe's 20 and 25 (and the
graph's value on two other input sets); and each link passes L3 on
every committed profile.

Verified: the three tests pass; with the previous commit's gate
restored all three fail, the link refused with exactly the consumer's
error (Linking, NotImplemented, stitch_caller block 0 instruction 5,
symbol "fused"). regen-air-fixtures --check: up to date.

(Carried to development from steelbrain/reims-graphics-kext 88a6b651a7.)
2026-11-01 21:26:19 -08:00
Anees Iqbal bf3ce3813c Read Core Image kernel libraries and split whole aggregate accesses
A Core Image kernel library (metal -fcikernel, metallib -cikernel) is a
metallib of file type 1 whose kernels (!air.ci) are listed as function
TYPE 5 over one shared module. The container refused the file type
(Unsupported LibraryKind(1)), so newLibraryWithData: failed where Metal
succeeds; the consumer's graphics-kext lane hit it on Core Image's own
helper library in a macOS 26 guest, so every Core Image path stopped
there.

What Metal answers, measured with kernels written from scratch on an M3
Max under macOS 27.0.1 (probe programs over Metal's API and objc's message
log of a CIColorKernel render):
- newLibraryWithData: takes it as MTLLibraryTypeExecutable; functionNames
  is empty; the private externFunctionNames lists the kernels in the
  reverse of the table's order (libraries of two and four kernels);
- newFunctionWithName:, newFunctionWithDescriptor: and the private
  newExternFunctionWithName: make each kernel with functionType 4 (no SDK
  enumerator; its description prints "Unknown"); newExternFunctionWithName:
  answers as newFunctionWithName: for any library, a kernel of an
  executable one included, and nil for a missing name;
- a compute pipeline made from an extern function fails ("Function tint
  was not found in the module");
- Core Image fetches each kernel and its own helpers with
  newExternFunctionWithName: and links them on the CPU, in Metal.framework's
  base device class, into an ordinary executable library holding one
  kernel, ciKernelMain, of which it builds a plain compute pipeline.

So now:
- container: file type 1 is read (executable; its functions may share one
  bitcode range, hashed once, as a dynamic library's); TYPE 5 is the new
  FunctionStage::Extern, no stage: the ABI cross-check refuses it as a
  mismatch, Library::Function compiles it as no entry (EntryNotFound,
  available 0). Unobserved file types stay LibraryKind refusals.
- FunctionType gains the private enumerator Extern = 4
  (regen-metal-enums PRIVATE); reflection maps Extern to it.
- runtime Library: function_names leaves extern functions out;
  extern_function_names (reverse table order) and
  new_extern_function_with_name are new.

ciKernelMain itself was refused next: Lowering(Arith) at its first
load, `load [4 x <4 x float>], ptr addrspace(2)`, a whole array loaded
from the constant buffer and passed by value to a helper. Lowering reads
and writes buffer and threadgroup memory a scalar or vector at a time.
The new canon pass `aggregates` (after SCCP, beside the other expansions)
replaces each non-volatile, non-atomic load or store of a pointer-free
array or struct in device, constant or threadgroup memory by its members'
accesses in layout order (a getelementptr i8 at the member's distance, the
access's alignment lowered to what the distance allows, joined by
insertvalue or split by extractvalue), at most 256 members, 8 deep.
Thread memory, pointer-holding aggregates (handles), volatile accesses
and larger types stay whole as before. The same-type pointer bitcast
beside the load was never the problem (verified alone).

Public surface: metal2vulkan-air FunctionStage::Extern; metal2vulkan
FunctionStage::Extern and FunctionType::Extern; runtime
Library::extern_function_names and new_extern_function_with_name
(api_signatures blessed: 5 added, none changed or removed). devtools
gains core_image_metallib. The metal-enum generation now records the
macOS 27.2 SDK (the host's Xcode); no SDK value changed, only Extern was
added. LibraryKind's doc and reach note name what it refuses now.

No cache version moves: file type 1 and aggregate accesses outside thread
memory were refused before, so no key reached them, and
golden_hashes_match_the_table passes unchanged (every public fixture
assembled: this Mac's Xcode 27.2 now has its Metal toolchain). The
runtime-sources pin moves (runtime library.rs): re-pinned here to
23766690fd75227c5333e976bfc1fdfafa6ff78f43e0c5ba8fa5183574cd9371.

Verified (M3 Max, macOS 27.0.1):
- Metal versus this tree's runtime on MoltenVK: Core Image's linked
  ciKernelMain for a tint color kernel and for a sampler kernel (both
  from-scratch CI kernels; the linked libraries captured from Metal in
  scratch and deleted after), same constant buffer, source texture and
  sampler, 4x4 RGBA32Float target: byte-identical texels, the early-out
  column untouched on both. The parent tree answers FALLBACK (Lowering
  Arith) for both. Release CLI: 0.01-0.03 s, 11 MiB each.
- Release CLI, parent vs this tree, largest public fixtures
  (hfb_filter_bank render pair, tns_mm_flags), three runs each:
  0.12-0.13 s vs 0.12-0.16 s and 0.05-0.06 s vs 0.04-0.05 s, 27 MiB both
  (runs beside a test suite; the same within noise).
- New tests: canon aggregates (split loads, stores with nested arrays and
  lowered alignments, threadgroup; volatile, pointer-holding and
  300-element aggregates stay whole), an engine test running a
  ciKernelMain-shaped kernel on the CPU interpreter on three profiles,
  core_image_libraries (container types, stages, shared hash, functionType
  4, EntryNotFound), and a runtime device test on MoltenVK (names, extern
  names, both lookups, pipeline refusal, an executable library's kernel
  through the extern lookup). Negative controls: the split and execution
  tests fail with the pass disabled; the library tests fail with file
  type 1 refused.
- cargo nextest -p metal2vulkan -p metal2vulkan-air -p metal2vulkan-runtime
  -p metal2vulkan-devtools --all-features: 4927 passed (golden hashes and
  the metal-as fixture parts included); -p metal2vulkan-validation
  -p metal2vulkan-conformance: 2369, all passed after the re-pin; doctests
  ok; clippy --workspace --all-targets --all-features -D warnings and the
  runtime's under --cfg m2v_gpu: clean; rustdoc -D warnings and
  scripts/api-docs: clean; REFUSALS, METAL-COVERAGE and
  CONFORMANCE-COVERAGE re-derived (MTLFunctionTypeExtern is listed as not
  yet compared by a conformance case). Not run: a corpus translation
  census, and the device suites beyond the new runtime test.
2026-10-31 03:39:16 +02:00
Anees Iqbal ec6b322bb5 Read the AIR slice of Mach-O universal metallibs
The container took a universal metallib only in Metal's own form (magic
0xCBFEBABE, what MTLDynamicLibrary's serializeToURL: writes). The system's
universal metallibs are Mach-O universal files instead: FAT_MAGIC
(0xCAFEBABE) with fat_arch records (five big-endian u32s), or FAT_MAGIC_64
(0xCAFEBABF) with fat_arch_64 records, whose offset and size are u64s.
Metal loads them; the parser refused them as BadMagic ("input not read").
The consumer's reims-graphics lane hit it on every Core Animation library
WindowServer made (QuartzCore's default.metallib, 19 slices on a macOS
26.6.1 x86-64 guest).

container::parse now dispatches on all three headers (UniversalForm) and
reads the slice of CPU type 0x01000017, the library's AIR; the GPU slices
stay unread. Metal's own form without an AIR slice is still NoAirSlice. The
Mach-O magic is shared with files that are no metallib (a CPU-only binary,
a Java class), so a Mach-O file whose records do not fit, or that holds no
AIR slice, is BadMagic, as before. An AIR slice that is no MTLB is
BadMagic at the slice; error offsets inside the slice are the slice's own.
Truncation offsets saturate rather than overflow on a hostile 64-bit
record.

The library is its AIR slice. container::Metallib gains `bytes` (the
metallib's own bytes: the input, or the slice), and Library::parse keeps
and hashes only that slice: Library::bytes, content_hash and the runtime's
serializeToURL: are the AIR slice's for a universal input. That keeps a
universal file inside the 500 MiB ceiling: QuartzCore's file is 187 MB,
and the first cut, which kept the whole file and copied it, peaked at
587 MB of resident memory in the command line. The command line also no
longer copies a .metallib input before parsing it.

Public surface (metal2vulkan-air): FAT_MAGIC and FAT_MAGIC_64 are new
public constants beside UNIVERSAL_MAGIC; container::Metallib gains the
public field `bytes`. Metallib is not #[non_exhaustive], so a consumer
that builds one with a struct literal must add the field; consumers that
only read a parsed Metallib are unaffected. The devtools metallib module
gains UniversalHeader and universal(), the builder both suites share.

No cache version moves: a function's translation key covers its own
bitcode, which is the same in a thin and a universal file, and a refused
file never reached a key. The content hash of a library loaded from
Metal's own universal form changes (it covers the AIR slice, not the
whole file), so such a key misses once; it never hits stale.

Verified (M3 Max, macOS 27.0.1):
- QuartzCore's default.metallib starts CA FE BA BE with 21 fat_arch
  records, its AIR slice at offset 432 of 2,776,572 bytes (the layout
  <mach-o/fat.h> gives). The release command line built from this tree
  translates its kernel dynamic_system_ootf_decimate (profile
  amd-rdna3-radv; spirv-val vulkan1.2: PASS) in 0.03-0.04 s wall at
  192.4 MiB max RSS (185.9 MiB peak footprint, the input file itself),
  three runs; from the extracted AIR slice, 0.01 s at 16.2 MiB, with
  byte-identical SPIR-V (sha256 2dda4fe6...). Built from the parent it
  answers FALLBACK (input not read). Nothing of the file is in the tree;
  the scratch copy was deleted.
- Tests: a_universal_metallib_is_read_through_its_air_slice (each header;
  missing slice, non-MTLB slice, truncations, Java-class-shaped inputs),
  a_wide_universal_record_reads_64_bit_offsets_and_sizes (high words of
  offset and size), and a_universal_file_is_the_dynamic_library_it_holds
  (Library level: bytes, content hash, type, install name and a computed
  result through the interpreter, run with llvm-as present, no SKIPPED).
  The container tests fail on the parent's parser and pass here.
- cargo nextest -p metal2vulkan-air -p metal2vulkan-devtools: green;
  api_signatures (blessed: 3 signatures and 2 constant values added, none
  changed or removed) and api_surface: green; clippy --workspace
  --all-targets --all-features -D warnings: clean; cargo doc --workspace
  --all-features --no-deps with -D warnings and scripts/api-docs: clean;
  REFUSALS.md re-derived with no drift.
- The full metal2vulkan suite: 3258 run, 10 failed before the signature
  bless: api_signatures (fixed by the bless), golden_hashes (stale
  "unassembled" cells) and 8 tests that need `xcrun metal-as`, which this
  Xcode 27.2 lacks (its Metal Toolchain is not installed). Those 9 are
  environmental and independent of this change. The validation and
  conformance suites and a corpus translation census were not run.
2026-10-31 00:16:40 +02:00
Anees Iqbal 63859d8cc1 Sum emulated filters' taps in the device's arithmetic
Rule 1: where the device has a native form it is the only form. The
emulated filters reproduced Metal's datapath bit for bit: a 2^-16
Catmull-Rom weight table, two-word integer sums truncated onto grids
and rounded half up, exact quotients, ties-away half rounding, a 12-bit
sRGB grid snap, 64ths of a level and 256ths of a blend, and the
anisotropic filter's piecewise log2 and chord exp2. All of it is gone.

Bicubic (lower/sampler/bicubic.rs, bicubic/routines.rs):
- One routine, `Plane::sum`: Catmull-Rom weights computed in f32 from
  the fraction (vec4 Horner), the sixteen taps summed by the device's
  multiply and add, rows then columns; Metal's bilinear rule (32-bit
  float formats, a level under four texels) is the device's FMix of
  the four inner taps already fetched; UNORM/SNORM clamps.
- 1D: `Line::sum`, the device's FMix of its two taps.
- An 8-bit sRGB twin's taps are the device's transfer, not the
  1/4095 grid. A half result is the device's narrowing
  (`narrow::round`), not ties-away.
- Kept: Metal's footprint, addressing, mirror pin, filter selection,
  `Quad::exact` (in-place YCbCr's filter, owner form H, not touched).
- Deleted: the weight table routine, the exact/half/accumulated plane
  and row routines, the block and float-quad routines, their words and
  specials; metal::bicubic's test-only table and its test.

Extended range (lower/sampler/extended.rs):
- Linear, 3D and the linear mip filter's level blend decode their taps
  through xrconv's functions as they are, then FMix in f32 at the f32
  fractions; the level weight is the f32 fraction, not 64ths; a half
  result is the device's narrowing. Bicubic clamps into the format's
  decoded endpoints. The in-place decode keeps `Quad::exact`.
- Deleted: the step tables' callers (steps_of, step, level_taps,
  half_of) and, in xrconv's extended_range.rs and texel_round.rs, the
  helpers only they used (STEPS_WORDS, has_steps, steps, step_grids,
  ratio_by_255_to_f32, normal_half_bits; minimal edits in another
  lane's files).

Anisotropic (lower/sampler/anisotropic.rs):
- The device's Log2 and Exp2 replace Metal's piecewise log2, chord exp2
  and truncations; the level and spacing are not rounded to 256ths,
  4096ths or a 6-bit mantissa.
- Each tap is one explicit-level sample: under a linear mip filter the
  fractional level, which the device's own linear mip filter blends.
  The two-samples-a-tap form existed because an RTX 3090's blend of a
  fractional level is not Metal's (1.03 codes off without anisotropy);
  under rule 1 that blend is the device's. A nearest mip filter's level
  stays whole (the 3090's anisotropic sampler blends the next level at
  a fractional level whatever its mipmap mode).
- Kept: Metal's length, tap count thresholds, floor(256/n) weights,
  kappa fit and direction.

Notes: PrecisionNote::BicubicFilterArithmetic is reused, broadened to
the extended-range linear, 3D and level blends (select.rs records it);
AnisotropicFilter's doc names the device's logarithm and blend. No new
variant, no ARTIFACT_FORMAT_VERSION bump. FAST-PATHS: the two
"not built yet / none known" bicubic rows are now one device-gap row
(the device's sum is the form); the known-gaps bullet loses the sRGB
grid snap. API.md's catalogue entries rewritten.

SEMANTICS_VERSION 1922 -> 1923.

Tests: the plane routine's interpreter differential against an f32
Catmull-Rom reference in the routine's order (fails on the old table
and integer sum), the line routine's FMix, the routines' word bounds;
engine_bicubic against the polynomial within 2^-18 (+ half ulp);
extended-range engine tests compare within the filter's bound
(`filtered_close`); xr_bicubic's `near` adds Metal's table's
deviation from the polynomial (WEIGHTS_BOUND 2.1e-3); anisotropic and
bias-reach tests count one sample a tap and two Exp2 per emulation.

Lanes and the conformance suite:
- runtime_lane::extended_range_samples compares linear samples within
  `xr_bicubic::filtered_close` (moved to devtools from the engine test,
  which re-exports it); two_plane_samples holds the digest of nearest
  cases only (a linear one's values are compared by the conformance
  suite's xr-two-plane-samples cases).
- runtime_lane::anisotropic_filter's bounds re-measured on the M3 Max
  with samplerAnisotropy withheld: linear 10.375 codes max (mean 0.21),
  nearest mean 0.82 and 6.7% of channels a code or more off, clamp to
  edge 6.531 max. Other devices not measured.
- conformance: the XR two-plane-samples and extended-range/padded
  extended-swizzles cases declare bicubic-filter-arithmetic; 32
  known-gaps rows (Apple M3 Max) for the linear sites the device's FMix
  moves.
- runtime-sources.sha256 re-pinned: metal/bicubic.rs lost its test-only
  table and docs; no run's behaviour depends on it.

Verified (this M3 Max, macOS 27.0.1): metal2vulkan + devtools suites,
3302/3303 passed (golden_hashes_match_the_table fails: 1001 cells moved,
not blessed). Module words of a bicubic sample (ANV Iris Xe profile):
xr_bicubic xrb_edge 12990 -> 2093, a2_bicubic_weights 15731 -> 3858,
bcx_rules 30727 -> 11388; anisotropic emulation (vk12-floor)
2705 -> 1884.

Also in this packet: the padded 10-bit formats' linear samples join the known gaps (d326b293c0), and the conformance coverage document is regenerated for the filter rows. Anisotropic emulation (devices without samplerAnisotropy only) now takes the device's Log2/Exp2 and level blend, and Metal's spacing roundings (r' to 256ths, g*S to 4096ths, S to a 6-bit mantissa) are gone with them: on the M3 with samplerAnisotropy withheld, linear reads up to 10.4 codes from Metal (mean <= 0.21), bounded in runtime_lane/anisotropic_filter.rs.

One work packet, landed as 2 commits on archive/development-linear-2026-10-29: abc366a2fa, then 8f506cb2fd (the re-pin).
2026-10-29 15:43:53 +02:00
Anees Iqbal 20287666c0 Blend extended-range attachments in the device's arithmetic; drop the 32-bit float Metal blend
Rule 1 (owner, 10-29): where the device has a native form, it is the only form.
An extended-range attachment's raw codes are something no blend unit reads, so the
shader still blends it (capability), inside the pixel interlock or over lavapipe's
input attachment. Its arithmetic used to be Metal's compiler's: lerps, common
factors, fusing by factor rank, half rounding at every step, a separate float4
model and computed-output tables. Now it is a blend unit's arithmetic: S*Fs op D*Fd
in float, in the order of the blend equation, with the source, second source and
blend color clamped to the form's range first (`extended_range::blend::native`).
- computed.rs is deleted. blend_color.rs keeps only the two source ranges.
- input_blend.rs and fetch.rs call native().
- The blend color is pushed as raw f32 bits (HalfBlendColor), so
  PushField::BlendColor is gone.
- Every blended extended-range output that stores a channel now records
  ExtendedRangeBlendSource (half) or ExtendedRangeFloatBlendSource (float).
- The refusals ConstantColorDifference, SrgbForm and FloatOutput are gone, as is
  the fast-math DualSource refusal for extended range. Every factor, operation
  and mask is built; only outputs other than four half or float lanes are
  still refused (Output).

The 32-bit float storage-form blend (`Blend::float32`, `fetch::float32_blended`)
computed Metal's fused forms in float. Every committed profile except
roadmap-2022 and vk12-floor sets COLOR_ATTACHMENT_BLEND on R32/RG32/RGBA32_SFLOAT,
so that form copied Metal's bits where the device blends natively. It is removed:
- a fetched 32-bit float attachment takes the generic float blend
  (UnmeasuredFetchBlend);
- one that is not fetched gets the device's blend after the pass splits.
The float4-output paths of the half/unorm8 model (Atom::Sf, Arith::Kept,
round_inner, Blend::float/narrow/takes_float) were dead after this and are pruned.

Removed:
- the Metal blend-table validation lane (extended_range_blend_table.rs)
- devtools xr_blends
- the xr_blend_table*.txt fixtures
- lower/arith/tests/blend32.rs
- the extended_range tests that pinned Metal's forms

Added:
- every_blend_is_the_devices_arithmetic: every form, 19 factors, 5 operations,
  rotating masks and adversarial sources, bit-exact against a float model of
  S*Fs op D*Fd
- every_blend_is_built_but_a_placeholder

Docs:
- FAST-PATHS: the "Metal's rounding per shape" fast row is removed. The
  extended-range blend is now a device-gaps row with the two notes. The
  32-bit float row and the interlock section are fixed.
- artifact.rs note docs and the API.md catalogue are rewritten.
- REFUSALS is regenerated, reach.tsv updated and api_signatures blessed
  (removed ExtendedRangeBlend::{ConstantColorDifference, FloatOutput, SrgbForm},
  PushField::BlendColor).
- Conformance: the two notes join replay::NATIVE_NOTES, and 16 Apple M3 Max
  known-gaps rows hold the xr-blend add/premul sites the device's arithmetic
  moves: one code, two at the sRGB premultiplied sites.
- SEMANTICS_VERSION 1923, ARTIFACT_FORMAT_VERSION 479.

Size: a premultiplied half4 fill into RGB10A8_2P_XR10 on moltenvk-m3 goes from
3275 to 1937 SPIR-V words (the blend itself from 2133 to 795). The float4 fill
goes from 3435 to 1951 words, and BGRA10_XR_sRGB premultiplied from 7992 to 6654.

Verified:
- metal2vulkan lib, touched modules: 511/511.
- Sabotage: rounding the source to half in native() fails
  every_blend_is_the_devices_arithmetic; restored, it passes.
- clippy, plain and with --cfg m2v_gpu; rustdoc -D warnings.
- M3 Max conformance replay of 25 cases: half-output-blends-*,
  blend-interaction-format-float32 and xr-blend-*-one-zero are justified; the 16
  xr-blend add/premul sites are held by the new rows.
  The replay exits 0 with the ledger held exactly. The conformance crate
  passes 1007/1007, CONFORMANCE-COVERAGE is regenerated, and runtime
  degradation/catalogue and api_signatures/api_surface/refusal_surface pass.
- M3 device tests (memcap + maclock, --cfg m2v_gpu): 11/11 of
  runtime_lane::extended_range_blends and framebuffer_fetch::generic_blend.
  The renamed blends_of_half_outputs_into_extended_range_texels asserts
  Metal's bytes for one-zero and prints the 16 add/premul outputs the device's
  arithmetic moves.

One work packet, landed as 2 commits on archive/development-linear-2026-10-29: 808143ef80, then 18431ee908 (the re-pin).
2026-10-29 15:43:53 +02:00
Anees Iqbal 8264a4c1f0 Remove each scratch temporary that outlived its tool, kill included
Content: the tree of `development` at 16257a79ad, unchanged.
2026-10-26 13:19:16 +02:00
Anees Iqbal e320a1f475 Drop design-record, work-package and evidence codes from comments, and retire vk12-bare from the corpus
Comments, fixture notes and docs lose their design-record numbers, work-package codes and evidence
codes; lines that earlier commits of this series added carry their cleaned text there, so this
commit holds the cleanup of lines that predate the series, the retired vk12-bare profile's corpus
rows (a rationale and two observation rows), and docs/FAST-PATHS.md's measurements stated as they
stand. Thirteen hash-keyed files keep their citations, because their bytes are case or record
identities: eight case-keyed .ll fixtures and five parity sources.
Verified: the CPU suites (4997 of 4997 and 1328 of 1328), clippy, rustdoc and doctests.

Folds in:
- Drop evidence codes, design-record numbers and work-package codes from comments and fixture notes
- Drop the retired vk12-bare profile from the corpus
- Say the fast-path ledger's measurements as they stand, without commits, rounds or host incidents
- Keep the case-keyed .ll fixtures byte for byte
- Keep the parity lanes' fingerprinted sources byte for byte
2026-10-19 00:16:00 +03:00
Anees Iqbal 4b564766ec Sample extended-range textures through Metal's bicubic filter
A sample of a BGR10_XR, BGRA10_XR or RGB10A8_2P_XR10 texture (or an sRGB twin) through a constexpr
bicubic sampler, or through a runtime sampler whose bound word states Cubic, was refused
(NotImplemented(SamplerBicubicFilter) in the lowering, NotImplemented(Format) in the binder). It is
now Metal's bicubic filter of the decoded texels, measured on an Apple M3 Max (macOS 26.7) through
the owned fixture xr_bicubic: random codes of each of the six formats at 16x16, 7x5, 3x3, 2x6 and
1x1, 2,304 coordinates each (every texel's centre, then random ones up to 0.15 of the texture past
its edges), through 12 kernels (a runtime Cubic sampler with float and half results; constexpr
samplers under clamp to edge with float and half results, repeat, mirrored repeat, clamp to zero,
the opaque-white and opaque-black borders, pixel coordinates, and an offset under clamp to edge and
repeat): 3,317,760 lanes.

What Metal does, and what the lowering now does: the footprint, weights, addressing, a mirrored
axis and a level below four texels are the other formats' bicubic filter's, each tap the decoded
texel or the border texel through the format's channels; a level below four texels sums as the
extended-range linear filter (terms truncated); otherwise each tap's step is weighed by the
product of Metal's weights and summed exactly (no term truncated, unlike the linear filter), the
step rounded half up, clamped into the steps of the codes 0 and 1023 (a color lane's (0-384)/510
and (1023-384)/510, an sRGB twin's table steps, alpha [0, 1]), and divided by the grid exactly; a
half result rounds as the linear filter's does. The clamp is applied to the rounded result, which
equals clamping the step because each rounding is monotonic. Every lane but 4,050 matches that
model; each of the 4,050 is one step from Metal's (1/8160 a color lane, 1/8192 an sRGB color lane,
1/4080 alpha), its exact sum within 0.014 of a step of a rounding tie that Metal rounds the other
way. No model of Metal's datapath tried closes that residue, so the sample records
PrecisionNote::BicubicFilterArithmetic, and docs/FAST-PATHS.md and docs/API.md say so. A bfloat or
padded form's bicubic sample, a swizzled texture's and a gather through a bicubic sampler were not
measured and are refused.

How: select_extended takes the bicubic state of a constexpr sampler or of the slot's cubic-sampler
variant (LoweringInputs::cubic_samplers) and plans Metal's bicubic filter; the extended sampler emits
it through bicubic::filter with Texels::Extended, which fetches each tap's raw texel and decodes it,
through the exact routines alone, then clamps. The binder takes a cubic word at an extended-range
slot as the cubic-sampler variant's, and gives such a slot the neutral BicubicTexels value in the
plan of the pipeline as compiled, which binds the neutral there (it refused the format before
naming the variant: the device lane found that). SEMANTICS_VERSION 1693; RUNTIME_VERSION 1184, as
a run of an existing artifact with a cubic sampler at an extended-range slot is no longer refused;
the runtime-sources hash re-pinned.

The table: xr_bicubic.tsv (2,067 samples of the probe's, per texture and kernel the middle
texel's centre, four random coordinates, the first sample with a lane at a clamp bound and the
first with a lane at a tie), shared through metal2vulkan_devtools::xr_bicubic with the probe's
texture generator.

Verified on homelab-gem10 (debug builds):
- tests::engine_extended_range::bicubic, on the CPU interpreter on the lavapipe and MoltenVK-M3
  profiles: every lane of the table through the same 12 kernels, compiled under the six forms'
  variants (the runtime ones under the cubic-sampler word the binder plans), is Metal's bits but
  the 136 lanes the table marks, each one step away; each compile validates and its estimate
  bounds it. A padded or bfloat form's bicubic sample, a swizzled texture's and a gather are
  refused as above (a two-plane gather as Format, under any sampler); on every committed profile
  the pipeline as compiled plans the variants with the XR texture and a Cubic sampler bound, and
  the variant's pipeline plans the same key.
- runtime_lane::extended_range_bicubic (new): the 8,268 lanes on the Radeon 780M (RADV), the RTX
  3090 and lavapipe, textures written as the probe wrote them: 0 differ from Metal (136 at a tie,
  one step away), and the state announces bicubic-filter-arithmetic. The extended_range_samples,
  two_plane_samples and two_plane_copies lanes, whose helpers this shares, pass on all three.
- Release build, 12 kernels x 6 forms x 5 profiles (lavapipe, 780M, RTX 5080 Laptop, Arc ANV,
  MoltenVK-M3): 360 translations, mean 1.31 ms, slowest 1.97 ms (xrb_runtime, BGRA10_XR sRGB,
  780M), budget ledger peak at most 935 KiB, process peak RSS 15.6 MB; the linear XR kernels
  take 0.81 ms on average.
- clippy -D warnings (workspace, all features, all targets; validation also under m2v_gpu),
  rustdoc -D warnings and the doctests pass. Suites: metal2vulkan, -air, -runtime and -devtools
  4,566 of 4,567, validation 1,293 of 1,293. The one failure is tests::golden_hashes, whose 380
  stale cells are the two new fixtures' alone (smw_writers 7 and xr_bicubic 12 entries x 20
  profiles), left to be blessed on development.
2026-10-13 17:04:18 +03:00
Anees Iqbal 13b279df1b Squash 11203 commits of translator, runtime, and validation work
Rolls up everything since 43c46ac8 into a single commit. Its tree is
identical to the tree of private master at
b3c77f2d2b20a432be10591a2129547c10b1c24b.

- A Cargo workspace of five crates under crates/: metal2vulkan (the
  translator and the metal2vulkan command), metal2vulkan-runtime (the
  Metal API on Vulkan), metal2vulkan-air (the AIR front end),
  metal2vulkan-validation and metal2vulkan-devtools.
- Dual license: GPL-2.0-or-later OR LGPL-3.0-or-later.
- docs/: API, architecture, fast paths, how-to, Metal coverage,
  refusals, runtime porting and validation guides.

Private-Commit: b3c77f2d2b20a432be10591a2129547c10b1c24b
2026-10-11 20:09:13 +03:00