[Tracking] vector types: `<N x T>` as N lanes of T, per the design document
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 14
- Forks
- 2
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 61
Description
Umbrella for docs/discussions/design-vector-types.md, the outcome of Vx#472. The document is the source of truth; these issues track its phases.
The design was revised after phase 0. Two changes matter: a vector now has one alignment, the target datalayout's, with under-alignment carried by the pointer type (*mut align(4) <4 x f32>) and a cast that preserves the source alignment; and a user unsafe fn is a prerequisite rather than something to work around, adopting the Rust-2024 body rule from the start. The phase 0 report and the open points are Section 11 of the document.
Phases, each its own issue, in the document's order:
- Vx#475 phase 0: confirm against the tree (report: design Section 11)
- Vx#484 phase 1:
unsafe fnfor user functions (09c86445) - Vx#476 phase 2: the type
<N x T>on both paths - Vx#477 phase 3: operations
- Vx#478 phase 4: pointers to vectors
- Vx#485 phase 5: vectors in structs and across FFI
- Vx#479 phase 6: tensors as the safe producers
- Vx#480 phase 7: placement under
unsafe - Vx#481 phase 8: language docs
Five open points, carried in the document's Section 11.5, each due before the phase that needs it:
- Where
UNSAFE_FNcan live, given that word 3 is compared by the derived equality and hash (Vx#484). - The frontend computes layouts rather than querying a datalayout, so decision 7's invariant is held by a test, not by asking (Vx#476, Vx#485).
- The alignment subtyping direction is unstated: a more-aligned pointer must be usable where a less-aligned one is expected (Vx#478).
- The cast spelling,
p.cast::<<4 x f32>>()versusp as *mut <4 x f32>(Vx#478). as_vec_ptr's alignment: the machine file covers a declared sub-space, but a host allocation is a plainmalloc(Vx#479).
Release blocker, now cleared: Vx#486, the audit of user functions taking raw pointers, is done (1449ef41). It also produced the standard-library gate (e44627c7) and the enforcement of unsafe fn on every call path (341b5fdf). Follow-ups it left: Vx#487, Vx#488, Vx#489, Vx#490.
Open point 1 is closed: the flag went on FnSig alongside ret_prov, not in GID word 3, so identity did not change. The vxlib interface is now vxlib-interface-v10. See Vx#484.
Follow-ups named by the design and not scheduled: the machine-declared vector width and <native x T> (Section 8); shuffles, reductions, masked forms; bounded-tensor chunks/remainder (with rfc-bounded-extents.md); <3 x f32> and other non-power-of-two widths.
Related: Vx#472 (the question that produced the design), Vx#383 (trait_topologies.vx waits on the type phase), Vx#483 (a defect found in the code the pointer phase extends).
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Read docs/discussions/design-vector-types.md first, especially Section 11, then follow the phase issue that matches the work, beginning with Vx#476 for the vector type. The umbrella is complete when the listed phases and their open design points are resolved, but this issue alone does not identify a self-contained change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100