Translator: the device profile drops the 19 fields nothing reads

Device::from_queries derived these profile fields from the description's features, and no code
consulted any of them: only the profile's fingerprint rendered them, so a device that listed one
moved every cache key and changed nothing a module holds. They go, with the feature reads that
filled them:

- LeafCaps (crate-private): uniform_buffer_8bit, push_constant_8bit, uniform_buffer_16bit,
  push_constant_16bit, workgroup_explicit_layout, workgroup_explicit_layout_8bit,
  workgroup_explicit_layout_16bit, buffer_float32_atomic_min_max, shared_float32_atomic_add,
  shared_float32_atomic_min_max, image_float32_atomic_add, image_float32_atomic_min_max, fma16;
- ImageCaps (public): sampler_filter_minmax, compute_derivative_quads;
- DescriptorCaps (public): variable_descriptor_count;
- FragmentCaps (public): geometry_shader, cull_distance, dynamic_rendering_local_read.

The six public fields are removed from a published crate. The consumer's checkouts hold no use of
any of them: ~/Projects/steelbrain/reims-vgpu at 047a8d162d and clean-slate-reims-vgpu, 0 hits
for each of the six names (and for LeafCaps). This tree holds none outside derive.rs and
profile.rs. tests/api_signatures.tsv loses exactly their six records
(scripts/api-signatures/signatures.py --bless).

The features stay in the vocabulary (VkFeature): requirements name some of them, and a Khronos
profile or a queried device still lists them. Where the translator reads one of these features to
choose a form, it reads it elsewhere (float add: buffer_float32_atomic_add; fma: fma32), unchanged.

Why: the planner's feature-enable walk (lane texoff, 11-21) found every profile field the
translator derives from a feature, and these are the ones nothing reads (R4: delete). Under the
no-dead-code rule a field no code consults is deleted, and the feature-enable test compares the
profile a device's features derive, which an unread field would make differ for no reason.

The profile fingerprint changes on every device that lists one of these features; it is in every
cache key, so no stale artifact is taken. No module changes.
This commit is contained in:
Anees Iqbal committed 2026-11-21 13:39:50 -08:00
1 parent 8ca94bca19
commit 99b915bfc6
3 files changed
-45

No files matched your search

-19
View File
@@ -203,28 +203,15 @@ fn derive_fields(desc: &DeviceDescription, policy: &DevicePolicy) -> ProfileFiel
float16: has(VkFeature::ShaderFloat16),
float64: has(VkFeature::ShaderFloat64),
storage_buffer_8bit: has(VkFeature::StorageBuffer8BitAccess),
uniform_buffer_8bit: has(VkFeature::UniformAndStorageBuffer8BitAccess),
push_constant_8bit: has(VkFeature::StoragePushConstant8),
storage_buffer_16bit: has(VkFeature::StorageBuffer16BitAccess),
uniform_buffer_16bit: has(VkFeature::UniformAndStorageBuffer16BitAccess),
push_constant_16bit: has(VkFeature::StoragePushConstant16),
workgroup_explicit_layout: has(VkFeature::WorkgroupMemoryExplicitLayout),
workgroup_explicit_layout_8bit: has(VkFeature::WorkgroupMemoryExplicitLayout8BitAccess),
workgroup_explicit_layout_16bit: has(VkFeature::WorkgroupMemoryExplicitLayout16BitAccess),
buffer_int64_atomics: has(VkFeature::ShaderBufferInt64Atomics),
shared_int64_atomics: has(VkFeature::ShaderSharedInt64Atomics),
buffer_float32_atomic_add: has(VkFeature::ShaderBufferFloat32AtomicAdd),
buffer_float32_atomic_min_max: has(VkFeature::ShaderBufferFloat32AtomicMinMax),
shared_float32_atomic_add: has(VkFeature::ShaderSharedFloat32AtomicAdd),
shared_float32_atomic_min_max: has(VkFeature::ShaderSharedFloat32AtomicMinMax),
image_float32_atomic_add: has(VkFeature::ShaderImageFloat32AtomicAdd),
image_float32_atomic_min_max: has(VkFeature::ShaderImageFloat32AtomicMinMax),
image_int64_atomics: has(VkFeature::ShaderImageInt64Atomics),
vertex_stores_and_atomics: has(VkFeature::VertexPipelineStoresAndAtomics),
fragment_stores_and_atomics: has(VkFeature::FragmentStoresAndAtomics),
zero_initialize_workgroup_memory: has(VkFeature::ShaderZeroInitializeWorkgroupMemory),
fma32: has(VkFeature::ShaderFmaFloat32),
fma16: has(VkFeature::ShaderFmaFloat16),
float8: has(VkFeature::ShaderFloat8),
};
let images = ImageCaps {
@@ -240,9 +227,7 @@ fn derive_fields(desc: &DeviceDescription, policy: &DevicePolicy) -> ProfileFiel
|| has(VkFeature::RobustImageAccess2),
robust_image_access2: has(VkFeature::RobustImageAccess2),
sampler_anisotropy: has(VkFeature::SamplerAnisotropy),
sampler_filter_minmax: has(VkFeature::SamplerFilterMinmax),
sampler_mirror_clamp_to_edge: has(VkFeature::SamplerMirrorClampToEdge),
compute_derivative_quads: has(VkFeature::ComputeDerivativeGroupQuads),
compute_derivative_linear: has(VkFeature::ComputeDerivativeGroupLinear),
};
let descriptors = DescriptorCaps {
@@ -251,7 +236,6 @@ fn derive_fields(desc: &DeviceDescription, policy: &DevicePolicy) -> ProfileFiel
uniform_buffer_standard_layout: has(VkFeature::UniformBufferStandardLayout),
runtime_descriptor_array: has(VkFeature::RuntimeDescriptorArray),
partially_bound: has(VkFeature::DescriptorBindingPartiallyBound),
variable_descriptor_count: has(VkFeature::DescriptorBindingVariableDescriptorCount),
update_after_bind_sampled_image: has(
VkFeature::DescriptorBindingSampledImageUpdateAfterBind,
),
@@ -291,7 +275,6 @@ fn derive_fields(desc: &DeviceDescription, policy: &DevicePolicy) -> ProfileFiel
sample_rate_shading: has(VkFeature::SampleRateShading),
dual_src_blend: has(VkFeature::DualSrcBlend),
independent_blend: has(VkFeature::IndependentBlend),
geometry_shader: has(VkFeature::GeometryShader),
tessellation_shader: has(VkFeature::TessellationShader),
// The features alone: at the 1.2 floor they replace `VK_EXT_shader_viewport_index_layer`'s
// one capability (`ShaderViewportIndexLayerEXT`) with the `ShaderLayer` and
@@ -301,9 +284,7 @@ fn derive_fields(desc: &DeviceDescription, policy: &DevicePolicy) -> ProfileFiel
output_layer: has(VkFeature::ShaderOutputLayer),
output_viewport_index: has(VkFeature::ShaderOutputViewportIndex),
clip_distance: has(VkFeature::ShaderClipDistance),
cull_distance: has(VkFeature::ShaderCullDistance),
rasterization_order_color_access: has(VkFeature::RasterizationOrderColorAttachmentAccess),
dynamic_rendering_local_read: has(VkFeature::DynamicRenderingLocalRead),
vertex_attribute_divisor: has(VkFeature::VertexAttributeInstanceRateDivisor),
vertex_attribute_zero_divisor: has(VkFeature::VertexAttributeInstanceRateZeroDivisor),
};
-20
View File
@@ -501,30 +501,16 @@ pub struct LeafCaps {
pub float16: bool,
pub float64: bool,
pub storage_buffer_8bit: bool,
pub uniform_buffer_8bit: bool,
pub push_constant_8bit: bool,
pub storage_buffer_16bit: bool,
pub uniform_buffer_16bit: bool,
pub push_constant_16bit: bool,
pub workgroup_explicit_layout: bool,
pub workgroup_explicit_layout_8bit: bool,
pub workgroup_explicit_layout_16bit: bool,
pub buffer_int64_atomics: bool,
pub shared_int64_atomics: bool,
pub buffer_float32_atomic_add: bool,
pub buffer_float32_atomic_min_max: bool,
pub shared_float32_atomic_add: bool,
pub shared_float32_atomic_min_max: bool,
pub image_float32_atomic_add: bool,
pub image_float32_atomic_min_max: bool,
pub image_int64_atomics: bool,
pub vertex_stores_and_atomics: bool,
pub fragment_stores_and_atomics: bool,
pub zero_initialize_workgroup_memory: bool,
/// `OpFmaKHR` on 32-bit floats (`shaderFmaFloat32`): a correctly rounded fused multiply-add.
pub fma32: bool,
/// `OpFmaKHR` on 16-bit floats (`shaderFmaFloat16`): a correctly rounded fused multiply-add.
pub fma16: bool,
/// 8-bit floats of the encodings `Float8E4M3EXT` and `Float8E5M2EXT` (`shaderFloat8`,
/// `SPV_EXT_float8`): an 8-bit float converts to a wider float through the device's own type.
pub float8: bool,
@@ -554,9 +540,7 @@ pub struct ImageCaps {
/// Metal's out-of-bounds texel.
pub robust_image_access2: bool,
pub sampler_anisotropy: bool,
pub sampler_filter_minmax: bool,
pub sampler_mirror_clamp_to_edge: bool,
pub compute_derivative_quads: bool,
pub compute_derivative_linear: bool,
}
@@ -571,7 +555,6 @@ pub struct DescriptorCaps {
pub uniform_buffer_standard_layout: bool,
pub runtime_descriptor_array: bool,
pub partially_bound: bool,
pub variable_descriptor_count: bool,
pub update_after_bind_sampled_image: bool,
pub update_after_bind_storage_image: bool,
pub update_after_bind_storage_buffer: bool,
@@ -602,14 +585,11 @@ pub struct FragmentCaps {
pub sample_rate_shading: bool,
pub dual_src_blend: bool,
pub independent_blend: bool,
pub geometry_shader: bool,
pub tessellation_shader: bool,
pub output_layer: bool,
pub output_viewport_index: bool,
pub clip_distance: bool,
pub cull_distance: bool,
pub rasterization_order_color_access: bool,
pub dynamic_rendering_local_read: bool,
pub vertex_attribute_divisor: bool,
pub vertex_attribute_zero_divisor: bool,
}
@@ -2526,7 +2526,6 @@ field metal2vulkan::device::DescriptorCaps.update_after_bind_storage_image pub u
field metal2vulkan::device::DescriptorCaps.update_after_bind_storage_texel_buffer pub update_after_bind_storage_texel_buffer: bool
field metal2vulkan::device::DescriptorCaps.update_after_bind_uniform_texel_buffer pub update_after_bind_uniform_texel_buffer: bool
field metal2vulkan::device::DescriptorCaps.update_unused_while_pending pub update_unused_while_pending: bool
field metal2vulkan::device::DescriptorCaps.variable_descriptor_count pub variable_descriptor_count: bool
field metal2vulkan::device::DeviceDescription.allocation pub allocation: AllocationLimits
field metal2vulkan::device::DeviceDescription.api_version pub api_version: ApiVersion
field metal2vulkan::device::DeviceDescription.device_id pub device_id: u32
@@ -2570,11 +2569,8 @@ field metal2vulkan::device::FormatProperties.optimal_tiling pub optimal_tiling:
field metal2vulkan::device::FormatSupport.formats pub formats: BTreeMap<vk::Format, FormatProperties>
field metal2vulkan::device::FragmentCaps.barycentric pub barycentric: bool
field metal2vulkan::device::FragmentCaps.clip_distance pub clip_distance: bool
field metal2vulkan::device::FragmentCaps.cull_distance pub cull_distance: bool
field metal2vulkan::device::FragmentCaps.demote_to_helper pub demote_to_helper: bool
field metal2vulkan::device::FragmentCaps.dual_src_blend pub dual_src_blend: bool
field metal2vulkan::device::FragmentCaps.dynamic_rendering_local_read pub dynamic_rendering_local_read: bool
field metal2vulkan::device::FragmentCaps.geometry_shader pub geometry_shader: bool
field metal2vulkan::device::FragmentCaps.independent_blend pub independent_blend: bool
field metal2vulkan::device::FragmentCaps.output_layer pub output_layer: bool
field metal2vulkan::device::FragmentCaps.output_viewport_index pub output_viewport_index: bool
@@ -2595,7 +2591,6 @@ field metal2vulkan::device::GeneratedCommandsProperties.max_indirect_sequence_co
field metal2vulkan::device::GeneratedCommandsProperties.pipeline_binding_stages pub pipeline_binding_stages: vk::ShaderStageFlags
field metal2vulkan::device::GeneratedCommandsProperties.supported_stages pub supported_stages: vk::ShaderStageFlags
field metal2vulkan::device::ImageCaps.compute_derivative_linear pub compute_derivative_linear: bool
field metal2vulkan::device::ImageCaps.compute_derivative_quads pub compute_derivative_quads: bool
field metal2vulkan::device::ImageCaps.cube_array pub cube_array: bool
field metal2vulkan::device::ImageCaps.dynamic_sample_offset pub dynamic_sample_offset: bool
field metal2vulkan::device::ImageCaps.gather_extended pub gather_extended: bool
@@ -2603,7 +2598,6 @@ field metal2vulkan::device::ImageCaps.min_lod pub min_lod: bool
field metal2vulkan::device::ImageCaps.robust_image_access pub robust_image_access: bool
field metal2vulkan::device::ImageCaps.robust_image_access2 pub robust_image_access2: bool
field metal2vulkan::device::ImageCaps.sampler_anisotropy pub sampler_anisotropy: bool
field metal2vulkan::device::ImageCaps.sampler_filter_minmax pub sampler_filter_minmax: bool
field metal2vulkan::device::ImageCaps.sampler_mirror_clamp_to_edge pub sampler_mirror_clamp_to_edge: bool
field metal2vulkan::device::ImageCaps.storage_extended_formats pub storage_extended_formats: bool
field metal2vulkan::device::ImageCaps.storage_multisample pub storage_multisample: bool
Can't render this file because it is too large.