Reading issue
rust-lang / rust · Issue No. 160567
Reduced from https://github.com/rust-lang/rust/issues/160470#issuecomment-5185373594 (a different bug)
I tried this code:
#![feature(autodiff)]
use std::autodiff::*;
#[autodiff_reverse(d_eval, Const)]
fn eval(_out: &mut [f64]) {}
#[autodiff_forward(hvp_eval, Dual)]
fn grad(out: &mut [f64]) {
d_eval(out);
}
fn main() {
let mut out = [0.0];
let mut out_t = [0.0];
hvp_eval(&mut out, &mut out_t);
}
RUSTFLAGS="-Z autodiff=Enable,NoTT" cargo +enzyme build
I expected to see this happen: compiles
Instead, this happened:
On nightly:
error: src/main.rs:4:1: in function preprocess__RNvCs5ENfmmVW5Vl_3bar6d_eval void (ptr, i64): Enzyme: No forward mode derivative found for __enzyme_autodiff_RNvCs5ENfmmVW5Vl_3bar6d_eval
at context: %3 = call {} (...) @__enzyme_autodiff_RNvCs5ENfmmVW5Vl_3bar6d_eval(ptr @_RNvCs5ENfmmVW5Vl_3bar4eval, ptr @enzyme_const, ptr %0, ptr @enzyme_const, i64 %1) #174, !dbg !75
On head (self-build) we also get:
error: src/main.rs:4:1: in function fwddiffe_RNvCs8wtiwuS546I_3bar6d_eval void (ptr, ptr, i64): Enzyme: Cannot cast __enzyme_autodiff primal argument 3, found ptr %0, type ptr (simplified to ptr %0 ) - to arg 1, i64
error: src/main.rs:4:1: in function fwddiffe_RNvCs8wtiwuS546I_3bar6d_eval void (ptr, ptr, i64): Enzyme: Cannot cast __enzyme_autodiff primal argument 3, found ptr %0, type ptr (simplified to ptr %0 ) - to arg 1, i64
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.