[removed by author] #125

Closed
opened 2026-11-21 16:40:04 +00:00 by thegl0w · 4 comments
thegl0w commented 2026-11-21 16:40:04 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-21T16:40:04Z.


[removed by author]

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6531545722 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/126). Originally posted by [thegl0w](https://github.com/thegl0w) on 2026-11-21T16:40:04Z. --- [removed by author]
R0Y00 commented 2026-11-24 06:47:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:16:35Z.


#134 covers the desktop interpretation of the observed attribute words. Let's keep this issue open for the unverified allocator ID and graphics-memory semantics, and record those separately from the passing desktop allocation tests.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066351198 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/126#issuecomment-7066351198). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T17:16:35Z. --- #134 covers the desktop interpretation of the observed attribute words. Let's keep this issue open for the unverified allocator ID and graphics-memory semantics, and record those separately from the passing desktop allocation tests.
dcastell1 commented 2026-11-24 06:47:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by dcastell1 on 2026-11-21T19:01:55Z.


Independent implementation of the same field split, for cross-reference: the TomBox continuation at omonkeyz/xbox-emulator has Attr in crates/compat/xmem/src/alloc.rs (commit 72affd5a) with object type 0..13, page size 14..15, allocator ID 16..23, log2 alignment 24..28 and memory type 29..32. Its test attribute_fields_match_console_decode uses 0x30804000, 0x0480009e and 0x150004000; page size maps 0=4 KiB, 1=64 KiB, 2..3=2 MiB, and memory types 0..12 are accepted. This corroborates the layout used in #134, but it does not settle the allocator ID or graphics-memory semantics, so it does not close this issue. The test name says the vectors come from a console decode; I have not independently verified that provenance.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067706337 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/126#issuecomment-7067706337). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-21T19:01:55Z. --- Independent implementation of the same field split, for cross-reference: the TomBox continuation at `omonkeyz/xbox-emulator` has `Attr` in `crates/compat/xmem/src/alloc.rs` (commit `72affd5a`) with object type 0..13, page size 14..15, allocator ID 16..23, log2 alignment 24..28 and memory type 29..32. Its test `attribute_fields_match_console_decode` uses `0x30804000`, `0x0480009e` and `0x150004000`; page size maps 0=4 KiB, 1=64 KiB, 2..3=2 MiB, and memory types 0..12 are accepted. This corroborates the layout used in #134, but it does not settle the allocator ID or graphics-memory semantics, so it does not close this issue. The test name says the vectors come from a console decode; I have not independently verified that provenance.
legacy-code-archaeologist commented 2026-11-24 06:48:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-22T23:36:59Z.


Source research on the two questions this issue was kept open for (allocator ID 0xE5, memory type GRAPHICS_5). I used only publicly licensed code; no game files.

Found (MIT, Microsoft):

  • Middleware texture loading. DirectXTex Auxiliary/DirectXTexXboxD3D12X.cpp at a8e5dbf (lines 30–34) builds its default XMemAlloc attributes for texture loading as
    MAKE_XALLOC_ATTRIBUTES(eXALLOCAllocatorId_MiddlewareReservedMin, 0, XALLOC_MEMTYPE_GRAPHICS_WRITECOMBINE_GPU_READONLY, XALLOC_PAGESIZE_64KB, XALLOC_ALIGNMENT_64K). The same pattern appears in DirectXTK's XboxDDSTextureLoader.cpp. So the allocator-ID field has a middleware-reserved range, and graphics memory types carry cache/GPU-visibility names such as WRITECOMBINE_GPU_READONLY.
  • Title range. The ATG MemoryHelpersXbox.cpp (PlayFab-Samples, MIT, line 72) classifies a request as a title request when dwAllocatorId is between eXALLOCAllocatorId_GameMin and eXALLOCAllocatorId_GameMax.

Not found: the numeric values of these constants. No publicly licensed source I could reach gives eXALLOCAllocatorId_GameMin/GameMax/MiddlewareReservedMin or the numbering of the named XALLOC_MEMTYPE_GRAPHICS_* types. SlimEra era.h and WinDurango kernelx.h only have the placeholder enum GRAPHICS_1…GRAPHICS_6. Some third-party repositories carry copies of Xbox 360 SDK headers that contain such values. I did not use them: they are not publicly licensed, and they describe the older console.

Consequence for this issue: whether 0xE5 from the Bink caller falls into the middleware-reserved or the title range, and which named type GRAPHICS_5 is, cannot be settled from licensed public sources. That remains a hypothesis. One plausible reading is that the 0xa8004000 word from the AMD caller (64 KiB pages, graphics type) corresponds to a GPU-visible type like the one DirectXTex uses for textures, but that is not verified. Settling it would need a measurement, for example from the observed runtime behavior of these allocations.

AI-assisted (Claude Code); GitHub code search via the authenticated API.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7087705699 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/126#issuecomment-7087705699). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-22T23:36:59Z. --- Source research on the two questions this issue was kept open for (allocator ID `0xE5`, memory type `GRAPHICS_5`). I used only publicly licensed code; no game files. **Found (MIT, Microsoft):** - **Middleware texture loading.** DirectXTex `Auxiliary/DirectXTexXboxD3D12X.cpp` at `a8e5dbf` (lines 30–34) builds its default XMemAlloc attributes for texture loading as `MAKE_XALLOC_ATTRIBUTES(eXALLOCAllocatorId_MiddlewareReservedMin, 0, XALLOC_MEMTYPE_GRAPHICS_WRITECOMBINE_GPU_READONLY, XALLOC_PAGESIZE_64KB, XALLOC_ALIGNMENT_64K)`. The same pattern appears in DirectXTK's `XboxDDSTextureLoader.cpp`. So the allocator-ID field has a middleware-reserved range, and graphics memory types carry cache/GPU-visibility names such as `WRITECOMBINE_GPU_READONLY`. - **Title range.** The ATG `MemoryHelpersXbox.cpp` (PlayFab-Samples, MIT, line 72) classifies a request as a title request when `dwAllocatorId` is between `eXALLOCAllocatorId_GameMin` and `eXALLOCAllocatorId_GameMax`. **Not found:** the numeric values of these constants. No publicly licensed source I could reach gives `eXALLOCAllocatorId_GameMin`/`GameMax`/`MiddlewareReservedMin` or the numbering of the named `XALLOC_MEMTYPE_GRAPHICS_*` types. SlimEra `era.h` and WinDurango `kernelx.h` only have the placeholder enum `GRAPHICS_1`…`GRAPHICS_6`. Some third-party repositories carry copies of Xbox 360 SDK headers that contain such values. I did not use them: they are not publicly licensed, and they describe the older console. **Consequence for this issue:** whether `0xE5` from the Bink caller falls into the middleware-reserved or the title range, and which named type `GRAPHICS_5` is, cannot be settled from licensed public sources. That remains a hypothesis. One plausible reading is that the `0xa8004000` word from the AMD caller (64 KiB pages, graphics type) corresponds to a GPU-visible type like the one DirectXTex uses for textures, but that is not verified. Settling it would need a measurement, for example from the observed runtime behavior of these allocations. AI-assisted (Claude Code); GitHub code search via the authenticated API.
triggered02 commented 2026-11-24 06:50:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T04:37:31Z.


Taking a code slice on this: the scanner cannot see the XMemAllocDefault / XMemFreeDefault aliases.

tools/xmem_attribute_scan.py fixes TARGETS = (XMemAlloc, XMemFree), but the released entry image imports all four names, and the shim exports the Default pair as aliases (XMemAllocDefault=XMemAlloc @5, XMemFreeDefault=XMemFree @6). So real call sites through the aliases are invisible to the scan today.

Scope:

  1. Add both aliases to TARGETS, keeping the recorded export name in the report so a site is not attributed to the wrong symbol.
  2. Extend the source-built fixture (tests/cpu/xmem_attributes.asm) with a direct XMemAllocDefault call, an XMemFreeDefault tail jump, and a cmove-guarded site (mov edx,imm32; cmp byte ptr [flag],0; cmove rdx,rbx; call) — the scanner deliberately reports that shape as computed, and today nothing pins that classification with a test.
  3. Update tests/xmem_attribute_scan_check.py, and add the observed attribute-word decode notes to docs/experiments.md.

Decoding/test-only; no shim behaviour change.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7122190173 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/126#issuecomment-7122190173). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T04:37:31Z. --- Taking a code slice on this: the scanner cannot see the `XMemAllocDefault` / `XMemFreeDefault` aliases. `tools/xmem_attribute_scan.py` fixes `TARGETS = (XMemAlloc, XMemFree)`, but the released entry image imports all four names, and the shim exports the `Default` pair as aliases (`XMemAllocDefault=XMemAlloc @5`, `XMemFreeDefault=XMemFree @6`). So real call sites through the aliases are invisible to the scan today. Scope: 1. Add both aliases to `TARGETS`, keeping the recorded export name in the report so a site is not attributed to the wrong symbol. 2. Extend the source-built fixture (`tests/cpu/xmem_attributes.asm`) with a direct `XMemAllocDefault` call, an `XMemFreeDefault` tail jump, and a `cmove`-guarded site (`mov edx,imm32; cmp byte ptr [flag],0; cmove rdx,rbx; call`) — the scanner deliberately reports that shape as `computed`, and today nothing pins that classification with a test. 3. Update `tests/xmem_attribute_scan_check.py`, and add the observed attribute-word decode notes to `docs/experiments.md`. Decoding/test-only; no shim behaviour change.
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
R0Y00/Xbox2Windows#125
No description provided.