Skip to content

Support backend-defined jobs in reflection hooks - #925

Merged
maleadt merged 2 commits into
mainfrom
tb/backend-agnostic-hook
Sep 8, 2026
Merged

Support backend-defined jobs in reflection hooks#925
maleadt merged 2 commits into
mainfrom
tb/backend-agnostic-hook

Conversation

@maleadt

@maleadt maleadt commented Sep 8, 2026

Copy link
Copy Markdown
Member

GPUCompiler's reflection macros currently expect a CompilerJob, tying them to GPUCompiler's compilation pipeline. Backends such as cuTile have their own job types and compilation stages, but still need to inspect kernels launched by an expression—including expressions that use multiple backends.

Allow the individual @device_code_* macros to accept backend-defined jobs and dispatch to their reflection methods. Document compile_hook as the shared entry point, including how backends report cached compilations. Backends can also build their own stage macros with an optional job filter, and display already-inferred code with type-instability highlighting. This lets them preserve constant specializations instead of reconstructing a generic inference request.

Missing LLVM or native reflection produces an explicit unsupported-operation error. The all-stage @device_code directory dump remains specific to GPUCompiler's LLVM pipeline.

Bump the version to 2.6 for downstream compatibility bounds.

Accept backend-defined jobs in the individual device_code macros. Expose the shared hook and macro builder, with a job filter for backend-specific stages, and print already-inferred code so reflection can preserve constant specializations.

Report unsupported stages explicitly and keep the all-stage dump specific to the LLVM pipeline. Cover foreign jobs, mixed jobs, filtering, keyword forwarding, and hook suppression.
@maleadt
maleadt merged commit e9dbe53 into main Sep 8, 2026
31 of 33 checks passed
@maleadt
maleadt deleted the tb/backend-agnostic-hook branch September 8, 2026 14:10
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.33333% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.76%. Comparing base (0432e4c) to head (6981f0a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/reflection_compat.jl 53.22% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #925      +/-   ##
==========================================
+ Coverage   85.49%   85.76%   +0.26%     
==========================================
  Files          29       29              
  Lines        5584     5598      +14     
==========================================
+ Hits         4774     4801      +27     
+ Misses        810      797      -13     

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

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.

1 participant