Look up views once per range in watch::writing, and drop ended pins #67
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/67"
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 Belobug/VIctory-Belobug-AMD. Originally posted by romainhedouin on 2026-11-25T13:16:34Z.
watch::writingruns for every copy into title memory, every copy-back, every readback row, everyReadFileand every raw DirectStorage request. For each 64 KiB block of the range it locked the views table and copied that block's list of views into a newVec, even for pages with a single view that it then skipped. It now locks the views table once for the whole range and only collects the other views of pages that have several. It also drops pins that have ended when adding a new one (they end in the order they are made, so this is a pop from the front); before, they were only dropped on the slow path ofguard()and could pile up, making every pin check scan them. Same pins, same blocks opened.writing()call over N blocks"Model benchmark" = the same logic copied into a standalone program and timed in release mode on a Mac, not in the game. The model asserts identical pins and opened blocks for the old and new code. Type-checked for Windows (
cargo clippy --target x86_64-pc-windows-msvc, with and without--all-features, no new warnings); not run.🤖 Generated with Claude Code
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T15:08:54Z.
Review: COMMENTED
AI-assisted review: I checked the changed behavior and the associated test coverage.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T15:08:54Z.
Code review location:
crates/victory-gpu/src/watch.rs; line 664The existing alias tests write through a mapped view and exercise the exception path, but they do not call writing() on a range spanning aliased blocks. Could one test verify that this bulk alias collection leaves each corresponding other view writable and reports it on the next guard check? AI-assisted review; I checked the changed range walk against the existing alias tests.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by romainhedouin on 2026-11-26T22:24:34Z.
Closing: on
a-publier,watch::writingno longer pins or walks views block by block. It takes the guards' lock only when thePROTECTEDbitmap shows a protected block (watch.rs:3222).Pull request closed