Skip to content

feat(inference,continuous,effects,transpile): 0.14.0#45

Merged
aaronstevenwhite merged 1 commit into
mainfrom
feat/tiers-1-through-10
Jul 1, 2026
Merged

feat(inference,continuous,effects,transpile): 0.14.0#45
aaronstevenwhite merged 1 commit into
mainfrom
feat/tiers-1-through-10

Conversation

@aaronstevenwhite

@aaronstevenwhite aaronstevenwhite commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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: ParamSource ABC + LinearSource, MLPSource, LookupSource, EmbeddingSource, AttentionSource, IdentitySource, FunctionSource, ComposeSource; param_transforms.TRANSFORM_TO_BIJECTOR bijector-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, DReGsBound objectives on the existing Objective ABC; AutoGuideList block-composition and AutoStructured per-site distribution/dependency choice; Pyro-style short-name aliases.
  • quivers.effects (new package): EffectHandler ABC with thread-local stack + three-phase apply_stack; concrete handlers (TraceHandler, clamp, do, mask, scale, block, replay, lift, collapse); Reparam strategies in effects/reparam/.
  • quivers.transpile: full target-agnostic scaffold cherry-picked from feat/transpile-foundation (IR with ConstraintSpec taxonomy, IRArg variants, Dim / Plate; Lower; RendererBase; FAMILY_META); new renderer_registry with emit_hook(backend_name, node_type) for third-party operator + backend extensibility.
  • quivers.diagnostics: to_datatree_from_svi and to_datatree_any dispatch on fit type.
  • DSL: DrawArg tagged AST union (DrawArgName, DrawArgIndex, DrawArgScalar, DrawArgDist, DrawArgList) replaces bare-string args; grammar extended with family_call_arg and list_arg productions.

The compositional-deepening audit findings and their resolution (Tier 10 quantale reverted, Tier 4 objective renames reverted, Tier 6 handler condition renamed to clamp to avoid collision with inference.conditioning.condition, Tier 3 categorical wrappers reverted) are documented in notes/compositional-deepening-brainstorm.md.

API impact

  • No API change.
  • Additive only (new symbols, no existing behaviour changed).
  • Breaking change. Migration notes:

The pre-existing Objective ABC and its five subclasses (ELBO, IWAEBound, RenyiBound, VRIWAEBound) keep their names and signatures. New objectives (ChiVI, RWS, DReGsBound) subclass the same ABC. Every pre-existing Auto*Guide retains 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/ -q runs 2363 passing, 131 skipped, 52 deselected (13 warnings).
  • pyright src/quivers reports 0 errors, 563 warnings (baseline 451 on main; 298 net-new warnings catalogued in notes/warning-cleanup-plan.md with a three-commit follow-up patch plan).
  • ruff check src/ tests/ clean.
  • ruff format --check src/ tests/ clean.
  • New tests added: 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.
  • Tree-sitter grammar regenerated (grammars/qvr/{grammar.js, grammar.json, node-types.json, parser.c} updated) for the two new DrawArg productions.

Documentation

  • Docstrings updated for every new class and method.
  • User-facing pages under 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).
  • Denotational semantics under 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

  • Single squashed commit with type(scope): summary tag reflecting the touched subsystems.
  • No backward-compatibility shims added.
  • Comments describe the code as it stands; no references to prior states or removed code.
  • No secrets, credentials, or large binary artefacts in the diff.

Followup: warning cleanup patch per notes/warning-cleanup-plan.md returns pyright to the pre-release warning baseline.

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.
@aaronstevenwhite aaronstevenwhite merged commit d8ea0c5 into main Jul 1, 2026
3 checks passed
@aaronstevenwhite aaronstevenwhite deleted the feat/tiers-1-through-10 branch July 1, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant