The translator's comments cited the deleted runtime's files and the deleted validation lanes
(runtime_lane::*) as where a measurement or a mirror test lived, and called rt "the new runtime".
The measurements now stand as measured, and "the new runtime" says "the runtime". The crate
docs' last line names metal2vulkan-rt as the Metal-like runtime built on this API, and
scripts/api-docs no longer says the runtime uses the hidden env_vars and repro modules (nothing
outside the crate does).
Left for the translator-switch commit, which deletes what they describe: driver_facts.rs,
profile.rs, derive.rs, lockstep.rs's resident-table domains, the old render descriptor key
(compile/api.rs and its pinned test), DriverDeviation's doc in error/mod.rs, function_storage.rs,
and the Device::new notes in engine_private_render_state, engine_simd and engine_arith.
Comments only, plus the crate-root doc line and one script comment.
What: metal2vulkan-runtime writes the FALLBACK repro bundle the command line
writes for its own failures when it refuses a library or pipeline creation,
where METAL2VULKAN_REPRO_DIR names a directory (unset, nothing is written).
- The CLI's bundle writer moves into the library as the hidden crate-root
module metal2vulkan::repro (feature serde), shared by the binary and the
runtime. A bundle's directory is named by its content
(metal2vulkan-repro-<16 hex>), written under a temporary name and renamed,
so an identical failure is written once, across threads, processes and
runs. The CLI's own bundles keep their files (input, profile.json, the
descriptor files, repro.sh, repro-command.txt, failure.txt); only the
directory's name changed, so a bundle written before still replays.
- The CLI takes --device FILE in place of --profile: the JSON of a
DeviceDescription and DevicePolicy (ReproDevice), which builds the
runtime's own compile device.
- The runtime hooks each creation where its refusal returns: a library of a
metallib, a function's lookup, every compute and tile state
(ComputePipelineState/TileState::create_adding: creations, added binary
functions, archive adds) and every render state
(GraphicsState::create_reflecting). It bundles Unsupported, NotImplemented
and Compile refusals but a cancelled compile and a name the library lacks
(Metal's own nil); never Invalid/Nil/MetalError. The bundle holds the
library's bytes, device.json, the request as the CLI's options and
descriptor files, and failure.txt with the call, the refusal and what the
command does not replay. That list comes from a full destructuring of the
compute, tile and render descriptors (and the stage functions): a new
descriptor field fails to compile in repro.rs until it is replayed or
listed.
- Bounded: at most 32 bundles and 256 MiB per process; past either nothing
more is written and one line says so. Written on the refusing thread; the
call returns the same refusal; a write failure is said once. Each bundle
is named in one line through the device's message sink (id name
metal2vulkan-repro). The runtime's metal2vulkan dependency gains serde.
- Not bundled: mesh states (no CLI mesh path), a dispatch's or draw's later
variant, driver VkPipeline makings, Metal-source libraries.
Docs: env_vars registry, README CLI, docs/HOWTO.md section 4, the runtime
README's Errors section, the CLI help.
Tests: runtime CPU tests of the bounds (a tally with the seam's limits);
a lavapipe/GPU device test (ob3_stage_input with no stage-input descriptor:
one bundle with the expected parts and command, device.json rebuilding the
runtime's compile device by profile fingerprint and answering the same
refusal, none for a second identical refusal or a missing name, none
without a directory); CLI tests replaying library-written runtime bundles
(compute, and render with a vertex descriptor) through repro.sh to the same
FALLBACK, and --device compiling what --profile does.
Verified at ae56b195e9 (msi, m3-max-32986): metal2vulkan cli,
api_surface and api_signatures 25 passed; runtime repro tests 9 passed;
clippy -p metal2vulkan -p metal2vulkan-runtime all targets, all features
0. Lavapipe (m3-max-32978): repro_device writes one bundle that the
CLI replays to the same refusal; a second identical refusal writes
nothing.
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