setDepthBias:slopeScale:clamp: bounds the bias by its clamp: "Pass a positive or negative value to
limit the largest magnitude of a positive or negative bias, respectively. You can disable the bias
clamping functionality by passing 0.0" (Apple's page for the method, as fetched). Vulkan's
depthBiasClamp is the same bound (dbclamp: x for 0, min(x, clamp) above 0, max(x, clamp) below).
rt refused every clamp but 0 (DrawKind::DepthBiasClamp), where the deleted runtime passed it.
floor: depthBiasClamp joins REQUIRED. Every dumped venue reports it (vulkaninfo m3-max-48727 to
48731, 48736, 48737 and 61508 for the RX 550: RX 7900 XTX, the three 780Ms, RTX 2080, RTX 3090,
Iris Xe, RTX 5080 Laptop, llvmpipe, the UHD 630's Windows driver, KosmicKrisp on the M3 Max, RX
550), and Vulkan 1.4 and Roadmap 2022 require it.
render encoder: set_depth_bias keeps the clamp beside the bias and slope scale and records it in
vkCmdSetDepthBias, as dynamic state (no pipeline). It returns nothing now, as Metal's call does:
its only error was the clamp. DrawKind::DepthBiasClamp is deleted. The consumer's checkout names
both: rt_platform/render.rs:380 (`e.set_depth_bias(...)?`) and rt_platform/unbuilt.rs:873 (a test's
sample refusal of DepthBiasClamp); each needs a one-line change at its next pin.
AGENTS.md: the Scope sentence on features no guest has used is replaced with the planner's
wording: a feature a program can ask about is answered from the Vulkan query; one Metal gives every
Mac device with no way to ask is built, a typed refusal in the known gaps until it is.
Docs: the README's floor table, its depth bias paragraph and its render encoder known gaps;
docs/REFUSALS.md regenerated (Draw's basis and sites); api_signatures.tsv blessed (the setter's
signature, the variant gone). The conformance ledger drops render-state-depth-bias's refusal row.
Tests: every_device_tests_writes_and_biases_a_depth_attachment's first draw is biased by 2^23
(0.25 or 0.125 in the device's unit at depth 0.25) clamped to 0.0625, and the depth read back is
0.3125 on every device; the later draws' answers are unchanged in kind. The conformance case
render-state-depth-bias (a slope-scaled bias under the clamp -0.0125) now compares against Metal's
recording.
Before a published crate's public item is deleted, the lane searches the
consumer's checkout for it and names the hit or the zero in the commit message.
The consumer is asked only where a search cannot answer (a macro, a re-export).
A search takes seconds and leaves the same evidence as a round of messages.
The orphan pass deleted ArgumentBufferLayout::from_descriptors because nothing in
this tree called it; the consumer did, and its build broke at f53cd542b6. The
dead-code rule now says a public item of a published crate is used when a
consumer calls it, and that the consumer is asked before one is deleted.
The cutover deleted the translator's speed-for-accuracy switches, the driver-fact tables, the
device checks, docs/FAST-PATHS.md and tests::fast_paths. AGENTS.md still said they "stay correct
until the cutover deletes them", listed FAST-PATHS.md in the doc table, and named it among the
honest trade-offs that change with behaviour. Those three passages now say what is true:
- the doc table loses the FAST-PATHS.md row;
- the old-runtime paragraph becomes "No switches. Never add a policy switch, a fact-table row,
a device check or a ledger row.";
- "The honest trade-offs stay current" names REFUSALS.md, METAL-COVERAGE.md,
CONFORMANCE-COVERAGE.md and API.md's catalogue, without FAST-PATHS.md.
DevicePolicy itself stays: it now holds only the consumer's domain, containment and isolation
choices, none of which trades accuracy for speed.
Verified: git ls-tree shows no docs/FAST-PATHS.md and git grep finds no fast_paths under crates/
at the parent; the diff touches AGENTS.md only.
The cutover's last mechanical step. The old runtime is deleted, so its name is free: the crate
moves to crates/metal2vulkan-runtime, its package is metal2vulkan-runtime and its library
metal2vulkan_runtime, and every reference in the tree follows (sources, tests, scripts, CI,
generated tables and docs).
It is now a published crate, as AGENTS.md said it would be once it took the name: version 0.2.0
with the other two, the translator pinned exactly (=0.2.0, as the translator pins the AIR front
end), documentation, keywords and categories, and copies of the repository's four license files,
which the published-crates test now holds equal to the root's for three crates. CI packages it
with the others. Prose that said it was unpublished, or counted two published crates, says three.
AGENTS.md: facts only. The crate table row, the published-crates and version sentences, and the
paragraph on the old runtime, whose name the runtime now carries (listed for the owner).
Made by one script run on this tip. Verified by the job
named in the landing note.
Section 9 now catalogues rt's precision notes (53f3e522e9); the degrade-notice
catalogue it replaced described the deleted runtime's notices. The doc table
and the docs rule name it by what it is now. Docs only.
The old runtime crate is deleted (5d725aeec7), so the facts change: seven
crates, two published crates sharing one version, rt described as the
runtime (unpublished until it takes the name metal2vulkan-runtime), the
harness as the runtime's, no row for the deleted crate or its README, the
gate line without -p metal2vulkan-runtime, and FAST-PATHS.md as the
translator's switches alone. The owner's rule sentences that name the old
runtime are untouched; they are listed for him.
Docs only; nothing compiles differently.
The scope sentence said a Metal feature no replay stream uses is a typed
refusal until a stream needs it. The owner did not rule that and asked for
it to change: a feature no guest has used, in a replay stream or a live
session, is a typed refusal until one does, and a refusal a guest meets is a
bug, ranked by how often guests meet it.
Docs only; nothing compiles differently.
The owner allowed driver-zeroed memory as a device-chosen form ("I'll allow it", relayed by the
planner from the owner's Telegram reply on 2026-11-19). Rule 2's list now names it, before
unified memory: a device with the zero-initialize feature allocates its memory zeroed and a block
says so at its take; a device without it writes every zero itself. The README's first memory
bullet no longer says nothing the driver does counts: a block's bytes are undefined except where
a take answers BlockInfo::zeroed, whose rule (high-water per allocation, rt's own zero requests
unchanged) the bullet below it states.
Docs only. The form itself is the commits before this one (c5607a598b..f776af3cb3): checked by
m3-max-53011 (clippy x3, rustdoc), m3-max-53003 (rt+harness 152/152, api_signatures 3/3, rt on
lavapipe 365/365 with both device tests), the negative control m3-max-52975 (the outside-writes
test fails on 114d718d46), and device runs on the 780M (53019), Iris (53022) and RX 550 (53026),
369/369 each.
The owner allowed one more exception to optimal images, exactly a plane texture of an exported
surface: a linear image on the surface's own exported memory at the export's pitch and plane
starts, and the copy form of the same call, counted and recorded as a known gap, where the device
offers no such image or cannot meet the layout. The Shared-buffer exception is kept word for word.
Checked against Device::new_exported_surface as built: in place, each plane's image is bound to
the surface's exported memory (a dma-buf's per-plane import of it, or the opaque handle's one
allocation) at SurfaceExport::planes; otherwise SurfaceForm::Copy, counted in
Metrics::surfaces_copied, its gaps in the rt README.
The owner's order (relayed by the planner, Telegram message 1924): "Remove
unused lines from the rules." The eighth second form of rule 2, a small zero
image or the default sampler where a device lacks the null descriptor, is
unused: nullDescriptor is a floor feature (crates/metal2vulkan-rt/src/
floor.rs requires robustness2.null_descriptor), so no device above the floor
takes the zero-image form and no code holds it.
Verified: a grep of the tree's Markdown and Rust for another statement of
eight forms or of the zero-image form finds none outside AGENTS.md. The rules'
other named items (the attachment feedback loop's counted copy in
crate::over and the attachments' copies, the optional features in
floor::OPTIONAL, DevicePolicy, tests::fast_paths, docs/FAST-PATHS.md) exist.
The owner approved it on 2026-11-18, typed in the planner's session, verbatim: "I approve it", on the planner's question "allow it as an eighth query-chosen form". Rule 2's list now holds eight: a device without the nullDescriptor feature gives every element of the texture and sampler arrays that no resource owns a small zero image or the default sampler, recorded as a known gap. The closing sentence (a second form chosen by anything else is not allowed) is kept. Docs only; the form itself is not built yet (it waits for the Mac lane).
Owner rule 2 named five features whose query may choose a second form. The owner allowed two
more on 2026-11-18, relayed verbatim by the planner from the Telegram bot:
- "I allow it", answering whether unified memory, decided by the Vulkan device type, may be a
query-decided form. That is the one-or-two-copies choice for Managed buffers that
Device::has_unified_memory answers. It is decided by the physical device type alone, never by
a vendor or device ID. The earlier sixth form (explicit pitch) stays dropped.
- "Wait never mind, copying is fine if the gpu/driver genuinely doesn't support it", reversing
the typed refusal for attachment reads on a driver without the feedback-loop features. On
such a device a draw that reads its own render target goes through a counted copy of the
target, as the last form there, reported as a known gap. The Copies rule is unchanged: this
is not leave for a copy on any device that has the feature.
The rt test that enforces rule 2 (tests::one_path) forbids identity names, environment reads
and policy types. It does not list the allowed queries, so it does not change.
The owner ruled it on 2026-11-17 (to the planner, "Add it"), on the item "SIMD
groups: the subgroup size range and maximal reconvergence". Rule 2 now lists
five features: the four before, and SIMD groups, the subgroup size range with
its stages and operations, and maximal reconvergence.
What follows for the translator and the new runtime: the three SIMD-group tiers
(pinned, 32-lane clusters, emulated), the large-kernel trigger and the form for a
device without maximal reconvergence are allowed on the runtime's one path,
chosen by those queries. The identity-keyed stage-bound fallback stays out.
Measured behind it: every lab GPU and lavapipe has
shaderMaximalReconvergence except the UHD 630 under Windows (driver 101.2145);
there, the 53 benchmark kernels with simdgroup lockstep barriers compile on the
emulated tier whole. Pinning large kernels costs 1.3-4.4x GPU time and 2-19x
creation time on the Intel GPUs, so the size-range choice stays.
Rule 3 said "optimal images in real layouts" without the exception the owner
accepted for textures over Shared buffers, so the two contradicted each other.
The rule now names the exception and its conditions: a linear image on the
buffer's memory, in the device's own layout, created so its first use keeps the
bytes, with the alignment the guest reads from Metal's minimum linear texture
alignment; where a format query offers no linear image for a format and usage, a
counted copy at commit. The owner fixed these conditions and said they do not grow.
Doc-only change.
The owner's decisions on the runtime rewrite's rules:
- The workaround ladder loses its calibration rung. Where no single form wins on
every device, the form that is best on the slowest GPU is taken and the loss on
the others is recorded as a known gap. The ladder is now four rungs; the
thresholds' time box ends at rung 4.
- "One form" means one form per Vulkan capability. A second form chosen by a
feature's query is allowed only for the four features the floor cannot
require on every lab device: 16-bit floats, storage-image reads without a
format, 64-bit atomics and 64-bit floats.
- Copies: nothing is copied that Metal would not copy; a copy is only the last
form on a device with no other, reported as a known gap.
Doc-only change; nothing else refers to the removed rung.
What: a new, unpublished workspace crate, crates/metal2vulkan-rt, that will replace
metal2vulkan-runtime and take its name at the cutover. It has no public API yet. Its first test,
tests::one_path, reads the crate's product sources (line comments removed) and fails on:
- a vendor, device or driver identity name (vendor_id, deviceID, DriverId, driver_name ...);
- a GPU vendor's ID as a hex literal (0x1002, 0x10de, 0x8086 ...);
- an environment read (env::var, option_env!);
- a struct or enum named as a policy.
Two more tests prove the scan finds each form and passes prose and unrelated numbers.
AGENTS.md takes the owner's new rules, in priority order:
1. correct for documented Metal, with the device's arithmetic and static notes per operation;
2. one path for every device;
3. native-like speed;
4. small.
It also takes:
- the workaround ladder, the never-list and the thresholds;
- the matrix rules: every check fans out one leg per GPU at once, and the replay matrix runs on
development after each merge with deterministic metrics and leak gauges;
- the freeze: the old runtime, DevicePolicy switches, driver-fact tables, device checks and
docs/FAST-PATHS.md get regression fixes only until the cutover deletes them, and nothing new
of those kinds is added;
- the scope rule: below the floor is a typed refusal, and a Metal feature no replay stream uses is
a typed refusal until a stream needs it.
The crate table, the doc table, CI's crate lists and the gate commands in AGENTS.md,
CONTRIBUTING.md and docs/VALIDATION.md name the new crate.
Why: the owner's plan replaces the runtime with one that has no per-device code paths. These are
the rules every lane of that work follows from its first commit.
Verified: cargo fmt. Build, clippy and the crate's tests run on development after this lands.
x86_64-pc-windows-gnullvm (the primary Windows target) and x86_64-pc-windows-msvc, with
--all-targets --all-features and warnings denied. Clippy links nothing, so the Linux job
needs only the two targets' standard libraries. AGENTS.md's CI paragraph names the step.
Verified: the same clippy lines ran in potluck jobs on Linux (msi) for both targets.
kache 2.0 imports a crate's incremental state from another worktree's target only when both
targets sit inside their worktrees: a CARGO_TARGET_DIR outside its worktree is attributed to the
target's parent directory instead, and neither gives nor takes. AGENTS.md and CONTRIBUTING.md
now say so: target/ (Cargo's default), and target/gpucfg for --cfg m2v_gpu builds, as CI and
docs/VALIDATION.md already name it.
Verified on the M3 Max at 7dbedfd151 with three lean worktrees building metal2vulkan-air, then
the same comment edit to its lib.rs: the donor's first edit rebuilt from scratch in 3.89 s; a
second worktree with an in-tree target rebuilt it in 1.61 s, which kache explain records as
"automatic worktree seed"; a control with its target outside its worktree took 3.84 s,
recorded as a plain edit rebuild under the target's parent.
The owner asked for a nightly toolchain, -Zthreads, kache 2.0 with its incremental cache, and
Rust's incremental compilation on.
- rust-toolchain.toml pins nightly-2026-11-03 (rustc 1.101.0-nightly 1c3a65069), dated so every
machine runs one rustc, clippy and rustfmt. The published crates keep rust-version 1.98, which
this build no longer checks by itself (clippy's incompatible_msrv still flags newer std items).
- .cargo/config.toml passes -Zthreads=0 (a thread per core) through Cargo's profile rustflags,
which add to RUSTFLAGS instead of being replaced by it, so `--cfg m2v_gpu` lanes and CI's
-Dwarnings keep it.
- scripts/rustc-wrapper hands each compile to kache where kache is on PATH outside CI, and to
rustc otherwise; `RUSTC_WRAPPER=` (empty) builds without it.
- CARGO_INCREMENTAL=0 is gone from scripts/device-lane, AGENTS.md and CONTRIBUTING.md.
- CI installs the toolchain the file names; both Dockerfiles take the same nightly.
What the nightly asked of the code:
- Its standard library containers take more trait-solver levels (Box -> BoxRaw, RawVec ->
PhantomData), so proving a RenderCommandEncoder `Send` from a program's crate ran past the
default recursion limit (tests/consumer_auto_traits.rs failed, a future-incompat lint that will
become an error). The encoder now holds its own lowering in `OwnLowering`, whose `Send` impl is
written out over a compile-time proof that `RenderLowering` is `Send`, as `LoweringSlot` already
was. The runtime crate's own proofs need recursion_limit 256.
- New clippy lints: needless_range_loop, single_element_loop, new_instead_of_clear (a false
positive on a moved-from Vec: the part's segments are now taken explicitly),
needless_borrows_for_generic_args, redundant_closure, unnecessary_lazy_evaluations,
manual_range_patterns; AtomicU64::fetch_update is deprecated for try_update (present in 1.98).
- Cargo warns that `homepage` equals `repository`: homepage removed from the manifests.
- nightly rustfmt formats ir_id! invocations one argument per line.
Verified on the M3 Max: `cargo clippy --workspace --all-targets --all-features -- -D warnings`
clean on the nightly; `cargo build -v` shows -Zthreads on every rustc invocation and
scripts/rustc-wrapper in front of each.
One work packet, landed as 2 commits (4bf2c22aad..9090d9a1b1 on archive/development-linear-2026-10-28), in order:
* Drop the exact golden table, a duplicate of the default one
`DevicePolicy::exact_answers()` now sets only the runtime's switches (heap compression,
completion, batch order, render lowering, host-page textures), none of which a translation reads:
the table's own structural test held its profiles' fingerprints equal to the default table's, so
`golden_hashes_exact.tsv` pinned a subset of `golden_hashes.tsv` cell for cell. The table, its
comparison test, its structural test and the `samples` filter go; the bless writes the one table.
Verified: clippy (workspace, all targets, all features) clean; the golden module's structural
tests, fast_paths and published_crates pass (14 tests).
* State the native-arithmetic rule in AGENTS.md and the ledger
The owner ruled on 2026-10-27: "Just promise the GPU's native arithmetics, no more 'exact'
emulation." Rule 1 now says so: arithmetic and value answers are the device's own native form,
recorded as a precision note where they can differ from Metal's, and no path or switch emulates
Metal's bits where the device has a native form; capability emulation stays; the remaining
speed-for-accuracy switches (outside arithmetic) keep both forms, the fast one the default. The
"Scope is the device's" honesty rule names the native answer as a recorded near-equivalent.
docs/FAST-PATHS.md's opening says the same and what its tables hold.
Verified: tests::fast_paths passes.
The steps this packet landed as, in order:
- Wrap the option-space axis's two overlong lines
- Blank a source for the hand-modelled scan only where a match needs it
- Remove the self-test's trees when it is done with them
- Say that a sweep by ordinal states no value by name
- Record why an ordinal-stated value must not be resolved by field name
- Re-derive the generated documents at the landing tip
Content: the tree of `development` at 9e1c5a54d5, unchanged.
The steps this packet landed as, in order:
- Give AstcDecode its first check against Metal rather than against itself
- Inventory what the conformance suite verifies, not what we implement
- Leave no bytecode cache beside the coverage script
- Group the conformance inventory by SDK header as well as by container
Content: the tree of `development` at 0375c9b833, unchanged.
The steps this packet landed as, in order:
- Prove the conformance loop with two seed cases, recorded on this M3 Max
- Own the committed-AIR shader path, and three more exhaustive byte cases
- Compare a case's words in named columns, and keep the suite's two venues green
- Bump the runtime version and pin the runtime sources after the binding fix
Content: the tree of `development` at 4b4ecc5628, unchanged.
The owner lifts it: a device may keep what it checked or learned about
itself in an earlier session (its driver's answers and defects, checked
on the device). The bans on keying behavior to an app, a shader hash or
a corpus census stay. Doc-only; cargo fmt --all run.
AGENTS.md told agents to merge into master at once and to run the
checks and re-blesses there. The owner's rule (2026-10-11) is now that
no agent works on or advances master unless the user explicitly asks:
work happens on development, made from master when it is missing, or on
branches off it. The git workflow section, the loop's last step and the
definition of done now name development instead of master. The speed
rule is unchanged: merge at once, no pre-merge gate, fix forward.
Verified: docs only; cargo fmt --all left the tree unchanged, and the
only remaining mention of master in AGENTS.md is the new rule itself.
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
Rolls up everything since 9e0e99a4 into a single commit:
- src/native, src/passes, src/reflect, src/meta: AIR intrinsic lowering,
access-chain and pointer handling, constant/composite dedup, storage
and descriptor-slot fixes, function-constant folding.
- validation/: Metal and MoltenVK oracles, triage, observation contract,
and the case runner.
- validation/corpus and fixtures: new authored cases and re-recorded
candidate observations at the shipping fingerprint.
- tests/: module-level oracles for reflection, NonWritable, gated
varyings/system values/descriptor slots, loop budget, and fallback.
Both were being followed by habit and neither was written anywhere, so
each new contributor (human or agent) had to rediscover them:
- Never amend. An existing commit is history someone may already have
read; corrections belong in the next commit, not in a rewrite of the
last one.
- Every commit is a release candidate. Landing a half-applied refactor or
a fix whose test is still to come leaves the tree in a state where the
pre-commit gate no longer means what it claims. Large changes get split
into independently sound steps, not into a break followed by a repair.
The hard end-to-end ceiling per translation attempt is now 20 seconds,
in the corpus-triage worker guard that enforces it and in the AGENTS.md
and docs/VALIDATION.md statements of the contract. The 500-MiB memory
budget is unchanged.
Verified: corpus-triage unit tests (15) pass; fmt clean.
Squash 147 commits (2026-08-20 through 2026-08-31) into one change on top
of the exact-kernel-grid work. Covers native lowering and pointer/layout
construction, AIR intrinsic and funnel-shift coverage, BDA address
preservation across aggregate calls, CFG structurization, function-constant
and visible-function specialization, the 30-second translation ceiling, the
authored-case corpus and linkage validation suite, and refreshed byte-exact
MoltenVK evidence.
The kernel-grid lowering in this tree supersedes the 324-line variant in
the parent commit; that file is reduced to its current 139-line form here.
Resulting tree is identical to 7174c7b. Prior history remains reachable at
tag pre-squash-backup and branch backup/pre-squash-7174c7b.
Claude-Session: https://claude.ai/code/session_01D1u4vU7Mr5QNWrnnRHC8iS
Overhaul the validation workflow around sharded authored cases, dependency-exact observations, incremental indexed corpus audits, bounded parallel translation, and native Metal/Vulkan comparison.\n\nExpand native AIR lowering, reflection, linked-function specialization, resource and stage-interface support, and structural CFG/pointer repair across the harvested macOS 26 corpus. Add exact intrinsic inventory, distributed 16x16x16 matrix lowering, explicit opaque tensor linkage, and regression coverage for the newly supported feature classes.\n\nThe final corpus verification accounts for all 88,819 indexed AIR modules under the current product fingerprint: 65,355 translate and validate directly, 23,464 require exact authored linkage, and zero fail or remain unresolved.
Replace the old drift/harvest scripts and generated corpus-test path with
Rust validation binaries that use JSONL ledgers as the durable corpus and
execution record.
- Move translate banking from validation/corpus/drift-ledger.jsonl to
validation/corpus/metal2vulkan-ledger.jsonl, and seed tracked Metal and
MoltenVK execution ledgers with hash-identified rows and output_b64
payloads.
- Add corpus-harvest, corpus-mint, corpus-remint, corpus-why, corpus-triage,
and corpus-run-{metal,vulkan,moltenvk} binaries for shard harvesting,
additive/remint translate banking, single-case fallback inspection,
status triage, and backend execution.
- Rework corpus runners to infer execution plans from shard-backed AIR at run
time, merge per-run deltas into sorted ledgers, support focused reruns, and
keep Metal oracle coverage available for translate FALLBACK rows while SPIR-V
backends remain gated on translate status=ok.
- Bound control-parameter seeding and add loop-budget instrumentation,
quarantine handling, subprocess timeouts, Ctrl-C worker cleanup, slow-case
logging, panic backtraces, and MoltenVK/Homebrew Vulkan discovery for safer
offline execution.
- Consolidate validation helpers for AIR stage/entry parsing, corpus source and
shard resolution, hashing, JSONL I/O, texture shape policy, translate-ledger
rows, runner status rows, and triage summaries.
- Remove obsolete Python drift/harvest scripts, generated corpus stubs,
broken/tolerances sidecars, TOOLCHAIN.lock, and unused validation harness
modules from the repo surface.
- Update validation, corpus, A/B, architecture, contributing, and agent docs,
plus gitignore rules, to describe the shard-backed ledger workflow and its
expected generated artifacts.