Skip to content

Conversation

@alexreinking
Copy link
Member

Fixes #8699

@alexreinking
Copy link
Member Author

It would be good to audit all our Python __repr__ and __str__ functions to check that they (a) don't crash (at a minimum) and (b) behave like Pythonic __repr__ and __str__ functions... i.e., __repr__ should be something copy-paste-able into a REPL (maybe with from halide import *)

@alexreinking alexreinking force-pushed the python/print-imageparam branch from 8f52b70 to bff95ab Compare August 7, 2025 15:39
@alexreinking alexreinking changed the title Fix printing undefined ImageParams Fix several printing segfaults. Aug 7, 2025
@alexreinking
Copy link
Member Author

alexreinking commented Aug 7, 2025

An LLM success story: I asked Claude Code to audit all the __str__, __repr__, and operator<< functions in the codebase for .defined()-ness issues. It turned up a few false-positives, but it found the Pipeline issue and the exercise helped me notice and construct the Func::name() segfault.

Who knows if it found them all?

No code in this PR was written by Claude; I asked it only to find fishy functions.

Copy link
Contributor

@mcourteaux mcourteaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to prevent updating Halide.h when it didn't change, and don't recompile all dependents? I like :)

@alexreinking
Copy link
Member Author

This is to prevent updating Halide.h when it didn't change, and don't recompile all dependents? I like :)

It also seemed to fix an issue on the arm mac worker

@alexreinking
Copy link
Member Author

Lots of unrelated failures:

  • Make failing due to a new layout for Homebrew's libpng & libjpeg.
  • Make failing due to -Werror in the previously untested onnx app (denormal_disabler.h). Should be fixed by Add CMake for onnx app #8707.
  • LLVM trunk simd-op-check failures
  • On arm-32-linux, a failure in correctness_mul_div_mod appears to be new
  • adams2019_test_autoscheduler performance test is known to be flaky.
  • LLVM 21 has an error in correctness_register_shuffle
  • WASM has an issue with correctness_indexing_access_undef

Lots to follow up on, but nothing to halt overall progress.

@alexreinking alexreinking merged commit 214388e into main Aug 13, 2025
5 of 19 checks passed
@alexreinking alexreinking deleted the python/print-imageparam branch August 13, 2025 04:54
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.

Missing check for undefined Parameter in an ImageParam

4 participants