Rust-GPU / Rust-GPU/rust-gpu

[Migrated] debug_printf requires unsafe

Open
#96 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.4k
Forks
125
PR merge metrics
No merged PRs in 30d

Description

Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/997
Old labels: t: enhancement
Originally creatd by charles-r-earp on 2023-03-04T00:38:43Z


The debug_printf and debug_printfln macros generate an invocation of the asm macro, which requires an unsafe block. However, the macro appears to validate it's input, so it could potentially add the unsafe block to it's output. If there are still outstanding issues, perhaps a safety section could be added to the docs to reduce confusion? This is a really useful tool, and it seems strange to require unsafe just to debug stuff.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the debug_printf and debug_printfln macro definitions and the asm macro they invoke. Check how input validation relates to the unsafe requirement, then establish whether completion means changing the generated invocation or documenting the safety expectations.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.