Bound Bits::any and Bits::all to the representable block limit #458
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
old-names
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!458
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-458"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ahmetbagci8 on GitHub · 2026-11-29 20:47 UTC · original
ahmetbagci8:fix/gpu-watch-bits-bounds→main· +60034 −5429 · 206 files · 660 commits · closed without mergingProblem
In crates/victory-gpu/src/watch.rs, unlike Bits::set_in which clamps last to Bits::PIECES * Bits::WORDS * 64, neither Bits::any nor Bits::all bounds last:
@Kal0s-design on GitHub · 2026-11-29 20:52 UTC · original · reviewed
Read against main's
Bits. The change is correct:anynow clampslasttoPIECES * WORDS * 64(2^31 blocks), asset_inalready does. Below that bound the loop is unchanged, and theNonebranch's jump to the next piece can no longer overflow, sincewordstays belowPIECES * WORDS. A range starting at or past the bound returns false without entering the loop.allreturning false forlastpast the bound matches what it already answered there whenever it got that far:piece()isNonebeyond the table (self.0.get(..)?), which is the existing!BITS.all(1 << 40, (1 << 40) + 1)case. Only the overflowing arithmetic nearusize::MAXis new behaviour.allassertions in the bits tests still hold, and the new test adds positive in-range cases next to the boundary ones.For context: a 64 KiB block index of a user-mode address (below 2^47) stays within 2^31, so the runtime's own callers don't reach the clamp. This guards the arithmetic, not a live path. CI is green.
AI-assisted: yes
@TaynanGT on GitHub · 2026-11-30 17:05 UTC · original
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Pull request closed