keep fresh left-open host lists across list::reset #645

Open
RileyW wants to merge 1 commit from RileyW/Darner:pr/fresh-open-reset into Main
First-time contributor

Note: This exact Darner revision has not yet been run end-to-end in the game on Darner main. The same fix has been running continuously in gameplay on our Windows 10 (i7-8700, RTX 3080 20 GiB) fork, and this Darner port was verified with a live RTX 3080 D3D12 unit test (via PR #631 on riley/all) and all workspace gates.

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: In crates/darner-gpu/src/list.rs, reset() calls with_state(this, |host, state| { host.reset(); state.reset(pipeline); }). Inside with_state, host_list(this) calls list.title_call(), incrementing title_calls before HostList::reset() checks still_left_open(). Because leave_open() saved title_calls + 1 before reset(), still_left_open() always sees a mismatched count, closes the list, and falls back to full D3D12 allocator and command-list resets (FRESH_OPEN[1] stays 0 while FRESH_OPEN[2] increments on every reset).
  • Real-world gameplay/runtime impact: During gameplay, the title records and resets roughly 200 command lists per frame. DARNER_FRESH_OPEN=1 (default-on) exists specifically to skip redundant D3D12 Close(), ID3D12CommandAllocator::Reset(), and ID3D12GraphicsCommandList::Reset() calls on freshly opened empty lists, saving driver CPU time every frame. On main, this bug silently defeats DARNER_FRESH_OPEN 100 percent of the time.
  • What this does: Calls with_state_on(host_list_held(this), this, "reset", ...) inside list::reset so the reset itself does not count as a title recording call, allowing still_left_open() to succeed on untouched lists while still closing and resetting lists that actually recorded title calls before Reset(). Adds regression test list::tests::reset_keeps_fresh_left_open_host_list covering both the untouched positive case and the title-call negative control.

How it was tested

  • Tested revision: 2ceaa45 (PR branch on c8258f9) and b97ea8e / 96096db (merged into riley/all with PR #631 for live Win10 SM 6.6 testing)
  • Commands and results:
    • cargo clippy --workspace --all-targets --locked -- -D warnings: passed (0 warnings)
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed (0 warnings)
    • cargo xtask policy and cargo xtask policy --staged: passed (576 files ok)
    • Live RTX 3080 GPU test on riley/all with DARNER_TEST_AGILITY_DIR pointing at Agility SDK 1.620: cargo test -p darner-gpu --lib --locked list::tests::reset_keeps_fresh_left_open_host_list -- --exact --nocapture passed (1 passed, 0 failed, 0.31s)
  • Changes a default: no (restores the intended behavior of the already default-on DARNER_FRESH_OPEN=1 path)
  • A/B result: Not yet A/B logged on Darner main; this is a pure bug fix restoring an existing default-on fast path, and the same fix has been running in gameplay on our Windows 10 i7-8700 + RTX 3080 fork.
  • Gates run on that revision: all three workspace gates in AGENTS.md on 2ceaa45 and 96096db
  • Gameplay, when relevant: Windows 10 22H2, i7-8700, RTX 3080 20 GiB (verified continuously on our fork; Darner main gameplay run pending)
  • Shader wave sizes tested, when relevant: n/a (CPU command-list reset path)
  • Hardware dependence: general (all Windows GPUs; largest benefit on CPU-bound systems)
  • Coverage gaps: Not yet run in-game directly on Darner main; on clean Windows 10 without Agility SDK test staging (PR #631), host::host() unit tests require SM 6.6 so live GPU execution was verified on riley/all with PR #631 active.

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: #631 (used locally on riley/all to execute the live RTX 3080 GPU unit test on Windows 10)
  • Replaces or overlaps: none found
Note: This exact Darner revision has not yet been run end-to-end in the game on Darner main. The same fix has been running continuously in gameplay on our Windows 10 (i7-8700, RTX 3080 20 GiB) fork, and this Darner port was verified with a live RTX 3080 D3D12 unit test (via PR #631 on riley/all) and all workspace gates. ## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: In `crates/darner-gpu/src/list.rs`, `reset()` calls `with_state(this, |host, state| { host.reset(); state.reset(pipeline); })`. Inside `with_state`, `host_list(this)` calls `list.title_call()`, incrementing `title_calls` before `HostList::reset()` checks `still_left_open()`. Because `leave_open()` saved `title_calls + 1` before `reset()`, `still_left_open()` always sees a mismatched count, closes the list, and falls back to full D3D12 allocator and command-list resets (`FRESH_OPEN[1]` stays 0 while `FRESH_OPEN[2]` increments on every reset). - Real-world gameplay/runtime impact: During gameplay, the title records and resets roughly 200 command lists per frame. `DARNER_FRESH_OPEN=1` (default-on) exists specifically to skip redundant D3D12 `Close()`, `ID3D12CommandAllocator::Reset()`, and `ID3D12GraphicsCommandList::Reset()` calls on freshly opened empty lists, saving driver CPU time every frame. On main, this bug silently defeats `DARNER_FRESH_OPEN` 100 percent of the time. - What this does: Calls `with_state_on(host_list_held(this), this, "reset", ...)` inside `list::reset` so the reset itself does not count as a title recording call, allowing `still_left_open()` to succeed on untouched lists while still closing and resetting lists that actually recorded title calls before `Reset()`. Adds regression test `list::tests::reset_keeps_fresh_left_open_host_list` covering both the untouched positive case and the title-call negative control. ## How it was tested - Tested revision: `2ceaa45` (PR branch on `c8258f9`) and `b97ea8e` / `96096db` (merged into `riley/all` with PR #631 for live Win10 SM 6.6 testing) - Commands and results: - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passed (0 warnings) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passed (0 warnings) - `cargo xtask policy` and `cargo xtask policy --staged`: passed (576 files ok) - Live RTX 3080 GPU test on `riley/all` with `DARNER_TEST_AGILITY_DIR` pointing at Agility SDK 1.620: `cargo test -p darner-gpu --lib --locked list::tests::reset_keeps_fresh_left_open_host_list -- --exact --nocapture` passed (1 passed, 0 failed, 0.31s) - Changes a default: no (restores the intended behavior of the already default-on `DARNER_FRESH_OPEN=1` path) - A/B result: Not yet A/B logged on Darner main; this is a pure bug fix restoring an existing default-on fast path, and the same fix has been running in gameplay on our Windows 10 i7-8700 + RTX 3080 fork. - Gates run on that revision: all three workspace gates in AGENTS.md on `2ceaa45` and `96096db` - Gameplay, when relevant: Windows 10 22H2, i7-8700, RTX 3080 20 GiB (verified continuously on our fork; Darner main gameplay run pending) - Shader wave sizes tested, when relevant: n/a (CPU command-list reset path) - Hardware dependence: general (all Windows GPUs; largest benefit on CPU-bound systems) - Coverage gaps: Not yet run in-game directly on Darner main; on clean Windows 10 without Agility SDK test staging (PR #631), `host::host()` unit tests require SM 6.6 so live GPU execution was verified on `riley/all` with PR #631 active. ## Checklist - [ ] 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: #631 (used locally on `riley/all` to execute the live RTX 3080 GPU unit test on Windows 10) - Replaces or overlaps: none found
TrustNo1 changed title from [pr-fix][rendering] keep fresh left-open host lists across list::reset to keep fresh left-open host lists across list::reset 2026-12-06 03:25:37 +00:00
Owner

Test needed — commit 2ceaa457; what to check:

  • The problem on main: In crates/darner-gpu/src/list.rs, reset() calls with_state(this, |host, state| { host.reset(); state.reset(pipeline); }). Inside with_state, host_list(this) calls list.title_call(), incrementing title_calls before HostList::reset() checks still_left_open(). Because leave_open() saved title_calls + 1 before reset(), still_left_open() always sees a mismatched count, closes the list, and falls back to full D3D12 allocator and command-list resets (FRESH_OPEN[1] stays 0 while FRESH_OPEN[2] increments on every reset).
  • Real-world gameplay/runtime impact: During gameplay, the title records and resets roughly 200 command lists per frame. DARNER_FRESH_OPEN=1 (default-on) exists specifically to skip redundant D3D12 Close(), ID3D12CommandAllocator::Reset(), and ID3D12GraphicsCommandList::Reset() calls on freshly opened empty lists, saving driver CPU time every frame. On main, this bug silently defeats DARNER_FRESH_OPEN 100 percent of the time.
  • What this does: Calls with_state_on(host_list_held(this), this, "reset", ...) inside list::reset so the reset itself does not count as a title recording call, allowing `still_left_ope

Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.

Reply testing to take this run; it's free again after 24 h with no results.

**Test needed** — commit `2ceaa457`; what to check: - The problem on main: In `crates/darner-gpu/src/list.rs`, `reset()` calls `with_state(this, |host, state| { host.reset(); state.reset(pipeline); })`. Inside `with_state`, `host_list(this)` calls `list.title_call()`, incrementing `title_calls` before `HostList::reset()` checks `still_left_open()`. Because `leave_open()` saved `title_calls + 1` before `reset()`, `still_left_open()` always sees a mismatched count, closes the list, and falls back to full D3D12 allocator and command-list resets (`FRESH_OPEN[1]` stays 0 while `FRESH_OPEN[2]` increments on every reset). - Real-world gameplay/runtime impact: During gameplay, the title records and resets roughly 200 command lists per frame. `DARNER_FRESH_OPEN=1` (default-on) exists specifically to skip redundant D3D12 `Close()`, `ID3D12CommandAllocator::Reset()`, and `ID3D12GraphicsCommandList::Reset()` calls on freshly opened empty lists, saving driver CPU time every frame. On main, this bug silently defeats `DARNER_FRESH_OPEN` 100 percent of the time. - What this does: Calls `with_state_on(host_list_held(this), this, "reset", ...)` inside `list::reset` so the reset itself does not count as a title recording call, allowing `still_left_ope Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture. Reply `testing` to take this run; it's free again after 24 h with no results.
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 'pr/fresh-open-reset:RileyW-pr/fresh-open-reset'
git switch 'RileyW-pr/fresh-open-reset'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'Main'
git merge --no-ff 'RileyW-pr/fresh-open-reset'
git switch 'RileyW-pr/fresh-open-reset'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'RileyW-pr/fresh-open-reset'
git switch 'RileyW-pr/fresh-open-reset'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'RileyW-pr/fresh-open-reset'
git switch 'Main'
git merge --squash 'RileyW-pr/fresh-open-reset'
git switch 'Main'
git merge --ff-only 'RileyW-pr/fresh-open-reset'
git switch 'Main'
git merge 'RileyW-pr/fresh-open-reset'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!645
No description provided.