From 1fb65bf3ef68fea04a3297bc70f7178cbaa7f3d6 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sat, 21 Nov 2026 13:32:47 -0800 Subject: [PATCH] Runtime tests: the device form of the profile test reads the same two README tables The previous commit taught the committed-profile form of the profile test to exempt the README's "Enabled, not stated" features. The device form, under --cfg m2v_gpu or m2v_cpu_icd, kept its own copy of the check, which read only the "Not enabled" table. On the RTX 3090 (m3-max-64890), the Radeon 780M (m3-max-64892) and the Iris Xe (m3-max-64891) it still failed on maintenance5, which those devices report and which creation withholds there or never states. Both forms now call one check, all_recorded. --- .../src/tests/feature_enables.rs | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/tests/feature_enables.rs b/crates/metal2vulkan-runtime/src/tests/feature_enables.rs index 1ff8a5e38..eb6f8b9d1 100644 --- a/crates/metal2vulkan-runtime/src/tests/feature_enables.rs +++ b/crates/metal2vulkan-runtime/src/tests/feature_enables.rs @@ -408,16 +408,14 @@ fn the_profile_reads_no_feature_creation_withholds_unrecorded() { judge(&read, &reported); } -/// Each feature `read` names is recorded in the README's `Not enabled` table or its `Enabled, not -/// stated` one, and each feature `Not enabled` records is not a feature creation enables, and is -/// in `read` wherever some device reports it. -fn judge(read: &BTreeMap>, reported: &BTreeSet) { - let recorded = recorded(); +/// Each feature `read` names is in the README's `Not enabled` table or its `Enabled, not stated` +/// one: a feature creation enables only where its own rule says, and never states, is withheld +/// wherever that rule does not hold. +fn all_recorded(read: &BTreeMap>) { for (feature, devices) in read { println!("feature-enables: {feature:?} changes the profile on {devices:?}"); } - // A feature creation enables only where its own rule says, and never states, is withheld - // wherever that rule does not hold. + let recorded = recorded(); let unstated: BTreeSet = unstated("feature") .iter() .filter_map(|member| vocabulary(member)) @@ -431,6 +429,14 @@ fn judge(read: &BTreeMap>, reported: &BTreeSet "read by the translator's profile, withheld by creation and in neither the README's `Not \ enabled` table nor its `Enabled, not stated` one: {unrecorded:?}" ); +} + +/// Each feature `read` names is recorded in the README's `Not enabled` table or its `Enabled, not +/// stated` one, and each feature `Not enabled` records is not a feature creation enables, and is +/// in `read` wherever some device reports it. +fn judge(read: &BTreeMap>, reported: &BTreeSet) { + let recorded = recorded(); + all_recorded(read); let creation = creation_features(); let enabled: Vec<&VkFeature> = recorded.intersection(&creation).collect(); assert!( @@ -489,14 +495,5 @@ fn the_profile_reads_no_feature_the_device_reports_that_creation_withholds_unrec } drop(runtime); assert!(checked > 0, "the loader lists no device of this cfg's kind"); - let recorded = recorded(); - let unrecorded: Vec<&VkFeature> = read.keys().filter(|f| !recorded.contains(f)).collect(); - for (feature, devices) in &read { - println!("feature-enables: {feature:?} changes the profile on {devices:?}"); - } - assert!( - unrecorded.is_empty(), - "read by the translator's profile, withheld by creation and not in the README's `Not \ - enabled` table: {unrecorded:?}" - ); + all_recorded(&read); }