Return early on empty ranges in texback::remapped, port::forget, and port::touches #454

Closed
github-bot wants to merge 660 commits from github-bot/gh-454 into main AGit
Owner

@⁠ahmetbagci8 on GitHub · 2026-11-29 18:18 UTC · original
ahmetbagci8:fix/gpu-empty-range-texback-port → main · +60034 −5429 · 206 files · 660 commits · closed without merging

Problem

In crates/victory-gpu/src/texback.rs (
emapped) and crates/victory-gpu/src/port.rs ( orget and ouches), half-open range checks did not return early when len == 0:

  • exback::remapped(at, 0) evaluated t < ticket.end && ticket.at < at to rue for any ticket with icket.at < at < ticket.end, falsely invalidating a live readback ticket.
  • port::forget(at, 0) evicted any live region strictly containing t, and port::touches(at, 0) returned rue when BOUNDS[0] < at < BOUNDS[1].

Fix

Return early on len == 0 in exback::remapped, port::forget, and port::touches, with unit tests covering each case.

Verification

  • cargo test -p victory-gpu --lib -- texback::tests port::tests (4 passed, 0 failed)
  • cargo clippy -p victory-gpu --tests (0 warnings)
**@⁠ahmetbagci8** on GitHub · 2026-11-29 18:18 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/454) `ahmetbagci8:fix/gpu-empty-range-texback-port` → `main` · +60034 −5429 · 206 files · 660 commits · closed without merging ## Problem In crates/victory-gpu/src/texback.rs ( emapped) and crates/victory-gpu/src/port.rs ( orget and ouches), half-open range checks did not return early when len == 0: - exback::remapped(at, 0) evaluated t < ticket.end && ticket.at < at to rue for any ticket with icket.at < at < ticket.end, falsely invalidating a live readback ticket. - port::forget(at, 0) evicted any live region strictly containing t, and port::touches(at, 0) returned rue when BOUNDS[0] < at < BOUNDS[1]. ## Fix Return early on len == 0 in exback::remapped, port::forget, and port::touches, with unit tests covering each case. ## Verification - cargo test -p victory-gpu --lib -- texback::tests port::tests (4 passed, 0 failed) - cargo clippy -p victory-gpu --tests (0 warnings)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 18:23:34 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 19:09 UTC · original

Thanks for the consistent half-open range handling. I checked the diff: empty remaps preserve live readback tickets and empty forgets preserve registered regions. The positive nonempty invalidation tests should remain alongside these regressions.

**@⁠TaynanGT** on GitHub · 2026-11-29 19:09 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/454#issuecomment-7261051954) Thanks for the consistent half-open range handling. I checked the diff: empty remaps preserve live readback tickets and empty forgets preserve registered regions. The positive nonempty invalidation tests should remain alongside these regressions.
github-bot closed this pull request 2026-11-30 17:08:30 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:05 UTC · original

main has 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 current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:05 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/454#issuecomment-7285712219) `main` has 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 current `main` and open a new PR; I'll review it there.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.