Skip to content

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Oct 16, 2025

Context:

When updating tests for #2078 , I was getting weird failures on this test:

def test_ps_qft(inp, backend):

Basically what was happening was that the conversion of the target jaxpr was reordering the consts. So we need to use the consts for the new jaxpr, not the input jaxpr.

Description of the Change:

In all relevant translation steps, we pull the consts from the new jaxpr, not the original inputs.

Benefits:

Get correct results without errors.

Possible Drawbacks:

I didn't test all the other control flow primitives that might have the same issue, because I don't know how to trigger this is other cases.

Related GitHub Issues:

[sc-101609]

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.39%. Comparing base (cc2e747) to head (f9d1bcc).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2128   +/-   ##
=======================================
  Coverage   97.39%   97.39%           
=======================================
  Files          91       91           
  Lines       10609    10610    +1     
  Branches      999      999           
=======================================
+ Hits        10333    10334    +1     
  Misses        218      218           
  Partials       58       58           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Christina!

@albi3ro albi3ro merged commit 41b3a12 into main Oct 17, 2025
39 checks passed
@albi3ro albi3ro deleted the consts-issue branch October 17, 2025 13:34
paul0403 added a commit that referenced this pull request Oct 20, 2025
paul0403 added a commit that referenced this pull request Oct 20, 2025
**Context:**
Recently plxpr pipeline's control flow handling of `consts` for subscope
body jaxprs were updated, but one place was missed in the update. #2128

**Description of the Change:**
`handle_for_loop` correctly uses length of `new_consts`. 

**Benefits:**
Things are correct.
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