﻿# udev sensor rules: parent attributes must match the same ancestor

A serial sensor alias can fail even when every copied attribute appears in sysfs. Preserve parent relationships and interface selection instead of relying on discovery-order device names.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/edge-udev-sensor-parent-attribute-match/
Language: en

## Every attribute exists but the alias never appears

An edge classifier reads a USB serial sensor through a configured alias. Its udev rule combines attributes copied from an attribute walk, yet no alias is created after reconnecting. Every individual value appears somewhere in the output, encouraging the assumption that permissions or timing must be wrong. Inspect where each attribute belongs. A hierarchy is not a flat dictionary of interchangeable fields; selecting the right product ancestor and the intended serial child interface requires a coherent match.

## Discovery order is not the identity policy

The [udev reference](https://raw.githubusercontent.com/systemd/systemd/main/man/udev.xml) explains that kernel names commonly depend on discovery order, while meaningful symlinks can use device properties. Define whether the application identifies a particular physical sensor, a connection location or a class of interchangeable devices. Those policies differ after moving a cable or replacing hardware. A stable-looking alias only implements the rule it was given; it does not prove that an available serial identifier is globally unique, trustworthy or sufficient for selecting the intended function.

## Parent-matching keys share one ancestor

The reference explicitly requires multiple keys matching parent devices in one rule to match the same parent. Copying a vendor attribute from one level and another identifying attribute from an unrelated ancestor can create an impossible conjunction. Keep the attribute’s path and hierarchy level beside its value during review. Separate device-local properties from parent-search properties instead of changing operators until the rule appears to work. A broad accidental match can be worse than a visible missing alias because it silently routes another sensor into inference.

## Inspect the actual child and processed event

The [udevadm reference](https://raw.githubusercontent.com/systemd/systemd/main/man/udevadm.xml) documents attribute-walk inspection and monitoring kernel versus post-rule udev events. Use those observations to connect the selected child, its ancestors and the resulting properties. Composite hardware may expose several usable-looking children, so include the intended function or interface boundary when the policy requires it. A product-level match alone can assign the same application meaning to distinct channels. Do not treat a device-added event as evidence that a sensor protocol handshake already completed.

## Propose a hierarchy-specific alias fixture

In a disposable setup, retain attribute trees and processed properties for harmless equivalent devices. Compare reconnect order, cable relocation and the intended composite interfaces under the declared identity policy. Review the resulting rule match and alias target before feeding a known sensor fixture to the application. Acceptance requires an unambiguous intended source or an explicit ambiguity state. No rule was installed or device reconnected here; this procedure describes identity evidence, not a claimed sensor compatibility or throughput test.

## Keep naming separate from runtime qualification

[CDI device selection](/journal/nvidia-cdi-device-selection/) checks another device-naming layer. [Reproducible software records](/journal/software-stack-reproducibility/) preserve the environment that interprets observations. A udev alias adds a concrete rule and hierarchy contract before an edge model consumes data. Record the selected child and source policy, then validate the protocol separately. This prevents a missing or overly broad alias from becoming an unexplained model-quality incident and avoids treating a convenient name as authenticated physical identity.
