Skip to content

interpreter: (arith) Implement run_select for arith.select - #6352

Open
jumerckx wants to merge 2 commits into
mainfrom
jumerckx/interpret-select
Open

interpreter: (arith) Implement run_select for arith.select#6352
jumerckx wants to merge 2 commits into
mainfrom
jumerckx/interpret-select

Conversation

@jumerckx

Copy link
Copy Markdown
Collaborator

No description provided.

@jumerckx jumerckx self-assigned this Aug 10, 2026
@jumerckx jumerckx added dialects Changes on the dialects interpreter xDSL Interpreter labels Aug 10, 2026
@jumerckx
jumerckx requested review from ed741 and superlopuh August 10, 2026 16:00
Comment thread xdsl/interpreters/arith.py Outdated
Comment on lines +268 to +269
assert len(args) == 3
return (args[1] if args[0] else args[2],)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This doesn't handle the vector condition case, but i don't know if the rest of the stuff in the airth interpreter does either.

@alexarice alexarice left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks good to me though I'm not an expert on the interpreter

self, interpreter: Interpreter, op: arith.SelectOp, args: PythonValues
):
assert len(args) == 3
cond, lhs, rhs = args

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: what's the error you would get here if you remove the assert?

f"arith.select shape mismatch: {shaped_cond.shape}, "
f"{shaped_lhs.shape}, {shaped_rhs.shape}",
)
data: list[Any] = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why a list here instead of tuple?

@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.93%. Comparing base (8e43a88) to head (55eb770).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6352      +/-   ##
==========================================
+ Coverage   86.90%   86.93%   +0.02%     
==========================================
  Files         437      437              
  Lines       65823    65840      +17     
  Branches     7485     7489       +4     
==========================================
+ Hits        57206    57238      +32     
+ Misses       7042     7028      -14     
+ Partials     1575     1574       -1     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dialects Changes on the dialects interpreter xDSL Interpreter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants