Audit: Maximum number of fields in derived types in the ecosystem
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 179
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 29
Description
TL;DR: 120 fields
We have upcoming work that will require a dedicated trait impl for each supported number of fields. Before choosing a limit, it would be useful to know how many fields real zerocopy users actually need.
I did a best-effort ecosystem scan for public Rust crates/projects that use zerocopy derives:
Users
* `signalapp/libsignal`
* `lowRISC/opentitan`
* `google/crosvm`
* `theseus-os/Theseus`
* `managarm/managarm`
* `oxidecomputer/hubris`
* `bitflags/bitflags`
* `awslabs/mountpoint-s3`
* `cberner/fuser`
* `tailscale/tailscale-rs`
* `project-oak/oak`
* `ChainSafe/forest`
* `microsoft/litebox`
* `kaspanet/rusty-kaspa`
* `coconut-svsm/svsm`
* `elodin-sys/elodin`
* `messense/mupdf-rs`
* `bitshifter/glam-rs`
* `sampsyo/bril`
* `rust-vmm/kvm`
* `synacktiv/frinet`
* `zlfn/rust-gb`
* `taks/esp32-nimble`
* `supervc-stack/VectorChord-bm25`
* `memorysafety/rav1d`
* `worldcoin/orb-software`
* `category-labs/monad-bft`
* `SecureDNA/SecureDNA`
* `microsoft/openvmm`
* `rosenpass/rosenpass`
* `OpenDevicePartnership/patina`
* `n0-computer/iroh-willow`
* `rust-osdev/virtio-spec-rs`
* `NationalSecurityAgency/seabee`
* `AyagamiDev/ayagami`
* `oxidecomputer/idolatry`
* `jiangzhe/doradb`
* `heinrich5991/libtw2`
* `rkyv/rend`
* `rust-osdev/fuse-abi`
* `rust-osdev/endian-num`
* `DevExzh/litchi`
* `aranya-project/aranya-core`
* `lohvht/azothacore-rs`
* `platform-system-interface/android-image`
* `sivadeilra/pow2`
* `zhengxinchang/isopedia`
* `platform-system-interface/intel_fw`
* `kdanecki/uma-filesystem`
* `moehr1z/hermit-rs`
* `rcore-os/virtio-drivers`
* `google/safe-mmio`
* `microsoft/pdb-rs`
* `chipsalliance/caliptra-dpe`
* `birkenfeld/ads-rs`
* `camshaft/codec`
* `RibirX/Ribir`
* `Systemcluster/wrappe`
* `encounter/nod`
* `cbiffle/catibo`
* `KOBA789/qp`
* `KOBA789/relly`
* `willglynn/taptap`
* `worldfnd/whir`
* `monadplus/rust-playground`
* `google/percore`
The largest type I found is `coconut-svsm/svsm`'s `cpuarch::VMSA`, with 120 fields:
```rust
#[repr(C, packed)]
#[derive(Debug, FromBytes)]
pub struct VMSA {
// ...
}
```
Contributor guide
Research direction
Start by reviewing the listed ecosystem projects and the `cpuarch::VMSA` type in coconut-svsm, which the issue identifies as having 120 fields. Record the largest derived types found and compare them with the supported field limit. Done means producing an evidence-backed recommendation for the limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100