[pr-performance][pr-fix][textures] Prioritize missing/fresh textures over speculative rechecks (7:1 newest bias), lift park VRAM target under live FrameGen, and fix park_report argument order #528

Closed
MasterWolf wants to merge 4 commits from (deleted):pr/texture-streaming-priority-and-park-vram into Main
First-time contributor

Contributor role (optional)

  • Fluxer ID: 1577824307575267331

What it changes

  • The problem on main:

    1. crates/darner-gpu/src/descriptor/host.rs (Due::ordered_with): With DARNER_SAMPLED_MARKS=0 (on by default), hot_slot() always returns false, so hot is empty. All remaining again entries — including 3,966–7,278 already-uploaded textures queued only for speculative FLAG_CHECKED fingerprint rechecks (checked_pos != NO_CHECKED) — were served before brand-new un-uploaded fresh textures. Furthermore, fresh interleaved 1:1 newest-to-oldest (top_n = need.div_ceil(2), bot_n = need / 2), spending half of every frame's upload budget on stale entries (observed up to 13,902 frames ago in a 6-minute run) instead of recently written near-player textures.
    2. crates/darner-gpu/src/pool.rs (park_card_target_with_buffers): resource::room_line_for stops double-counting DARNER_FRAMEGEN_ROOM_RESERVE on >= 13 GiB GPUs once framegen_live() is true (since FrameGen's ~1.5–2 GiB allocation is already included in DXGI used), but pool::park_card_target_with_buffers lacked that adjustment. On an RTX 5070 Ti (14,056 MB DXGI budget), park_card_target() stayed stuck at 11,245 MB (80%) with >2.1 GiB of GDDR7 unused, forcing 3,391–4,077 newly streamed textures (1,408 MB) into PC shared RAM over PCIe and spiking GPU frame time to 23.8 ms.
    3. crates/darner-gpu/src/pool.rs (park_report): The format arguments card_refused, held, out_n, mb(out_bytes), back_n, mb(back_bytes) were shifted relative to the format string placeholders (moves (DARNER_TEX_PARK=2): card copies parked {} ({} MB), parked copies brought back to the card {} ({} MB); slot makes refused for card room {} (the aim: 0), slots held {} (the aim: 0)), printing DARNER_TEX_PARK=2 counters in the wrong fields.
  • What this does:

    1. Partitions remaining again in Due::ordered_with into missing_again (checked_pos == NO_CHECKED) and checked_rechecks (checked_pos != NO_CHECKED), serving: (1) texres=2 recheck share & hot missing/fresh (unchanged) -> (2) missing_again (newest write first) -> (3) fresh at a 7:1 newest-to-oldest ratio (FRESH_OLD_DIVISOR = 8, emit_fresh_interleaved, keeping a 12.5% anti-starvation tail) -> (4) checked_rechecks last (newest write first).
    2. Adds park_target_with_framegen_live, mirroring resource::room_line_for (normal.saturating_sub(512 << 20) on budget >= PARK_LESS_BIG once framegen_live() is true, respecting DARNER_FRAMEGEN_LIVE_ROOM and explicit DARNER_TEX_PARK_CARD_MB). On an RTX 5070 Ti (14,138 MB budget), this lifts park_card_target from 11,245 MB to 12,858 MB.
    3. Reorders the park_report arguments to out_n, mb(out_bytes), back_n, mb(back_bytes), card_refused, held.

How it was tested

  • Tested revision: c8258f9 + this PR (2a58622 locally / 253e220 on fork)

  • Commands and results:

    • cargo xtask policy: 576 files ok
    • cargo clippy --locked -p darner-gpu --all-targets -- -D warnings: 0 warnings
    • cargo clippy --locked -p darner-gpu --all-features --all-targets -- -D warnings: 0 warnings
    • cargo test --locked -p darner-gpu -- --skip oracle64: 1,807 passed; 0 failed; 81 ignored (including new missing_fresh_textures_precede_checked_rechecks_and_bias_newest & park_target_lifts_once_framegen_is_live_on_big_cards, plus updated due_ordered_truncation_matches_full_sort, hot_missing_textures_precede_checked_rechecks, and the_texture_queue_serves_the_newest_writes_first).
  • Changes a default: yes — Due::ordered_with ordering affects all runs; park_target_with_framegen_live affects >= 13 GiB GPUs with DARNER_TEX_PARK and live FrameGen; park_report changes diagnostic log formatting only.

  • A/B telemetry note: Full gameplay runs (darner-play-20261205-063041-36996.log -> darner-play-20261205-071246-19076.log, ~30k frames each) also changed runtime switches (DARNER_TEX_PARK=2, DARNER_POOL_TRIM=1, DARNER_PAGE_DEAD_S=15, DARNER_DUE_INDEX=1, DARNER_TEXSPK_PASS_MS=16, removed DARNER_PRESENT_SENT=1) and included PR #332 drain tuning, so whole-run FPS (23.1 -> 26.8 median FPS, 5.7 -> 20.5 min FPS) reflects the combined setup; isolated per-subsystem counters directly attributable to this PR:

    Metric (RTX 5070 Ti 16 GB, Series X, 1080to1440, DLSS Quality + MFG 3x, High textures) Before (063041) After (071246)
    park_card_target under live MFG 11,245 MB (14,056 MB budget) 12,858 MB (14,138 MB budget)
    Parked textures in PC RAM 3,391–4,077 (1,408 MB) 176 (80 MB)
    Texture queue backlog at 30k frames 335 due (oldest 13,902 frames) 0 due (oldest 0 frames)
  • Gates run on that revision: all three gates above passed on pr/texture-streaming-priority-and-park-vram.

  • Gameplay: NVIDIA GeForce RTX 5070 Ti 16 GB, Intel Core Ultra 7 265KF, 64 GB DDR5-6400, Series X profile, 1080to1440, DLSS Quality, DLSS MFG 3x, RT off.

  • Shader wave sizes tested: 32 and 64 lanes (DARNER_EXACT64=71883e40620a567a+7168dd781ca7efb9, DARNER_SAMPLED_MARKS=0).

  • Hardware dependence: Due::ordered_with is general; park_target_with_framegen_live targets >= 13 GiB VRAM cards (< PARK_LESS_BIG unchanged, unit-tested).

  • Coverage gaps: In-game gameplay verified on RTX 5070 Ti 16 GB with Series X + MFG 3x; 12 GB NVIDIA and AMD GPUs were not runtime-tested (unit tests cover < PARK_LESS_BIG).

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #332, #489
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: 1577824307575267331 ## What it changes - The problem on main: 1. `crates/darner-gpu/src/descriptor/host.rs` (`Due::ordered_with`): With `DARNER_SAMPLED_MARKS=0` (on by default), `hot_slot()` always returns `false`, so `hot` is empty. All remaining `again` entries — including 3,966–7,278 already-uploaded textures queued only for speculative `FLAG_CHECKED` fingerprint rechecks (`checked_pos != NO_CHECKED`) — were served *before* brand-new un-uploaded `fresh` textures. Furthermore, `fresh` interleaved 1:1 newest-to-oldest (`top_n = need.div_ceil(2)`, `bot_n = need / 2`), spending half of every frame's upload budget on stale entries (observed up to `13,902 frames ago` in a 6-minute run) instead of recently written near-player textures. 2. `crates/darner-gpu/src/pool.rs` (`park_card_target_with_buffers`): `resource::room_line_for` stops double-counting `DARNER_FRAMEGEN_ROOM_RESERVE` on `>= 13 GiB` GPUs once `framegen_live()` is true (since FrameGen's ~1.5–2 GiB allocation is already included in DXGI `used`), but `pool::park_card_target_with_buffers` lacked that adjustment. On an RTX 5070 Ti (`14,056 MB` DXGI budget), `park_card_target()` stayed stuck at `11,245 MB` (80%) with >2.1 GiB of GDDR7 unused, forcing 3,391–4,077 newly streamed textures (`1,408 MB`) into PC shared RAM over PCIe and spiking GPU frame time to `23.8 ms`. 3. `crates/darner-gpu/src/pool.rs` (`park_report`): The format arguments `card_refused, held, out_n, mb(out_bytes), back_n, mb(back_bytes)` were shifted relative to the format string placeholders (`moves (DARNER_TEX_PARK=2): card copies parked {} ({} MB), parked copies brought back to the card {} ({} MB); slot makes refused for card room {} (the aim: 0), slots held {} (the aim: 0)`), printing `DARNER_TEX_PARK=2` counters in the wrong fields. - What this does: 1. Partitions remaining `again` in `Due::ordered_with` into `missing_again` (`checked_pos == NO_CHECKED`) and `checked_rechecks` (`checked_pos != NO_CHECKED`), serving: (1) `texres=2` recheck share & `hot` missing/fresh (unchanged) -> (2) `missing_again` (newest write first) -> (3) `fresh` at a **7:1** newest-to-oldest ratio (`FRESH_OLD_DIVISOR = 8`, `emit_fresh_interleaved`, keeping a 12.5% anti-starvation tail) -> (4) `checked_rechecks` last (newest write first). 2. Adds `park_target_with_framegen_live`, mirroring `resource::room_line_for` (`normal.saturating_sub(512 << 20)` on `budget >= PARK_LESS_BIG` once `framegen_live()` is true, respecting `DARNER_FRAMEGEN_LIVE_ROOM` and explicit `DARNER_TEX_PARK_CARD_MB`). On an RTX 5070 Ti (`14,138 MB` budget), this lifts `park_card_target` from `11,245 MB` to `12,858 MB`. 3. Reorders the `park_report` arguments to `out_n, mb(out_bytes), back_n, mb(back_bytes), card_refused, held`. ## How it was tested - Tested revision: `c8258f9` + this PR (`2a58622` locally / `253e220` on fork) - Commands and results: - `cargo xtask policy`: `576 files ok` - `cargo clippy --locked -p darner-gpu --all-targets -- -D warnings`: 0 warnings - `cargo clippy --locked -p darner-gpu --all-features --all-targets -- -D warnings`: 0 warnings - `cargo test --locked -p darner-gpu -- --skip oracle64`: `1,807 passed; 0 failed; 81 ignored` (including new `missing_fresh_textures_precede_checked_rechecks_and_bias_newest` & `park_target_lifts_once_framegen_is_live_on_big_cards`, plus updated `due_ordered_truncation_matches_full_sort`, `hot_missing_textures_precede_checked_rechecks`, and `the_texture_queue_serves_the_newest_writes_first`). - Changes a default: yes — `Due::ordered_with` ordering affects all runs; `park_target_with_framegen_live` affects `>= 13 GiB` GPUs with `DARNER_TEX_PARK` and live FrameGen; `park_report` changes diagnostic log formatting only. - A/B telemetry note: Full gameplay runs (`darner-play-20261205-063041-36996.log` -> `darner-play-20261205-071246-19076.log`, ~30k frames each) also changed runtime switches (`DARNER_TEX_PARK=2`, `DARNER_POOL_TRIM=1`, `DARNER_PAGE_DEAD_S=15`, `DARNER_DUE_INDEX=1`, `DARNER_TEXSPK_PASS_MS=16`, removed `DARNER_PRESENT_SENT=1`) and included PR #332 drain tuning, so whole-run FPS (`23.1 -> 26.8` median FPS, `5.7 -> 20.5` min FPS) reflects the combined setup; isolated per-subsystem counters directly attributable to this PR: | Metric (RTX 5070 Ti 16 GB, Series X, `1080to1440`, DLSS Quality + MFG 3x, High textures) | Before (`063041`) | After (`071246`) | |---|---|---| | `park_card_target` under live MFG | `11,245 MB` (`14,056 MB` budget) | `12,858 MB` (`14,138 MB` budget) | | Parked textures in PC RAM | `3,391–4,077` (`1,408 MB`) | `176` (`80 MB`) | | Texture queue backlog at 30k frames | `335` due (oldest `13,902 frames`) | `0` due (oldest `0 frames`) | - Gates run on that revision: all three gates above passed on `pr/texture-streaming-priority-and-park-vram`. - Gameplay: NVIDIA GeForce RTX 5070 Ti 16 GB, Intel Core Ultra 7 265KF, 64 GB DDR5-6400, Series X profile, `1080to1440`, DLSS Quality, DLSS MFG 3x, RT off. - Shader wave sizes tested: 32 and 64 lanes (`DARNER_EXACT64=71883e40620a567a+7168dd781ca7efb9`, `DARNER_SAMPLED_MARKS=0`). - Hardware dependence: `Due::ordered_with` is general; `park_target_with_framegen_live` targets `>= 13 GiB` VRAM cards (`< PARK_LESS_BIG` unchanged, unit-tested). - Coverage gaps: In-game gameplay verified on RTX 5070 Ti 16 GB with Series X + MFG 3x; 12 GB NVIDIA and AMD GPUs were not runtime-tested (unit tests cover `< PARK_LESS_BIG`). ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #332, #489 - Replaces or overlaps: none found
Contributor

I tested Due::ordered_with from 253e220 against c8258f9 on Windows. With 4,096 checked rechecks and 3,083 fresh slots, marks off and no reserved recheck share, the first 64 slots changed from 64 rechecks on main to 64 fresh slots here. That reproduces the intended priority improvement.

I also found a starvation case when a pass exhausts its time or byte budget early. Start with 128 fresh slots in write order, call ordered_with(4096, 0, |_| false), remove only the first four returned slots and append four newer writes. Repeat for 240 passes. Main served the oldest slot on pass 1. This head left it pending after pass 240. The same happened with two or seven serviced per pass. With eight, this head served the oldest on pass 1. I saw the same outcome with a selection limit of 64, which exercises the partial-selection path.

A local variation kept the 7:1 allocation and ordered each complete group as one newest, one oldest, then six newest. It kept all 64 fresh selections in the mixed test and served the oldest on pass 1 at two, four and seven. A budget of one still needs rotation across passes to guarantee progress. Could you add the short-pass case to the ordering test? These results cover CPU queue selection with synthetic slots. In-game texture visibility, FrameGen and parking were outside this check.

I tested `Due::ordered_with` from `253e220` against `c8258f9` on Windows. With 4,096 checked rechecks and 3,083 fresh slots, marks off and no reserved recheck share, the first 64 slots changed from 64 rechecks on main to 64 fresh slots here. That reproduces the intended priority improvement. I also found a starvation case when a pass exhausts its time or byte budget early. Start with 128 fresh slots in write order, call `ordered_with(4096, 0, |_| false)`, remove only the first four returned slots and append four newer writes. Repeat for 240 passes. Main served the oldest slot on pass 1. This head left it pending after pass 240. The same happened with two or seven serviced per pass. With eight, this head served the oldest on pass 1. I saw the same outcome with a selection limit of 64, which exercises the partial-selection path. A local variation kept the 7:1 allocation and ordered each complete group as one newest, one oldest, then six newest. It kept all 64 fresh selections in the mixed test and served the oldest on pass 1 at two, four and seven. A budget of one still needs rotation across passes to guarantee progress. Could you add the short-pass case to the ordering test? These results cover CPU queue selection with synthetic slots. In-game texture visibility, FrameGen and parking were outside this check.
Contributor

I tested the one-upload case on 253e220. With 128 fresh slots, one new write for each upload, selection limit 1, and 240 passes, the oldest slot was never served. The same happened with a limit of 64 and a repeating actual budget of 1, 0, 4, 2, 0, 7. That second case serviced 560 slots without picking the oldest once.

I tried carrying the 7:1 phase across passes. Start at zero, select oldest when (phase + position) % 8 == 7, and advance the phase only by the number of fresh entries actually serviced. For a selection of take entries, reserve (phase + take) / 8 from the oldest end. This matters when fewer than eight entries are requested, as well as when a longer selection is cut short.

Across selection limits 1, 2, 4, 7, 8, 64 and 4096 and five actual-service patterns, the first oldest pick landed on the eighth serviced slot in all 35 cases, with no duplicate slot/version selections. With a budget of one it made 30 oldest picks in 240 uploads. With the mixed budget and limit 64 it made 70 in 560. Empty passes consumed no phase. These tests used the PR's Rust ordering function and a synthetic service loop. A production implementation would need the service count from the fresh part of the upload pass.

I tested the one-upload case on `253e220`. With 128 fresh slots, one new write for each upload, selection limit 1, and 240 passes, the oldest slot was never served. The same happened with a limit of 64 and a repeating actual budget of 1, 0, 4, 2, 0, 7. That second case serviced 560 slots without picking the oldest once. I tried carrying the 7:1 phase across passes. Start at zero, select oldest when `(phase + position) % 8 == 7`, and advance the phase only by the number of fresh entries actually serviced. For a selection of `take` entries, reserve `(phase + take) / 8` from the oldest end. This matters when fewer than eight entries are requested, as well as when a longer selection is cut short. Across selection limits 1, 2, 4, 7, 8, 64 and 4096 and five actual-service patterns, the first oldest pick landed on the eighth serviced slot in all 35 cases, with no duplicate slot/version selections. With a budget of one it made 30 oldest picks in 240 uploads. With the mixed budget and limit 64 it made 70 in 560. Empty passes consumed no phase. These tests used the PR's Rust ordering function and a synthetic service loop. A production implementation would need the service count from the fresh part of the upload pass.
Author
First-time contributor

Thanks @holoslicer — great catch and super helpful reproduction of the < 8 / mixed-budget starvation edge case!

Updated pr/texture-streaming-priority-and-park-vram to carry the 7:1 fresh interleaver phase across passes (rather than resetting phase = 0 per pass):

  • Due::ordered_with_phase / emit_fresh_interleaved (crates/darner-gpu/src/descriptor/host.rs): computes bot_n = (phase + take) / 8, picks from the oldest end at (phase + pos) % 8 == 7, and returns fresh_range (the cold fresh sub-range of order).
  • HostHeap::fresh_phase (AtomicUsize): loaded when collecting due slots and advanced via HostHeap::advance_fresh_phase(serviced) after tells.flush() using tells.fresh_serviced (crates/darner-gpu/src/draw.rs), so only cold fresh slots actually processed (accounting for urgent reordering, early breaks, and claim skips; 0 on empty/aborted slots) advance the phase.
  • Added fresh_phase_rotation_prevents_starvation_on_short_passes covering all 7 selection limits [1, 2, 4, 7, 8, 64, 4096] x 5 fixed budgets [1, 2, 4, 7, 8] + repeating mixed budgets [1, 0, 4, 2, 0, 7].

Verification on updated head:

  • cargo xtask policy (576 files ok)
  • cargo clippy --locked --all-targets -- -D warnings and --all-features (0 warnings)
  • cargo test --locked -p darner-gpu -- --skip oracle64: 1,808 passed, 0 failed (including all 95 tests in descriptor::host::tests).
Thanks `@holoslicer` — great catch and super helpful reproduction of the `< 8` / mixed-budget starvation edge case! Updated `pr/texture-streaming-priority-and-park-vram` to carry the 7:1 `fresh` interleaver `phase` across passes (rather than resetting `phase = 0` per pass): - `Due::ordered_with_phase` / `emit_fresh_interleaved` (`crates/darner-gpu/src/descriptor/host.rs`): computes `bot_n = (phase + take) / 8`, picks from the oldest end at `(phase + pos) % 8 == 7`, and returns `fresh_range` (the cold `fresh` sub-range of `order`). - `HostHeap::fresh_phase` (`AtomicUsize`): loaded when collecting due slots and advanced via `HostHeap::advance_fresh_phase(serviced)` after `tells.flush()` using `tells.fresh_serviced` (`crates/darner-gpu/src/draw.rs`), so only cold `fresh` slots actually processed (accounting for urgent reordering, early `break`s, and claim skips; 0 on empty/aborted slots) advance the phase. - Added `fresh_phase_rotation_prevents_starvation_on_short_passes` covering all 7 selection limits `[1, 2, 4, 7, 8, 64, 4096]` x 5 fixed budgets `[1, 2, 4, 7, 8]` + repeating mixed budgets `[1, 0, 4, 2, 0, 7]`. Verification on updated head: - `cargo xtask policy` (576 files ok) - `cargo clippy --locked --all-targets -- -D warnings` and `--all-features` (0 warnings) - `cargo test --locked -p darner-gpu -- --skip oracle64`: `1,808 passed, 0 failed` (including all 95 tests in `descriptor::host::tests`).
Contributor

Two follow-ups on 326b1799 after the phase fix. Both are from source review and CPU models.

  • Overlapping passes can still lose the oldest turn. texture/claim.rs documents that two passes can read the same queue head before either flushes, with claims off by default. Tells::tell increments fresh_serviced before the queue applies the (slot, write) result. Two phase-zero passes that both take the same four fresh slots can therefore advance the phase by eight even though only four Done(None) removals match. In a model with 128 fresh writes, four new arrivals per pair, and 240 pairs, the oldest was still pending after 960 unique removals. A test with two overlapping snapshots would cover the gap in the sequential test. The phase should account for accepted service of a cold entry, including whether the old turn was actually consumed.
  • Live FrameGen can override an explicit park percentage. pool.rs:1069–1094 applies the lift when DARNER_TEX_PARK_CARD_MB is absent, even if DARNER_TEX_PARK_PERCENT was supplied. With a 14 GiB DXGI budget, DARNER_TEX_PARK_PERCENT=60, the FrameGen reserve marker, live FrameGen, and no other reserves, the model takes the target from 8601.6 to 13056 MiB. I would preserve the explicit park percentage as well as the explicit MB cap, while keeping the lift for the automatic target.

Reviewed with Codex and Claude Code. No gameplay or GPU measurement for these cases.

Two follow-ups on `326b1799` after the phase fix. Both are from source review and CPU models. - **Overlapping passes can still lose the oldest turn.** `texture/claim.rs` documents that two passes can read the same queue head before either flushes, with claims off by default. `Tells::tell` increments `fresh_serviced` before the queue applies the `(slot, write)` result. Two phase-zero passes that both take the same four fresh slots can therefore advance the phase by eight even though only four `Done(None)` removals match. In a model with 128 fresh writes, four new arrivals per pair, and 240 pairs, the oldest was still pending after 960 unique removals. A test with two overlapping snapshots would cover the gap in the sequential test. The phase should account for accepted service of a cold entry, including whether the old turn was actually consumed. - **Live FrameGen can override an explicit park percentage.** `pool.rs:1069–1094` applies the lift when `DARNER_TEX_PARK_CARD_MB` is absent, even if `DARNER_TEX_PARK_PERCENT` was supplied. With a 14 GiB DXGI budget, `DARNER_TEX_PARK_PERCENT=60`, the FrameGen reserve marker, live FrameGen, and no other reserves, the model takes the target from 8601.6 to 13056 MiB. I would preserve the explicit park percentage as well as the explicit MB cap, while keeping the lift for the automatic target. Reviewed with Codex and Claude Code. No gameplay or GPU measurement for these cases.
Author
First-time contributor

Thanks @tyr0nsur — both points are spot on. Implemented and verified locally on pr/texture-streaming-priority-and-park-vram (aa41582; will push when back at the keyboard for push/upload confirmation):

  1. Overlapping passes / fresh_phase accounting (crates/darner-gpu/src/descriptor/host.rs, crates/darner-gpu/src/draw.rs):

    • Tells::tell now carries is_fresh: bool (fresh_range.contains(&pos)) into TextureQueue::apply_told (called by both HostHeap::texture_slots_told and HostHeap::texture_slot_tell_one), which checks is_unserviced_fresh(index, write) (looks == 0, no FLAG_MAPPED | FLAG_SOON | FLAG_CHECKED, and not in self.held) before applying the transition.
    • HostHeap::advance_fresh_phase now receives only accepted unique cold-fresh transitions under TextureQueue's lock, so overlapping snapshots on the same (slot, write) never double-advance fresh_phase.
    • Added overlapping_passes_do_not_double_advance_fresh_phase reproducing the 128-slot / 4-per-pair / 240-pair (960 unique removals) schedule: confirms slot 0 is served on the 8th unique removal and fresh_phase == 960.
  2. Preserve explicit DARNER_TEX_PARK_PERCENT (crates/darner-gpu/src/pool.rs):

    • Extracted park_target_resolved and gated park_target_with_framegen_live on given.is_none() && !explicit_percent so explicit DARNER_TEX_PARK_PERCENT (like explicit DARNER_TEX_PARK_CARD_MB) is never overridden by the FrameGen live lift.
    • Added the 14 GiB + DARNER_TEX_PARK_PERCENT=60 assertion to park_target_lifts_once_framegen_is_live_on_big_cards (stays 60%, whereas automatic 80% lifts to 13,056 MiB).

Local checks on aa41582: cargo xtask policy (576 files ok), clippy --all-targets -- -D warnings (default & --all-features, 0 warnings), cargo test --locked -p darner-gpu -- --skip oracle64 (1,809 passed, 0 failed).

Thanks `@tyr0nsur` — both points are spot on. Implemented and verified locally on `pr/texture-streaming-priority-and-park-vram` (`aa41582`; will push when back at the keyboard for push/upload confirmation): 1. **Overlapping passes / `fresh_phase` accounting** (`crates/darner-gpu/src/descriptor/host.rs`, `crates/darner-gpu/src/draw.rs`): - `Tells::tell` now carries `is_fresh: bool` (`fresh_range.contains(&pos)`) into `TextureQueue::apply_told` (called by both `HostHeap::texture_slots_told` and `HostHeap::texture_slot_tell_one`), which checks `is_unserviced_fresh(index, write)` (`looks == 0`, no `FLAG_MAPPED | FLAG_SOON | FLAG_CHECKED`, and not in `self.held`) before applying the transition. - `HostHeap::advance_fresh_phase` now receives only accepted unique cold-`fresh` transitions under `TextureQueue`'s lock, so overlapping snapshots on the same `(slot, write)` never double-advance `fresh_phase`. - Added `overlapping_passes_do_not_double_advance_fresh_phase` reproducing the 128-slot / 4-per-pair / 240-pair (960 unique removals) schedule: confirms slot 0 is served on the 8th unique removal and `fresh_phase == 960`. 2. **Preserve explicit `DARNER_TEX_PARK_PERCENT`** (`crates/darner-gpu/src/pool.rs`): - Extracted `park_target_resolved` and gated `park_target_with_framegen_live` on `given.is_none() && !explicit_percent` so explicit `DARNER_TEX_PARK_PERCENT` (like explicit `DARNER_TEX_PARK_CARD_MB`) is never overridden by the FrameGen live lift. - Added the 14 GiB + `DARNER_TEX_PARK_PERCENT=60` assertion to `park_target_lifts_once_framegen_is_live_on_big_cards` (stays `60%`, whereas automatic `80%` lifts to `13,056 MiB`). Local checks on `aa41582`: `cargo xtask policy` (576 files ok), `clippy --all-targets -- -D warnings` (default & `--all-features`, 0 warnings), `cargo test --locked -p darner-gpu -- --skip oracle64` (`1,809 passed, 0 failed`).
Contributor

I retested the updated selector at 326b1799 against c8258f95 on Windows using the production ordering function and generated queue entries. Each pass could select 4,096 entries and service two. With a continuing supply of speculative fingerprint rechecks and 16 ordinary new writes, main serviced 0 of the 16 in 120 passes. This revision serviced all 16 and picked the oldest by pass five.

A separate control used unchecked retries for previously absent backing memory. With that traffic, a returned, previously streamed-out slot and all 16 ordinary writes still waited through 120 passes on both revisions. With the retry traffic removed, the returned slot was selected on the first pass on both. I am testing the returned-slot case independently using the queue lifecycle. This result covers offline selection and gives no gameplay FPS measurement.

I retested the updated selector at `326b1799` against `c8258f95` on Windows using the production ordering function and generated queue entries. Each pass could select 4,096 entries and service two. With a continuing supply of speculative fingerprint rechecks and 16 ordinary new writes, main serviced 0 of the 16 in 120 passes. This revision serviced all 16 and picked the oldest by pass five. A separate control used unchecked retries for previously absent backing memory. With that traffic, a returned, previously streamed-out slot and all 16 ordinary writes still waited through 120 passes on both revisions. With the retry traffic removed, the returned slot was selected on the first pass on both. I am testing the returned-slot case independently using the queue lifecycle. This result covers offline selection and gives no gameplay FPS measurement.
Author
First-time contributor

Closing as obsolete: this PR targeted the old pre-merge renderer and is no longer needed on post-merge.

Closing as obsolete: this PR targeted the old pre-merge renderer and is no longer needed on post-merge.
MasterWolf closed this pull request 2026-12-06 00:19:46 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!528
No description provided.