orxfun / orxfun/orx-split-vec

unsafe `set_len` breaks fragmentation rules

Open
#58 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3
Forks
5
Avg merge
1h 40m
Merged PRs (30d)
11

Description

Assume we are using a Doubling strategy and currently we have 2 fragments with capacities of 4 an 8 respectively.
If the user calls set_len(3) while the vector is on this state, we will have:

  • fragment 1 with len=3 and capacity=4
  • fragment 2 with len=0 and capacity=8

This is an invalid fragment state. We must drop the second fragment.

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 at the set_len implementation and reproduce the Doubling strategy state described in the issue, with fragments of capacities 4 and 8. Done means calling set_len(3) leaves the first fragment at length 3 and removes the now-empty second fragment; add or run the relevant set_len tests if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.