runtime: decode the 261000 xmem attribute layout #3275
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3275
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3273"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@lambirou on GitHub · 2026-11-28 04:35 UTC · original
lambirou:gdk/xmem-attributes-261000→main· +54 −39 · 5 files · 4 commits · merged 2026-11-28 05:22 UTCProblem
The desktop xmem allocator decoded the attribute word as if it ended with 31 reserved bits. The GDK 261000 XALLOC_ATTRIBUTES layout has an address-below-4-GiB bit at bit 33 followed by 30 reserved bits (34-63), and page size 2 means 2 MiB, not 4 MiB.
Folding the address bit into the reserved field meant a valid request was rejected as an undefined attribute word. The page-size table also used the wrong size for value 2.
Change
Behavior for the observed Bink and AMD words is unchanged; the address-below-4-GiB request still returns null, but for a stated reason instead of being mistaken for reserved bits.
Evidence
The field order comes from the GDK 261000 xmem.h. A local compile-time probe using MAKE_XALLOC_ATTRIBUTES(0xAB, 0x1234, 5, 2, 0x11, 1) produced 0x00000002B1AB9234, which confirms the address bit at 33 and the 30 reserved bits above it. The SDK header is not copied into the repository.
Validation
Result: 10/10 era_heap tests passed; xmem.dll built successfully. The decode_fields_control test is the negative control (WILL_FAIL) and passes as expected.
Notes
A real below-4-GiB allocator is a separate change. This PR only makes the decoding correct and the refusal explicit; it does not claim that such an address is currently served.
@R0Y00 on GitHub · 2026-11-28 04:42 UTC · original · requested changes
Independent check of
a2698792: builtera_heap_checkandxmem_shimin Debug and Release, then ranctest --preset <preset> --no-tests=error --output-on-failure -R '^era_heap_'. Both configurations passed all 10 checks, including the expected-failure control. Windows 11 build 26200, MSVC 19.51.Please update the Era heap section of
docs/experiments.mdbefore merge. Theera_heap_graphics_typesrow still describes the rejected page size as 4 MB, andera_heap_decode_fieldsstill describes 31 reserved bits. Those rows should reflect the two-MiB page, bit 33 and bits 34–63, and say that a below-4-GiB request still returns null. Keep the older desktop test observations scoped to the layout they measured.@R0Y00 on GitHub · 2026-11-28 05:02 UTC · original · requested changes
Rechecked
c8716216; Release again passed 10/10, and the docs-link check passed. The new test rows describe the corrected constants. One contradiction remains in the same section: the overview still presents the old ERA layout as the desktop implementation and omits the below-4-GiB refusal, whileera_heap_decode_fieldsdescribes a reserved field starting at bit 34 as a mutation, even though 34 is the correct start. Please distinguish the historical SlimEra comparison from the current 261000 decoder, update the rejection summary, and remove or correct the mutation sentence.@lambirou on GitHub · 2026-11-28 05:02 UTC · original
Merci pour la vérification. Le tableau Era heap est corrigé sur la branche (commit
c8716216) :\n\n- ra_heap_graphics_types décrit la page de 2 MiB refusée, plus la valeur de page 3 et l'exposant 17 ;\n- ra_heap_decode_fields décrit le bit 33 « adresse sous 4 GiB » et les 30 bits réservés 34–63 ;\n- la ligne précise qu'une requête sous 4 GiB reste refusée par l'allocateur, et les anciennes observations desktop restent rattachées au layout qu'elles ont mesuré.\n\nHead :c8716216.@R0Y00 on GitHub · 2026-11-28 05:22 UTC · original · approved these changes
Rechecked
d77efc7d. The overview now distinguishes the 261000 decoder and the historical SlimEra observations, documents the below-4-GiB refusal, and identifies bit 34 as the correct start of the reserved field. The docs-link check passed and all 10 Releaseera_heap_*checks passed again. One nonblocking wording correction for the experiment note: the 12-bit mask would leave the two recorded zero-valued object types unchanged, while it would truncate the widest value0x3fff.