Skip to main content

wgpu_core/
limits.rs

1//! Functionality related to device and adapter limits.
2//!
3//! # Limit Bucketing
4//!
5//! Web browsers make various information about their operating environment
6//! available to content to provide a better experience. For example, content is
7//! able to detect whether the device has a touch-screen, in order to provide an
8//! appropriate user interface.
9//!
10//! [Browser fingerprinting][bfp] employs this information for the purpose of
11//! constructing a unique "fingerprint" value that is unique to a single browser
12//! or shared among a relatively small number of browsers. Fingerprinting can be
13//! used for various purposes, including to identify and track users across
14//! different websites.
15//!
16//! Limit bucketing can reduce the ability to fingerprint users based on GPU
17//! hardware characteristics when using `wgpu` in applications like a web
18//! browser.
19//!
20//! When limit bucketing is enabled, the adapter limits offered by `wgpu` do not
21//! necessarily reflect the exact capabilities of the hardware. Instead, the
22//! hardware capabilities are rounded down to one of several pre-defined buckets.
23//! The goal of doing this is for there to be enough devices assigned to each
24//! bucket that knowledge of which bucket applies is minimally useful for
25//! fingerprinting.
26//!
27//! Limit bucketing may be requested by setting `apply_limit_buckets` in
28//! [`wgt::RequestAdapterOptions`] or by setting `apply_limit_buckets` to
29//! true when calling [`enumerate_adapters`].
30//!
31//! If your application does not expose `wgpu` to untrusted content, limit
32//! bucketing is not necessary.
33//!
34//! [bfp]: https://support.mozilla.org/en-US/kb/firefox-protection-against-fingerprinting
35//! [`enumerate_adapters`]: `crate::instance::Instance::enumerate_adapters`
36
37use core::mem;
38
39use alloc::{borrow::Cow, vec::Vec};
40use thiserror::Error;
41use wgt::error::{ErrorType, WebGpuError};
42use wgt::{AdapterInfo, AdapterLimitBucketInfo, DeviceType, Features, Limits};
43
44use crate::api_log;
45
46#[derive(Clone, Debug, Error)]
47#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
48#[error("Limit '{name}' value {requested} is better than allowed {allowed}")]
49pub struct FailedLimit {
50    name: Cow<'static, str>,
51    requested: u64,
52    allowed: u64,
53}
54
55impl WebGpuError for FailedLimit {
56    fn webgpu_error_type(&self) -> ErrorType {
57        ErrorType::Validation
58    }
59}
60
61pub(crate) fn check_limits(requested: &Limits, allowed: &Limits) -> Vec<FailedLimit> {
62    let mut failed = Vec::new();
63
64    requested.check_limits_with_fail_fn(allowed, false, |name, requested, allowed| {
65        failed.push(FailedLimit {
66            name: Cow::Borrowed(name),
67            requested,
68            allowed,
69        })
70    });
71
72    failed
73}
74
75/// Fields in [`wgt::AdapterInfo`] relevant to limit bucketing.
76pub(crate) struct BucketedAdapterInfo {
77    // Equivalent to `adapter.info.device_type == wgt::DeviceType::Cpu`
78    is_fallback_adapter: bool,
79
80    subgroup_min_size: u32,
81    subgroup_max_size: u32,
82}
83
84impl BucketedAdapterInfo {
85    const fn defaults() -> Self {
86        Self {
87            is_fallback_adapter: false,
88            subgroup_min_size: 4,
89            subgroup_max_size: 128,
90        }
91    }
92}
93
94impl Default for BucketedAdapterInfo {
95    fn default() -> Self {
96        Self::defaults()
97    }
98}
99
100pub(crate) struct Bucket {
101    name: &'static str,
102    limits: Limits,
103    info: BucketedAdapterInfo,
104    features: Features,
105}
106
107impl Bucket {
108    pub fn name(&self) -> &'static str {
109        self.name
110    }
111
112    /// Returns `true` if the device having `limits`, `info`, and `features` satisfies
113    /// the bucket definition in `self`.
114    pub fn is_compatible(&self, limits: &Limits, info: &AdapterInfo, features: Features) -> bool {
115        // In the context of limit checks, "allowed" or "available" means
116        // what the device supports. If an application requests an
117        // unsupported value, the error message might say "limit of {} exceeds
118        // allowed value {}". For purposes of bucket compatibility, the bucket values
119        // take the place of application-requested values. If the bucket value
120        // is beyond what the device supports, then the device does not qualify
121        // for that bucket.
122        let candidate_is_fallback_adapter = info.device_type == DeviceType::Cpu;
123
124        let failing_limits = check_limits(&self.limits, limits);
125        let limits_ok = failing_limits.is_empty();
126
127        if !limits_ok {
128            log::debug!("Failing limits: {:#?}", failing_limits);
129        }
130
131        let bucket_has_subgroups = self.features.contains(Features::SUBGROUP);
132        let subgroups_ok = !bucket_has_subgroups
133            || info.subgroup_min_size >= self.info.subgroup_min_size
134                && info.subgroup_max_size <= self.info.subgroup_max_size;
135        if !subgroups_ok {
136            log::debug!(
137                "Subgroup min/max {}/{} is not compatible with allowed {}/{}",
138                self.info.subgroup_min_size,
139                self.info.subgroup_max_size,
140                info.subgroup_min_size,
141                info.subgroup_max_size,
142            );
143        }
144
145        let features_ok = features.contains(self.features);
146        if !features_ok {
147            log::debug!("{:?} are not available", self.features - features);
148        }
149
150        limits_ok
151            && candidate_is_fallback_adapter == self.info.is_fallback_adapter
152            && subgroups_ok
153            && features_ok
154    }
155
156    pub fn try_apply_to(&self, adapter: &mut hal::DynExposedAdapter) -> bool {
157        if !self.is_compatible(
158            &adapter.capabilities.limits,
159            &adapter.info,
160            adapter.features,
161        ) {
162            log::debug!("bucket `{}` is not compatible", self.name);
163            return false;
164        }
165
166        let raw_limits = mem::replace(&mut adapter.capabilities.limits, self.limits.clone());
167
168        // Features in EXEMPT_FEATURES are not affected by limit bucketing.
169        let exposed_features = adapter
170            .features
171            .intersection(EXEMPT_FEATURES)
172            .union(self.features);
173        let raw_features = mem::replace(&mut adapter.features, exposed_features);
174
175        let (bucket_subgroup_min_size, bucket_subgroup_max_size) =
176            if self.features.contains(Features::SUBGROUP) {
177                (self.info.subgroup_min_size, self.info.subgroup_max_size)
178            } else {
179                // WebGPU requires that we report these values when subgroups are
180                // not supported
181                (
182                    wgt::MINIMUM_SUBGROUP_MIN_SIZE,
183                    wgt::MAXIMUM_SUBGROUP_MAX_SIZE,
184                )
185            };
186        let raw_subgroup_min_size = mem::replace(
187            &mut adapter.info.subgroup_min_size,
188            bucket_subgroup_min_size,
189        );
190        let raw_subgroup_max_size = mem::replace(
191            &mut adapter.info.subgroup_max_size,
192            bucket_subgroup_max_size,
193        );
194
195        adapter.info.limit_bucket = Some(AdapterLimitBucketInfo {
196            name: Cow::Borrowed(self.name),
197            raw_limits,
198            raw_features,
199            raw_subgroup_min_size,
200            raw_subgroup_max_size,
201        });
202
203        true
204    }
205}
206
207/// Apply [limit bucketing][lt] to the adapter limits and features in `raw`.
208///
209/// Finds a supported bucket and replaces the capabilities with the set defined by
210/// the bucket. If no suitable bucket is found, returns `None`, but this should only
211/// happen with downlevel devices, and attempting to use limit bucketing with
212/// downlevel devices is not recommended.
213///
214/// [lt]: self#Limit-bucketing
215pub fn apply_limit_buckets(mut raw: hal::DynExposedAdapter) -> Option<hal::DynExposedAdapter> {
216    for bucket in buckets() {
217        if bucket.try_apply_to(&mut raw) {
218            let name = bucket.name();
219            api_log!("Applied limit bucket `{name}`");
220            return Some(raw);
221        }
222    }
223    log::warn!(
224        "No suitable limit bucket found for device with {:?}, {:?}, {:?}",
225        raw.capabilities.limits,
226        raw.info,
227        raw.features,
228    );
229    None
230}
231
232/// These features are left alone by limit bucketing. They will be exposed to higher layers
233/// whenever the device supports them, and they are not considered when determining bucket
234/// compatibility.
235///
236/// All four features in the list are related to external textures. (The texture format
237/// features are used internally by Firefox to support external textures.)
238///
239/// Handling them this way is a bit of a kludge, but is expected to be a short-term
240/// situation only until external texture support is universally available.
241///
242/// Note that while NV12 and P010 can be hidden from content by excluding them from WebIDL,
243/// TEXTURE_FORMATS_16BIT_NORM will eventually be replaced with TEXTURE_FORMATS_TIER1, and
244/// at that point neither excluding the tier1 formats from WebIDL entirely nor allowing
245/// content to use them on a device that doesn't have the feature enabled will be
246/// acceptable. See <https://github.com/gfx-rs/wgpu/issues/8122>.
247pub(crate) const EXEMPT_FEATURES: Features = Features::EXTERNAL_TEXTURE
248    .union(Features::TEXTURE_FORMAT_NV12)
249    .union(Features::TEXTURE_FORMAT_P010)
250    .union(Features::TEXTURE_FORMAT_16BIT_NORM);
251
252/// Return the defined adapter feature/limit buckets
253///
254/// Buckets are not always subsets of preceding buckets, but [`enumerate_adapters`]
255/// considers them in the order they are listed here and uses the first bucket satisfied
256/// by the device.
257///
258/// [`enumerate_adapters`]: `crate::instance::Instance::enumerate_adapters`
259pub(crate) fn buckets() -> impl Iterator<Item = &'static Bucket> {
260    [
261        &BUCKET_M1,
262        &BUCKET_A2,
263        &BUCKET_I1,
264        &BUCKET_N1,
265        &BUCKET_A1,
266        &BUCKET_NO_F16,
267        &BUCKET_LLVMPIPE,
268        &BUCKET_WARP,
269        &BUCKET_DEFAULT,
270        &BUCKET_FALLBACK,
271    ]
272    .iter()
273    .copied()
274}
275
276// The following limits could be higher for some hardware, but are capped where they
277// are to avoid introducing platform or backend dependencies.
278//
279// **`max_vertex_attributes`:** While there is broad support for 32, Intel hardware with
280// Vulkan only supports 29; the D3D12 backend is also limited to 30.
281// See <https://gitlab.freedesktop.org/mesa/mesa/-/blob/465c186fc5f72c51bda943ac0e19f6512f8e6262/src/intel/vulkan/anv_private.h#L188>.
282//
283// **`max_dynamic_{storage,uniform}_buffers_per_pipeline_layout`:** These are limited to
284// 4 and 8 by DX12.
285
286// UPLEVEL is not a bucket that is actually applied to devices. It serves as a baseline from
287// which most of the rest of the buckets are derived. (It could be a real bucket if desired,
288// but since UPLEVEL is an intersection across many devices, there is usually a better match
289// for any particular device.)
290const UPLEVEL: Bucket = Bucket {
291    name: "uplevel-defaults",
292    limits: Limits {
293        max_bind_groups: 8,
294        // use default max_bind_groups_plus_vertex_buffers
295        // use default max_bindings_per_bind_group
296        max_buffer_size: 1 << 30, // 1 GB
297        max_color_attachment_bytes_per_sample: 64,
298        // use default max_color_attachments
299        max_compute_invocations_per_workgroup: 1024,
300        max_compute_workgroup_size_x: 1024,
301        max_compute_workgroup_size_y: 1024,
302        // use default max_compute_workgroup_size_z
303        max_compute_workgroup_storage_size: 32 << 10, // 32 kB
304        // use default max_compute_workgroups_per_dimension
305        // use default max_dynamic_storage_buffers_per_pipeline_layout
306        // use default max_dynamic_uniform_buffers_per_pipeline_layout
307        max_inter_stage_shader_variables: 28,
308        // use default max_sampled_textures_per_shader_stage
309        // use default max_samplers_per_shader_stage
310        // use default max_storage_buffer_binding_size
311        // use default max_storage_buffers_per_shader_stage
312        // use default max_storage_buffers_in_vertex_stage
313        // use default max_storage_buffers_in_fragment_stage
314        max_storage_textures_per_shader_stage: 8,
315        max_storage_textures_in_vertex_stage: 8,
316        max_storage_textures_in_fragment_stage: 8,
317        max_texture_array_layers: 2048,
318        max_texture_dimension_1d: 16384,
319        max_texture_dimension_2d: 16384,
320        // use default max_texture_dimension_3d
321        // use default max_uniform_buffer_binding_size
322        // use default max_uniform_buffers_per_shader_stage
323        max_vertex_attributes: 29,
324        // use default max_vertex_buffer_array_stride
325        // use default max_vertex_buffers
326        // use default min_storage_buffer_offset_alignment
327        // use default min_uniform_buffer_offset_alignment
328        ..Limits::defaults()
329    },
330    info: BucketedAdapterInfo {
331        is_fallback_adapter: false,
332        subgroup_min_size: 4,
333        subgroup_max_size: 128,
334    },
335    features: Features::CORE_FEATURES_AND_LIMITS
336        .union(Features::DEPTH_CLIP_CONTROL)
337        .union(Features::DEPTH32FLOAT_STENCIL8)
338        // omit TEXTURE_COMPRESSION_ASTC
339        // omit TEXTURE_COMPRESSION_ASTC_SLICED_3D
340        .union(Features::TEXTURE_COMPRESSION_BC)
341        .union(Features::TEXTURE_COMPRESSION_BC_SLICED_3D)
342        // omit TEXTURE_COMPRESSION_ETC2
343        .union(Features::TIMESTAMP_QUERY)
344        .union(Features::INDIRECT_FIRST_INSTANCE)
345        // omit SHADER_F16
346        .union(Features::RG11B10UFLOAT_RENDERABLE)
347        .union(Features::BGRA8UNORM_STORAGE)
348        .union(Features::FLOAT32_FILTERABLE)
349        .union(Features::FLOAT32_BLENDABLE)
350        // CLIP_DISTANCES not implemented in wgpu dx12 backend; https://github.com/gfx-rs/wgpu/issues/6236
351        .union(Features::DUAL_SOURCE_BLENDING)
352        // TIER1/TIER2 not implemented in wgpu; https://github.com/gfx-rs/wgpu/issues/8122
353        .union(Features::PRIMITIVE_INDEX)
354        // TEXTURE_COMPONENT_SWIZZLE not implemented in wgpu; https://github.com/gfx-rs/wgpu/issues/1028
355        .union(Features::SUBGROUP)
356        .union(Features::IMMEDIATES),
357};
358
359// e.g. Apple M Series
360const BUCKET_M1: Bucket = Bucket {
361    name: "m1",
362    limits: Limits {
363        max_dynamic_uniform_buffers_per_pipeline_layout: 12,
364        max_sampled_textures_per_shader_stage: 48,
365        max_storage_buffer_binding_size: 1 << 30, // 1 GB,
366        max_storage_buffers_per_shader_stage: 9,
367        max_storage_buffers_in_vertex_stage: 9,
368        max_storage_buffers_in_fragment_stage: 9,
369        max_vertex_attributes: 31,
370        ..UPLEVEL.limits
371    },
372    info: BucketedAdapterInfo {
373        subgroup_min_size: 4,
374        subgroup_max_size: 64,
375        ..UPLEVEL.info
376    },
377    features: UPLEVEL
378        .features
379        .union(Features::TEXTURE_COMPRESSION_ASTC)
380        .union(Features::TEXTURE_COMPRESSION_ASTC_SLICED_3D)
381        .union(Features::TEXTURE_COMPRESSION_ETC2)
382        .union(Features::SHADER_F16)
383        .union(Features::CLIP_DISTANCES),
384};
385
386// e.g. Radeon Vega
387const BUCKET_A2: Bucket = Bucket {
388    name: "a2",
389    limits: Limits {
390        max_color_attachment_bytes_per_sample: 128,
391        max_compute_workgroup_storage_size: 64 << 10, // 64 kB,
392        max_sampled_textures_per_shader_stage: 48,
393        max_storage_buffer_binding_size: 1 << 30, // 1 GB,
394        max_storage_buffers_per_shader_stage: 16,
395        max_storage_buffers_in_vertex_stage: 16,
396        max_storage_buffers_in_fragment_stage: 16,
397        max_vertex_attributes: 30,
398        ..UPLEVEL.limits
399    },
400    info: BucketedAdapterInfo {
401        subgroup_min_size: 64,
402        subgroup_max_size: 64,
403        ..UPLEVEL.info
404    },
405    features: UPLEVEL.features.union(Features::SHADER_F16),
406};
407
408// e.g. Intel Arc, UHD 600 Series, Iris Xe
409const BUCKET_I1: Bucket = Bucket {
410    name: "i1",
411    limits: Limits {
412        max_color_attachment_bytes_per_sample: 128,
413        max_sampled_textures_per_shader_stage: 48,
414        max_storage_buffer_binding_size: 1 << 29, // 512 MB,
415        max_storage_buffers_per_shader_stage: 16,
416        max_storage_buffers_in_vertex_stage: 16,
417        max_storage_buffers_in_fragment_stage: 16,
418        ..UPLEVEL.limits
419    },
420    info: BucketedAdapterInfo {
421        subgroup_min_size: 8,
422        subgroup_max_size: 32,
423        ..UPLEVEL.info
424    },
425    features: UPLEVEL.features.union(Features::SHADER_F16),
426};
427
428// e.g. GeForce GTX 1650, GeForce RTX 20, 30, 40, 50 Series
429const BUCKET_N1: Bucket = Bucket {
430    name: "n1",
431    limits: Limits {
432        max_color_attachment_bytes_per_sample: 128,
433        max_compute_workgroup_storage_size: 48 << 10, // 48 kB,
434        max_sampled_textures_per_shader_stage: 48,
435        max_storage_buffer_binding_size: 1 << 30, // 1 GB,
436        max_storage_buffers_per_shader_stage: 16,
437        max_storage_buffers_in_vertex_stage: 16,
438        max_storage_buffers_in_fragment_stage: 16,
439        max_vertex_attributes: 30,
440        ..UPLEVEL.limits
441    },
442    info: BucketedAdapterInfo {
443        subgroup_min_size: 32,
444        subgroup_max_size: 32,
445        ..UPLEVEL.info
446    },
447    features: UPLEVEL.features.union(Features::SHADER_F16),
448};
449
450// e.g. Radeon RX 6000, 7000, 9000 Series
451const BUCKET_A1: Bucket = Bucket {
452    name: "a1",
453    limits: Limits {
454        max_color_attachment_bytes_per_sample: 128,
455        max_sampled_textures_per_shader_stage: 48,
456        max_storage_buffer_binding_size: 1 << 30, // 1 GB,
457        max_storage_buffers_per_shader_stage: 16,
458        max_storage_buffers_in_vertex_stage: 16,
459        max_storage_buffers_in_fragment_stage: 16,
460        max_vertex_attributes: 30,
461        ..UPLEVEL.limits
462    },
463    info: BucketedAdapterInfo {
464        subgroup_min_size: 32,
465        subgroup_max_size: 64,
466        ..UPLEVEL.info
467    },
468    features: UPLEVEL.features.union(Features::SHADER_F16),
469};
470
471// e.g. GeForce GTX 1050, Radeon WX 5100
472const BUCKET_NO_F16: Bucket = Bucket {
473    name: "no-f16",
474    limits: Limits {
475        max_color_attachment_bytes_per_sample: 128,
476        max_compute_workgroup_storage_size: 48 << 10, // 48 kB
477        max_sampled_textures_per_shader_stage: 48,
478        max_storage_buffer_binding_size: 1 << 30, // 1 GB
479        max_storage_buffers_per_shader_stage: 16,
480        max_storage_buffers_in_vertex_stage: 16,
481        max_storage_buffers_in_fragment_stage: 16,
482        max_vertex_attributes: 30,
483        ..UPLEVEL.limits
484    },
485    info: BucketedAdapterInfo {
486        subgroup_min_size: 32,
487        subgroup_max_size: 64,
488        ..UPLEVEL.info
489    },
490    features: UPLEVEL.features,
491};
492
493const BUCKET_LLVMPIPE: Bucket = Bucket {
494    name: "llvmpipe",
495    limits: Limits {
496        max_color_attachment_bytes_per_sample: 128,
497        max_sampled_textures_per_shader_stage: 48,
498        max_storage_buffers_per_shader_stage: 16,
499        max_storage_buffers_in_vertex_stage: 16,
500        max_storage_buffers_in_fragment_stage: 16,
501        max_vertex_attributes: 32,
502        ..UPLEVEL.limits
503    },
504    info: BucketedAdapterInfo {
505        is_fallback_adapter: true,
506        subgroup_min_size: 8,
507        subgroup_max_size: 8,
508    },
509    features: UPLEVEL
510        .features
511        .union(Features::SHADER_F16)
512        .union(Features::CLIP_DISTANCES),
513};
514
515// a.k.a. Microsoft Basic Render Driver
516const BUCKET_WARP: Bucket = Bucket {
517    name: "warp",
518    limits: Limits {
519        max_color_attachment_bytes_per_sample: 128,
520        max_sampled_textures_per_shader_stage: 48,
521        max_storage_buffers_per_shader_stage: 16,
522        max_storage_buffers_in_vertex_stage: 16,
523        max_storage_buffers_in_fragment_stage: 16,
524        max_vertex_attributes: 30,
525        ..UPLEVEL.limits
526    },
527    info: BucketedAdapterInfo {
528        is_fallback_adapter: true,
529        subgroup_min_size: 4,
530        subgroup_max_size: 128,
531    },
532    features: UPLEVEL.features.union(Features::SHADER_F16),
533};
534
535// WebGPU default limits, not a fallback adapter
536const BUCKET_DEFAULT: Bucket = Bucket {
537    name: "default",
538    limits: Limits::defaults(),
539    info: BucketedAdapterInfo::defaults(),
540    features: Features::CORE_FEATURES_AND_LIMITS,
541};
542
543// WebGPU default limits, is a fallback adapter
544const BUCKET_FALLBACK: Bucket = Bucket {
545    name: "fallback",
546    limits: Limits::defaults(),
547    info: BucketedAdapterInfo {
548        is_fallback_adapter: true,
549        ..BucketedAdapterInfo::defaults()
550    },
551    features: Features::CORE_FEATURES_AND_LIMITS,
552};
553
554#[cfg(test)]
555mod tests {
556    use super::*;
557    use wgt::Features;
558
559    #[test]
560    fn enumerate_webgpu_features() {
561        let difference = Features::all_webgpu_mask().difference(
562            Features::CORE_FEATURES_AND_LIMITS
563                .union(Features::DEPTH_CLIP_CONTROL)
564                .union(Features::DEPTH32FLOAT_STENCIL8)
565                .union(Features::TEXTURE_COMPRESSION_ASTC)
566                .union(Features::TEXTURE_COMPRESSION_ASTC_SLICED_3D)
567                .union(Features::TEXTURE_COMPRESSION_BC)
568                .union(Features::TEXTURE_COMPRESSION_BC_SLICED_3D)
569                .union(Features::TEXTURE_COMPRESSION_ETC2)
570                .union(Features::TIMESTAMP_QUERY)
571                .union(Features::INDIRECT_FIRST_INSTANCE)
572                .union(Features::SHADER_F16)
573                .union(Features::RG11B10UFLOAT_RENDERABLE)
574                .union(Features::BGRA8UNORM_STORAGE)
575                .union(Features::FLOAT32_FILTERABLE)
576                .union(Features::FLOAT32_BLENDABLE)
577                .union(Features::CLIP_DISTANCES)
578                .union(Features::DUAL_SOURCE_BLENDING)
579                .union(Features::SUBGROUP)
580                //.union(Features::TEXTURE_FORMATS_TIER1) not implemented
581                //.union(Features::TEXTURE_FORMATS_TIER2) not implemented
582                .union(Features::PRIMITIVE_INDEX)
583                .union(Features::TEXTURE_COMPONENT_SWIZZLE)
584                .union(Features::IMMEDIATES)
585                .union(Features::DEBUG_PRINTF),
586        );
587        assert!(
588            difference.is_empty(),
589            "New WebGPU features should be assigned to appropriate limit buckets; missing {difference:?}"
590        );
591    }
592
593    #[test]
594    fn relationships() {
595        // Check that each bucket is a superset of UPLEVEL, ignoring the `is_fallback_adapter` flag.
596        for bucket in [
597            &BUCKET_M1,
598            &BUCKET_A2,
599            &BUCKET_I1,
600            &BUCKET_N1,
601            &BUCKET_A1,
602            &BUCKET_NO_F16,
603            &BUCKET_WARP,
604            &BUCKET_LLVMPIPE,
605        ] {
606            let info = AdapterInfo {
607                subgroup_min_size: bucket.info.subgroup_min_size,
608                subgroup_max_size: bucket.info.subgroup_max_size,
609                ..AdapterInfo::new(
610                    DeviceType::DiscreteGpu, // not a fallback adapter
611                    wgt::Backend::Noop,
612                )
613            };
614            assert!(
615                UPLEVEL.is_compatible(&bucket.limits, &info, bucket.features),
616                "Bucket `{}` should be a superset of UPLEVEL",
617                bucket.name(),
618            );
619        }
620    }
621}