Skip to content

Deprecate TailStrategy::Predicate in favor of GuardWithIf - #9446

Open
mcourteaux wants to merge 1 commit into
mainfrom
mcourteaux/fix-9443-deprecate-predicate
Open

Deprecate TailStrategy::Predicate in favor of GuardWithIf#9446
mcourteaux wants to merge 1 commit into
mainfrom
mcourteaux/fix-9443-deprecate-predicate

Conversation

@mcourteaux

@mcourteaux mcourteaux commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

First step of the deprecation plan in #9443:

  • TailStrategy::Predicate now shares the same underlying enum value as TailStrategy::GuardWithIf (they have been behaviorally identical in ApplySplit.cpp for a while) and is marked [[deprecated]].
  • Switch statements over TailStrategy (ApplySplit.cpp, IRPrinter.cpp, Serialization.cpp) no longer need a separate case for Predicate, since it now compiles to the same value as GuardWithIf.
  • Deserialization.cpp maps old serialized Predicate pipelines to GuardWithIf directly, without referencing the deprecated identifier.
  • Func.cpp's exact-split legality check is simplified accordingly.
  • The Python binding keeps exposing TailStrategy.Predicate for this release (with the deprecation warning locally suppressed), per the plan to remove it for real only in the release after next.
  • Updated the internal uses of TailStrategy::Predicate in a handful of tests and the hannk app to use GuardWithIf instead, so the codebase doesn't trigger its own new deprecation warning.

Closes #9443 (partially — the follow-up release will remove Predicate entirely).

Test plan

  • libHalide builds clean (no warnings) with these changes
  • Serialization.cpp, Deserialization.cpp, and PyEnums.cpp individually syntax-checked with -Wdeprecated-declarations: none triggered
  • All touched test/app files compile
  • clang-format --dry-run --Werror clean on all touched files
  • pre-commit run --all-files passed on the commit

🤖 Generated with Claude Code

Predicate has been behaviorally identical to GuardWithIf for a while
(ApplySplit.cpp already routed both to the same code path). Give it
the same enum value as GuardWithIf and mark it [[deprecated]] as the
first step of the deprecation plan in #9443; remove it entirely in a
future release.

Since the two values now compare equal, the switch statements over
TailStrategy in IRPrinter.cpp, ApplySplit.cpp, and Serialization.cpp
no longer need a separate case for Predicate. Deserialization.cpp
still maps the old serialized Predicate value to GuardWithIf without
referencing the deprecated identifier. The Python binding keeps
exposing TailStrategy.Predicate for this release, with the
deprecation warning locally suppressed. Internal uses of
TailStrategy::Predicate in tests and the hannk app are switched to
GuardWithIf.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.93%. Comparing base (0b4fbea) to head (fae150a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/Func.cpp 0.00% 1 Missing and 1 partial ⚠️
src/Deserialization.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9446      +/-   ##
==========================================
+ Coverage   69.84%   69.93%   +0.09%     
==========================================
  Files         261      261              
  Lines       79615    79605      -10     
  Branches    19402    19398       -4     
==========================================
+ Hits        55606    55674      +68     
+ Misses      18042    18013      -29     
+ Partials     5967     5918      -49     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Deprecation plan for TailStrategy::Predicate

1 participant