Repository navigation
Conversation
… page A range declared as written through views whose writes shaders mark is armed, so that the title's first write to one of its pages keeps the page's bytes from before. Arming put every page of the range into a set: a root view declares its copy from its address to the end, so each declaration on the world's 174 MB heap cost up to 2,784 set entries, 31-36 microseconds in a synthetic measurement, however many declarations before it had armed the same pages. The armed pages are now kept as the runs declared, none inside another, with the single pages a copy-back takes out of them kept apart until the tracker is disarmed. Which pages are armed is the same as before. 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 watch::— 7 passed, 0 failed (includingarmed_ranges_keep_their_pages_bytes_from_before_the_first_write)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean run-based arming of writable shader page ranges in watch.rs. Looks good.
AI-assisted (Gemini 4 Neon).
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.
Shader-writable ranges armed as runs of pages — page-granularity WPM arming; relates to #1865's dirty-bitmaps/WPM work.
…rite are armed as runs of pages, head f869790) 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>
|
@catminou4 on the relation to #1865: the two do not overlap. #1865 changes only AI-assisted |
|
Verified head
Finding (
|
Runs armed end to end or overlapping (descriptor tables' UAV sub-ranges) each stayed a run of their own, so arming was quadratic in them and the write handler's check of a page, under the guards' lock, scanned them all. Arming now merges every run it overlaps or touches, and a page's check is a binary search. Reported by nathanbzrr on Marvisak#2147. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@nathanbzrr thank you, the finding holds. Pushed as
Verified on WARP ( AI-assisted; synthetic tests only, no title data used. |
|
In-game counters from one PC: RTX 5070 (driver 616.92), Ryzen 7 7800X3D (max processor state 99 %), Windows 11, diagnostics builds, This is not a same-frame A/B:
The scenes are different moments of the opening. Here are the preparing steps of the
AI-assisted |
|
Automated triage for the maintainers. Merge candidate. Generated by Claude Code |
Since cd94d35 a range declared as written through views whose writes shaders mark keeps no snapshot:
Shadow::writingarms it instead (Tracked::arm), so that the title's first write to one of its pages keeps the page's bytes from before. Arming puts every 64 KiB page of the range into aBTreeSet, once per declaration.A root view declares its copy from its address to the copy's end (
draw.rs,root_view:shadow.left(address)when the copy is marked). On the world's 174 MB heap that is up to 2,784 set entries for each such draw or dispatch, however many declarations before it armed the same pages, andHostList::defer_gpu_writedoes not merge them.The change
watch::Savedkeeps the armed pages as the runs declared, none inside another, and the single pages a copy-back takes out (Tracked::unarm) in a set of their own until the tracker is disarmed. A declaration inside a run already armed costs a scan of the runs; a root view's runs all end at the copy's end, so the heap's collapse into one.Which pages are armed at any moment is the same as before:
armre-arms a page that was taken out, as the set insert did, anddisarmclears both.Numbers (synthetic)
The unit cost printed by the benchmark of #2134, WARP,
diagprofile withdiagnostics, 200 declarations each:mainThat benchmark's frame declares the heap 66 times, so this is about 2 ms of its 168–225 ms preparing: below the run-to-run spread, and I am not claiming a frame time from it. The job that measured this branch ran with the machine busy (
mainalone gave 306 and 722 ms in it), so its frame times compare nothing.How much this is in the title depends on how many ranges a world frame declares through marked root views, which no published log says: the
GPU writesstep of thecopies per frameline (563 ms in the #400 run) holds this together with the refresh batch that step flushes and the snapshots. At thousands of draws a frame it could be tens of milliseconds; a tester's line before and after would say.Not a duplicate of
#435 merges identical declarations (same copy, address and length) at submission, and #2102 changes the hasher of the per-list and per-submission sets. Neither changes what one declaration costs to arm. This merges cleanly with #2136.
Tested
watch::tests::armed_ranges_keep_their_pages_bytes_from_before_the_first_write: pages of overlapping armed ranges keep their bytes from before the first write, a page next to the range and a page taken out keep none, arming again arms it again, and nothing is kept afterdisarm.shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed, which arms a copy and relies on the saved page, passes unchanged.victory-gpusuite on WARP (diagnosticsbuild,VICTORY_D3D12_WARP=1, one thread): 147 passed, 0 failed, 2 ignored.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, with and without--features diagnostics: clean.Not run: the title; any hardware GPU (the suite and the benchmark ran on the software adapter only);
cargo test --workspace. The title was not used in these tests.AI-assisted
🤖 Generated with Claude Code