d3d12_xs: implement console list slot 148 AllocateUploadMemory and ro… #686

Closed
kotekompotek wants to merge 1 commit from upstream-pr/686 into main
kotekompotek commented 2026-11-24 12:01:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-24T12:01:17Z.


Claimed in the coordination issue as: coordination issue #14

What and why

  • Rebased onto current main.
  • Implemented console command-list slot 148 (AllocateUploadMemory(size, alignment)) on ListProxy with upload-buffer chunk pooling, reset on Reset, and root SRV/UAV/CBV VA translation in runtime/shims/d3d12_xs_device.cpp.
  • Added mock coverage in runtime/test/xs_proxy_mock_test.cpp and synced docs/d3d12_command_objects.md.

Tested

  • Built xs_proxy_mock_test and ran ctest -R ^xs_proxy_mock$ (Passed, 0.09s).

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5471725360 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/686). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-24T12:01:17Z. --- Claimed in the coordination issue as: coordination issue #14 ### What and why - Rebased onto current `main`. - Implemented console command-list slot `148` (`AllocateUploadMemory(size, alignment)`) on `ListProxy` with upload-buffer chunk pooling, reset on `Reset`, and root SRV/UAV/CBV VA translation in `runtime/shims/d3d12_xs_device.cpp`. - Added mock coverage in `runtime/test/xs_proxy_mock_test.cpp` and synced `docs/d3d12_command_objects.md`. ### Tested - Built `xs_proxy_mock_test` and ran `ctest -R ^xs_proxy_mock$` (`Passed`, 0.09s). GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
abnalstlll-byte commented 2026-11-24 12:20:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T12:20:57Z.

Review: APPROVED


Reviewed and verified implementation of console command list slot 148 AllocateUploadMemory and root view VA translation. Dynamic suballocation with committed upload chunks, aligned offset reservation, unmap/release on list destruction, offset reset on list Reset, and VA translation for root views (slots 39-44) maintain clean isolation. All CTest expectations in
untime/test/xs_proxy_mock_test.cpp pass cleanly. Approved.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6039090466 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/686#pullrequestreview-6039090466). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T12:20:57Z. **Review:** APPROVED --- Reviewed and verified implementation of console command list slot 148 AllocateUploadMemory and root view VA translation. Dynamic suballocation with committed upload chunks, aligned offset reservation, unmap/release on list destruction, offset reset on list Reset, and VA translation for root views (slots 39-44) maintain clean isolation. All CTest expectations in untime/test/xs_proxy_mock_test.cpp pass cleanly. Approved.
Poussistar commented 2026-11-24 15:12:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Poussistar on 2026-11-24T15:12:31Z.


Heads-up from a rebase check: this patch no longer applies to main a28927849.

git worktree add --detach /tmp/wt origin/main
git apply <686>.diff
error: patch failed: runtime/test/xs_proxy_mock_test.cpp:89

The shim side (runtime/shims/d3d12_xs_device.h) applies; only the test file's hunk at line 89 conflicts, so a rebase
alone should do it. I cannot run the new xs_proxy_mock_test.cpp here (Linux host, no MSVC, no AMD GPU), so this is a
rebase notice, not a verdict on the change itself.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7135636933 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/686#issuecomment-7135636933). Originally posted by [Poussistar](https://github.com/Poussistar) on 2026-11-24T15:12:31Z. --- Heads-up from a rebase check: this patch no longer applies to `main` `a28927849`. ``` git worktree add --detach /tmp/wt origin/main git apply <686>.diff error: patch failed: runtime/test/xs_proxy_mock_test.cpp:89 ``` The shim side (`runtime/shims/d3d12_xs_device.h`) applies; only the test file's hunk at line 89 conflicts, so a rebase alone should do it. I cannot run the new `xs_proxy_mock_test.cpp` here (Linux host, no MSVC, no AMD GPU), so this is a rebase notice, not a verdict on the change itself.
kotekompotek commented 2026-11-25 07:45:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-25T07:45:26Z.


Rebased on current ubi/main (3f81d46ac) and pushed. Conflicts resolved against the newer main changes; test suite for the touched area passes locally (xs_proxy_mock_test PASS on Windows; the int64-atomics semantic tests 6/6 and test_rdna2_decode 21/21 where applicable).

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7156217314 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/686#issuecomment-7156217314). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T07:45:26Z. --- Rebased on current ubi/main (3f81d46ac) and pushed. Conflicts resolved against the newer main changes; test suite for the touched area passes locally (xs_proxy_mock_test PASS on Windows; the int64-atomics semantic tests 6/6 and test_rdna2_decode 21/21 where applicable). AI-assisted: yes
MoonEyes commented 2026-11-28 23:19:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T23:19:22Z.


Hi @kotekompotek, a check against main adfb3821a: console list slot 148 (AllocateUploadMemory) is already implemented there, in a different way: an upload-memory arena installed by the first call (runtime/shims/d3d12_xs_device.cpp:120, :2911), checked in runtime/test/xs_proxy_mock_test.cpp:2419 and :2457. After your rebase this PR only changes docs/d3d12_command_objects.md, and the text it adds describes chunk pooling and a ListProxy::allocate_upload_memory that do not exist on main, so merged as is the page would describe code that is not there.
Could you either rewrite the line to describe the arena that main has, or close this PR as covered by main? Thanks for the work on slot 148.

AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247352169 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/686#issuecomment-7247352169). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T23:19:22Z. --- Hi @kotekompotek, a check against `main` adfb3821a: console list slot 148 (`AllocateUploadMemory`) is already implemented there, in a different way: an upload-memory arena installed by the first call (`runtime/shims/d3d12_xs_device.cpp:120`, `:2911`), checked in `runtime/test/xs_proxy_mock_test.cpp:2419` and `:2457`. After your rebase this PR only changes `docs/d3d12_command_objects.md`, and the text it adds describes chunk pooling and a `ListProxy::allocate_upload_memory` that do not exist on `main`, so merged as is the page would describe code that is not there. Could you either rewrite the line to describe the arena that `main` has, or close this PR as covered by `main`? Thanks for the work on slot 148. AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.
zmasi commented 2026-11-29 00:28:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T00:28:52Z.


#686 | head 950ad56efc (merged cleanly onto origin/main 48bae6cade) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Independent Verification (Windows 11)

  • Diff & safety audit: Inspected 100% of the net diff (+4/-1 in docs/d3d12_command_objects.md; after rebasing onto main, this PR touches documentation only). python -I scripts/check_no_game_data.py docs/d3d12_command_objects.md passed (rc=0).
  • Merge & doc suite checks on #686 + origin/main (48bae6cade):
    • Clean 3-way merge onto origin/main (48bae6cade).
    • Scoped tests/test_docs_links.py and tests/test_docs_cli_flags.py checks on docs/d3d12_command_objects.md (0 issues), plus tests/test_docs_table_rows.py (2/2), tests/test_docs_repo_paths.py (5/5), tests/test_docs_encoding.py (1/1), tests/test_docs_list_items.py (3/3), and tests/test_docs_repeated_lines.py (3/3) all passed (OK).
  • Source cross-check finding (docs/d3d12_command_objects.md vs runtime/shims/d3d12_xs_device.cpp):
    • The added parenthetical describes this PR's earlier superseded C++ design ("ListProxy::allocate_upload_memory backs requests from upload buffer chunks with >=16-byte power-of-2 alignment, Reset rewinds chunk offsets...").
    • On origin/main (48bae6cade), ListProxy::allocate_upload_memory does not exist (0 matches in runtime/shims/d3d12_xs_device.cpp): console command-list slot 148 (kConsoleAllocateUpload = 148, AllocateUploadMemory) carves from the device-level UploadArena (upload_state, installed by compare-exchange on first call; covered in runtime/test/xs_proxy_mock_test.cpp §9) rather than rewinding per-list chunk offsets on Reset. Updating that parenthetical to match main's UploadArena implementation will prevent documenting a non-existent symbol and reset behavior.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248141368 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/686#issuecomment-7248141368). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T00:28:52Z. --- #686 | head 950ad56efc05eeaca577f648d75748baac0d0a8e (merged cleanly onto origin/main 48bae6cade) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes ### Independent Verification (Windows 11) - **Diff & safety audit**: Inspected 100% of the net diff (`+4/-1` in `docs/d3d12_command_objects.md`; after rebasing onto `main`, this PR touches documentation only). `python -I scripts/check_no_game_data.py docs/d3d12_command_objects.md` passed (`rc=0`). - **Merge & doc suite checks on `#686 + origin/main` (`48bae6cade`)**: - Clean 3-way merge onto `origin/main` (`48bae6cade`). - Scoped `tests/test_docs_links.py` and `tests/test_docs_cli_flags.py` checks on `docs/d3d12_command_objects.md` (`0` issues), plus `tests/test_docs_table_rows.py` (`2/2`), `tests/test_docs_repo_paths.py` (`5/5`), `tests/test_docs_encoding.py` (`1/1`), `tests/test_docs_list_items.py` (`3/3`), and `tests/test_docs_repeated_lines.py` (`3/3`) all passed (`OK`). - **Source cross-check finding (`docs/d3d12_command_objects.md` vs `runtime/shims/d3d12_xs_device.cpp`)**: - The added parenthetical describes this PR's earlier superseded C++ design (`"ListProxy::allocate_upload_memory backs requests from upload buffer chunks with >=16-byte power-of-2 alignment, Reset rewinds chunk offsets..."`). - On `origin/main` (`48bae6cade`), `ListProxy::allocate_upload_memory` does **not** exist (`0` matches in `runtime/shims/d3d12_xs_device.cpp`): console command-list slot `148` (`kConsoleAllocateUpload = 148`, `AllocateUploadMemory`) carves from the device-level `UploadArena` (`upload_state`, installed by compare-exchange on first call; covered in `runtime/test/xs_proxy_mock_test.cpp` §9) rather than rewinding per-list chunk offsets on `Reset`. Updating that parenthetical to match `main`'s `UploadArena` implementation will prevent documenting a non-existent symbol and reset behavior.
MoonEyes commented 2026-11-29 14:40:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:40:11Z.


Closing: console list slot 148 (AllocateUploadMemory) is already on main, implemented as an upload arena installed by the first call (runtime/shims/d3d12_xs_device.cpp:120-123), checked just now. What remains here is the doc page, which describes the other design. A small PR that documents main's arena is welcome. Thanks for the work!

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257483217 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/686#issuecomment-7257483217). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T14:40:11Z. --- Closing: console list slot 148 (AllocateUploadMemory) is already on main, implemented as an upload arena installed by the first call (runtime/shims/d3d12_xs_device.cpp:120-123), checked just now. What remains here is the doc page, which describes the other design. A small PR that documents main's arena is welcome. Thanks for the work!

Pull request closed

Sign in to join this conversation.
No reviewers
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!686
No description provided.