metal: convolution ring lookup overflows at valid high positions
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend, machine-learning
Research direction
Read crates/metal/kernels/delta.metal at the reported tap_x location and the shared oracle at crates/metal/src/bin/shared/oracle_delta.rs; first trace how pos0, back, and ring slots are calculated. Add the boundary case to the delta tests and compare both implementations with independently calculated predecessor slots. Done means the valid high-position call selects the expected slots and produces correct convolution inputs and recurrent state.
Written by the indexing model from the issue text.
Description
A public delta_rows call with pos = u32::MAX - 9 and nine rows passes check_rows. In tap_x, row 0 with distance 1 computes ring slot 0 instead of slot 4 because pos0 + RING_ROWS - back wraps before the modulo. Distinct finite ring values therefore produce incorrect convolution inputs and recurrent state without a fault. This expression already exists on the base branch. After the existing pos0 < back guard, compute (pos0 - back) % BLOOMERY_DELTA_RING_ROWS. Apply the same subtraction to the shared oracle's tap, whose current addition also overflows. Add a boundary case checked against independently calculated predecessor slots.
Evidence (at the base of #792):
- crates/metal/kernels/delta.metal:144
- crates/metal/src/kernels/delta.rs:495
- crates/metal/kernels/delta.metal:673
- crates/metal/src/bin/shared/oracle_delta.rs:329
Filed by Shingler, the review bot, while reviewing #792; the defect is outside that pull request.
- Dominant language
- Rust
- Stars
- 21
- Forks
- 4
- Avg merge
- 2h 32m
- Merged PRs (30d)
- 530
Getting set up
- No Dockerfile or Docker Compose file
- Has a 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 midagedev/bloomery
-
review-bot
Difficulty 3/5 1-2 days Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
model
Difficulty 5/5 Over a week Newbie friendliness 25/100
midagedev/bloomery#698 · 3 comments ·
Maintainers usually reply within 1 day
-
model
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
model
Difficulty 5/5 Over a week Newbie friendliness 25/100
midagedev/bloomery#632 · 9 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 1-2 days Newbie friendliness 45/100
midagedev/bloomery#617 · 1 comment ·
Maintainers usually reply within 1 day
All issues in midagedev/bloomery
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
rust-embedded/heapless#694 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
farion1231/cc-switch#8899 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
manuscript-lang/manuscript#1364 ·
Maintainers usually reply within 1 day