linebender / linebender/vello

(Un)packing code makes assumptions about struct sizes

Open
#1,259 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-research
Dominant language
Rust
Stars
4.3k
Forks
300
Avg merge
2d 13h
Merged PRs (30d)
61

Description

(Un)packing code feels unsafe, as there are some assumptions of types that can change. We should at least have some const asserts here for size assumptions (by looking using https://doc.rust-lang.org/std/primitive.u32.html#method.leading_zeros on max of types).

_Originally posted by @sagudev in https://github.com/linebender/vello/pull/1173#discussion_r2397119809_

Contributor guide

No contributing guide indexed for this repository

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

Start by locating the Rust packing and unpacking code referenced by the issue, then review its assumptions about integer type sizes and the relevant Rust `u32::leading_zeros` documentation. Add compile-time size assertions for the assumptions identified there and verify that the code still builds and its existing checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.