Repository navigation
Conversation
…f opening them With the view guard on, the first write through any view of a guarded page opened every other view of it read-write (one VirtualProtect each), and the next check guarded them all again (one more each). The other views now stay read-only: they are only noted written, and guarded again together when a check finds the pages written. A write through one of them still faults once and is reported by the next check, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…tect opening them
…, small buffers on the card, parallel page merge, absent blocks asked outside the guards' lock, PR fxceless#853 alias guard, GPU_UPLOAD windows, legacy multiply and wide scalar loads); view guard back on in play-lod.ps1 Written by AI agents from this session's leads, reviewed and built here; measured separately. Switches: - VICTORY_INDIRECT_CARD_BUDGET (on; =0 as before): the clamp's per-list budget counter in card memory, zeroed by the clamp shader's own entry, instead of a system-memory buffer with 1-4 atomics per clamp over PCIe (after fxceless/victory-fork PR fxceless#220). - VICTORY_CARD_BUFFERS_MIN_KB (off): card copies for title buffers under 1 MiB, floor 64 KiB (after PR fxceless#200). - VICTORY_MERGE_THREADS (4; =1 as before): merge_under_writes reads contiguous stale pages in one call and compares them on scoped threads; changed_runs skips equal bytes 64 at a time; merging stays in order on the submitting thread. - VICTORY_GUARD_ABSENT_BITS (on; =0 as before): absent blocks still uncommitted are dropped from a range's runs before the guards' lock is taken (nothing marked clean, unlike parking). - PR fxceless#853 (Peppacodes et al.) ported: a write through one view no longer opens the other views of the page; they are noted written and guarded again together (plus clean_bit cleared for the alias). - VICTORY_UPLOAD_WINDOWS_MB / VICTORY_UPLOAD_WINDOWS_ROOM_MB (off): windows in GPU_UPLOAD (ReBAR) heaps, written by the CPU straight into card memory. - VICTORY_LEGACY_MUL=1|2, VICTORY_SMEM_WIDE=1 (off): plain multiplies for exact legacy-multiply cases, scalar buffer loads 4 dwords at a time. - play-lod.ps1: VICTORY_VIEW_GUARD=0 removed (walls of the cell were missing without it: same shot, screenshots). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ack on Windows) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head AI-assisted (Claude Code); no game data. |
|
Measured again on f85101b, this time with the README's new switches on, because with them the submissions are prepared on the layer's own thread and the card is much less of a wall. Same machine, scene and method as in the description. Runs alternated with Settings in every run:
So with these switches there is no gain to show: the spread between runs (129 to 158) is larger than the about 4 ms this saved with the defaults, and the branch's median (140) is not better than Picture: cell wall, window mesh and shirt print there in all six runs; no device loss. (Runs and this note by Claude Code with Claude Opus 5.5, at the account owner's request.) |
…f opening them (fxceless#853) PR: fxceless#853 Head: d1980ad Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…SET) fxceless#812 answers from Guards::unclean, and fxceless#853 marks the other views written by taking them out of clean without adding them to unclean, so the fast path did not see the write (4 watch tests failed with both; each PR alone passed). Two changes: - open: a view marked written also goes into unclean, as open_here does. - guard_unclean: when a block that is still read-only is protected again, protect_aliases, as guard does since fxceless#853. With this the 14 watch tests pass, also with VICTORY_VIEW_SET=0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not-clean set, and its check guards the other views again With the view set (fxceless#812) an asking is answered from the view blocks that are not clean. The write through another view (fxceless#853) now leaves the checked view read-only and only takes it out of the clean set: it has to go into the not-clean set too, or its next check finds nothing written and its copies keep the bytes from before the write. That check, like the walk, guards the other views of the page again (the write opened the one it went through).
…celess#24/fxceless#104), null CBVs (fxceless#304), tables at list cuts (fxceless#742), heap entries (fxceless#589), barriers (fxceless#787), depth-stencil UAV barriers (fxceless#214), windows ending at recorded writes (fxceless#663), sRGB views (fxceless#644), wide accesses across pages (fxceless#846), view-guard costs (fxceless#812/fxceless#853), the fill latch (fxceless#860), pipeline waits (fxceless#709), robustness; opt-in fxceless#868/fxceless#845
With the view guard (8dd30ab), the first write through any view of a guarded page opens every other view of it read-write, one
VirtualProtecteach, and the next check makes them all read-only again, one more each. In the first room that is about 4.7 to 4.8 million views opened a run here (theviews opened by a write through anothercounter), so some 9.5 million protection changes on the submitting and copy-back threads.This change leaves the other views read-only. A write through one view now only notes the other views written (
protected, no longerclean). The next check of any of them reports them written, as before, and guards the whole set again (protect_aliases, whichprotectnow also uses). A write through one of those other views still faults once and is opened by the handler, as before.Why the rest stays right:
protectedstill means exactly "read-only", sowriting(before the kernel writes into title memory) opens these blocks as it opens any guarded block.guardalready treated a protected block that is not clean as written;views_mappedleaves blocks in that same state.openchanges for the other views, plus the protected-not-clean branch ofguard, which now guards the other views again so a view no copy checks is not left open.Measured
RTX 5080, Ryzen 7 7800X3D, 32 GB. Diagnostics build, the same checkpoint in the first room (cell window), median ms a frame over 260-355 s of each run. The first run of each binary is listed apart.
On
main(9376fd6), alternated:VICTORY_VIEW_GUARD=0On 8dd30ab, alternated: main 182-184 (5 runs), this change 178-181 (3 runs, first run 179); wall drawn in all.
Counters per run on 9376fd6: views opened by a write through another 4,848,705 and 4,653,814 on
main; with this change 707,948, 661,846 and 732,331 views noted written (only views that were clean count), and no view is opened that way. Guard faults are about the same (558-583 against 538-552).So this takes back about 4 ms (mean 187.7 to 183.3) of the guard's 15-20 ms here. The rest is elsewhere: #812 (Peppacodes) measures the walk over absent blocks at 26 ms of the submitting thread on 9376fd6, which this does not touch.
Tests
watch::tests::a_view_no_copy_checks_is_guarded_again_by_the_checked_one: a write through the other view opens only that view and leaves the checked one read-only; the next check reports it and guards the other view again; a later write through the checked view is still seen.victory-gputests: 160 passed, 0 failed, 4 ignored on f85101b (145 passed on 9376fd6).cargo clippy -p victory-gpu --all-targets -- -D warnings(on 9376fd6): nothing in the changed files; the three findingsmainitself has (placed_filler_twins,sort_unstable_by_key,depth_written) are still there.The branch is rebased onto f85101b, which does not touch
watch.rs; the runs above are of the same change on 9376fd6 and 8dd30ab.#763 (AscilCH) also edits
open's alias loop; whichever goes in second has a small conflict there.(Change, runs and this note by Claude Code with Claude Opus 5.5, at the account owner's request.)
🤖 Generated with Claude Code