cuda-core: define boolean storage and element padding/packing policy
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 8/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- rust
- Domain
- data, documentation
Research direction
This is a design decision, not a starter task: the issue defers to the survey and proposed direction in its first comment and to #1506, #1460/#1461, #1401 and #1513. Read those first, then the DTypeId and DeviceCopy definitions and the bool handling they reference. Done means a written representation and cast policy that the maintainers accept, plus tests for invalid boolean encodings and supported packed layouts.
Written by the indexing model from the issue text.
Description
Define a consistent storage and conversion policy for boolean, packed, and sub-byte element types. Logical dtype width, host storage layout, and Rust value validity impose different constraints on copies, casts, and readback.
Requirements
- Document boolean storage as one byte per element holding
0x00or0x01, the Rustboollayout. There is no separate byte-backed boolean storage type:boolimplementsDeviceCopy, and the safe reinterpreting casts exclude it through theAnyBitPatternbound (#1506). - Specify conversions and validation between raw bytes, device boolean storage, and Rust
bool. Safe APIs must not materialize invalid Rust boolean values. - Distinguish logical dtype width from host storage size/alignment. Specify element counts, byte extents, and explicit pack/unpack boundaries for packed and sub-byte types.
- Define how padding, alignment, and initialized bytes affect copies, casts, and readback, including which guarantees belong to dtype metadata and which to the raw-buffer contract.
- Apply the policy consistently to owned, borrowed, and foreign storage and document foreign-memory validity requirements.
- Mark
DTypeId#[non_exhaustive]so storage types can be added without breaking downstream matches.
Acceptance
Document the representation/cast policy and add coverage for invalid boolean encodings and supported packed layouts. Coordinate cast coverage with #1401.
The shared-runtime migration in #1460/#1461 implements DeviceCopy for bool and keeps bool: DType; the cast rule is #1506, and no new boolean representation is planned. The sub-byte, packed, and padded storage questions (shape semantics for packed types, nibble order, odd extents, DeviceCopy aggregate layout, DTypeId::size_in_bytes versus logical width) were filed as #1513 and are consolidated here; the survey and proposed direction are in the first comment.
- Dominant language
- Rust
- Stars
- 3.7k
- Forks
- 312
- Avg merge
- 6d 5h
- Merged PRs (30d)
- 68
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from NVIDIA/cuda-rust
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NVIDIA/cuda-rust#1568 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: The doc of trait `LoadTileLike` is incorrectPossibly taken @akhil9tiet claimed this 6 days ago. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
NVIDIA/cuda-rust#1523 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Target feature scan splits LLVM IR on ';', so conjunctive predicates match across the whole module (integer redux + any f32 reads as ReduxF32)Possibly taken @vyncint claimed this 33 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA/cuda-rust#1303 · 1 comment ·
Maintainers usually reply within 2 days
All issues in NVIDIA/cuda-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
git-ai-project/git-ai#2434 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
peteonrails/voxtype#909 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kucherenko/jscpd#1239 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
alchemyplatform/rundler#1358 ·
Maintainers usually reply within 3 days