Skip to content

docs: boot stop 13 asserts on the stop 10 placeholder's base, and one… - #9375

Closed
DatGuySnowfox wants to merge 1 commit into
ProjectLeonida:mainfrom
DatGuySnowfox:docs/stop-13-descriptor-base
Closed

DatGuySnowfox wants to merge 1 commit into
ProjectLeonida:mainfrom
DatGuySnowfox:docs/stop-13-descriptor-base

Conversation

@DatGuySnowfox

@DatGuySnowfox DatGuySnowfox commented Nov 23, 2026 •

Copy link
Copy Markdown

… ConsoleMode registry DWORD picks Series X or S

The value the title compares the first descriptor heap's slot 9 handle against is the pointer the stop 10 placeholder reserve returned, and the heap's byte size is that placeholder's first three sub-ranges. It is not an address the title predicts, it is memory the title already owns. Only one of the title's five descriptor heaps supplies a base, so the other four should follow once that one clears.

Four pages:

  • descriptor_heap_allocation_hook.md: the derivation above, the five descriptor heap call sites, the slot 15 increment's effect on the placeholder's own size, and the full XMemAllocationHooks chain ABI: two walkers, 256-entry head arrays indexed by byte 2 of the class word, the title's single index 128, the host-populated default the walker dereferences before testing it, thread-scoped nodes, the ten-node collect buffer, the class word's bitfield including its log2 alignment field, and the three interceptor kinds. Which walker is allocation and which is release is measured, not inferred from position.

  • title_descriptor_model.md: the title sub-allocates descriptors itself and keeps a free list inside four of the five heaps' descriptor memory, RTV and DSV included, so it writes a UINT over the first four bytes of 4096 RTV and 2048 DSV slots and reads them back. Views come from device slots 17, 18 and 19 in PC argument order with null resource pointers. A byte at offset 24 of the device object selects a raw-descriptor fallback no proxy can intercept. Includes the bring-up order after the heaps: the submission ring over placeholder sub-range 3, and 64 CreateCommandAllocator calls whose failure aborts bring-up with no assert and no message.

  • console_sku_detection.md: the title reads one REG_DWORD, ConsoleMode under HKLM\Software\Microsoft\Windows NT\CurrentVersion\OEM, and maps it to a generation id. The virtual-memory setup asserts the id is 1, 6, 7 or 8, so five of the nine ids are fatal before the device exists and the absent value passes. Id 6 is the Series S, and 63 functions across 71 call sites read that one predicate: it picks the ":xbsx" or ":xbss" asset variant, a ten-entry memory budget table, and render target dimensions. Stop 1's two reserves are 24 GiB each.

  • xbox_only_import_shapes.md: argument counts and in and out roles for the 23 unimplemented Xbox-only imports, so a stand-in can be declared with the right signature before the title reaches it.

retail_boot_chain.md's stop 13 row now carries the measurement in place of the hypothesis, and its stop 1 row the reserve sizes.

Static analysis only, nothing executed, so none of this is a verified fix. Every XMemVirtualAlloc immediate decoded here reconciles with xmem_exe_calls.md's table, the D3D12ConfigureVirtualMemoryX argument shape with d3d12_xs_surface.md, and device slots 8, 9, 26, 48, 73 and 133 with retail_boot_chain.md section 3.

Claimed in the coordination issue as:

Depends on:

What and why

Tested

AI-assisted:

Checklist

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

@YordiLorenzo

Copy link
Copy Markdown

Checked b3f0881 on Linux, Python 3.14.4: docs pass (no game copy here, so the measurements themselves are not rechecked)

  • test_docs_repeated_lines, list_items, table_rows, table_ids, repo_paths, env_vars: OK; test_docs_links, cli_flags and design_rows fail as on main and name none of the 6 pages
  • check_no_game_data on the 6 files: clean
  • The XMemVirtualAlloc words the pages quote match the static table in xmem_exe_calls.md (0x20402000/0x21/0x4, 0x42000/0x7/0x1, 0x20401000/0x283/0x42404, the 0x20406000 row), and the 24 GiB stop 1 reserves match the measured order in docs/xmem_exe_calls: the boot's XMemVirtualAlloc order, measured #7641.
  • The PR body still has the template's placeholders: no claim ID, no Depends on, and the no-game-data box is unticked. AGENTS.md asks for the item ID in the PR, so the coordinator can't link it as it stands.

@DatGuySnowfox
DatGuySnowfox force-pushed the docs/stop-13-descriptor-base branch from b3f0881 to 1a09b20 Compare November 23, 2026 21:05
… ConsoleMode registry DWORD picks Series X or S

The value the title compares the first descriptor heap's slot 9 handle against is the
pointer the stop 10 placeholder reserve returned, and the heap's byte size is that
placeholder's first three sub-ranges. It is not an address the title predicts, it is
memory the title already owns. Only one of the title's five descriptor heaps supplies a
base, so the other four should follow once that one clears.

Four pages:

- descriptor_heap_allocation_hook.md: the derivation above, the five descriptor heap call
  sites, the slot 15 increment's effect on the placeholder's own size, and the full
  __XMemAllocationHooks__ chain ABI: two walkers, 256-entry head arrays indexed by byte 2
  of the class word, the title's single index 128, the host-populated default the walker
  dereferences before testing it, thread-scoped nodes, the ten-node collect buffer, the
  class word's bitfield including its log2 alignment field, and the three interceptor
  kinds. Which walker is allocation and which is release is measured, not inferred from
  position.

- title_descriptor_model.md: the title sub-allocates descriptors itself and keeps a free
  list inside four of the five heaps' descriptor memory, RTV and DSV included, so it
  writes a UINT over the first four bytes of 4096 RTV and 2048 DSV slots and reads them
  back. Views come from device slots 17, 18 and 19 in PC argument order with null
  resource pointers. A byte at offset 24 of the device object selects a raw-descriptor
  fallback no proxy can intercept. Includes the bring-up order after the heaps: the
  submission ring over placeholder sub-range 3, and 64 CreateCommandAllocator calls whose
  failure aborts bring-up with no assert and no message.

- console_sku_detection.md: the title reads one REG_DWORD, ConsoleMode under
  HKLM\Software\Microsoft\Windows NT\CurrentVersion\OEM, and maps it to a generation id.
  The virtual-memory setup asserts the id is 1, 6, 7 or 8, so five of the nine ids are
  fatal before the device exists and the absent value passes. Id 6 is the Series S, and
  63 functions across 71 call sites read that one predicate: it picks the ":xbsx" or
  ":xbss" asset variant, a ten-entry memory budget table, and render target dimensions.
  Stop 1's two reserves are 24 GiB each.

- xbox_only_import_shapes.md: argument counts and in and out roles for the 23
  unimplemented Xbox-only imports, so a stand-in can be declared with the right signature
  before the title reaches it.

retail_boot_chain.md's stop 13 row now carries the measurement in place of the
hypothesis, and its stop 1 row the reserve sizes.

Static analysis only, nothing executed, so none of this is a verified fix. Every
XMemVirtualAlloc immediate decoded here reconciles with xmem_exe_calls.md's table, the
D3D12ConfigureVirtualMemoryX argument shape with d3d12_xs_surface.md, and device slots 8,
9, 26, 48, 73 and 133 with retail_boot_chain.md section 3.
@DatGuySnowfox

Copy link
Copy Markdown
Author

Closing this as superseded. I opened it without checking the open pull requests first, which CONTRIBUTING.md asks for and which would have saved everyone the review. The queue already had better-sourced versions of nearly all of it:

Two parts were not already covered, and I have posted them where they are actionable instead of leaving them here:

I also had the hook chain's direction backwards in one place on this branch, describing the head arrays as something the host must populate. The title exports the hooks so the host calls into the title, so the correct caution is only that the host must pass an attribute word the title has an interceptor for, because the walker does not null-check the indexed head slot. #7021 satisfies that by construction.

@YordiLorenzo thanks for running it, and sorry for the wasted pass. One correction for the record: test_docs_env_vars also fails on main, on the undocumented LEONIDA_TLS_GA_PATCH in runtime/src/pe_loader.cpp:519, so it belongs with links, cli_flags and design_rows rather than in the passing list. I checked all four against a clean origin/main worktree and they fail identically there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants