Modify mask operators to remove explicit mask where it isn't needed
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 50/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cpp
- Domain
- performance
Research direction
Locate the mask operators that currently call from_builtin, along with the from_raw and from_prechecked_builtin entry points. Determine which operations preserve valid mask bits without extra masking, update only those conversions, and verify that operators such as complement still remove unwanted bits.
Written by the indexing model from the issue text.
Description
The compact mask is a plain integer, which may be bigger than the bits actually being masked (e.g., 64-bit value for a mask of 40 bits).
The operators call from_builtin to convert the output of the operation to a mask, and in doing so this explicitly masks off the unwanted bits of the mask to make sure that the extraneous bits don't have some unintended side-effect. For example, calling ~ will set some of the out-of-bound bits to 1, which can introduce subtle issues.
But some operators are guaranteed to produce a valid output provided the inputs are valid. For example, given two masks of 40 bits each, their internal values will not contain any bits beyond position 40. Performing an AND will produce an output which also is limited to 40 bits. In such a case, rather than calling from_builtin, an alternative from_raw (or from_prechecked_builtin) could be called which omits the extra AND operation to mask off unwanted bits. This would be opt-in - only operators known to generate valid bits would call this.
- Dominant language
- C++
- Stars
- 6
- Forks
- 2
- Avg merge
- 2d 47m
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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 intel/xvec
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 40/100
Maintainers usually reply within 1 day
-
C++29 extension
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
-
C++29 extension
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
Status: Needs confirmation Status: Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
A-combat P-low S-ready-to-start task
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
bug intrinsic medium priority rt_lib
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day