Fix severe GPU resource retirement performance regression introduced by #563 #591
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/591"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LooperSalty/AnyXboxX. Originally posted by XxXFixuXxX on 2026-11-28T22:55:33Z.
<html>
Change
Refs #563
Fixes a severe performance regression in relay descriptor resource retirement by batching retirements per completed submission.
Profiling identified repeated ordered insertions into the retirement queue through
insert_retiredas the primary bottleneck. Approximately 91.7% of insertions were out of order, with insertion costs reaching approximately 1408 ms per frame.This change reuses the existing
merge_retired_batchmechanism instead of repeatedly inserting individual resources into the ordered queue.The patch preserves retirement stamp ordering, including equal stamps, and is designed to preserve existing resource lifetime and synchronization semantics.
Only
third_party/victory/crates/victory-gpu/src/host.rsis modified.Performance results
Hardware:
Build | Average base FPS -- | -- Before #563 (AMD Ryzen 9 5900X
NVIDIA RTX 3090 24 GB
64 GB DDR4 RAM
Windows, NVMe SSD
4bfb5bd) | 8.17 After #563 (4079f2b) | 0.42 With retirement batching (3301ba5) | 8.16Approximately 19.4x higher base FPS compared with the regressed build in the tested workload.
The measured WHY_READ cost decreased from approximately 1629 ms to 62 ms per frame.
DLSS and frame generation were disabled.
These are local, workload-specific measurements on the earlier development base, not a general performance guarantee. Performance has not yet been rebenchmarked on the final rebased commit.
Verification
Final commit:
7329e82Upstream base:
66b92fbRelease build:
Result:
The build completed with warnings but no errors.
GPU library unit tests:
Result:
Python tests:
Result:
All three failing tests were independently reproduced on an unmodified checkout of upstream commit
66b92fb:test_unfused_multiply_add_nans_match_the_python_modeltest_float_atomic_programs_match_the_python_modeltest_interpolation_programs_match_the_python_modelBaseline verification:
Using the same Python virtual environment:
Result:
No tests were disabled or modified to suppress these failures.
Ruff:
Result:
Git diff validation:
Result: no output.
GPU performance measurements were performed on an RTX 3090. The GPU library test suite also included WARP tests.
A fresh runtime benchmark on the final rebased commit and a full Rust workspace test run have not been performed. The ignored GPU tests were not run.
Oracle and test data
No decoder or HLSL translation changes.
The retirement regression tests use synthetic data constructed within the Rust tests. No external test data is introduced.
The following retirement batch tests passed:
relay_batch_appends_ordered_stampsrelay_batch_merges_out_of_order_stampsrelay_batch_retains_order_for_equal_stampsa_late_batch_does_not_hide_eligible_retirementsThe performance regression was reproduced before the change, and the earlier patched build restored performance in the measured workload.
A separate failing-before/passing-after unit test run has not been demonstrated.
Checklist
The PR covers a single reviewable behaviour.
A test fails without this change and passes with it.
The commands and results of each check are given above.
An unimplemented function returns an error (
E_NOTIMPL), never a fake success. (Not applicable: no unimplemented functions added.)README: the same change in the English and French READMEs (
test_readme_sync.pychecks it). (Not applicable: no README changes.)No game, console or SDK file, no key, no dump, no download link.
Findings drawn from a title: limited to what rule 2 of
AGENTS.mdallows. Only aggregate runtime performance measurements are reported.Code taken from another project: compatible licence and credit in
THIRD_PARTY.md. (Not applicable: the patch reuses existing repository code.)AI assistance
OpenAI Codex and ChatGPT assisted with regression analysis, profiling, implementation, testing and preparation of this pull request. The contributor performed local builds and benchmarks.
Experimental descriptor allocator changes and additional diagnostic instrumentation are intentionally excluded from this PR.
</html>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.