github halide/Halide v22.1.0
Halide 22.1.0

4 hours ago

Halide 22.1.0

A minor release of Halide 22. It adds FreeBSD as a target OS, fixes undefined behavior and memory-safety bugs, and makes the build easier to package for distributions (see #4660).

New features

  • FreeBSD target OS (#9642). Target::FreeBSD (freebsd in target strings, e.g. x86-64-freebsd) uses the FreeBSD LLVM triple and the POSIX runtime. It is detected as the host OS when Halide is built on FreeBSD and is exposed in the Python bindings and in add_halide_library. x86, ARM/AArch64 and RISC-V are supported. Native builds were tested on FreeBSD 15.1 amd64; AArch64 is untested. FreeBSD is appended to Target::OS, so existing enum values are unchanged.

Bug fixes

Python

  • Buffer.copy_from rejects mismatched buffers (#9635). hl.Buffer and hlr.Buffer now raise ValueError when the source has a different element size or number of dimensions. Before, release builds (including the wheels) read past the end of the source.
  • Dimension indices are bounds-checked (#9645). crop, slice, embed, translate, transpose, dim and their non-mutating variants on hl.Buffer and hlr.Buffer now raise IndexError for an out-of-range dimension, and ValueError for vector arguments with too many entries (or, for transpose(order), the wrong number). Before, release builds read or wrote past the buffer's shape array.

Compiler and autoschedulers

  • Fixed two left shifts of negative values (undefined behavior before C++20) in ConstantInterval and the simplifier (#9640).
  • Anderson2021: fixed an out-of-bounds read in Strides::dump and a latent null dereference in unrolled_loops (#9640).
  • Anderson2021: worked around a clang 22 ThinLTO miscompile (IPSCCP) that made the Anderson2021 generators segfault in LTO builds (#9640).

Build and packaging

These changes let distribution packages drop their local patches (#9641):

  • LLD is only required for the in-process WebAssembly JIT. It is now requested only when Halide_WASM_BACKEND is set. Builds with Halide_WASM_BACKEND=OFF no longer need LLD and may link LLVM statically.
  • Shared-only FlatBuffers installs (such as Arch's) are supported, and the installed CMake package now finds them for consumers.
  • Installed static libraries are built without LTO. Halide_GenGen and Halide_PyStubs no longer pick up distro -flto flags, which left compiler-specific bitcode in the shipped archives.
  • The empty Sphinx-only doc/ subdirectories are no longer installed.
  • test_export_single_symbol no longer depends on $SHELL, which is unset in containers.
  • The Homebrew build instructions now say Halide_LLVM_ROOT instead of Halide_ROOT.

Compatibility

There are no API or ABI changes. LLVM 21, 22 and 23 are supported, as in 22.0.0. Python code that relied on out-of-bounds Buffer arguments now gets an exception.

Thanks to @soma0212 for the Python Buffer fixes.

Full changelog: v22.0.0.post3...v22.1.0

🤖 Generated with Claude Code

Don't miss a new Halide release

NewReleases is sending notifications on new releases.