Files
salmanoff/docs/design/intrin-thresholds.md
T
hayodea 27a5d48451 Lg1: Implement both light|darkAmbience stimBuffs & their production
We now produce both light and dark ambience stimframes into
stimbuffs for the LivoxGen1 lidar devices.
2026-04-18 14:54:14 -04:00

5.3 KiB

Intrinsic Threshold Parameters

Overview

This document describes quale-iface-api-params that control threshold values for constructing stencils and delivering them to SMO via postrinInd/negtrinInd with different importance levels. These parameters allow the stimbuff API library to determine when to construct a stencil for postrin or negtrin data and present it to SMO with appropriate importance classifications.

Intrinsic parameters live inside postrin(...) / negtrin(...) segments attached to a nontrin DAP line. A DAP line may declare at most one postrin(...) segment and at most one negtrin(...) segment, and both must precede the qualeIfaceApi segment. Ordering between postrin and negtrin is free.

Intrinsic threshold params (and the deprecated from-stimbuff marker) must not appear on the qualeIfaceApi params themselves — policy validation rejects them there. The nontrin qualeIfaceApi (e.g. pcloudLightAmbience / pcloudDarkAmbience) still owns its own sensory params (such as passband comparators); only the threshold classifications (interest-*, distraction-*, stupefaction-* / stupefying-*, intolerable-*) live in the postrin/negtrin segments.

postrin / negtrin segments

On postrin(...) or negtrin(...), the intrinsic family (positive vs negative) is fixed by the segment name, so only the unprefixed short forms interest-..., distraction-..., stupefaction- / stupefying-..., and intolerable-... (with the unit suffix rules below) are accepted.

Example (negtrin segment attached to ambience, with passband comparator on the nontrin qualeIfaceApi):

+edev|avia0|negtrin(interest-pc=85)|pcloudLightAmbience(passband-count-gt-val=120)|livoxGen1()|livoxProto1(SMO_IP)|3JEDK380010Z39||

Unit Suffix Rules

All intrinsic threshold params must include an explicit unit suffix. These suffix families are not synonyms with each other; they select different units:

  • -percentage/-pc
  • -threshold/-thresh/-thr

Parameters with the -percentage or -pc suffix take a percentage in the range 0-100.

Parameters with the -threshold, -thresh, or -thr suffix take an absolute number. The interpretation of that number, and the underlying unit, is defined by the API library itself.

Users must specify only one unit-suffixed parameter per targeted intrinsic classification. If multiple unit-suffixed variants targeting the same classification are supplied anyway, the lattermost supplied parameter takes precedence.

Shorthand params without a unit suffix are not permitted. The following forms are invalid because they omit units:

  • <interest|distraction|stupef<action|ying>|intolerable>

Inside postrin(...) / negtrin(...) segments, the short forms interest-..., distraction-..., etc. still require those unit suffixes.

Interest Threshold Parameters

Parameter forms (only inside postrin(...) or negtrin(...) segments):

  • interest-<percentage|pc|threshold|thresh|thr>

Description: These parameters denote the value at which the stimbuff API library should construct a stencil for the postrin or negtrin that it delivers for this intrinsic spec, and present it to SMO via postrinInd/negtrinInd with the "importance" argument set to "INTERESTING".

Example (negtrin segment attached to ambience):

+edev|avia0|negtrin(interest-pc=85)|pcloudLightAmbience(passband-count-gt-val=120)|livoxGen1()|livoxProto1(SMO_IP)|3JEDK380010Z39||

Distraction Threshold Parameters

Parameter forms (only inside postrin(...) or negtrin(...) segments):

  • distraction-<percentage|pc|threshold|thresh|thr>

Description: These parameters denote the value at which the stimbuff API library ought to construct a stencil and deliver it to SMO via postrinInd/negtrinInd with the importance argument set to "DISTRACTION".

Stupefying Threshold Parameters (Postrin)

Parameter forms (only inside postrin(...) segments):

  • stupefaction-<percentage|pc|threshold|thresh|thr>
  • stupefying-<percentage|pc|threshold|thresh|thr>

Description: These parameters denote the value at which the stimbuff API library ought to construct a stencil and deliver it to SMO via postrinInd with the importance argument set to "STUPEFYING".

Intolerable Threshold Parameters (Negtrin)

Parameter forms (only inside negtrin(...) segments):

  • intolerable-<percentage|pc|threshold|thresh|thr>

Description: These parameters denote the value at which the stimbuff API library ought to construct a stencil and deliver it to SMO via negtrinInd with the importance argument set to "INTOLERABLE".

Notes

The way that SMO handles these importance levels is not yet fully worked out. For postrins, the distinction between "interesting" vs "stupefying" is somewhat reasonably intuitively clear, but how that meaning is given in code has not been worked out yet. Similarly, for negtrins, the distinctions between "interesting" vs "distracting" vs "intolerable" are not entirely clear in terms of how their handling will impose meaningful differences that will give meaning to their distinctions.

These parameters provide the mechanism for the stimbuff API library to classify and deliver intrinsic stimuli with appropriate importance levels, but the downstream processing and behavioral implications of these classifications within SMO remain to be fully defined.