fix(victory-gpu): clear stale same-kind subranges in titlemem and add tests #419

Closed
github-bot wants to merge 1 commit from github-bot/gh-419 into main AGit
Owner

@⁠Lewandox on GitHub · 2026-11-26 18:03 UTC · original
Lewandox:fix/titlemem-cleanup-overlapping-ranges → main · +50 −3 · 1 files · 1 commits · closed without merging

Summary

Improves memory range hygiene and adds unit test coverage in third_party/victory/crates/victory-gpu/src/titlemem.rs:

  1. Avoid stale overlapping entries when ranges are replaced:
    • When title_range inserts [base, base + size), any previously tracked range that started inside (base, base + size) from an earlier allocation at the same region is cleared so RANGES cannot accumulate stale sub-ranges.
    • title_range with size == 0 removes any stale entry at base instead of leaving it behind.
  2. Unit tests:
    • Adds unit tests for title_range, title_range_free, forget_if_stale (verifying only VIRTUAL ranges are removed), snapshot ordering, and overlapping-entry cleanup.

Verification

  • cargo test -p victory-gpu --lib titlemem::tests (default and --features diagnostics)
  • cargo xtask policy inside third_party/victory
**@⁠Lewandox** on GitHub · 2026-11-26 18:03 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/419) `Lewandox:fix/titlemem-cleanup-overlapping-ranges` → `main` · +50 −3 · 1 files · 1 commits · closed without merging ## Summary Improves memory range hygiene and adds unit test coverage in `third_party/victory/crates/victory-gpu/src/titlemem.rs`: 1. **Avoid stale overlapping entries when ranges are replaced**: - When `title_range` inserts `[base, base + size)`, any previously tracked range that started inside `(base, base + size)` from an earlier allocation at the same region is cleared so `RANGES` cannot accumulate stale sub-ranges. - `title_range` with `size == 0` removes any stale entry at `base` instead of leaving it behind. 2. **Unit tests**: - Adds unit tests for `title_range`, `title_range_free`, `forget_if_stale` (verifying only `VIRTUAL` ranges are removed), `snapshot` ordering, and overlapping-entry cleanup. ## Verification - `cargo test -p victory-gpu --lib titlemem::tests` (default and `--features diagnostics`) - `cargo xtask policy` inside `third_party/victory`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:03:33 +00:00
github-bot closed this pull request 2026-11-26 19:34:47 +00:00
Author
Owner

@⁠Lewandox on GitHub · 2026-11-26 19:16 UTC · original

Closing as obsolete after #409 (\ itlemem.rs\ was removed in the combined base). Keeping the PR queue clean.

**@⁠Lewandox** on GitHub · 2026-11-26 19:16 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/419#issuecomment-7201387864) Closing as obsolete after #409 (\ itlemem.rs\ was removed in the combined base). Keeping the PR queue clean.

Pull request closed

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