feat(inference,continuous,effects,transpile): 0.14.0#45
Merged
Conversation
Distribution families, compositional measure algebra, pluggable parameter sources, bijector-typed parameter transforms, three new variational objectives on the existing Objective ABC, composable autoguide combinators, algebraic effect handlers, reparameterisation strategies, fit-agnostic diagnostics, and the target-agnostic transpile scaffold. See CHANGELOG.md [0.14.0] for the flat feature list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add distribution families (OrderedLogistic, ZeroInflatedPoisson, HurdlePoisson, MixtureNormal), compositional measure algebra (Bijector library, PointMass / Restrict / Pushforward / Mixture / Independent / Normalize, sugar table, four rewrite rules), pluggable parameter sources, bijector-typed parameter transforms, three new variational objectives (ChiVI, RWS, DReGsBound), AutoGuideList / AutoStructured autoguide combinators, the algebraic effect-handler stack (TraceHandler, clamp, do, mask, scale, block, replay, lift, collapse) with reparameterisation strategies (LocScaleReparam, TransformReparam, NeuTraReparam, ConjugateReparam), fit-agnostic ArviZ diagnostics, and the target-agnostic transpile scaffold (IR, Lower, family_meta, renderer_registry, renderers/_base, backends/_resolve).
Motivation
The compositional-deepening design note (
notes/compositional-deepening-brainstorm.md) identified ten architectural leverage points beyond the 0.14.0 base. This PR implements the ones with clear compositional value while explicitly avoiding parallel abstractions that duplicated existing core APIs. Two OrderedLogistic edge cases surfaced during external ordinal-regression integration are also fixed here so 0.14.0 ships them at once.Changes
quivers.continuous:ParamSourceABC + LinearSource, MLPSource, LookupSource, EmbeddingSource, AttentionSource, IdentitySource, FunctionSource, ComposeSource;param_transforms.TRANSFORM_TO_BIJECTORbijector-typed registry; compositional measure algebra with lazy normalisation; OrderedLogistic / ZeroInflatedPoisson / HurdlePoisson / MixtureNormal families; Poisson / NegativeBinomial / Binomial conditional-family registrations; DSL[param_source=...]option surface.quivers.inference:ChiVI,RWS,DReGsBoundobjectives on the existingObjectiveABC;AutoGuideListblock-composition andAutoStructuredper-site distribution/dependency choice; Pyro-style short-name aliases.quivers.effects(new package):EffectHandlerABC with thread-local stack + three-phaseapply_stack; concrete handlers (TraceHandler,clamp,do,mask,scale,block,replay,lift,collapse);Reparamstrategies ineffects/reparam/.quivers.transpile: full target-agnostic scaffold cherry-picked fromfeat/transpile-foundation(IR withConstraintSpectaxonomy,IRArgvariants,Dim/Plate;Lower;RendererBase;FAMILY_META); newrenderer_registrywithemit_hook(backend_name, node_type)for third-party operator + backend extensibility.quivers.diagnostics:to_datatree_from_sviandto_datatree_anydispatch on fit type.DrawArgtagged AST union (DrawArgName,DrawArgIndex,DrawArgScalar,DrawArgDist,DrawArgList) replaces bare-string args; grammar extended withfamily_call_argandlist_argproductions.The compositional-deepening audit findings and their resolution (Tier 10 quantale reverted, Tier 4 objective renames reverted, Tier 6 handler
conditionrenamed toclampto avoid collision withinference.conditioning.condition, Tier 3 categorical wrappers reverted) are documented innotes/compositional-deepening-brainstorm.md.API impact
The pre-existing
ObjectiveABC and its five subclasses (ELBO,IWAEBound,RenyiBound,VRIWAEBound) keep their names and signatures. New objectives (ChiVI,RWS,DReGsBound) subclass the same ABC. Every pre-existingAuto*Guideretains its name. The DSL surface accepts every prior program; the new[param_source=...]option and the compositional measure algebra draw args (Mixture(...),Restrict(...),Pushforward(...)) are opt-in extensions.Tests
pytest tests/ -qruns 2363 passing, 131 skipped, 52 deselected (13 warnings).pyright src/quiversreports 0 errors, 563 warnings (baseline 451 on main; 298 net-new warnings catalogued innotes/warning-cleanup-plan.mdwith a three-commit follow-up patch plan).ruff check src/ tests/clean.ruff format --check src/ tests/clean.tests/test_param_source.py,tests/test_param_transforms.py,tests/test_bijectors.py,tests/test_measure_algebra.py,tests/test_compositional_dsl.py,tests/test_ordered_logistic.py,tests/test_zip_hurdle_mixture.py,tests/test_effect_handlers.py,tests/test_reparam.py,tests/test_autoguides.py,tests/test_renderer_registry.py.Documentation
docs/updated (48 files edited by the two-verifier-layer doc audit; the strip-development-history sweep ran across the same set).CHANGELOG.md [0.14.0]covers the release as a single flat entry (no intra-release timeline references).docs/semantics/untouched by this PR; the new operators (measure algebra, effect handlers) fit under the existing semantic account and are deferred to a dedicated semantics-chapter PR.Checklist
type(scope): summarytag reflecting the touched subsystems.Followup: warning cleanup patch per
notes/warning-cleanup-plan.mdreturns pyright to the pre-release warning baseline.