fd2771d51dfa6526d51778a1a3e2e553aa75290c
braney
  Tue Sep 1 10:37:16 2026 -0700
trackDbConditions: follow a setting to where its value is used, refs #37908

The first pass only saw a condition when it enclosed the read.  That misses the
commonest shape in the drawing code: the setting is read plainly at the top of a
loader, carried into a struct, and used far below behind a test of a different
setting.  bamColorTag came back unconditional even though it does nothing unless
bamColorMode is tag.

So follow the value.  A name that holds exactly one setting across a file is
taken to carry it, including into a struct field of the same name, which is how
the value usually travels.  Then find where the value is used and intersect the
conditions guarding those uses.

Two distinctions do the work.  A mention at paren depth zero is one side of an
assignment or an element of an initializer list, which only moves the value
somewhere else, so it is not a use; inside a call it is an argument and it is.
Counting the struct initializer as a use put an unguarded site in the set and
emptied every intersection.  And matching drops the field prefix, so the test
written sameString(colorMode, ...) in the loader is the same condition as
sameString(btd->colorMode, ...) in the drawer.

These are reported as "when used" and kept apart from "always".  The every-path
conditions are necessary by construction; a use-site condition is only as good
as the set of uses found, so it is a strong hint rather than a claim, and it
keeps the strict key rather than the loose one for that reason.

43 settings in the render scope are read plainly and used only under a
condition, 21 of them documented.  Among them: bamColorTag needs
bamColorMode=tag, pairSearchRange needs pairEndsByName, speciesCodonDefault
needs mafChain and frames, and speciesOrder, speciesGroups and speciesDefaultOff
turn out to gate each other.

diff --git src/hg/utils/trackDbConditions/conditionBaseline.txt src/hg/utils/trackDbConditions/conditionBaseline.txt
index 0a1eb39564d..eb47808293a 100644
--- src/hg/utils/trackDbConditions/conditionBaseline.txt
+++ src/hg/utils/trackDbConditions/conditionBaseline.txt
@@ -1,45 +1,59 @@
 # Documented settings whose reads all sit behind a condition.
 # Accepted state for trackDbConditions.py --check.  One scope:name per line.
+render:bamColorTag
 render:barChartBars
 render:barChartCategoryUrl
 render:barChartColors
 render:barChartMerge
 render:baseColorTickColor
 render:baseColorUseCds
+render:bigDataIndex
+render:bigDataUrl
 render:centerLabelsDense
 render:chainNormScoreAvailable
+render:colorFields
 render:configurable
 render:configureByPopup
 render:dataVersion
 render:detailsBoxesEnabled
 render:drawMode
 render:exonNumbers
 render:filterBy
 render:frames
 render:hapClusterHeight
 render:hapClusterTreeAngle
 render:hicArcLimit
 render:hideEmptySubtracks
 render:hideEmptySubtracksMultiBedUrl
 render:hideEmptySubtracksSourcesUrl
+render:highlightColor
 render:irows
 render:labelOnFeature
 render:linkDataUrl
+render:logoMaf
 render:lollyMaxSize
 render:lollyNoStems
+render:maxLimit
 render:metadata
 render:minGrayLevel
 render:minQual
+render:negateValues
+render:nextExonText
 render:noInherit
 render:normalization
 render:otherTwoBitUrl
+render:pairSearchRange
 render:pennantIcon
 render:resolution
 render:saturationScore
 render:showCdsMaxZoom
+render:showSnpWidth
 render:smoothingWindow
 render:speciesCodonDefault
+render:speciesDefaultOff
+render:speciesGroups
+render:speciesOrder
 render:subGroups
 render:thickDrawItem
 render:viewLimits
 render:windowingFunction