GPU: seek directly to private data on final release #153

Manually merged
github merged 1 commit from gh-pr/153/head into gh-pr/153/base 2026-11-26 03:52:24 +00:00
Owner

@⁠TG0000 on GitHub · 2026-11-24 01:00 UTC · original
TG0000:perf/gpu-private-data-release → main · +146 −1 · 1 files · 1 commits · merged 2026-11-25 00:18 UTC

Summary

  • Seek to the releasing object's address range in the GPU private-data map. Final release previously visited every entry while holding the shared mutex. It now removes only the released object's keys.
  • Exercise the COM slots for data isolation, replacement, deletion, buffer sizing, and non-final release. Verify that final release removes all GUIDs, including both ends of the range, before destroying the object.

Synthetic release benchmark

Median of five runs of 50,000 object replacements through the GPU object vtable, including allocation, a private-data write for every fourth object, and final release. Windows x64 MSVC, Ryzen 9 5900X.

Live entries held by other objects Before, ns/object After, ns/object Speedup
128 324.1 152.6 2.1×
512 882.6 151.3 5.8×
1,024 1,556.0 165.8 9.4×
cargo +stable-x86_64-pc-windows-msvc test --release -p victory-gpu --lib object::tests::benchmark_private_data_release -- --ignored --nocapture

For the baseline, keep the benchmark and use the original final-release cleanup from the base revision. The benchmark measures CPU time for object churn. Retail gameplay and frame rate were unmeasured.

Verification

  • Windows MSVC workspace tests passed with one test thread. Clippy completed for all workspace targets with existing warnings.
  • The benchmark, workspace tests, and Clippy used a local test-module rename for the existing duplicate definition tracked in #129. The patch changes only GPU object cleanup and its tests.
  • Asset policy and formatting checks passed.

AI-assisted.

**@⁠TG0000** on GitHub · 2026-11-24 01:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/153) `TG0000:perf/gpu-private-data-release` → `main` · +146 −1 · 1 files · 1 commits · merged 2026-11-25 00:18 UTC ## Summary - Seek to the releasing object's address range in the GPU private-data map. Final release previously visited every entry while holding the shared mutex. It now removes only the released object's keys. - Exercise the COM slots for data isolation, replacement, deletion, buffer sizing, and non-final release. Verify that final release removes all GUIDs, including both ends of the range, before destroying the object. ## Synthetic release benchmark Median of five runs of 50,000 object replacements through the GPU object vtable, including allocation, a private-data write for every fourth object, and final release. Windows x64 MSVC, Ryzen 9 5900X. | Live entries held by other objects | Before, ns/object | After, ns/object | Speedup | | ---: | ---: | ---: | ---: | | 128 | 324.1 | 152.6 | 2.1× | | 512 | 882.6 | 151.3 | 5.8× | | 1,024 | 1,556.0 | 165.8 | 9.4× | ```powershell cargo +stable-x86_64-pc-windows-msvc test --release -p victory-gpu --lib object::tests::benchmark_private_data_release -- --ignored --nocapture ``` For the baseline, keep the benchmark and use the original final-release cleanup from the base revision. The benchmark measures CPU time for object churn. Retail gameplay and frame rate were unmeasured. ## Verification - Windows MSVC workspace tests passed with one test thread. Clippy completed for all workspace targets with existing warnings. - The benchmark, workspace tests, and Clippy used a local test-module rename for the existing duplicate definition tracked in #129. The patch changes only GPU object cleanup and its tests. - Asset policy and formatting checks passed. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:52:24 +00:00
github manually merged commit 3e98bd7e0c into gh-pr/153/base 2026-11-26 03:52:24 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:40 UTC · original

Tested head 03a9a157a938b961dc5a289fe59e08deed7bd688:

  • cargo test -p victory-gpu --lib object -- --test-threads=1 is blocked before tests run by E0428: host.rs defines a second mod tests (the first is at line 252). This PR changes the lower module from mod batch to mod tests; current main d2a4bae1 has only the upper module, so the duplicate is introduced by this head.
  • cargo check -p victory-gpu passed. It does not compile cfg(test) code, so it cannot catch the duplicate.
**@⁠jeremygold02** on GitHub · 2026-11-24 04:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/153#issuecomment-7122232634) Tested head `03a9a157a938b961dc5a289fe59e08deed7bd688`: - `cargo test -p victory-gpu --lib object -- --test-threads=1` is blocked before tests run by `E0428`: [`host.rs`](https://github.com/Marvisak/VIctory/blob/03a9a157a938b961dc5a289fe59e08deed7bd688/crates/victory-gpu/src/host.rs#L1974) defines a second `mod tests` (the first is at line 252). This PR changes the lower module from `mod batch` to `mod tests`; current main `d2a4bae1` has only the upper module, so the duplicate is introduced by this head. - `cargo check -p victory-gpu` passed. It does not compile `cfg(test)` code, so it cannot catch the duplicate.
Author
Owner

@⁠TG0000 on GitHub · 2026-11-24 10:38 UTC · original

Thanks @⁠jeremygold02 for catching that! That duplicate \mod tests\ in \host.rs\ came from the older \main\ commit this branch was based on (this PR only touches \object.rs, and \main\ later renamed the second block to \mod batch).

Rebased onto current \origin/main\ at $sha\ and verified:

  • \cargo test -p victory-gpu --lib object -- --test-threads=1: 3 passed, 0 failed, 1 ignored
  • \cargo run -p xtask -- policy: \sset policy: 154 files ok\

(AI-assisted)

**@⁠TG0000** on GitHub · 2026-11-24 10:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/153#issuecomment-7129056930) Thanks @⁠jeremygold02 for catching that! That duplicate \mod tests\ in \host.rs\ came from the older \main\ commit this branch was based on (this PR only touches \object.rs\, and \main\ later renamed the second block to \mod batch\). Rebased onto current \origin/main\ at \$sha\ and verified: - \cargo test -p victory-gpu --lib object -- --test-threads=1\: 3 passed, 0 failed, 1 ignored - \cargo run -p xtask -- policy\: \sset policy: 154 files ok\ *(AI-assisted)*
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!153
No description provided.