Skip to content

List the call sites when an IR backtrace reaches several - #1135

Closed
nishagoswamii wants to merge 1 commit into
JuliaGPU:mainfrom
nishagoswamii:ng/backtrace-call-sites
Closed

nishagoswamii wants to merge 1 commit into
JuliaGPU:mainfrom
nishagoswamii:ng/backtrace-call-sites

Conversation

@nishagoswamii

Copy link
Copy Markdown
Contributor

The frames after multiple call sites are alternatives, not a call chain.
Besides InvalidIRError, they show in the exception backtraces that CUDA.jl, AMDGPU.jl, Metal.jl, OpenCL.jl and oneAPI.jl print at debug level 2.
On Metal and SPIR-V that is only when the throwing function cannot be inlined into the kernel, for example because it is recursive.
The multiple call sites frame stays, because error_origin uses it to tell that a backtrace has no single call in the outermost function.
call_site_frames is off by default because some callers, emit_exception! and Enzyme.jl's emit_error, turn each frame into device code.
Should each call site get its whole chain instead, and should the list be capped?

Part of #637.

@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.55%. Comparing base (27f0d5c) to head (6a6d034).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1135      +/-   ##
==========================================
- Coverage   93.01%   91.55%   -1.46%     
==========================================
  Files          32       32              
  Lines        8562     8574      +12     
==========================================
- Hits         7964     7850     -114     
- Misses        598      724     +126     

☔ 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.

@maleadt

maleadt commented Dec 2, 2026

Copy link
Copy Markdown
Member

Thanks. I've reworked it in #1141: instead of appending caller frames to the backtrace (where they read as one call chain and only went one level up), the callers are now stored next to the errors in InvalidIRError and printed as alternative paths followed out to the kernel. Exception sites and emit_exception! keep their current backtraces.

@maleadt maleadt closed this Dec 2, 2026
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.

2 participants