GPU: a read slot is resolved once, not twice #3215

Open
github-bot wants to merge 1 commit from github-bot/gh-3215 into main AGit
Owner

@⁠borosf on GitHub · 2026-11-26 13:21 UTC · original
borosf:vibe/read-slots-842ca5 → main · +13 −10 · 2 files · 1 commits · open

Summary

descriptor::make_read resolved every read slot twice: first HostHeap::mirror — the made-keys lock, the global views lock, a clone of the view, plus the kept lock when a texture view needs remaking — and then stamp_read, which looked the same slot up again through the same two locks and a second clone, only to stamp the HostTexture the view holds.

mirror already has the view in hand and returns it, so the stamp now takes the view: stamp_read_view(&view). stamp_read had no other caller, so it is deleted rather than left as a second way to do the same thing.

  • No behaviour change in what gets stamped. The slots mirror refuses are exactly the ones stamp_read found no made key for and returned on (its key != 0 guard), so the set of stamped textures is identical.
  • Per read slot: one resolution instead of two — one made-keys lock, one global views lock, one view clone. These run once per submission over the slots the title's lists read (descriptor.rs, make_read), against the world's 1,300–14,400 written slots a frame quoted in that file's own comment.
  • View is Clone but not Copy, so the placed-texture upgrade clones rather than moves; that is the only new clone, and it replaces a dropped one.

Verification

Intel Arc B580, Windows 11:

  • cargo test -p victory-gpu --lib --locked -- --test-threads=1 → 229 passed, 2 failed, 1 ignored. The two failures are the known Intel heap-cap pair (descriptor::host::tests::dynamic_slots_are_held_until_released, memory::tests::lists_share_a_table_and_copies_keep_their_views — #1744/#1829) that pristine main 63bcca4 also fails on this card.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings clean with and without the diagnostics feature.

No game data used; synthetic tests only.

Stacked on nothing: branched from main 63bcca4, two files, +13/−10. The magnitude is modelled from the slot rate × the two lock pairs and clone it removes, not measured — that needs a world frame with the title.

claiming: GPU: descriptor::make_read resolves every read slot twice (mirror, then stamp_read, each taking the made lock and the global VIEWS lock and cloning the view) — resolve once per slot and pass the view to the stamp, with a ReadSlots counter so the frame line can price it

**@⁠borosf** on GitHub · 2026-11-26 13:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/3215) `borosf:vibe/read-slots-842ca5` → `main` · +13 −10 · 2 files · 1 commits · open ## Summary `descriptor::make_read` resolved every read slot **twice**: first `HostHeap::mirror` — the made-keys lock, the global views lock, a clone of the view, plus the kept lock when a texture view needs remaking — and then `stamp_read`, which looked the same slot up again through the same two locks and a second clone, only to stamp the `HostTexture` the view holds. `mirror` already has the view in hand and returns it, so the stamp now takes the view: `stamp_read_view(&view)`. `stamp_read` had no other caller, so it is deleted rather than left as a second way to do the same thing. - **No behaviour change in what gets stamped.** The slots `mirror` refuses are exactly the ones `stamp_read` found no made key for and returned on (its `key != 0` guard), so the set of stamped textures is identical. - **Per read slot:** one resolution instead of two — one made-keys lock, one global views lock, one view clone. These run once per submission over the slots the title's lists read (`descriptor.rs`, `make_read`), against the world's 1,300–14,400 written slots a frame quoted in that file's own comment. - `View` is `Clone` but not `Copy`, so the placed-texture upgrade clones rather than moves; that is the only new clone, and it replaces a dropped one. ## Verification Intel Arc B580, Windows 11: - `cargo test -p victory-gpu --lib --locked -- --test-threads=1` → **229 passed, 2 failed, 1 ignored**. The two failures are the known Intel heap-cap pair (`descriptor::host::tests::dynamic_slots_are_held_until_released`, `memory::tests::lists_share_a_table_and_copies_keep_their_views` — #1744/#1829) that pristine `main` `63bcca4` also fails on this card. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean with and without the `diagnostics` feature. No game data used; synthetic tests only. Stacked on nothing: branched from `main` `63bcca4`, two files, +13/−10. The magnitude is modelled from the slot rate × the two lock pairs and clone it removes, not measured — that needs a world frame with the title. claiming: GPU: descriptor::make_read resolves every read slot twice (mirror, then stamp_read, each taking the made lock and the global VIEWS lock and cloning the view) — resolve once per slot and pass the view to the stamp, with a ReadSlots counter so the frame line can price it
`descriptor::make_read` resolved every read slot twice: `mirror` (the
made keys' lock, the global views' lock, a clone of the view, and the
kept lock when a texture view needs remaking) and then `stamp_read`,
which looked the same slot up again -- the same two locks and a second
clone -- only to stamp the texture the view holds.

`mirror` already has the view in hand and returns it, so the stamp takes
it: `stamp_read_view(&view)`. `stamp_read` had no other caller and is
gone. Per read slot that is one lookup instead of two, and the stamps are
unchanged: the slots `mirror` refuses are the ones `stamp_read` found no
key for and returned on.

Verified on an Intel Arc B580, Windows 11:
- `cargo test -p victory-gpu --lib --locked -- --test-threads=1`: 229
  passed, 2 failed -- the known Intel heap-cap pair (#1744/#1829) that
  pristine main also fails on this card.
- `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean with
  and without the `diagnostics` feature.

No game data used; synthetic tests only.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:24:49 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 13:27 UTC · original · approved these changes

Verified on RTX 5090 against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib descriptor::host:: -- --test-threads=1 --skip dynamic_slots_are_held_until_released: 14/14 passed.
  • cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly avoids resolving each read slot twice.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 13:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3215#pullrequestreview-6074943126) · **approved these changes** Verified on RTX 5090 against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib descriptor::host:: -- --test-threads=1 --skip dynamic_slots_are_held_until_released`: 14/14 passed. - `cargo test -p victory-gpu --lib draw:: -- --test-threads=1`: 20/20 passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly avoids resolving each read slot twice. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
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 origin '+refs/pull/3215/head:github-bot/gh-3215'
git switch 'github-bot/gh-3215'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3215'
git switch 'github-bot/gh-3215'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3215'
git switch 'github-bot/gh-3215'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3215'
git switch 'main'
git merge --squash 'github-bot/gh-3215'
git switch 'main'
git merge --ff-only 'github-bot/gh-3215'
git switch 'main'
git merge 'github-bot/gh-3215'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3215
No description provided.