[removed by author] #126

Closed
opened 2026-11-26 21:28:45 +00:00 by github-bot · 4 comments
Owner

@⁠thegl0w on GitHub · 2026-11-21 16:40 UTC · original

[removed by author]

**@⁠thegl0w** on GitHub · 2026-11-21 16:40 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/126) [removed by author]
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:28:45 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-21 17:16 UTC · original

#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.

**@⁠R0Y00** on GitHub · 2026-11-21 17:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/126#issuecomment-7066351198) #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.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-21 19:01 UTC · original

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.

**@⁠dcastell1** on GitHub · 2026-11-21 19:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/126#issuecomment-7067706337) 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.
Author
Owner

@⁠legacy-code-archaeologist on GitHub · 2026-11-22 23:36 UTC · original

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.

**@⁠legacy-code-archaeologist** on GitHub · 2026-11-22 23:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/126#issuecomment-7087705699) 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.
Author
Owner

@⁠triggered02 on GitHub · 2026-11-24 04:37 UTC · original

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.

**@⁠triggered02** on GitHub · 2026-11-24 04:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/126#issuecomment-7122190173) 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.
github-bot changed title from Decode the full XMemAlloc attribute word observed in the Bink and AMD callers to [removed by author] 2026-12-02 09:38:30 +00:00
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#126
No description provided.