gpu(descriptor): preserve disjoint small linear texture views under Rule::Start #164

Merged
Androtim merged 1 commit from upstream-pr/164 into main 2026-11-29 21:06:53 +00:00
Androtim commented 2026-11-29 20:43:27 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T20:43:27Z.


## Summary

  • Port 43ec6223 into crates/victory-gpu/src/descriptor/host.rs:
    • Bound Rule::Start span invalidation by each allocation's actual end.min(start + HEAD) so disjoint small linear material lookup textures (< 4 KiB) sharing the same 4 KiB page are preserved instead of invalidating neighbours.
    • Add unit test small_linear_lookup_neighbours_stay.

Test plan

  • cargo run -p xtask -- policy: passed (305 files ok)
  • cargo test -p victory-gpu descriptor::host::: 55/55 passed
  • Dual cargo clippy --workspace --all-targets (default and --features diagnostics) with -D warnings: passed
<!-- greyfinch-sync:Androtim/MiniVI:issue:5554918198 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/164). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T20:43:27Z. --- ## Summary - Port `43ec6223` into `crates/victory-gpu/src/descriptor/host.rs`: - Bound `Rule::Start` span invalidation by each allocation's actual `end.min(start + HEAD)` so disjoint small linear material lookup textures (< 4 KiB) sharing the same 4 KiB page are preserved instead of invalidating neighbours. - Add unit test `small_linear_lookup_neighbours_stay`. ## Test plan - `cargo run -p xtask -- policy`: passed (305 files ok) - `cargo test -p victory-gpu descriptor::host::`: 55/55 passed - Dual `cargo clippy --workspace --all-targets` (default and `--features diagnostics`) with `-D warnings`: passed
Androtim commented 2026-11-29 21:05:04 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T21:05:04Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Review Summary

  • Scope & Logic (crates/victory-gpu/src/descriptor/host.rs):
    • In Spans::note under Rule::Start, the new span's protected head is now bounded by head_end = end.min(start.saturating_add(HEAD)), and candidate spans in by_start.range(start.saturating_sub(HEAD - 1)..start.saturating_add(HEAD)) are filtered with *at < head_end && start < span.0.min(at.saturating_add(HEAD)).
    • Because end <= start returns early (and all stored spans satisfy span.0 > *at), the filter is an exact half-open interval overlap check between [start, min(end, start + HEAD)) and [*at, min(span.0, *at + HEAD)).
    • The BTreeMap query window start.saturating_sub(HEAD - 1)..start.saturating_add(HEAD) remains sound: any span starting outside it cannot satisfy both inequalities, and textures of size >= HEAD (4 KiB) keep identical behavior to origin/main.
    • Exact-match reuse (at == start && same(...)), newer == false rejection, and invalidation of genuinely overlapping small spans all continue to work as expected.
  • Tests & CI:
    • Adds small_linear_lookup_neighbours_stay, verifying that disjoint 256-byte linear textures sharing a 4 KiB page coexist (including newer == false views) while an overlapping write still invalidates all views of the overlapped lookup without disturbing neighbours.
    • CI is passing and no policy/security issues were found.
  • Next step: Since this changes live placed-texture descriptor invalidation in the D3D12 host (descriptor/host.rs), a quick local real-GPU smoke test is recommended before merging.

Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7262589881 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/164#issuecomment-7262589881). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T21:05:04Z. --- <!-- minivi-triage v1 head=c0650cc673b0199fa74cde53fb33acbd483ce006 verdict=needs-gpu-test ci=passing at=2026-11-29T21:05:37Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary - **Scope & Logic (`crates/victory-gpu/src/descriptor/host.rs`)**: - In `Spans::note` under `Rule::Start`, the new span's protected head is now bounded by `head_end = end.min(start.saturating_add(HEAD))`, and candidate spans in `by_start.range(start.saturating_sub(HEAD - 1)..start.saturating_add(HEAD))` are filtered with `*at < head_end && start < span.0.min(at.saturating_add(HEAD))`. - Because `end <= start` returns early (and all stored spans satisfy `span.0 > *at`), the filter is an exact half-open interval overlap check between `[start, min(end, start + HEAD))` and `[*at, min(span.0, *at + HEAD))`. - The BTreeMap query window `start.saturating_sub(HEAD - 1)..start.saturating_add(HEAD)` remains sound: any span starting outside it cannot satisfy both inequalities, and textures of size `>= HEAD` (4 KiB) keep identical behavior to `origin/main`. - Exact-match reuse (`at == start && same(...)`), `newer == false` rejection, and invalidation of genuinely overlapping small spans all continue to work as expected. - **Tests & CI**: - Adds `small_linear_lookup_neighbours_stay`, verifying that disjoint 256-byte linear textures sharing a 4 KiB page coexist (including `newer == false` views) while an overlapping write still invalidates all views of the overlapped lookup without disturbing neighbours. - CI is passing and no policy/security issues were found. - **Next step**: Since this changes live placed-texture descriptor invalidation in the D3D12 host (`descriptor/host.rs`), a quick local real-GPU smoke test is recommended before merging. --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-11-29 21:27:43 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T21:27:43Z.


Automated RTX 4060 Ti 8 GB Open-World A/B hardware verification PASSED (playtest/wave5 vs origin/main b1b6dc1, VICTORY_LEVELS_ON_DEMAND=0 play-parity):

  • Hardware cargo test (RTX 4060 Ti): 645 passed, 0 failed (victory 39/39, victory-shader emit::wave64_tests 19/19 & lower 19/19, victory-gpu 568/568).
  • 45s Open-World A/B (scripts/verify-world.ps1, DLSS Quality + open-world save):
    • FPS: median 9.4 fps vs 7.5 fps (+1.90 fps / +25%), min 8.3 fps vs 0.8 fps, preparing 53.6 ms vs 60.0 ms
    • Stability: 0 crashes / 0 DRED / 0 untranslated shaders
    • VRAM / Issue #149: max 5760 MB vs 6005 MB (-245 MB, 0 MB over budget); no room for new ones halved (9,000 vs 18,000); max_waiting dropped (36,432 vs 41,431)
    • Decoration bakes / Issue #150: 0 mismatches (other_bytes=0, showed_another_view=0, failed=0 vs 5 and 2 on baseline)
    • Residency stalls: mapped_rate 1.63 ms/s vs 6.9 ms/s (-76%, max 12.9 vs 51.9 ms)
    • Visual check: Clean open-world safehouse frames (frame-5975.png, frame-5983.png), edge_energy=4.69 vs 3.88, near_black=0.02%, magenta=0.0% (and #141 2bf6800 showed zero visual artifacts).
<!-- greyfinch-sync:Androtim/MiniVI:comment:7262893801 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/164#issuecomment-7262893801). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T21:27:43Z. --- Automated RTX 4060 Ti 8 GB **Open-World** A/B hardware verification **PASSED** (`playtest/wave5` vs `origin/main` `b1b6dc1`, `VICTORY_LEVELS_ON_DEMAND=0` play-parity): - **Hardware `cargo test` (RTX 4060 Ti):** **645 passed, 0 failed** (`victory` 39/39, `victory-shader` `emit::wave64_tests` 19/19 & `lower` 19/19, `victory-gpu` 568/568). - **45s Open-World A/B (`scripts/verify-world.ps1`, DLSS Quality + open-world save):** - **FPS:** median **`9.4 fps`** vs `7.5 fps` (**+1.90 fps / +25%**), min **`8.3 fps`** vs **`0.8 fps`**, preparing `53.6 ms` vs `60.0 ms` - **Stability:** **0** crashes / **0** DRED / **0** untranslated shaders - **VRAM / Issue #149:** max **`5760 MB`** vs `6005 MB` (**-245 MB**, `0 MB` over budget); `no room for new ones` halved (**`9,000`** vs `18,000`); `max_waiting` dropped (`36,432` vs `41,431`) - **Decoration bakes / Issue #150:** **`0` mismatches** (`other_bytes=0, showed_another_view=0, failed=0` vs `5` and `2` on baseline) - **Residency stalls:** `mapped_rate` **`1.63 ms/s`** vs `6.9 ms/s` (**-76%**, max `12.9` vs `51.9 ms`) - **Visual check:** Clean open-world safehouse frames (`frame-5975.png`, `frame-5983.png`), `edge_energy=4.69` vs `3.88`, `near_black=0.02%`, `magenta=0.0%` (and `#141` `2bf6800` showed zero visual artifacts).
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
Androtim/MiniVI!164
No description provided.