GPU: a write through one view notes the other views written instead of opening them #853
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!853
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-853"
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?
@larelgit on GitHub · 2026-11-25 10:47 UTC · original
larelgit:perf/view-guard-lazy-aliases→main· +71 −26 · 2 files · 1 commits · openWith the view guard (
8dd30ab), the first write through any view of a guarded page opens every other view of it read-write, oneVirtualProtecteach, 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 onmain; 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 onf85101b(145 passed on9376fd6).cargo clippy -p victory-gpu --all-targets -- -D warnings(on9376fd6): 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 touchwatch.rs; the runs above are of the same change on9376fd6and8dd30ab.#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
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 10:47 UTC · original · edited 2026-11-25 10:50 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
d1980adℹ️ About Codex in GitHub
Your 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.
@MamaLeVrai on GitHub · 2026-11-25 12:23 UTC · original
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
d1980adintomainf85101bin a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warningsfails with exactly the errorsmainitself has on this machine (placed_filler_twins,depth_written, a sort; PR #841 fixes them), also with--all-features; this PR adds none.cargo test --workspace --locked: run 1: 556 passed, 0 failed, 11 ignored; run 2: stopped atindirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields(the one that fails onmainitself most runs here (PR #849 and #847 fix its assertion)) (mainalone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
@larelgit on GitHub · 2026-11-25 12:49 UTC · original
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 withmain(and with a third build not part of this pull request).Settings in every run:
VICTORY_ASYNC_SUBMIT=1 VICTORY_QUEUE2=1 VICTORY_INDIRECT_WINDOW=1 VICTORY_TEXTURE_NO_WAIT=1(noMERGE_GAP).mainf85101bf85101bmainwith the same settings in an earlier series the same day: 134, 133, 133.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
main's (133-134 over six runs). I can't tell from three runs whether it is worse or only noisy; the thirdmainrun (158, with copies at 49 ms) is unlike the other five. The defaults numbers in the description stand (three runs each on9376fd6and on8dd30ab). Whether a change that only pays without the switches is worth having is your call; I'm fine with closing this if the switches are to become the defaults.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.)
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.