startup: slot-70 memory SRV probes unreadable memory twice per refusal #3462

Closed
opened 2026-11-29 14:58:51 +00:00 by Leyukaka · 0 comments
Leyukaka commented 2026-11-29 14:58:51 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T14:58:51Z.


On main (5de0b114), a slot-70 memory SRV whose address range is reserved but not committed is probed twice before it is refused:

  1. publish_tiled_texture calls x2w_local::readable(address, bytes) and returns null (src/startup_stubs/d3d12_memory_srv.inl:557).
  2. The caller then asks texture_unavailable_reason for the census name, and that function calls x2w_local::readable on the same range again (d3d12_memory_srv.inl:548-549; call sites :719 and :787). The second probe was added with the census cause in #2836.

readable is probe_readable (src/startup_stubs/local_log.h:135-171, :240-244, :260): it touches one byte per page under __try, so each failed probe is a first-chance access violation. The mapped_prefix pre-check refuses only MEM_FREE, so a reserved page still faults, and the shared run preset turns the pre-check off (X2W_PROBE_PRECHECK=0). Under debug_launch.py every first-chance exception stops the whole process for a debugger round trip (local_log.h:66).

A refusal that is also logged (the first 8, then the first of each new shape) probes one more byte of the same address in log_refused_memory_srv.

Measurement

One long run of the application under debug_launch.py: about 44k of these probe faults on about 15k distinct addresses in 85 s, while the frame rate fell from about 30 fps to 6-8 fps. The run stopped shortly after; the cause of the stop is not established.

#2245 (open, changes requested, currently conflicting with main) replaces the first probe in publish_tiled_texture with a page-registry lookup and a 30-frame retry cache. Its diff does not touch texture_unavailable_reason, so on a refused view the second probe would still touch the range, including for an address its cache has just skipped. I found no other open issue or PR on this.

Plan

Probe once per refusal: publish_tiled_texture reports why it returned null (over 64 MiB, unreadable, no wrapper) and texture_unavailable_reason uses that instead of probing again. Census names and refusal decisions stay the same. Small and independent of #2245; it applies on top of either readability test.

Not in this change: caching unreadable ranges across calls. That is #2245's retry cache, and it needs a reliable commit signal to be invalidated correctly.

I'm working on this.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6680218855 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3462). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T14:58:51Z. --- On `main` (`5de0b114`), a slot-70 memory SRV whose address range is reserved but not committed is probed twice before it is refused: 1. `publish_tiled_texture` calls `x2w_local::readable(address, bytes)` and returns null (`src/startup_stubs/d3d12_memory_srv.inl:557`). 2. The caller then asks `texture_unavailable_reason` for the census name, and that function calls `x2w_local::readable` on the same range again (`d3d12_memory_srv.inl:548-549`; call sites `:719` and `:787`). The second probe was added with the census cause in #2836. `readable` is `probe_readable` (`src/startup_stubs/local_log.h:135-171`, `:240-244`, `:260`): it touches one byte per page under `__try`, so each failed probe is a first-chance access violation. The `mapped_prefix` pre-check refuses only `MEM_FREE`, so a reserved page still faults, and the shared run preset turns the pre-check off (`X2W_PROBE_PRECHECK=0`). Under `debug_launch.py` every first-chance exception stops the whole process for a debugger round trip (`local_log.h:66`). A refusal that is also logged (the first 8, then the first of each new shape) probes one more byte of the same address in `log_refused_memory_srv`. ## Measurement One long run of the application under `debug_launch.py`: about 44k of these probe faults on about 15k distinct addresses in 85 s, while the frame rate fell from about 30 fps to 6-8 fps. The run stopped shortly after; the cause of the stop is not established. ## Related #2245 (open, changes requested, currently conflicting with `main`) replaces the first probe in `publish_tiled_texture` with a page-registry lookup and a 30-frame retry cache. Its diff does not touch `texture_unavailable_reason`, so on a refused view the second probe would still touch the range, including for an address its cache has just skipped. I found no other open issue or PR on this. ## Plan Probe once per refusal: `publish_tiled_texture` reports why it returned null (over 64 MiB, unreadable, no wrapper) and `texture_unavailable_reason` uses that instead of probing again. Census names and refusal decisions stay the same. Small and independent of #2245; it applies on top of either readability test. Not in this change: caching unreadable ranges across calls. That is #2245's retry cache, and it needs a reliable commit signal to be invalidated correctly. I'm working on this.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#3462
No description provided.