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
First party debug flag for cargo oxide build #1255
I have a Maturin-based (pyo3) scientific pipeline where I occasionally need to compile conditional gpu_printf! macros diagnostics into kernels. cargo oxide build currently uses the release-like policy, so it always applies -Copt-level=3 -Cdebug-assertions=off, including when preparing the environment for maturin develop.
Proposed API / behavior
--debug-assertions = -Copt-level=3 -Cdebug-assertions=on -Coverflow-checks=off
seems like the sensible choice of flag for the issue. It keeps the whole example suite working while overflow checks stay a separate decision.
Nihal's perspective
more MIR : debug_assert! checks and the panic paths behind them, plus your cfg(debug_assertions) code. All of that translates fine today; a failing assert becomes a device trap.
overflow checks come along for free: rustc turns -Coverflow-checks on whenever debug-assertions is on. Every + and * grows a check and a trap. That changes the MIR enough to break at least one pattern-sensitive lowering (the WGMMA accumulator-fusion path stops recognising its K-loop).
flag
examples compiling
debug-assertions=on, overflow follows 225 / 227
debug-assertions=on, overflow off 227 / 227
Alternatives considered
For my current project I am using a Cargo feature as a local workaround. I wanted to check whether exposing the independent rustc setting fits the intended profile model before potentially creating an issue.
cargo oxide build --device-cfg gpu_diag plus #[cfg(gpu_diag)] also exists today but seems like a workaround instead of having a toggle.
My intended scope would be limited to cargo oxide build --debug-assertions, keeping the existing release-like optimization policy while switching the wrapper-owned rustc flags to:
I would model this as a separate CodegenProfilePolicy rather than changing the backend or the existing ReleaseLike semantics, and cover the regular build, Cargo passthrough, and metadata interop device-build paths.
I’ll keep cargo oxide test unchanged so Cargo remains authoritative for its selected profile.
If that policy shape is undesirable, please let me know; otherwise I’ll send a draft PR against #1255.
Activity
uurl commentedon Sep 10, 2026
I can take a pass at this.
My intended scope would be limited to
cargo oxide build --debug-assertions, keeping the existing release-like optimization policy while switching the wrapper-owned rustc flags to:I would model this as a separate
CodegenProfilePolicyrather than changing the backend or the existingReleaseLikesemantics, and cover the regular build, Cargo passthrough, and metadata interop device-build paths.I’ll keep
cargo oxide testunchanged so Cargo remains authoritative for its selected profile.If that policy shape is undesirable, please let me know; otherwise I’ll send a draft PR against #1255.
nihalpasham commentedon Sep 15, 2026
#1258 is ready after maintainer rebase and implements this request.
Keeping this issue open until the PR is merged.