WIP: Retire holds when a texture write leaves the queue #620

Draft
tyr0nsur wants to merge 2 commits from tyr0nsur/Darner:codex/held-texture-writes into Main
Contributor

Refs #541.

Contributor role (optional)

  • Contributor role already granted.

What it changes

  • The two new assertions fail on c8258f95 with only the tests added. A removed or replaced texture write kept its entry in the texture queue's hold map. After the last such write was gone, any_held_textures() could still select the 4-frame readback cadence until the queue had room again.
  • Retire a hold when its write leaves the queue or is replaced. Clear the published hint only when the last hold is retired. A completion for an older write generation cannot retire a newer one.

How it was tested

  • Tested revision: 6d80b4ba47b77affec5e46730959167f8181aac9 on native Windows with Rust 1.98.1.
  • cargo test --locked --offline -p darner-gpu --lib descriptor::host::tests:: -- --test-threads=1 passed 95 tests, including both new regressions in the flat and indexed queue modes. One test was ignored.
  • Changes a default: no configuration change. Both texture queue modes get the fix.
  • Gates: cargo clippy --workspace --all-targets --locked --offline -- -D warnings and the same command with --all-features passed. cargo run --locked --offline -p xtask -- policy passed for 576 files. The clean cargo test --workspace --locked --offline run completed darner-gpu (1,825 passed, 81 ignored) before I stopped the still-running exhaustive shader sweep. The same sweep passed in 42.04 s with RUSTFLAGS=-C target-cpu=native and cargo test --release --locked --offline -p darner-shader --lib oracle64::legacy_mul_forms_are_exact -- --exact (see #619).
  • The workspace retry with -- --skip oracle64::legacy_mul_forms_are_exact stopped on one intermittent watch::tests::ask_rest_falls_back_per_piece_when_touching_unwatched_neighbour failure (unwatched.is_none()). #565 updates this exact fixture. That assertion passed in all three separate darner-gpu package runs on main. One of those runs failed three other watch tests.
  • Gameplay and A/B: measurements in a game scene are pending. The tests exercise the queue and published hint on the CPU. Shader wave size is outside this change.

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: #539 changes the due-slot scans for holds. #609 retires records in the texture-residency module. #615 changes which placed textures receive write notifications.
  • Replaces or overlaps: the shared file is used by #539 and #615. This change only updates the hold state when a write leaves the queue.
Refs #541. ## Contributor role (optional) - Contributor role already granted. ## What it changes - The two new assertions fail on `c8258f95` with only the tests added. A removed or replaced texture write kept its entry in the texture queue's hold map. After the last such write was gone, `any_held_textures()` could still select the 4-frame readback cadence until the queue had room again. - Retire a hold when its write leaves the queue or is replaced. Clear the published hint only when the last hold is retired. A completion for an older write generation cannot retire a newer one. ## How it was tested - Tested revision: `6d80b4ba47b77affec5e46730959167f8181aac9` on native Windows with Rust 1.98.1. - `cargo test --locked --offline -p darner-gpu --lib descriptor::host::tests:: -- --test-threads=1` passed 95 tests, including both new regressions in the flat and indexed queue modes. One test was ignored. - Changes a default: no configuration change. Both texture queue modes get the fix. - Gates: `cargo clippy --workspace --all-targets --locked --offline -- -D warnings` and the same command with `--all-features` passed. `cargo run --locked --offline -p xtask -- policy` passed for 576 files. The clean `cargo test --workspace --locked --offline` run completed `darner-gpu` (1,825 passed, 81 ignored) before I stopped the still-running exhaustive shader sweep. The same sweep passed in 42.04 s with `RUSTFLAGS=-C target-cpu=native` and `cargo test --release --locked --offline -p darner-shader --lib oracle64::legacy_mul_forms_are_exact -- --exact` (see #619). - The workspace retry with `-- --skip oracle64::legacy_mul_forms_are_exact` stopped on one intermittent `watch::tests::ask_rest_falls_back_per_piece_when_touching_unwatched_neighbour` failure (`unwatched.is_none()`). #565 updates this exact fixture. That assertion passed in all three separate `darner-gpu` package runs on `main`. One of those runs failed three other watch tests. - Gameplay and A/B: measurements in a game scene are pending. The tests exercise the queue and published hint on the CPU. Shader wave size is outside this change. ## 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: #539 changes the due-slot scans for holds. #609 retires records in the texture-residency module. #615 changes which placed textures receive write notifications. - Replaces or overlaps: the shared file is used by #539 and #615. This change only updates the hold state when a write leaves the queue.
TrustNo1 changed title from WIP: [pr-fix][rendering][memory] Retire holds when a texture write leaves the queue to WIP: Retire holds when a texture write leaves the queue 2026-12-06 03:26:08 +00:00
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'codex/held-texture-writes:tyr0nsur-codex/held-texture-writes'
git switch 'tyr0nsur-codex/held-texture-writes'

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 'tyr0nsur-codex/held-texture-writes'
git switch 'tyr0nsur-codex/held-texture-writes'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'tyr0nsur-codex/held-texture-writes'
git switch 'tyr0nsur-codex/held-texture-writes'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'tyr0nsur-codex/held-texture-writes'
git switch 'Main'
git merge --squash 'tyr0nsur-codex/held-texture-writes'
git switch 'Main'
git merge --ff-only 'tyr0nsur-codex/held-texture-writes'
git switch 'Main'
git merge 'tyr0nsur-codex/held-texture-writes'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!620
No description provided.