Skip to content

[Transform] Keep assumption checks with local dependencies in scope - #3611

Open
sepcnt wants to merge 1 commit into
tile-ai:mainfrom
sepcnt:packed-api-local-check-placement
Open

sepcnt wants to merge 1 commit into
tile-ai:mainfrom
sepcnt:packed-api-local-check-placement

Conversation

@sepcnt

@sepcnt sepcnt commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Split runtime-check placement out of #3265 for independent review.

Launch preparation can introduce local scalar bindings referenced by assumption runtime-check annotations. Extracting these checks to the packed-function entry places them before the variables they depend on are defined.

Track variables introduced by Bind statements in MakePackedAPI. When a marked condition references one of these variables, emit its assertion at the original location instead of extracting it to the function entry. This preserves the dependency without expanding the binding expressions.

Checks without local dependencies remain eligible for extraction. Existing handling of checks inside conditionals and loops is unchanged.

Summary

  • Track variables introduced by Bind statements in MakePackedAPI.
  • Keep a runtime-check assertion in the function body when its condition references a tracked variable. Place it after the relevant binding rather than at packed-function entry.
  • Continue collecting checks without references to tracked variables for entry-time assertions.
  • Preserve the existing handling of checks inside conditional and loop scopes.

C++ style / lint notes

  • The change modifies C++ code. It does not touch rules documented in docs/developer_guide/cpp_style.md.
  • No evidence was provided about the “C++ API Style Audit (warning only)” CI step or any style warnings introduced by this change.

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run pre-commit run --all-files in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 8f63bc0 and 943c62b.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 741bf8b and 8f63bc0.

📒 Files selected for processing: 1
  • src/transform/make_packed_api.cc

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

📝 Walkthrough

The extractor now tracks variables introduced by BindNode. It keeps checks that reference those variables in the function body as AssertStmts. Checks without local-variable references remain collected for entry-time assertions.

Changes: Runtime check placement

Layer / File(s) Summary
Track locals and place assertions
src/transform/make_packed_api.cc
The extractor records bound variables. Checks that reference them become in-place assertions, while other checks remain collected for entry-time assertions.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: bug

Suggested reviewers: siriusneo

Merge Risk: ⚪ Minimal · up to 8f63b

No actionable merge-blocking risk remains in the reviewed change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: keeping assumption checks with local variable dependencies in their original scope.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
🧪 Generate unit tests (beta)
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested a review from SiriusNEO October 22, 2026 11:20
@coderabbitai coderabbitai Bot added the bug Something isn't working label Oct 22, 2026
@sepcnt
sepcnt force-pushed the packed-api-local-check-placement branch from 8f63bc0 to 400541b Compare October 22, 2026 12:37
@sepcnt
sepcnt force-pushed the packed-api-local-check-placement branch from 400541b to 943c62b Compare October 22, 2026 15:47

@KellyFrog KellyFrog 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.

LGTM

This branch has not been deployed

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants