runtime: log one adapter-facts line per adapter at device creation #3680

Manually merged
github merged 1 commit from github-bot/gh-3678 into main 2026-12-01 01:19:26 +00:00 AGit
Owner

@⁠legacy-code-archaeologist on GitHub · 2026-12-01 00:53 UTC · original
legacy-code-archaeologist:runtime/adapter-facts-line → main · +107 −3 · 3 files · 1 commits · merged 2026-12-01 01:17 UTC

Summary

Item (d) of #3678: one adapter-facts line at start-up.

The runtime's device path (x2w_d3d12_permissive_create_device, used by D3D12XboxCreateDevice with a parameter block) now queries D3D12_FEATURE_ARCHITECTURE1 and D3D12_FEATURE_EXISTING_HEAPS after the device is created, and logs once per adapter and process:

x2w-d3d12 adapter facts: uma=1 cache_coherent_uma=1 existing_heaps=1 local=7781651866 nonlocal=0 luid=00000000:0000c05f
  • local/nonlocal are the QueryVideoMemoryInfo budgets of the segment groups. A failed query prints -1.
  • The LUID-to-DXGI adapter lookup that report_budget already had (including the WARP match through EnumWarpAdapter) moves into adapter_for(), and both use it. report_budget's behaviour is unchanged.
  • Rows 1–2 of #3678 are not changed here. This only makes the facts visible, so a later change can refuse row 1 before any open.

Refs #3678, refs #1914

Measured on this machine

main a3bfd019 plus this change, Windows 11 Pro 10.0.26100, in-box runtime:

Adapter Line
WARP (Microsoft Basic Render Driver) uma=1 cache_coherent_uma=1 existing_heaps=1 local=7781651866 nonlocal=0
Intel HD Graphics 530 (driver 31.0.101.2111) uma=1 cache_coherent_uma=1 existing_heaps=0 local=7781651866 nonlocal=0

The Intel adapter is an integrated GPU with unified memory that still reports existing_heaps=0. That is the case #1914 mentions, where only the copy path is left.

Tests

tests/startup_adapter_facts_check.py, tests/cmake/startup_adapter_facts.cmake. It runs startup_descriptor_increment (the permissive create path) and checks for exactly one facts line, after the create line, with fields in range. It also checks existing_heaps=1 on WARP. A hardware run passes 77 through.

  • ctest --preset dev --no-tests=error -R '^startup_adapter_facts_' -V: warp and hardware passed (hardware ran on the Intel HD 530).
  • With the report_adapter_facts(device) call removed, startup_adapter_facts_warp fails.
  • ctest --preset dev --no-tests=error -R '^(startup_|d3d12x_|d3d12_xs).*(warp|controls)$' -j 3: 582 of 587 passed. The 5 failures fail identically on unmodified main a3bfd019 with this machine's in-box WARP: startup_image_load_mip_warp, startup_image_gather_lz_warp, startup_compute_gather_l_warp, startup_compute_dispatch_cube_warp, startup_presenter_fence_warp.
  • startup_triage_run, startup_build_rev_controls/_dll and the d3d12_xs_shim checks passed.

AI-assisted: written with Claude Code. I reviewed it and ran the commands above.

🤖 Generated with Claude Code

**@⁠legacy-code-archaeologist** on GitHub · 2026-12-01 00:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3678) `legacy-code-archaeologist:runtime/adapter-facts-line` → `main` · +107 −3 · 3 files · 1 commits · merged 2026-12-01 01:17 UTC ## Summary Item (d) of #3678: one adapter-facts line at start-up. The runtime's device path (`x2w_d3d12_permissive_create_device`, used by `D3D12XboxCreateDevice` with a parameter block) now queries `D3D12_FEATURE_ARCHITECTURE1` and `D3D12_FEATURE_EXISTING_HEAPS` after the device is created, and logs once per adapter and process: ``` x2w-d3d12 adapter facts: uma=1 cache_coherent_uma=1 existing_heaps=1 local=7781651866 nonlocal=0 luid=00000000:0000c05f ``` - `local`/`nonlocal` are the `QueryVideoMemoryInfo` budgets of the segment groups. A failed query prints -1. - The LUID-to-DXGI adapter lookup that `report_budget` already had (including the WARP match through `EnumWarpAdapter`) moves into `adapter_for()`, and both use it. `report_budget`'s behaviour is unchanged. - Rows 1–2 of #3678 are not changed here. This only makes the facts visible, so a later change can refuse row 1 before any open. Refs #3678, refs #1914 ## Measured on this machine `main` `a3bfd019` plus this change, Windows 11 Pro 10.0.26100, in-box runtime: | Adapter | Line | |---|---| | WARP (Microsoft Basic Render Driver) | `uma=1 cache_coherent_uma=1 existing_heaps=1 local=7781651866 nonlocal=0` | | Intel HD Graphics 530 (driver 31.0.101.2111) | `uma=1 cache_coherent_uma=1 existing_heaps=0 local=7781651866 nonlocal=0` | The Intel adapter is an integrated GPU with unified memory that still reports `existing_heaps=0`. That is the case #1914 mentions, where only the copy path is left. ## Tests `tests/startup_adapter_facts_check.py`, `tests/cmake/startup_adapter_facts.cmake`. It runs `startup_descriptor_increment` (the permissive create path) and checks for exactly one facts line, after the create line, with fields in range. It also checks `existing_heaps=1` on WARP. A hardware run passes 77 through. - `ctest --preset dev --no-tests=error -R '^startup_adapter_facts_' -V`: warp and hardware **passed** (hardware ran on the Intel HD 530). - With the `report_adapter_facts(device)` call removed, `startup_adapter_facts_warp` **fails**. - `ctest --preset dev --no-tests=error -R '^(startup_|d3d12x_|d3d12_xs).*(warp|controls)$' -j 3`: 582 of 587 passed. The 5 failures fail identically on unmodified `main` `a3bfd019` with this machine's in-box WARP: `startup_image_load_mip_warp`, `startup_image_gather_lz_warp`, `startup_compute_gather_l_warp`, `startup_compute_dispatch_cube_warp`, `startup_presenter_fence_warp`. - `startup_triage_run`, `startup_build_rev_controls`/`_dll` and the `d3d12_xs_shim` checks passed. AI-assisted: written with Claude Code. I reviewed it and ran the commands above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The permissive D3D12XboxCreateDevice path now queries
D3D12_FEATURE_ARCHITECTURE1 and D3D12_FEATURE_EXISTING_HEAPS once per
adapter and logs uma, cache_coherent_uma, existing_heaps, the local and
non-local video memory budgets and the LUID, so a log states whether
application memory can be shared with the GPU (#1914). The LUID-to-DXGI
adapter lookup of report_budget moves into adapter_for() for both.

Refs #3676

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 00:55:05 +00:00
github manually merged commit 775740c45e into main 2026-12-01 01:19:25 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-01 01:14 UTC · original · approved these changes

Reviewed adapter lookup and one-line-per-LUID behavior. The WARP fallback compares the adapter LUID, the deduplication is locked, and failed queries have explicit -1 fields. ctest --test-dir <build> --no-tests=error -j1 -R '^startup_adapter_facts_(warp|hardware)$' --output-on-failure passed on WARP and RTX 4060 Laptop.

**@⁠R0Y00** on GitHub · 2026-12-01 01:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3678#pullrequestreview-6123435226) · **approved these changes** Reviewed adapter lookup and one-line-per-LUID behavior. The WARP fallback compares the adapter LUID, the deduplication is locked, and failed queries have explicit `-1` fields. `ctest --test-dir <build> --no-tests=error -j1 -R '^startup_adapter_facts_(warp|hardware)$' --output-on-failure` passed on WARP and RTX 4060 Laptop.
This discussion has been locked. Commenting is limited to contributors.
No description provided.