[ICE]: std::autodiff regression in integer slice-length argument
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Hello, in the last nightly version of Enzyme, it rejects an integer slice-length argument while canonicalizing LLVM IR.
See the MWE below.
Code
#![feature(autodiff)]
use std::autodiff::autodiff_reverse;
#[autodiff_reverse(d_eval, Const, Duplicated, Duplicated)]
#[inline(never)]
fn eval(ops: &[u32], x: &[f64], output: &mut [f64]) {
output[0] = f64::from(ops[0]) * x[0];
}
fn main() {
let ops = [1_u32];
let x = [4.0];
let mut x_shadow = [0.0];
let mut output = [0.0];
let mut output_shadow = [1.0];
d_eval(&ops, &x, &mut x_shadow, &mut output, &mut output_shadow);
assert_eq!(x_shadow, [1.0]);
}
Using:
inherits = "release"
lto = "fat"
codegen-units = 16
The program should exit successfully after checking that the derivative is 1.0.
Actual nightly 2026-08-01:
bad enzyme_type {[0]:Integer} RegSize=0 I: call void @diffe_...(ptr ..., i64 ...)
rustc-LLVM ERROR: Canonicalization failed
It works fine in rustc 1.99.0-nightly (dc3f85158 2026-07-26) with the enzyme component, using the same command and profile.
Meta (failing)
rustc --version --verbose:
rustc 1.99.0-nightly (ad3d0bc14 2026-07-31)
binary: rustc
commit-hash: ad3d0bc141a02cf446e384136d250a1f6950fed5
commit-date: 2026-07-31
host: x86_64-unknown-linux-gnu
release: 1.99.0-nightly
LLVM version: 22.1.8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the supplied Rust MWE with the failing nightly, the working nightly, and the shown release profile to reproduce the LLVM canonicalization error. Compare the generated behavior around the integer slice-length argument and the Enzyme component; done means the program compiles and exits successfully with the derivative assertion passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100