You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ICE]: std::autodiff regression in integer slice-length argument #160470
C-bugCategory: This is a bug.F-autodiff`#![feature(autodiff)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
Can you please add the actual command you're running, and maybe the OS? I'm unable to reproduce it with RUSTFLAGS="-Z autodiff=Enable" cargo +nightly-2026-08-01 run
I feel like that' s been an issue that Enzyme fixed in the past. Do you by chance have older nightly toolchains with Enzyme that you could delete? Also, can you delete and re-install enzyme (and run cargo clean)
You're the second person today running into this issue with outdated toolchain. Let's see if more people encounter it, and if yes what we can do about it.
I'm not sure what's the difference from nightly to Master, but it sounds like you now have a working solution everywhere?
I mean, if I just do nightly with oximo, it fails. Both CI and locally. I am not sure why it works with master and with the older toolchain and not with latest.
If you try to run oximo, do you get incorrect autodiff typetree handling for slice: [u8]?
Edit:
Just to add more context, creating a rust-toolchain.toml in oximo with:
Huh, I just retried the MWE and it is compiling fine (I didn't reinstall enzyme).
But if you still can't compile your main application, I guess something just went wrong while creating the MWE, right? Can you try again and update the MWE, once you find some time?
Passing: RUSTFLAGS='-Zautodiff=Enable' cargo +nightly-2026-07-26 run --profile enzyme
Failing: RUSTFLAGS='-Zautodiff=Enable' cargo +nightly-2026-08-01 run --profile enzyme
Output passing:
germanheim@german:~/Desktop/enzyme-mwe$ RUSTFLAGS='-Zautodiff=Enable' cargo +nightly-2026-07-26 run --profile enzyme
warning: variable does not need to be mutable
--> src/main.rs:98:9
|
98 |let mut hess_out = [0.0];| ----^^^^^^^^
||| help: remove this `mut`|
= note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default
warning: unused variable: `hess_out`
--> src/main.rs:98:9
|
98 |let mut hess_out = [0.0];| ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_hess_out`|
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
warning: `enzyme-mwe` (bin "enzyme-mwe") generated 2 warnings (run `cargo fix --bin "enzyme-mwe" -p enzyme-mwe` to apply 2 suggestions)
Finished `enzyme` profile [optimized] target(s) in 0.03s
Running `target/enzyme/enzyme-mwe`
[1.0] [0.0]
Output failing:
germanheim@german:~/Desktop/enzyme-mwe$ RUSTFLAGS='-Zautodiff=Enable' cargo +nightly-2026-08-01 run --profile enzyme
Compiling enzyme-mwe v0.1.0 (/home/germanheim/Desktop/enzyme-mwe)
warning: variable does not need to be mutable
--> src/main.rs:98:9
|
98 |let mut hess_out = [0.0];| ----^^^^^^^^
||| help: remove this `mut`|
= note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default
warning: unused variable: `hess_out`
--> src/main.rs:98:9
|
98 |let mut hess_out = [0.0];| ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_hess_out`|
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
bad enzyme_type {[0]:Integer} RegSize=0 I: call void @diffe_RNvCs7uBthmQWLUV_10enzyme_mwe4eval(ptr %0, i64 %1, ptr %2, i64 %3, ptr %4, i64 %5, ptr %6, i64 %7, ptr %8, i64 %9, ptr %10, i64 %11, ptr %12, ptr %14, i64 %13, ptr %15, i64 %16, ptr %17, i64 %18, ptr %19, ptr %21, i64 %20, ptr %22, ptr %24, i64 %23)
rustc-LLVM ERROR: Canonicalization failed
warning: `enzyme-mwe` (bin "enzyme-mwe") generated 2 warnings (run `cargo fix --bin "enzyme-mwe" -p enzyme-mwe` to apply 2 suggestions)
error: could not compile `enzyme-mwe` (bin "enzyme-mwe"); 2 warnings emitted
Caused by:
process didn't exit successfully: `/home/germanheim/.rustup/toolchains/nightly-2026-08-01-x86_64-unknown-linux-gnu/bin/rustc --crate-name enzyme_mwe --edition=2024 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=157 --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto=fat -C codegen-units=16 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=b0d55cd2f28d1ae6 --out-dir /home/germanheim/Desktop/enzyme-mwe/target/enzyme/build/enzyme-mwe/19d2faeaf4ed04ba/out -C strip=debuginfo -Zautodiff=Enable` (exit status: 101)
The original MWE now passes using the nightly-2026-10-11 toolchain. I believe this was fixed by EnzymeAD/Enzyme#3272.
However, oximo-autodiff's CI is still failing on the latest nightly. It looks like passing [(1_u64, &42_u64)] by value to black_box triggers a crash when -Zautodiff=Enable is set, even without any active autodiff functions.
@GermanHeim Can you retry again tomorrow? Enzyme just landed a fix which should be in the next nightly. But yeah, if its happening even without autodiff calls it's likely a different bug, so a new issue would be good.
I just tried it. The original MWE passes on latest nightly. However, there is the other issue I mentioned.
Whenever I use std::hint::black_box on an array of (integer, reference) tuples, with no autodiff attributes or dependencies, it aborts on native and WASM (TypeTree.h).
C-bugCategory: This is a bug.F-autodiff`#![feature(autodiff)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
Activity
CI: Update nightly version
ZuseZ4 commentedon Aug 4, 2026
Can you please add the actual command you're running, and maybe the OS? I'm unable to reproduce it with
RUSTFLAGS="-Z autodiff=Enable" cargo +nightly-2026-08-01 runZuseZ4 commentedon Aug 4, 2026
I feel like that' s been an issue that Enzyme fixed in the past. Do you by chance have older nightly toolchains with Enzyme that you could delete? Also, can you delete and re-install enzyme (and run cargo clean)
GermanHeim commentedon Aug 4, 2026
Huh, I just retried the MWE and it is compiling fine (I didn't reinstall enzyme).
I am not sure what happened or whether I did something wrong.
oximo is still failing in main with 2026-08-01, while
rustc 1.99.0-nightly (dc3f85158 2026-07-26)does fine:Here my CI was failing:
oximo-rs/oximo@40e5c43
Switching toolchain versions worked fine:
oximo-rs/oximo@0d74ae1
I will try to create another MWE or try to find what I was doing differently.
Edit: I am using Fedora 44 KDE Linux 7.1.5-201.fc44.x86_64
ZuseZ4 commentedon Aug 4, 2026
You're the second person today running into this issue with outdated toolchain. Let's see if more people encounter it, and if yes what we can do about it.
I'm not sure what's the difference from nightly to Master, but it sounds like you now have a working solution everywhere?
GermanHeim commentedon Aug 4, 2026
I mean, if I just do nightly with oximo, it fails. Both CI and locally. I am not sure why it works with master and with the older toolchain and not with latest.
If you try to run oximo, do you get
incorrect autodiff typetree handling for slice: [u8]?Edit:
Just to add more context, creating a
rust-toolchain.tomlin oximo with:Makes oximo-autodiff work. Switching to
channel = "nightly-2026-08-02"ICEs.ping @ZuseZ4 because of edit.
ZuseZ4 commentedon Aug 5, 2026
But if you still can't compile your main application, I guess something just went wrong while creating the MWE, right? Can you try again and update the MWE, once you find some time?
GermanHeim commentedon Aug 5, 2026
I updated the MWE to match what is in oximo:
Cargo.toml:
Reproducing commands:
Output passing:
Output failing:
GermanHeim commentedon Oct 11, 2026
Hey @ZuseZ4,
The original MWE now passes using the nightly-2026-10-11 toolchain. I believe this was fixed by EnzymeAD/Enzyme#3272.
However,
oximo-autodiff's CI is still failing on the latest nightly. It looks like passing[(1_u64, &42_u64)]by value toblack_boxtriggers a crash when-Zautodiff=Enableis set, even without any active autodiff functions.Should we close this issue and open a new one?
Rollup merge of rust-lang#165028 - ZuseZ4:update-enzyme-oct-27, r=ZuseZ4
Rollup merge of rust-lang#165028 - ZuseZ4:update-enzyme-oct-27, r=ZuseZ4
Unrolled build for #165028 in rollup 165056
ZuseZ4 commentedon Oct 28, 2026
@GermanHeim Can you retry again tomorrow? Enzyme just landed a fix which should be in the next nightly. But yeah, if its happening even without autodiff calls it's likely a different bug, so a new issue would be good.
Rollup merge of #165028 - ZuseZ4:update-enzyme-oct-27, r=ZuseZ4
GermanHeim commentedon Nov 1, 2026
Hi @ZuseZ4,
I just tried it. The original MWE passes on latest nightly. However, there is the other issue I mentioned.
Whenever I use
std::hint::black_boxon an array of (integer, reference) tuples, with no autodiff attributes or dependencies, it aborts on native and WASM (TypeTree.h).This should fail:
Using:
And also
RUSTFLAGS='-Zautodiff=Enable' cargo +nightly run --profile enzyme(release optimization, fat LTO, and 16 codegen units).July 26 nightly passes.
Should I open a new issue?
(I can easily move to using a vector, but this should be fixed)