[PR #969] [CLOSED] dstorage: requests into physical pages write the title's pages (RT-DSTORAGE-DEST-PAGES) #1007

Closed
opened 2026-11-26 20:19:46 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/969
Author: @DadaCap
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: dstorage-dest-pages


📝 Commits (1)

  • e56789a dstorage: requests into physical pages write the title's pages (RT-DSTORAGE-DEST-PAGES)

📊 Changes

6 files changed (+155 additions, -7 deletions)

View changed files

📝 docs/directstorage.md (+14 -3)
📝 runtime/shims/dstorage.cpp (+34 -3)
📝 runtime/shims/xmem.cpp (+28 -0)
📝 runtime/shims/xmem.h (+8 -0)
📝 runtime/test/dstorage_test.cpp (+60 -1)
📝 runtime/test/xmem_test.cpp (+11 -0)

📄 Description

Claim: RT-DSTORAGE-DEST-PAGES (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136979744).

A DirectStorage request with DestinationIsPhysicalPages runs into a staging buffer and its bytes then go to the 64 KiB pages XMemAllocatePhysicalPages gave out (rt::xmem::write_physical_pages), so every address they are mapped at sees them. Until now it answered E_NOTIMPL.

The page array is read when the request runs, not at enqueue. The retail title passes a pointer into its own page table: at enqueue the entries are 0, and they are filled by the time the request runs. Measured on 1.0.2.1 (in my prototype stack): with a copy taken at enqueue nearly every such request named page 0; read late, no request failed in a 240 s run that reaches the loading screen.

The xmem shim is called through a pointer, as dstorage_test does not link it; without it such a request stays E_NOTIMPL. Physical-page sources stay E_NOTIMPL (none has been seen).

Tested

  • dstorage_test: 341 checks, 0 failures (new: the table filled after enqueue, the offset, three pages, a page that is not live, a null and an unreadable array). xmem_test: 220 checks OK (new: writes across pages, into uncommitted ones, bad page numbers). Windows 11, MSVC, Release-with-debug-info, on main.
  • Retail package: only in my prototype stack, not on this branch alone (RTX 5080, driver 621.24, Windows 11).
  • No game data.

AI-assisted (Claude Code, Opus 5.5).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/969 **Author:** [@DadaCap](https://github.com/DadaCap) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `dstorage-dest-pages` --- ### 📝 Commits (1) - [`e56789a`](https://github.com/ubiquitarianism/leonida/commit/e56789a345aebd0e99ff1f3b4c0fe0e3956b5b5a) dstorage: requests into physical pages write the title's pages (RT-DSTORAGE-DEST-PAGES) ### 📊 Changes **6 files changed** (+155 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/directstorage.md` (+14 -3) 📝 `runtime/shims/dstorage.cpp` (+34 -3) 📝 `runtime/shims/xmem.cpp` (+28 -0) 📝 `runtime/shims/xmem.h` (+8 -0) 📝 `runtime/test/dstorage_test.cpp` (+60 -1) 📝 `runtime/test/xmem_test.cpp` (+11 -0) </details> ### 📄 Description Claim: RT-DSTORAGE-DEST-PAGES (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136979744). A DirectStorage request with `DestinationIsPhysicalPages` runs into a staging buffer and its bytes then go to the 64 KiB pages `XMemAllocatePhysicalPages` gave out (`rt::xmem::write_physical_pages`), so every address they are mapped at sees them. Until now it answered `E_NOTIMPL`. **The page array is read when the request runs, not at enqueue.** The retail title passes a pointer into its own page table: at enqueue the entries are 0, and they are filled by the time the request runs. Measured on 1.0.2.1 (in my prototype stack): with a copy taken at enqueue nearly every such request named page 0; read late, no request failed in a 240 s run that reaches the loading screen. The xmem shim is called through a pointer, as `dstorage_test` does not link it; without it such a request stays `E_NOTIMPL`. Physical-page **sources** stay `E_NOTIMPL` (none has been seen). ### Tested - `dstorage_test`: 341 checks, 0 failures (new: the table filled after enqueue, the offset, three pages, a page that is not live, a null and an unreadable array). `xmem_test`: 220 checks OK (new: writes across pages, into uncommitted ones, bad page numbers). Windows 11, MSVC, Release-with-debug-info, on `main`. - Retail package: only in my prototype stack, not on this branch alone (RTX 5080, driver 621.24, Windows 11). - No game data. AI-assisted (Claude Code, Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:46 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1007
No description provided.