From e85535dbfa78ffbda7572018ef8cbd7d929f061a Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 2 Dec 2026 18:01:46 -0800 Subject: [PATCH] Validation test: an input whose architecture the toolchain does not know is skipped and counted (red) macOS CI (run 47003321413, macos-26, MetalToolchain 17.6) failed oracle_fuel::tests::public_fixtures_with_loops_round_trip_instrumented on tns_mm_fp8, tns_mm_left and tns_mm_v2 .air.ll: that toolchain's metal-opt answers "unrecognized architecture 'air64_v29' provided." for the fixtures' own target triple, which is newer than it knows. The air writer's Tally already skips, lists and counts an input above the toolchain's AIR version or Metal standard; it has no rule for this third refusal, so the fixture counts as a failure. The new test hands Tally::refused that refusal for tns_mm_v2.air.ll and expects a skip. Two more cases join every_other_toolchain_error_fails: an architecture the input's triple does not name, and one refused for an input with no triple, both still failures. Red: string-only, so it runs on Linux; expected to fail until the classifier lands (next commits). --- .../src/air_writer/tests.rs | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/crates/metal2vulkan-validation/src/air_writer/tests.rs b/crates/metal2vulkan-validation/src/air_writer/tests.rs index 55218700e..854f07f8f 100644 --- a/crates/metal2vulkan-validation/src/air_writer/tests.rs +++ b/crates/metal2vulkan-validation/src/air_writer/tests.rs @@ -739,13 +739,32 @@ fn a_source_above_the_compiler_s_metal_standard_is_skipped_and_counted() { assert!(tally.above[0].contains("a27_memory_order.metal")); } +/// An older `metal-opt` refuses the architecture of a newer AIR it does not know (the +/// MetalToolchain 17.6 of Xcode 26.6 on a fixture of target `air64_v29`): the input is skipped, +/// listed and counted, not failed. The input is a fixture whose own `target triple` names +/// `air64_v29`. +#[test] +fn an_input_of_an_architecture_the_toolchain_does_not_know_is_skipped_and_counted() { + let path = fixtures().join("engine").join("tns_mm_v2.air.ll"); + let refusal = "metal-opt: the input passes no level: /usr/metal/current/bin/metal-opt: \ + unrecognized architecture 'air64_v29' provided.\n"; + let mut tally = Tally::default(); + tally.refused(&path, refusal); + assert_eq!(tally.failures, Vec::::new()); + assert_eq!(tally.above.len(), 1, "{:?}", tally.above); + assert!(tally.above[0].contains("tns_mm_v2.air.ll")); + assert!(tally.above[0].contains("air64_v29")); +} + /// Every other toolchain error still fails: another metallib error; a version refusal whose /// expected version is not below the input's, or that names a version the input does not state; a /// compiler refusal of a standard the source does not name, or where the compiler offers the -/// source's; any other compiler error. +/// source's; any other compiler error; a refusal of an architecture the input's `target triple` +/// does not name, or of one where the input states no triple. #[test] fn every_other_toolchain_error_fails() { let air = fixtures().join("engine").join("air_2_9_front_end.air.ll"); + let air29 = fixtures().join("engine").join("tns_mm_v2.air.ll"); let msl = fixtures().join("engine").join("a27_memory_order.metal"); let errors = [ (&air, "metallib: error: undefined symbol '_air.foo'\n"), @@ -770,6 +789,14 @@ fn every_other_toolchain_error_fails() { note: use 'metal4.1' for 'Metal 4.1' standard\n", ), (&msl, "error: use of undeclared identifier 'foo'\n"), + ( + &air29, + "metal-opt: unrecognized architecture 'air64_v30' provided.\n", + ), + ( + &msl, + "metal-opt: unrecognized architecture 'air64_v29' provided.\n", + ), ]; for (path, error) in errors { let mut tally = Tally::default();