shader: query host readability once per region during the SRT walk #473

Closed
github-bot wants to merge 1 commit from gh-pr/473/head into gh-pr/473/base
Owner

@⁠brandostrong on GitHub · 2026-09-02 21:50 UTC · original
brandostrong:fix/srt-walk-readable-region-cache → main · +57 −6 · 3 files · 1 commits · closed without merging

Problem. With no memory reader installed (the draw path installs only the specialization reader), every SRT word the walk read called HostMemoryRangeIsReadable, one VirtualQuery syscall each. Astro Bot's first scene walks thousands of words per draw: Srt.EvaluateRuntimeSources took 1.94 ms per call, 94% of the GPU thread, about 1 fps.

Change. Add HostMemoryReadableRegion, which returns the bounds of the committed readable region containing an address, and have the evaluator cache those bounds so later words in the same region need no query. Words outside every cached region still query.

Effect. Astro Bot's first scene runs at interactive speed instead of ~1 fps.

Verification. Suites pass; measured across several Astro Bot runs.

References

  • Microsoft Docs, VirtualQuery and MEMORY_BASIC_INFORMATION: one query returns the whole region of pages with identical attributes (RegionSize), so it answers every address inside it.
**@⁠brandostrong** on GitHub · 2026-09-02 21:50 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/473) `brandostrong:fix/srt-walk-readable-region-cache` → `main` · +57 −6 · 3 files · 1 commits · closed without merging **Problem.** With no memory reader installed (the draw path installs only the specialization reader), every SRT word the walk read called `HostMemoryRangeIsReadable`, one `VirtualQuery` syscall each. Astro Bot's first scene walks thousands of words per draw: `Srt.EvaluateRuntimeSources` took 1.94 ms per call, 94% of the GPU thread, about 1 fps. **Change.** Add `HostMemoryReadableRegion`, which returns the bounds of the committed readable region containing an address, and have the evaluator cache those bounds so later words in the same region need no query. Words outside every cached region still query. **Effect.** Astro Bot's first scene runs at interactive speed instead of ~1 fps. **Verification.** Suites pass; measured across several Astro Bot runs. **References** - Microsoft Docs, `VirtualQuery` and `MEMORY_BASIC_INFORMATION`: one query returns the whole region of pages with identical attributes (`RegionSize`), so it answers every address inside it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:22:48 +00:00
github-bot closed this pull request 2026-11-26 09:22:48 +00:00

Pull request closed

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