startup: sample slot-70 textures of the non-XOR console layouts from their address #2008
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2015"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
0x105with partial last tiles (#1272, #2105), and the0x109BC5/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
Layoutis a non-XOR console swizzle mode:0x101,0x102,0x105,0x106,0x109or0x10a.src/startup_stubs/gfx10_layout.hholds 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 committools/fetch_addrlib.pypins,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.src/startup_stubs/address_texture.h, device-free).0x105BC3/BC7 surface and the0x109chains keep their own upstream paths. Layout0and0x100without a live texture stay refused, sostartup_address_srvruns unchanged in the default configuration, with its mismatched-width and interior-address refusals.x2w-d3d12 slot70 texture kind <n>: <outcome>; first seen res{...} view{...}line per new kind of call, andx2w-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/
0x100raw-rows path and theX2W_MEMORY_SRV_NARROWswitch. 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
mainat681d01f5: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_writeandbc7_mode6_multiblock_{warp,hardware}.startup_gfx10_layoutbc7_4k_s.h,bc64_chain.h,tile64_plan.h, round trips, 15 descriptions, 16 viewsstartup_gfx10_layout_display_control(WILL_FAIL)0x10aas0x109is detectedstartup_address_console_{warp,hardware}startup_address_console_gate_{warp,hardware}startup_address_console_gate_ring_{warp,hardware}(control)startup_address_{srv,bc_view,single_element,buffer_srv}_{warp,hardware},startup_xg_*,startup_bc7_4k_s*,startup_tile64_plan*,bc7_*Fail-first controls, each run on WARP and hardware with the other code unchanged:
gate_ringtests above.startup_address_console_gate_*fails with all 32,768 right-half pixels still showing payload 0.startup_address_console_*fails because the published texture still draws texels.startup_gfx10_layout_display_control, as above.Limits
_D) rows that differ from the standard ones (1-, 8- and 16-byte elements) are checked against the addrlib rows alone.docs/startup-runtime.mdnotes this.Prepared by Claude Opus 5.5.
🤖 Generated with Claude Code
https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
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.
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
mergeable=CONFLICTING.git merge-tree --write-tree origin/main HEADshows content conflicts insrc/startup_stubs/d3d12_draw.inlandsrc/startup_stubs/d3d12_memory_srv.inl.P2: display-mode patterns lack a second source
gfx10_layout.h:99-102hard-codes the standard and display bit patterns. The test compares them to pattern rows and tobc7_4k_s.h,bc64_chain.handtile64_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:21usesconstexpr UINT x = FLAG_A | FLAG_B | .... With MinGW-w64 headers the enumoperator|is notconstexpr, so this fails to compile there (MSVC and CI are fine). Casting each flag toUINTmakes it portable.tests/startup_address_console_check.pyrun without<consumer> <backend>arguments dies with aTypeErrorfromcheck()instead of a usage message.Checked
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.is_displayto always false ingfx10_layout.h. I could not build or runstartup_gfx10_layout_checkhere (no D3D12 headers on Linux; the MinGW build fails as noted above), so I did not observe the kill myself. The PR registersstartup_gfx10_layout_display_control(WILL_FAIL) for this mutation, and the Windows CI job passed. My edit was reverted.gfx2hlsl, and CI's Windows job already built and ran the new tests.Commands run locally:
gh pr view,gh pr checks,git diff --statand--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.
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 on96853add.Summary: All findings from the previous review are addressed. No P1 and no P2 left.
Previous findings, now
main(git merge-base --is-ancestor origin/main HEADtrue,git merge-tree --write-tree origin/main HEADexits 0,mergeable=MERGEABLE).gfx10_layout.h:101-105anddocs/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).constexprnit:address_texture.h:15-22casts each flag toUINT. The layout test now builds with MinGW-w64.tests/startup_address_console_check.pywithout arguments prints a usage line instead of aTypeError.Checks
/O2and 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).gfx10_layout.hI setis_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 withgit checkout -- ..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.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-25T05:18:22Z.
Thanks both. I rebased onto
mainat681d01f5and reworked the PR. The new head isf3455b08, with two commits: code and tests, then docs.R0Y00
X2W_MEMORY_SRV_NARROWare removed. Any upload or eviction policy will come as a separate PR.ExecuteCommandListsof 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,0x105BC3/BC7,0x109chains) keep their upstream ring path unchanged.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.0and0x100without a live texture are refused as before. The raw-rows path is gone rather than put behind a switch, sostartup_address_srv_*runs unchanged, with its mismatched-width and interior-address refusals, in the default configuration.docs/experiments.mdname AMD addrlib at thetools/fetch_addrlib.pypin (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." andSPDX-License-Identifier: MIT, checked against the files at that commit.tedin7
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 thestartup_address_bc_view126x128 refusal._Dpatterns:docs/startup-runtime.mdnow notes which rows have a second source and which do not. A comment at the tables ingfx10_layout.hsays the same. Only the 16-byte standard rows are compared with another implementation (bc7_4k_s.h,bc64_chain.h).tile64_plan.hchecks the0x10amip 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.address_texture.hnow casts each flag toUINTbefore the OR.tests/startup_address_console_check.pyrun 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:
startup_address_console_gate_*fails: all 32,768 right-half pixels still show payload 0.startup_address_console_*fails because the texture still draws texels.The
0x109chains 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):
xg_bc64_tiling_reference,xg_swizzle_*×4,bc7_mode6_multiblock_*×2^(startup_|xg_|gfx10_|bc7_)(423)startup_view_heap_warpandstartup_logical_view_warpstartup_address_console_{warp,hardware}startup_address_console_gate_{warp,hardware}/_gate_ring_*startup_gfx10_layout/_display_control(WILL_FAIL)Not run locally: the dev (Debug) and
prpresets. CI will run them.Prepared by Claude Opus 5.5.
🤖 Generated with Claude Code
https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
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 used96853addon a local integration; I will check the loading transition again on this revision before attributing that result to it.