Repository navigation
Conversation
…ark) An ignored test that runs the submissions of a made-up world frame through Host::execute on made-up title memory (write-watched pools, physical pages shown through two views), at the per-frame volumes a title run published on issue Marvisak#400, and prints the parts next to the published numbers and the cost of each mechanism on its own. No title, no hardware GPU needed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --lib frame_bench— compiles cleanly and respects#[ignore]cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (184 files ok)
Clean opt-in world-frame preparation benchmark harness in host/frame_bench.rs. Looks good.
AI-assisted (Gemini 4 Neon).
…ished volumes (benchmark)
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
GPU tests: world frame preparing at published volume — test-only PR for GPU paths; can't run on macOS, relies on Windows CI.
…at the published volumes, head efb35b5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sak#2115 in; Marvisak#2150 left out for now Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Confirmed working on Windows 11 x64 / AMD Radeon RX 7600 (driver
Clean, deterministic synthetic baseline for hardware comparisons. AI-assisted; synthetic tests only, no game files, dumps, or captures used. |
|
Automated triage for the maintainers. Merge candidate (with the earlier size caveat). The new head On your reply: the three points are done as agreed. The table for the three refresh PRs is expected, not measured, so someone should run the case on them before it is used to choose between them. The earlier caveat still stands. It is about 750 lines of synthetic benchmark that needs about 3 GB when run, so whether to carry it in the tree is the maintainer's decision. CI: Generated by Claude Code |
|
Two limits I ran into while using 1. The frame never reaches the byte-merge loop of the copy-back. With temporary counters in 2.
The function is reached only behind an So a single build per side can show a ±50 % difference that has nothing to do with the change. Comparing PRs with this benchmark needs either a check that the changed code runs at all, or several builds per side (e.g. with a trivial unrelated change) before reading a difference. |
… copy-back Every range the benchmark declared was either marked (copied back by page) or stayed out of title memory (root UAVs in lists that read memory with no copy), so the byte merge of a declared range's copy-back never ran (the Marvisak#2134 review). Now one list a submission declares a two-page copy unmarked and the shaders' part changes 8 bytes of one of its pieces, without marking it: 33 pieces merged and written back a frame, a made-up volume. In its place that list makes one refresh fewer, so the refresh count stays as it was. The output prints the pieces changed, merged and the bytes written back, the bytes compared, and a unit cost of one such copy-back. A note at the top of the file and a line in the output say how to compare builds: code layout alone moved `copying back` by about half in the review, so check with the counters that the changed code runs and compare several builds per side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@shortselow-byte thank you. Both points held up when I read the code, and the head is now 1. The merge loop. You're right that nothing reached it, and it happens even before the
The fix: once per submission, list 7 refreshes one 128 KiB copy declared unmarked, and the shaders' part of list 11 changes 8 bytes of one of its pieces without a mark. That's 33 pieces a frame through
2. Layout noise. A note at the top of the file and a line in the output say what your table shows. On your setup ( What ran here, WARP only: clippy clean, the victory-gpu lib tests 146 passed, and the benchmark passed with 33 pieces merged and 2.2 MB written back a frame. That benchmark run used the unoptimized test profile, so its times aren't comparable with your AI-assisted |
|
I ran this on two machines to compare open copy PRs, and found three things. 1. It doesn't build on current 2.
That's 1,325 change checks against the 274,094 in the description. 3. It can't compare the refresh-range PRs. #2428, #1555 and #1818 each stop a batch from refreshing one In the same rounds, #2051 (copies on several threads) took preparing to 33.9–37.6 ms and 131.4–134.0 ms with identical counters. Details on #2051. AI-assisted (Claude Code). Synthetic benchmark only, no game data. |
|
@xndbogdan thank you. All three hold, and the third is the most useful: the benchmark's frame never asks one batch for two distant ranges of the same copy, so it can't tell the refresh-range PRs apart.
I'll post the head here when it's updated: main merged in, the build fixed, the new case added, and the WARP run results. Checked here by reading the code at AI-assisted |
|
Hardware verification of Setup. To put the host device on a chosen adapter I used a local test-only patch: Correctness. Every run passes its checks. The counters are identical on both adapters, in every run, and match xndbogdan's RTX 5080 / RX 9070 XT numbers:
Timings (median of 5 frames per run):
GPU time is about 1 ms a frame on both adapters, so the frame is almost entirely CPU work. That's why the two adapters overlap. The run-to-run spread (68–96 ms on the same build) is larger than the adapter difference, so these runs can't rank the GPUs. Possible causes: the 9950X3D's two CCDs and where the scheduler puts the thread, and the layout effect the bench's notes describe. Compared with xndbogdan's Ryzen 7 9800X3D + RTX 5080 (48.1–50.2 / 39.0–42.0 ms on Synthetic benchmark only, no game data. The merge and test patch are local, not pushed. AI-assisted (Claude Code). |
Two 64 KiB ranges 8 MiB apart only show whether a batch keeps one span: every change that keeps ranges apart keeps these apart. Pages 0 and 2 are asked for as well, with page 1 written and not asked for, so the bytes checked and copied also show whether ranges a page apart are joined (copying page 1) or kept as asked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Updated the head to
Thanks @JoeY54 for the hardware run (comment). They ran The earlier caveat still stands. This is about 680 lines of synthetic constants and needs about 3 GB to run, so whether to carry it in the tree is your call. Tested at
Not run: any hardware GPU, the title, and the new case on #2428, #1555 or #1818. Only synthetic data was used. No title data was used. AI-assisted |
The title run on
940d32fin #400 (comment, RX 6700 XT) put 774–1,198 ms of a 1.2–2.0 s world frame into preparing submissions on the CPU, and published the volumes behind it: 21,974 refreshes asking for 20.6 GB, 254,139 change checks over 92.8 GB of which 99.7 % was unchanged, 7,147 protect calls, 698,986 page faults. Nothing in the tree replays those volumes, so a change to the refresh, guard or arming code can only be measured in the title.This adds an ignored benchmark,
host::frame_bench::world_frame_preparing, that does. It needs no title and no hardware GPU: it runs on the software adapter.What it does
It makes 4,100 host copies of 1.6 GB of made-up title memory of the two kinds the runtime gives a title: write-watched pools, and physical pages shown through two views (one view per run, and again page by page through placeholders, reported with
title_memory_aliasedasxmemreports them). Then it records and runs frames of 33 submissions of 12 lists throughHost::executeitself, so the refresh batch,Shadow::update, the guards and their fault handler, arming, snapshots, the page table'sprepareand both copy-backs are the real ones. The lists record no GPU commands.Per frame it asks for what the published line asks for. The left column is this benchmark on
main63bcca4(WARP,diagprofile, median of 5 frames), the right the title run on940d32f:It prints the frame's parts next to the published numbers (with the
diagnosticsfeature, every counter of thecopies per frameline), and then what each mechanism costs on its own: a check of a copy nothing wrote, a check of the heap under declared ranges, declaring a range as written, a guard's round (the title's write, the fault, the next refresh) on each kind of memory with the page faults it causes, and a copy through the kernel against one in user mode.What the published line does not say is made up, and the file says so at each constant: how many copies there are and how large (4,100 of 365 KB on average follows from the checks;
memory.rsnames the count), which lists use title memory, how many ranges shaders declare, and whether the title writes the same pages every submission. Not modelled: title threads writing while a submission is prepared (the title's writes come between submissions, on the same thread), heap-indexed views (Step::Heap), textures.What it showed on
940d32f(synthetic)Ryzen 7 7800X3D, WARP,
diagprofile withdiagnostics, median of 5 frames after 2 warm-up frames, three runs:940d32f. A check costs 138–146 ns on its own and 332–354 ns through a refresh batch, 274,094 times a frame: about 90 ms, half of preparing here. A separate PR removes it.mainthe refresh batch no longer checks copies that nothing wrote: a frame makes 1,325 change checks, not the 274,094 this benchmark made on940d32fand not the title's published 254,139. JoeY54 and xndbogdan got the same counters on four hardware adapters.distant_refreshes_preparingadds one batch with ranges a page apart and 8 MiB apart in one copy, and prints how many bytes it checks and copies. That tells apart a batch that keeps one span, one that joins ranges a page apart, and one that keeps exactly what was asked.copies per frameline the comment did not quote would tell: guard faults, pages opened, pages written, page faults while preparing, protecting, moves.These are wall times of a made-up pattern on an idle process. They say which change moves which part, not what frame rate the title gets.
Next to the other benchmarks
#1743 (
world_frame_copies) and #2051 (world_frame_refreshes) replay one 174 MB heap throughupdate,writingandcopy_back, to compare copy and snapshot changes. This one is about what those leave out: thousands of copies asked for many times over, the guards, the page table'sprepare, and the submission path around them. It goes throughHost::executeand reports the diagnostics counters, so its output lines up with a tester's log.Changes outside the new file
host.rs: themodline.shadow.rs:Shadow::mark_written(tests only), which sets a page's bit in the views' written-pages bitmap as a shader does.copystat.rs:take()(tests only), the counters since they were last read.Running it
About 4 s after the build; it takes 1.6 GB of memory twice (title memory and host copies). Without
diagnosticsit runs on the default adapter and prints the times without the counters.Tested
diagnosticsbuild,VICTORY_D3D12_WARP=1): three runs on940d32f, and once more at35eac210(merged withmain63bcca4) together withdistant_refreshes_preparing.cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1at35eac210on WARP: 246 passed, 0 failed, 3 ignored.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, with and without--features diagnostics: clean.Not run: the title; any hardware GPU (everything above is the software adapter);
distant_refreshes_preparingon #2428, #1555 or #1818. The title was not used in these tests.AI-assisted
🤖 Generated with Claude Code