Make array returned by `ArraySymbol.state()` copy-on-write
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- backend-api-design, performance
Research direction
Start at dwave/optimization/_model.pyx around line 1729 and review ArraySymbol.state() alongside the NumPy interface constraints described here. Determine whether copy-on-write is feasible; otherwise consider a readonly return, while ensuring the node remains valid after model garbage collection. Done means state() avoids an unnecessary copy or safely returns readonly data without segfaults.
Written by the indexing model from the issue text.
Description
I have copy-on-write on my mind. Now that I think about it, we should try to make the array returned by ArraySymbol.state() a copy-on-write array. Currently we always return a copy.
Of course, it might not be (easily) possible via NumPy's interface. In which case we should consider returning a readonly array.
Another challenge will be tying the lifespan of the node to the array. I.e. when the model gets garbage collected we don't want to segfault when accessing the array.
- Dominant language
- C++
- Stars
- 31
- Forks
- 36
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 4
Contributor 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 dwavesystems/dwave-optimization
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dwavesystems/dwave-optimization#505 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in dwavesystems/dwave-optimization
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·