Internal Documentation
Documentation for DistributionsInference's internal interface.
Contents
Index
Internal API
DistributionsInference._concrete_field_candidates Function
_concrete_field_candidates(
objtype,
rows
) -> Vector{Tuple{Int64, Symbol, DataType}}The estimated rows whose OWN struct field is concretely typed, precomputed once.
_concrete_field_candidates(objtype, rows) walks the ESTIMATED rows as_logdensity already derived once at construction (the same estimated_rows(obj) result flat_priors is built from — passed in here rather than re-derived, so construction calls parameter_rows once, not twice), and keeps only the (index, name, declared_type) triples the concrete-field-under-AD guard (DI#48) needs to check — index into the ESTIMATED flat vector, name the row's own struct field, declared_type that field's concrete type. A row whose name is dotted (a nested/composed structure this generic check does not introspect) or whose declared field type is not concrete (already generic, or abstract) is dropped entirely, so a properly generic object gets an EMPTY list and logdensity's per-evaluation guard is a single isempty check.
This mirrors extra_prior_state: structural state that depends only on obj (fixed for the life of a FitLogDensity), never on the flat vector, computed once rather than recomputed on every evaluation.