Repository navigation
startup: publish BC3/BC7 memory SRVs whose last tile row or column is partial - #2105
Conversation
… partial Device slot 70 accepted address-only BC3/BC7 views at layout 0x105 only when width and height were multiples of 64 texels. A single-mip 4 KiB standard surface pads its pitch and height to whole tiles (addrlib ComputeSurfaceInfoMacroTiled; Bc16Surface does the same), so any size in whole 4x4 blocks now takes the existing detile path. Sizes that are not whole blocks stay refused. The first publication at an address of such a view logs its size, format, whether the XG stand-in announced a copy there, and how many of the first and last 4 KiB are non-zero, with a hash (no addresses). startup_address_bc_view adds a 100x68 texture of each format with distinct padding blocks, a wrong-tile-pitch reference that must differ, and a 98x68 description that must be refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sion read Raise the cap on the partial-tile log line from 16 to 64 so that a run publishing many such views still logs the later ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtial-tile-rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The partial-tile cases double the draws. On a loaded machine the hardware run took 86-92 s against the 90 s limit (6-11 s when idle). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtial-tile-rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…XG size A partial-tile BC3/BC7 view at layout 0x105 now stays refused when the XG stand-in announced a copy to its address before the first publication there (that copy wrote desktop-footprint rows), or when its padded tiles are larger than the size the stand-in reports for the description (the desktop footprint rounded to 64 KiB), since those bytes may belong to something else. The log line names the reason, and gives the content summary only for a published view. startup_address_bc_view asserts the tiled byte count and adds refusals for a height that is not whole blocks, a 1028x1028 description and a view over an announced copy. The docs cite the pinned addrlib revision and list startup_bc7_4k_s with the reproduction tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
startup_address_bc_view translated the same pipeline (gfx2hlsl and FXC) for every case, which dominated its run time; with four cases it came close to the 90 s limit on a loaded machine. Translate once per run and draw every case from that cache, and restore the 90 s limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtial-tile-rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test boundaries The announced-copy refusal now applies only to XG copies of desktop rows: the opt-in BC7 4 KiB copy announces tiled blocks (with their size), which detile correctly. startup_address_bc_view adds a 256x196 view (only the height is partial; padded size equal to the reported 64 KiB) that must be published, and a 100x68 view over an opt-in BC7 copy that must be published. Each case starts with no previous pixel output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtial-tile-rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Can you add a negative case for a partial-tile address after its first valid publication, followed by a desktop-row XG copy at that address and a second slot 70 request? The present refusal is gated on !tiled_srv_addresses.count(address). The current tests cover the XG row copy before the first publication. Please either show which update path preserves the tiled backing for later copies or make the refusal track the latest write provenance, and check the second request preserves its destination descriptor on refusal. |
…ot only before the first The refusal over desktop-footprint rows was gated on the address never having been published, so a valid publication followed by an XG row copy and a second slot 70 request published the old tiled resource again and read the rows as tiles. The write record now keeps whether the last XG copy wrote desktop rows or opt-in BC7 tiles, and the refusal follows it. startup_address_bc_view adds that sequence: the second request must be refused and leave the destination naming the view it held before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, the gap was real: the refusal only covered a row copy before the first publication, and no update path keeps the backing tiled. As of Limit, noted in the docs: a view published before the row copy still reads the address as tiles; only new requests are refused. AI-assisted (Claude Code). |
|
The new republication case preserves the destination descriptor. An already-bound token could still reach the tiled uploader after the last write changed to desktop rows. I added the same provenance check at sampling time, keeping descriptor bytes intact and binding a null texture while rows are current. Windows Release passed 6/6 (partial/full BC view, address buffer and XG BC-chain on WARP and RTX 4060 Laptop). Disabling only the sampling check changed panel 4 at local pixel (4,0) from zero to 0000ff07 in WARP, while the republication guard stayed active. |
…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
…their address (#2015) * startup: sample slot-70 textures of the non-XOR console layouts from 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 (#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 * docs: describe by-address console textures on device slot 70 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 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
) * startup: sample slot-70 textures of the non-XOR console layouts from 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 (#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 * docs: describe by-address console textures on device slot 70 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 * gpu: validate by-address views and retry discarded texture uploads * gpu: run the gated readback with the ring switch absent --------- Co-authored-by: Its3rr0rsWRLD <92172873+Its3rr0rsWRLD@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Change
Device slot 70 publishes an address-only BC3_UNORM or BC7_UNORM view at layout 0x105 (4 KiB standard,
non-XOR) only when width and height are multiples of 64 texels. Any other size is refused as
unsupported_description, the destination descriptor keeps its previous bytes, and translated draws thatsample it bind a null texture.
A single-mip 4 KiB standard surface pads its pitch and height to whole tiles. In AMD addrlib (Mesa
5c142e46f3f6e752ed745fd48912ebb8fad67145,src/amd/addrlib/src/gfx10/gfx10addrlib.cpp),ComputeSurfaceInfoMacroTiledaligns pitch and height to the block size, with no mip tail for one mip.ComputeSurfaceAddrFromCoordMacroTiledtakes a block's tile index as block row × tiles per padded pitch,plus block column.
Bc16Surfaceand the existing detile path already do the same.What changes:
tiled_bc_srvnow accepts any non-zero width and height in whole 4x4 blocks, which the desktop texturerequires. Other sizes stay refused. One mip, one slice, the alignment, the flags and the view checks are
unchanged.
partial_tile_xg_rows: the XG stand-in announced a copy to the address before the first publicationthere. That copy wrote desktop-footprint rows, and the upload would read them as tiles. A copy from the
opt-in BC7 4 KiB layout writes tiles and does not hold the view.
partial_tile_beyond_xg_size: the padded tiles are larger than the size the stand-in reports for thedescription (the footprint rounded to 64 KiB). Those bytes may belong to something else, and the
readability probe cannot tell. Example: 1028x1028 pads to 1,183,744 bytes against a reported 1,179,648.
a log bound only: at most 64 lines for published views and 8 for refused ones, and nothing depends on
reaching it.
It gives the size, format, layout and tiled byte count, plus how many of the first and last 4 KiB are
non-zero, with a hash. A refused view logs its reason instead.
No change to
draw_translatedorupload_texture.Refs #1140 (layout queries: this does not change the XG answers). Open PR #1469 adds a general tiler and
rewrites the same
publish_tiled_texture/ slot 70 statement ind3d12_memory_srv.inl, so a textualconflict is expected whichever lands second. It does not widen the slot 70 check.
Verification
Head 681a22a, which merges current main at 3259564. Measured at the commits named below; Release build, Windows 11 build 26300, debug layer off.
Full filter at ae28720 (merged with main at 06cdc47): 23 tests selected, 23 passed, 0 failed, 0 skipped.
startup_bc7_4k_sand its control,startup_stream_fetch_translate.startup_stream_*_warp,startup_address_*_warp), withstartup_address_bc_view_warptaking 28.8 s.*_hardware), withstartup_address_bc_view_hardwaretaking 19.9 s.b52f56a adds two cases to the fixture and the opt-in-copy distinction. At that commit
startup_address_bc_view_warpandstartup_address_bc_view_hardwarepassed (21.0 s and 32.1 s).The later merge of main at 3259564 (681a22a) was clean and was not re-tested.
docs_links_check.py: 18 files, 391 links, pass.startup_address_bc_viewran on NVIDIA GeForce RTX 5090 (32.0.16.2135) and on WARP (10.0.26100.10068).texels outside the texture must load as zero, and the log must report 16,384 tiled bytes.
Controls inside the test:
1,600 pixels for BC3 and 1,500 for BC7.
view over memory announced as an XG copy.
64 KiB), and a 100x68 view over memory announced by the opt-in BC7 4 KiB copy, which writes real tiles.
Each of these source changes makes the test fail:
partial_tile_xg_rowsrefusal&&)>=)partial_tile_beyond_xg_sizepartial_tile_xg_rowsBc16Surfacetile rows downstartup_bc7_4k_salso fails (its rows expect 4096)The check now translates the pipeline (gfx2hlsl and FXC) once per run and draws every case from that cache.
Before, it translated once per case, and translation dominated the run time. So the four cases run in
about the time the two cases took on
main, measured on the same loaded machine:main, two casesThe 90 s limit is unchanged.
Evidence and follow-up
The fixture is source-built. It uses the existing literal BC3 encoder and the BC7 block builder of
bc7_draw_check.py, placed with the repository's 4 KiB standard block order (bc7_tiles_check.py).Assumptions:
The padding rule is addrlib's GFX10 rule. That the console uses the same padding is the assumption the
existing 64-texel path already makes. The optional addrlib oracle test was not run.
A partial last column changes block addresses, which the wrong-pitch control covers. A partial last row
changes only how many bytes are read, which the byte-count assertion and
startup_bc7_4k_scover.Both readability probes (at publish and at upload) check that the padded range is mapped, not that the
texture owns it. The reported-size refusal covers the case where padding runs past what the title was
told; within the reported size, ownership is assumed.
Limit: the record of an XG copy is never cleared. An address that was once written with desktop rows
keeps its partial-tile views refused, even if tiled data is later placed there.
mainrefused all ofthese views.
In a local run of a console executable:
Follow-ups, not in this PR:
upload_texture.docs/experiments.md, "Sample address-only BC3/BC7 textures in translated draws", is updated.Checklist
AI-assisted (Claude Code); the commands listed were run locally.
🤖 Generated with Claude Code