Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Improve handling of unvalued/bound MeasurableVariables #209

@brandonwillard

Description

@brandonwillard

Our current approach of tracking Variables that have been converted to MeasurableVariables and reverting them when they're not eventually associated with a value variable (i.e. "bound" in some sense), is rather inefficient. We could—at the very least—make sure that these reversions are always performed in a reverse-topological order, so that fewer replacements are necessary (e.g. assuming that reversion is only ever necessary closest to the "base" valued/bound variable).

The reason we currently convert all terms to measurable terms—and not just the nodes that are directly bound/valued—is that some node conversions can only occur once the node's inputs are determined to be measurable. We can take a number of entirely different approaches, but the current is thorough and simple (e.g. MeasurableVariable-specific guided and short-circuited depth-first conversions, "inverse" functions associated with each MeasurableVariable type, consistent use of OpFromGraph, etc.) A fix to this issue could easily involve one of those approaches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgraph rewritingInvolves the implementation of rewrites to Aesara graphsperformance concernrefactoringA change that improves the codebase but doesn't necessarily introduce a new featurerequest discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions