Skip to content

Fix bug in nested LLVM And and Or nodes - #97

Merged
drhagen merged 1 commit into
masterfrom
llvm-and-or
Aug 11, 2026
Merged

drhagen merged 1 commit into
masterfrom
llvm-and-or

Conversation

@drhagen

@drhagen drhagen commented Aug 11, 2026

Copy link
Copy Markdown
Owner

When And or Or nodes are nested, there is a bug in the LLVM generation. Each assume that the operands end in the block where they started and then draw the phi nodes under that assumption. The problem is that the And and Or nodes create new blocks as part of how they work (because they are control flow). This leads to an LLVM error when a short-circuit node includes another short-circuit node.

This happens if there are 3 or more sparse operations in a row, which now has tests.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.79%. Comparing base (acfed6f) to head (47426df).

Files with missing lines Patch % Lines
src/tensora/codegen/_ir_to_llvm.py 50.00% 5 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
- Coverage   90.82%   90.79%   -0.03%     
==========================================
  Files          60       60              
  Lines        3161     3163       +2     
  Branches      386      386              
==========================================
+ Hits         2871     2872       +1     
- Misses        208      209       +1     
  Partials       82       82              

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

@drhagen
drhagen merged commit 7beddbb into master Aug 11, 2026
22 checks passed
@drhagen
drhagen deleted the llvm-and-or branch August 11, 2026 22:07
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