gpu: normalize relocations in extended Mesh57 descriptors #3367

Manually merged
github merged 1 commit from gh-pr/3365/head into gh-pr/3365/base 2026-11-28 14:26:24 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-28 14:10 UTC · original
R0Y00:codex/normalize-mesh57-color-descriptors → main · +103 −3 · 3 files · 1 commits · merged 2026-11-28 14:15 UTC

Change

Refs #3311 and #870.

Normalize relocation in the recognized 0x300-byte fixed Mesh57 descriptor when forming the captured profile key and comparing a profile with the current descriptor. Preserve metadata and the relative offsets of shader record pointers. Unrecognized extended layouts retain their section fields.

The source-built creation fixture checks that two relocations produce identical normalized bytes. Changing either a metadata byte or a relative pointer offset changes the result. A mismatched allocation pointer leaves the extended fields intact.

Verification

Tested commit 090de8f24d51438799c37a335fdc9f87900d0500 on main 06cfb07f. Windows 11 26200.9974, MSVC 19.51, SDK 10.0.26100, RTX 4060 Laptop driver 32.0.16.1656 and in-box WARP 10.0.26100.9818. The GPU fixtures reported the D3D12 debug layer enabled.

cmake --build --preset dev --target startup_indirect_draw_indexed
ctest --preset dev --no-tests=error -j 1 -V -R '^(startup_indirect_mesh_create_result_(warp|hardware)|native_fixed_mesh57_mrt_(warp|hardware))$'
cmake --build --preset release --target startup_indirect_draw_indexed
ctest --preset release --no-tests=error -j 1 -V -R '^(startup_indirect_mesh_create_result_(warp|hardware)|native_fixed_mesh57_mrt_(warp|hardware))$'

4 passed in each configuration, with 0 failures and 0 skips. The fixture checks descriptor identity and existing fixed mesh attachment readbacks. The scene-color submission checkpoint stays tracked in #870.

**@⁠R0Y00** on GitHub · 2026-11-28 14:10 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3365) `R0Y00:codex/normalize-mesh57-color-descriptors` → `main` · +103 −3 · 3 files · 1 commits · merged 2026-11-28 14:15 UTC ## Change Refs #3311 and #870. Normalize relocation in the recognized 0x300-byte fixed Mesh57 descriptor when forming the captured profile key and comparing a profile with the current descriptor. Preserve metadata and the relative offsets of shader record pointers. Unrecognized extended layouts retain their section fields. The source-built creation fixture checks that two relocations produce identical normalized bytes. Changing either a metadata byte or a relative pointer offset changes the result. A mismatched allocation pointer leaves the extended fields intact. ## Verification Tested commit `090de8f24d51438799c37a335fdc9f87900d0500` on main `06cfb07f`. Windows 11 26200.9974, MSVC 19.51, SDK 10.0.26100, RTX 4060 Laptop driver 32.0.16.1656 and in-box WARP 10.0.26100.9818. The GPU fixtures reported the D3D12 debug layer enabled. ```powershell cmake --build --preset dev --target startup_indirect_draw_indexed ctest --preset dev --no-tests=error -j 1 -V -R '^(startup_indirect_mesh_create_result_(warp|hardware)|native_fixed_mesh57_mrt_(warp|hardware))$' cmake --build --preset release --target startup_indirect_draw_indexed ctest --preset release --no-tests=error -j 1 -V -R '^(startup_indirect_mesh_create_result_(warp|hardware)|native_fixed_mesh57_mrt_(warp|hardware))$' ``` 4 passed in each configuration, with 0 failures and 0 skips. The fixture checks descriptor identity and existing fixed mesh attachment readbacks. The scene-color submission checkpoint stays tracked in #870.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:26:23 +00:00
github manually merged commit 090de8f24d into gh-pr/3365/base 2026-11-28 14:26:24 +00:00
Author
Owner

@⁠R0D4X on GitHub · 2026-11-28 14:18 UTC · original · reviewed

I checked PR 3365 at commit 090de8f24d51438799c37a335fdc9f87900d0500 on Windows 11 Pro 26H2 (build 10.0.26300.0), MSVC 19.44.35230.0. nvidia-smi reported NVIDIA GeForce RTX 5080, 621.40; D3D fixture output reported NVIDIA GeForce RTX 5080, debug layer enabled, driver 32.0.16.2140, and WARP as Microsoft Basic Render Driver, debug layer enabled, driver 10.0.26100.9818.

Logic: the extended-layout recognition is guarded by the 0x300 size, nonzero 0x30/0x70, zero 0x48/0x50, the two 0x04010000 words, pointer-range checks, the repeated allocation address, and the two 32-bit pair links. Recognized layouts rewrite section-relative pointers, then zero the section base and both allocation slots; the first rewritten section word is no longer a pointer, so a second normalization is a no-op. Metadata and relative offsets remain untouched, and unrecognized layouts return early.

Build:

. .\tools\dev.ps1; cmake --build --preset dev --target startup_indirect_draw_indexed
. .\tools\dev.ps1; cmake --build --preset release --target startup_indirect_draw_indexed

Selected tests:

. .\tools\dev.ps1; $env:XBOX2WINDOWS_ADAPTER = 'RTX 5080'; ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R '^(startup_indirect_mesh_create_result_|native_fixed_mesh57_mrt_)'
. .\tools\dev.ps1; $env:XBOX2WINDOWS_ADAPTER = 'RTX 5080'; ctest --test-dir out/build/release --no-tests=error -j 1 -V -R '^(startup_indirect_mesh_create_result_|native_fixed_mesh57_mrt_)'

Result: 4/4 passed in dev, 4/4 passed in release, no skips. Both hardware fixtures reported NVIDIA GeForce RTX 5080, debug layer enabled with driver 32.0.16.2140; both WARP fixtures reported debug layer enabled with driver 10.0.26100.9818. The fixture printed extended Mesh57 layout normalizes relocations and preserves metadata and relative offsets.

Python checks:

.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py
.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py

Result: Self-test passed. Checked 156 Markdown files and 678 links. and Self-test passed. Checked 2562 tracked source, script and build/CI files: no bidirectional controls.

Targeted mutations (both reverted, then clean rebuild and rerun above):

  • const auto relative = address(offset) - section; -> const auto relative = address(offset);
. .\tools\dev.ps1; cmake --build --preset dev --target startup_indirect_draw_indexed; ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R '^startup_indirect_mesh_create_result_warp$'; git checkout -- .

Result: 330 - startup_indirect_mesh_create_result_warp (Failed), 0% tests passed, 1 tests failed out of 1.

  • Removed allocation != address(0x2c0) || from the extended-layout guard:
. .\tools\dev.ps1; cmake --build --preset dev --target startup_indirect_draw_indexed; ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R '^startup_indirect_mesh_create_result_warp$'; git checkout -- .

Result: 330 - startup_indirect_mesh_create_result_warp (Failed), 0% tests passed, 1 tests failed out of 1.

No blocking defect found in the change itself.
AI-assisted; commands listed were executed locally.

**@⁠R0D4X** on GitHub · 2026-11-28 14:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3365#pullrequestreview-6098338506) · **reviewed** I checked PR 3365 at commit `090de8f24d51438799c37a335fdc9f87900d0500` on Windows 11 Pro 26H2 (build `10.0.26300.0`), MSVC `19.44.35230.0`. `nvidia-smi` reported `NVIDIA GeForce RTX 5080, 621.40`; D3D fixture output reported `NVIDIA GeForce RTX 5080, debug layer enabled`, driver `32.0.16.2140`, and WARP as `Microsoft Basic Render Driver, debug layer enabled`, driver `10.0.26100.9818`. Logic: the extended-layout recognition is guarded by the 0x300 size, nonzero 0x30/0x70, zero 0x48/0x50, the two 0x04010000 words, pointer-range checks, the repeated allocation address, and the two 32-bit pair links. Recognized layouts rewrite section-relative pointers, then zero the section base and both allocation slots; the first rewritten section word is no longer a pointer, so a second normalization is a no-op. Metadata and relative offsets remain untouched, and unrecognized layouts return early. Build: ```powershell . .\tools\dev.ps1; cmake --build --preset dev --target startup_indirect_draw_indexed . .\tools\dev.ps1; cmake --build --preset release --target startup_indirect_draw_indexed ``` Selected tests: ```powershell . .\tools\dev.ps1; $env:XBOX2WINDOWS_ADAPTER = 'RTX 5080'; ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R '^(startup_indirect_mesh_create_result_|native_fixed_mesh57_mrt_)' . .\tools\dev.ps1; $env:XBOX2WINDOWS_ADAPTER = 'RTX 5080'; ctest --test-dir out/build/release --no-tests=error -j 1 -V -R '^(startup_indirect_mesh_create_result_|native_fixed_mesh57_mrt_)' ``` Result: 4/4 passed in dev, 4/4 passed in release, no skips. Both hardware fixtures reported `NVIDIA GeForce RTX 5080, debug layer enabled` with driver `32.0.16.2140`; both WARP fixtures reported debug layer enabled with driver `10.0.26100.9818`. The fixture printed `extended Mesh57 layout normalizes relocations and preserves metadata and relative offsets`. Python checks: ```powershell .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py ``` Result: `Self-test passed. Checked 156 Markdown files and 678 links.` and `Self-test passed. Checked 2562 tracked source, script and build/CI files: no bidirectional controls.` Targeted mutations (both reverted, then clean rebuild and rerun above): - `const auto relative = address(offset) - section;` -> `const auto relative = address(offset);` ```powershell . .\tools\dev.ps1; cmake --build --preset dev --target startup_indirect_draw_indexed; ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R '^startup_indirect_mesh_create_result_warp$'; git checkout -- . ``` Result: `330 - startup_indirect_mesh_create_result_warp (Failed)`, `0% tests passed, 1 tests failed out of 1`. - Removed `allocation != address(0x2c0) ||` from the extended-layout guard: ```powershell . .\tools\dev.ps1; cmake --build --preset dev --target startup_indirect_draw_indexed; ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R '^startup_indirect_mesh_create_result_warp$'; git checkout -- . ``` Result: `330 - startup_indirect_mesh_create_result_warp (Failed)`, `0% tests passed, 1 tests failed out of 1`. No blocking defect found in the change itself. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.