Pool & defaults: add texture block compaction (VICTORY_TEXTURE_COMPACT=1) and separate 6 GB VRAM tier #14

Open
github-bot wants to merge 1 commit from github-bot/gh-14 into main AGit
Owner

@⁠adib-cyber007 on GitHub · 2026-12-03 09:47 UTC · original
adib-cyber007:pr/13-shared-pressure-compact-and-6gb-tier → main · +573 −23 · 7 files · 1 commits · open

Two focused VRAM improvements for 4 GB and 6 GB GPUs (note: residency.rs in this fork already tracks DXGI shared-memory pressure via next_pressure_with_shared_for, so this PR focuses strictly on what is not here yet):

1. Texture block compaction (VICTORY_TEXTURE_COMPACT=1, opt-in)

  • Source: Port of DoubleGhosty/cool_fox 0f7539b0 (PR #197, GPL-3.0).
  • Why for 4–6 GB VRAM: A 16 MiB texture pool heap can only be released back to DXGI once 100% empty. After a scene loads and idle textures are evicted, surviving textures stay scattered across many half-empty blocks, pinning hundreds of MB of dead VRAM.
  • With VICTORY_TEXTURE_COMPACT=1, sparse blocks are marked for draining (Pool::drain), excluded from new allocations (!block.drain), and their remaining textures are seamlessly relocated into other free ranges while slots keep showing their old view until the copy completes (moved). Also adds a 5-second the card's memory by kind: telemetry line in release builds so compaction savings are visible immediately.

2. Separate 6 GB VRAM tier in apps/victory/src/defaults.rs (addresses #1)

  • In #1, an RTX 3060 Mobile 6 GB user reported ~2 GB of dedicated VRAM going unused because defaults.rs grouped every <= 6144 MiB card into the strict 4 GB preset (VICTORY_CARD_BUFFERS_MB=640, VICTORY_TEXTURE_MAX_DIM=512).
  • Splits vram_tier() cleanly into:
    • 4 GB tier (<= 4608 MiB): Exact existing RTX 3050 / RTX 2050 4 GB settings unchanged.
    • 6 GB tier (4608 < MiB <= 6656): VICTORY_CARD_BUFFERS_MB=1536, VICTORY_TEXTURE_MAX_DIM=1024, VICTORY_TEXTURE_ROOM_PERCENT=90 (applied before ALWAYS, while any explicit user/script env var still wins).

Verification

  • All pool::tests (including new drain block-selection, pinning, timeout, and reclaim tests), all 37 descriptor::host tests, all 17 victory bin tests (including vram_tiers_separate_4gb_6gb_and_larger_cards), default workspace check, and --features diagnostics check passed with zero new warnings.
  • Live VRAM compaction & 6 GB tier impact need measurement in-game (VICTORY_TEXTURE_COMPACT=1).
**@⁠adib-cyber007** on GitHub · 2026-12-03 09:47 UTC · [original](https://github.com/ImTaneax/VIctory-RTX3050-4gb/pull/14) `adib-cyber007:pr/13-shared-pressure-compact-and-6gb-tier` → `main` · +573 −23 · 7 files · 1 commits · open Two focused VRAM improvements for 4 GB and 6 GB GPUs (note: `residency.rs` in this fork already tracks DXGI shared-memory pressure via `next_pressure_with_shared_for`, so this PR focuses strictly on what is not here yet): ### 1. Texture block compaction (`VICTORY_TEXTURE_COMPACT=1`, opt-in) - **Source:** Port of `DoubleGhosty/cool_fox` `0f7539b0` (PR #197, GPL-3.0). - **Why for 4–6 GB VRAM:** A 16 MiB texture pool heap can only be released back to DXGI once 100% empty. After a scene loads and idle textures are evicted, surviving textures stay scattered across many half-empty blocks, pinning hundreds of MB of dead VRAM. - With `VICTORY_TEXTURE_COMPACT=1`, sparse blocks are marked for draining (`Pool::drain`), excluded from new allocations (`!block.drain`), and their remaining textures are seamlessly relocated into other free ranges while slots keep showing their old view until the copy completes (`moved`). Also adds a 5-second `the card's memory by kind:` telemetry line in release builds so compaction savings are visible immediately. ### 2. Separate 6 GB VRAM tier in `apps/victory/src/defaults.rs` (addresses #1) - In #1, an RTX 3060 Mobile 6 GB user reported ~2 GB of dedicated VRAM going unused because `defaults.rs` grouped every `<= 6144 MiB` card into the strict 4 GB preset (`VICTORY_CARD_BUFFERS_MB=640`, `VICTORY_TEXTURE_MAX_DIM=512`). - Splits `vram_tier()` cleanly into: - **4 GB tier (`<= 4608 MiB`):** Exact existing RTX 3050 / RTX 2050 4 GB settings unchanged. - **6 GB tier (`4608 < MiB <= 6656`):** `VICTORY_CARD_BUFFERS_MB=1536`, `VICTORY_TEXTURE_MAX_DIM=1024`, `VICTORY_TEXTURE_ROOM_PERCENT=90` (applied before `ALWAYS`, while any explicit user/script env var still wins). ### Verification - All `pool::tests` (including new `drain` block-selection, pinning, timeout, and reclaim tests), all 37 `descriptor::host` tests, all 17 `victory` bin tests (including `vram_tiers_separate_4gb_6gb_and_larger_cards`), default workspace check, and `--features diagnostics` check passed with zero new warnings. - Live VRAM compaction & 6 GB tier impact need measurement in-game (`VICTORY_TEXTURE_COMPACT=1`).
Two focused VRAM optimizations for 4 GB and 6 GB GPUs (GPL-3.0 credited):
1. Texture block compaction (VICTORY_TEXTURE_COMPACT=1, opt-in): Port of DoubleGhosty/cool_fox 0f7539b0 (PR #197). Drains and relocates sparse texture pool blocks while VRAM is over budget so whole 16 MiB heaps actually return to DXGI instead of staying pinned by a few surviving textures, plus adds a 5-second card-memory breakdown log in release builds.
2. Separate 6 GB VRAM tier (apps/victory/src/defaults.rs): Addresses Issue #1 (RTX 3060 Mobile 6 GB report) by separating 6 GB cards (4608 < MiB <= 6656: VICTORY_CARD_BUFFERS_MB=1536, VICTORY_TEXTURE_MAX_DIM=1024, VICTORY_TEXTURE_ROOM_PERCENT=90) from strict 4 GB limits (<= 4608 MiB).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 09:52:21 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/14/head:github-bot/gh-14'
git switch 'github-bot/gh-14'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-14'
git switch 'github-bot/gh-14'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-14'
git switch 'github-bot/gh-14'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-14'
git switch 'main'
git merge --squash 'github-bot/gh-14'
git switch 'main'
git merge --ff-only 'github-bot/gh-14'
git switch 'main'
git merge 'github-bot/gh-14'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.