Skip to content

[FIX][TIR] Conservatively analyze unsigned branch conditions - #20344

Open
sepcnt wants to merge 4 commits into
apache:mainfrom
sepcnt:cond-dtype
Open

sepcnt wants to merge 4 commits into
apache:mainfrom
sepcnt:cond-dtype

Conversation

@sepcnt

@sepcnt sepcnt commented Sep 15, 2026

Copy link
Copy Markdown

Fixes #20343.
Fixes tile-ai/tilelang#3235.

Unsigned branch conditions can crash block access-region analysis because the inequality solver constructs negative coefficients using unsigned variable types, raising cannot make uint from negative value -1.
Keep unsupported unsigned conditions unresolved and conservatively analyze both branches, while preserving independent signed bounds.
Add regression coverage for zero comparisons, high-bit thresholds, wraparound predicates, and mixed signed/unsigned conditions.

@tqchen

tqchen commented Sep 15, 2026

Copy link
Copy Markdown
Member

Is this case from a real use-case, or AI/fuzzer, if so would be good to know the background.

The regression tests is too broad

Comment thread tests/python/s_tir/analysis/test_sblock_access_region.py Outdated
@sepcnt

sepcnt commented Sep 15, 2026

Copy link
Copy Markdown
Author

Is this case from a real use-case, or AI/fuzzer, if so would be good to know the background.

The regression tests is too broad

This came from a compilation error in a differentiable renderer kernel for winding number calculation.

@tqchen

tqchen commented Sep 15, 2026

Copy link
Copy Markdown
Member

Would be good to understand further on the shape of differentiable renderer kernel

please try to narrow the coverage, seems the error comes in arith, so it should be in a form of arith only testcase, and not through read write region

@tqchen

tqchen commented Sep 15, 2026

Copy link
Copy Markdown
Member

test should be in python

@tqchen

tqchen commented Sep 15, 2026

Copy link
Copy Markdown
Member

cc @tlopex would be good to see if we can have a more narrow check other than disabling, good to see candidates here and learnings

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

Labels

None yet

Projects

None yet

2 participants