gpu: guard empty/overflowing ranges in descriptor, texback, port, and shadow #495

Open
ahmetbagci8 wants to merge 1 commit from upstream-pr/495 into main
ahmetbagci8 commented 2026-12-01 17:11:39 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by ahmetbagci8 on 2026-12-01T17:11:39Z.


Rebuilt on the new main line (per #468) consolidating our previously reviewed GPU range/bounds fixes (#438, #453, #454, #455):

Fixes

  1. descriptor::in_shader_heap: Return alse on len == 0 and use saturating_add.
  2. ** exback::remapped, port::forget, port::touches:** Return early on len == 0.
  3. port::committed: Use checked_add(len) and a
    ext <= here forward-progress guard.
  4. shadow::joined_piece_runs: Sort by (r.first, r.from) and preserve last.from = last.from.min(run.from) when merging spans in the same piece.

Verification

  • cargo test -p vice-tay-gpu --lib -- texback::tests port::tests (8 passed, 0 failed)
  • cargo clippy -p vice-tay-gpu --tests (0 warnings)
<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5590650220 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/495). Originally posted by [ahmetbagci8](https://github.com/ahmetbagci8) on 2026-12-01T17:11:39Z. --- Rebuilt on the new main line (per #468) consolidating our previously reviewed GPU range/bounds fixes (#438, #453, #454, #455): ## Fixes 1. **descriptor::in_shader_heap:** Return alse on len == 0 and use saturating_add. 2. ** exback::remapped, port::forget, port::touches:** Return early on len == 0. 3. **port::committed:** Use checked_add(len) and a ext <= here forward-progress guard. 4. **shadow::joined_piece_runs:** Sort by (r.first, r.from) and preserve last.from = last.from.min(run.from) when merging spans in the same piece. ## Verification - cargo test -p vice-tay-gpu --lib -- texback::tests port::tests (8 passed, 0 failed) - cargo clippy -p vice-tay-gpu --tests (0 warnings)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/495:upstream-pr/495'
git switch 'upstream-pr/495'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/495'
git switch 'upstream-pr/495'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/495'
git switch 'upstream-pr/495'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/495'
git switch 'main'
git merge --squash 'upstream-pr/495'
git switch 'main'
git merge --ff-only 'upstream-pr/495'
git switch 'main'
git merge 'upstream-pr/495'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
TaynanGT/Vice-Tay!495
No description provided.