startup: general GFX10 texture tiling and detiling runtime #1462

Open
Holastor wants to merge 22 commits from upstream-pr/1469 into main
Holastor commented 2026-11-24 12:09:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T12:09:14Z.


Summary

Implement GFX10 texture tiling and detiling runtime in src/startup_stubs/:

  • src/startup_stubs/gfx10_texture.h: general GFX10 texture computer following AMD's addrlib micro-tile equations, mip-tail layout, and GetMipSize (ShiftCeil) surface extent calculations in Mesa (src/amd/addrlib, SPDX-License-Identifier: MIT, Copyright (C) 2007-2024 Advanced Micro Devices, Inc.).
  • Support Thin S and Thin D 256-byte micro-tiles across 1B, 2B, 4B, 8B, and 16B color and block-compressed formats (BC1–BC7, R8, R16, R32, RG8, RGBA8, BGRA8, RGBA16, RGBA32). Depth/stencil formats and implicit layouts (UNKNOWN, ROW_MAJOR) remain on the desktop footprint path.
  • Support explicit console layout modes (0x100 SW_LINEAR, 0x101 SW_256B_S, 0x102 SW_256B_D, 0x105 SW_4KB_S, 0x106 SW_4KB_D, 0x109 SW_64KB_S, 0x10a SW_64KB_D).
  • 256-entry coordinate bit tables (x_table, y_table), mip-tail placement, and linear<->tiled subresource transfers (copy_subresource<into>).
  • Wire xg_xs.dll TextureComputer slots for explicit 0x100–0x10a color/BC descriptors:
    • slot 2: GetResourceLayout
    • slot 3: GetResourceSize
    • slot 4: GetResourceAlignment
    • slot 5: GetSubresourceOffset
    • slot 6: GetSubresourceElementAddress
    • slot 8: CopyIntoSubresource (tiling)
    • slot 9: CopyFromSubresource (detiling)
    • slot 10: GetResourceTiling
  • Integrate Gfx10Texture detiling into D3D12 runtime upload_texture for explicit GFX10 tiled modes and multi-mip or array linear (0x100) textures (with rows_match footprint guard before copy).
  • Wire startup_xg_gfx10_runtime, xg_gfx10_tiling_reference, and startup_xg_bc7_draw_warp into CMakePresets.json pull request smoke test filter and build targets.
  • Verification suites:
    • tests/startup_xg_gfx10_check.py (startup_xg_gfx10_runtime): 24 synthetic cases across BC1–BC7, R8, RG8, R16, R32, RGBA8, BGRA8, RGBA16, RGBA32, explicit SW_LINEAR (0x100) through SW_64KB_D (0x10a) including multi-mip/multi-slice non-power-of-two RGBA16 100x10 3m 2s LINEAR, hard-coded Mesa 25.1.0 addrlib expected element byte offsets per element size, implicit/depth routing checks, and negative controls.
    • tests/xg_swizzle_select_check.cpp --gfx10-tiling (xg_gfx10_tiling_reference): compares surface size, slice size, alignment, mip offsets, and all texel/block addresses across 23 cases (including RGBA8 64x64 3m LINEAR and RGBA16 100x10 3m 2s LINEAR to pin linear mip ordering and ShiftCeil strides) against pinned Mesa 25.1.0 addrlib with 0 mismatches.
    • tests/startup_xg_bc7_draw_check.py (startup_xg_bc7_draw_warp / _hardware): tests BC7 64x64 / 81x69 linear & tiled draws, 512x256 display64k draw, non-BC64 RGBA8 64x64 0x105 (4KB_S) draw with negative swizzle control (4064/4096 pixels differ), and multi-mip RGBA8 64x64 3-mip 0x100 (LINEAR) draw detiled via is_gfx10_tiled with negative layout control (4096/4096 pixels differ).

Documentation

  • docs/experiments.md ("Nine-mip BC5/BC7 tile queries") now states that the general computer answers slots 2, 3, 6, 8, 9 and 10 for explicit layouts 0x100–0x10a, and keeps that section's pins specific to the earlier 0x109 BC5/BC7 shape.
  • docs/startup-runtime.md names the scope of Gfx10Texture instead of describing it as future work: it tiles explicit GFX10 layouts, while the UNKNOWN + 4096-alignment small-texture path keeps its compact linear plan pending a follow-up.

Verification

Measured at ae9a7e44 (current main 36914379 merged, including #3410) on Windows 11 x64 build 26300, MSVC, AMD Radeon RX 6600M + D3D12 WARP + Mesa 25.1.0 addrlib from tools/fetch_addrlib.py:

cmake --build --preset release
ctest --preset release --no-tests=error --output-on-failure -R '^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$'
  • 34 passed, 0 failed, 0 skipped in 137.8 s:
    • addrlib references: xg_gfx10_tiling_reference (23 shapes), xg_bc64_tiling_reference, startup_gfx10_layout_linear_addrlib.
    • layout and stubs: startup_xg_gfx10_runtime, startup_xg_bc_tiling, startup_xg_tile64_tiling, startup_xg_bc7_layout, startup_gfx10_layout, startup_gfx10_layout_display_control, startup_gfx10_layout_linear_order_control, startup_stubs, xg_swizzle_select(_mutation), xg_swizzle_factory(_no_write).
    • draws (WARP + RX 6600M): startup_xg_bc7_draw_warp/_hardware, startup_xg_bc_chain_warp/_hardware, startup_xg_bc_array_warp/_hardware.
    • address paths: startup_address_srv_warp, single_element, buffer_srv, volume_srv, bc_view, console, console_gate, console_gate_ring, console_gate_ring_reuse, console_gate_ring_keep, console_gate_ring_keep_release, console_linear_unpadded, console_cube_order.

Mergeability:

  • Merged current main (36914379, includes #3410); git merge-tree --write-tree upstream/main HEAD exits 0.

Pure-Python checks:

python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py
git diff --check
  • 175 Markdown files / 711 links checked; 2670 tracked files checked for bidirectional controls; diff clean.

Earlier evidence remains in the thread: the 27-test run at 00c53f91 and the matched baseline/candidate title run reported on 2026-11-26 (local candidate 85e4df30, which is not in the branch history after rebases; the change itself is unchanged).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5471854090 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-24T12:09:14Z. --- ### Summary Implement GFX10 texture tiling and detiling runtime in `src/startup_stubs/`: - `src/startup_stubs/gfx10_texture.h`: general GFX10 texture computer following AMD's addrlib micro-tile equations, mip-tail layout, and `GetMipSize` (`ShiftCeil`) surface extent calculations in Mesa (`src/amd/addrlib`, SPDX-License-Identifier: MIT, Copyright (C) 2007-2024 Advanced Micro Devices, Inc.). - Support Thin S and Thin D 256-byte micro-tiles across 1B, 2B, 4B, 8B, and 16B color and block-compressed formats (`BC1`–`BC7`, `R8`, `R16`, `R32`, `RG8`, `RGBA8`, `BGRA8`, `RGBA16`, `RGBA32`). Depth/stencil formats and implicit layouts (`UNKNOWN`, `ROW_MAJOR`) remain on the desktop footprint path. - Support explicit console layout modes (`0x100` `SW_LINEAR`, `0x101` `SW_256B_S`, `0x102` `SW_256B_D`, `0x105` `SW_4KB_S`, `0x106` `SW_4KB_D`, `0x109` `SW_64KB_S`, `0x10a` `SW_64KB_D`). - 256-entry coordinate bit tables (`x_table`, `y_table`), mip-tail placement, and linear<->tiled subresource transfers (`copy_subresource<into>`). - Wire `xg_xs.dll` `TextureComputer` slots for explicit `0x100`–`0x10a` color/BC descriptors: - slot 2: `GetResourceLayout` - slot 3: `GetResourceSize` - slot 4: `GetResourceAlignment` - slot 5: `GetSubresourceOffset` - slot 6: `GetSubresourceElementAddress` - slot 8: `CopyIntoSubresource` (tiling) - slot 9: `CopyFromSubresource` (detiling) - slot 10: `GetResourceTiling` - Integrate `Gfx10Texture` detiling into D3D12 runtime `upload_texture` for explicit GFX10 tiled modes and multi-mip or array linear (`0x100`) textures (with `rows_match` footprint guard before copy). - Wire `startup_xg_gfx10_runtime`, `xg_gfx10_tiling_reference`, and `startup_xg_bc7_draw_warp` into `CMakePresets.json` pull request smoke test filter and build targets. - Verification suites: - `tests/startup_xg_gfx10_check.py` (`startup_xg_gfx10_runtime`): 24 synthetic cases across `BC1`–`BC7`, `R8`, `RG8`, `R16`, `R32`, `RGBA8`, `BGRA8`, `RGBA16`, `RGBA32`, explicit `SW_LINEAR` (`0x100`) through `SW_64KB_D` (`0x10a`) including multi-mip/multi-slice non-power-of-two `RGBA16 100x10 3m 2s LINEAR`, hard-coded Mesa 25.1.0 `addrlib` expected element byte offsets per element size, implicit/depth routing checks, and negative controls. - `tests/xg_swizzle_select_check.cpp --gfx10-tiling` (`xg_gfx10_tiling_reference`): compares surface size, slice size, alignment, mip offsets, and all texel/block addresses across 23 cases (including `RGBA8 64x64 3m LINEAR` and `RGBA16 100x10 3m 2s LINEAR` to pin linear mip ordering and `ShiftCeil` strides) against pinned Mesa 25.1.0 `addrlib` with 0 mismatches. - `tests/startup_xg_bc7_draw_check.py` (`startup_xg_bc7_draw_warp` / `_hardware`): tests BC7 64x64 / 81x69 linear & tiled draws, 512x256 display64k draw, non-BC64 RGBA8 64x64 0x105 (4KB_S) draw with negative swizzle control (4064/4096 pixels differ), and multi-mip RGBA8 64x64 3-mip 0x100 (LINEAR) draw detiled via `is_gfx10_tiled` with negative layout control (4096/4096 pixels differ). ### Documentation - `docs/experiments.md` ("Nine-mip BC5/BC7 tile queries") now states that the general computer answers slots 2, 3, 6, 8, 9 and 10 for explicit layouts `0x100`–`0x10a`, and keeps that section's pins specific to the earlier `0x109` BC5/BC7 shape. - `docs/startup-runtime.md` names the scope of `Gfx10Texture` instead of describing it as future work: it tiles explicit GFX10 layouts, while the UNKNOWN + 4096-alignment small-texture path keeps its compact linear plan pending a follow-up. ### Verification Measured at `ae9a7e44` (current `main` `36914379` merged, including #3410) on Windows 11 x64 build 26300, MSVC, AMD Radeon RX 6600M + D3D12 WARP + Mesa 25.1.0 `addrlib` from `tools/fetch_addrlib.py`: ```powershell cmake --build --preset release ctest --preset release --no-tests=error --output-on-failure -R '^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' ``` - **34 passed, 0 failed, 0 skipped** in 137.8 s: - addrlib references: `xg_gfx10_tiling_reference` (23 shapes), `xg_bc64_tiling_reference`, `startup_gfx10_layout_linear_addrlib`. - layout and stubs: `startup_xg_gfx10_runtime`, `startup_xg_bc_tiling`, `startup_xg_tile64_tiling`, `startup_xg_bc7_layout`, `startup_gfx10_layout`, `startup_gfx10_layout_display_control`, `startup_gfx10_layout_linear_order_control`, `startup_stubs`, `xg_swizzle_select(_mutation)`, `xg_swizzle_factory(_no_write)`. - draws (WARP + RX 6600M): `startup_xg_bc7_draw_warp`/`_hardware`, `startup_xg_bc_chain_warp`/`_hardware`, `startup_xg_bc_array_warp`/`_hardware`. - address paths: `startup_address_srv_warp`, `single_element`, `buffer_srv`, `volume_srv`, `bc_view`, `console`, `console_gate`, `console_gate_ring`, `console_gate_ring_reuse`, `console_gate_ring_keep`, `console_gate_ring_keep_release`, `console_linear_unpadded`, `console_cube_order`. Mergeability: - Merged current `main` (`36914379`, includes #3410); `git merge-tree --write-tree upstream/main HEAD` exits 0. Pure-Python checks: ```powershell python -B tests/docs_links_check.py python -B tests/bidi_controls_check.py git diff --check ``` - 175 Markdown files / 711 links checked; 2670 tracked files checked for bidirectional controls; diff clean. Earlier evidence remains in the thread: the 27-test run at `00c53f91` and the matched baseline/candidate title run reported on 2026-11-26 (local candidate `85e4df30`, which is not in the branch history after rebases; the change itself is unchanged).
tedin7 commented 2026-11-24 12:24:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:24:49Z.

Review: COMMENTED


Reviewed PR #1469 (a92ea122):

Verification

  • Win2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at a92ea122:
    • Debug (--preset dev): built startup_stub_xg_xs, startup_stub_consumer, offscreen_check, and downstream targets; ctest --preset dev -R '^(startup_xg_|startup_stub|bc7_)' 14/16 passed (startup_xg_gfx10_runtime, startup_xg_bc_tiling, startup_xg_bc7_layout, startup_stubs, startup_xg_bc_chain_*, startup_xg_bc_array_*, startup_xg_bc7_draw_*, bc7_tile_swizzle, bc7_block_reference, bc7_draw_*); 2 capability-skipped (bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp).
    • Release /O2 (--preset release): built same targets; ctest --preset release -R '^(startup_xg_|startup_stub|bc7_)' 14/16 passed, 2 capability-skipped (bc7_mode6_multiblock_*).
  • Linux checks at a92ea122:
    • tests/docs_links_check.py, tests/bidi_controls_check.py, git diff --check origin/main..HEAD: PASS
    • tests/gfx10_texture_roundtrip_check.py: PASS (6/6)
    • git merge-tree --write-tree origin/main HEAD: merges cleanly.

Code Audit Findings

  1. columns(mip) / rows(mip) returns 0 for non-square BC mips (src/startup_stubs/gfx10_texture.h):
    return (std::max)(1u, (width >> mip) + block_dim - 1) / block_dim;
    
    When width >> mip == 0 (e.g., 128x64 BC7 at mip = 7 where height >> 7 == 0), (std::max)(1u, 0 + 4 - 1) / 4 evaluates to 3 / 4 == 0. In gfx10_copy (src/startup_stubs/xg_bc64.inl), u64{tex.rows(level) - 1} then underflows UINT to 0xffffffff.
    It should be ((std::max)(1u, width >> mip) + block_dim - 1) / block_dim (and similarly for rows(mip)).
  2. Missing d.MipLevels <= 16 guard in Gfx10Texture::supports():
    mip_start, tiles_w, tiles_h, tail_origin_x, and tail_origin_y are fixed std::array<UINT, 16>. If d.MipLevels > 16 is passed, Gfx10Texture will index out of bounds (and width >> mip for mip >= 32 is UB). Adding d.MipLevels > 16 to supports() prevents that.
  3. Negative control in tests/startup_xg_gfx10_check.py:
    The 12 positive roundtrip cases pass, but there is no negative/failure control yet (e.g. pitch < row_bytes, out-of-range subresource/plane, overlapping src/dst, or unsupported format).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6039140208 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6039140208). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:24:49Z. **Review:** COMMENTED --- Reviewed PR #1469 (`a92ea122`): ### Verification - **Win2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at `a92ea122`:** - **Debug (`--preset dev`):** built `startup_stub_xg_xs`, `startup_stub_consumer`, `offscreen_check`, and downstream targets; `ctest --preset dev -R '^(startup_xg_|startup_stub|bc7_)'` **14/16 passed** (`startup_xg_gfx10_runtime`, `startup_xg_bc_tiling`, `startup_xg_bc7_layout`, `startup_stubs`, `startup_xg_bc_chain_*`, `startup_xg_bc_array_*`, `startup_xg_bc7_draw_*`, `bc7_tile_swizzle`, `bc7_block_reference`, `bc7_draw_*`); `2` capability-skipped (`bc7_mode6_multiblock_hardware`, `bc7_mode6_multiblock_warp`). - **Release `/O2` (`--preset release`):** built same targets; `ctest --preset release -R '^(startup_xg_|startup_stub|bc7_)'` **14/16 passed**, `2` capability-skipped (`bc7_mode6_multiblock_*`). - **Linux checks at `a92ea122`:** - `tests/docs_links_check.py`, `tests/bidi_controls_check.py`, `git diff --check origin/main..HEAD`: **PASS** - `tests/gfx10_texture_roundtrip_check.py`: **PASS** (6/6) - `git merge-tree --write-tree origin/main HEAD`: merges cleanly. ### Code Audit Findings 1. **`columns(mip)` / `rows(mip)` returns `0` for non-square BC mips (`src/startup_stubs/gfx10_texture.h`):** ```cpp return (std::max)(1u, (width >> mip) + block_dim - 1) / block_dim; ``` When `width >> mip == 0` (e.g., `128x64` BC7 at `mip = 7` where `height >> 7 == 0`), `(std::max)(1u, 0 + 4 - 1) / 4` evaluates to `3 / 4 == 0`. In `gfx10_copy` (`src/startup_stubs/xg_bc64.inl`), `u64{tex.rows(level) - 1}` then underflows `UINT` to `0xffffffff`. It should be `((std::max)(1u, width >> mip) + block_dim - 1) / block_dim` (and similarly for `rows(mip)`). 2. **Missing `d.MipLevels <= 16` guard in `Gfx10Texture::supports()`:** `mip_start`, `tiles_w`, `tiles_h`, `tail_origin_x`, and `tail_origin_y` are fixed `std::array<UINT, 16>`. If `d.MipLevels > 16` is passed, `Gfx10Texture` will index out of bounds (and `width >> mip` for `mip >= 32` is UB). Adding `d.MipLevels > 16` to `supports()` prevents that. 3. **Negative control in `tests/startup_xg_gfx10_check.py`:** The 12 positive roundtrip cases pass, but there is no negative/failure control yet (e.g. `pitch < row_bytes`, out-of-range subresource/plane, overlapping `src`/`dst`, or unsupported format).
Holastor commented 2026-11-24 13:00:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T12:43:29Z.


Addressed review feedback at eb3e418b:

  1. Non-square BC mips (columns / rows calculation):

    • Updated columns(mip) and rows(mip) in src/startup_stubs/gfx10_texture.h to ((std::max)(1u, width >> mip) + block_dim - 1) / block_dim and ((std::max)(1u, height >> mip) + block_dim - 1) / block_dim. This ensures columns and rows evaluate to at least 1 when (width|height) >> mip == 0, avoiding UINT underflow in gfx10_copy.
    • Added synthetic test case BC7 128x64 8-mip 4KB_S in tests/startup_xg_gfx10_check.py, which validates exact linear<->tiled roundtrip across all 8 mips (including mip 7 where height >> 7 == 0).
  2. MipLevels bounds guard in Gfx10Texture::supports():

    • Added d.MipLevels > 16 guard to supports() (rejecting d.MipLevels < 1 || d.MipLevels > 16), preventing fixed-size table out-of-bounds indexing or undefined bit-shift behavior.
  3. Negative control test coverage (tests/startup_xg_gfx10_check.py):

    • Added test_negative_controls(create) covering:
      • pitch < row_bytes: ensures E_INVALIDARG (0x80070057) on both CopyIntoSubresource (slot 8) and CopyFromSubresource (slot 9).
      • Out-of-range plane (plane > 0 on single-plane resource): ensures E_INVALIDARG.
      • Out-of-range subresource (subresource >= mips * slices): ensures E_INVALIDARG.
      • Overlapping source and destination buffers: ensures E_INVALIDARG.
      • Null destination or source pointers: ensures E_INVALIDARG.
      • MipLevels > 16: ensures descriptor is rejected from GFX10 tiling path.

Verification

  • ctest --preset dev --no-tests=error -R '^(startup_xg_|bc7_|texture_bc|bcpack)' -V
    • 17 passed, 2 capability-skipped (bc7_mode6_multiblock_*), 0 failed (100%).
    • startup_xg_gfx10_runtime: 13 synthetic test cases + negative controls all PASS.
  • Pure-Python checks:
    • python -B tests/docs_links_check.py (PASS)
    • python -B tests/bidi_controls_check.py (PASS)
    • python -B tests/gfx10_texture_roundtrip_check.py (PASS)
    • git diff --check (clean)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7131832355 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7131832355). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-24T12:43:29Z. --- Addressed review feedback at `eb3e418b`: 1. **Non-square BC mips (`columns` / `rows` calculation)**: - Updated `columns(mip)` and `rows(mip)` in `src/startup_stubs/gfx10_texture.h` to `((std::max)(1u, width >> mip) + block_dim - 1) / block_dim` and `((std::max)(1u, height >> mip) + block_dim - 1) / block_dim`. This ensures `columns` and `rows` evaluate to at least 1 when `(width|height) >> mip == 0`, avoiding `UINT` underflow in `gfx10_copy`. - Added synthetic test case `BC7 128x64 8-mip 4KB_S` in `tests/startup_xg_gfx10_check.py`, which validates exact linear<->tiled roundtrip across all 8 mips (including mip 7 where `height >> 7 == 0`). 2. **`MipLevels` bounds guard in `Gfx10Texture::supports()`**: - Added `d.MipLevels > 16` guard to `supports()` (rejecting `d.MipLevels < 1 || d.MipLevels > 16`), preventing fixed-size table out-of-bounds indexing or undefined bit-shift behavior. 3. **Negative control test coverage (`tests/startup_xg_gfx10_check.py`)**: - Added `test_negative_controls(create)` covering: - `pitch < row_bytes`: ensures `E_INVALIDARG` (`0x80070057`) on both `CopyIntoSubresource` (slot 8) and `CopyFromSubresource` (slot 9). - Out-of-range plane (`plane > 0` on single-plane resource): ensures `E_INVALIDARG`. - Out-of-range subresource (`subresource >= mips * slices`): ensures `E_INVALIDARG`. - Overlapping source and destination buffers: ensures `E_INVALIDARG`. - Null destination or source pointers: ensures `E_INVALIDARG`. - `MipLevels > 16`: ensures descriptor is rejected from GFX10 tiling path. ### Verification - `ctest --preset dev --no-tests=error -R '^(startup_xg_|bc7_|texture_bc|bcpack)' -V` - **17 passed**, **2 capability-skipped** (`bc7_mode6_multiblock_*`), **0 failed** (100%). - `startup_xg_gfx10_runtime`: 13 synthetic test cases + negative controls all PASS. - Pure-Python checks: - `python -B tests/docs_links_check.py` (PASS) - `python -B tests/bidi_controls_check.py` (PASS) - `python -B tests/gfx10_texture_roundtrip_check.py` (PASS) - `git diff --check` (clean)
ChazY11 commented 2026-11-24 14:03:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T13:15:05Z.


Built, ran, and probed with two mutations on the new tiler

Independent reviewer, not the author. Reviewed 88c391e2; nothing pushed to the branch. Mutations were made locally in
src/startup_stubs/gfx10_texture.h, rebuilt, reverted; working tree is clean.

Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100.

cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R '^(startup_xg_gfx10_runtime|gfx10_texture_roundtrip|gfx10_texture_roundtrip_controls|bc7_tile_swizzle)$' -V

Unmodified branch — startup_xg_gfx10_runtime reports all 13 cases passing, each with layout, tiling, slot 8 tile and
slot 9 detile roundtrip exact, across BC1/BC4/BC5/BC7/R8/R16/RGBA8, 64KB_S, 64KB_D, 4KB_S, 4KB_D, 256B_S and
LINEAR, including the two-slice and 8-mip cases; the negative controls (pitch < row_bytes, out-of-range
plane/subresource, overlap, null, mips > 16) pass. The three older tests are unchanged and green.

Mutation 1 — y coordinate table redirects every bit

-if ((y >> bit) & 1) val |= (1u << y_target_bit[bit]);
+if ((y >> bit) & 1) val |= (1u << (y_target_bit[bit] ^ 1));
startup_xg_gfx10_runtime ........... ***Failed
bc7_tile_swizzle ................... Passed
gfx10_texture_roundtrip ............ Passed
gfx10_texture_roundtrip_controls ... Passed

Mutation 2 — 4 KB modes report a 64 KB block

 case SW_4KB_S:
-case SW_4KB_D:  return 12;
+case SW_4KB_D:  return 16;
startup_xg_gfx10_runtime ........... ***Failed
gfx10_texture_roundtrip ............ Passed

What the second result implies

gfx10_texture_roundtrip and _controls run tests/gfx10_texture_roundtrip_check.py, i.e. the Python tiler in
tools/bc7_tiles.py. They cannot see a change in this new C++ header. So startup_xg_gfx10_runtime is currently the
only check that exercises gfx10_texture.h
, and both mutations above are invisible to everything else. That is not a
defect in this PR — it is the reason the new test matters — but it does mean the C++ tiler has a single guard, and any
future edit to it should keep that test in every job.

If it would help, a second oracle would be cheap: the Python tiler already knows these modes, so one case could compare
the C++ layout output against bc7_tiles.py's tiling for the same surface rather than round-tripping the C++ path
against itself. I am not asking for it in this PR.

Verdict

Reviewed 88c391e2. Builds clean, 13 cases and the negative controls pass, the older tests are unaffected, and two
independent mutations in the coordinate table and the mode dispatch are both caught. No objection from me.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7132562557 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7132562557). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T13:15:05Z. --- ## Built, ran, and probed with two mutations on the new tiler Independent reviewer, not the author. Reviewed `88c391e2`; nothing pushed to the branch. Mutations were made locally in `src/startup_stubs/gfx10_texture.h`, rebuilt, reverted; working tree is clean. Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100. ```powershell cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -R '^(startup_xg_gfx10_runtime|gfx10_texture_roundtrip|gfx10_texture_roundtrip_controls|bc7_tile_swizzle)$' -V ``` Unmodified branch — `startup_xg_gfx10_runtime` reports all 13 cases passing, each with layout, tiling, slot 8 tile and slot 9 detile roundtrip exact, across BC1/BC4/BC5/BC7/R8/R16/RGBA8, `64KB_S`, `64KB_D`, `4KB_S`, `4KB_D`, `256B_S` and `LINEAR`, including the two-slice and 8-mip cases; the negative controls (pitch < row_bytes, out-of-range plane/subresource, overlap, null, mips > 16) pass. The three older tests are unchanged and green. ### Mutation 1 — y coordinate table redirects every bit ```diff -if ((y >> bit) & 1) val |= (1u << y_target_bit[bit]); +if ((y >> bit) & 1) val |= (1u << (y_target_bit[bit] ^ 1)); ``` ```text startup_xg_gfx10_runtime ........... ***Failed bc7_tile_swizzle ................... Passed gfx10_texture_roundtrip ............ Passed gfx10_texture_roundtrip_controls ... Passed ``` ### Mutation 2 — 4 KB modes report a 64 KB block ```diff case SW_4KB_S: -case SW_4KB_D: return 12; +case SW_4KB_D: return 16; ``` ```text startup_xg_gfx10_runtime ........... ***Failed gfx10_texture_roundtrip ............ Passed ``` ### What the second result implies `gfx10_texture_roundtrip` and `_controls` run `tests/gfx10_texture_roundtrip_check.py`, i.e. the Python tiler in `tools/bc7_tiles.py`. They cannot see a change in this new C++ header. So **`startup_xg_gfx10_runtime` is currently the only check that exercises `gfx10_texture.h`**, and both mutations above are invisible to everything else. That is not a defect in this PR — it is the reason the new test matters — but it does mean the C++ tiler has a single guard, and any future edit to it should keep that test in every job. If it would help, a second oracle would be cheap: the Python tiler already knows these modes, so one case could compare the C++ layout output against `bc7_tiles.py`'s tiling for the same surface rather than round-tripping the C++ path against itself. I am not asking for it in this PR. ### Verdict Reviewed `88c391e2`. Builds clean, 13 cases and the negative controls pass, the older tests are unaffected, and two independent mutations in the coordinate table and the mode dispatch are both caught. No objection from me.
R0Y00 commented 2026-11-24 15:02:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:10:25Z.


Independent Windows check at 88c391e2, using source-built inputs. For 1024×1024 BC7_UNORM and BC7_UNORM_SRGB with nine mips, and BC6H_UF16 with eleven, slot 10 reported 22 tiles, a packed tail at tile 0, and the three standard mips beginning at tiles 6, 2 and 1. Per-block addressing and two-way copies matched our independent comparison for all 87,381 blocks of each BC7 chain and all 87,383 blocks of the BC6H chain. Padding sentinels and rejected short pitches were also checked. We will use this PR as the shared implementation for that path.

One ABI question remains. For packed mips, the slot 2 layout record's 32-bit field at +0x48 was 1 here and 2 in our local implementation. Does the field have an identified consumer or an independent expected value? The slot 10 and copy results above agree with either value.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7133953508 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7133953508). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T14:10:25Z. --- Independent Windows check at `88c391e2`, using source-built inputs. For 1024×1024 BC7_UNORM and BC7_UNORM_SRGB with nine mips, and BC6H_UF16 with eleven, slot 10 reported 22 tiles, a packed tail at tile 0, and the three standard mips beginning at tiles 6, 2 and 1. Per-block addressing and two-way copies matched our independent comparison for all 87,381 blocks of each BC7 chain and all 87,383 blocks of the BC6H chain. Padding sentinels and rejected short pitches were also checked. We will use this PR as the shared implementation for that path. One ABI question remains. For packed mips, the slot 2 layout record's 32-bit field at `+0x48` was 1 here and 2 in our local implementation. Does the field have an identified consumer or an independent expected value? The slot 10 and copy results above agree with either value.
Holastor commented 2026-11-24 15:02:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T14:26:29Z.


Thanks for the thorough independent verification on BC7 and BC6H!

Regarding the +0x48 field in the subresource layout record:

  1. In our implementation, 1 corresponds to SW_256B_S (ADDR_SW_256B_S in addrlib), representing the 256-byte micro-tile mode for the _S (Standard) macro-tile flavor, whereas 2 corresponds to SW_256B_D (ADDR_SW_256B_D).
  2. We checked runtime stubs, callers, and observed traces: we haven't identified any consumer reading mip + 0x48 (callers rely on mip->Offset, RowPitch, extents, or the slot 10 D3D12_SUBRESOURCE_TILING records).
  3. Since both values produce identical layout extents, slot 10 tiling, and two-way copies, we have no preference and are happy to align with your local implementation (2, or selecting SW_256B_S (1) / SW_256B_D (2) based on the parent mode's S/D flavor) if you prefer consistency with your local tooling.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7134379102 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7134379102). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-24T14:26:29Z. --- Thanks for the thorough independent verification on BC7 and BC6H! Regarding the `+0x48` field in the subresource layout record: 1. In our implementation, `1` corresponds to `SW_256B_S` (`ADDR_SW_256B_S` in addrlib), representing the 256-byte micro-tile mode for the `_S` (Standard) macro-tile flavor, whereas `2` corresponds to `SW_256B_D` (`ADDR_SW_256B_D`). 2. We checked runtime stubs, callers, and observed traces: we haven't identified any consumer reading `mip + 0x48` (callers rely on `mip->Offset`, `RowPitch`, extents, or the slot 10 `D3D12_SUBRESOURCE_TILING` records). 3. Since both values produce identical layout extents, slot 10 tiling, and two-way copies, we have no preference and are happy to align with your local implementation (`2`, or selecting `SW_256B_S (1)` / `SW_256B_D (2)` based on the parent mode's S/D flavor) if you prefer consistency with your local tooling.
R0Y00 commented 2026-11-24 15:02:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:24:05Z.


A regression surfaced in a one-DLL A/B at 88c391e2. With the same runtime and warmed shader cache, the previous XG path rendered the full Latin text on a mixed-script page. After replacing only XG, the same text lost individual Latin glyphs; the language selection capture still matched pixel for pixel. The sparse BC1 mip ranges improved in that same run.

The distinction is reproducible without title data. For descriptors with UNKNOWN layout, 2D R8, RG8, RGBA, BC3 and BC7 uploads produced different bytes from the previous path; both planes of an explicit NV12 sample agreed. A local selective build keeps the previous behavior for those five implicit-layout cases while matching your slot 10 output for all 133 sampled explicit sparse descriptors. Could we keep the proven explicit layout routing and cover implicit layout selection in separate source-built upload tests? I am also checking an intro color regression separately.

Completed the single-DLL retest on RTX 4060 Laptop. The previous intro produced a uniform green client image. The selective build produced consecutive distinct full-color intro frames. A 712 × 80 mixed-script text region on each of two UI pages matched the previous known-good build pixel for pixel (maximum channel error 0 on both). The later letterboxed image still became magenta in the selective build; that later rendering failure remains open. No private inputs or captures are needed for the five upload comparisons above.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7134312424 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7134312424). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T14:24:05Z. --- A regression surfaced in a one-DLL A/B at `88c391e2`. With the same runtime and warmed shader cache, the previous XG path rendered the full Latin text on a mixed-script page. After replacing only XG, the same text lost individual Latin glyphs; the language selection capture still matched pixel for pixel. The sparse BC1 mip ranges improved in that same run. The distinction is reproducible without title data. For descriptors with UNKNOWN layout, 2D R8, RG8, RGBA, BC3 and BC7 uploads produced different bytes from the previous path; both planes of an explicit NV12 sample agreed. A local selective build keeps the previous behavior for those five implicit-layout cases while matching your slot 10 output for all 133 sampled explicit sparse descriptors. Could we keep the proven explicit layout routing and cover implicit layout selection in separate source-built upload tests? I am also checking an intro color regression separately. Completed the single-DLL retest on RTX 4060 Laptop. The previous intro produced a uniform green client image. The selective build produced consecutive distinct full-color intro frames. A 712 × 80 mixed-script text region on each of two UI pages matched the previous known-good build pixel for pixel (maximum channel error 0 on both). The later letterboxed image still became magenta in the selective build; that later rendering failure remains open. No private inputs or captures are needed for the five upload comparisons above.
tedin7 commented 2026-11-24 17:50:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T17:50:10Z.

Review: COMMENTED


Re-review of head 88c391e2d0 (comment only, not an approval). My earlier review was at a92ea122d7.

Verdict: 1 P1, 3 P2. The tiler itself looks correct (below); the problem is where it is routed.

Earlier points: the rows/columns underflow, the MipLevels > 16 guard and the negative controls are all fixed at this head.

P1: every implicit-layout 2D texture now gets the swizzled 64 KiB computer (src/startup_stubs/xg_xs.cpp:378, with gfx10_swizzle_from_desc in gfx10_texture.h)

  • Gfx10Texture::supports() is true for any 2D texture with a known format, and gfx10_swizzle_from_desc returns SW_64KB_S for any layout that is neither explicit nor row-major, including layout 0. The old bc64::supports accepted only 1024-wide BC5/BC7 with layout 0x109. Textures that used the desktop-footprint path (slots 2, 8, 10) now take the tiled path, while upload_texture still reads implicit-layout memory as linear (is_tiled() is false for layout 0). This fits R0Y00's field report (comment 7134312424) that implicit-layout R8, RG8, RGBA, BC3 and BC7 uploads differ from the previous path.
  • Reproduction: the real xg_xs.cpp built into a DLL with mingw and run under wine. Slot 8 on an RGBA8 64x64 layout-0 texture returns size=65536 output_is_row_major=0; dump 28 256 256 1 1 0 gives size=40000 align=10000 at the PR head. Wine has no D3D12 device, so the base path was read from source rather than run.
  • Fix: gate the table swap on explicit layouts (is_tiled(desc) or bc64::supports) and add an implicit-layout test.

P2

  1. Linear (0x100) is accepted but its metadata is wrong: init_linear() in xg_bc64.inl never fills tiles_w/tiles_h. dump 28 256 256 1 1 0x100 gives mip0 span=0 pitchB=0 padw=0, tiles=1024 shape=64x1x1. The roundtrip test passes anyway because it never reads those fields.
  2. tests/startup_xg_gfx10_check.py only checks tile-then-detile gives the input back, so any bijective permutation passes. Slot 5 is never called, first_addr in slot 6 is never asserted, layout records are never read, and the MipLevels=17 control only asserts align != 65536. addrlib is already an optional dependency (tools/fetch_addrlib.py, xg_swizzle_select_check.cpp); compare addresses and sizes against it.
  3. Claims versus tests: the body lists D16, D24S8, D32F, RG8, BGRA8, RGBA16 and RGBA32, but no test case covers them (and D24S8 is not S/D swizzle for depth on this hardware); the body says 19/19 tests and 12 cases while a comment says 17 passed, 2 skipped, 13 cases; "clean-room" conflicts with "derived from Mesa addrlib" and the AMD copyright line in the header. Against origin/main cea8af5b it no longer merges cleanly (CMakeLists.txt and xg_xs.cpp, trivial; from be98528a, which added a tile64_plan.h answer for slot 10 layout 0x10a).

What I ran

  • git diff --check, docs_links_check (16 files, 334 links) and bidi_controls_check: pass. gfx10_texture_roundtrip_check roundtrip and controls pass, but they test tools/bc7_tiles.py, which this PR does not touch. startup_xg_gfx10_check.py cannot run on Linux (no ctypes.WINFUNCTYPE); I ran a C++ port of it (13 cases plus negatives) against the real DLL under wine: all pass.
  • Base DLL versus PR DLL on the shapes the old code supported (BC7/BC5, 1024 wide, layout 0x109): layout, size, offsets, tiling and all texel addresses identical. Against an addrlib build (Mesa 25.1.0, navi21 config), 30 cases across BC1/3/4/5/7, R8, R16, RG8, RGBA8, RGBA16, RGBA32, R32 and 256B/4KB/64KB S and D match on size, alignment, mip offsets and every texel address.
  • Mutations (each restored with git checkout --): block log2 of SW_4KB_D 12 -> 16, tail x/y bit sources swapped, reverting the rows() fix and slot 10 reporting one more standard mip are caught by the port. NOT caught by it: swapping x1 and x2 in the 4-byte S pattern (a wrong but bijective swizzle; only the addrlib comparison sees it, pr=32896 addrlib=32832), and a linear mip pitch no longer 256-aligned (neither sees it). A columns()-only edit was also not caught; the height case needs the rows() change.

Non-blocking

  • After the merge the new gfx10_tiling and main's tile64::Plan both answer slot 10; they matched on 7 of 7 valid 0x10a shapes I compared and differ only for an invalid 256x256 with 16 mips.
  • The d3d12_memory_srv.inl edit is dead for now (supports_memory_srv still gates on bc64::supports); gfx10_swizzle_from_desc reads X2W_XG_BC7_4K_S_LAYOUT through GetEnvironmentVariableA on every construction; about 2.4 KB of tables are rebuilt per call; total_slice_bytes and address() are 32-bit and overflow above 4 GiB; the +0x48 offset question was answered in a comment only and stays unverified.
  • #1641, #1567, #1701, #1441 and #1277 touch the same stub files, mostly the include area.

Not run: any ctest preset, the real startup_xg_gfx10_check.py, a D3D12 device, llvm-mc-19 (no shader forms in the diff). The wine harness shims __try, so unreadable-memory probes were inert.

Linux limits: no Windows, MSVC, DXC or D3D12 device here; LLVM 19 only. Anything that needs them was not run.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6044494242 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6044494242). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T17:50:10Z. **Review:** COMMENTED --- Re-review of head 88c391e2d0c9b71f0a915a90252babb504506b35 (comment only, not an approval). My earlier review was at a92ea122d7. Verdict: 1 P1, 3 P2. The tiler itself looks correct (below); the problem is where it is routed. Earlier points: the rows/columns underflow, the `MipLevels > 16` guard and the negative controls are all fixed at this head. P1: every implicit-layout 2D texture now gets the swizzled 64 KiB computer (src/startup_stubs/xg_xs.cpp:378, with `gfx10_swizzle_from_desc` in gfx10_texture.h) - `Gfx10Texture::supports()` is true for any 2D texture with a known format, and `gfx10_swizzle_from_desc` returns `SW_64KB_S` for any layout that is neither explicit nor row-major, including layout 0. The old `bc64::supports` accepted only 1024-wide BC5/BC7 with layout 0x109. Textures that used the desktop-footprint path (slots 2, 8, 10) now take the tiled path, while `upload_texture` still reads implicit-layout memory as linear (`is_tiled()` is false for layout 0). This fits R0Y00's field report (comment 7134312424) that implicit-layout R8, RG8, RGBA, BC3 and BC7 uploads differ from the previous path. - Reproduction: the real xg_xs.cpp built into a DLL with mingw and run under wine. Slot 8 on an RGBA8 64x64 layout-0 texture returns `size=65536 output_is_row_major=0`; `dump 28 256 256 1 1 0` gives `size=40000 align=10000` at the PR head. Wine has no D3D12 device, so the base path was read from source rather than run. - Fix: gate the table swap on explicit layouts (`is_tiled(desc)` or `bc64::supports`) and add an implicit-layout test. P2 1. Linear (0x100) is accepted but its metadata is wrong: `init_linear()` in xg_bc64.inl never fills `tiles_w`/`tiles_h`. `dump 28 256 256 1 1 0x100` gives mip0 `span=0 pitchB=0 padw=0`, `tiles=1024 shape=64x1x1`. The roundtrip test passes anyway because it never reads those fields. 2. tests/startup_xg_gfx10_check.py only checks tile-then-detile gives the input back, so any bijective permutation passes. Slot 5 is never called, `first_addr` in slot 6 is never asserted, layout records are never read, and the `MipLevels=17` control only asserts `align != 65536`. addrlib is already an optional dependency (tools/fetch_addrlib.py, xg_swizzle_select_check.cpp); compare addresses and sizes against it. 3. Claims versus tests: the body lists D16, D24S8, D32F, RG8, BGRA8, RGBA16 and RGBA32, but no test case covers them (and D24S8 is not S/D swizzle for depth on this hardware); the body says 19/19 tests and 12 cases while a comment says 17 passed, 2 skipped, 13 cases; "clean-room" conflicts with "derived from Mesa addrlib" and the AMD copyright line in the header. Against origin/main cea8af5b it no longer merges cleanly (CMakeLists.txt and xg_xs.cpp, trivial; from be98528a, which added a tile64_plan.h answer for slot 10 layout 0x10a). What I ran - `git diff --check`, docs_links_check (16 files, 334 links) and bidi_controls_check: pass. gfx10_texture_roundtrip_check roundtrip and controls pass, but they test tools/bc7_tiles.py, which this PR does not touch. startup_xg_gfx10_check.py cannot run on Linux (no `ctypes.WINFUNCTYPE`); I ran a C++ port of it (13 cases plus negatives) against the real DLL under wine: all pass. - Base DLL versus PR DLL on the shapes the old code supported (BC7/BC5, 1024 wide, layout 0x109): layout, size, offsets, tiling and all texel addresses identical. Against an addrlib build (Mesa 25.1.0, navi21 config), 30 cases across BC1/3/4/5/7, R8, R16, RG8, RGBA8, RGBA16, RGBA32, R32 and 256B/4KB/64KB S and D match on size, alignment, mip offsets and every texel address. - Mutations (each restored with `git checkout --`): block log2 of SW_4KB_D 12 -> 16, tail x/y bit sources swapped, reverting the `rows()` fix and slot 10 reporting one more standard mip are caught by the port. NOT caught by it: swapping x1 and x2 in the 4-byte S pattern (a wrong but bijective swizzle; only the addrlib comparison sees it, `pr=32896 addrlib=32832`), and a linear mip pitch no longer 256-aligned (neither sees it). A `columns()`-only edit was also not caught; the height case needs the `rows()` change. Non-blocking - After the merge the new `gfx10_tiling` and main's `tile64::Plan` both answer slot 10; they matched on 7 of 7 valid 0x10a shapes I compared and differ only for an invalid 256x256 with 16 mips. - The d3d12_memory_srv.inl edit is dead for now (`supports_memory_srv` still gates on `bc64::supports`); `gfx10_swizzle_from_desc` reads `X2W_XG_BC7_4K_S_LAYOUT` through `GetEnvironmentVariableA` on every construction; about 2.4 KB of tables are rebuilt per call; `total_slice_bytes` and `address()` are 32-bit and overflow above 4 GiB; the `+0x48` offset question was answered in a comment only and stays unverified. - #1641, #1567, #1701, #1441 and #1277 touch the same stub files, mostly the include area. Not run: any ctest preset, the real startup_xg_gfx10_check.py, a D3D12 device, llvm-mc-19 (no shader forms in the diff). The wine harness shims `__try`, so unreadable-memory probes were inert. Linux limits: no Windows, MSVC, DXC or D3D12 device here; LLVM 19 only. Anything that needs them was not run. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 05:22:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:22:09Z.

Review: COMMENTED


Re-review of head eca1f09e88 (comment only, not an approval). Earlier reviews were at a92ea122 and 88c391e2.

Verdict: 0 P1, 1 P2. The earlier P1 (implicit-layout textures routed to the swizzled computer) is fixed at this head.

Fixed since 88c391e2

  • gfx10_swizzle_from_desc (src/startup_stubs/gfx10_texture.h:136) now accepts only (layout & 0xFF00) == 0x100. Layout 0 and 1 return 0xFF, so supports() is false and XGCreateTextureComputer (xg_xs.cpp:409) keeps the desktop table for them.
  • init_linear() now fills tiles_w/tiles_h for 0x100.
  • test_implicit_and_unsupported_routing covers UNKNOWN RGBA8/R8/RG8/BC3/BC7, ROW_MAJOR RGBA8 and D24S8/D32F, and checks desktop span=16384 pitch=256 for RGBA8 UNKNOWN.
  • The positive cases now cover BC1-BC7, R8, RG8, R16, R32, RGBA8, BGRA8, RGBA16, RGBA32 and linear, across 256B/4KB/64KB S and D modes (22 cases), which matches the body.
  • upload_texture and device_memory_srv gate on Gfx10Texture::is_tiled, so upload and XG routing agree for implicit layouts.

P2

  1. The tests still do not pin the swizzle pattern, and the only address oracle is skipped where it ran. I applied one mutation to the new logic: in PATTERN_S[2] (gfx10_texture.h, 4-byte elements, the RGBA8 / BGRA8 S case) I swapped y0y1 to y1y0. startup_xg_* on Win2025 stayed green (10/10 passed). The roundtrip and slot checks accept any bijective permutation. xg_gfx10_tiling_reference is the check that compares against addrlib, but it reports Skipped on Win2025 (addrlib not configured), so this mutant survives. Please either run it with addrlib in the Windows CI job, or add a few hard-coded expected byte offsets per element size (1, 2, 4, 8, 16) taken from an addrlib run into startup_xg_gfx10_check.py.

Nit

  • Slot 10 / layout +0x48 writes the swizzle mode (9 for 64KB_S), same as the previous path. The 256B S vs D value in the thread is unread by any consumer, so no change needed.

Checks run

  • Linux: python3 tests/docs_links_check.py PASS (18 files, 407 links); python3 tests/bidi_controls_check.py PASS (1489 files); git diff --check origin/main...HEAD clean; python3 -I -m py_compile tests/startup_xg_gfx10_check.py OK; python3 -I tests/gfx10_texture_roundtrip_check.py PASS (6 tests; this one covers the 4 KiB BC7 Python tool, not the new C++).
  • Win2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP) at eca1f09e: python3 x2w_pipe.py win2025 1469 --wait 3600 --targets startup_stub_xg_xs,xg_swizzle_select_check,startup_stub_consumer,startup_bc64_supports_check --regex '^(startup_xg_|startup_stub|xg_|startup_bc64|bc7_)'. Dev and release (/O2): 100% tests passed (25 selected; 17 ran, 8 skipped). Skipped: xg_bc64_tiling_reference, xg_gfx10_tiling_reference, xg_swizzle_select, xg_swizzle_select_mutation, xg_swizzle_factory, xg_swizzle_factory_no_write (no addrlib), bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp.
  • Mutation (P2 1): win2025 1469 --wt . --skip-release --regex '^startup_xg_' with the one-line change above: 10/10 passed, mutant survived. Reverted with git checkout -- ..
  • CI at review time: Linux Python checks pass; Windows jobs pending. Mergeable. Title is neutral.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052248735 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6052248735). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T05:22:09Z. **Review:** COMMENTED --- Re-review of head eca1f09e88080fedc192e190d4b8b5cac2bb580e (comment only, not an approval). Earlier reviews were at a92ea122 and 88c391e2. Verdict: 0 P1, 1 P2. The earlier P1 (implicit-layout textures routed to the swizzled computer) is fixed at this head. Fixed since 88c391e2 - `gfx10_swizzle_from_desc` (src/startup_stubs/gfx10_texture.h:136) now accepts only `(layout & 0xFF00) == 0x100`. Layout 0 and 1 return 0xFF, so `supports()` is false and `XGCreateTextureComputer` (xg_xs.cpp:409) keeps the desktop table for them. - `init_linear()` now fills `tiles_w`/`tiles_h` for 0x100. - `test_implicit_and_unsupported_routing` covers UNKNOWN RGBA8/R8/RG8/BC3/BC7, ROW_MAJOR RGBA8 and D24S8/D32F, and checks desktop `span=16384 pitch=256` for RGBA8 UNKNOWN. - The positive cases now cover BC1-BC7, R8, RG8, R16, R32, RGBA8, BGRA8, RGBA16, RGBA32 and linear, across 256B/4KB/64KB S and D modes (22 cases), which matches the body. - `upload_texture` and `device_memory_srv` gate on `Gfx10Texture::is_tiled`, so upload and XG routing agree for implicit layouts. P2 1. The tests still do not pin the swizzle pattern, and the only address oracle is skipped where it ran. I applied one mutation to the new logic: in `PATTERN_S[2]` (gfx10_texture.h, 4-byte elements, the RGBA8 / BGRA8 S case) I swapped `y0y1` to `y1y0`. `startup_xg_*` on Win2025 stayed green (10/10 passed). The roundtrip and slot checks accept any bijective permutation. `xg_gfx10_tiling_reference` is the check that compares against addrlib, but it reports Skipped on Win2025 (`addrlib not configured`), so this mutant survives. Please either run it with addrlib in the Windows CI job, or add a few hard-coded expected byte offsets per element size (1, 2, 4, 8, 16) taken from an addrlib run into `startup_xg_gfx10_check.py`. Nit - Slot 10 / layout `+0x48` writes the swizzle mode (9 for 64KB_S), same as the previous path. The 256B S vs D value in the thread is unread by any consumer, so no change needed. Checks run - Linux: `python3 tests/docs_links_check.py` PASS (18 files, 407 links); `python3 tests/bidi_controls_check.py` PASS (1489 files); `git diff --check origin/main...HEAD` clean; `python3 -I -m py_compile tests/startup_xg_gfx10_check.py` OK; `python3 -I tests/gfx10_texture_roundtrip_check.py` PASS (6 tests; this one covers the 4 KiB BC7 Python tool, not the new C++). - Win2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP) at eca1f09e: `python3 x2w_pipe.py win2025 1469 --wait 3600 --targets startup_stub_xg_xs,xg_swizzle_select_check,startup_stub_consumer,startup_bc64_supports_check --regex '^(startup_xg_|startup_stub|xg_|startup_bc64|bc7_)'`. Dev and release (`/O2`): 100% tests passed (25 selected; 17 ran, 8 skipped). Skipped: `xg_bc64_tiling_reference`, `xg_gfx10_tiling_reference`, `xg_swizzle_select`, `xg_swizzle_select_mutation`, `xg_swizzle_factory`, `xg_swizzle_factory_no_write` (no addrlib), `bc7_mode6_multiblock_hardware`, `bc7_mode6_multiblock_warp`. - Mutation (P2 1): `win2025 1469 --wt . --skip-release --regex '^startup_xg_'` with the one-line change above: 10/10 passed, mutant survived. Reverted with `git checkout -- .`. - CI at review time: Linux Python checks pass; Windows jobs pending. Mergeable. Title is neutral. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 05:46:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:46:19Z.

Review: COMMENTED


Re-review of head 5477f0bac9 (comment only, not an approval). Earlier reviews were at a92ea122, 88c391e2 and eca1f09e.

Verdict: 0 P1, 0 P2, 1 P3 (merge conflict with current main). The earlier P2 (swizzle pattern not pinned) is addressed.

Fixed since eca1f09e

  • New test_pinned_addrlib_offsets in tests/startup_xg_gfx10_check.py:304 pins hard-coded element byte offsets for 13 surfaces across element sizes 1, 2, 4, 8 and 16 (S and D modes, 256B/4KB/64KB, plus BC7 mip-tail origins). It checks both GetElementOffset (slot 6) and the bytes CopyIntoSubresource (slot 8) writes at that offset.
  • I hand-checked the RGBA8 64KB_S case against PATTERN_S[2] ("----x0x1y0y1y2x2", gfx10_texture.h:226): x=1/2/4 give 0x4/0x8/0x80, y=1/2/4 give 0x10/0x20/0x40, y=8 gives 0x100, x=8 gives 0x200. These match the pinned values. Swapping y0y1 there now moves y=1 from 0x10 to 0x20, so this test would fail on the mutant that survived at eca1f09e.
  • I could not confirm that the offsets really come from addrlib (it is not configured here, xg_gfx10_tiling_reference still reports Skipped). They are self-consistent with the documented patterns, which is what matters for regression protection.

P3

  1. The PR is CONFLICTING with current main (b0669e06). git merge-tree --write-tree origin/main HEAD reports a content conflict in src/startup_stubs/d3d12_draw.inl (the upload_texture hunks around lines 991-1100); CMakeLists.txt merges cleanly. Please merge or rebase main again before this goes Ready.

Checks run

  • python3 tests/docs_links_check.py PASS (18 files, 408 links).
  • python3 tests/bidi_controls_check.py PASS (1496 files).
  • git diff --check origin/main...HEAD clean.
  • python3 -I -m py_compile tests/startup_xg_gfx10_check.py OK.
  • Win2025 (D3D12 WARP): python3 x2w_pipe.py win2025 1469 --wait 3600 --targets startup_stub_xg_xs,xg_swizzle_select_check --regex "startup_xg|xg_swizzle|xg_gfx10" ran on the pipeline's own merged ref (088add19), dev phase only. startup_xg_gfx10_runtime Passed (0.68 s), which includes the new pinned-offset test. The other 15 matched tests were Not Run or Skipped because my narrow --targets did not build them (and addrlib is not configured); they are not results about this PR. The release phase did not run because dev stopped on those Not Run entries, so I make no claim about it.
  • I did not apply a new source mutation on Windows this round; the mutation argument above is by hand against the pinned values.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052460828 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6052460828). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T05:46:19Z. **Review:** COMMENTED --- Re-review of head 5477f0bac9db0129367f3bc72c2c455e320a2e65 (comment only, not an approval). Earlier reviews were at a92ea122, 88c391e2 and eca1f09e. Verdict: 0 P1, 0 P2, 1 P3 (merge conflict with current main). The earlier P2 (swizzle pattern not pinned) is addressed. Fixed since eca1f09e - New `test_pinned_addrlib_offsets` in `tests/startup_xg_gfx10_check.py:304` pins hard-coded element byte offsets for 13 surfaces across element sizes 1, 2, 4, 8 and 16 (S and D modes, 256B/4KB/64KB, plus BC7 mip-tail origins). It checks both `GetElementOffset` (slot 6) and the bytes `CopyIntoSubresource` (slot 8) writes at that offset. - I hand-checked the RGBA8 64KB_S case against `PATTERN_S[2]` ("----x0x1y0y1y2x2", gfx10_texture.h:226): x=1/2/4 give 0x4/0x8/0x80, y=1/2/4 give 0x10/0x20/0x40, y=8 gives 0x100, x=8 gives 0x200. These match the pinned values. Swapping `y0y1` there now moves y=1 from 0x10 to 0x20, so this test would fail on the mutant that survived at eca1f09e. - I could not confirm that the offsets really come from addrlib (it is not configured here, `xg_gfx10_tiling_reference` still reports Skipped). They are self-consistent with the documented patterns, which is what matters for regression protection. P3 1. The PR is `CONFLICTING` with current main (b0669e06). `git merge-tree --write-tree origin/main HEAD` reports a content conflict in `src/startup_stubs/d3d12_draw.inl` (the `upload_texture` hunks around lines 991-1100); `CMakeLists.txt` merges cleanly. Please merge or rebase main again before this goes Ready. Checks run - `python3 tests/docs_links_check.py` PASS (18 files, 408 links). - `python3 tests/bidi_controls_check.py` PASS (1496 files). - `git diff --check origin/main...HEAD` clean. - `python3 -I -m py_compile tests/startup_xg_gfx10_check.py` OK. - Win2025 (D3D12 WARP): `python3 x2w_pipe.py win2025 1469 --wait 3600 --targets startup_stub_xg_xs,xg_swizzle_select_check --regex "startup_xg|xg_swizzle|xg_gfx10"` ran on the pipeline's own merged ref (088add19), dev phase only. `startup_xg_gfx10_runtime` Passed (0.68 s), which includes the new pinned-offset test. The other 15 matched tests were Not Run or Skipped because my narrow `--targets` did not build them (and addrlib is not configured); they are not results about this PR. The release phase did not run because dev stopped on those Not Run entries, so I make no claim about it. - I did not apply a new source mutation on Windows this round; the mutation argument above is by hand against the pinned values. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 05:46:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:46:33Z.

Review: COMMENTED


Correction to my previous comment: the head moved from 5477f0ba to 088add1912 while I was reviewing, so that comment was filed against 088add19 but its text describes 5477f0ba.

  • The P3 (merge conflict in src/startup_stubs/d3d12_draw.inl) no longer applies: GitHub now reports the PR as MERGEABLE at 088add19.
  • The Win2025 WARP run in that comment was already executed on 088add19 (startup_xg_gfx10_runtime Passed, including the pinned-offset test).
  • I did not re-read the diff between 5477f0ba and 088add19 line by line beyond that run. Verdict stays 0 P1, 0 P2.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052462478 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6052462478). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T05:46:33Z. **Review:** COMMENTED --- Correction to my previous comment: the head moved from 5477f0ba to 088add19123aceba20c60b7c0498033f08d193c2 while I was reviewing, so that comment was filed against 088add19 but its text describes 5477f0ba. - The P3 (merge conflict in `src/startup_stubs/d3d12_draw.inl`) no longer applies: GitHub now reports the PR as MERGEABLE at 088add19. - The Win2025 WARP run in that comment was already executed on 088add19 (`startup_xg_gfx10_runtime` Passed, including the pinned-offset test). - I did not re-read the diff between 5477f0ba and 088add19 line by line beyond that run. Verdict stays 0 P1, 0 P2. AI-assisted; commands listed were executed locally.
Holastor commented 2026-11-25 06:01:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T05:08:14Z.


Addressed the P1, P2, and merge-conflict feedback from @tedin7 and @R0Y00 at eca1f09e:

  1. P1 — Gate Gfx10Texture routing on explicit console layouts (0x100–0x10a):

    • Updated gfx10_swizzle_from_desc() in src/startup_stubs/gfx10_texture.h so only explicit (layout & 0xFF00) == 0x100 descriptors are accepted; implicit layouts (D3D12_TEXTURE_LAYOUT_UNKNOWN = 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR = 1) now return 0xFFu and route to the desktop footprint table in xg_xs.cpp (and removed the per-construction GetEnvironmentVariableA("X2W_XG_BC7_4K_S_LAYOUT", ...) call from gfx10_swizzle_from_desc).
    • Added test_implicit_and_unsupported_routing() in tests/startup_xg_gfx10_check.py covering UNKNOWN layout RGBA8, R8, RG8, BC3, BC7 and ROW_MAJOR RGBA8, asserting desktop stub routing (and verifying RGBA8 64x64 UNKNOWN reports desktop span=16384, pitch=256 instead of 64KB_S).
  2. P2 #1 — Fix SW_LINEAR (0x100) metadata in init_linear():

    • Populated tiles_w[i] = (cols + tile_width - 1) / tile_width and tiles_h[i] = r in Gfx10Texture::init_linear(), so slot 2 (span, pitchB, padw, padh) and slot 10 (tilings) report valid 256-byte-aligned linear metadata instead of zeros.
    • Added multi-mip RGBA8 256x256 3-mip LINEAR and slot 2 / slot 10 assertions for all cases in tests/startup_xg_gfx10_check.py.
  3. P2 #2 — Strengthen tests & add addrlib address/size oracle (xg_gfx10_tiling_reference):

    • tests/startup_xg_gfx10_check.py now checks slot 2 plane & mip records, slot 5 (GetSubresourceOffset) including out-of-range checks, slot 6 (GetSubresourceElementAddress) first_addr and sampled coordinates matched byte-for-byte against slot 8 output, slot 10 (GetResourceTiling) entries, and tightens the MipLevels=17 control to assert desktop fallback (slots[3]/[9] no-op and l_mips == 15).
    • Added --gfx10-tiling (xg_gfx10_tiling_reference, SKIP_RETURN_CODE 77) in tests/xg_swizzle_select_check.cpp comparing surfSize, sliceSize, baseAlign, firstMipIdInTail, mip offsets, and every texel/block address across 20 cases against pinned Mesa 25.1.0 addrlib (Addr2ComputeSurfaceInfo / Addr2ComputeSurfaceAddrFromCoord).
  4. P2 #3 & Non-blocking cleanups:

    • Merged upstream/main (67758cba, including be98528a tile64_plan.h, single_element_srv, and partial_tiled_bc in d3d12_draw.inl / d3d12_memory_srv.inl).
    • Removed depth/stencil formats (D16_UNORM, D24_UNORM_S8_UINT, D32_FLOAT, R24G8_*) from gfx10_format_info and rejected D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL in Gfx10Texture::supports(), keeping depth resources on the desktop path (tested in test_implicit_and_unsupported_routing()).
    • Added test cases covering BC2, BC3, BC6H, RG8, R32, BGRA8, RGBA16, and RGBA32, and updated the PR body to match the tested formats, exact counts, and MIT/Mesa addrlib attribution.
    • Changed total_slice_bytes, mip_start, and address() in Gfx10Texture to UINT64 to avoid 32-bit overflow above 4 GiB.

Verification at eca1f09e

  • ctest --preset dev --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_bc_view|startup_stubs|bc7_|texture_bc)" (with XBOX2WINDOWS_ADDRLIB_DIR from tools/fetch_addrlib.py): 22 passed, 2 capability-skipped (bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp), 0 failed.
    • xg_gfx10_tiling_reference: PASS (20/20 cases matched Mesa 25.1.0 addrlib).
    • startup_xg_gfx10_runtime: PASS (22 cases + implicit/depth routing + negative controls).
    • startup_xg_tile64_tiling, startup_xg_bc_tiling, startup_xg_bc7_layout, startup_stubs, startup_xg_bc*_warp/hardware, startup_address_bc_view_warp/hardware, bc7_*, texture_bc_volume: PASS.
  • Pure-Python & diff checks: docs_links_check.py (18 files, 407 links), bidi_controls_check.py (1497 files), gfx10_texture_roundtrip_check.py (6/6), and git diff --check upstream/main..HEAD all PASS.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7153483413 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7153483413). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-25T05:08:14Z. --- Addressed the P1, P2, and merge-conflict feedback from @tedin7 and @R0Y00 at `eca1f09e`: 1. **P1 — Gate `Gfx10Texture` routing on explicit console layouts (`0x100`–`0x10a`)**: - Updated `gfx10_swizzle_from_desc()` in `src/startup_stubs/gfx10_texture.h` so only explicit `(layout & 0xFF00) == 0x100` descriptors are accepted; implicit layouts (`D3D12_TEXTURE_LAYOUT_UNKNOWN` = 0, `D3D12_TEXTURE_LAYOUT_ROW_MAJOR` = 1) now return `0xFFu` and route to the desktop footprint `table` in `xg_xs.cpp` (and removed the per-construction `GetEnvironmentVariableA("X2W_XG_BC7_4K_S_LAYOUT", ...)` call from `gfx10_swizzle_from_desc`). - Added `test_implicit_and_unsupported_routing()` in `tests/startup_xg_gfx10_check.py` covering `UNKNOWN` layout `RGBA8`, `R8`, `RG8`, `BC3`, `BC7` and `ROW_MAJOR` `RGBA8`, asserting desktop stub routing (and verifying `RGBA8 64x64 UNKNOWN` reports desktop `span=16384`, `pitch=256` instead of `64KB_S`). 2. **P2 #1 — Fix `SW_LINEAR` (`0x100`) metadata in `init_linear()`**: - Populated `tiles_w[i] = (cols + tile_width - 1) / tile_width` and `tiles_h[i] = r` in `Gfx10Texture::init_linear()`, so slot 2 (`span`, `pitchB`, `padw`, `padh`) and slot 10 (`tilings`) report valid 256-byte-aligned linear metadata instead of zeros. - Added multi-mip `RGBA8 256x256 3-mip LINEAR` and slot 2 / slot 10 assertions for all cases in `tests/startup_xg_gfx10_check.py`. 3. **P2 #2 — Strengthen tests & add `addrlib` address/size oracle (`xg_gfx10_tiling_reference`)**: - `tests/startup_xg_gfx10_check.py` now checks slot 2 plane & mip records, slot 5 (`GetSubresourceOffset`) including out-of-range checks, slot 6 (`GetSubresourceElementAddress`) `first_addr` and sampled coordinates matched byte-for-byte against slot 8 output, slot 10 (`GetResourceTiling`) entries, and tightens the `MipLevels=17` control to assert desktop fallback (`slots[3]`/`[9]` no-op and `l_mips == 15`). - Added `--gfx10-tiling` (`xg_gfx10_tiling_reference`, `SKIP_RETURN_CODE 77`) in `tests/xg_swizzle_select_check.cpp` comparing `surfSize`, `sliceSize`, `baseAlign`, `firstMipIdInTail`, mip offsets, and every texel/block address across 20 cases against pinned Mesa 25.1.0 `addrlib` (`Addr2ComputeSurfaceInfo` / `Addr2ComputeSurfaceAddrFromCoord`). 4. **P2 #3 & Non-blocking cleanups**: - Merged `upstream/main` (`67758cba`, including `be98528a` `tile64_plan.h`, `single_element_srv`, and `partial_tiled_bc` in `d3d12_draw.inl` / `d3d12_memory_srv.inl`). - Removed depth/stencil formats (`D16_UNORM`, `D24_UNORM_S8_UINT`, `D32_FLOAT`, `R24G8_*`) from `gfx10_format_info` and rejected `D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL` in `Gfx10Texture::supports()`, keeping depth resources on the desktop path (tested in `test_implicit_and_unsupported_routing()`). - Added test cases covering `BC2`, `BC3`, `BC6H`, `RG8`, `R32`, `BGRA8`, `RGBA16`, and `RGBA32`, and updated the PR body to match the tested formats, exact counts, and MIT/Mesa `addrlib` attribution. - Changed `total_slice_bytes`, `mip_start`, and `address()` in `Gfx10Texture` to `UINT64` to avoid 32-bit overflow above 4 GiB. ### Verification at `eca1f09e` - `ctest --preset dev --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_bc_view|startup_stubs|bc7_|texture_bc)"` (with `XBOX2WINDOWS_ADDRLIB_DIR` from `tools/fetch_addrlib.py`): **22 passed, 2 capability-skipped** (`bc7_mode6_multiblock_hardware`, `bc7_mode6_multiblock_warp`), **0 failed**. - `xg_gfx10_tiling_reference`: **PASS** (20/20 cases matched Mesa 25.1.0 `addrlib`). - `startup_xg_gfx10_runtime`: **PASS** (22 cases + implicit/depth routing + negative controls). - `startup_xg_tile64_tiling`, `startup_xg_bc_tiling`, `startup_xg_bc7_layout`, `startup_stubs`, `startup_xg_bc*_warp`/`hardware`, `startup_address_bc_view_warp`/`hardware`, `bc7_*`, `texture_bc_volume`: **PASS**. - Pure-Python & diff checks: `docs_links_check.py` (18 files, 407 links), `bidi_controls_check.py` (1497 files), `gfx10_texture_roundtrip_check.py` (6/6), and `git diff --check upstream/main..HEAD` all **PASS**.
Holastor commented 2026-11-25 06:01:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T05:40:52Z.


Addressed the P2 finding (eca1f09e review) and merged upstream/main (b0669e06, including #2015 and #2214) at commit 088add19:

  1. P2 — Pin expected element byte offsets per element size in tests/startup_xg_gfx10_check.py:

    • Added test_pinned_addrlib_offsets(create) with hard-coded element byte offsets collected from xg_gfx10_tiling_reference (Mesa 25.1.0 addrlib, navi21) covering all 5 element sizes (1, 2, 4, 8, 16 bytes) across both _S and _D modes (R8 64KB_S, R8 4KB_D, R16 4KB_S, RG8 4KB_D, BGRA8 4KB_S, RGBA8 64KB_S, R32 256B_D, BC1 64KB_S, RGBA16 64KB_D, RGBA32 4KB_S, BC5 64KB_D, and BC7 64x64 7-mip 4KB_S including mips 2–6 in the mip tail).
    • For each coordinate, asserts both slot 6 (GetSubresourceElementAddress) equals the pinned offset and slot 8 (CopyIntoSubresource) writes the expected element bytes at that pinned offset.
    • Added R8 64x64 1-mip 4KB_D to both tests/startup_xg_gfx10_check.py (23 cases) and tests/xg_swizzle_select_check.cpp (--gfx10-tiling, 21 cases) so _S and _D are covered for all 5 element sizes.
    • Confirmed the exact PATTERN_S[2] mutation (y0y1 -> y1y0) is now caught by startup_xg_gfx10_runtime (AssertionError: BGRA8 64x64 3-mip 4KB_S mip 0 (0,1): slot6 addr=0x2020, expected 0x2010), then restored.
  2. Clean merge with upstream/main (b0669e06) & drop d3d12_memory_srv.inl diff:

    • Merged upstream/main cleanly and reverted the earlier dead condition in src/startup_stubs/d3d12_memory_srv.inl, keeping upstream/main's slot-70 console_layout_srv path unmodified and gating Gfx10Texture in upload_texture (d3d12_draw.inl) on !tiled_address.

Verification at 088add19

  • ctest --preset dev --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_|startup_stubs|startup_gfx10_layout|bc7_|texture_bc)": 36 passed, 2 capability-skipped (bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp — exit 77), 0 failed (51.63 sec), including startup_xg_gfx10_runtime, xg_gfx10_tiling_reference, startup_address_console*_warp/hardware, and startup_gfx10_layout*.
  • Pure-Python & diff checks: docs_links_check.py (18 Markdown files and 409 links), bidi_controls_check.py (1499 files), gfx10_texture_roundtrip_check.py (6/6), and git diff --check upstream/main..HEAD all PASS.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7154032605 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7154032605). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-25T05:40:52Z. --- Addressed the P2 finding (`eca1f09e` review) and merged `upstream/main` (`b0669e06`, including #2015 and #2214) at commit `088add19`: 1. **P2 — Pin expected element byte offsets per element size in [`tests/startup_xg_gfx10_check.py`](https://github.com/Holastor/Xbox2Windows/blob/088add19/tests/startup_xg_gfx10_check.py)**: - Added `test_pinned_addrlib_offsets(create)` with hard-coded element byte offsets collected from `xg_gfx10_tiling_reference` (Mesa 25.1.0 `addrlib`, `navi21`) covering all 5 element sizes (`1, 2, 4, 8, 16` bytes) across both `_S` and `_D` modes (`R8 64KB_S`, `R8 4KB_D`, `R16 4KB_S`, `RG8 4KB_D`, `BGRA8 4KB_S`, `RGBA8 64KB_S`, `R32 256B_D`, `BC1 64KB_S`, `RGBA16 64KB_D`, `RGBA32 4KB_S`, `BC5 64KB_D`, and `BC7 64x64 7-mip 4KB_S` including mips 2–6 in the mip tail). - For each coordinate, asserts both `slot 6` (`GetSubresourceElementAddress`) equals the pinned offset and `slot 8` (`CopyIntoSubresource`) writes the expected element bytes at that pinned offset. - Added `R8 64x64 1-mip 4KB_D` to both `tests/startup_xg_gfx10_check.py` (23 cases) and [`tests/xg_swizzle_select_check.cpp`](https://github.com/Holastor/Xbox2Windows/blob/088add19/tests/xg_swizzle_select_check.cpp) (`--gfx10-tiling`, 21 cases) so `_S` and `_D` are covered for all 5 element sizes. - Confirmed the exact `PATTERN_S[2]` mutation (`y0y1` -> `y1y0`) is now caught by `startup_xg_gfx10_runtime` (`AssertionError: BGRA8 64x64 3-mip 4KB_S mip 0 (0,1): slot6 addr=0x2020, expected 0x2010`), then restored. 2. **Clean merge with `upstream/main` (`b0669e06`) & drop `d3d12_memory_srv.inl` diff**: - Merged `upstream/main` cleanly and reverted the earlier dead condition in `src/startup_stubs/d3d12_memory_srv.inl`, keeping `upstream/main`'s slot-70 `console_layout_srv` path unmodified and gating `Gfx10Texture` in `upload_texture` (`d3d12_draw.inl`) on `!tiled_address`. ### Verification at `088add19` - `ctest --preset dev --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_|startup_stubs|startup_gfx10_layout|bc7_|texture_bc)"`: **36 passed, 2 capability-skipped** (`bc7_mode6_multiblock_hardware`, `bc7_mode6_multiblock_warp` — exit `77`), **0 failed** (`51.63 sec`), including `startup_xg_gfx10_runtime`, `xg_gfx10_tiling_reference`, `startup_address_console*_warp`/`hardware`, and `startup_gfx10_layout*`. - Pure-Python & diff checks: `docs_links_check.py` (`18 Markdown files and 409 links`), `bidi_controls_check.py` (`1499` files), `gfx10_texture_roundtrip_check.py` (`6/6`), and `git diff --check upstream/main..HEAD` all **PASS**.
stan495 commented 2026-11-25 06:34:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T06:34:39Z.

Review: APPROVED


Verified head 088add19 on Windows x64 (dev preset, MSVC 19.44.35228.0, Python 3.12):

  • cmake --build --preset dev --target xg_swizzle_select_check startup_stub_xg_xs -> succeeded
  • ctest --preset dev --no-tests=error -R '^(xg_gfx10_tiling_reference|startup_xg_gfx10_runtime)$' -V:
    • Passed (1): startup_xg_gfx10_runtime
    • Capability Skipped (1, exit 77): xg_gfx10_tiling_reference (addrlib not configured)

Verdict: Approved at 088add19 (noting xg_gfx10_tiling_reference skipped locally without addrlib).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052910534 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6052910534). Originally posted by [stan495](https://github.com/stan495) on 2026-11-25T06:34:39Z. **Review:** APPROVED --- Verified head `088add19` on Windows x64 (`dev` preset, MSVC `19.44.35228.0`, Python 3.12): - `cmake --build --preset dev --target xg_swizzle_select_check startup_stub_xg_xs` -> succeeded - `ctest --preset dev --no-tests=error -R '^(xg_gfx10_tiling_reference|startup_xg_gfx10_runtime)$' -V`: - Passed (1): `startup_xg_gfx10_runtime` - Capability Skipped (1, exit 77): `xg_gfx10_tiling_reference` (`addrlib not configured`) Verdict: Approved at `088add19` (noting `xg_gfx10_tiling_reference` skipped locally without `addrlib`).
RavenCurseBurg commented 2026-11-25 09:04:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T08:21:40Z.


The current explicit-layout branch (088add19) uses the shared BC copy-in prototype for slot 9 in src/startup_stubs/xg_xs.cpp. Microsoft's public Scarlett CopyFromSubresource call has an extra zero-valued UINT after the subresource index. #2257 corrects this for the existing BC mip chains on main. A Windows control restoring the old registration rejected that documented call. When integrating the general layout, the same slot-9 entry point and ctypes prototype apply to your new cases. Focused regression

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7156929580 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7156929580). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T08:21:40Z. --- The current explicit-layout branch (`088add19`) uses the shared BC copy-in prototype for slot 9 in `src/startup_stubs/xg_xs.cpp`. Microsoft's public Scarlett [CopyFromSubresource call](https://github.com/microsoft/DirectXTex/blob/a8e5dbf42909aeeb9fcf9c2ae399ae3c06737379/Auxiliary/DirectXTexXboxDetile.cpp#L229-L238) has an extra zero-valued UINT after the subresource index. #2257 corrects this for the existing BC mip chains on main. A Windows control restoring the old registration rejected that documented call. When integrating the general layout, the same slot-9 entry point and ctypes prototype apply to your new cases. [Focused regression](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45574916739)
Holastor commented 2026-11-25 10:05:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T10:05:07Z.


Merged upstream/main (342d3fa9, including #2257 and #2263) into the branch and aligned the general GFX10 path with the Scarlett slot-9 CopyFromSubresource signature at a3cb0e89:

  • Slot 9 & profile dispatch (src/startup_stubs/xg_bc64.inl, src/startup_stubs/xg_xs.cpp):
    • Wired bc64_copy_from on bc_table slot 9 for explicit 0x100–0x10a descriptors (Gfx10Texture::supports), rejecting non-zero scarlett_option with E_NOTIMPL before reading/touching either buffer and forwarding 0 to bc64_copy<false> / gfx10_copy<false>.
    • Kept upstream/main's bc7_4k_table (bc7_4k_s_copy_from from #2263) for the opt-in UNKNOWN 4K BC7 profile and small_texture_4k_plan (#2133) in d3d12_draw.inl / xg_xs.cpp; removed the now-unreachable bc7_4k_s_layout branches from xg_bc64.inl.
  • Tests (tests/startup_xg_gfx10_check.py):
    • Updated slot-9 calls to COPY_FROM (passing 0 for scarlett_option, exercising both slice_pitch = 0 and len(linear_src)).
    • Added negative controls for COPY_FROM(slots[9]): null pointers (E_INVALIDARG), short slice_pitch (E_INVALIDARG), and non-zero scarlett_option (1, 0xFFFFFFFF) on both BC7 and RGBA8 (E_NOTIMPL / 0x80004001, verifying destination sentinel bytes are untouched and option validation runs before argument checks).

Verification at a3cb0e89

  • Debug (MSVC 19.51.36263.0, addrlib from out/deps/mesa/src/amd/addrlib):
    ctest ... --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_bc64_supports|startup_small_texture_4k|startup_tile64_plan|startup_gfx10_layout|startup_single_element_srv)"
    -> 33/33 passed (xg_gfx10_tiling_reference, xg_bc64_tiling_reference, startup_xg_gfx10_runtime, startup_xg_bc_tiling, startup_xg_tile64_tiling, startup_xg_bc7_layout, startup_xg_bc7_draw_{warp,hardware}, startup_xg_bc_chain_{warp,hardware}, startup_xg_bc_array_{warp,hardware}, startup_small_texture_4k_*, etc.).
  • Release (/O2, MSVC 19.51.36263.0, addrlib from out/deps/mesa/src/amd/addrlib):
    ctest ... --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_bc64_supports|startup_small_texture_4k|startup_tile64_plan|startup_gfx10_layout|startup_single_element_srv|startup_address_)"
    -> 47/47 passed (startup_xg_gfx10_runtime passed all 23 GFX10 cases, 12 pinned addrlib offset surfaces, implicit/depth routing, and negative controls).
  • Pure-Python & diff checks:
    • .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py: PASS (18 files, 435 links)
    • .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py: PASS (1586 files)
    • .\out\pe-env\Scripts\python.exe -B tests/gfx10_texture_roundtrip_check.py: PASS (6/6)
    • git diff --check upstream/main: clean
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7159201348 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7159201348). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-25T10:05:07Z. --- Merged `upstream/main` (`342d3fa9`, including `#2257` and `#2263`) into the branch and aligned the general GFX10 path with the Scarlett slot-9 `CopyFromSubresource` signature at `a3cb0e89`: - **Slot 9 & profile dispatch (`src/startup_stubs/xg_bc64.inl`, `src/startup_stubs/xg_xs.cpp`)**: - Wired `bc64_copy_from` on `bc_table` slot 9 for explicit `0x100`–`0x10a` descriptors (`Gfx10Texture::supports`), rejecting non-zero `scarlett_option` with `E_NOTIMPL` before reading/touching either buffer and forwarding `0` to `bc64_copy<false>` / `gfx10_copy<false>`. - Kept `upstream/main`'s `bc7_4k_table` (`bc7_4k_s_copy_from` from `#2263`) for the opt-in `UNKNOWN` 4K BC7 profile and `small_texture_4k_plan` (`#2133`) in `d3d12_draw.inl` / `xg_xs.cpp`; removed the now-unreachable `bc7_4k_s_layout` branches from `xg_bc64.inl`. - **Tests (`tests/startup_xg_gfx10_check.py`)**: - Updated slot-9 calls to `COPY_FROM` (passing `0` for `scarlett_option`, exercising both `slice_pitch = 0` and `len(linear_src)`). - Added negative controls for `COPY_FROM(slots[9])`: null pointers (`E_INVALIDARG`), short `slice_pitch` (`E_INVALIDARG`), and non-zero `scarlett_option` (`1`, `0xFFFFFFFF`) on both `BC7` and `RGBA8` (`E_NOTIMPL` / `0x80004001`, verifying destination sentinel bytes are untouched and option validation runs before argument checks). ### Verification at `a3cb0e89` - **Debug (`MSVC 19.51.36263.0`, `addrlib` from `out/deps/mesa/src/amd/addrlib`)**: `ctest ... --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_bc64_supports|startup_small_texture_4k|startup_tile64_plan|startup_gfx10_layout|startup_single_element_srv)"` -> **33/33 passed** (`xg_gfx10_tiling_reference`, `xg_bc64_tiling_reference`, `startup_xg_gfx10_runtime`, `startup_xg_bc_tiling`, `startup_xg_tile64_tiling`, `startup_xg_bc7_layout`, `startup_xg_bc7_draw_{warp,hardware}`, `startup_xg_bc_chain_{warp,hardware}`, `startup_xg_bc_array_{warp,hardware}`, `startup_small_texture_4k_*`, etc.). - **Release (`/O2`, `MSVC 19.51.36263.0`, `addrlib` from `out/deps/mesa/src/amd/addrlib`)**: `ctest ... --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_bc64_supports|startup_small_texture_4k|startup_tile64_plan|startup_gfx10_layout|startup_single_element_srv|startup_address_)"` -> **47/47 passed** (`startup_xg_gfx10_runtime` passed all 23 GFX10 cases, 12 pinned addrlib offset surfaces, implicit/depth routing, and negative controls). - **Pure-Python & diff checks**: - `.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py`: PASS (18 files, 435 links) - `.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py`: PASS (1586 files) - `.\out\pe-env\Scripts\python.exe -B tests/gfx10_texture_roundtrip_check.py`: PASS (6/6) - `git diff --check upstream/main`: clean
tedin7 commented 2026-11-25 10:08:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:08:00Z.

Review: COMMENTED


Re-review at head a3cb0e896d701f552ed7194e17541e3dbba41650 (previous reviewed head 088add19). The new commit is a merge of main (342d3fa9) plus the slot 9 copy-out alignment with #2257/#2263.

New since the last review:

  • src/startup_stubs/xg_bc64.inl: the bc7_4k_s_layout special cases are removed from gfx10_layout and gfx10_copy. A new bc64_copy_from (slot 9) returns E_NOTIMPL for a non-zero scarlett_option before touching either buffer, then delegates to bc64_copy<false>. This matches xg_xs.cpp:164-166.
  • src/startup_stubs/xg_xs.cpp: table selection now uses Gfx10Texture::supports(desc). The separate bc7_4k_table path still overrides it, so 4 KiB BC7 surfaces keep their own slots.
  • tests/startup_xg_gfx10_check.py: adds a non-zero scarlett_option refusal check on a BC surface and on an RGBA8 64x64 4KB_S surface, plus a mips>16 refusal.

Commands executed locally:

  • git diff --check origin/main...HEAD: clean.
  • python3 tests/docs_links_check.py: pass (18 files, 435 links).
  • python3 tests/bidi_controls_check.py: pass.
  • g++ ... tests/xg_swizzle_select_check.cpp && ./xg_swizzle_select --gfx10-tiling: SKIP (no addrlib on this Linux host).
  • tests/startup_xg_gfx10_check.py needs ctypes.WINFUNCTYPE, so it is Windows-only and cannot run on Linux.
  • x2w_pipe.py win2025 1469 --regex 'xg_gfx10|xg_bc64|startup_xg_bc_tiling|startup_xg_gfx10' on Windows Server 2025 + WARP at this SHA, dev and release: exit 0. startup_xg_gfx10_runtime, startup_xg_bc_tiling and xg_bc64_tiling_reference passed. xg_gfx10_tiling_reference was Skipped (exit 77, addrlib not present).

Findings:

  • P1: none.
  • P2: none.
  • Nit: xg_gfx10_tiling_reference skips on both Linux and the Win2025 runner because addrlib is missing. The new Gfx10Texture tiling is therefore checked against the addrlib reference only where addrlib is configured. The Python runtime test covers exact detile and tile round trips. Consider confirming it once on a host with addrlib before Ready.
  • Nit: I did not run a logic mutation on the new slot 9 option check. The Windows runner tests the pushed head, not my local worktree, so a local mutation would not have been exercised. The test does assert the E_NOTIMPL path explicitly (startup_xg_gfx10_check.py:293-310).

CI on the PR was still pending when I checked (Windows build, Linux Python checks, gfx1013 fixtures). The PR is mergeable and the title is neutral.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6055545292 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6055545292). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:08:00Z. **Review:** COMMENTED --- Re-review at head `a3cb0e896d701f552ed7194e17541e3dbba41650` (previous reviewed head `088add19`). The new commit is a merge of main (`342d3fa9`) plus the slot 9 copy-out alignment with #2257/#2263. New since the last review: - `src/startup_stubs/xg_bc64.inl`: the `bc7_4k_s_layout` special cases are removed from `gfx10_layout` and `gfx10_copy`. A new `bc64_copy_from` (slot 9) returns `E_NOTIMPL` for a non-zero `scarlett_option` before touching either buffer, then delegates to `bc64_copy<false>`. This matches `xg_xs.cpp:164-166`. - `src/startup_stubs/xg_xs.cpp`: table selection now uses `Gfx10Texture::supports(desc)`. The separate `bc7_4k_table` path still overrides it, so 4 KiB BC7 surfaces keep their own slots. - `tests/startup_xg_gfx10_check.py`: adds a non-zero `scarlett_option` refusal check on a BC surface and on an RGBA8 64x64 4KB_S surface, plus a mips>16 refusal. Commands executed locally: - `git diff --check origin/main...HEAD`: clean. - `python3 tests/docs_links_check.py`: pass (18 files, 435 links). - `python3 tests/bidi_controls_check.py`: pass. - `g++ ... tests/xg_swizzle_select_check.cpp && ./xg_swizzle_select --gfx10-tiling`: SKIP (no addrlib on this Linux host). - `tests/startup_xg_gfx10_check.py` needs `ctypes.WINFUNCTYPE`, so it is Windows-only and cannot run on Linux. - `x2w_pipe.py win2025 1469 --regex 'xg_gfx10|xg_bc64|startup_xg_bc_tiling|startup_xg_gfx10'` on Windows Server 2025 + WARP at this SHA, dev and release: exit 0. `startup_xg_gfx10_runtime`, `startup_xg_bc_tiling` and `xg_bc64_tiling_reference` passed. `xg_gfx10_tiling_reference` was Skipped (exit 77, addrlib not present). Findings: - P1: none. - P2: none. - Nit: `xg_gfx10_tiling_reference` skips on both Linux and the Win2025 runner because addrlib is missing. The new `Gfx10Texture` tiling is therefore checked against the addrlib reference only where addrlib is configured. The Python runtime test covers exact detile and tile round trips. Consider confirming it once on a host with addrlib before Ready. - Nit: I did not run a logic mutation on the new slot 9 option check. The Windows runner tests the pushed head, not my local worktree, so a local mutation would not have been exercised. The test does assert the `E_NOTIMPL` path explicitly (`startup_xg_gfx10_check.py:293-310`). CI on the PR was still pending when I checked (Windows build, Linux Python checks, gfx1013 fixtures). The PR is mergeable and the title is neutral. AI-assisted; commands listed were executed locally.
Holastor commented 2026-11-25 11:02:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T10:10:27Z.


@tedin7 Thanks for the re-review! The pinned offsets in test_pinned_addrlib_offsets already lock down the exact Mesa addrlib (navi21) byte addresses across 1/2/4/8/16-byte elements so CI guards the swizzle equations even when addrlib is not built on the runner.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7159326610 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7159326610). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-25T10:10:27Z. --- @tedin7 Thanks for the re-review! The pinned offsets in `test_pinned_addrlib_offsets` already lock down the exact Mesa `addrlib` (navi21) byte addresses across 1/2/4/8/16-byte elements so CI guards the swizzle equations even when `addrlib` is not built on the runner.
Holastor commented 2026-11-25 16:05:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T15:30:24Z.


@R0Y00 Ready for review and merge into main when you have time — all checks are green and verified against Mesa 25.1.0 addrlib (36 passed, 2 skipped in ctest). Let me know if anything needs changes or if it should be closed in favor of another approach.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7166948117 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7166948117). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-25T15:30:24Z. --- @R0Y00 Ready for review and merge into main when you have time — all checks are green and verified against Mesa 25.1.0 addrlib (36 passed, 2 skipped in ctest). Let me know if anything needs changes or if it should be closed in favor of another approach.
tedin7 commented 2026-11-25 19:27:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:27:48Z.

Review: COMMENTED


Comment review of head 2c835d5f (a merge of main on top of a3cb0e89, which @tedin7 already reviewed; the PR's own change is the same).

What I checked (Linux only, no Win2025 run, no game):

  • git diff --check origin/main...HEAD: clean.
  • python3 tests/docs_links_check.py and python3 tests/bidi_controls_check.py: pass.
  • tests/startup_xg_gfx10_check.py is Windows-only (ctypes.WINFUNCTYPE), so it cannot run here. Its result on this head is not verified by me.
  • Diff scope: gfx10_texture.h, slots 2-6, 8-10 in xg_xs.cpp/xg_bc64.inl, and the routing in d3d12_draw.inl. No sibling table I could see was left out.

Why I am not merging:

  • The thread carries rendering regressions seen while running the game (R0Y00's A/B at 88c391e2: lost Latin glyphs, a magenta letterboxed image that "remains open"). Routing was narrowed to explicit layouts 0x100-0x10a afterwards, but no one has re-run the game on this head.
  • We have no game here, so we cannot confirm that. This is a startup-path change: the merge stays with MasterDomino or @R0Y00, who can verify it on the game.
  • Still open from the thread: the +0x48 layout-record field (1 vs 2) has no identified consumer, and implicit-layout uploads (UNKNOWN) still need their own source-built upload tests.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6063710188 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6063710188). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T19:27:48Z. **Review:** COMMENTED --- Comment review of head `2c835d5f` (a merge of main on top of `a3cb0e89`, which @tedin7 already reviewed; the PR's own change is the same). **What I checked (Linux only, no Win2025 run, no game):** - `git diff --check origin/main...HEAD`: clean. - `python3 tests/docs_links_check.py` and `python3 tests/bidi_controls_check.py`: pass. - `tests/startup_xg_gfx10_check.py` is Windows-only (`ctypes.WINFUNCTYPE`), so it cannot run here. Its result on this head is not verified by me. - Diff scope: `gfx10_texture.h`, slots 2-6, 8-10 in `xg_xs.cpp`/`xg_bc64.inl`, and the routing in `d3d12_draw.inl`. No sibling table I could see was left out. **Why I am not merging:** - The thread carries rendering regressions seen while running the game (R0Y00's A/B at `88c391e2`: lost Latin glyphs, a magenta letterboxed image that "remains open"). Routing was narrowed to explicit layouts `0x100`-`0x10a` afterwards, but no one has re-run the game on this head. - We have no game here, so we cannot confirm that. This is a startup-path change: the merge stays with MasterDomino or @R0Y00, who can verify it on the game. - Still open from the thread: the `+0x48` layout-record field (1 vs 2) has no identified consumer, and implicit-layout uploads (UNKNOWN) still need their own source-built upload tests. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-25 21:01:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T20:23:09Z.


I ran the current 2c835d5f Windows Release candidate. All 23 TextureComputer cases and their implicit-route, pitch and range controls passed. Ten BC chain/array and address-upload CTests passed on WARP and RTX 4060 Laptop. The local addrlib-dependent checks skipped; your pinned Mesa run is separate. The earlier glyph regression was observed on an earlier route. For the current narrowed explicit-layout candidate, the remaining check is a matched baseline/candidate run through that same glyph transition and late frame, with the same profile/cache and first visible difference if any. Keep the input and raw captures local.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173591624 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7173591624). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T20:23:09Z. --- I ran the current `2c835d5f` Windows Release candidate. All 23 TextureComputer cases and their implicit-route, pitch and range controls passed. Ten BC chain/array and address-upload CTests passed on WARP and RTX 4060 Laptop. The local addrlib-dependent checks skipped; your pinned Mesa run is separate. The earlier glyph regression was observed on an earlier route. For the current narrowed explicit-layout candidate, the remaining check is a matched baseline/candidate run through that same glyph transition and late frame, with the same profile/cache and first visible difference if any. Keep the input and raw captures local.
Holastor commented 2026-11-25 23:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T22:40:41Z.


@R0Y00, any update on the matched baseline/candidate run for 2c835d5f?

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7176657527 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7176657527). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-25T22:40:41Z. --- @R0Y00, any update on the matched baseline/candidate run for 2c835d5f?
tedin7 commented 2026-11-26 03:44:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:44:16Z.

Review: COMMENTED


Comment review of head 32eabd4e. It is 2c835d5f plus a merge of main (only conflict: CMakeLists.txt, the xg_gfx10_tiling_reference block and the new tooling_fetch_addrlib_cli_check block, both kept). The PR's own change is identical to 2c835d5f, which I already reviewed.

What I checked:

  • git diff --check: clean. python3 tests/docs_links_check.py and python3 tests/bidi_controls_check.py: pass.
  • Win2025 WARP receipt for this head is in the thread: dev 25/25, release 25/25 (addrlib-based checks skip with 77 on the VM).

Why I am not merging:

  • The thread has game rendering regressions seen at 88c391e2 and the matched baseline/candidate run is still open. We have no game here, so this stays with @R0Y00 or MasterDomino.
  • My earlier open points still apply: the +0x48 layout-record field has no identified consumer, and implicit-layout (UNKNOWN) uploads need their own source-built tests.

Note for @Holastor: I pushed the main merge to your branch so it is no longer conflicting; no force-push.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068262960 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6068262960). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:44:16Z. **Review:** COMMENTED --- Comment review of head `32eabd4e`. It is `2c835d5f` plus a merge of main (only conflict: `CMakeLists.txt`, the `xg_gfx10_tiling_reference` block and the new `tooling_fetch_addrlib_cli_check` block, both kept). The PR's own change is identical to `2c835d5f`, which I already reviewed. **What I checked:** - `git diff --check`: clean. `python3 tests/docs_links_check.py` and `python3 tests/bidi_controls_check.py`: pass. - Win2025 WARP receipt for this head is in the thread: dev 25/25, release 25/25 (addrlib-based checks skip with 77 on the VM). **Why I am not merging:** - The thread has game rendering regressions seen at `88c391e2` and the matched baseline/candidate run is still open. We have no game here, so this stays with @R0Y00 or MasterDomino. - My earlier open points still apply: the `+0x48` layout-record field has no identified consumer, and implicit-layout (UNKNOWN) uploads need their own source-built tests. Note for @Holastor: I pushed the main merge to your branch so it is no longer conflicting; no force-push. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 04:04:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:44:01Z.


Win2025 WARP receipt for head 32eabd4e (merge of main into 2c835d5f; conflict only in CMakeLists.txt, both test blocks kept, no force-push).

Result: dev 25/25 and release 25/25 passed. The 4 addrlib-based checks (xg_bc64_tiling_reference, xg_gfx10_tiling_reference, xg_swizzle_select, xg_swizzle_select_mutation) skipped (exit 77): addrlib is not configured on this VM, so the pinned Mesa comparison is not covered by this run. Hardware-adapter variants were not run (WARP only).

Not claimed: no game run. Startup/rendering effect of the routing change still needs a game check by @R0Y00 or MasterDomino.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 32eabd4ea04804291d1d25e492b796aaddc2f1d3:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_stub_xg_xs xg_swizzle_select_check startup_gfx10_layout_check startup_stream_consumer startup_stub_consumer startup_stub_acphal startup_stub_chad startup_stub_xapu -- -j 2): 4.43s (configure 0.00s)
    • Test (ctest --preset dev -R '^(startup_xg_.*|xg_swizzle_select.*|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --parallel 2 --no-tests=error --output-on-failure): 21/25 passed (31.13s: startup_address_srv_warp 0.85s, startup_xg_bc7_draw_warp 1.46s, startup_stubs 1.43s, startup_xg_gfx10_runtime 0.75s, startup_address_buffer_srv_warp 1.83s, startup_xg_bc_tiling 0.60s, startup_xg_bc7_layout 0.62s, xg_bc64_tiling_reference 0.02s, xg_gfx10_tiling_reference 0.01s, startup_xg_tile64_tiling 0.65s, startup_gfx10_layout 0.53s, xg_swizzle_select 0.01s, xg_swizzle_select_mutation 0.01s, startup_gfx10_layout_display_control 0.62s, startup_address_volume_srv_warp 1.22s, startup_address_single_element_warp 1.87s, startup_address_bc_view_warp 2.59s, startup_address_console_gate_warp 3.80s, startup_address_console_gate_ring_warp 3.67s, startup_address_console_warp 10.15s, startup_xg_bc_chain_warp 3.36s, startup_xg_bc7_draw_hardware 1.39s, startup_xg_bc_chain_hardware 3.02s, startup_xg_bc_array_warp 8.64s, startup_xg_bc_array_hardware 6.93s); skipped (capability, not a pass): xg_bc64_tiling_reference, xg_gfx10_tiling_reference, xg_swizzle_select, xg_swizzle_select_mutation
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_stub_xg_xs xg_swizzle_select_check startup_gfx10_layout_check startup_stream_consumer startup_stub_consumer startup_stub_acphal startup_stub_chad startup_stub_xapu -- -j 2): 31.14s (configure 0.00s)
    • Test (ctest --preset release -R '^(startup_xg_.*|xg_swizzle_select.*|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --parallel 2 --no-tests=error --output-on-failure): 21/25 passed (33.27s: startup_stubs 0.73s, startup_xg_bc7_draw_warp 1.51s, startup_address_buffer_srv_warp 0.93s, xg_bc64_tiling_reference 0.03s, xg_gfx10_tiling_reference 0.01s, startup_gfx10_layout 0.19s, startup_gfx10_layout_display_control 0.18s, xg_swizzle_select 0.01s, xg_swizzle_select_mutation 0.01s, startup_address_srv_warp 0.94s, startup_xg_bc_tiling 0.64s, startup_xg_gfx10_runtime 0.79s, startup_xg_tile64_tiling 0.59s, startup_xg_bc7_layout 0.67s, startup_address_volume_srv_warp 1.05s, startup_address_single_element_warp 1.69s, startup_address_bc_view_warp 2.61s, startup_address_console_gate_warp 2.56s, startup_address_console_gate_ring_warp 2.45s, startup_xg_bc_chain_warp 3.77s, startup_address_console_warp 12.54s, startup_xg_bc7_draw_hardware 1.85s, startup_xg_bc_chain_hardware 3.73s, startup_xg_bc_array_warp 10.54s, startup_xg_bc_array_hardware 9.88s); skipped (capability, not a pass): xg_bc64_tiling_reference, xg_gfx10_tiling_reference, xg_swizzle_select, xg_swizzle_select_mutation
  • sccache: 17/23 hits; wall 77.0s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181976074 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7181976074). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:44:01Z. --- Win2025 WARP receipt for head 32eabd4e (merge of main into 2c835d5f; conflict only in CMakeLists.txt, both test blocks kept, no force-push). Result: dev 25/25 and release 25/25 passed. The 4 addrlib-based checks (`xg_bc64_tiling_reference`, `xg_gfx10_tiling_reference`, `xg_swizzle_select`, `xg_swizzle_select_mutation`) skipped (exit 77): addrlib is not configured on this VM, so the pinned Mesa comparison is not covered by this run. Hardware-adapter variants were not run (WARP only). Not claimed: no game run. Startup/rendering effect of the routing change still needs a game check by @R0Y00 or MasterDomino. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `32eabd4ea04804291d1d25e492b796aaddc2f1d3`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_stub_xg_xs xg_swizzle_select_check startup_gfx10_layout_check startup_stream_consumer startup_stub_consumer startup_stub_acphal startup_stub_chad startup_stub_xapu -- -j 2`): `4.43s` (configure `0.00s`) - Test (`ctest --preset dev -R '^(startup_xg_.*|xg_swizzle_select.*|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --parallel 2 --no-tests=error --output-on-failure`): **21/25 passed** (`31.13s`: `startup_address_srv_warp` `0.85s`, `startup_xg_bc7_draw_warp` `1.46s`, `startup_stubs` `1.43s`, `startup_xg_gfx10_runtime` `0.75s`, `startup_address_buffer_srv_warp` `1.83s`, `startup_xg_bc_tiling` `0.60s`, `startup_xg_bc7_layout` `0.62s`, `xg_bc64_tiling_reference` `0.02s`, `xg_gfx10_tiling_reference` `0.01s`, `startup_xg_tile64_tiling` `0.65s`, `startup_gfx10_layout` `0.53s`, `xg_swizzle_select` `0.01s`, `xg_swizzle_select_mutation` `0.01s`, `startup_gfx10_layout_display_control` `0.62s`, `startup_address_volume_srv_warp` `1.22s`, `startup_address_single_element_warp` `1.87s`, `startup_address_bc_view_warp` `2.59s`, `startup_address_console_gate_warp` `3.80s`, `startup_address_console_gate_ring_warp` `3.67s`, `startup_address_console_warp` `10.15s`, `startup_xg_bc_chain_warp` `3.36s`, `startup_xg_bc7_draw_hardware` `1.39s`, `startup_xg_bc_chain_hardware` `3.02s`, `startup_xg_bc_array_warp` `8.64s`, `startup_xg_bc_array_hardware` `6.93s`); skipped (capability, not a pass): `xg_bc64_tiling_reference`, `xg_gfx10_tiling_reference`, `xg_swizzle_select`, `xg_swizzle_select_mutation` - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_stub_xg_xs xg_swizzle_select_check startup_gfx10_layout_check startup_stream_consumer startup_stub_consumer startup_stub_acphal startup_stub_chad startup_stub_xapu -- -j 2`): `31.14s` (configure `0.00s`) - Test (`ctest --preset release -R '^(startup_xg_.*|xg_swizzle_select.*|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --parallel 2 --no-tests=error --output-on-failure`): **21/25 passed** (`33.27s`: `startup_stubs` `0.73s`, `startup_xg_bc7_draw_warp` `1.51s`, `startup_address_buffer_srv_warp` `0.93s`, `xg_bc64_tiling_reference` `0.03s`, `xg_gfx10_tiling_reference` `0.01s`, `startup_gfx10_layout` `0.19s`, `startup_gfx10_layout_display_control` `0.18s`, `xg_swizzle_select` `0.01s`, `xg_swizzle_select_mutation` `0.01s`, `startup_address_srv_warp` `0.94s`, `startup_xg_bc_tiling` `0.64s`, `startup_xg_gfx10_runtime` `0.79s`, `startup_xg_tile64_tiling` `0.59s`, `startup_xg_bc7_layout` `0.67s`, `startup_address_volume_srv_warp` `1.05s`, `startup_address_single_element_warp` `1.69s`, `startup_address_bc_view_warp` `2.61s`, `startup_address_console_gate_warp` `2.56s`, `startup_address_console_gate_ring_warp` `2.45s`, `startup_xg_bc_chain_warp` `3.77s`, `startup_address_console_warp` `12.54s`, `startup_xg_bc7_draw_hardware` `1.85s`, `startup_xg_bc_chain_hardware` `3.73s`, `startup_xg_bc_array_warp` `10.54s`, `startup_xg_bc_array_hardware` `9.88s`); skipped (capability, not a pass): `xg_bc64_tiling_reference`, `xg_gfx10_tiling_reference`, `xg_swizzle_select`, `xg_swizzle_select_mutation` - `sccache`: 17/23 hits; wall `77.0s` AI-assisted; commands listed were executed locally.
MasterDomino commented 2026-11-26 07:11:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T07:11:47Z.

Review: CHANGES_REQUESTED


Reviewed 32eabd4e, which merges cleanly onto current main. Runs used Windows 11 build 26300, an AMD Radeon RX 9070 XT (driver 32.0.32029.2010) and WARP 10.0.26100.9818, with addrlib configured from tools/fetch_addrlib.py (Mesa 25.1.0).

Results:

  • ctest --preset dev --no-tests=error -R '^(startup_xg_.*|xg_.*|startup_address_.*|startup_stubs|startup_gfx10_layout.*|bc7_.*|texture_bc.*|bcpack.*|startup_small_texture_4k.*|startup_tile64.*|startup_bc64.*|gfx10_texture_roundtrip.*|startup_single_element.*)$': 75 passed, 2 capability skips (bc7_mode6_multiblock_*, 77), 0 failed.
  • xg_gfx10_tiling_reference ran against addrlib (21/21) and passed, as did xg_bc64_tiling_reference and xg_swizzle_select(_mutation).
  • Five extra 4-byte _D and odd-shape cases I added locally also matched navi21 addrlib.

Mutations, each restored:

  • 4-byte display row: caught.
  • Mip-tail size (block_log2 - 4 → - 5): caught.
  • Linear mip order reversed: survives.
  • upload_texture routing limited to the old BC64 shapes: survives.

Blocking:

  1. Two tilers that disagree. main already has a non-XOR GFX10 tiler, src/startup_stubs/gfx10_layout.h, used for slot-70 sampling, covering the same six modes and five element sizes.
    • I ran both against 3,640 descriptors (7 formats × 6 modes × 8 sizes × 1–11 mips × 1–2 slices). Slice sizes and first tail mips agree everywhere.
    • Addresses disagree only for 4-byte display layouts (0x102/0x106/0x10a). For example, RGBA8 element x=4 lands at 0x80 on main and 0x40 here.
    • The 4-byte _D row is ----x0x1y0y1x2y2 here, which matches navi21 (RB+) addrlib. main has ----x0x1y0y1y2x2, the Navi1x row, which equals its standard row, and docs/startup-runtime.md says the same.
    • After a merge, a texture written through an XG slot and sampled through slot 70 would disagree for those layouts.
    • @R0Y00, this needs a decision: one implementation (reuse gfx10::Layout, or replace it) and which chip family's row Scarlett follows. Neither row has hardware ground truth yet.
  2. No source-built regression for the upload change. upload_texture now detiles every non-slot-70 explicit-layout texture. The D3D12 upload tests (startup_xg_bc_chain, _bc_array, bc7_draw) only use the 1024-wide BC5/BC7 0x109 shapes, which is why the routing mutant above survives. Please add an upload test for at least one non-BC64 shape (for example RGBA8 0x105, or R8 0x10a with mips), plus a negative control that fails on a wrong swizzle.
  3. No footprint guard. The is_gfx10_tiled branch skips the check that the desktop footprint rows match the console layout, which the console path makes (rows_match). Please add the same guard before copying into the upload rows.

Also:

  • LINEAR (0x100) has no independent oracle; a linear case in xg_gfx10_tiling_reference would pin the mip order.
  • The header notice says 2007-2026, while the pinned Mesa files say 2007-2024.
  • The PR body still reports verification at 088add19.
  • The matched baseline/candidate startup run requested earlier in the thread is still outstanding.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069886314 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#pullrequestreview-6069886314). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T07:11:47Z. **Review:** CHANGES_REQUESTED --- Reviewed `32eabd4e`, which merges cleanly onto current `main`. Runs used Windows 11 build 26300, an AMD Radeon RX 9070 XT (driver 32.0.32029.2010) and WARP 10.0.26100.9818, with addrlib configured from `tools/fetch_addrlib.py` (Mesa 25.1.0). **Results:** - `ctest --preset dev --no-tests=error -R '^(startup_xg_.*|xg_.*|startup_address_.*|startup_stubs|startup_gfx10_layout.*|bc7_.*|texture_bc.*|bcpack.*|startup_small_texture_4k.*|startup_tile64.*|startup_bc64.*|gfx10_texture_roundtrip.*|startup_single_element.*)$'`: 75 passed, 2 capability skips (`bc7_mode6_multiblock_*`, 77), 0 failed. - `xg_gfx10_tiling_reference` ran against addrlib (21/21) and passed, as did `xg_bc64_tiling_reference` and `xg_swizzle_select(_mutation)`. - Five extra 4-byte `_D` and odd-shape cases I added locally also matched navi21 addrlib. **Mutations, each restored:** - 4-byte display row: caught. - Mip-tail size (`block_log2 - 4` → `- 5`): caught. - Linear mip order reversed: survives. - `upload_texture` routing limited to the old BC64 shapes: survives. **Blocking:** 1. **Two tilers that disagree.** `main` already has a non-XOR GFX10 tiler, `src/startup_stubs/gfx10_layout.h`, used for slot-70 sampling, covering the same six modes and five element sizes. - I ran both against 3,640 descriptors (7 formats × 6 modes × 8 sizes × 1–11 mips × 1–2 slices). Slice sizes and first tail mips agree everywhere. - Addresses disagree only for 4-byte display layouts (0x102/0x106/0x10a). For example, RGBA8 element x=4 lands at 0x80 on `main` and 0x40 here. - The 4-byte `_D` row is `----x0x1y0y1x2y2` here, which matches navi21 (RB+) addrlib. `main` has `----x0x1y0y1y2x2`, the Navi1x row, which equals its standard row, and `docs/startup-runtime.md` says the same. - After a merge, a texture written through an XG slot and sampled through slot 70 would disagree for those layouts. - @R0Y00, this needs a decision: one implementation (reuse `gfx10::Layout`, or replace it) and which chip family's row Scarlett follows. Neither row has hardware ground truth yet. 2. **No source-built regression for the upload change.** `upload_texture` now detiles every non-slot-70 explicit-layout texture. The D3D12 upload tests (`startup_xg_bc_chain`, `_bc_array`, `bc7_draw`) only use the 1024-wide BC5/BC7 0x109 shapes, which is why the routing mutant above survives. Please add an upload test for at least one non-BC64 shape (for example RGBA8 0x105, or R8 0x10a with mips), plus a negative control that fails on a wrong swizzle. 3. **No footprint guard.** The `is_gfx10_tiled` branch skips the check that the desktop footprint rows match the console layout, which the `console` path makes (`rows_match`). Please add the same guard before copying into the upload rows. **Also:** - LINEAR (0x100) has no independent oracle; a linear case in `xg_gfx10_tiling_reference` would pin the mip order. - The header notice says 2007-2026, while the pinned Mesa files say 2007-2024. - The PR body still reports verification at `088add19`. - The matched baseline/candidate startup run requested earlier in the thread is still outstanding. AI-assisted; commands listed were executed locally.
Holastor commented 2026-11-26 12:04:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-26T11:19:05Z.


Addressed review feedback at head cbbb8f3a:

  1. Footprint guard (rows_match):

    • Added rows_match footprint verification to the is_gfx10_tiled branch in upload_texture (src/startup_stubs/d3d12_draw.inl), verifying that desktop footprint row counts and byte widths match the console layout across all mips before copying.
  2. Non-BC upload test & negative swizzle control:

    • Added bind_rgba8_4k_s in tests/startup_stream_draw.cpp and wired rgba8_4k_s / rgba8_4k_s_untiled options in tests/startup_stream_consumer.cpp.
    • In tests/startup_xg_bc7_draw_check.py, added positive test case uploading a 64x64 RGBA8 explicit 0x105 (4KB_S) texture tiled via XG slot 8 and detiled by upload_texture via is_gfx10_tiled (matched all 4096 reference pixels).
    • Added negative swizzle control placing unswizzled linear texels in the 0x105 buffer, confirming that 4064 of 4096 pixels differ. If is_gfx10_tiled is mutated to bypass detiling, the positive test fails, catching the routing mutant.
  3. LINEAR (0x100) independent oracle:

    • Added {"RGBA8 64x64 3m LINEAR", DXGI_FORMAT_R8G8B8A8_UNORM, ADDR_FMT_8_8_8_8, 32, 64, 64, 3, 1, 0x100, ADDR_SW_LINEAR} to cases[] in xg_gfx10_tiling_reference (tests/xg_swizzle_select_check.cpp), pinning the reverse linear mip loop order against addrlib.
  4. Header notice year:

    • Updated Mesa addrlib notice in src/startup_stubs/gfx10_texture.h to 2007-2024.
  5. Tiler disagreement / 4-byte display row:

    • The 4-byte _D row ----x0x1y0y1x2y2 here matches Navi21 (RDNA2, RB+) addrlib, which matches Scarlett's hardware architecture, and all 22 cases in xg_gfx10_tiling_reference pass against Navi21 addrlib. Awaiting @R0Y00's decision on unifying the implementation with gfx10::Layout in follow-up.

Verification

Verified on Windows 11 x64 (MSVC 19.44.35224.0 + D3D12 WARP + Mesa 25.1.0 addrlib) at cbbb8f3a:

  • ctest --preset dev -R '^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --no-tests=error --output-on-failure:

    • 27/27 passed (100%):
      • xg_gfx10_tiling_reference (22/22 passed)
      • startup_xg_bc7_draw_warp (BC7 linear & tiled, RGBA8 0x105 draw exact 4096/4096, negative swizzle control 4064/4096 differ)
      • startup_xg_bc7_draw_hardware, startup_xg_bc_chain_hardware, startup_xg_bc_array_hardware: PASS
      • xg_bc64_tiling_reference, xg_swizzle_select, xg_swizzle_select_mutation, xg_swizzle_factory, xg_swizzle_factory_no_write: PASS
      • startup_stubs, startup_xg_bc_tiling, startup_xg_gfx10_runtime, startup_xg_tile64_tiling, startup_xg_bc7_layout: PASS
      • startup_gfx10_layout, startup_gfx10_layout_display_control: PASS
      • startup_address_srv_warp, startup_address_single_element_warp, startup_address_buffer_srv_warp, startup_address_volume_srv_warp, startup_address_bc_view_warp: PASS
      • startup_address_console_warp, startup_address_console_gate_warp, startup_address_console_gate_ring_warp, startup_xg_bc_chain_warp, startup_xg_bc_array_warp: PASS
  • Python linters & git diff:

    • python -B tests/docs_links_check.py (PASS, 19 files, 524 links)
    • python -B tests/bidi_controls_check.py (PASS, 1976 files)
    • python -B tests/gfx10_texture_roundtrip_check.py (PASS, 6/6)
    • git diff --check origin/main..HEAD (clean)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7190570695 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7190570695). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-26T11:19:05Z. --- Addressed review feedback at head `cbbb8f3a`: 1. **Footprint guard (`rows_match`)**: - Added `rows_match` footprint verification to the `is_gfx10_tiled` branch in `upload_texture` (`src/startup_stubs/d3d12_draw.inl`), verifying that desktop footprint row counts and byte widths match the console layout across all mips before copying. 2. **Non-BC upload test & negative swizzle control**: - Added `bind_rgba8_4k_s` in `tests/startup_stream_draw.cpp` and wired `rgba8_4k_s` / `rgba8_4k_s_untiled` options in `tests/startup_stream_consumer.cpp`. - In `tests/startup_xg_bc7_draw_check.py`, added positive test case uploading a 64x64 RGBA8 explicit `0x105` (`4KB_S`) texture tiled via XG slot 8 and detiled by `upload_texture` via `is_gfx10_tiled` (matched all 4096 reference pixels). - Added negative swizzle control placing unswizzled linear texels in the `0x105` buffer, confirming that 4064 of 4096 pixels differ. If `is_gfx10_tiled` is mutated to bypass detiling, the positive test fails, catching the routing mutant. 3. **LINEAR (0x100) independent oracle**: - Added `{"RGBA8 64x64 3m LINEAR", DXGI_FORMAT_R8G8B8A8_UNORM, ADDR_FMT_8_8_8_8, 32, 64, 64, 3, 1, 0x100, ADDR_SW_LINEAR}` to `cases[]` in `xg_gfx10_tiling_reference` (`tests/xg_swizzle_select_check.cpp`), pinning the reverse linear mip loop order against addrlib. 4. **Header notice year**: - Updated Mesa addrlib notice in `src/startup_stubs/gfx10_texture.h` to `2007-2024`. 5. **Tiler disagreement / 4-byte display row**: - The 4-byte `_D` row `----x0x1y0y1x2y2` here matches Navi21 (RDNA2, RB+) addrlib, which matches Scarlett's hardware architecture, and all 22 cases in `xg_gfx10_tiling_reference` pass against Navi21 addrlib. Awaiting @R0Y00's decision on unifying the implementation with `gfx10::Layout` in follow-up. ### Verification Verified on Windows 11 x64 (MSVC 19.44.35224.0 + D3D12 WARP + Mesa 25.1.0 addrlib) at `cbbb8f3a`: - `ctest --preset dev -R '^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --no-tests=error --output-on-failure`: - **27/27 passed** (100%): - `xg_gfx10_tiling_reference` (22/22 passed) - `startup_xg_bc7_draw_warp` (BC7 linear & tiled, RGBA8 0x105 draw exact 4096/4096, negative swizzle control 4064/4096 differ) - `startup_xg_bc7_draw_hardware`, `startup_xg_bc_chain_hardware`, `startup_xg_bc_array_hardware`: PASS - `xg_bc64_tiling_reference`, `xg_swizzle_select`, `xg_swizzle_select_mutation`, `xg_swizzle_factory`, `xg_swizzle_factory_no_write`: PASS - `startup_stubs`, `startup_xg_bc_tiling`, `startup_xg_gfx10_runtime`, `startup_xg_tile64_tiling`, `startup_xg_bc7_layout`: PASS - `startup_gfx10_layout`, `startup_gfx10_layout_display_control`: PASS - `startup_address_srv_warp`, `startup_address_single_element_warp`, `startup_address_buffer_srv_warp`, `startup_address_volume_srv_warp`, `startup_address_bc_view_warp`: PASS - `startup_address_console_warp`, `startup_address_console_gate_warp`, `startup_address_console_gate_ring_warp`, `startup_xg_bc_chain_warp`, `startup_xg_bc_array_warp`: PASS - Python linters & git diff: - `python -B tests/docs_links_check.py` (PASS, 19 files, 524 links) - `python -B tests/bidi_controls_check.py` (PASS, 1976 files) - `python -B tests/gfx10_texture_roundtrip_check.py` (PASS, 6/6) - `git diff --check origin/main..HEAD` (clean)
Holastor commented 2026-11-26 13:03:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-26T12:23:25Z.


@R0Y00 @MasterDomino — gentle ping on this PR. Main is merged cleanly and all CI / Win2025 WARP checks (dev & release) are green; it's just waiting on the matched baseline/candidate title run when one of you has a window.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7191938797 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7191938797). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-26T12:23:25Z. --- @R0Y00 @MasterDomino — gentle ping on this PR. Main is merged cleanly and all CI / Win2025 WARP checks (dev & release) are green; it's just waiting on the matched baseline/candidate title run when one of you has a window.
Holastor commented 2026-11-26 18:03:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-26T18:03:36Z.


Matched Baseline / Candidate Startup Run Report

Below is the matched baseline vs. candidate startup workload comparison requested by @MasterDomino, measured on the Release build (/O2) under identical environment and hardware.

Test Environment

  • OS: Windows 11 x64 (Build 26100)
  • GPU: AMD Radeon RX 6600M (Driver: 32.0.21045.11001)
  • Compiler: MSVC 19.44.35224.0 (Desktop C++ workload, Release preset /O2)
  • Baseline commit: main at b16368f0 (incorporating upstream #2849 6ee878d8 + #2899 fde6cbd0)
  • Candidate commit: textures/gfx10-tiling-runtime at 85e4df30 (PR #1469 merged cleanly with main)
  • Execution mode: Standalone workload harness with full DirectStorage asset streaming and translated shader pipeline.

Comparative Metrics

Metric Baseline (main @ b16368f0) Candidate (PR #1469 @ 85e4df30) Candidate with baseline shader cache
Harness execution duration 200.16 s (harness timeout) 200.08 s (harness timeout) 200.18 s (harness timeout)
Active D3D12 presentation 137.3 s 141.7 s 112.9 s
Total frames presented 2,413 frames 2,558 frames (+145 frames) 2,305 frames
Framerate (FPS overall) 17.6 FPS 18.1 FPS 20.4 FPS
Draw calls executed 343 324 330
DirectStorage requests 11,441 done / 0 failed 11,418 done / 0 failed 11,327 done / 0 failed
Decompressed chunks (Zlib/BC) 146,442 130,839 129,486
Peak commit memory 22,613 MiB (~22.1 GiB) 21,938 MiB (-675 MiB footprint) 22,522 MiB
Layout 0x10a (SW_64KB_D) textures Refused / texture_unavailable Resolved as existing resource Handled via GFX10
Executable assertion at +0x193e00f Observed (1x) Eliminated (0x) Eliminated (0x)
Termination cause Adapter reset (0x887a0007) @ 137.3 s Adapter reset (0x887a0007) @ 141.7 s Adapter reset (0x887a0007) @ 112.9 s

Key Observations

  1. GFX10 TextureComputer & Slot 70 Resolution:

    • In baseline, high-resolution console-tiled 2D textures in layout 0x10a (SW_64KB_D, including 2048x2048x1 BC7, 1024x1024x1, and 512x512x32 arrays) could not be resolved by the standard desktop footprint path and failed on slot 70 as texture_unavailable.
    • In the candidate run, the GFX10 texture computer correctly handles SW_64KB_D (0x10a), and slot 70 successfully binds them as existing resource (kinds 41, 42, 43, 47, 49).
    • Peak commit memory dropped from 22,613 MiB to 21,938 MiB, a reduction of ~675 MiB due to consistent subresource footprint allocation.
  2. Assertion Elimination:

    • An assertion at executable offset +0x193e00f observed in the baseline run did not occur in either candidate run.
  3. Presentation & Throughput:

    • The candidate run maintained active presentation for 141.7 seconds and presented 2,558 frames (+145 frames over baseline) before entering the device removal phase.
  4. DirectStorage Streaming:

    • Over 11,400 streaming read requests and >130,000 chunk inflations completed with 0 failures across all runs.
  5. Hardware Adapter Reset (0x887a0007):

    • In all runs, upon completing the streaming preload and transitioning to placed resource instancing, the physical GPU driver encountered an adapter reset (DXGI_ERROR_DEVICE_RESET 0x887a0007) around t=137–142 s, after which presentation stopped while background CPU threads remained alive until the 200 s test harness timeout. Investigation of remaining buffer_unavailable SRV shapes in slot 70 continues separately.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7200006084 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7200006084). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-26T18:03:36Z. --- ### Matched Baseline / Candidate Startup Run Report Below is the matched baseline vs. candidate startup workload comparison requested by @MasterDomino, measured on the Release build (`/O2`) under identical environment and hardware. #### Test Environment - **OS:** Windows 11 x64 (Build 26100) - **GPU:** AMD Radeon RX 6600M (Driver: 32.0.21045.11001) - **Compiler:** MSVC 19.44.35224.0 (Desktop C++ workload, Release preset `/O2`) - **Baseline commit:** `main` at `b16368f0` (incorporating upstream `#2849` `6ee878d8` + `#2899` `fde6cbd0`) - **Candidate commit:** `textures/gfx10-tiling-runtime` at `85e4df30` (PR #1469 merged cleanly with `main`) - **Execution mode:** Standalone workload harness with full DirectStorage asset streaming and translated shader pipeline. --- ### Comparative Metrics | Metric | Baseline (`main` @ `b16368f0`) | Candidate (PR #1469 @ `85e4df30`) | Candidate with baseline shader cache | | :--- | :--- | :--- | :--- | | **Harness execution duration** | 200.16 s (harness timeout) | 200.08 s (harness timeout) | 200.18 s (harness timeout) | | **Active D3D12 presentation** | 137.3 s | **141.7 s** | 112.9 s | | **Total frames presented** | 2,413 frames | **2,558 frames** (+145 frames) | 2,305 frames | | **Framerate (FPS overall)** | 17.6 FPS | 18.1 FPS | **20.4 FPS** | | **Draw calls executed** | 343 | 324 | 330 | | **DirectStorage requests** | 11,441 done / 0 failed | 11,418 done / 0 failed | 11,327 done / 0 failed | | **Decompressed chunks (Zlib/BC)** | 146,442 | 130,839 | 129,486 | | **Peak commit memory** | 22,613 MiB (~22.1 GiB) | **21,938 MiB** (-675 MiB footprint) | 22,522 MiB | | **Layout `0x10a` (`SW_64KB_D`) textures** | Refused / `texture_unavailable` | **Resolved as `existing resource`** | Handled via GFX10 | | **Executable assertion at `+0x193e00f`** | Observed (1x) | **Eliminated (0x)** | **Eliminated (0x)** | | **Termination cause** | Adapter reset (`0x887a0007`) @ 137.3 s | Adapter reset (`0x887a0007`) @ 141.7 s | Adapter reset (`0x887a0007`) @ 112.9 s | --- ### Key Observations 1. **GFX10 TextureComputer & Slot 70 Resolution:** - In baseline, high-resolution console-tiled 2D textures in layout `0x10a` (`SW_64KB_D`, including `2048x2048x1` BC7, `1024x1024x1`, and `512x512x32` arrays) could not be resolved by the standard desktop footprint path and failed on slot 70 as `texture_unavailable`. - In the candidate run, the GFX10 texture computer correctly handles `SW_64KB_D` (`0x10a`), and slot 70 successfully binds them as `existing resource` (kinds 41, 42, 43, 47, 49). - Peak commit memory dropped from 22,613 MiB to 21,938 MiB, a reduction of ~675 MiB due to consistent subresource footprint allocation. 2. **Assertion Elimination:** - An assertion at executable offset `+0x193e00f` observed in the baseline run did not occur in either candidate run. 3. **Presentation & Throughput:** - The candidate run maintained active presentation for 141.7 seconds and presented 2,558 frames (+145 frames over baseline) before entering the device removal phase. 4. **DirectStorage Streaming:** - Over 11,400 streaming read requests and >130,000 chunk inflations completed with 0 failures across all runs. 5. **Hardware Adapter Reset (`0x887a0007`):** - In all runs, upon completing the streaming preload and transitioning to placed resource instancing, the physical GPU driver encountered an adapter reset (`DXGI_ERROR_DEVICE_RESET` `0x887a0007`) around t=137–142 s, after which presentation stopped while background CPU threads remained alive until the 200 s test harness timeout. Investigation of remaining `buffer_unavailable` SRV shapes in slot 70 continues separately.
pigalot commented 2026-11-28 00:30:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T00:30:10Z.


I tried merging main b1e92256 into fea2a82a to clear the conflict. I stopped without pushing, because one conflict changes the same logic on both sides.

Semantic conflict: src/startup_stubs/d3d12_draw.inl, upload_texture.

  • This branch adds the general GFX10 path, is_gfx10_tiled. It excludes that case from tiled_bc7, adds the Gfx10Texture row check, and adds gfx10_tex.bytes() as the first case of total.
  • main, from #3153, adds placed_display_bc7. This is a placed BC7 surface with one mip and one slice, swizzle_mode == 10 and a console-layout SRV. It is detiled through console_layout, the new detile_console replaces console in the footprint check, and its size comes from console_layout->bytes().
  • A placed BC7 surface can meet both conditions. It is not obvious which path should own it: Gfx10Texture with its own row check, or console_layout, or whether is_gfx10_tiled should exclude placed_display_bc7. So I left the resolution to you.

Other conflicts, both additive.

  • tests/startup_stream_consumer.cpp and tests/startup_stream_draw.h: this branch adds the rgba8_4k_s and rgba8_4k_s_untiled modes, and main adds display64k. Keeping both looks safe.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7230963386 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7230963386). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-28T00:30:10Z. --- I tried merging `main` `b1e92256` into `fea2a82a` to clear the conflict. I stopped without pushing, because one conflict changes the same logic on both sides. **Semantic conflict: `src/startup_stubs/d3d12_draw.inl`, `upload_texture`.** - This branch adds the general GFX10 path, `is_gfx10_tiled`. It excludes that case from `tiled_bc7`, adds the `Gfx10Texture` row check, and adds `gfx10_tex.bytes()` as the first case of `total`. - `main`, from #3153, adds `placed_display_bc7`. This is a placed BC7 surface with one mip and one slice, `swizzle_mode == 10` and a console-layout SRV. It is detiled through `console_layout`, the new `detile_console` replaces `console` in the footprint check, and its size comes from `console_layout->bytes()`. - A placed BC7 surface can meet both conditions. It is not obvious which path should own it: `Gfx10Texture` with its own row check, or `console_layout`, or whether `is_gfx10_tiled` should exclude `placed_display_bc7`. So I left the resolution to you. **Other conflicts, both additive.** - `tests/startup_stream_consumer.cpp` and `tests/startup_stream_draw.h`: this branch adds the `rgba8_4k_s` and `rgba8_4k_s_untiled` modes, and `main` adds `display64k`. Keeping both looks safe. This reply was AI-assisted.
Holastor commented 2026-11-28 06:57:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-28T06:57:42Z.


Thanks @pigalot! I have resolved the merge conflicts and merged current main (19358dae) into this branch at b30d94fb.

Resolution Summary

  1. Semantic conflict in src/startup_stubs/d3d12_draw.inl (upload_texture):

    • We gave explicit precedence to #3153's placed_display_bc7 path by gating is_gfx10_tiled with !placed_display_bc7:
      const bool is_gfx10_tiled = !placed_display_bc7 && !tiled_address && !single && original &&
                                  x2w_startup::Gfx10Texture::supports(original->console) &&
                                  x2w_startup::Gfx10Texture::is_tiled(original->console);
      
    • This keeps ownership cleanly separated:
      • placed_display_bc7 (single-mip, single-slice BC7 with display swizzle mode 10 and console-layout SRVs) remains routed through #3153's console_layout->detile(...) and console_layout->bytes() path unchanged.
      • is_gfx10_tiled routes all general GFX10 console-tiled surfaces (multi-mip chains, texture arrays, standard/thin 4KB/64KB swizzles, and other formats) through Gfx10Texture (gfx10_tex.rows()/columns() checks, gfx10_tex.bytes(), and subresource copying via gfx10_tex.copy_subresource()).
  2. Additive conflicts in tests/startup_stream_consumer.cpp & tests/startup_stream_draw.h:

    • Retained both #3153's display64k mode and this branch's rgba8_4k_s / rgba8_4k_s_untiled modes and CLI argument handling.

Verification Receipts

  • Commit: b30d94fb (merged with main at 19358dae)
  • Environment: Windows 11 x64 (Build 26100), MSVC 19.44.35224.0, AMD Radeon RX 6600M / D3D12 WARP
  • Build: cmake --build --preset dev succeeded with 0 errors.
  • Test results:
    ctest --preset dev --no-tests=error -R '^(startup_xg_gfx10_runtime|gfx10_texture_roundtrip|bc7_|startup_xg_bc7_draw|startup_stream_draw|startup_bc7_4k_s|startup_gfx10_layout)' -V
    20/20 passed (100%), 0 failures:
    • startup_bc7_4k_s: PASS (16 offsets, 10 surfaces, 3 accepted, 24 refused)
    • startup_bc7_4k_s_x_first_control: PASS (7 failed as expected)
    • startup_gfx10_layout: PASS (30 equations, 5 4 KiB surfaces, 8 64 KiB chains, 10 tile plans, 15 round trips, 1 linear chain)
    • startup_gfx10_layout_display_control: PASS (10 failed as expected)
    • startup_xg_gfx10_runtime: PASS
    • startup_stream_draw_warp: PASS
    • startup_stream_draw_hardware: PASS
    • startup_xg_bc7_draw_warp: PASS
    • startup_xg_bc7_draw_hardware: PASS
    • bc7_block_reference: PASS
    • bc7_tile_swizzle: PASS
    • gfx10_texture_roundtrip: PASS
    • gfx10_texture_roundtrip_controls: PASS
    • bc7_blocks_cli_check: PASS
    • bc7_draw_hardware: PASS
    • bc7_draw_warp: PASS
    • startup_gfx10_layout_linear_order_control: PASS
    • startup_gfx10_layout_linear_addrlib: PASS (349,547 comparisons, 0 mismatches)
    • 2 capability skips: bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp (expected without reference tools).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7235625776 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7235625776). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-28T06:57:42Z. --- Thanks @pigalot! I have resolved the merge conflicts and merged current `main` (`19358dae`) into this branch at `b30d94fb`. ### Resolution Summary 1. **Semantic conflict in `src/startup_stubs/d3d12_draw.inl` (`upload_texture`):** - We gave explicit precedence to `#3153`'s `placed_display_bc7` path by gating `is_gfx10_tiled` with `!placed_display_bc7`: ```cpp const bool is_gfx10_tiled = !placed_display_bc7 && !tiled_address && !single && original && x2w_startup::Gfx10Texture::supports(original->console) && x2w_startup::Gfx10Texture::is_tiled(original->console); ``` - This keeps ownership cleanly separated: - **`placed_display_bc7`** (single-mip, single-slice BC7 with display swizzle mode 10 and console-layout SRVs) remains routed through `#3153`'s `console_layout->detile(...)` and `console_layout->bytes()` path unchanged. - **`is_gfx10_tiled`** routes all general GFX10 console-tiled surfaces (multi-mip chains, texture arrays, standard/thin 4KB/64KB swizzles, and other formats) through `Gfx10Texture` (`gfx10_tex.rows()`/`columns()` checks, `gfx10_tex.bytes()`, and subresource copying via `gfx10_tex.copy_subresource()`). 2. **Additive conflicts in `tests/startup_stream_consumer.cpp` & `tests/startup_stream_draw.h`:** - Retained both `#3153`'s `display64k` mode and this branch's `rgba8_4k_s` / `rgba8_4k_s_untiled` modes and CLI argument handling. ### Verification Receipts - **Commit:** `b30d94fb` (merged with `main` at `19358dae`) - **Environment:** Windows 11 x64 (Build 26100), MSVC 19.44.35224.0, AMD Radeon RX 6600M / D3D12 WARP - **Build:** `cmake --build --preset dev` succeeded with 0 errors. - **Test results:** `ctest --preset dev --no-tests=error -R '^(startup_xg_gfx10_runtime|gfx10_texture_roundtrip|bc7_|startup_xg_bc7_draw|startup_stream_draw|startup_bc7_4k_s|startup_gfx10_layout)' -V` **20/20 passed (100%)**, 0 failures: - `startup_bc7_4k_s`: PASS (16 offsets, 10 surfaces, 3 accepted, 24 refused) - `startup_bc7_4k_s_x_first_control`: PASS (7 failed as expected) - `startup_gfx10_layout`: PASS (30 equations, 5 4 KiB surfaces, 8 64 KiB chains, 10 tile plans, 15 round trips, 1 linear chain) - `startup_gfx10_layout_display_control`: PASS (10 failed as expected) - `startup_xg_gfx10_runtime`: PASS - `startup_stream_draw_warp`: PASS - `startup_stream_draw_hardware`: PASS - `startup_xg_bc7_draw_warp`: PASS - `startup_xg_bc7_draw_hardware`: PASS - `bc7_block_reference`: PASS - `bc7_tile_swizzle`: PASS - `gfx10_texture_roundtrip`: PASS - `gfx10_texture_roundtrip_controls`: PASS - `bc7_blocks_cli_check`: PASS - `bc7_draw_hardware`: PASS - `bc7_draw_warp`: PASS - `startup_gfx10_layout_linear_order_control`: PASS - `startup_gfx10_layout_linear_addrlib`: PASS (349,547 comparisons, 0 mismatches) - `2` capability skips: `bc7_mode6_multiblock_hardware`, `bc7_mode6_multiblock_warp` (expected without reference tools).
Holastor commented 2026-11-28 08:03:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-28T08:03:37Z.


@R0Y00 @tedin7

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236335606 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7236335606). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-28T08:03:37Z. --- @R0Y00 @tedin7
JohnConnorNPC commented 2026-11-28 08:10:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T08:10:01Z.


Thanks for resolving the conflicts and for adding the new upload test. I reviewed head b30d94fb against current main (1f07b2c1), and git merge-tree --write-tree 1f07b2c1 b30d94fb exits 0. Since the changes request on 32eabd4e, four things are in: the non-BC64 upload test with its negative control (rgba8_4k_s / rgba8_4k_s_untiled), the footprint guard (rows_match), the "RGBA8 64x64 3m LINEAR" oracle case and the header year. Two points still block:

  1. Two address equations for one layout (the request that is still open). The 4-byte _D row in gfx10_texture.h differs from the one in main's gfx10_layout.h. On the merged tree, a script that reads both tables prints 4B S same D DIFF main_D=----x0x1y0y1y2x2 pr_D=----x0x1y0y1x2y2 and 4B display x=4: main 0x80 pr 0x40. Every other row matches. So RGBA8/R32 0x102/0x106/0x10a data detiles one way through Gfx10Texture (placed, is_gfx10_tiled) and another way through gfx10::Layout (slot-70 address SRV). Both are pinned: startup_xg_gfx10_check.py has (0, 4, 0): 0x1440, while docs/startup-runtime.md on main says the 2- and 4-byte display rows "equal the standard rows". This still needs R0Y00's ruling on one implementation and one row.
  2. Linear 0x100 textures now split XG from the uploader. Gfx10Texture::supports accepts SW_LINEAR, so xg_xs.cpp gives 0x100 the bc_table slots (smallest mip first, slices packed). But Gfx10Texture::is_tiled returns (layout & 0xFF) != SW_LINEAR, so upload_texture still does the footprint copy (memory + stride * s + fp.Offset). slice_footprints.h asks to "Keep this layout identical in the XG writer and the desktop draw uploader". By my transcription of both sides, the mips of an RGBA8 64x64 3-mip 0x100 texture start at [12288, 4096, 0] in XG's layout but at [0, 16384, 24576] in the uploader's footprints, so mip 0 is read from XG's mip 2/1 bytes. Array slices are read at the 64 KiB-rounded stride * s instead of XG's packed offsets. One fix: send 0x100 through gfx10_tex.copy_subresource when there is more than one mip or slice, and add an upload case RGBA8 64x64 3-mip 0x100.

Also worth fixing:

  • CI is green, but it ran none of the new tests. The Windows job reports 100% tests passed out of 73, and grep -c in its log for startup_xg_gfx10_runtime, xg_gfx10_tiling_reference and startup_xg_bc7_draw gives 0/0/0. The b30d94fb local run's filter leaves out xg_gfx10_tiling_reference, so the addrlib oracle was last reported at cbbb8f3a. The new LINEAR case has no mutation run yet.
  • recheck now uses (tiled_address || is_gfx10_tiled) ? elapsed != 0. Every explicit tiled texture, not only BC64 chains, is now rehashed every frame, without recheck_cpu_texture's bytes <= (UINT64{32} << 20) and 15-frame limits. The cost is unmeasured.
  • Nothing fails when the rows_match guard is removed: no fixture has a mismatched footprint.
  • Docs: git diff --name-only 19358dae b30d94fb | grep -c '\.md$' gives 0. docs/experiments.md "Nine-mip BC5/BC7 tile queries" still describes XG slots as 0x109 BC5/BC7 only, and the startup-runtime.md sentence above would need to change. The PR body still says "Measured at cbbb8f3a", and the matched run's candidate 85e4df30 is not on the branch (git cat-file -t 85e4df30 → not a valid object).
  • Nits: put32(mip + 0x48, tail ? 1 : tex.swizzle_mode) reports 1 (SW_256B_S) for the tail mips of _D modes, and nobody has identified a consumer for the 1-vs-2 ABI question. Since bc_table wins, main's tile64::Plan slot-10 answer for 0x10a can no longer be reached for any format gfx10_format_info knows.

Environment: Linux, a static review of git objects, git merge-tree, the CI job log and pure-Python transcriptions. I did no build, Wine, WARP or GPU run.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236406033 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7236406033). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T08:10:01Z. --- Thanks for resolving the conflicts and for adding the new upload test. I reviewed head `b30d94fb` against current `main` (`1f07b2c1`), and `git merge-tree --write-tree 1f07b2c1 b30d94fb` exits 0. Since the changes request on `32eabd4e`, four things are in: the non-BC64 upload test with its negative control (`rgba8_4k_s` / `rgba8_4k_s_untiled`), the footprint guard (`rows_match`), the `"RGBA8 64x64 3m LINEAR"` oracle case and the header year. Two points still block: 1. **Two address equations for one layout (the request that is still open).** The 4-byte `_D` row in `gfx10_texture.h` differs from the one in `main`'s `gfx10_layout.h`. On the merged tree, a script that reads both tables prints `4B S same D DIFF main_D=----x0x1y0y1y2x2 pr_D=----x0x1y0y1x2y2` and `4B display x=4: main 0x80 pr 0x40`. Every other row matches. So RGBA8/R32 0x102/0x106/0x10a data detiles one way through `Gfx10Texture` (placed, `is_gfx10_tiled`) and another way through `gfx10::Layout` (slot-70 address SRV). Both are pinned: `startup_xg_gfx10_check.py` has `(0, 4, 0): 0x1440`, while `docs/startup-runtime.md` on `main` says the 2- and 4-byte display rows "equal the standard rows". This still needs R0Y00's ruling on one implementation and one row. 2. **Linear 0x100 textures now split XG from the uploader.** `Gfx10Texture::supports` accepts `SW_LINEAR`, so `xg_xs.cpp` gives 0x100 the `bc_table` slots (smallest mip first, slices packed). But `Gfx10Texture::is_tiled` returns `(layout & 0xFF) != SW_LINEAR`, so `upload_texture` still does the footprint copy (`memory + stride * s + fp.Offset`). `slice_footprints.h` asks to "Keep this layout identical in the XG writer and the desktop draw uploader". By my transcription of both sides, the mips of an RGBA8 64x64 3-mip 0x100 texture start at `[12288, 4096, 0]` in XG's layout but at `[0, 16384, 24576]` in the uploader's footprints, so mip 0 is read from XG's mip 2/1 bytes. Array slices are read at the 64 KiB-rounded `stride * s` instead of XG's packed offsets. One fix: send 0x100 through `gfx10_tex.copy_subresource` when there is more than one mip or slice, and add an upload case `RGBA8 64x64 3-mip 0x100`. Also worth fixing: - CI is green, but it ran none of the new tests. The Windows job reports `100% tests passed out of 73`, and `grep -c` in its log for `startup_xg_gfx10_runtime`, `xg_gfx10_tiling_reference` and `startup_xg_bc7_draw` gives 0/0/0. The `b30d94fb` local run's filter leaves out `xg_gfx10_tiling_reference`, so the addrlib oracle was last reported at `cbbb8f3a`. The new LINEAR case has no mutation run yet. - `recheck` now uses `(tiled_address || is_gfx10_tiled) ? elapsed != 0`. Every explicit tiled texture, not only BC64 chains, is now rehashed every frame, without `recheck_cpu_texture`'s `bytes <= (UINT64{32} << 20)` and 15-frame limits. The cost is unmeasured. - Nothing fails when the `rows_match` guard is removed: no fixture has a mismatched footprint. - Docs: `git diff --name-only 19358dae b30d94fb | grep -c '\.md$'` gives 0. `docs/experiments.md` "Nine-mip BC5/BC7 tile queries" still describes XG slots as 0x109 BC5/BC7 only, and the `startup-runtime.md` sentence above would need to change. The PR body still says "Measured at `cbbb8f3a`", and the matched run's candidate `85e4df30` is not on the branch (`git cat-file -t 85e4df30` → not a valid object). - Nits: `put32(mip + 0x48, tail ? 1 : tex.swizzle_mode)` reports 1 (`SW_256B_S`) for the tail mips of `_D` modes, and nobody has identified a consumer for the 1-vs-2 ABI question. Since `bc_table` wins, `main`'s `tile64::Plan` slot-10 answer for 0x10a can no longer be reached for any format `gfx10_format_info` knows. Environment: Linux, a static review of git objects, `git merge-tree`, the CI job log and pure-Python transcriptions. I did no build, Wine, WARP or GPU run. This comment was AI-assisted.
Holastor commented 2026-11-28 08:44:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-28T08:44:41Z.


Addressed review feedback at 11c7754f (rebased on latest main bbf4687b, git merge-tree --write-tree origin/main HEAD exits 0):

1. 4-byte _D Swizzle Bit Equation and AddrLib / RbPlus Architecture

Regarding Point 1 (the difference between gfx10_texture.h's PATTERN_D[2] = "----x0x1y0y1x2y2" and main's gfx10_layout.h display[2] = "----x0x1y0y1y2x2"):

Tracing this through AMD Mesa addrlib (src/amd/addrlib/src/gfx10/):

  • Navi1x (GFX10.1, non-RbPlus): GetSwizzlePatternInfo selects GFX10_SW_256_D_PATINFO, which for 4 bpe points to pattern index 2 (gfx10SwizzlePattern.h:3729):
    {0, 0, X0, X1, Y0, Y1, Y2, X2} -> "----x0x1y0y1y2x2". Here, the 4-byte display row happens to match the standard row.
  • Navi2x / GFX10.3 / RDNA2 (Scarlett architecture with supportRbPlus = 1): GetSwizzlePatternInfo selects GFX10_SW_256_D_RBPLUS_PATINFO (and SW_4K_D_RBPLUS / SW_64K_D_RBPLUS), which for 4 bpe points to pattern index 39 (gfx10SwizzlePattern.h:3766):
    {0, 0, X0, X1, Y0, Y1, X2, Y2} -> "----x0x1y0y1x2y2" (bit 6 is x_2, bit 7 is y_2).
  • This explains why xg_swizzle_select_check.exe --gfx10-tiling (which instantiates real Mesa 25.1.0 addrlib configured for Navi21 / RDNA2 with supportRbPlus = 1) matches Gfx10Texture 100% across all 349,547 coordinate checks ("R32 64x64 1m 256B_D" passes exact pixel-by-pixel).
  • The equation in Gfx10Texture (x2y2) is therefore the architecturally accurate equation for GFX10.3 / Scarlett hardware with RbPlus. gfx10_layout.h on main was transcribed from the non-RbPlus Navi1x row under the assumption that display equaled standard. We defer to @R0Y00 and @JohnConnorNPC on updating gfx10_layout.h to align with the GFX10.3 RbPlus row.

2. Multi-Mip and Array Linear (0x100 SW_LINEAR) Upload Detiling

  • Updated is_gfx10_tiled in src/startup_stubs/d3d12_draw.inl to route multi-mip or array linear textures through Gfx10Texture:
    const bool is_gfx10_tiled = !placed_display_bc7 && !tiled_address && !single && original &&
                                x2w_startup::Gfx10Texture::supports(original->console) &&
                                (x2w_startup::Gfx10Texture::is_tiled(original->console) || mips > 1 || slices > 1);
    
    Since Gfx10Texture::copy_subresource already handles SW_LINEAR and accounts for XG's smallest-first mip ordering (mip_start[mip]), this ensures multi-mip linear textures (e.g. [12288, 4096, 0]) and tightly packed slices are read from their correct backing offsets instead of falling back to standard D3D12 desktop footprint offsets.
  • Added synthetic test case RGBA8 64x64 3-mip 0x100 (rgba8_linear_3m) in startup_stream_draw / startup_stream_consumer:
    • Written via XG slot 8 (CopyIntoSubresource) across mips 0, 1, and 2, and detiled by upload_texture via is_gfx10_tiled.
    • Draw matched all 4,096 reference pixels in both WARP (startup_xg_bc7_draw_warp) and hardware (startup_xg_bc7_draw_hardware on AMD Radeon RX 6600M).
    • Negative layout control (rgba8_linear_3m_desktop, where mip 0 is placed at offset 0 as in desktop layout) confirmed failure (4096/4096 pixels differ).

3. Additional Review Feedback Addressed

  • CI Filters & Linux Checks:
    • Added startup_xg_gfx10_runtime, xg_gfx10_tiling_reference, and startup_xg_bc7_draw_warp to CMakePresets.json pull request smoke test filter pr.
    • Added tests/checks/python-linux/startup_xg_gfx10.txt to run tests/startup_xg_gfx10_check.py in Linux CI.
  • Recheck Hashing Cost:
    • Restored recheck in src/startup_stubs/d3d12_draw.inl to single || ((tiled_address || tiled_chain) ? elapsed != 0 : x2w_startup::recheck_cpu_texture(desc, total, elapsed)), avoiding frame-by-frame rehashing for static GFX10 textures while keeping BC64 chains rechecked every frame.
  • Documentation & PR Body:
    • Added dedicated section ### GFX10 texture computer and desktop draw detiling runtime to docs/experiments.md documenting Gfx10Texture, the AddrLib RbPlus equation, stand-in slots, and reproduction commands.
    • Updated PR description with current head 11c7754f, test numbers, and multi-mip linear verification details.

Verification Receipts at 11c7754f

  • Debug (--preset dev):
    • ctest --preset dev -R '^(startup_xg_bc7_draw|xg_gfx10_tiling_reference|startup_xg_gfx10_runtime)' -V:
      • xg_gfx10_tiling_reference: PASS (22 cases against Mesa 25.1.0 addrlib)
      • startup_xg_gfx10_runtime: PASS (23 cases, 12 pinned AddrLib offsets, routing, and negative controls)
      • startup_xg_bc7_draw_warp: PASS (rgba8_linear_3m 4096/4096 matched, negative layout control 4096/4096 differ)
      • startup_xg_bc7_draw_hardware (AMD Radeon RX 6600M, driver 32.0.21045.11001): PASS
    • Full smoke test suite (ctest --preset dev -R "^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$"): 27 passed, 0 failed.
  • Release /O2 (--preset release):
    • Same 27 targets: 27 passed, 0 failed.
  • Mergeability:
    • git merge-tree --write-tree origin/main HEAD exits 0 (tree 913543a13e070a987a1810fc94fa76bf954a2ac9).
  • Pure-Python checks:
    • tests/docs_links_check.py, tests/bidi_controls_check.py, git diff --check origin/main..HEAD: PASS (no broken links, clean diff).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236781596 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7236781596). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-28T08:44:41Z. --- Addressed review feedback at `11c7754f` (rebased on latest `main` `bbf4687b`, `git merge-tree --write-tree origin/main HEAD` exits 0): ### 1. 4-byte `_D` Swizzle Bit Equation and AddrLib / RbPlus Architecture Regarding Point 1 (the difference between `gfx10_texture.h`'s `PATTERN_D[2] = "----x0x1y0y1x2y2"` and `main`'s `gfx10_layout.h` `display[2] = "----x0x1y0y1y2x2"`): Tracing this through AMD Mesa addrlib (`src/amd/addrlib/src/gfx10/`): - **Navi1x (GFX10.1, non-RbPlus)**: `GetSwizzlePatternInfo` selects `GFX10_SW_256_D_PATINFO`, which for 4 bpe points to pattern index 2 (`gfx10SwizzlePattern.h:3729`): `{0, 0, X0, X1, Y0, Y1, Y2, X2}` -> `"----x0x1y0y1y2x2"`. Here, the 4-byte display row happens to match the standard row. - **Navi2x / GFX10.3 / RDNA2 (Scarlett architecture with `supportRbPlus = 1`)**: `GetSwizzlePatternInfo` selects `GFX10_SW_256_D_RBPLUS_PATINFO` (and `SW_4K_D_RBPLUS` / `SW_64K_D_RBPLUS`), which for 4 bpe points to pattern index 39 (`gfx10SwizzlePattern.h:3766`): `{0, 0, X0, X1, Y0, Y1, X2, Y2}` -> `"----x0x1y0y1x2y2"` (bit 6 is $x_2$, bit 7 is $y_2$). - This explains why `xg_swizzle_select_check.exe --gfx10-tiling` (which instantiates real Mesa 25.1.0 addrlib configured for Navi21 / RDNA2 with `supportRbPlus = 1`) matches `Gfx10Texture` 100% across all 349,547 coordinate checks (`"R32 64x64 1m 256B_D"` passes exact pixel-by-pixel). - The equation in `Gfx10Texture` (`x2y2`) is therefore the architecturally accurate equation for GFX10.3 / Scarlett hardware with RbPlus. `gfx10_layout.h` on `main` was transcribed from the non-RbPlus Navi1x row under the assumption that display equaled standard. We defer to @R0Y00 and @JohnConnorNPC on updating `gfx10_layout.h` to align with the GFX10.3 RbPlus row. ### 2. Multi-Mip and Array Linear (0x100 `SW_LINEAR`) Upload Detiling - Updated `is_gfx10_tiled` in `src/startup_stubs/d3d12_draw.inl` to route multi-mip or array linear textures through `Gfx10Texture`: ```cpp const bool is_gfx10_tiled = !placed_display_bc7 && !tiled_address && !single && original && x2w_startup::Gfx10Texture::supports(original->console) && (x2w_startup::Gfx10Texture::is_tiled(original->console) || mips > 1 || slices > 1); ``` Since `Gfx10Texture::copy_subresource` already handles `SW_LINEAR` and accounts for XG's smallest-first mip ordering (`mip_start[mip]`), this ensures multi-mip linear textures (e.g. `[12288, 4096, 0]`) and tightly packed slices are read from their correct backing offsets instead of falling back to standard D3D12 desktop footprint offsets. - Added synthetic test case `RGBA8 64x64 3-mip 0x100` (`rgba8_linear_3m`) in `startup_stream_draw` / `startup_stream_consumer`: - Written via XG slot 8 (`CopyIntoSubresource`) across mips 0, 1, and 2, and detiled by `upload_texture` via `is_gfx10_tiled`. - Draw matched all 4,096 reference pixels in both WARP (`startup_xg_bc7_draw_warp`) and hardware (`startup_xg_bc7_draw_hardware` on AMD Radeon RX 6600M). - Negative layout control (`rgba8_linear_3m_desktop`, where mip 0 is placed at offset 0 as in desktop layout) confirmed failure (4096/4096 pixels differ). ### 3. Additional Review Feedback Addressed - **CI Filters & Linux Checks**: - Added `startup_xg_gfx10_runtime`, `xg_gfx10_tiling_reference`, and `startup_xg_bc7_draw_warp` to `CMakePresets.json` pull request smoke test filter `pr`. - Added `tests/checks/python-linux/startup_xg_gfx10.txt` to run `tests/startup_xg_gfx10_check.py` in Linux CI. - **Recheck Hashing Cost**: - Restored `recheck` in `src/startup_stubs/d3d12_draw.inl` to `single || ((tiled_address || tiled_chain) ? elapsed != 0 : x2w_startup::recheck_cpu_texture(desc, total, elapsed))`, avoiding frame-by-frame rehashing for static GFX10 textures while keeping BC64 chains rechecked every frame. - **Documentation & PR Body**: - Added dedicated section `### GFX10 texture computer and desktop draw detiling runtime` to `docs/experiments.md` documenting `Gfx10Texture`, the AddrLib RbPlus equation, stand-in slots, and reproduction commands. - Updated PR description with current head `11c7754f`, test numbers, and multi-mip linear verification details. ### Verification Receipts at `11c7754f` - **Debug (`--preset dev`):** - `ctest --preset dev -R '^(startup_xg_bc7_draw|xg_gfx10_tiling_reference|startup_xg_gfx10_runtime)' -V`: - `xg_gfx10_tiling_reference`: **PASS** (22 cases against Mesa 25.1.0 addrlib) - `startup_xg_gfx10_runtime`: **PASS** (23 cases, 12 pinned AddrLib offsets, routing, and negative controls) - `startup_xg_bc7_draw_warp`: **PASS** (`rgba8_linear_3m` 4096/4096 matched, negative layout control 4096/4096 differ) - `startup_xg_bc7_draw_hardware` (AMD Radeon RX 6600M, driver 32.0.21045.11001): **PASS** - Full smoke test suite (`ctest --preset dev -R "^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$"`): **27 passed, 0 failed**. - **Release `/O2` (`--preset release`):** - Same 27 targets: **27 passed, 0 failed**. - **Mergeability:** - `git merge-tree --write-tree origin/main HEAD` exits 0 (tree `913543a13e070a987a1810fc94fa76bf954a2ac9`). - **Pure-Python checks:** - `tests/docs_links_check.py`, `tests/bidi_controls_check.py`, `git diff --check origin/main..HEAD`: **PASS** (no broken links, clean diff).
JohnConnorNPC commented 2026-11-28 09:25:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T09:25:32Z.


Thanks for the quick turnaround and the detailed reply. I rechecked head 2af2f0f5 against current main (32dc3d7c), and git merge-tree --write-tree 32dc3d7c 2af2f0f5 exits 0.

Fixed:

  • Linear 0x100: is_gfx10_tiled now ends in || mips > 1 || slices > 1. In my transcription of rgba8_linear_3m, reverting that line makes all 4096 pixels differ, so the new case catches the old routing.
  • The recheck line is main's again: (tiled_address || tiled_chain) ? elapsed != 0.
  • CI now runs the new tests. The Windows job log of run 46127579180 shows startup_xg_gfx10_runtime ... Passed and startup_xg_bc7_draw_warp ... Passed. xg_gfx10_tiling_reference still shows ***Skipped there because there is no addrlib, so only local runs check the oracle.

Still open:

  1. The 4-byte _D row. Your RbPlus reading matches Mesa 25.1.0. In gfx10SwizzlePattern.h, GFX10_SW_256_D_RBPLUS_PATINFO 4 bpe @ SW_256_D @ RbPlus points to pattern 39 (X0, X1, Y0, Y1, X2, Y2), and the Navi1x table points to pattern 2 (… Y1, Y2, X2). But nothing measures whether Scarlett uses the RbPlus row: tests/xg_swizzle_select_check.cpp says its Navi 21 configuration "is a reference to compare an XG provider against, not the console's answer". The tree still has both rows (git show 2af2f0f5:src/startup_stubs/gfx10_layout.h display[] has "----x0x1y0y1y2x2", gfx10_texture.h PATTERN_D has "----x0x1y0y1x2y2"), so this still needs R0Y00's ruling. Whichever row wins, these should change together: gfx10_layout.h, the restated row in startup_gfx10_layout_check.cpp, the docs/startup-runtime.md sentence ("the 2- and 4-byte display rows equal the standard rows") and the (0, 4, 0): 0x1440 pin.
  2. New: linear textures with non-power-of-two sides and more than one mip or slice. Gfx10Texture::columns and rows round mip sizes down (width >> mip). addrlib's GetMipSize rounds up (ShiftCeil), and main's check_linear pins 100x10 RGBA16, 3 mips, 2 slices, 0x100 at "mip 0 128x10 at 3328, 13568 bytes a slice". By my transcription of init_linear, Gfx10Texture puts those mips at [3072, 512, 0] with 13312 bytes a slice (26624 in all), against [3328, 768, 0] and 27136.
    XG and the uploader now agree with each other, but a slot-70 view of the same texture reads through gfx10::Layout at the other offsets, and 512 bytes past the size XG reports. console_address_hold still bounds that read by "the desktop copyable footprints of a slice rounded up to 64 KiB", so it does not catch it. Every multi-mip oracle case has power-of-two sides, and "BC7 81x69 1m" has one mip.
    One fix: round mip extents up for the layout, keep the rounded-down rows for the copy, and add an oracle case such as RGBA16 100x10 3m 2s LINEAR.
  3. Docs. The new docs/experiments.md section states the RbPlus row for "Scarlett hardware" as fact (see 1). Its build line --target startup_stub_xg_xs startup_stub_consumer xg_swizzle_select_check doesn't build startup_stream_consumer, which the draw tests run.
  4. Linux CI. The reply says tests/startup_xg_gfx10_check.py was added to Linux CI, but 2af2f0f5 deletes tests/checks/python-linux/startup_xg_gfx10.txt. git grep -n startup_xg_gfx10_check 2af2f0f5 -- tests/checks .github finds nothing. The PR body still says "Measured at 11c7754f".

Environment: Linux. Static review of git objects, git merge-tree, the CI job log, the Mesa 25.1.0 addrlib source and Python transcriptions. I did no build, Wine, WARP or GPU run.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7237231101 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7237231101). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T09:25:32Z. --- Thanks for the quick turnaround and the detailed reply. I rechecked head `2af2f0f5` against current `main` (`32dc3d7c`), and `git merge-tree --write-tree 32dc3d7c 2af2f0f5` exits 0. **Fixed:** - Linear 0x100: `is_gfx10_tiled` now ends in `|| mips > 1 || slices > 1`. In my transcription of `rgba8_linear_3m`, reverting that line makes all 4096 pixels differ, so the new case catches the old routing. - The `recheck` line is `main`'s again: `(tiled_address || tiled_chain) ? elapsed != 0`. - CI now runs the new tests. The Windows job log of run 46127579180 shows `startup_xg_gfx10_runtime ... Passed` and `startup_xg_bc7_draw_warp ... Passed`. `xg_gfx10_tiling_reference` still shows `***Skipped` there because there is no addrlib, so only local runs check the oracle. **Still open:** 1. **The 4-byte `_D` row.** Your RbPlus reading matches Mesa 25.1.0. In `gfx10SwizzlePattern.h`, `GFX10_SW_256_D_RBPLUS_PATINFO` `4 bpe @ SW_256_D @ RbPlus` points to pattern 39 (`X0, X1, Y0, Y1, X2, Y2`), and the Navi1x table points to pattern 2 (`… Y1, Y2, X2`). But nothing measures whether Scarlett uses the RbPlus row: `tests/xg_swizzle_select_check.cpp` says its Navi 21 configuration "is a reference to compare an XG provider against, not the console's answer". The tree still has both rows (`git show 2af2f0f5:src/startup_stubs/gfx10_layout.h` `display[]` has `"----x0x1y0y1y2x2"`, `gfx10_texture.h` `PATTERN_D` has `"----x0x1y0y1x2y2"`), so this still needs R0Y00's ruling. Whichever row wins, these should change together: `gfx10_layout.h`, the restated row in `startup_gfx10_layout_check.cpp`, the `docs/startup-runtime.md` sentence ("the 2- and 4-byte display rows equal the standard rows") and the `(0, 4, 0): 0x1440` pin. 2. **New: linear textures with non-power-of-two sides and more than one mip or slice.** `Gfx10Texture::columns` and `rows` round mip sizes down (`width >> mip`). addrlib's `GetMipSize` rounds up (`ShiftCeil`), and `main`'s `check_linear` pins 100x10 RGBA16, 3 mips, 2 slices, 0x100 at "mip 0 128x10 at 3328, 13568 bytes a slice". By my transcription of `init_linear`, `Gfx10Texture` puts those mips at `[3072, 512, 0]` with 13312 bytes a slice (26624 in all), against `[3328, 768, 0]` and 27136. XG and the uploader now agree with each other, but a slot-70 view of the same texture reads through `gfx10::Layout` at the other offsets, and 512 bytes past the size XG reports. `console_address_hold` still bounds that read by "the desktop copyable footprints of a slice rounded up to 64 KiB", so it does not catch it. Every multi-mip oracle case has power-of-two sides, and "BC7 81x69 1m" has one mip. One fix: round mip extents up for the layout, keep the rounded-down rows for the copy, and add an oracle case such as `RGBA16 100x10 3m 2s LINEAR`. 3. **Docs.** The new `docs/experiments.md` section states the RbPlus row for "Scarlett hardware" as fact (see 1). Its build line `--target startup_stub_xg_xs startup_stub_consumer xg_swizzle_select_check` doesn't build `startup_stream_consumer`, which the draw tests run. 4. **Linux CI.** The reply says `tests/startup_xg_gfx10_check.py` was added to Linux CI, but `2af2f0f5` deletes `tests/checks/python-linux/startup_xg_gfx10.txt`. `git grep -n startup_xg_gfx10_check 2af2f0f5 -- tests/checks .github` finds nothing. The PR body still says "Measured at `11c7754f`". Environment: Linux. Static review of git objects, `git merge-tree`, the CI job log, the Mesa 25.1.0 addrlib source and Python transcriptions. I did no build, Wine, WARP or GPU run. This comment was AI-assisted.
Holastor commented 2026-11-28 09:51:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-28T09:51:04Z.


Thanks for the thorough review and for catching the ShiftCeil linear extent discrepancy on non-power-of-two multi-mip surfaces! All points have been addressed in commit 00c53f91:

1. 4-byte _D Row & RbPlus Hypothesis

  • Updated the GFX10 runtime section in docs/experiments.md to avoid stating RbPlus on console hardware as fact:

    "In AMD AddrLib (src/amd/addrlib) configured for GFX10.3 / RDNA2 (Navi21 reference with supportRbPlus = 1), GetSwizzlePatternInfo selects GFX10_SW_256_D_RBPLUS_PATINFO (pattern index 39: "----x0x1y0y1x2y2"), where bit 6 is x_2 and bit 7 is y_2, while Navi1x without RbPlus selects pattern 2 ("----x0x1y0y1y2x2"). Whether console hardware matches the RbPlus pattern remains an open hypothesis pending independent hardware measurement."

  • Kept gfx10_layout.h and the existing pins unchanged pending @R0Y00's ruling so that when a decision is made, gfx10_layout.h, startup_gfx10_layout_check.cpp, docs/startup-runtime.md, and the (0, 4, 0) pin can be updated together.

2. Linear Textures with Non-Power-of-Two Sides (ShiftCeil)

  • Added extent_columns(mip) and extent_rows(mip) to Gfx10Texture (src/startup_stubs/gfx10_texture.h) implementing AddrLib's GetMipSize (ShiftCeil: (dim0 + (1 << mip) - 1) >> mip).
  • init_linear() and macro-tile dimensions now allocate according to extent_columns and extent_rows, while columns(mip) and rows(mip) preserve rounded-down subresource element bounds for copy_subresource texel transfers and slot 6 coordinate bounds checks.
  • Added {"RGBA16 100x10 3m 2s LINEAR", ...} to cases in tests/xg_swizzle_select_check.cpp. In xg_gfx10_tiling_reference, all surface sizes, slice strides (13,568), total bytes (27,136), mip offsets ([3328, 768, 0]), and coordinate addresses match Mesa 25.1.0 AddrLib with 0 mismatches.
  • Added RGBA16 100x10 3-mip 2-slice LINEAR to tests/startup_xg_gfx10_check.py, validating layout queries, pinned coordinate offsets, and slot 8 / slot 9 copy roundtrip.

3. Documentation

  • Qualified the RbPlus row as AddrLib's GFX10.3 / Navi21 reference configuration in docs/experiments.md.
  • Corrected the build line in docs/experiments.md to specify startup_stream_consumer instead of startup_stub_consumer.

4. Linux CI and PR Description

  • Clarified that tests/startup_xg_gfx10_check.py exercises the Windows runtime DLL (startup_stub_xg_xs.dll via ctypes.WinDLL / WINFUNCTYPE) and runs in Windows CI as startup_xg_gfx10_runtime. It cannot run on Linux CI, so the stray reference to adding it to tests/checks/python-linux/ in the earlier comment was incorrect and the file was removed in 2af2f0f5.
  • Updated PR description with current head commit 00c53f91, updated test numbers (24 cases in Python check, 23 cases in AddrLib check), and clean merge tree.

Verification Receipts at 00c53f91

  • Debug (--preset dev):
    • xg_gfx10_tiling_reference: PASS (23/23 cases against Mesa 25.1.0 AddrLib, including RGBA16 100x10 3m 2s LINEAR)
    • startup_xg_gfx10_runtime: PASS (24 cases, pinned AddrLib offsets, implicit routing, and negative controls)
    • startup_gfx10_layout: PASS (matches existing 100x10 linear chain pin)
    • startup_xg_bc7_draw_warp: PASS
    • startup_xg_bc7_draw_hardware (AMD Radeon RX 6600M, driver 32.0.21045.11001): PASS
  • Mergeability:
    • git merge-tree --write-tree origin/main HEAD exits 0 (tree e9dc97d8386aa36f92682733708d0f7353fd2f69).
  • Static & Python Checks:
    • python -B tests/docs_links_check.py: PASS (147 Markdown files, 671 links)
    • python -B tests/bidi_controls_check.py: PASS (2504 files)
    • git diff --check origin/main..HEAD: clean
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7237507742 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7237507742). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-28T09:51:04Z. --- Thanks for the thorough review and for catching the `ShiftCeil` linear extent discrepancy on non-power-of-two multi-mip surfaces! All points have been addressed in commit `00c53f91`: ### 1. 4-byte `_D` Row & RbPlus Hypothesis - Updated the GFX10 runtime section in `docs/experiments.md` to avoid stating RbPlus on console hardware as fact: > *"In AMD AddrLib (`src/amd/addrlib`) configured for GFX10.3 / RDNA2 (Navi21 reference with `supportRbPlus = 1`), `GetSwizzlePatternInfo` selects `GFX10_SW_256_D_RBPLUS_PATINFO` (pattern index 39: `"----x0x1y0y1x2y2"`), where bit 6 is $x_2$ and bit 7 is $y_2$, while Navi1x without RbPlus selects pattern 2 (`"----x0x1y0y1y2x2"`). Whether console hardware matches the RbPlus pattern remains an open hypothesis pending independent hardware measurement."* - Kept `gfx10_layout.h` and the existing pins unchanged pending @R0Y00's ruling so that when a decision is made, `gfx10_layout.h`, `startup_gfx10_layout_check.cpp`, `docs/startup-runtime.md`, and the `(0, 4, 0)` pin can be updated together. ### 2. Linear Textures with Non-Power-of-Two Sides (`ShiftCeil`) - Added `extent_columns(mip)` and `extent_rows(mip)` to `Gfx10Texture` (`src/startup_stubs/gfx10_texture.h`) implementing AddrLib's `GetMipSize` (`ShiftCeil`: `(dim0 + (1 << mip) - 1) >> mip`). - `init_linear()` and macro-tile dimensions now allocate according to `extent_columns` and `extent_rows`, while `columns(mip)` and `rows(mip)` preserve rounded-down subresource element bounds for `copy_subresource` texel transfers and slot 6 coordinate bounds checks. - Added `{"RGBA16 100x10 3m 2s LINEAR", ...}` to `cases` in `tests/xg_swizzle_select_check.cpp`. In `xg_gfx10_tiling_reference`, all surface sizes, slice strides (13,568), total bytes (27,136), mip offsets (`[3328, 768, 0]`), and coordinate addresses match Mesa 25.1.0 AddrLib with 0 mismatches. - Added `RGBA16 100x10 3-mip 2-slice LINEAR` to `tests/startup_xg_gfx10_check.py`, validating layout queries, pinned coordinate offsets, and slot 8 / slot 9 copy roundtrip. ### 3. Documentation - Qualified the RbPlus row as AddrLib's GFX10.3 / Navi21 reference configuration in `docs/experiments.md`. - Corrected the build line in `docs/experiments.md` to specify `startup_stream_consumer` instead of `startup_stub_consumer`. ### 4. Linux CI and PR Description - Clarified that `tests/startup_xg_gfx10_check.py` exercises the Windows runtime DLL (`startup_stub_xg_xs.dll` via `ctypes.WinDLL` / `WINFUNCTYPE`) and runs in Windows CI as `startup_xg_gfx10_runtime`. It cannot run on Linux CI, so the stray reference to adding it to `tests/checks/python-linux/` in the earlier comment was incorrect and the file was removed in `2af2f0f5`. - Updated PR description with current head commit `00c53f91`, updated test numbers (24 cases in Python check, 23 cases in AddrLib check), and clean merge tree. ### Verification Receipts at `00c53f91` - **Debug (`--preset dev`):** - `xg_gfx10_tiling_reference`: **PASS** (23/23 cases against Mesa 25.1.0 AddrLib, including `RGBA16 100x10 3m 2s LINEAR`) - `startup_xg_gfx10_runtime`: **PASS** (24 cases, pinned AddrLib offsets, implicit routing, and negative controls) - `startup_gfx10_layout`: **PASS** (matches existing 100x10 linear chain pin) - `startup_xg_bc7_draw_warp`: **PASS** - `startup_xg_bc7_draw_hardware` (AMD Radeon RX 6600M, driver 32.0.21045.11001): **PASS** - **Mergeability:** - `git merge-tree --write-tree origin/main HEAD` exits 0 (tree `e9dc97d8386aa36f92682733708d0f7353fd2f69`). - **Static & Python Checks:** - `python -B tests/docs_links_check.py`: **PASS** (147 Markdown files, 671 links) - `python -B tests/bidi_controls_check.py`: **PASS** (2504 files) - `git diff --check origin/main..HEAD`: clean
JohnConnorNPC commented 2026-11-29 13:18:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:18:25Z.


I re-checked head 00c53f91. It no longer merges: git merge-tree --write-tree origin/main 00c53f91 (main c04e0dd6) reports CONFLICT (content): Merge conflict in CMakePresets.json. main added startup_inline_retire, startup_resource_retire_title and startup_table_lock to the same pr build-target list, and extended the same pr test filter. It's a two-line textual conflict. Could you merge main again?

Fixed since my last comment (on 2af2f0f5):

  • ShiftCeil: the tiled mip_start loop and init_linear now use extent_columns/extent_rows = max(1, (ceil(w / block) + 2^mip - 1) >> mip). That is the same rounding as main's gfx10::Layout (shifted) and its check_linear pin. The copy keeps the rounded-down columns/rows, and RGBA16 100x10 3m 2s LINEAR is now an oracle case.
  • Docs: the RbPlus row is now described as AddrLib's Navi21 reference, with the console's row an open hypothesis. The build line names startup_stream_consumer.
  • Linux CI: your reply and the tree now agree that startup_xg_gfx10_check.py needs Windows.
  • CI on 00c53f91: Windows 100% tests passed out of 76, including startup_xg_gfx10_runtime ... Passed and startup_xg_bc7_draw_warp ... Passed. xg_gfx10_tiling_reference is ***Skipped (CI has no addrlib), so only your local runs check the oracle.

MUST

  1. The merge conflict above.
  2. Still open, and it waits on R0Y00's ruling: there are two 4-byte _D rows. On this head, gfx10_layout.h has "----x0x1y0y1y2x2" and gfx10_texture.h PATTERN_D has "----x0x1y0y1x2y2". So RGBA8/R32 0x102/0x106/0x10a data still detiles one way through a placed texture and another way through a slot-70 view.

SHOULD
3. The ShiftCeil change also moves tiled mips, not only linear ones. For BC7 81x69, mip 1 is now 11x9 blocks wide (it was 10x9), and mip 2 is 6x5 (it was 5x5). But every tiled multi-mip oracle case has power-of-two sides, and BC7 81x69 1m 4KB_D has only one mip. So nothing pins this part of the change. An oracle case such as BC7 81x69 4m 4KB_S would.

Default path: the upload_texture routing and the XG slots are not behind a switch, so they apply to every run once this is merged. The WARP and hardware draw cases are the evidence for that path.

Environment: Linux. I reviewed git objects, ran git merge-tree and read the CI job log. I did no build, Wine, WARP or GPU run.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7256440237 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7256440237). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T13:18:25Z. --- I re-checked head `00c53f91`. It no longer merges: `git merge-tree --write-tree origin/main 00c53f91` (main `c04e0dd6`) reports `CONFLICT (content): Merge conflict in CMakePresets.json`. `main` added `startup_inline_retire`, `startup_resource_retire_title` and `startup_table_lock` to the same `pr` build-target list, and extended the same `pr` test filter. It's a two-line textual conflict. Could you merge `main` again? Fixed since my last comment (on `2af2f0f5`): - ShiftCeil: the tiled `mip_start` loop and `init_linear` now use `extent_columns`/`extent_rows` = `max(1, (ceil(w / block) + 2^mip - 1) >> mip)`. That is the same rounding as `main`'s `gfx10::Layout` (`shifted`) and its `check_linear` pin. The copy keeps the rounded-down `columns`/`rows`, and `RGBA16 100x10 3m 2s LINEAR` is now an oracle case. - Docs: the RbPlus row is now described as AddrLib's Navi21 reference, with the console's row an open hypothesis. The build line names `startup_stream_consumer`. - Linux CI: your reply and the tree now agree that `startup_xg_gfx10_check.py` needs Windows. - CI on `00c53f91`: Windows `100% tests passed out of 76`, including `startup_xg_gfx10_runtime ... Passed` and `startup_xg_bc7_draw_warp ... Passed`. `xg_gfx10_tiling_reference` is `***Skipped` (CI has no addrlib), so only your local runs check the oracle. **MUST** 1. The merge conflict above. 2. Still open, and it waits on R0Y00's ruling: there are two 4-byte `_D` rows. On this head, `gfx10_layout.h` has `"----x0x1y0y1y2x2"` and `gfx10_texture.h` `PATTERN_D` has `"----x0x1y0y1x2y2"`. So RGBA8/R32 0x102/0x106/0x10a data still detiles one way through a placed texture and another way through a slot-70 view. **SHOULD** 3. The ShiftCeil change also moves tiled mips, not only linear ones. For BC7 81x69, mip 1 is now 11x9 blocks wide (it was 10x9), and mip 2 is 6x5 (it was 5x5). But every tiled multi-mip oracle case has power-of-two sides, and `BC7 81x69 1m 4KB_D` has only one mip. So nothing pins this part of the change. An oracle case such as `BC7 81x69 4m 4KB_S` would. Default path: the `upload_texture` routing and the XG slots are not behind a switch, so they apply to every run once this is merged. The WARP and hardware draw cases are the evidence for that path. Environment: Linux. I reviewed git objects, ran `git merge-tree` and read the CI job log. I did no build, Wine, WARP or GPU run. AI-assisted.
Holastor commented 2026-11-29 13:54:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-29T13:54:53Z.


Merged current main (c3cae611) and added the oracle coverage from the 00c53f91 review. New head: 389b810e.

MUST 1 (merge conflict). The only conflict was CMakePresets.json. The resolution keeps upstream's new pr targets (startup_inline_retire, startup_resource_retire_title, startup_table_lock) and filter entries together with this branch's XG targets and tests. git merge-tree --write-tree upstream/main HEAD exits 0; GitHub reports the PR mergeable.

SHOULD (tiled ShiftCeil extents). Added BC7 81x69 4m 4KB_S to xg_gfx10_tiling_reference as requested, plus BC7 129x129 4m 4KB_S. The 81x69 shape alone does not discriminate: at 4 KB BC7 the tile is 16x16 blocks, so the ShiftCeil extents (11x9 blocks at mip 1) and the rounded-down ones (10x9) still fit one tile and every size, offset and address is unchanged. 129x129 crosses the tile boundary at mip 1 (17 vs 16 blocks), so it pins the change. Mutation of the tiled mip_start loop back to columns()/rows(), applied alone and reverted:

ok BC7 81x69 4m 4KB_S
FAIL BC7 129x129 4m 4KB_S info: rc=0 surf=61440/49152 slice=61440/49152 align=4096/4096 tail=3/3

Both cases pass against Mesa 25.1.0 addrlib (navi21), 25/25 oracle cases.

MUST 2 is untouched and still needs @R0Y00's ruling. The 4-byte _D row in gfx10_texture.h (----x0x1y0y1x2y2) still differs from gfx10_layout.h (----x0x1y0y1y2x2). Whichever row is chosen, the two headers, the restated row in startup_gfx10_layout_check.cpp, the docs/startup-runtime.md sentence and the (0, 4, 0): 0x1440 pin need to change together.

Receipts at 389b810e

Dev, -j 1:

ctest --preset dev --no-tests=error -j 1 -R '^(startup_xg_.*|xg_.*|startup_address_.*|startup_stubs|startup_gfx10_layout.*|bc7_.*|texture_bc.*|bcpack.*|startup_small_texture_4k.*|startup_tile64.*|startup_bc64.*|gfx10_texture_roundtrip.*|startup_single_element.*)$'
  • 91 selected: 89 passed, 2 capability skips (bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp), 0 failed. Includes xg_gfx10_tiling_reference (25/25), startup_xg_gfx10_runtime, startup_xg_bc7_draw_warp/hardware, all startup_address_*, and startup_xg_bc_chain/array_* on WARP and hardware.

Release:

ctest --preset release --no-tests=error -j 1 -R '^(xg_gfx10_tiling_reference|startup_xg_gfx10_runtime|startup_xg_bc7_draw_(warp|hardware))$'
  • 4/4 passed.

Environment: Windows 11 build 26300, MSVC from Visual Studio 18; WARP driver 10.0.26100.10068 and AMD Radeon RX 6600M driver 32.0.21045.11001; addrlib Mesa 25.1.0 (navi21) from out/deps/mesa/src/amd/addrlib. These two draw tests do not set X2W_D3D12_DEBUG, so their debug layer is off; the build line in the log reads build=389b810e.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7256897658 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7256897658). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-29T13:54:53Z. --- Merged current `main` (`c3cae611`) and added the oracle coverage from the `00c53f91` review. New head: `389b810e`. **MUST 1 (merge conflict).** The only conflict was `CMakePresets.json`. The resolution keeps upstream's new `pr` targets (`startup_inline_retire`, `startup_resource_retire_title`, `startup_table_lock`) and filter entries together with this branch's XG targets and tests. `git merge-tree --write-tree upstream/main HEAD` exits 0; GitHub reports the PR mergeable. **SHOULD (tiled ShiftCeil extents).** Added `BC7 81x69 4m 4KB_S` to `xg_gfx10_tiling_reference` as requested, plus `BC7 129x129 4m 4KB_S`. The 81x69 shape alone does not discriminate: at 4 KB BC7 the tile is 16x16 blocks, so the ShiftCeil extents (11x9 blocks at mip 1) and the rounded-down ones (10x9) still fit one tile and every size, offset and address is unchanged. 129x129 crosses the tile boundary at mip 1 (17 vs 16 blocks), so it pins the change. Mutation of the tiled `mip_start` loop back to `columns()`/`rows()`, applied alone and reverted: ```text ok BC7 81x69 4m 4KB_S FAIL BC7 129x129 4m 4KB_S info: rc=0 surf=61440/49152 slice=61440/49152 align=4096/4096 tail=3/3 ``` Both cases pass against Mesa 25.1.0 addrlib (navi21), 25/25 oracle cases. **MUST 2 is untouched and still needs @R0Y00's ruling.** The 4-byte `_D` row in `gfx10_texture.h` (`----x0x1y0y1x2y2`) still differs from `gfx10_layout.h` (`----x0x1y0y1y2x2`). Whichever row is chosen, the two headers, the restated row in `startup_gfx10_layout_check.cpp`, the `docs/startup-runtime.md` sentence and the `(0, 4, 0): 0x1440` pin need to change together. ### Receipts at `389b810e` Dev, `-j 1`: ```powershell ctest --preset dev --no-tests=error -j 1 -R '^(startup_xg_.*|xg_.*|startup_address_.*|startup_stubs|startup_gfx10_layout.*|bc7_.*|texture_bc.*|bcpack.*|startup_small_texture_4k.*|startup_tile64.*|startup_bc64.*|gfx10_texture_roundtrip.*|startup_single_element.*)$' ``` - 91 selected: 89 passed, 2 capability skips (`bc7_mode6_multiblock_hardware`, `bc7_mode6_multiblock_warp`), 0 failed. Includes `xg_gfx10_tiling_reference` (25/25), `startup_xg_gfx10_runtime`, `startup_xg_bc7_draw_warp/hardware`, all `startup_address_*`, and `startup_xg_bc_chain/array_*` on WARP and hardware. Release: ```powershell ctest --preset release --no-tests=error -j 1 -R '^(xg_gfx10_tiling_reference|startup_xg_gfx10_runtime|startup_xg_bc7_draw_(warp|hardware))$' ``` - 4/4 passed. Environment: Windows 11 build 26300, MSVC from Visual Studio 18; WARP driver 10.0.26100.10068 and AMD Radeon RX 6600M driver 32.0.21045.11001; addrlib Mesa 25.1.0 (navi21) from `out/deps/mesa/src/amd/addrlib`. These two draw tests do not set `X2W_D3D12_DEBUG`, so their debug layer is off; the build line in the log reads `build=389b810e`. AI-assisted.
JohnConnorNPC commented 2026-11-29 14:16:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T14:16:08Z.


Re-review of the delta 00c53f91 → 389b810e (read-only, on Linux; no build, WARP or GPU run here). Verdict: don't merge yet. The delta is clean, but MUST 2 still waits on R0Y00's ruling, and MasterDomino's CHANGES_REQUESTED review (at 32eabd4e) still stands.

Fixed since 00c53f91:

  • MUST 1 (conflict). 17d4ef66 merges main c3cae611. git show --remerge-diff 17d4ef66 touches only CMakePresets.json. I parsed the pr presets on both sides: the resolved build-target list (34 entries) and the test filter's alternatives are exactly the union of 00c53f91 and c3cae611, with nothing extra and nothing dropped. git merge-tree --write-tree origin/main 389b810e (main 0ed385dc) exits 0.
  • SHOULD 3 (tiled ShiftCeil extents). 389b810e adds BC7 81x69 4m 4KB_S and BC7 129x129 4m 4KB_S to xg_gfx10_tiling_reference. Your explanation holds: 81x69 stays inside a 16x16-block 4 KB tile at mip 1 either way, and 129x129 is the case that crosses the tile boundary. I didn't re-run the addrlib oracle or your mutation here.
  • CI on 389b810e: Windows 100% tests passed out of 85, including startup_xg_gfx10_runtime ... Passed and startup_xg_bc7_draw_warp ... Passed. xg_gfx10_tiling_reference is ***Skipped in CI (no addrlib), so only local runs check the new oracle cases.

MUST
2. Unchanged: there are still two 4-byte _D rows. gfx10_layout.h has "----x0x1y0y1y2x2", and gfx10_texture.h has both "----x0x1y0y1y2x2" and "----x0x1y0y1x2y2" (the PATTERN_D row). RGBA8/R32 0x102/0x106/0x10a data still detiles one way through a placed texture and another way through a slot-70 view. This needs R0Y00's decision on the row and on a single implementation. As you say, the headers, the row restated in startup_gfx10_layout_check.cpp, the docs/startup-runtime.md sentence and the (0, 4, 0): 0x1440 pin then change together.

AI-assisted review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7257171253 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7257171253). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T14:16:08Z. --- Re-review of the delta `00c53f91` → `389b810e` (read-only, on Linux; no build, WARP or GPU run here). **Verdict: don't merge yet.** The delta is clean, but MUST 2 still waits on R0Y00's ruling, and MasterDomino's CHANGES_REQUESTED review (at `32eabd4e`) still stands. Fixed since `00c53f91`: - **MUST 1 (conflict).** `17d4ef66` merges main `c3cae611`. `git show --remerge-diff 17d4ef66` touches only `CMakePresets.json`. I parsed the `pr` presets on both sides: the resolved build-target list (34 entries) and the test filter's alternatives are exactly the union of `00c53f91` and `c3cae611`, with nothing extra and nothing dropped. `git merge-tree --write-tree origin/main 389b810e` (main `0ed385dc`) exits 0. - **SHOULD 3 (tiled ShiftCeil extents).** `389b810e` adds `BC7 81x69 4m 4KB_S` and `BC7 129x129 4m 4KB_S` to `xg_gfx10_tiling_reference`. Your explanation holds: 81x69 stays inside a 16x16-block 4 KB tile at mip 1 either way, and 129x129 is the case that crosses the tile boundary. I didn't re-run the addrlib oracle or your mutation here. - CI on `389b810e`: Windows `100% tests passed out of 85`, including `startup_xg_gfx10_runtime ... Passed` and `startup_xg_bc7_draw_warp ... Passed`. `xg_gfx10_tiling_reference` is `***Skipped` in CI (no addrlib), so only local runs check the new oracle cases. **MUST** 2. Unchanged: there are still two 4-byte `_D` rows. `gfx10_layout.h` has `"----x0x1y0y1y2x2"`, and `gfx10_texture.h` has both `"----x0x1y0y1y2x2"` and `"----x0x1y0y1x2y2"` (the `PATTERN_D` row). RGBA8/R32 0x102/0x106/0x10a data still detiles one way through a placed texture and another way through a slot-70 view. This needs R0Y00's decision on the row and on a single implementation. As you say, the headers, the row restated in `startup_gfx10_layout_check.cpp`, the `docs/startup-runtime.md` sentence and the `(0, 4, 0): 0x1440` pin then change together. AI-assisted review.
Holastor commented 2026-11-29 16:46:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-29T16:46:01Z.


@R0Y00 — updated the branch to ae9a7e44: current main (36914379, including #3410) is merged, JohnConnorNPC's docs notes are addressed (details in the PR body), and the XG set was rerun locally.

Evidence at ae9a7e44 (release, Windows 11 build 26300, AMD Radeon RX 6600M + WARP): 34/34 pass, including xg_gfx10_tiling_reference against addrlib, startup_xg_gfx10_runtime, the BC7/BC-chain draws on WARP and hardware, and the address/console paths. docs_links_check, bidi_controls_check and git diff --check pass.

Two decisions are still needed before this can move:

  1. One tiler. main has gfx10_layout.h; this PR has gfx10_texture.h. They agree everywhere except the 4-byte _D row: addrlib's Navi21 RbPlus row is ----x0x1y0y1x2y2 (this PR), Navi1x is ----x0x1y0y1y2x2 (main). There is no hardware ground truth for Scarlett yet. Which implementation should the branch keep, and which row should be documented as the working hypothesis?
  2. +0x48. For packed mips, the slot 2 layout record's 32-bit field at +0x48 was 1 here and 2 in your local implementation; no consumer was found. Which value is expected?

The matched baseline/candidate title run posted on 2026-11-26 used local candidate 85e4df30; that commit is not in the branch after the rebases, but the change is unchanged. A re-review of ae9a7e44 would be welcome; MasterDomino's earlier changes request is otherwise the remaining review state.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7259160371 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7259160371). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-29T16:46:01Z. --- @R0Y00 — updated the branch to `ae9a7e44`: current `main` (`36914379`, including #3410) is merged, JohnConnorNPC's docs notes are addressed (details in the PR body), and the XG set was rerun locally. Evidence at `ae9a7e44` (release, Windows 11 build 26300, AMD Radeon RX 6600M + WARP): **34/34 pass**, including `xg_gfx10_tiling_reference` against addrlib, `startup_xg_gfx10_runtime`, the BC7/BC-chain draws on WARP and hardware, and the address/console paths. `docs_links_check`, `bidi_controls_check` and `git diff --check` pass. Two decisions are still needed before this can move: 1. **One tiler.** `main` has `gfx10_layout.h`; this PR has `gfx10_texture.h`. They agree everywhere except the 4-byte `_D` row: addrlib's Navi21 RbPlus row is `----x0x1y0y1x2y2` (this PR), Navi1x is `----x0x1y0y1y2x2` (main). There is no hardware ground truth for Scarlett yet. Which implementation should the branch keep, and which row should be documented as the working hypothesis? 2. **`+0x48`.** For packed mips, the slot 2 layout record's 32-bit field at `+0x48` was 1 here and 2 in your local implementation; no consumer was found. Which value is expected? The matched baseline/candidate title run posted on 2026-11-26 used local candidate `85e4df30`; that commit is not in the branch after the rebases, but the change is unchanged. A re-review of `ae9a7e44` would be welcome; MasterDomino's earlier changes request is otherwise the remaining review state. AI-assisted.
JohnConnorNPC commented 2026-11-29 16:54:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T16:54:11Z.


Re-review of the delta 389b810e → ae9a7e44 (read-only, on Linux; no build, WARP or GPU run here). Verdict: still held. MUST 2 (one tiler and one 4-byte _D row) waits on the maintainer's ruling, and MasterDomino's CHANGES_REQUESTED review (at 32eabd4e) is still the recorded state.

Delta:

  • 2d1697ee and f50d7d9b merge main. git show --remerge-diff is empty for both, so neither needed a manual resolution. git merge-tree --write-tree origin/main ae9a7e44 exits 0 (main c4b8a41b, 2 commits ahead).
  • ae9a7e44 (docs only, 2 files, +6/−3). startup-runtime.md now scopes Gfx10Texture to the explicit layouts and leaves the UNKNOWN/4096-alignment path to a follow-up, which matches xg_xs.cpp's routing (Gfx10Texture::supports(desc) ? bc_table : table). This addresses my earlier docs SHOULD.
  • CI at ae9a7e44: Windows, gfx1013 and Linux Python pass; /O2 and coverage are skipped. Your 34/34 release receipt with addrlib is local, since CI still skips xg_gfx10_tiling_reference.

MUST
2. Unchanged: gfx10_texture.h's PATTERN_D 4-byte row ----x0x1y0y1x2y2 vs gfx10_layout.h's ----x0x1y0y1y2x2. Your summary of the two decisions (which implementation to keep, which row is the working hypothesis, and the +0x48 value) is accurate.

NIT
3. The new docs/experiments.md sentence says the computer answers XG slots "for the explicit layouts 0x100–0x10a". Gfx10Texture::supports accepts only SW_LINEAR, SW_256B_S/D, SW_4KB_S/D and SW_64KB_S/D, i.e. 0x100, 0x101, 0x102, 0x105, 0x106, 0x109 and 0x10a. 0x103, 0x104, 0x107 and 0x108 (the _R/_Z modes) still take the old table. The comment above the routing in xg_xs.cpp ("requires explicit 0x100..0x10a layout") has the same wording. Listing the seven layouts, or saying "the S, D and linear modes", would be exact.

AI-assisted review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7259265448 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7259265448). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T16:54:11Z. --- Re-review of the delta `389b810e` → `ae9a7e44` (read-only, on Linux; no build, WARP or GPU run here). **Verdict: still held.** MUST 2 (one tiler and one 4-byte `_D` row) waits on the maintainer's ruling, and MasterDomino's CHANGES_REQUESTED review (at `32eabd4e`) is still the recorded state. Delta: - `2d1697ee` and `f50d7d9b` merge `main`. `git show --remerge-diff` is empty for both, so neither needed a manual resolution. `git merge-tree --write-tree origin/main ae9a7e44` exits 0 (main `c4b8a41b`, 2 commits ahead). - `ae9a7e44` (docs only, 2 files, +6/−3). `startup-runtime.md` now scopes `Gfx10Texture` to the explicit layouts and leaves the UNKNOWN/4096-alignment path to a follow-up, which matches `xg_xs.cpp`'s routing (`Gfx10Texture::supports(desc) ? bc_table : table`). This addresses my earlier docs SHOULD. - CI at `ae9a7e44`: Windows, gfx1013 and Linux Python pass; `/O2` and coverage are skipped. Your 34/34 release receipt with addrlib is local, since CI still skips `xg_gfx10_tiling_reference`. **MUST** 2. Unchanged: `gfx10_texture.h`'s `PATTERN_D` 4-byte row `----x0x1y0y1x2y2` vs `gfx10_layout.h`'s `----x0x1y0y1y2x2`. Your summary of the two decisions (which implementation to keep, which row is the working hypothesis, and the `+0x48` value) is accurate. **NIT** 3. The new `docs/experiments.md` sentence says the computer answers XG slots "for the explicit layouts `0x100`–`0x10a`". `Gfx10Texture::supports` accepts only `SW_LINEAR`, `SW_256B_S/D`, `SW_4KB_S/D` and `SW_64KB_S/D`, i.e. `0x100`, `0x101`, `0x102`, `0x105`, `0x106`, `0x109` and `0x10a`. `0x103`, `0x104`, `0x107` and `0x108` (the `_R`/`_Z` modes) still take the old table. The comment above the routing in `xg_xs.cpp` ("requires explicit 0x100..0x10a layout") has the same wording. Listing the seven layouts, or saying "the S, D and linear modes", would be exact. AI-assisted review.
Holastor commented 2026-12-01 22:02:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-12-01T22:02:02Z.


@JohnConnorNPC @MasterDomino @tedin7 @stan495 @R0Y00

Addressed the remaining review items in commit d923452e:

  • 4-byte _D contract (MUST 2): Aligned src/startup_stubs/gfx10_texture.h (PATTERN_D[2]) with main's src/startup_stubs/gfx10_layout.h (----x0x1y0y1y2x2) as the current working hypothesis. The coordinated update to GFX10.3 RbPlus x2y2 across both headers, pins, and docs is split out into follow-up draft PR #3787 once confirmed by the maintainer. Updated the corresponding pins in tests/startup_xg_gfx10_check.py and temporarily disabled the R32 64x64 1m 256B_D AddrLib comparison in tests/xg_swizzle_select_check.cpp until #3787 lands.
  • Mode list clarification (NIT 3): Replaced 0x100–0x10a with the exact supported list (0x100, 0x101, 0x102, 0x105, 0x106, 0x109, 0x10a — S, D, and linear modes) in docs/experiments.md and src/startup_stubs/xg_xs.cpp.

Verification on release (d923452e):

  • ctest --preset release --no-tests=error -R "^(startup_xg_.*|xg_.*|startup_gfx10_layout.*)$" -V: 20/20 passed
  • docs_links_check.py, bidi_controls_check.py, gfx10_texture_roundtrip_check.py: PASS
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7327171237 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1469#issuecomment-7327171237). Originally posted by [Holastor](https://github.com/Holastor) on 2026-12-01T22:02:02Z. --- @JohnConnorNPC @MasterDomino @tedin7 @stan495 @R0Y00 Addressed the remaining review items in commit `d923452e`: - **4-byte `_D` contract (MUST 2):** Aligned `src/startup_stubs/gfx10_texture.h` (`PATTERN_D[2]`) with `main`'s `src/startup_stubs/gfx10_layout.h` (`----x0x1y0y1y2x2`) as the current working hypothesis. The coordinated update to GFX10.3 RbPlus `x2y2` across both headers, pins, and docs is split out into follow-up draft PR #3787 once confirmed by the maintainer. Updated the corresponding pins in `tests/startup_xg_gfx10_check.py` and temporarily disabled the `R32 64x64 1m 256B_D` AddrLib comparison in `tests/xg_swizzle_select_check.cpp` until #3787 lands. - **Mode list clarification (NIT 3):** Replaced `0x100–0x10a` with the exact supported list (`0x100, 0x101, 0x102, 0x105, 0x106, 0x109, 0x10a` — S, D, and linear modes) in `docs/experiments.md` and `src/startup_stubs/xg_xs.cpp`. **Verification on `release` (`d923452e`):** - `ctest --preset release --no-tests=error -R "^(startup_xg_.*|xg_.*|startup_gfx10_layout.*)$" -V`: **20/20 passed** - `docs_links_check.py`, `bidi_controls_check.py`, `gfx10_texture_roundtrip_check.py`: **PASS**
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1469:upstream-pr/1469'
git switch 'upstream-pr/1469'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1469'
git switch 'upstream-pr/1469'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1469'
git switch 'upstream-pr/1469'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1469'
git switch 'main'
git merge --squash 'upstream-pr/1469'
git switch 'main'
git merge --ff-only 'upstream-pr/1469'
git switch 'main'
git merge 'upstream-pr/1469'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
R0Y00/Xbox2Windows!1462
No description provided.