Commit Graph
23 Commits
Author SHA1 Message Date
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 588c40f91e Credit the format-by-type grid the read-write tier case puts to Metal
Content: the tree of `development` at 294fa689f9, unchanged.
2026-10-26 13:19:19 +02:00
Anees Iqbal 25ab1ea82b Read the storage mode the suite's cases actually state
Content: the tree of `development` at 1f1ac002e7, unchanged.
2026-10-26 13:19:18 +02:00
Anees Iqbal 04820f0bed Read the conformance suite's unit tests out of its Metal leg
The steps this packet landed as, in order:
- Read the selectors the suite's Metal leg sends by hand
- Type the receivers the suite's Metal leg binds by pattern
- Read the receiver, the chain and the closure the leg actually writes
- Say what still costs an unresolved call site
- Re-bless the golden tables after the extension vocabulary grew

Content: the tree of `development` at 1116f3a6d0, unchanged.
2026-10-26 13:19:18 +02:00
Anees Iqbal eab25ced7d Cite a refusal's sites by file and function, with no generation stamp
The steps this packet landed as, in order:
- Say so when a conformance-coverage module is run as a command
- Order the TOOLCHAIN fixture lines by byte value, not by the host's locale

Content: the tree of `development` at b5a0b1378b, unchanged.
2026-10-26 13:19:16 +02:00
Anees Iqbal 302b45d57a Carry a venue's own gap in the failure's recorded value
The steps this packet landed as, in order:
- Flag what moves between runs of one replay selection
- Read a leg function handed to a combinator as an edge

Content: the tree of `development` at f3069fdc8e, unchanged.
2026-10-26 13:19:14 +02:00
Anees Iqbal 8b786a7304 Declare the discrete-card memory notice on every fresh-contents row
The steps this packet landed as, in order:
- Hold the venue memory notice in one place, beside notice_allowance
- Declare the discrete-card memory notice in eleven families that named none
- Declare the discrete-card memory notice in eight families that already named others
- Declare the discrete-card memory notice in sixteen more families
- Declare the notices a non-Metal driver provokes in the rest of the a-l shard

Content: the tree of `development` at 1df59f5add, unchanged.
2026-10-26 13:19:14 +02:00
Anees Iqbal feb0dca3ec Hold a crossing's field axis to the field its module's own data states
The steps this packet landed as, in order:
- Declare the crossings two pass families already hold

Content: the tree of `development` at a4805b6ba1, unchanged.
2026-10-26 13:19:14 +02:00
Anees Iqbal 0f7913c84e Make layered and sliced rendering reachable, and compare it
The steps this packet landed as, in order:
- Re-derive the generated documents at the landing tip

Content: the tree of `development` at fc6bb53c97, unchanged.
2026-10-26 13:19:14 +02:00
Anees Iqbal 51ef415ed3 Cross tessellation's option space, and MTLPrimitiveType with MTLIndexType
The steps this packet landed as, in order:
- Re-derive the generated documents at the landing tip

Content: the tree of `development` at 2c1636399f, unchanged.
2026-10-26 13:19:14 +02:00
Anees Iqbal 30a76f3e8d Compare the depth-resolved stencil filter against Metal
The steps this packet landed as, in order:
- Measure compressionType, and say why no case states it

Content: the tree of `development` at 2eb1d1baf1, unchanged.
2026-10-26 13:19:14 +02:00
Anees Iqbal 3fd2027718 Cross a pass's store action with the next pass's load action
Content: the tree of `development` at 9bbfa59230, unchanged.
2026-10-26 13:19:13 +02:00
Anees Iqbal 80897130a4 Count this round's crossings, and measure the ones the pairs ledger cannot say
Content: the tree of `development` at e5730ba29c, unchanged.
2026-10-26 13:19:13 +02:00
Anees Iqbal 709b119ac1 Count the pairs of the option space a case puts to Metal at once
Content: the tree of `development` at bdf26790f9, unchanged.
2026-10-26 13:19:13 +02:00
Anees Iqbal 980c6cdaa7 Count the option values no case can reach apart from the gap
Content: the tree of `development` at 208724fc04, unchanged.
2026-10-26 13:19:13 +02:00
Anees Iqbal 2313f0d924 Say which items an untyped receiver hides, and bound it honestly
Content: the tree of `development` at 9a29ebc6f8, unchanged.
2026-10-26 13:19:13 +02:00
Anees Iqbal 0ddba0e572 Key the implemented denominator, which the map holds one item of twice
The steps this packet landed as, in order:
- Credit a container's own row, and state what no binding can reach
- Stop dropping call edges, and read a class message broken after `::`
- Report a site name held twice, instead of pairing the two by luck
- Give the hand-declared Metal enums an SDK denominator
- Read a braced `use`, which named values this axis counted nowhere
- Separate what Metal answered from what a case named a site
- State the two floors as what they are, not as what they were

Content: the tree of `development` at 15adea8261, unchanged.
2026-10-26 13:19:12 +02:00
Anees Iqbal acea7ad20b Measure how much of each Metal enum the conformance suite compared
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.
2026-10-26 13:19:12 +02:00
Anees Iqbal cc34e1a18b Resolve the Metal leg's class-method sends, and stop claiming the limits are closed
The steps this packet landed as, in order:
- Say why a called selector can be missing from the coverage map

Content: the tree of `development` at eed0293b78, unchanged.
2026-10-26 13:19:12 +02:00
Anees Iqbal ca39c8f685 Compare every self-fact a function states, specialized and not, against Metal
The steps this packet landed as, in order:
- Compare what a compute and a drawing pipeline state say about themselves
- Stop the coverage derivation dropping a Metal-leg function whose signature holds a semicolon, and type three receivers it could not

Content: the tree of `development` at 35b3d026d4, unchanged.
2026-10-26 13:19:11 +02:00
Anees Iqbal 265230b7a8 Compare an argument encoder's layout and a function's bindings against Metal
The steps this packet landed as, in order:
- Take Metal's answer for the argument-encoder and function-binding cases
- Name the receiver that reads a texture an argument buffer holds, and cut what nothing calls
- Declare the three notices the sampling cases announce on a software renderer
- Keep the argument-encoder module's docs inside what rustdoc will publish

Content: the tree of `development` at ae72eece5c, unchanged.
2026-10-26 13:19:11 +02:00
Anees Iqbal bf13d43da6 Say what an unimplemented item the leg calls may be
Content: the tree of `development` at 69f9fc84f2, unchanged.
2026-10-26 13:19:10 +02:00
Anees Iqbal 2047524f92 Give EtcDecode its first check against Metal rather than against itself
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.
2026-10-26 13:19:09 +02:00