The derived-slot probe records Metal's answers on the M3 Max

What: overlapping_derived_slots.m's header records its run: Metal refuses
the function for kind 0 batch 0 ("texture argument src has invalid
location (<0,1>)"), and makes and runs it for kind 0 batch 1 (dst reads
1 2 3 4) and kind 2 batch 0 (dst gated off, reads 0 0 0 0).

Why: it settles that a runtime refusal of a kernel whose constants put
two present textures on one slot through derived constants is Metal's own
answer, made at the pipeline state where Metal makes it at the function.

Verified: potluck job m3-max-25307 on the M3 Max (macOS 27.0.1), one run.
This commit is contained in:
Anees Iqbal committed 2026-11-13 03:31:13 -08:00
1 parent 394ee5cae2
commit 48ca4bba63
1 file changed
+8
@@ -18,6 +18,14 @@
// clang -fobjc-arc -O1 -fmodules -o overlapping_derived_slots overlapping_derived_slots.m \
// -framework Foundation -framework Metal
// Run: ./overlapping_derived_slots, MTL_DEBUG_LAYER unset.
//
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1, one run):
// - kind 0, batch 0: Metal refuses the function: "texture argument src has invalid location
// (<0,1>) in overlapping_derived_slots".
// - kind 0, batch 1: the function and pipeline are made; `dst` reads 1 2 3 4.
// - kind 2, batch 0: made; `dst`, gated off, reads 0 0 0 0.
// The runtime makes this check at the pipeline state rather than at the function
// (`Library::new_function_with_name_constant_values`).
#import <Foundation/Foundation.h>
#import <Metal/Metal.h>
#include <stdio.h>