Return early on empty range in inplace::views_gone #351
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!351
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-351"
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-27 19:11 UTC · original
ahmetbagci8:fix/gpu-inplace-views-gone-empty→main· +14 −0 · 1 files · 1 commits · merged 2026-11-27 19:24 UTCSummary
In
crates/victory-gpu/src/inplace.rs,views_gone(at, 0)computedend = at.saturating_add(0) = atand calledv.views.range(at.saturating_add(1)..end)whenv.viewswas non-empty, which panics inBTreeMap::range(range start is greater than range end). Even without the panic,firstwould match and remove any view coveringatdespite[at, at + 0)being empty.Changes
len == 0at the start ofviews_gone.views_gone_empty_range_leaves_existing_views_alone.Tested
cargo test -p victory-gpu --lib inplace:9 passed; 0 failed; 0 ignoredcargo clippy -p victory-gpu --tests: clean (0 warnings)@TaynanGT on GitHub · 2026-11-27 19:27 UTC · original
@ahmetbagci8 Merged as
1d83085. The regression test keeps the mapped view for an empty range and still removes it for a non-empty range. Both CI test suites and Clippy passed.