Skip to content

Stop the frozen-generator check from rejecting inner-graph inputs - #87

Merged
jessegrabowski merged 3 commits into
pymc-devs:mainfrom
jessegrabowski:inner-graph-rng-check
Aug 12, 2026
Merged

Stop the frozen-generator check from rejecting inner-graph inputs#87
jessegrabowski merged 3 commits into
pymc-devs:mainfrom
jessegrabowski:inner-graph-rng-check

Conversation

@jessegrabowski

Copy link
Copy Markdown
Member

The check that refuses a graph whose generator nothing advances counted any non-output use as a draw. An op carrying an inner graph might draw from a generator it's handed or might just accept it, so a layer that takes one without drawing got rejected with a message claiming the graph draws from it. Now only direct draw ops count — inner graphs are collect_default_updates' business, and it already raises when one draws without threading the generator back out.

Also restores the "here's how to fix it" half of the two inner-graph error messages, dropped when we vendored them from pymc.

An op carrying an inner graph may draw from a generator it receives or merely accept it, and only that inner graph knows which, so treating every non-output use as a draw rejected graphs that never draw at all. `collect_default_updates` already raises for an inner graph that draws without threading the generator back out.
@codecov-commenter

codecov-commenter commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.73%. Comparing base (5860ec9) to head (e78adbd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #87      +/-   ##
==========================================
+ Coverage   95.46%   96.73%   +1.27%     
==========================================
  Files          45       45              
  Lines        1807     1807              
==========================================
+ Hits         1725     1748      +23     
+ Misses         82       59      -23     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jessegrabowski
jessegrabowski merged commit e9809ff into pymc-devs:main Aug 12, 2026
7 checks passed
@jessegrabowski
jessegrabowski deleted the inner-graph-rng-check branch August 12, 2026 02:55
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.

2 participants