startup: read single-mip 0x105 volumes in slot 70 #2863
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2871"
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 pigalot on 2026-11-26T15:18:52Z.
Slot 70 reads console-layout textures from an address (
gfx10_layout.h), but only for 2D descriptions. A Texture3D description in layout0x105was refused asunsupported_description, so its view kept the old descriptor.This adds one shape: a 3D texture in
0x105(4 KiB standard) with one mip, one sample, an uncompressed format with a known element size, and at most 2048 texels on each side, viewed as a Texture3D. addrlib lays a 3D resource in a standard mode out in thick blocks (Gfx10Lib::HwlIsThick):GFX10_SW_4K_S3_PATINFO;The rows are restated as data, as in the 2D layouts. No addrlib code is included.
Changes:
gfx10_layout.h:supports_volume, plus the thick addressing inLayout.address,tileanddetiletake a z coordinate and a layer pitch.d3d12_draw.inl: the console upload checks the footprint depth and copies each depth layer to its own rows.d3d12_memory_srv.inl:console_address_holdcounts a volume as one slice. It used to multiply the footprint, which already spans every layer, by the depth, so a volume larger than the size the XG stand-in reports would have been published.Still refused, unchanged: volume mip chains, block-compressed volumes, volumes in every other mode, cube views, and layout
0/0x100without a live texture.Tests (one new family,
tests/cmake/startup_gfx10_volume.cmake):startup_gfx10_volume(no device):startup_gfx10_volume_thin_control: lays each volume out as a thin 2D array of its layers.WILL_FAIL; it fails 51 checks.startup_gfx10_volume_addrlib: compares the size and every element address of 190 volumes (276,885 addresses) withAddr2ComputeSurfaceInfo/Addr2ComputeSurfaceAddrFromCoord(ADDR_RSRC_TEX_3D,ADDR_SW_4KB_S, Navi21 configuration). Skips (77) without-DXBOX2WINDOWS_ADDRLIB_DIR.startup_address_console_{warp,hardware}also draws two volumes, RGBA8 17x17x17 and 33x9x18, from a backing built in Python from the same S3 row.console_layout_beyond_xg_size.X2W_TEST_CONSOLE_DESCtakes an optional seventh field, depth.Negative controls run once by hand, not registered: setting the upload's layer pitch to 0 fails
startup_address_console_warpon the first volume's pixels, and restoring the old hold fails it on the held volume.Checks (Windows 11 build 26200, MSVC 14.52, debug layer off; the
_hardwarerun's adapter on this host was Microsoft Basic Render Driver 10.0.26100.9818, so no physical-GPU result is claimed):The layout is checked against addrlib, not against console memory.
This change was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-27T11:27:23Z.
thick()/address()reproduce addrlib's size and every element address on 190 volumes — independent Linux/x86_64 run atef4ee2e8Not a code change; measurements only.
Environment
5c142e46, fetched by this repository's owntools/fetch_addrlib.py, built from the 16 sources listed for thexbw_addrlibtarget with-DADDR_FASTCALL= -DLITTLEENDIAN_CPU -DDEBUG=0.tests/startup_gfx10_volume_check.cpp(sha2567eab180e…) andsrc/startup_stubs/gfx10_layout.h(sha256f040ad0a…) atef4ee2e8, unmodified, compiled against a reducedd3d12.hI wrote for this:DXGI_FORMATis imported unmodified from Microsoft's DirectX-Headersdxgiformat.h, the rest is the handful of constants and structs these two headers touch.Commands
cwd is the repository root for the first two lines and the build directory for the last.
Observed
The volume and address counts are the ones the description gives, from a different compiler, a different OS, and addrlib built from source rather than linked from an existing build; that agreement is what tells me this build behaves like the author's. The addrlib run takes 0.037 s.
My own mutations, not the PR's controls
The only negative control this change registers is
--mutate thin. Seven mutations ofthick()/address(), applied one at a time, rebuilt each time, then restored from a pristine copy (sha256 back tof040ad0a…,git status --porcelain --untracked-files=noempty):blocks_wide[0]floored → default entry rc -6,free(): invalid next size (normal), noFAILline on stdout; addrlib 148 mismatches, element addresses compared falling to 182,528 because a volume whosesurfSizedisagrees is not sweptblocks_highfloored → rc -6, same abort; 185 mismatches / 104,448 comparedslice_sizefloored on the depth → rc -6, same abort; 185 mismatches / 122,880 comparedz / block_heightinstead ofz / block_depth→ 5 reported failures; 74,786 mismatchesX0andZ0swapped → 2 reported failures; 11,076 mismatchesz_bits[z % block_width]instead ofz % block_depth→ 4 reported failures; 17,818 mismatchesy / block_depthinstead ofy / block_height→ rc -11 (SIGSEGV); 57,144 mismatchesAll seven turn the default entry red, but only three of them leave a
FAIL …line behind: the three that abort in glibc's heap check and the one that segfaults lose their buffered stdout. All seven are reported as counted mismatches by--addrlib, so that mode is not a redundant confirmation of the default entry — it is the only one that names every one of these mutations.The Python oracle behind the draw
startup_address_console_check.pybuilds its backing bytes from its own restatement of the same row (THICK_4K_S3,ConsoleVolume), so a wrong row there would agree with itself. I imported that class from the file, fed it addrlib's addresses for the three volumes the family names, and compared:--addrlibsweep (17³ RGBA16F, 32³ RGBA8, 33³ RGBA16F, 32³ A8, 16x16x8 R16F, 16³ R8G8, 32³ R10G10B10A2, 5x3x7 RGBA32F, 1x1x2 R8, 64x8x40 R32F, plus 1/3/9/24 × 1/7/17 × 1/5/18), so the draw's second volume gets an addrlib reference herePotentially useful follow-up: adding
33x9x18to that sweep costs one line.Where these entries run
startup_gfx10_volume,startup_gfx10_volume_thin_controlorstartup_gfx10_volume_addrlibmatches theprtest preset's include regex (CMakePresets.json:45), andstartup_gfx10_volume_checkis absent from that preset'stargetslist, socmake --build --preset prdoes not build it either.ctest --preset dev -E '_hardware$'runs the first two;..._addrlibexits 77 because no workflow callstools/fetch_addrlib.py, as doxg_bc64_tiling_referenceandstartup_small_texture_4k_addrlib.startup_address_console_{warp,hardware}:_warpfrom the push sweep,_hardwarenever. Since the description already states the_hardwarerun used the Basic Render Driver, the layer-pitch copy and theconsole_address_holdchange have no physical-GPU result yet.Two small notes
check_distinct_and_round_triprecordsclashand then runs the round trip anyway, andtile()/detile()write ataddress()with no bound. Anif (clash) continue;after the failure would turn afree(): invalid next sizeor a SIGSEGV into a readableFAIL …line.--mutate thinprints 50 failures here against 51 in the description. The count is arithmetic over the tables in the file, so one of the two comes from another revision of it. The entry isWILL_FAIL, so the verdict does not change.Limits
console_address_hold. What is covered isgfx10_layout.hand the refusals inaddress_texture.h.Layoutderives, so a wrong reading of the description would feed both sides the same wrong sides. What the comparison covers is the coordinate-to-address mapping and the size.d3d12.h, not the Windows SDK; the fixture and both headers are unmodified.prtest filter andstartup_gfx10_volume_checkinbuildPresets.pr.targets.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-27T13:11:21Z.
Independent AMD Radeon RX 9070 XT result on
ef4ee2e8— the volume path andconsole_address_holdon a physical GPUNot a code change; measurements only. This closes the line my previous comment left open (“the layer-pitch copy and the
console_address_holdchange have no physical-GPU result yet”).Environment
cl19.44.35230 (VC\Tools\MSVClists 14.44.35207), Windows SDK 10.0.26100.0,dxc1.9.2602.17.Meta Virtual Monitor; the adapter is selected by name, so that selection is not cosmetic.dev(Debug, Ninja), configured with-DINTAKE_PYTHON=C:/Users/walde/Downloads/x2w-pr641/out/pe-env/Scripts/python.exe;ctest -N -R '^startup_address_console'lists 6 entries.git rev-parse HEAD=ef4ee2e8,git status --porcelain --untracked-files=noempty before and after each run.Commands
cwd is the repository root throughout. The adapter is set in the quoted form:
set VAR=valeur &leaves a trailing space in the name and no adapter matches.Observed
Each hardware case prints the card immediately above its verdict:
The same three lines appear on the WARP entry as
1333: warp …, with the same values.The 13
adapter=Microsoft Basic Render Driver driver=10.0.26100.9818lines in the same log are not draws and not the author's WARP run: each one sits betweenx2w-draw no translation for pipeline 0067af00a2b74bb7and0067af00a2b74bb7: ok/compilation object save succeeded, i.e. inside the per-case shader compilation. The warp entry carries 13 of them too, and there they are followed by 13 more for its draws, all on the same adapter.What the 65,536 pixels cover
Replaying the fixture’s tiling formula (
z = (x // w + (y // h) * across) % depth) over the 512x128 target:29z+11 mod 256), and 29 is odd, so the 17 layer values are distinct: a layer mix-up cannot pass a pixel comparison.These are counts over the fixture’s own formula, not a property of the device; what the device contributes is that every one of those comparisons matched, plus the
published console layoutline the fixture also requires for each volume (startup_address_console_check.py:212).Regression
ctest -R "^startup_address_console"on the clean head: 6 pass / 0 skip / 0 fail, 33.54 s.ctest -R "^startup_gfx10_volume": 2 pass / 1 skip / 0 fail. The skip isstartup_gfx10_volume_addrlib, exit 77, this tree configured withoutXBOX2WINDOWS_ADDRLIB_DIR.startup_gfx10_volume_thin_controlisWILL_FAIL, so itsPassedmeans the mutated binary exited non-zero.Mutation A — the step between depth layers
src/startup_stubs/d3d12_draw.inl:1448-1449passesplan.placed[i].Footprint.RowPitchas the row pitch andstd::size_t{plan.placed[i].Footprint.RowPitch} * plan.rows[i]as the step between depth layers. A sets that second argument tostd::size_t{0} * plan.rows[i](mutated file sha256cf9303cf…,occurrences=1). Both backends stop on the first volume:0xdb= 219 =(29*16 + 11) & 255: the texel of layer 16 lands at layer 0, i.e. every layer is written to the same rows and the last one covers the others. A copy that wrote nothing would leave zeros or a stale target, never a well-formed texel of another layer. This proves the layer term must be non-zero; it does not pin its value, and it does not touch the row pitch.Mutation B — the slice count of the hold test
src/startup_stubs/d3d12_memory_srv.inl:523readsconst u64 slices = desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? 1 : desc.DepthOrArraySize;. B puts the pre-PRconst u64 slices = desc.DepthOrArraySize;back (mutated file sha256896e6225…,occurrences=1). Both backends, on the volume that used to be held:2 of the 6 entries fail (1333 warp, 1377 hardware), the other 4 stay green. The arithmetic is the edited term alone: the desktop footprints of one slice are 81,920 bytes, rounded to 131,072; the layout is 163,840. With
slices = 1the hold fires (163,840 > 131,072); withslices = 40the reported size becomes 5,242,880 and the volume is published and sampled. The assertion that fires is the readback one, not the log one, so the description really was drawn from. What B does not establish is that1is the right value — that rests onGetCopyableFootprintsalready spanning the depth, which is an API contract, not something this mutant measures.The accepted branch of that ternary has no case
const u64 slices = 1;, unconditionally, keeps all 6 entries green (mutated file sha256e574645d…). No entry in this family describes a 2D array withDepthOrArraySize > 1, so the pass-through branch of? 1 :is never taken. A 2D-array case whose one-slice footprint is under the size the XG stand-in reports and whoseDepthOrArraySize-multiplied footprint is over it would exercise it.After each restore
git status --porcelain --untracked-files=noempty, working-tree sha2567fa3c167…(d3d12_memory_srv.inl) anddb7c6092…(d3d12_draw.inl), rebuild, and the family green again (2/2,6/6). An emptygit statusis what ties those bytes toef4ee2e8; the hashes are working-tree bytes, not the LF blobs.Limits
THICK_4K_S3has a single entry (4), so this path is exercised for one element size and one block shape (8x16x8). The five element sizesstartup_gfx10_volumesweeps are CPU side. No volume with more than 3 block layers is drawn — the 64x8x40 one is held, never detiled.detile()only; the fourth is not isolated here.kind 1in the trap-log line is an ordinal of first sight (kinds.size(),d3d12_memory_srv.inl:488), so it is stable for the current order of cases, not an identifier of the description.startup_address_console_hardwarenever runs in CI.AI-assisted; runs executed on the machine above.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T13:54:09Z.
Review: APPROVED
Independent integration review on
main36d2cbeb(treec9d3721adb0063619851bc8d6b7f7c3788e87f5e). The new shape is confined to single-mip, uncompressed 0x105 Texture3D. The copy uses the footprint depth and depth-layer pitch, and the bounds check counts a full 3D footprint once.Built
startup_stream_consumer d3d12_xs_shim startup_gfx10_layout_check startup_gfx10_volume_check startup_memory_srv_volume_check.ctest --test-dir <build> --no-tests=error -V -R '^(startup_gfx10_(layout|volume).*|startup_memory_srv_volume.*|startup_address_(console|volume_srv)_(warp|hardware))$'produced 13 passes and one addrlib capability skip (77) in both Debug and Release/O2. WARP and RTX matched all 65,536 pixels for each of two volumes. The 64x8x40 oversize case was held with a null view and the thin-layout negative control reported 50 mismatches. The independent Linux result above compared 276,885 addresses against addrlib, and the RX 9070 XT run independently covered physical-GPU slot 70.Local environment: Windows 11 build 26200.9974, WARP 10.0.26100.9818, RTX 4060 Laptop driver 32.0.16.1656, SDK DXC 10.0.26100, address-console fixture debug layer off. These are source-built tests.