Found while re-scoping #831 (CD adoption of the standalone dist-ops packages). Not a blocker — a design decision needed before the inference-layer migration lands.
Context
The inference layer is now adoptable: ComposedDistributions main is a strict superset of CD's composers/logdensity.jl. params_table upstream is 5-col (edge | param | value | support | prior) and emits :thin rows, so the #90 uncertain-first precondition is met. Upstream ComposedLogDensity{D,P,T,L,FP,CP} already carries fixed-param rows (covering CD's _FixPlan, #752/#761) and pool groups, and flatten/unflatten/as_logdensity/logdensity are public with matching names.
So CD can delete its generic logdensity half and sit on upstream. Two pieces have no upstream counterpart.
(1) to_constrained has no upstream home
- CD:
src/composers/logdensity.jl:499 (function to_constrained end), declared public at src/public.jl:126, with the actual method living in CD's BijectorsExt.
- Upstream: no
to_constrained anywhere in ComposedDistributions src/ or ext/ (grepped against current main).
to_constrained(prob, z) -> (x, logjac) is the unconstrained→constrained transform + log-Jacobian, i.e. the sampler-facing layer over the prior support. It is generic over any composed tree — nothing about it is censoring-specific — so on the "generic composition lives upstream" principle it arguably belongs in ComposedDistributions next to flatten/unflatten, as a Bijectors extension there.
Decision needed: does CD keep to_constrained (a CD-owned method on upstream types — legal, since it adds a new signature), or does it go upstream so any ComposedDistributions user gets NUTS-ready unconstrained sampling for free?
(2) free_dimension vs flat_dimension — same concept, two names
- CD declares
free_dimension public (src/public.jl:126).
- Upstream declares
flat_dimension public (ComposedDistributions/src/composers/logdensity.jl:94).
Same concept (the length of the flat parameter vector). If CD adopts upstream's logdensity layer, one name should win. Suggest CD adopts flat_dimension and deprecates/aliases free_dimension, unless there is a reason to prefer CD's spelling.
Related
This was opened by a bot. Please ping @seabbs for any questions.
Found while re-scoping #831 (CD adoption of the standalone dist-ops packages). Not a blocker — a design decision needed before the inference-layer migration lands.
Context
The inference layer is now adoptable:
ComposedDistributionsmain is a strict superset of CD'scomposers/logdensity.jl.params_tableupstream is 5-col (edge | param | value | support | prior) and emits:thinrows, so the #90 uncertain-first precondition is met. UpstreamComposedLogDensity{D,P,T,L,FP,CP}already carries fixed-param rows (covering CD's_FixPlan, #752/#761) and pool groups, andflatten/unflatten/as_logdensity/logdensityare public with matching names.So CD can delete its generic logdensity half and sit on upstream. Two pieces have no upstream counterpart.
(1)
to_constrainedhas no upstream homesrc/composers/logdensity.jl:499(function to_constrained end), declared public atsrc/public.jl:126, with the actual method living in CD'sBijectorsExt.to_constrainedanywhere inComposedDistributionssrc/orext/(grepped against currentmain).to_constrained(prob, z) -> (x, logjac)is the unconstrained→constrained transform + log-Jacobian, i.e. the sampler-facing layer over the prior support. It is generic over any composed tree — nothing about it is censoring-specific — so on the "generic composition lives upstream" principle it arguably belongs inComposedDistributionsnext toflatten/unflatten, as a Bijectors extension there.Decision needed: does CD keep
to_constrained(a CD-owned method on upstream types — legal, since it adds a new signature), or does it go upstream so anyComposedDistributionsuser gets NUTS-ready unconstrained sampling for free?(2)
free_dimensionvsflat_dimension— same concept, two namesfree_dimensionpublic (src/public.jl:126).flat_dimensionpublic (ComposedDistributions/src/composers/logdensity.jl:94).Same concept (the length of the flat parameter vector). If CD adopts upstream's logdensity layer, one name should win. Suggest CD adopts
flat_dimensionand deprecates/aliasesfree_dimension, unless there is a reason to prefer CD's spelling.Related
ComposedDistributions#56,ModifiedDistributions#27,ConvolvedDistributions#24are all closed and landed.ComposedDistributions#96(the 374-signature divergence inventory) is functionally superseded by the syncs that have since landed upstream (Consider making the numerical fallback an extension feature #101 composer sync, chore: auto-increment version to 0.1.1 #104rand_outcomepublic + Enzyme-safeone_of, chore: auto-increment version to 0.1.3 #98 pooling, Fix #87: Convert documentation code blocks to executable @example syntax #90 uncertain-first) — worth a re-audit and close.This was opened by a bot. Please ping @seabbs for any questions.