startup: sample slot-70 textures of the non-XOR console layouts from their address #2008

Merged
Its3rr0rsWRLD merged 2 commits from upstream-pr/2015 into main 2026-11-25 05:24:28 +00:00
Its3rr0rsWRLD commented 2026-11-24 23:10:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-24T23:10:18Z.


Problem

Device slot 70 publishes a texture by address: a resource description, a view and the address of the texels, with no resource object. Slot 70 read a few shapes from the address: the single texel (#2157), single-mip BC3/BC7 at layout 0x105 with partial last tiles (#1272, #2105), and the 0x109 BC5/BC7 chains (#1318). For anything else it needed a live resource with the same description at that address. Every other description is refused, the destination descriptor stays as it was, and the translated draw samples a null view.

What changes

This PR changes only the layout and sampling. When no live resource matches, slot 70 now also reads a two-dimensional, single-sample, sampled-only texture whose format has a known element size (8- to 128-bit texels, BC1 to BC7 in whole 4x4 blocks) and whose Layout is a non-XOR console swizzle mode: 0x101, 0x102, 0x105, 0x106, 0x109 or 0x10a.

  • Layout: src/startup_stubs/gfx10_layout.h holds the address equations, block sizes and mip-tail rules after AMD addrlib as Mesa carries it (src/amd/addrlib, at the Mesa 25.1.0 commit tools/fetch_addrlib.py pins, 5c142e46f3f6e752ed745fd48912ebb8fad67145; MIT). The header and both fixtures name the three files and keep their notice. No addrlib code is included. A translated draw copies each mip of each array slice from the console layout into desktop footprint rows. A 256 B layout is taken with one mip only.
  • Views: 2D or 2D-array views, in a format of the same typeless family, whose mip and slice ranges stay inside the texture (src/startup_stubs/address_texture.h, device-free).
  • Unchanged paths: the single texel, the 0x105 BC3/BC7 surface and the 0x109 chains keep their own upstream paths. Layout 0 and 0x100 without a live texture stay refused, so startup_address_srv runs unchanged in the default configuration, with its mismatched-width and interior-address refusals.
  • Upload lifetime (only for the new textures): every upload of a console-layout texture gets its own upload buffer instead of a slice of the shared ring. The recording, and each submit of it, keeps that buffer and the texture referenced until a fence signalled behind that submit on the consuming queue has completed. This is the same mechanism the draw sampler heaps already use. The desktop texture is never released, so no retirement is involved.
  • Held, as for partial-tile BC views (#2105): nothing is published when the latest XG stand-in copy to the address wrote desktop-footprint rows. An already-published texture there then samples the null view. Nothing is published either when the layout runs past the size the XG stand-in reports for the description.
  • Repeated publication: a repeated slot 70 call for a texture this path published announces a write, so changed texels are uploaded again.
  • Log lines: one x2w-d3d12 slot70 texture kind <n>: <outcome>; first seen res{...} view{...} line per new kind of call, and x2w-draw by-address uploads: <n> submits completed and released (...).

Left out on purpose: the earlier per-frame upload budget, eviction and refresh policy, the layout-0/0x100 raw-rows path and the X2W_MEMORY_SRV_NARROW switch. Any policy will come as a separate PR with its own lifetime checks.

Evidence

Release preset, Windows 11 build 26300, WARP 10.0.26100.9818 and NVIDIA GeForce RTX 4070 Ti (driver 32.0.16.1088), on main at 681d01f5:

cmake --preset release
cmake --build --preset release
ctest --test-dir out/build/release --no-tests=error -j 2 --output-on-failure -R '^(startup_address_|startup_gfx10_layout|startup_xg_|xg_|startup_tile64|gfx10_texture_roundtrip|startup_bc7|bc7_)'
ctest --test-dir out/build/release --no-tests=error -j 4 --output-on-failure -R '^(startup_|xg_|gfx10_|bc7_)'

Focused set: 44 tests, all passed apart from capability skips. Broad set: 423 tests, 0 failed. The only skips are capability skips that return 77: startup_view_heap_warp, startup_logical_view_warp, xg_bc64_tiling_reference, xg_swizzle_select, xg_swizzle_select_mutation, xg_swizzle_factory, xg_swizzle_factory_no_write and bc7_mode6_multiblock_{warp,hardware}.

Test Result
startup_gfx10_layout pass: 30 addrlib equations, agreement with bc7_4k_s.h, bc64_chain.h, tile64_plan.h, round trips, 15 descriptions, 16 views
startup_gfx10_layout_display_control (WILL_FAIL) pass: reading 0x10a as 0x109 is detected
startup_address_console_{warp,hardware} pass: 7 textures with every one of the 65,536 pixels exact; 2 held descriptions; 1 texture held after a later XG row copy
startup_address_console_gate_{warp,hardware} pass: 18 submits held behind a fixture fence, 16 MiB payloads at one address; left half payload 0 and right half payload 17 exact; 18 retained submits released
startup_address_console_gate_ring_{warp,hardware} (control) pass: with the uploads taken from the shared ring, all 32,768 left pixels lose payload 0
startup_address_{srv,bc_view,single_element,buffer_srv}_{warp,hardware}, startup_xg_*, startup_bc7_4k_s*, startup_tile64_plan*, bc7_* pass

Fail-first controls, each run on WARP and hardware with the other code unchanged:

  • Uploads from the shared ring instead of retained buffers: the gate_ring tests above.
  • Dropping the repeated-publication announcement: startup_address_console_gate_* fails with all 32,768 right-half pixels still showing payload 0.
  • Dropping the later-XG-rows check: startup_address_console_* fails because the published texture still draws texels.
  • startup_gfx10_layout_display_control, as above.

Limits

  • Still refused: the XOR modes and every other layout value, three-dimensional textures, cube views, multisampled textures, textures with a target, depth or UAV flag, formats without a known element size, and textures over 64 MiB.
  • The equations are checked against addrlib's rows and the three existing layout headers, not against console memory. Only the 16-byte standard rows have a second implementation in the tree. The display (_D) rows that differ from the standard ones (1-, 8- and 16-byte elements) are checked against the addrlib rows alone. docs/startup-runtime.md notes this.
  • No bound on upload bytes per frame and no release of unsampled textures (see above).

Prepared by Claude Opus 5.5.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593270682 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2015). Originally posted by [Its3rr0rsWRLD](https://github.com/Its3rr0rsWRLD) on 2026-11-24T23:10:18Z. --- ## Problem Device slot 70 publishes a texture by address: a resource description, a view and the address of the texels, with no resource object. Slot 70 read a few shapes from the address: the single texel (#2157), single-mip BC3/BC7 at layout `0x105` with partial last tiles (#1272, #2105), and the `0x109` BC5/BC7 chains (#1318). For anything else it needed a live resource with the same description at that address. Every other description is refused, the destination descriptor stays as it was, and the translated draw samples a null view. ## What changes This PR changes only the layout and sampling. When no live resource matches, slot 70 now also reads a two-dimensional, single-sample, sampled-only texture whose format has a known element size (8- to 128-bit texels, BC1 to BC7 in whole 4x4 blocks) and whose `Layout` is a non-XOR console swizzle mode: `0x101`, `0x102`, `0x105`, `0x106`, `0x109` or `0x10a`. - **Layout**: `src/startup_stubs/gfx10_layout.h` holds the address equations, block sizes and mip-tail rules after AMD addrlib as Mesa carries it (`src/amd/addrlib`, at the Mesa 25.1.0 commit `tools/fetch_addrlib.py` pins, `5c142e46f3f6e752ed745fd48912ebb8fad67145`; MIT). The header and both fixtures name the three files and keep their notice. No addrlib code is included. A translated draw copies each mip of each array slice from the console layout into desktop footprint rows. A 256 B layout is taken with one mip only. - **Views**: 2D or 2D-array views, in a format of the same typeless family, whose mip and slice ranges stay inside the texture (`src/startup_stubs/address_texture.h`, device-free). - **Unchanged paths**: the single texel, the `0x105` BC3/BC7 surface and the `0x109` chains keep their own upstream paths. Layout `0` and `0x100` without a live texture stay refused, so `startup_address_srv` runs unchanged in the default configuration, with its mismatched-width and interior-address refusals. - **Upload lifetime (only for the new textures)**: every upload of a console-layout texture gets its own upload buffer instead of a slice of the shared ring. The recording, and each submit of it, keeps that buffer and the texture referenced until a fence signalled behind that submit on the consuming queue has completed. This is the same mechanism the draw sampler heaps already use. The desktop texture is never released, so no retirement is involved. - **Held**, as for partial-tile BC views (#2105): nothing is published when the latest XG stand-in copy to the address wrote desktop-footprint rows. An already-published texture there then samples the null view. Nothing is published either when the layout runs past the size the XG stand-in reports for the description. - **Repeated publication**: a repeated slot 70 call for a texture this path published announces a write, so changed texels are uploaded again. - **Log lines**: one `x2w-d3d12 slot70 texture kind <n>: <outcome>; first seen res{...} view{...}` line per new kind of call, and `x2w-draw by-address uploads: <n> submits completed and released (...)`. Left out on purpose: the earlier per-frame upload budget, eviction and refresh policy, the layout-0/`0x100` raw-rows path and the `X2W_MEMORY_SRV_NARROW` switch. Any policy will come as a separate PR with its own lifetime checks. ## Evidence Release preset, Windows 11 build 26300, WARP 10.0.26100.9818 and NVIDIA GeForce RTX 4070 Ti (driver 32.0.16.1088), on `main` at `681d01f5`: ```powershell cmake --preset release cmake --build --preset release ctest --test-dir out/build/release --no-tests=error -j 2 --output-on-failure -R '^(startup_address_|startup_gfx10_layout|startup_xg_|xg_|startup_tile64|gfx10_texture_roundtrip|startup_bc7|bc7_)' ctest --test-dir out/build/release --no-tests=error -j 4 --output-on-failure -R '^(startup_|xg_|gfx10_|bc7_)' ``` Focused set: 44 tests, all passed apart from capability skips. Broad set: 423 tests, 0 failed. The only skips are capability skips that return 77: `startup_view_heap_warp`, `startup_logical_view_warp`, `xg_bc64_tiling_reference`, `xg_swizzle_select`, `xg_swizzle_select_mutation`, `xg_swizzle_factory`, `xg_swizzle_factory_no_write` and `bc7_mode6_multiblock_{warp,hardware}`. | Test | Result | |---|---| | `startup_gfx10_layout` | pass: 30 addrlib equations, agreement with `bc7_4k_s.h`, `bc64_chain.h`, `tile64_plan.h`, round trips, 15 descriptions, 16 views | | `startup_gfx10_layout_display_control` (`WILL_FAIL`) | pass: reading `0x10a` as `0x109` is detected | | `startup_address_console_{warp,hardware}` | pass: 7 textures with every one of the 65,536 pixels exact; 2 held descriptions; 1 texture held after a later XG row copy | | `startup_address_console_gate_{warp,hardware}` | pass: 18 submits held behind a fixture fence, 16 MiB payloads at one address; left half payload 0 and right half payload 17 exact; 18 retained submits released | | `startup_address_console_gate_ring_{warp,hardware}` (control) | pass: with the uploads taken from the shared ring, all 32,768 left pixels lose payload 0 | | `startup_address_{srv,bc_view,single_element,buffer_srv}_{warp,hardware}`, `startup_xg_*`, `startup_bc7_4k_s*`, `startup_tile64_plan*`, `bc7_*` | pass | **Fail-first controls**, each run on WARP and hardware with the other code unchanged: - Uploads from the shared ring instead of retained buffers: the `gate_ring` tests above. - Dropping the repeated-publication announcement: `startup_address_console_gate_*` fails with all 32,768 right-half pixels still showing payload 0. - Dropping the later-XG-rows check: `startup_address_console_*` fails because the published texture still draws texels. - `startup_gfx10_layout_display_control`, as above. ## Limits - Still refused: the XOR modes and every other layout value, three-dimensional textures, cube views, multisampled textures, textures with a target, depth or UAV flag, formats without a known element size, and textures over 64 MiB. - The equations are checked against addrlib's rows and the three existing layout headers, not against console memory. Only the 16-byte standard rows have a second implementation in the tree. The display (`_D`) rows that differ from the standard ones (1-, 8- and 16-byte elements) are checked against the addrlib rows alone. `docs/startup-runtime.md` notes this. - No bound on upload bytes per frame and no release of unsampled textures (see above). Prepared by Claude Opus 5.5. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
R0Y00 commented 2026-11-25 00:04:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T23:39:28Z.

Review: CHANGES_REQUESTED


The seven source-built draws are a useful basis for the non-XOR layout change. The new upload and eviction policy needs a separate lifetime check before it can ship. The 96 MiB cap counts source bytes per Present, while the ring reserves padded copy footprints and is also used by other paths. A queue blocked behind a fence can keep reading a slice after several Presents. The same condition can keep a texture alive past the 30-frame retirement grace period. Neither counter establishes that the backing is safe to overwrite or release.

Please split the layout change from the new eviction and refresh policy. For the new upload path, retain upload ranges and recorded textures through the consuming queue’s completed fence. Add a source-built control that gates the queue, records distinct payloads across ring reuse or texture retirement, then reads back both payloads after release. Keep the old mismatched-width and interior-address checks under the default configuration, or put layout-0 raw rows behind an explicit opt-in until the caller’s extent and layout can be validated. Also keep the spelling, revision and license of the Addrlib reference with the fixture.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6049183996 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2015#pullrequestreview-6049183996). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T23:39:28Z. **Review:** CHANGES_REQUESTED --- The seven source-built draws are a useful basis for the non-XOR layout change. The new upload and eviction policy needs a separate lifetime check before it can ship. The 96 MiB cap counts source bytes per Present, while the ring reserves padded copy footprints and is also used by other paths. A queue blocked behind a fence can keep reading a slice after several Presents. The same condition can keep a texture alive past the 30-frame retirement grace period. Neither counter establishes that the backing is safe to overwrite or release. Please split the layout change from the new eviction and refresh policy. For the new upload path, retain upload ranges and recorded textures through the consuming queue’s completed fence. Add a source-built control that gates the queue, records distinct payloads across ring reuse or texture retirement, then reads back both payloads after release. Keep the old mismatched-width and interior-address checks under the default configuration, or put layout-0 raw rows behind an explicit opt-in until the caller’s extent and layout can be validated. Also keep the spelling, revision and license of the Addrlib reference with the fixture.
tedin7 commented 2026-11-25 03:00:49 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of head 96853add72146b985cb5c9292d2c9830186a3750 (comment only, not an approval).

Summary: The layout equations, mip-tail handling and slot-70 routing read as consistent with the cited addrlib rules, and the CI jobs pass. One blocker: the branch no longer merges into current main.

P2 (blocks merge): merge conflicts

  • GitHub reports mergeable=CONFLICTING. git merge-tree --write-tree origin/main HEAD shows content conflicts in src/startup_stubs/d3d12_draw.inl and src/startup_stubs/d3d12_memory_srv.inl.
  • Both files hold the main behavior change (slot-70 routing, upload and detile path), so CI on this head does not show how the rebased result behaves. Please rebase and re-run the Windows jobs.

P2: display-mode patterns lack a second source

  • gfx10_layout.h:99-102 hard-codes the standard and display bit patterns. The test compares them to pattern rows and to bc7_4k_s.h, bc64_chain.h and tile64_plan.h, but display (_D) modes for element sizes 1, 2 and 8 B have no second source in the tree. A docs note on which rows are checked only against the AMD source text would help readers.

Nit

  • address_texture.h:21 uses constexpr UINT x = FLAG_A | FLAG_B | .... With MinGW-w64 headers the enum operator| is not constexpr, so this fails to compile there (MSVC and CI are fine). Casting each flag to UINT makes it portable.
  • tests/startup_address_console_check.py run without <consumer> <backend> arguments dies with a TypeError from check() instead of a usage message.

Checked

  • Title is neutral. The addrlib-derived rules carry the AMD/MIT notice. Nothing game-specific found.
  • git diff --check origin/main...HEAD: clean.
  • python3 tests/docs_links_check.py: self-test passed, 18 Markdown files, 389 links.
  • python3 tests/bidi_controls_check.py: self-test passed, 1393 files, no bidirectional controls.
  • gh pr checks 2015: Linux Python checks, gfx1013 fixtures and Windows build/test pass; the /O2 job and chart publish were skipped.
  • Mutation: I set is_display to always false in gfx10_layout.h. I could not build or run startup_gfx10_layout_check here (no D3D12 headers on Linux; the MinGW build fails as noted above), so I did not observe the kill myself. The PR registers startup_gfx10_layout_display_control (WILL_FAIL) for this mutation, and the Windows CI job passed. My edit was reverted.
  • No Win2025 WARP run: the change is C++ startup stubs, not gfx2hlsl, and CI's Windows job already built and ran the new tests.

Commands run locally: gh pr view, gh pr checks, git diff --stat and --check origin/main...HEAD, git merge-tree --write-tree origin/main HEAD, python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, python3 -B tests/startup_address_console_check.py (TypeError without args), x86_64-w64-mingw32-g++ -fpermissive ... startup_gfx10_layout_check.cpp (failed to build).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051150516 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2015#pullrequestreview-6051150516). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T02:54:00Z. **Review:** COMMENTED --- Review of head `96853add72146b985cb5c9292d2c9830186a3750` (comment only, not an approval). **Summary:** The layout equations, mip-tail handling and slot-70 routing read as consistent with the cited addrlib rules, and the CI jobs pass. One blocker: the branch no longer merges into current `main`. **P2 (blocks merge): merge conflicts** - GitHub reports `mergeable=CONFLICTING`. `git merge-tree --write-tree origin/main HEAD` shows content conflicts in `src/startup_stubs/d3d12_draw.inl` and `src/startup_stubs/d3d12_memory_srv.inl`. - Both files hold the main behavior change (slot-70 routing, upload and detile path), so CI on this head does not show how the rebased result behaves. Please rebase and re-run the Windows jobs. **P2: display-mode patterns lack a second source** - `gfx10_layout.h:99-102` hard-codes the standard and display bit patterns. The test compares them to pattern rows and to `bc7_4k_s.h`, `bc64_chain.h` and `tile64_plan.h`, but display (`_D`) modes for element sizes 1, 2 and 8 B have no second source in the tree. A docs note on which rows are checked only against the AMD source text would help readers. **Nit** - `address_texture.h:21` uses `constexpr UINT x = FLAG_A | FLAG_B | ...`. With MinGW-w64 headers the enum `operator|` is not `constexpr`, so this fails to compile there (MSVC and CI are fine). Casting each flag to `UINT` makes it portable. - `tests/startup_address_console_check.py` run without `<consumer> <backend>` arguments dies with a `TypeError` from `check()` instead of a usage message. **Checked** - Title is neutral. The addrlib-derived rules carry the AMD/MIT notice. Nothing game-specific found. - `git diff --check origin/main...HEAD`: clean. - `python3 tests/docs_links_check.py`: self-test passed, 18 Markdown files, 389 links. - `python3 tests/bidi_controls_check.py`: self-test passed, 1393 files, no bidirectional controls. - `gh pr checks 2015`: Linux Python checks, gfx1013 fixtures and Windows build/test pass; the /O2 job and chart publish were skipped. - Mutation: I set `is_display` to always false in `gfx10_layout.h`. I could not build or run `startup_gfx10_layout_check` here (no D3D12 headers on Linux; the MinGW build fails as noted above), so I did not observe the kill myself. The PR registers `startup_gfx10_layout_display_control` (WILL_FAIL) for this mutation, and the Windows CI job passed. My edit was reverted. - No Win2025 WARP run: the change is C++ startup stubs, not `gfx2hlsl`, and CI's Windows job already built and ran the new tests. Commands run locally: `gh pr view`, `gh pr checks`, `git diff --stat` and `--check origin/main...HEAD`, `git merge-tree --write-tree origin/main HEAD`, `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py`, `python3 -B tests/startup_address_console_check.py` (TypeError without args), `x86_64-w64-mingw32-g++ -fpermissive ... startup_gfx10_layout_check.cpp` (failed to build). AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 06:01:09 +00:00
tedin7 commented 2026-11-25 06:01:09 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Re-review of head f3455b08f439b5a87bcaf809b7cc95b506d807df (comment only, not an approval). Previous review was on 96853add.

Summary: All findings from the previous review are addressed. No P1 and no P2 left.

Previous findings, now

  • Merge conflict (was P2): the branch is rebased on current main (git merge-base --is-ancestor origin/main HEAD true, git merge-tree --write-tree origin/main HEAD exits 0, mergeable=MERGEABLE).
  • Display rows without a second source (was P2): gfx10_layout.h:101-105 and docs/startup-runtime.md ("Second sources for the address equations") now say which rows are checked only against the addrlib text (display rows for 1, 8 and 16 B).
  • MinGW constexpr nit: address_texture.h:15-22 casts each flag to UINT. The layout test now builds with MinGW-w64.
  • Usage nit: tests/startup_address_console_check.py without arguments prints a usage line instead of a TypeError.

Checks

  • CI on this head: Linux Python checks, gfx1013 fixtures and Windows build/test pass; /O2 and chart publish skipped.
  • git diff --check origin/main...HEAD: clean.
  • python3 tests/docs_links_check.py: self-test passed, 18 files, 406 links.
  • python3 tests/bidi_controls_check.py: self-test passed, 1487 files, no bidirectional controls.
  • x86_64-w64-mingw32-g++ -std=c++17 -static -Isrc -Iinclude tests/startup_gfx10_layout_check.cpp, run under wine: startup_gfx10_layout: PASS (30 equations, 5 4 KiB surfaces, 8 64 KiB chains, 10 tile plans, 9 round trips, 11 refusals, 12 address descriptions, 16 views).
  • Mutation: in gfx10_layout.h I set is_display = false. The same test then fails: FAIL layout 266 element 16 Y1: 32, expected bit 7, 30 FAILED, exit 1. The mutation is killed. Reverted with git checkout -- ..
  • No Win2025 WARP run: this is C++ startup stubs, not gfx2hlsl, and the Windows CI job already ran the new tests.

Findings: P1=0, P2=0, no new nits.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052242997 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2015#pullrequestreview-6052242997). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T05:21:23Z. **Review:** COMMENTED --- Re-review of head `f3455b08f439b5a87bcaf809b7cc95b506d807df` (comment only, not an approval). Previous review was on `96853add`. **Summary:** All findings from the previous review are addressed. No P1 and no P2 left. **Previous findings, now** - Merge conflict (was P2): the branch is rebased on current `main` (`git merge-base --is-ancestor origin/main HEAD` true, `git merge-tree --write-tree origin/main HEAD` exits 0, `mergeable=MERGEABLE`). - Display rows without a second source (was P2): `gfx10_layout.h:101-105` and `docs/startup-runtime.md` ("Second sources for the address equations") now say which rows are checked only against the addrlib text (display rows for 1, 8 and 16 B). - MinGW `constexpr` nit: `address_texture.h:15-22` casts each flag to `UINT`. The layout test now builds with MinGW-w64. - Usage nit: `tests/startup_address_console_check.py` without arguments prints a usage line instead of a `TypeError`. **Checks** - CI on this head: Linux Python checks, gfx1013 fixtures and Windows build/test pass; `/O2` and chart publish skipped. - `git diff --check origin/main...HEAD`: clean. - `python3 tests/docs_links_check.py`: self-test passed, 18 files, 406 links. - `python3 tests/bidi_controls_check.py`: self-test passed, 1487 files, no bidirectional controls. - `x86_64-w64-mingw32-g++ -std=c++17 -static -Isrc -Iinclude tests/startup_gfx10_layout_check.cpp`, run under wine: `startup_gfx10_layout: PASS (30 equations, 5 4 KiB surfaces, 8 64 KiB chains, 10 tile plans, 9 round trips, 11 refusals, 12 address descriptions, 16 views)`. - Mutation: in `gfx10_layout.h` I set `is_display = false`. The same test then fails: `FAIL layout 266 element 16 Y1: 32, expected bit 7`, `30 FAILED`, exit 1. The mutation is killed. Reverted with `git checkout -- .`. - No Win2025 WARP run: this is C++ startup stubs, not `gfx2hlsl`, and the Windows CI job already ran the new tests. **Findings:** P1=0, P2=0, no new nits. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-25 06:01:09 +00:00 (Migrated from github.com)

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

Review: APPROVED


Re-reviewed f3455b08. The new console-layout path owns its upload and texture through recording and each consuming queue's completion fence. The shared-ring and frame-count lifetime policy from the prior head is gone. The existing single-texel, narrow BC and mismatched/interior-view tests were retained.

Independent Windows Release run: 12/12, zero skips, using startup_address_console, startup_address_srv, startup_address_bc_view and startup_gfx10_layout. WARP and RTX 4060 Laptop each held 18 submissions behind the gate, then matched all 65,536 pixels and released 18 retained uploads. Both old-ring controls caught the overwritten first payload. This is a source-built validation of the new head. The saved-profile loading artwork reported in #870 was a separate local integration.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052259081 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2015#pullrequestreview-6052259081). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T05:23:32Z. **Review:** APPROVED --- Re-reviewed f3455b08. The new console-layout path owns its upload and texture through recording and each consuming queue's completion fence. The shared-ring and frame-count lifetime policy from the prior head is gone. The existing single-texel, narrow BC and mismatched/interior-view tests were retained. Independent Windows Release run: 12/12, zero skips, using startup_address_console, startup_address_srv, startup_address_bc_view and startup_gfx10_layout. WARP and RTX 4060 Laptop each held 18 submissions behind the gate, then matched all 65,536 pixels and released 18 retained uploads. Both old-ring controls caught the overwritten first payload. This is a source-built validation of the new head. The saved-profile loading artwork reported in #870 was a separate local integration.
Its3rr0rsWRLD commented 2026-11-25 06:01:36 +00:00 (Migrated from github.com)

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


Thanks both. I rebased onto main at 681d01f5 and reworked the PR. The new head is f3455b08, with two commits: code and tests, then docs.

R0Y00

  1. Split: the PR is now the layout and sampling change only. The 96 MiB-per-Present budget, the 30/900-frame retirement, the 15-frame refresh and X2W_MEMORY_SRV_NARROW are removed. Any upload or eviction policy will come as a separate PR.
  2. Lifetime: each upload of a console-layout texture now gets its own upload buffer instead of a slice of the shared ring. The recording, and each ExecuteCommandLists of it, holds that buffer and the texture until a fence signalled behind that submit on the consuming queue has completed, the same way the draw sampler heaps are held. The desktop texture is never released, so there is no retirement path. The shapes slot 70 already read (single texel, 0x105 BC3/BC7, 0x109 chains) keep their upstream ring path unchanged.
  3. Control: startup_address_console_gate_{warp,hardware} makes the queue wait on a fence the fixture holds. It then records and submits 18 lists, each republishing a 16 MiB texture at one address with a new payload. That is more than the 256 MiB ring. Nothing may complete before the fixture signals the fence. After that, the left half must hold payload 0, the right half payload 17, and 18 retained submits must be released. ..._gate_ring_* runs the same draws with the uploads taken from the shared ring and must lose payload 0. It does: 32,768 of 32,768 left pixels are wrong.
  4. Old checks: layout 0 and 0x100 without a live texture are refused as before. The raw-rows path is gone rather than put behind a switch, so startup_address_srv_* runs unchanged, with its mismatched-width and interior-address refusals, in the default configuration.
  5. Addrlib: the header, both fixtures and docs/experiments.md name AMD addrlib at the tools/fetch_addrlib.py pin (Mesa 25.1.0, 5c142e46f3f6e752ed745fd48912ebb8fad67145) and the three files. They carry the notice verbatim: "Copyright (C) 2007-2024 Advanced Micro Devices, Inc. All rights reserved." and SPDX-License-Identifier: MIT, checked against the files at that commit.

tedin7

  • Rebase: done. Where this PR overlapped merged work, upstream's behaviour wins. #2157 single texels and #2105 partial-tile BC views keep their paths, and the console path follows #2105's rules. Nothing is published when the latest XG copy wrote rows (console_layout_xg_rows), and an already-published texture then samples the null view. Nothing is published when the layout runs past the XG-reported size. BC console descriptions also need whole 4x4 blocks, which keeps the startup_address_bc_view 126x128 refusal.
  • _D patterns: docs/startup-runtime.md now notes which rows have a second source and which do not. A comment at the tables in gfx10_layout.h says the same. Only the 16-byte standard rows are compared with another implementation (bc7_4k_s.h, bc64_chain.h). tile64_plan.h checks the 0x10a mip starts and tail only. The display rows that differ from the standard ones (1-, 8- and 16-byte elements) are checked against the restated addrlib rows alone.
  • MinGW nit: address_texture.h now casts each flag to UINT before the OR.
  • Usage nit: tests/startup_address_console_check.py run with no arguments, or with a bad mode, now prints a usage message and exits 1.

The other fixes from the earlier rework, both with fail-first checks:

  • A repeated slot 70 call for a texture already published here announces a write, so changed texels are uploaded again. With that removed, startup_address_console_gate_* fails: all 32,768 right-half pixels still show payload 0.
  • An XG row copy after publication makes the texture sample the null view. With that removed, the new last case of startup_address_console_* fails because the texture still draws texels.

The 0x109 chains that XG writes in console layout never reach the console path or its rows check, because they keep their own path.

Tests (release, Windows 11 26300, WARP 10.0.26100.9818 and RTX 4070 Ti 32.0.16.1088):

cmake --preset release; cmake --build --preset release
ctest --test-dir out/build/release --no-tests=error -j 2 --output-on-failure -R '^(startup_address_|startup_gfx10_layout|startup_xg_|xg_|startup_tile64|gfx10_texture_roundtrip|startup_bc7|bc7_)'
ctest --test-dir out/build/release --no-tests=error -j 4 --output-on-failure -R '^(startup_|xg_|gfx10_|bc7_)'
Run Result
focused set (44) all pass; capability skips (77) only: xg_bc64_tiling_reference, xg_swizzle_* ×4, bc7_mode6_multiblock_* ×2
^(startup_|xg_|gfx10_|bc7_) (423) 0 failed; the same skips plus startup_view_heap_warp and startup_logical_view_warp
startup_address_console_{warp,hardware} 7 textures, every one of the 65,536 pixels exact; 2 held; 1 held after a later XG row copy
startup_address_console_gate_{warp,hardware} / _gate_ring_* pass / control loses payload 0 as required
startup_gfx10_layout / _display_control (WILL_FAIL) pass / mutation detected

Not run locally: the dev (Debug) and pr presets. CI will run them.

Prepared by Claude Opus 5.5.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7153643382 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2015#issuecomment-7153643382). Originally posted by [Its3rr0rsWRLD](https://github.com/Its3rr0rsWRLD) on 2026-11-25T05:18:22Z. --- Thanks both. I rebased onto `main` at `681d01f5` and reworked the PR. The new head is `f3455b08`, with two commits: code and tests, then docs. **R0Y00** 1. *Split*: the PR is now the layout and sampling change only. The 96 MiB-per-Present budget, the 30/900-frame retirement, the 15-frame refresh and `X2W_MEMORY_SRV_NARROW` are removed. Any upload or eviction policy will come as a separate PR. 2. *Lifetime*: each upload of a console-layout texture now gets its own upload buffer instead of a slice of the shared ring. The recording, and each `ExecuteCommandLists` of it, holds that buffer and the texture until a fence signalled behind that submit on the consuming queue has completed, the same way the draw sampler heaps are held. The desktop texture is never released, so there is no retirement path. The shapes slot 70 already read (single texel, `0x105` BC3/BC7, `0x109` chains) keep their upstream ring path unchanged. 3. *Control*: `startup_address_console_gate_{warp,hardware}` makes the queue wait on a fence the fixture holds. It then records and submits 18 lists, each republishing a 16 MiB texture at one address with a new payload. That is more than the 256 MiB ring. Nothing may complete before the fixture signals the fence. After that, the left half must hold payload 0, the right half payload 17, and 18 retained submits must be released. `..._gate_ring_*` runs the same draws with the uploads taken from the shared ring and must lose payload 0. It does: 32,768 of 32,768 left pixels are wrong. 4. *Old checks*: layout `0` and `0x100` without a live texture are refused as before. The raw-rows path is gone rather than put behind a switch, so `startup_address_srv_*` runs unchanged, with its mismatched-width and interior-address refusals, in the default configuration. 5. *Addrlib*: the header, both fixtures and `docs/experiments.md` name AMD addrlib at the `tools/fetch_addrlib.py` pin (Mesa 25.1.0, `5c142e46f3f6e752ed745fd48912ebb8fad67145`) and the three files. They carry the notice verbatim: "Copyright (C) 2007-2024 Advanced Micro Devices, Inc. All rights reserved." and `SPDX-License-Identifier: MIT`, checked against the files at that commit. **tedin7** - *Rebase*: done. Where this PR overlapped merged work, upstream's behaviour wins. #2157 single texels and #2105 partial-tile BC views keep their paths, and the console path follows #2105's rules. Nothing is published when the *latest* XG copy wrote rows (`console_layout_xg_rows`), and an already-published texture then samples the null view. Nothing is published when the layout runs past the XG-reported size. BC console descriptions also need whole 4x4 blocks, which keeps the `startup_address_bc_view` 126x128 refusal. - *`_D` patterns*: `docs/startup-runtime.md` now notes which rows have a second source and which do not. A comment at the tables in `gfx10_layout.h` says the same. Only the 16-byte standard rows are compared with another implementation (`bc7_4k_s.h`, `bc64_chain.h`). `tile64_plan.h` checks the `0x10a` mip starts and tail only. The display rows that differ from the standard ones (1-, 8- and 16-byte elements) are checked against the restated addrlib rows alone. - *MinGW nit*: `address_texture.h` now casts each flag to `UINT` before the OR. - *Usage nit*: `tests/startup_address_console_check.py` run with no arguments, or with a bad mode, now prints a usage message and exits 1. The other fixes from the earlier rework, both with fail-first checks: - A repeated slot 70 call for a texture already published here announces a write, so changed texels are uploaded again. With that removed, `startup_address_console_gate_*` fails: all 32,768 right-half pixels still show payload 0. - An XG row copy after publication makes the texture sample the null view. With that removed, the new last case of `startup_address_console_*` fails because the texture still draws texels. The `0x109` chains that XG writes in console layout never reach the console path or its rows check, because they keep their own path. **Tests** (release, Windows 11 26300, WARP 10.0.26100.9818 and RTX 4070 Ti 32.0.16.1088): ```powershell cmake --preset release; cmake --build --preset release ctest --test-dir out/build/release --no-tests=error -j 2 --output-on-failure -R '^(startup_address_|startup_gfx10_layout|startup_xg_|xg_|startup_tile64|gfx10_texture_roundtrip|startup_bc7|bc7_)' ctest --test-dir out/build/release --no-tests=error -j 4 --output-on-failure -R '^(startup_|xg_|gfx10_|bc7_)' ``` | Run | Result | |---|---| | focused set (44) | all pass; capability skips (77) only: `xg_bc64_tiling_reference`, `xg_swizzle_*` ×4, `bc7_mode6_multiblock_*` ×2 | | `^(startup_\|xg_\|gfx10_\|bc7_)` (423) | 0 failed; the same skips plus `startup_view_heap_warp` and `startup_logical_view_warp` | | `startup_address_console_{warp,hardware}` | 7 textures, every one of the 65,536 pixels exact; 2 held; 1 held after a later XG row copy | | `startup_address_console_gate_{warp,hardware}` / `_gate_ring_*` | pass / control loses payload 0 as required | | `startup_gfx10_layout` / `_display_control` (`WILL_FAIL`) | pass / mutation detected | Not run locally: the dev (Debug) and `pr` presets. CI will run them. Prepared by Claude Opus 5.5. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
R0Y00 commented 2026-11-25 06:01:36 +00:00 (Migrated from github.com)

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


Thanks for the updated f3455b08. I have picked up this revision for integration and am testing its console-only path, XG extent checks, delayed-queue readback and ring-reuse control on WARP and hardware. The earlier artwork comparison in #870 used 96853add on a local integration; I will check the loading transition again on this revision before attributing that result to it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7153727043 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2015#issuecomment-7153727043). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T05:23:39Z. --- Thanks for the updated f3455b08. I have picked up this revision for integration and am testing its console-only path, XG extent checks, delayed-queue readback and ring-reuse control on WARP and hardware. The earlier artwork comparison in #870 used 96853add on a local integration; I will check the loading transition again on this revision before attributing that result to it.
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!2008
No description provided.