Skip to content

Cross-file device-fn helper triggers "Type translation not yet implemented for: RigidTy(Str)" #76

Closed

Description

@mark-schultz-wu

Discovery context: I hit this bug while developing another project
with AI assistance, then asked the AI to extract a minimal reproducer
from the failing codebase. I (the human) verified the reproducer
reproduces the failure locally against main@c8b3103, but did not
independently audit the root-cause analysis, candidate patch, or
follow-up plan below — those are AI-generated and should be read
skeptically as a starting point, not a verified diagnosis.

Summary

A #[kernel] whose body delegates to a #[inline(always)] pub fn
helper defined in a sibling source file fails PTX codegen with
Type translation not yet implemented for: RigidTy(Str). The exact
same body inlined directly inside the kernel builds fine. The &str
appears to be traced from DisjointSlice::get_mut's internal
panic-message globals — the device-function lowering path doesn't
strip / handle them the way the kernel-entry path does.

Minimal reproducer:
https://github.com/mark-schultz-wu/mwe-cuda-oxide-bugs (crate
bug-b-cross-file/). Set INLINE=1 when running
cargo oxide build --arch sm_89 to verify the bug disappears when
the helper is inlined directly into the kernel body.

Observed error (verbatim, against main@c8b3103)

error: [rustc_codegen_cuda] Device codegen failed: PTX generation failed:
Translation failed: bug_b: Compilation error: invalid input program.
Unsupported construct: Type translation not yet implemented for: RigidTy(Str)

Concrete error site: crates/mir-importer/src/translator/types.rs:705-708
— the catch-all Type translation not yet implemented for: {:?} arm.
The &str reaches this arm because translate_pointer_like falls
through on the Str pointee.

Activity

  1. added
    bug
    codegen
    on Jun 6, 2026
  2. added a commit that references this issue on Jun 11, 2026
    4ffce63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcodegen

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions