Skip to content

startup: stop probing unmapped guest memory from the texture and no-op paths - #3767

Open
Leyukaka wants to merge 3 commits into
R0Y00:mainfrom
Leyukaka:takeover-2245
Open

Leyukaka wants to merge 3 commits into
R0Y00:mainfrom
Leyukaka:takeover-2245

Conversation

@Leyukaka

@Leyukaka Leyukaka commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Takes over #2245 by @Its3rr0rsWRLD, which had no activity for 48 h. Their commits are kept unchanged; I will hand back if they resume. Supersedes #2245.

Changes

Texture publication and the no-op paths no longer probe guest memory that is not mapped yet, and a texture published by address is retried once the mapping exists.

Rebased the original patch onto main 959306d4 and carried forward the merge resolutions by pigalot. The original commit message mentions export ordinal 23. The rebased code uses ordinal 28 and preserves the existing exports. Removed the 30-frame skip from SRV publication so a second call can succeed immediately after mapping. The existing probe fixture still expects one fault for a repeat on an ordinary reservation. The fixture now also maps the texel and samples it through the retried SRV. Also removed a BOM from tests/xmem_mapped_bytes_check.py.

Verification

Commit aeee2fbcb, dev preset, targets xmem_shim startup_queue_probe startup_stream_consumer:

ctest --preset dev --no-tests=error -R '^(xmem_mapped_bytes|startup_queue_probe_(reserved|xmem)_(warp|hardware)|startup_memory_srv_diag_(warp|hardware|supported_control_warp)|startup_address_(srv_(warp|hardware)|(single_element|bc_view|console|volume_srv)_.*)|startup_resource_address_index_missing_control_warp)$' -V

33/33 passed.

Its3rr0rsWRLD and others added 3 commits December 1, 2026 17:25
…p paths

Every readability probe that touches an unmapped page raises a first-chance access violation. Under
the debug launcher each one stops the process for a debugger round trip. On the title tested there
were about 21000-25000 of them per run, almost all before the intro: by-address (slot-70) textures
whose pages were not mapped yet, and a queue no-op slot (31) called every frame with the base of a
physical-page pool whose mapping had failed. Slot 31 is now handled by queue_page_mappings (R0Y00#2307);
the shape-check cap below still covers the slots left to queue_dynamic.

No intended behaviour change: the same addresses are found readable or unreadable as before; only how
that is found changes. The one timing difference is the 30-frame retry interval for by-address
texture addresses found unmapped (below).

- xmem: new export x2w_xmem_mapped_bytes(address, bytes, &mapped) answers from the page registry,
  without touching memory, how many bytes from address are mapped. It answers only inside xmem's
  page-mapping reservations; for any other address, a range past the reservation, a range a commit at
  address may cover, or an unmapped answer Windows does not confirm as reserved, it gives no answer
  and the caller probes as before.
- d3d12_xs: readable_window asks xmem first (unmapped: no touch; mapped prefix: probed as before).
  publish_tiled_texture, names_known_iid, hex_text and the ExecuteCommandLists shape test in
  queue_dynamic go through readable_window instead of x2w_local::readable.
- A by-address texture address that a probe found unmapped is not probed again for 30 frames
  (unless a write to it is announced).
- queue_dynamic checks only the first 32 calls of a slot for an IID, like noop_slot and
  device_noop_slot already do.
- The 5 s report logs "x2w-d3d12 readability: unmapped by xmem's page registry N, unreadable probes
  skipped N".
- xmem_shim.def: x2w_xmem_mapped_bytes is ordinal 23 (17-22 are taken on main).
- Tests: xmem_mapped_bytes (the export's answers), startup_queue_probe_{reserved,xmem}_{warp,hardware}
  (200 calls of unknown queue slot 30 with a reserved, unmapped r9: at most 32 faults without xmem,
  0 with it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc

R0Y00 commented Dec 2, 2026

Copy link
Copy Markdown
Owner

The Linux job's final failed check is tests/standin_exports_check.py. Please rebase, verify the export expectations against the updated stand-in, and rerun that check.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the clean merge tree with main e958b8e8. python -B tests/standin_exports_check.py still fails with xmem entries 56 != 54. The extra name and ordinal are x2w_xmem_mapped_bytes and 28; the current catalog classifies both as unmeasured. On the combined tree, changing the expected total to 56 and unmeasured count to 4 makes all 475 checks and all six mutation controls pass. Please update the expectations and add a named/ordinal equivalence assertion for the new export when rebasing.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants