Repository navigation
startup: sample slot-70 textures of the non-XOR console layouts from their address - #2015
Conversation
R0Y00
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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 HEADshows content conflicts insrc/startup_stubs/d3d12_draw.inlandsrc/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-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
- 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_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. - 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.
…their address Device slot 70 publishes a texture by address: a resource description, a view and the address of the texels, with no resource object. It read a few shapes from the address (the single texel, single-mip BC3/BC7 at layout 0x105 with partial last tiles, and the 0x109 BC chains) and otherwise needed a live resource with that description at the address. Every other description was refused, which leaves the title's descriptor as it was and the draw sampling nothing. When no live resource matches, it now also reads a two-dimensional, single-sample, sampled-only texture whose format has a known element size (block-compressed formats in whole 4x4 blocks) and whose Layout names a console swizzle mode 0x101, 0x102, 0x105, 0x106, 0x109 or 0x10a, in that console layout, mip chains and array slices included (gfx10_layout.h). Views may name a format of the same typeless family, a mip range or an array range. The shapes slot 70 already read keep their own paths unchanged. Layout 0 and the linear mode 0x100 without a live texture stay refused, as do three-dimensional and cube views, multisampled textures and the XOR swizzle modes: startup_address_srv, with its mismatched-width and interior-address calls, runs unchanged in the default configuration. Upload lifetime. The shared upload ring is reused without waiting for a queue, so a queue held behind a fence could execute a recorded copy after later uploads had passed over its source. An upload of a console-layout texture therefore owns its upload buffer (x2w_upload::make_page). The recording keeps a reference to the buffer and to the texture until the list is reset; each ExecuteCommandLists of the recording takes its own references and signals a fence behind the submit, and a later submit drops the references of the submits whose fence has completed, as the draw sampler heaps already do. A submit whose fence cannot be made keeps its references. The desktop texture of a by-address texture is not released. The earlier by-address shapes keep the ring. A repeated slot-70 call for a texture this slot published publishes it again, which announces a write, so changed texels are uploaded again. A console-layout description is held in the two cases a partial-tile BC view is held for (R0Y00#2105): when the latest XG stand-in copy announced for the address wrote desktop-footprint rows (a texture already published there then samples the null view, as a partial-tile view does), and when the layout runs past the size the XG stand-in reports for the description, which the title may not own. The address equations, block dimensions and mip-tail rules follow AMD addrlib as Mesa carries it under src/amd/addrlib, at the revision tools/fetch_addrlib.py pins (Mesa 25.1.0, commit 5c142e46f3f6e752ed745fd48912ebb8fad67145; MIT): src/gfx10/gfx10SwizzlePattern.h, src/core/addrlib2.cpp and src/gfx10/gfx10addrlib.cpp. The rules are restated; no addrlib code is included. The header and both fixtures name the files and their notice. Diagnostics: one "slot70 texture kind" line per new kind of call, and a line when retained uploads are released. Tests: - startup_gfx10_layout: the equations against the addrlib rows, agreement with bc7_4k_s.h, bc64_chain.h and tile64_plan.h, round trips, accepted descriptions and views; a display-order control that must fail. - startup_address_console_{warp,hardware}: seven textures drawn from bytes built by an independent oracle, every pixel compared; then the two held descriptions, which must log their reason and draw the null view, and a published texture whose address is announced as XG rows before the draw, which must draw the null view. - startup_address_console_gate_{warp,hardware}: the queue waits on a fence the fixture holds while eighteen lists are recorded and submitted on one list object, each after a new 16 MiB payload was written at the same address. Nothing may complete before the fence is signalled; afterwards the target must hold the first payload on the left and the last on the right, and the log must report eighteen retained submits released. - startup_address_console_gate_ring_{warp,hardware}: the same draws with X2W_TEST_ADDRESS_UPLOAD_RING=1 (fixtures only), which fills the textures from the 256 MiB ring; the first payload must be lost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
Adds the accepted descriptions, views, limits, the upload lifetime rule, the held cases and the log lines to docs/startup-runtime.md, with a note on which address-equation rows have a second source in the tree and which are checked against the addrlib rows alone, and the fixtures with their reproduction commands to docs/experiments.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc
96853ad to
f3455b0
Compare
|
Thanks both. I rebased onto R0Y00
tedin7
The other fixes from the earlier rework, both with fail-first checks:
The 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_)'
Not run locally: the dev (Debug) and Prepared by Claude Opus 5.5. 🤖 Generated with Claude Code |
tedin7
left a comment
There was a problem hiding this comment.
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 HEADtrue,git merge-tree --write-tree origin/main HEADexits 0,mergeable=MERGEABLE). - Display rows without a second source (was P2):
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). - MinGW
constexprnit:address_texture.h:15-22casts each flag toUINT. The layout test now builds with MinGW-w64. - Usage nit:
tests/startup_address_console_check.pywithout arguments prints a usage line instead of aTypeError.
Checks
- CI on this head: Linux Python checks, gfx1013 fixtures and Windows build/test pass;
/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).- Mutation: in
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 -- .. - 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
left a comment
There was a problem hiding this comment.
Re-reviewed f3455b0. 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.
|
Thanks for the updated f3455b0. 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 96853ad on a local integration; I will check the loading transition again on this revision before attributing that result to it. |
…e nulls (#2251) * startup: count refused slot 70 calls, slot 70 writes and token texture nulls A loading sequence can draw sampled textures black when their descriptor- table entry holds no stand-in view token. The draw then binds a null SRV (cause "token"). One candidate producer is device slot 70: a refused call leaves the destination as it was, and its refusal lines stop after eight. Another is a descriptor the title writes itself. These lines tell them apart; they count and print only, nothing changes on any descriptor. src/startup_stubs/memory_srv_census.h, printed with the five-second report when the counts changed: - refused slot 70 calls per reason, and per distinct reason, dimension, format, size, mips, layout and flags for the reasons a different description could avoid (up to 32 shapes); - successful slot 70 writes and distinct destination entries; - texture SRVs bound null with cause token, per translated pipeline. Detail lines: the existing Device::slot70 line for the first refusal of each of the first 8 distinct shapes, even past the 8-line limit; one line for the first write to each of the first 8 distinct entries; and the first 8 words of the entry for the first token null of each of the first 4 pipelines (all zero: nothing wrote the entry). The Device::slot70 line format and reasons are unchanged, so tools/startup/triage_run.py parses them as before. Tests: - startup_memory_srv_census: the limits without a device. - startup_memory_srv_diag_warp: eight zero-address refusals spend the line limit, a 2048x2048 BC1 10-mip texture is refused, a draw samples the untouched entry, then a supported 1-mip R8 texture is published and sampled. Expects one counted BC1 shape with its line past the limit, one write line for the R8 entry, one token null with zero words, and the R8 texels. - startup_memory_srv_diag_supported_control_warp publishes the R8 texture in place of the BC1 one and must fail (column 0 then shows the texel). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: describe the slot 70 write line and the eight-shape, four-pipeline detail limits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: keep 128 refused slot 70 shapes and report only the ones counted since the last report A diagnostic run overflowed the 32-shape table. Keep 128. The periodic report now lists only the shapes counted since it last ran, so a full table does not repeat every five seconds; a forced report lists all. Test: startup_memory_srv_census (the new limit, the changed-only periodic listing, and the forced listing). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: use a synthetic pipeline key in the census test; the diag control checks its exact mismatch The census test now uses 0x1000000000000001 as its pipeline key. The supported-texture control returns 0 only when the diag check stops at the exact column 0 mismatch the supported publish causes, 77 on a capability skip and 1 otherwise; it is no longer registered WILL_FAIL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: count the console-layout holds of slot 70 under their own names #2015 added five hold reasons (unsupported_desktop_format, console_layout_xg_rows, console_layout_without_footprints, console_layout_beyond_xg_size, overlapping_resource). The census and tools/startup/triage_run.py counted them as "other"; both now name them, and the census keeps shapes for every reason that depends on the description. The summary line buffer grows to fit the longer list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: rasptum <348594691+rasptum@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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