fix(gpu): return split submissions' descriptor slots; keep min level on moved views #223

Closed
mutlusinan wants to merge 2 commits from upstream-pr/223 into main
mutlusinan commented 2026-11-27 19:53:44 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-27T19:53:44Z.


Problem

  1. Split submissions leak descriptor slots. The lists a split submission runs at once are not detached, so nothing returned their fresh tables' dynamic slots before the title reset them; a long run lost slots it never got back. submit_cut already does this after the same execute; the split path did not.
  2. A moved view shifted its minimum level. show_from lowers ResourceMinLODClamp by the number of levels it skips, but the clamp is measured from mip 0 of the resource, not from the view's first level — so the minimum level changed when the view's start moved.

Fix

  • queue.rs, submit_split: call crate::list::tables_done(&lists[..cut]) after host.execute, as submit_cut does.
  • tiles.rs, show_from: leave ResourceMinLODClamp alone; the device test now samples the same resident level through the adjusted and the original view instead of expecting the adjusted one to read level 1.

Verification

  • cargo check --workspace --target x86_64-pc-windows-msvc --locked — clean.
  • cargo run -p xtask -- policy — 286 files ok.
  • The tiles.rs device test needs a GPU and was not run here.

Ported from fxceless/victory-fork af23c65 (fork PR #1320) and 41f9857 (fork PR #1210), GPL-3.0-or-later.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5532328451 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/223). Originally posted by [mutlusinan](https://github.com/mutlusinan) on 2026-11-27T19:53:44Z. --- ### Problem 1. **Split submissions leak descriptor slots.** The lists a split submission runs at once are not detached, so nothing returned their fresh tables' dynamic slots before the title reset them; a long run lost slots it never got back. `submit_cut` already does this after the same `execute`; the split path did not. 2. **A moved view shifted its minimum level.** `show_from` lowers `ResourceMinLODClamp` by the number of levels it skips, but the clamp is measured from mip 0 of the resource, not from the view's first level — so the minimum level changed when the view's start moved. ### Fix - `queue.rs`, `submit_split`: call `crate::list::tables_done(&lists[..cut])` after `host.execute`, as `submit_cut` does. - `tiles.rs`, `show_from`: leave `ResourceMinLODClamp` alone; the device test now samples the same resident level through the adjusted and the original view instead of expecting the adjusted one to read level 1. ### Verification - `cargo check --workspace --target x86_64-pc-windows-msvc --locked` — clean. - `cargo run -p xtask -- policy` — 286 files ok. - The `tiles.rs` device test needs a GPU and was not run here. Ported from fxceless/victory-fork `af23c65` (fork PR #1320) and `41f9857` (fork PR #1210), GPL-3.0-or-later.
mutlusinan commented 2026-11-27 20:21:19 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-27T20:21:19Z.


Risk assessment (porting review)

  • Slot release is safe here: Host::execute is submit(..., late = false), which holds the submission lock for the whole passage, i.e. the lists have run when it returns. submit_cut has used exactly this sequence (queue.rs:171-177), and tables_done skips null lists and lists that still have earlier work.
  • The freed subset is the same one submitted (now filters out entries without a host list).
  • Min level: ResourceMinLODClamp is measured from mip 0 of the resource per D3D12, so leaving it untouched is spec-correct. The device test that covers it was not run here (needs a GPU).
  • Compatibility: merges cleanly and type-checks against main at e69e39c.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7227420969 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/223#issuecomment-7227420969). Originally posted by [mutlusinan](https://github.com/mutlusinan) on 2026-11-27T20:21:19Z. --- ### Risk assessment (porting review) - **Slot release is safe here:** `Host::execute` is `submit(..., late = false)`, which holds the submission lock for the whole passage, i.e. the lists have run when it returns. `submit_cut` has used exactly this sequence (`queue.rs:171-177`), and `tables_done` skips null lists and lists that still have `earlier` work. - The freed subset is the same one submitted (`now` filters out entries without a host list). - **Min level:** `ResourceMinLODClamp` is measured from mip 0 of the resource per D3D12, so leaving it untouched is spec-correct. The device test that covers it was not run here (needs a GPU). - **Compatibility:** merges cleanly and type-checks against `main` at `e69e39c`.
1tsethan commented 2026-11-27 23:00:36 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 1tsethan on 2026-11-27T23:00:36Z.


Independent Windows validation of PR #223.

Tested commit: 4bdf2b31f95f099091aa192791685ff2ba0c14ce.

cargo test --locked -p victory-gpu tiles:: -- --nocapture --test-threads=1

Exit: 0.

  • test result: ok. 3 passed; 0 failed; 1 ignored; 0 measured; 451 filtered out; finished in 1.62s

Tested commit: 4bdf2b31f95f099091aa192791685ff2ba0c14ce.

cargo test --locked -p victory-gpu levels_on_demand_on_the_card -- --ignored --nocapture --test-threads=1

Exit: 0.

  • test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 454 filtered out; finished in 0.90s

Tested commit: 4bdf2b31f95f099091aa192791685ff2ba0c14ce.

cargo test --locked -p victory-gpu levels_on_demand_on_the_card -- --ignored --nocapture --test-threads=1

Exit: 0.
Test-specific environment: VICTORY_TILES_TEST_CARD=1

  • test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 454 filtered out; finished in 0.00s
  • no adapter with tiled resources of tier 2, or no debug layer for a run on the card; skipped

The first explicitly ignored device-test invocation selected the software adapter and passed. The recheck sets VICTORY_TILES_TEST_CARD=1; its adapter/progress notes are listed separately. The debug layer is not installed.

Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7229797423 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/223#issuecomment-7229797423). Originally posted by [1tsethan](https://github.com/1tsethan) on 2026-11-27T23:00:36Z. --- Independent Windows validation of PR #223. Tested commit: `4bdf2b31f95f099091aa192791685ff2ba0c14ce`. `cargo test --locked -p victory-gpu tiles:: -- --nocapture --test-threads=1` Exit: **0**. - test result: ok. 3 passed; 0 failed; 1 ignored; 0 measured; 451 filtered out; finished in 1.62s Tested commit: `4bdf2b31f95f099091aa192791685ff2ba0c14ce`. `cargo test --locked -p victory-gpu levels_on_demand_on_the_card -- --ignored --nocapture --test-threads=1` Exit: **0**. - test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 454 filtered out; finished in 0.90s Tested commit: `4bdf2b31f95f099091aa192791685ff2ba0c14ce`. `cargo test --locked -p victory-gpu levels_on_demand_on_the_card -- --ignored --nocapture --test-threads=1` Exit: **0**. Test-specific environment: `VICTORY_TILES_TEST_CARD=1` - test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 454 filtered out; finished in 0.00s - no adapter with tiled resources of tier 2, or no debug layer for a run on the card; skipped The first explicitly ignored device-test invocation selected the software adapter and passed. The recheck sets `VICTORY_TILES_TEST_CARD=1`; its adapter/progress notes are listed separately. The debug layer is not installed. Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result. <!-- victory-native-validation-20261128 -->
trustno1-coder commented 2026-11-28 02:49:21 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T02:49:21Z.


Merged into main (8fc2254) and shipped in v2026.11.27.10. The commit keeps you as its author, so it counts toward the contributors list. GitHub shows this as closed rather than merged only because the commits were applied on top of the newest main (new commit IDs). Thank you!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232615877 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/223#issuecomment-7232615877). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-28T02:49:21Z. --- Merged into main (8fc2254) and shipped in [v2026.11.27.10](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.27.10). The commit keeps you as its author, so it counts toward the contributors list. GitHub shows this as closed rather than merged only because the commits were applied on top of the newest main (new commit IDs). Thank you!

Pull request closed

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
trustno1-coder/VIctory-NVIDIA!223
No description provided.