d3d12 port 2: memcpy/memmove wrap marks 0 of ~10,700 heap copies a frame; fallback finds ~6 missed view records a frame, writers outside the title image #3259

Open
opened 2026-12-02 22:57:42 +00:00 by lerapeurdu62280-debug · 1 comment
lerapeurdu62280-debug commented 2026-12-02 22:57:42 +00:00 (Migrated from github.com)
Contributor

Imported from ubiquitarianism/leonida. Originally posted by lerapeurdu62280-debug on 2026-12-02T22:57:42Z.


Renderer port 2 (LEONIDA_PORT_DESCRIPTORS=1, set by the launcher) misses view records every frame, and its memcpy/memmove wrap marks none of the copies it sees.

Build: main 895c472fa (also seen after 16243cd6e), Ryzen 5 3600, RX 6600 8 GB, Series S, standing in the world. From the runtime's own lines (play-*.log):

renderer port 2 (LEONIDA_PORT_DESCRIPTORS=1) per frame: 127362 slots told (of them 5121 marked by our calls, the rest by the title's 6 patched stores) in 28.2 takings, 1.427 ms taking; of the title's memcpy/memmove calls into the heap 10682, 0 records they marked; fallback: 14.5 pages looked at whole, 6.09 view records no store told of (3.91 of them of draws' tables), 2332 other records changed, 0.0 told and not taken yet; since the start: 901206882 slots told (51208762 by our calls), 155011 pages looked at, 71388 view records missed; their writers: 0x7ffb99ec0000 (not the title's) 12207, 0x7ffc2d65af97 (not the title's) 9826, 0x7ffb99ec0080 (not the title's) 9061, title+0x4d9f264 7775, 0x7ffc2d65b043 (not the title's) 7148, 0x7ffc2d65b07c (not the title's) 5923
  • ~10,700 title memcpy/memmove calls a frame land in the heap; copied (port_descriptors.rs) marks 0 of them (the fork the port comes from saw ~250 view records a frame copied that way).
  • The fallback then finds ~6 view records a frame (about 4 of draws' tables) that no mark told of: ~22 a second, 16,572 WARN lines in a 13-minute session, 71,000 since the start. Each is shown stale until the fallback reaches its page.
  • The writers it names are mostly outside the title image. In that run the image was at 0x7ffb99f30000, so 0x7ffb99ec0000 / 0x7ffb99ec0080 lie 0x70000 below it (the area console_insn::near gives code stubs, e.g. the clzero stubs?), and 0x7ffc2d65xxxx is another module (not resolved).

Possible lead: stores from patched stubs placed near the title (clzero loops replaced by plain stores, LEONIDA_PATCH_CLZERO) are not among the six patched store sites, so a record they write goes unmarked. Not verified.

Could be related to textures briefly missing or black (black balusters on a railing seen here).

EI S.O.S INFO LUDO

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:6756313601 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3259). Originally posted by [lerapeurdu62280-debug](https://github.com/lerapeurdu62280-debug) on 2026-12-02T22:57:42Z. --- Renderer port 2 (`LEONIDA_PORT_DESCRIPTORS=1`, set by the launcher) misses view records every frame, and its memcpy/memmove wrap marks none of the copies it sees. Build: main 895c472fa (also seen after 16243cd6e), Ryzen 5 3600, RX 6600 8 GB, Series S, standing in the world. From the runtime's own lines (`play-*.log`): ``` renderer port 2 (LEONIDA_PORT_DESCRIPTORS=1) per frame: 127362 slots told (of them 5121 marked by our calls, the rest by the title's 6 patched stores) in 28.2 takings, 1.427 ms taking; of the title's memcpy/memmove calls into the heap 10682, 0 records they marked; fallback: 14.5 pages looked at whole, 6.09 view records no store told of (3.91 of them of draws' tables), 2332 other records changed, 0.0 told and not taken yet; since the start: 901206882 slots told (51208762 by our calls), 155011 pages looked at, 71388 view records missed; their writers: 0x7ffb99ec0000 (not the title's) 12207, 0x7ffc2d65af97 (not the title's) 9826, 0x7ffb99ec0080 (not the title's) 9061, title+0x4d9f264 7775, 0x7ffc2d65b043 (not the title's) 7148, 0x7ffc2d65b07c (not the title's) 5923 ``` - ~10,700 title memcpy/memmove calls a frame land in the heap; `copied` (port_descriptors.rs) marks 0 of them (the fork the port comes from saw ~250 view records a frame copied that way). - The fallback then finds ~6 view records a frame (about 4 of draws' tables) that no mark told of: ~22 a second, 16,572 WARN lines in a 13-minute session, 71,000 since the start. Each is shown stale until the fallback reaches its page. - The writers it names are mostly outside the title image. In that run the image was at 0x7ffb99f30000, so 0x7ffb99ec0000 / 0x7ffb99ec0080 lie 0x70000 below it (the area `console_insn::near` gives code stubs, e.g. the clzero stubs?), and 0x7ffc2d65xxxx is another module (not resolved). Possible lead: stores from patched stubs placed near the title (clzero loops replaced by plain stores, `LEONIDA_PATCH_CLZERO`) are not among the six patched store sites, so a record they write goes unmarked. Not verified. Could be related to textures briefly missing or black (black balusters on a railing seen here). EI S.O.S INFO LUDO
zmasi commented 2026-12-03 07:55:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T07:55:18Z.


Opened #3306 (f8751e2a39) for this report — thank you @lerapeurdu62280-debug for the detailed port_descriptors log line!

What those numbers and addresses were showing

  1. 0x7ffb99ec0000 and 0x7ffb99ec0080 (base - 0x70000): console_insn::near places descriptor_sites::apply's six patched vmovups stubs at base - 0x70000 (+0x00 is SITES[0], +0x80 is SITES[2], 0x40 stride). Those stubs do mark their own slots (0.0 told and not taken yet), but because a.writers records one last-faulting RIP per 64 KiB block (2,048 slots), whenever a patched stub or copy helper unguarded a 64 KiB block first, any later unmarked write into that open block inherited the stub's RIP.
  2. 0 / 10,682 memcpy/memmove marks vs 0x7ffc2d65af97/b043/b07c: With LEONIDA_OWN_UPSCALER=1 on by default, the ~10,700 memcpy/memmove calls into the +0x4d9f400 frame allocator are non-view constants and list nodes, while view-record copies through RtlMoveMemory / RtlCopyMemory (ntdll / kernel32), memcpy_s / memmove_s, or dynamic GetProcAddress lookups were unwrapped.
  3. LEONIDA_STORE_BESIDE=1 sparse stores: Faulting stores executed beside a guard via titlewrite::store (<= 4 faults in a 64 KiB block) returned EXCEPTION_CONTINUE_EXECUTION before port_descriptors::faulted, neither marking VIEW_TAG writes nor recording the writer RIP.

#3306 wraps the RTL/safe copy exports (both static IAT and GetProcAddress), marks VIEW_TAG beside-guard stores in titlewrite::store, and suppresses self-blaming block faults from our own stubs/wrappers so any remaining unpatched title store RVA (such as title+0x4d9f264) is attributed directly.

AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7371593433 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3259#issuecomment-7371593433). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-03T07:55:18Z. --- Opened #3306 (`f8751e2a39`) for this report — thank you @lerapeurdu62280-debug for the detailed `port_descriptors` log line! ### What those numbers and addresses were showing 1. **`0x7ffb99ec0000` and `0x7ffb99ec0080` (`base - 0x70000`)**: `console_insn::near` places `descriptor_sites::apply`'s six patched `vmovups` stubs at `base - 0x70000` (`+0x00` is `SITES[0]`, `+0x80` is `SITES[2]`, `0x40` stride). Those stubs do mark their own slots (`0.0 told and not taken yet`), but because `a.writers` records one last-faulting RIP per 64 KiB block (`2,048` slots), whenever a patched stub or copy helper unguarded a 64 KiB block first, any later unmarked write into that open block inherited the stub's RIP. 2. **`0 / 10,682` `memcpy`/`memmove` marks vs `0x7ffc2d65af97/b043/b07c`**: With `LEONIDA_OWN_UPSCALER=1` on by default, the ~10,700 `memcpy`/`memmove` calls into the `+0x4d9f400` frame allocator are non-view constants and list nodes, while view-record copies through `RtlMoveMemory` / `RtlCopyMemory` (`ntdll` / `kernel32`), `memcpy_s` / `memmove_s`, or dynamic `GetProcAddress` lookups were unwrapped. 3. **`LEONIDA_STORE_BESIDE=1` sparse stores**: Faulting stores executed beside a guard via `titlewrite::store` (`<= 4` faults in a 64 KiB block) returned `EXCEPTION_CONTINUE_EXECUTION` before `port_descriptors::faulted`, neither marking `VIEW_TAG` writes nor recording the writer RIP. #3306 wraps the RTL/safe copy exports (both static IAT and `GetProcAddress`), marks `VIEW_TAG` beside-guard stores in `titlewrite::store`, and suppresses self-blaming block faults from our own stubs/wrappers so any remaining unpatched title store RVA (such as `title+0x4d9f264`) is attributed directly. AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).
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
ProjectLeonida/mandy#3259
No description provided.