Check a texture for writes without building lists #32

Open
github-bot wants to merge 1 commit from github-bot/gh-32 into a-publier AGit
Owner

@⁠romainhedouin on GitHub · 2026-11-25 12:32 UTC · original
romainhedouin:perf/watch-writes-no-vec → a-publier · +62 −13 · 2 files · 1 commits · open

A sampled texture's refresh (texture.rs, twice in refresh_timed) only asks "was a page of my memory written since I last looked?", but watch::writes built a list of every noted page in the range for it to scan. The new watch::written_since answers from the same asking, looking at the journal in place under the same locks, and stops at the first newer page; writes now goes through the same code and answers exactly as before.

Per texture check, K noted pages in range, answered from the journal Before After
Allocations (model, counted) 2 (K ≤ 4), 4 (K = 16), 6 (K = 64) 1
Model benchmark, K = 16 136–150 ns 47–49 ns
Model benchmark, K = 64 334–348 ns 112–114 ns

"Model benchmark" = a-publier's Notes::each/range copied into a standalone program, unchanged texture (no newer page, so the whole range is scanned), timed in release on a Mac, not in the game. The one allocation left is the journal's pieces list, which this PR doesn't touch. Kernel askings are unchanged.

Tested: Windows clippy (with and without --all-features) adds no warnings, and an assertion for written_since is added to written_pages_are_reported_to_every_asker; watch.rs and texture.rs are Windows-only, so nothing ran here.

🤖 Generated with Claude Code

**@⁠romainhedouin** on GitHub · 2026-11-25 12:32 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/32) `romainhedouin:perf/watch-writes-no-vec` → `a-publier` · +62 −13 · 2 files · 1 commits · open A sampled texture's refresh (texture.rs, twice in `refresh_timed`) only asks "was a page of my memory written since I last looked?", but `watch::writes` built a list of every noted page in the range for it to scan. The new `watch::written_since` answers from the same asking, looking at the journal in place under the same locks, and stops at the first newer page; `writes` now goes through the same code and answers exactly as before. | Per texture check, K noted pages in range, answered from the journal | Before | After | |---|---|---| | Allocations (model, counted) | 2 (K ≤ 4), 4 (K = 16), 6 (K = 64) | 1 | | Model benchmark, K = 16 | 136–150 ns | 47–49 ns | | Model benchmark, K = 64 | 334–348 ns | 112–114 ns | "Model benchmark" = a-publier's `Notes::each`/`range` copied into a standalone program, unchanged texture (no newer page, so the whole range is scanned), timed in release on a Mac, not in the game. The one allocation left is the journal's `pieces` list, which this PR doesn't touch. Kernel askings are unchanged. Tested: Windows clippy (with and without `--all-features`) adds no warnings, and an assertion for `written_since` is added to `written_pages_are_reported_to_every_asker`; watch.rs and texture.rs are Windows-only, so nothing ran here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:33:55 +00:00
github-bot changed target branch from main to a-publier 2026-11-27 00:59:53 +00:00
github-bot force-pushed github-bot/gh-32 from 434d9852dc to dcdbf69447 2026-11-27 00:59:54 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/32/head:github-bot/gh-32'
git switch 'github-bot/gh-32'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-32'
git switch 'github-bot/gh-32'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-32'
git switch 'github-bot/gh-32'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-32'
git switch 'a-publier'
git merge --squash 'github-bot/gh-32'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-32'
git switch 'a-publier'
git merge 'github-bot/gh-32'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.