Leave a title list's new host list open when its recording is taken #311

Merged
wondasahnet merged 2 commits from upstream-pr/311 into main 2026-11-27 18:06:34 +00:00
wondasahnet commented 2026-11-27 15:38:02 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by wondasahnet on 2026-11-27T15:38:02Z.


At every submission each of the title's lists gives up its host list and is handed a new one from the idle ones, reset and open. That new list was then closed, empty, at once, so that the title's next Reset found it closed. The close ran on the thread that prepares the submissions, the one a frame waits for.

Measured

RTX 5080, Ryzen 7 9800X3D, 64 GB, Windows 11. Series S build, prison intro, windowed, diagnostics build, -Machine 4070.

A sampling profile of the submitting thread: 3.8% of its samples in the driver's Close of these empty lists, 216 of them a frame.

The profile share is the evidence. The frame rate was not measured with this change alone, and runs of this scene differ by about 1 fps anyway, so I claim no frame-rate change.

What changes

  • list::detach and list::detach_parts leave the new host list open. HostList::reset already closes a recording that is discarded before it resets the allocator, and it runs on the thread that translates the title's calls. So the empty close moves off the submitting thread to the title's next Reset of that list.
  • A list the title submits again without a reset in between would now give an open host list to the queue. HostList::close_if_open closes it when it is taken, in both functions.

Tests

  • Run on this branch at 2736ab2 (base c44e2ce), Windows 11, RTX 5080, Ryzen 7 9800X3D, 64 GB:

    Command Result
    cargo check --workspace --all-targets --locked clean
    cargo test --locked -p victory-gpu --features diagnostics --lib -- list:: 5 passed, 0 failed
    cargo build --locked --profile diag -p victory --features diagnostics (before the rebase onto c44e2ce, which was clean) builds
    git diff --check clean

    The four CI commands were run once on a local merge of this branch with five other branches of mine, on base fe8a7a2 before the rebase: both clippy commands clean, cargo test --workspace --locked passed, and cargo test --workspace --all-features --locked -- --test-threads=1 passed except modules::lifecycle::tests::direct_close_suspends_and_exits in victory-hle, a window test in a crate this branch does not touch; it passed in the default job of the same run and when run again alone. After the rebase the merge was linted again with both clippy commands: clean.

  • In game: builds with this change ran the Series S prison intro (cell, corridor, common room, with camera turns and walking) more than a dozen times on the PC above, self-driven, about a minute and a half to three minutes each. None of the logs has a "host command list did not close" or "did not reset" line.

Not covered

  • No unit test covers the open list through a real Reset or the second submission without a reset: both need a host device and a title list. Whether the title ever submits a list twice without a reset in these scenes was not checked, so close_if_open on that path is covered by reading only.
  • The close of the empty list is moved, not removed: its cost on the translating threads was not measured.
  • One PC, one card, one driver.

Since the runs above the branch was rebased onto main at 16edfec (no conflicts; cargo check -p victory-gpu --all-targets --locked clean); its tip is b4936ba now.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5529264322 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/311). Originally posted by [wondasahnet](https://github.com/wondasahnet) on 2026-11-27T15:38:02Z. --- At every submission each of the title's lists gives up its host list and is handed a new one from the idle ones, reset and open. That new list was then closed, empty, at once, so that the title's next `Reset` found it closed. The close ran on the thread that prepares the submissions, the one a frame waits for. ## Measured RTX 5080, Ryzen 7 9800X3D, 64 GB, Windows 11. Series S build, prison intro, windowed, diagnostics build, `-Machine 4070`. A sampling profile of the submitting thread: 3.8% of its samples in the driver's `Close` of these empty lists, 216 of them a frame. The profile share is the evidence. The frame rate was not measured with this change alone, and runs of this scene differ by about 1 fps anyway, so I claim no frame-rate change. ## What changes - `list::detach` and `list::detach_parts` leave the new host list open. `HostList::reset` already closes a recording that is discarded before it resets the allocator, and it runs on the thread that translates the title's calls. So the empty close moves off the submitting thread to the title's next `Reset` of that list. - A list the title submits again without a reset in between would now give an open host list to the queue. `HostList::close_if_open` closes it when it is taken, in both functions. ## Tests - Run on this branch at `2736ab2` (base `c44e2ce`), Windows 11, RTX 5080, Ryzen 7 9800X3D, 64 GB: | Command | Result | |---|---| | `cargo check --workspace --all-targets --locked` | clean | | `cargo test --locked -p victory-gpu --features diagnostics --lib -- list::` | 5 passed, 0 failed | | `cargo build --locked --profile diag -p victory --features diagnostics` (before the rebase onto `c44e2ce`, which was clean) | builds | | `git diff --check` | clean | The four CI commands were run once on a local merge of this branch with five other branches of mine, on base `fe8a7a2` before the rebase: both clippy commands clean, `cargo test --workspace --locked` passed, and `cargo test --workspace --all-features --locked -- --test-threads=1` passed except `modules::lifecycle::tests::direct_close_suspends_and_exits` in `victory-hle`, a window test in a crate this branch does not touch; it passed in the default job of the same run and when run again alone. After the rebase the merge was linted again with both clippy commands: clean. - In game: builds with this change ran the Series S prison intro (cell, corridor, common room, with camera turns and walking) more than a dozen times on the PC above, self-driven, about a minute and a half to three minutes each. None of the logs has a "host command list did not close" or "did not reset" line. ## Not covered - No unit test covers the open list through a real `Reset` or the second submission without a reset: both need a host device and a title list. Whether the title ever submits a list twice without a reset in these scenes was not checked, so `close_if_open` on that path is covered by reading only. - The close of the empty list is moved, not removed: its cost on the translating threads was not measured. - One PC, one card, one driver. --- Since the runs above the branch was rebased onto `main` at `16edfec` (no conflicts; `cargo check -p victory-gpu --all-targets --locked` clean); its tip is `b4936ba` now.
TaynanGT commented 2026-11-27 15:54:15 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T15:54:15Z.


@wondasahnet The 216 empty closes per frame identify a concrete source of submit-thread work. The important checks now are the next Reset and submitting the same title list twice before Reset. Both should reach execution with a closed host list.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7222620207 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/311#issuecomment-7222620207). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T15:54:15Z. --- @wondasahnet The 216 empty closes per frame identify a concrete source of submit-thread work. The important checks now are the next Reset and submitting the same title list twice before Reset. Both should reach execution with a closed host list.
wondasahnet commented 2026-11-27 17:59:49 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by wondasahnet on 2026-11-27T17:59:49Z.


Done in c65e462, on top of the reviewed tip.

Both cases are checked now, not read.

The open or closed state of a host list is a small state of its own (host::Recording: open when made or reset, left open when handed to a title's list in place of the recording a submission took, closed). HostList asks it what to do with its native list, so the two cases can be tested without a device and are then driven through the real code with one.

  • Next Reset: a_list_left_open_is_closed_by_the_next_reset_and_closed_when_submitted (state only), and list::tests::host_lists_reach_execution_closed_after_a_reset_and_when_submitted_twice with a device: a title list's own Close, a submission's detach, the title's Reset (which has to close the open native list before the allocator can be reset), a command, Close, a second detach. The host list taken is closed.
  • Twice before Reset: a_list_submitted_twice_without_a_reset_is_closed_when_taken (state only), and in the same device test a third detach with no Reset before it: the list that was left open is taken, and it is closed when taken.

In the device test every host list taken then goes through a real submission (Host::execute): the check at the queue finds none open, the lists run, and the device is still there afterwards. It passes on the hardware device and on WARP (VICTORY_D3D12_WARP=1).

Closed at execution is enforced. Where lists go to the queue (Host::submit, and before a submission is cut) a list that is still open is closed there with what it holds, counted, and logged: the first four, then every one that doubles the count. No path is known to lead there; it costs one load a list. an_open_host_list_given_to_a_submission_is_closed_and_runs hands a submission an open list on purpose: it is closed by the check and runs.

Counters. Since the start, written by the diagnostics build with its lines every five seconds: host lists left open at detach; of those, closed by the title's next Reset, closed when submitted again without a Reset, closed with something recorded and no Reset before; recordings the title submitted without a Close; lists found open at the queue.

One self-driven run with them: Series S build, prison intro, -Machine 4070, about three minutes in the world with the camera turning and walking, frame generation on. The build is this commit on a tree that has today's main merged in. The last counters line of the log, since the start:

host lists left open when their recording was taken 945,537
closed by the title's next Reset 915,256
closed when the list was submitted again without a Reset 29,983
closed with something recorded and no Reset before 0
recordings submitted without a Close 0
found open where lists go to the queue 0

The 298 not accounted for were still in their title lists, open, when the run was ended. The log has no "did not close", no "did not reset" and no "still open where they go to the queue" line, and no line at error level.

So the answer to "does the title submit a list twice before Reset" is yes, in this run 29,983 times, about 3 in 100 of the lists taken. Every one of them reached the queue closed.

Checks. cargo check --workspace --all-targets --locked, and cargo clippy --workspace --all-targets --locked -- -D warnings with and without --all-features: clean. cargo test --locked -p victory-gpu --features diagnostics --lib -- recording_tests list::: 11 passed; the same without the diagnostics feature: 11 passed.

Merged locally with today's main: no conflict, the 11 tests pass and both clippy commands are clean.

Not covered.

  • Where a submission takes a list's recording, a second submission of that list with no Reset in between, in another ExecuteCommandLists call, runs an empty host list: the recording went with the first. That was so before this pull request as well (the list given in its place was closed empty); this change makes sure it is closed and counts how often it happens: 29,983 times in the run above. I have not looked at what those lists held the first time, so I cannot say whether anything is missing from the picture because of it; it is not something this pull request changes.
  • The device test drives list::detach. detach_parts (lists cut at waits for memory values) has the same two lines and is covered by the check at the queue and the counters, not by a test of its own.
  • The empty close is moved to the title's next Reset, not removed; its cost on the translating threads is not measured.
<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7225006953 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/311#issuecomment-7225006953). Originally posted by [wondasahnet](https://github.com/wondasahnet) on 2026-11-27T17:59:49Z. --- Done in `c65e462`, on top of the reviewed tip. **Both cases are checked now, not read.** The open or closed state of a host list is a small state of its own (`host::Recording`: open when made or reset, left open when handed to a title's list in place of the recording a submission took, closed). `HostList` asks it what to do with its native list, so the two cases can be tested without a device and are then driven through the real code with one. - Next `Reset`: `a_list_left_open_is_closed_by_the_next_reset_and_closed_when_submitted` (state only), and `list::tests::host_lists_reach_execution_closed_after_a_reset_and_when_submitted_twice` with a device: a title list's own `Close`, a submission's `detach`, the title's `Reset` (which has to close the open native list before the allocator can be reset), a command, `Close`, a second `detach`. The host list taken is closed. - Twice before `Reset`: `a_list_submitted_twice_without_a_reset_is_closed_when_taken` (state only), and in the same device test a third `detach` with no `Reset` before it: the list that was left open is taken, and it is closed when taken. In the device test every host list taken then goes through a real submission (`Host::execute`): the check at the queue finds none open, the lists run, and the device is still there afterwards. It passes on the hardware device and on WARP (`VICTORY_D3D12_WARP=1`). **Closed at execution is enforced.** Where lists go to the queue (`Host::submit`, and before a submission is cut) a list that is still open is closed there with what it holds, counted, and logged: the first four, then every one that doubles the count. No path is known to lead there; it costs one load a list. `an_open_host_list_given_to_a_submission_is_closed_and_runs` hands a submission an open list on purpose: it is closed by the check and runs. **Counters.** Since the start, written by the diagnostics build with its lines every five seconds: host lists left open at detach; of those, closed by the title's next `Reset`, closed when submitted again without a `Reset`, closed with something recorded and no `Reset` before; recordings the title submitted without a `Close`; lists found open at the queue. One self-driven run with them: Series S build, prison intro, `-Machine 4070`, about three minutes in the world with the camera turning and walking, frame generation on. The build is this commit on a tree that has today's `main` merged in. The last counters line of the log, since the start: | | | |---|---:| | host lists left open when their recording was taken | 945,537 | | closed by the title's next `Reset` | 915,256 | | closed when the list was submitted again without a `Reset` | 29,983 | | closed with something recorded and no `Reset` before | 0 | | recordings submitted without a `Close` | 0 | | found open where lists go to the queue | 0 | The 298 not accounted for were still in their title lists, open, when the run was ended. The log has no "did not close", no "did not reset" and no "still open where they go to the queue" line, and no line at error level. So the answer to "does the title submit a list twice before `Reset`" is yes, in this run 29,983 times, about 3 in 100 of the lists taken. Every one of them reached the queue closed. **Checks.** `cargo check --workspace --all-targets --locked`, and `cargo clippy --workspace --all-targets --locked -- -D warnings` with and without `--all-features`: clean. `cargo test --locked -p victory-gpu --features diagnostics --lib -- recording_tests list::`: 11 passed; the same without the diagnostics feature: 11 passed. Merged locally with today's `main`: no conflict, the 11 tests pass and both clippy commands are clean. **Not covered.** - Where a submission takes a list's recording, a second submission of that list with no `Reset` in between, in another `ExecuteCommandLists` call, runs an empty host list: the recording went with the first. That was so before this pull request as well (the list given in its place was closed empty); this change makes sure it is closed and counts how often it happens: 29,983 times in the run above. I have not looked at what those lists held the first time, so I cannot say whether anything is missing from the picture because of it; it is not something this pull request changes. - The device test drives `list::detach`. `detach_parts` (lists cut at waits for memory values) has the same two lines and is covered by the check at the queue and the counters, not by a test of its own. - The empty close is moved to the title's next `Reset`, not removed; its cost on the translating threads is not measured.
TaynanGT commented 2026-11-27 18:02:53 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T18:02:53Z.


@wondasahnet The real submissions cover both the next Reset and the repeat submit, with closed lists on hardware and WARP. The 29,983 repeats show why that second check matters. The queue guard also covers split lists when they reach execution. I’ll use the original Close profile as the performance baseline and check c65e462 against current main when CI finishes.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7225063444 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/311#issuecomment-7225063444). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T18:02:53Z. --- @wondasahnet The real submissions cover both the next Reset and the repeat submit, with closed lists on hardware and WARP. The 29,983 repeats show why that second check matters. The queue guard also covers split lists when they reach execution. I’ll use the original Close profile as the performance baseline and check `c65e462` against current main when CI finishes.
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
TaynanGT/Vice-Tay!311
No description provided.