Skip to content

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

Done

Description

@Leyukaka

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 startup: name the cause of a slot 70 texture_unavailable refusal in the memory SRV census #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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions