Texture turns back off while they find nothing #83

Closed
github-bot wants to merge 0 commits from github-bot/gh-83 into main AGit
Owner

@⁠mgrein on GitHub · 2026-11-30 09:14 UTC · original
mgrein:texture-turn-backoff → main · +63 −4 · 1 files · 47 commits · closed without merging

A guarded texture is hashed whole on its turn (every eighth frame, staggered by address) to catch a write through another view of its pages that the write guard cannot see. Counting why texture refreshes read memory in the world of a new retail game showed that these turns are nearly all of it: about 32 textures and 30 MB hashed a frame, and not one change found in a whole run.

This makes each texture's turns back off while they find nothing:

  • A turn that finds nothing doubles that texture's interval, up to VICTORY_TEXTURE_TURN_MAX frames (64 by default, a power of two from 8 to 1024).
  • A turn that finds a change (a blind write) puts the texture back to every eighth frame, as before. The existing hot-texture handling is unchanged.
  • VICTORY_TEXTURE_TURN_MAX=8 gives the old behaviour for all textures.

Written, exact and hot textures are read exactly as before; only the "nothing seen, its turn" reads are spaced out.

Measured

RTX 4070, Ryzen 5 5600X, Series S profile, DLSS quality + frame generation, with VICTORY_SUBMIT_SPLIT=1, VICTORY_ASK_FIRST=1 and VICTORY_OFF_LINE=1. Two 7.5-minute idle runs in the world, compared at the same number of list calls a frame (the idle camera differs per run):

before after
texture refreshes, all threads 11-15 ms a frame 3-5 ms a frame
turn reads 32 textures, 30 MB a frame 5 textures, 4 MB a frame
blind changes found 0 0
submitting thread at 45-55k list calls 48-51 ms 41-44 ms

Separate runs of one build differ by up to about 3 ms at the same load, so I'd call the frame gain 2-5 ms; the texture refresh time is a direct counter and is the clearer number.

Tests

turns_back_off_while_nothing_changes (intervals, the cap, staggering); cargo test -p victory-gpu --lib texture passes.

The risk is a texture written only through another view, which is now caught up to 64 frames late instead of 8 once it has been quiet for a while; the first change found takes it back to every eighth frame.

🤖 Generated with Claude Code

**@⁠mgrein** on GitHub · 2026-11-30 09:14 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/83) `mgrein:texture-turn-backoff` → `main` · +63 −4 · 1 files · 47 commits · closed without merging A guarded texture is hashed whole on its turn (every eighth frame, staggered by address) to catch a write through another view of its pages that the write guard cannot see. Counting why texture refreshes read memory in the world of a new retail game showed that these turns are nearly all of it: about 32 textures and 30 MB hashed a frame, and not one change found in a whole run. This makes each texture's turns back off while they find nothing: - A turn that finds nothing doubles that texture's interval, up to `VICTORY_TEXTURE_TURN_MAX` frames (64 by default, a power of two from 8 to 1024). - A turn that finds a change (a blind write) puts the texture back to every eighth frame, as before. The existing hot-texture handling is unchanged. - `VICTORY_TEXTURE_TURN_MAX=8` gives the old behaviour for all textures. Written, exact and hot textures are read exactly as before; only the "nothing seen, its turn" reads are spaced out. ## Measured RTX 4070, Ryzen 5 5600X, Series S profile, DLSS quality + frame generation, with `VICTORY_SUBMIT_SPLIT=1`, `VICTORY_ASK_FIRST=1` and `VICTORY_OFF_LINE=1`. Two 7.5-minute idle runs in the world, compared at the same number of list calls a frame (the idle camera differs per run): | | before | after | |---|---|---| | texture refreshes, all threads | 11-15 ms a frame | 3-5 ms a frame | | turn reads | 32 textures, 30 MB a frame | 5 textures, 4 MB a frame | | blind changes found | 0 | 0 | | submitting thread at 45-55k list calls | 48-51 ms | 41-44 ms | Separate runs of one build differ by up to about 3 ms at the same load, so I'd call the frame gain 2-5 ms; the texture refresh time is a direct counter and is the clearer number. ## Tests `turns_back_off_while_nothing_changes` (intervals, the cap, staggering); `cargo test -p victory-gpu --lib texture` passes. The risk is a texture written only through another view, which is now caught up to 64 frames late instead of 8 once it has been quiet for a while; the first change found takes it back to every eighth frame. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A guarded texture is hashed whole on its turn, every eighth frame, to
catch a write through another view of its pages that the guard cannot
see. In the world those turns hashed about 30 MB a frame and never found
a change in a whole run. Each turn that finds nothing now doubles the
texture's interval, up to VICTORY_TEXTURE_TURN_MAX frames (64 by
default; 8 keeps every eighth frame for all); a turn that finds a change
takes it back to every eighth frame.

Measured in the world (switches SUBMIT_SPLIT, ASK_FIRST, OFF_LINE on):
texture refreshes 12 ms -> 3 ms a frame over all threads, turns 32
textures (30 MB) -> 5 (4 MB) a frame; the submitting thread 2-5 ms
less at the same number of list calls a frame (runs differ by up to
3 ms there).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 09:19:36 +00:00
github-bot closed this pull request 2026-12-01 01:10:33 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:36 UTC · original

A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection.

Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:36 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/83#issuecomment-7297692268) A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection. Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.