test: texture tiles NOTE only for the measured CopyTiles offset rounding on AMD and Intel (D3D-TILES-AMD-BYTE-OFFSET) #964
Open
github-bot
wants to merge 4 commits from
github-bot/gh-964 into main
AGit
pull from: github-bot/gh-964
merge into: github:main
github:main
github:docs/animation-merge-remnants
github:docs/story-dedup-and-cli
github:docs/restofworld-merge-remnants
github:docs/gamedata-dedup-tables
github:docs/textures-bcpack-tables-and-cli
github:docs/exe-fail-fast-shims-sync
github:fix/address-guard-wraparound-parity
github:fix/cvt-f16-denorm-and-clamp
github:docs/pso-cache-scope-note
github:docs/viewer-readme
github:docs/textures-arrays-dds-preview
github:docs/conformance-readme-status
github:fix/docs-validators-fences-urls
github:claude/loop-total
github:claude/pops-collision-seed
github:claude/dstorage-hold-page-reads
github:claude/host-image-copy-switch
github:feat/gdk-lifecycle-window-hook
github:claude/d16s8-uav-nvidia-fallback
github:feat/mfplat-offline-shim
github:claude/gameinput-slow-reader
github:fix/rt-null-barrier-clear
github:claude/depth-resolve-sample-positions
github:integration/palmetto-parity
github:claude/valu-literal-sext
github:claude/slot74-pool-handle
github:claude/rgb9e5-uint-alias-view
github:claude/fssm-root-layout-tables
github:feat/gdk-speech-display-lifecycle
github:asset-audio-skip-current
github:qemmhd/old-9940-rectangle-quad-lists
github:feat/ws2-offline-shim
github:qemmhd/rt-d16-unorm-uav
github:feat/xs-device-stops-7-9
github:qemmhd/rt-depth-same-base-shapes
github:qemmhd/rt-lazy-attachment-variant
github:feat/acphal-xma2-decoder
github:asset-audio-skip
github:codex/coord-claim-check-20261124-7e48
github:feat/xs-frame-pacing-presentx
github:feat/xs-device-vm-options
github:old-pr/9844
github:old-pr/9978
github:old-pr/9815
github:old-pr/10057
github:old-pr/9874
github:old-pr/9965
github:old-pr/9863
github:old-pr/10068
github:old-pr/10066
github:old-pr/10067
github:old-pr/10007
github:old-pr/10061
github:old-pr/10065
github:old-pr/10059
github:old-pr/10063
github:old-pr/10055
github:old-pr/10062
github:old-pr/10042
github:old-pr/10041
github:old-pr/10049
github:old-pr/10047
github:old-pr/10046
github:old-pr/10045
github:old-pr/10056
github:old-pr/10043
github:old-pr/10036
github:old-pr/10034
github:old-pr/9984
github:old-pr/10052
github:old-pr/10038
github:old-pr/10033
github:old-pr/10028
github:old-pr/10050
github:old-pr/9891
github:old-pr/9889
github:old-pr/10051
github:old-pr/10019
github:old-pr/10027
github:old-pr/10029
github:old-pr/10031
github:old-pr/10026
github:old-pr/9941
github:old-pr/10030
github:old-pr/10040
github:old-pr/9990
github:old-pr/10021
github:old-pr/9962
github:old-pr/10022
github:old-pr/10020
github:old-pr/10015
github:old-pr/10025
github:old-pr/9886
github:old-pr/10048
github:old-pr/10014
github:old-pr/10011
github:old-pr/9861
github:old-pr/10010
github:old-pr/10008
github:old-pr/9860
github:old-pr/10006
github:old-pr/9920
github:old-pr/9995
github:old-pr/10000
github:old-pr/10016
github:old-pr/10004
github:old-pr/10023
github:old-pr/9982
github:old-pr/9981
github:old-pr/9983
github:old-pr/9970
github:old-pr/9969
github:old-pr/9968
github:old-pr/9971
github:old-pr/9972
github:old-pr/9942
github:old-pr/9963
github:old-pr/9960
github:old-pr/9964
github:old-pr/9985
github:old-pr/9973
github:old-pr/9862
github:old-pr/9953
github:old-pr/10017
github:old-pr/9952
github:old-pr/9955
github:old-pr/9946
github:old-pr/9954
github:old-pr/9938
github:old-pr/9956
github:old-pr/9856
github:old-pr/9947
github:old-pr/9924
github:old-pr/9961
github:old-pr/9927
github:old-pr/9979
github:old-pr/10032
github:old-pr/9926
github:old-pr/5237
github:old-pr/9951
github:old-pr/9931
github:old-pr/9902
github:old-pr/9921
github:old-pr/9994
github:old-pr/9775
github:old-pr/9768
github:old-pr/9905
github:old-pr/9936
github:old-pr/9901
github:old-pr/9904
github:old-pr/9906
github:old-pr/9988
github:old-pr/9908
github:old-pr/9909
github:old-pr/9911
github:old-pr/9912
github:old-pr/9913
github:old-pr/9887
github:old-pr/9916
github:old-pr/9919
github:old-pr/9925
github:old-pr/9933
github:old-pr/9935
github:old-pr/9918
github:old-pr/9879
github:old-pr/9880
github:old-pr/9881
github:old-pr/9996
github:old-pr/9876
github:old-pr/9892
github:old-pr/9899
github:old-pr/9915
github:old-pr/9914
github:old-pr/9872
github:old-pr/9869
github:old-pr/9866
github:old-pr/9819
github:old-pr/10012
github:old-pr/9857
github:old-pr/9893
github:old-pr/9897
github:old-pr/9928
github:old-pr/9868
github:old-pr/9917
github:old-pr/9940
github:old-pr/9873
github:old-pr/9816
github:old-pr/10009
github:old-pr/9900
github:old-pr/9966
github:old-pr/9859
github:old-pr/9843
github:old-pr/9991
github:old-pr/10058
github:old-pr/9883
github:old-pr/9838
github:old-pr/9835
github:old-pr/9959
github:old-pr/9895
github:old-pr/9837
github:old-pr/9858
github:old-pr/9865
github:old-pr/9864
github:old-pr/9840
github:old-pr/9820
github:old-pr/4669
github:old-pr/9848
github:old-pr/9850
github:old-pr/9810
github:old-pr/9799
github:old-pr/9853
github:old-pr/9875
github:old-pr/9831
github:old-pr/9796
github:old-pr/9801
github:old-pr/9813
github:old-pr/9794
github:old-pr/7417
github:old-pr/9781
github:old-pr/9806
github:old-pr/9958
github:old-pr/9809
github:old-pr/9791
github:old-pr/9792
github:old-pr/10053
github:old-pr/9784
github:old-pr/9789
github:old-pr/9849
github:old-pr/9846
github:old-pr/9773
github:old-pr/9785
github:old-pr/9803
github:old-pr/9826
github:old-pr/9839
github:old-pr/9922
github:old-pr/9948
github:old-pr/7189
github:old-pr/9957
github:old-pr/9823
github:old-pr/9807
github:old-pr/9851
github:old-pr/9774
github:old-pr/9830
github:old-pr/9836
github:old-pr/9822
github:old-pr/9783
github:old-pr/9833
github:old-pr/9890
github:old-pr/9770
github:old-pr/9769
github:old-pr/9772
github:old-pr/9787
github:old-pr/9852
github:old-pr/9834
github:old-pr/9845
github:old-pr/9871
github:old-pr/9771
github:old-pr/9776
github:old-pr/10005
github:old-pr/9949
github:old-pr/9923
github:old-pr/9805
github:old-pr/9829
github:old-pr/9790
github:old-pr/9827
github:old-pr/9929
github:old-pr/9855
github:old-pr/9934
github:old-pr/9907
github:old-pr/9910
github:old-pr/9779
github:old-pr/9780
github:old-pr/9885
github:old-pr/9882
github:old-pr/9877
github:old-pr/9998
github:old-pr/4251
github:old-pr/9987
github:old-pr/9989
github:old-pr/9950
github:old-pr/9777
github:old-pr/10044
github:old-pr/9884
github:old-pr/2906
github:old-pr/5076
github:old-pr/9937
github:old-pr/9986
github:old-pr/3014
github:old-pr/9943
github:old-pr/9939
github:old-pr/4682
github:old-pr/4765
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
bug
Something isn't working
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
question
Further information is requested
wontfix
This will not be worked on
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!964
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-964"
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?
@adrianmjim on GitHub · 2026-11-24 15:56 UTC · original
adrianmjim:fix/texture-tiles-row-major-offset→main· +245 −47 · 3 files · 4 commits · openClaimed in the coordination issue as: D3D-TILES-AMD-BYTE-OFFSET
What and why
d3d12_texture_tilesfails on AMD Windows (RX 7900 XT, AMD 26.11.2 / 32.0.32029.2010):row-major alias tile 0 at (0,0): got 0x20000cc, expected 0xcc020000. It is one of the fivectestfailures #787 lists for RDNA3 on Windows.The half that fails is native D3D12, not the Vulkan layer. The layer's
256 x 240, linear offset 1replay had already passed. Buffered stdout printed its progress line after the native failure on stderr, which made it look like the layer's failure.AMD's driver behaves as if
CopyTilesroundedBufferStartOffsetInBytesdown to a multiple of 4, in both directions:0x020000cc, which is the bytes at offset 0 instead of offset 1, and the texels that straddle a tile seam.The other implementations disagree with AMD:
CopyTilesdocuments no alignment for that offset.This is inferred from the texel values. I did not run the D3D12 debug layer (not installed on this machine).
Update: an Intel Iris Xe host (Intel 32.0.101.7092), measured in this PR by @MalexAson, rounds the offset only in the tiles-to-buffer copies; its upload honours the offset. The test now accepts that pattern as a second model.
Change (test and docs only, no runtime change):
CopyTilesfrommodelled_readback(). Both round the offset down to a multiple of 4: AMD's in both directions, Intel's only in the tiles-to-buffer copies. The NOTE names the model, and every diverging case on a device must match the same one. Any other divergence still fails and prints, for each model, how many reads it leaves unexplained and the first one. Every byte-offset case first checks that the model with the true offset reproduces the test's expectations. The precedent for a NOTE on a measured driver divergence isd3d12_bundle_test.256x240and240x240at offset 4: native stays strict on clipped tiles on every GPU.host_wine.h), as in the other host-comparison tests. stdout is unbuffered.docs/testing.md: new Known problems row.docs/d3d12_vulkan.md: describes the driver behaviour.Tested
AMD Radeon RX 7900 XT, driver 32.0.32029.2010, Windows 11, MSVC (VS 2022), Vulkan SDK 1.4.363.0, base
23c459644.LEONIDA_VK_VALIDATION=1and 3 without. After: passed 6/6 in a row, with no validation messages, and a passing run prints nogot ... expectedlines. The one exception is the handoff case described below.83aea690a: pass, with the tiles-to-buffer-only NOTE at offsets 1 and 3 (#964).ctest: only the 4 failuresmainalready has on this GPU (vk_queue_query_sync,d3d12_execute_indirect_validation#504,d3d12_clear#516/#787,d3d12_pipeline_library_host).Still intermittent on AMD, separate issue: the native half of the COPY-to-DIRECT case (offset 4) sometimes reads zeros through the aliased tiles on this GPU. It failed 5 of 30 runs under a parallel
ctestand once in 3 single-test runs.mainthis case is never reached on AMD, because the offset-1 case fails first. This PR therefore turns a deterministic red into an occasional one on AMD.GPUs tested: AMD Radeon RX 7900 XT (RDNA3), AMD driver 26.11.2 (32.0.32029.2010), Windows 11; Intel Iris Xe (Raptor Lake-P), Intel 32.0.101.7092, Windows 11 24H2 (by @MalexAson)
AI-assisted: yes (Claude Code; the change went through three independent review passes before opening)
Checklist
mainand merges cleanly (written on23c459644, merges cleanly ontoa28927849).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
ref = {}releases (TEST-REF-MOVE-ONLY) #1758@ -85,0 +102,4 @@for (UINT tile = 0; tile < tiles; ++tile) {const UINT first_y = (tile / 2) * tile_height, first_x = (tile % 2) * tile_width;if (first_y >= height || first_x >= width) continue; // a texture smaller than the tile gridconst UINT rows = std::min(tile_height, height - first_y), columns = std::min(tile_width, width - first_x);@Copilot on GitHub · 2026-11-24 16:16 UTC · original
height - first_yandwidth - first_xare unsigned subtractions. If a future case uses a texture smaller than a tile (or otherwise makesfirst_* > *), this will underflow and produce a hugerows/columns, leading to out-of-bounds offset calculations. Make this robust by guardingif (first_y >= height || first_x >= width) continue;(or by computing remaining extents with conditional logic before subtracting).@ -114,13 +212,10 @@ bool run(ID3D12Device& device, UINT width, UINT height, UINT64 tile_copy_offset,const D3D12_RANGE empty{0, 0};void* mapped = nullptr;EXPECT(SUCCEEDED(upload->Map(0, &empty, &mapped)));@Copilot on GitHub · 2026-11-24 16:16 UTC · original
For the byte-unaligned cases, the advisory model assumes deterministic bytes in the upload buffer prior to
tile_copy_offset(e.g., when modelling a rounded-down offset). In the real test, only the region starting attile_copy_offsetis written, leaving earlier bytes undefined (dependent on heap/page reuse). To keep the model comparison stable and avoid flakiness on systems where the upload heap isn't zero-filled, initialize the entire mapped upload range used by the test (at least[rounded_offset, tile_copy_offset), or simply the full upload allocation) to a known value before callingfill_tiles().@Copilot on GitHub · 2026-11-24 16:16 UTC · original
On
docs/testing.mdline 668 (outdated):This row hard-codes an example NOTE mentioning only offset 1→0 (and offset 3). The test output is parameterized and can also produce NOTE lines for other byte-unaligned offsets (e.g., 5→4, 7→4) if cases expand in the future, and the prose in the same row already mentions offsets 1–8. Consider generalizing the example NOTE text to use placeholders like
linear offset X rounded down to Yso the Known problems entry stays consistent with the test’s actual output format.@Copilot on GitHub · 2026-11-24 16:16 UTC · original
On
runtime/test/d3d12_texture_tiles_test.cppline 312 (outdated):The
!advisory->unmodelled++idiom is hard to read and easy to misinterpret when revisiting this code. Consider rewriting this as an explicitif (actual != modelled) { if (advisory->unmodelled == 0) ...; ++advisory->unmodelled; }so the 'first unmodelled' capture and the counter increment are unambiguous.@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-24 16:16 UTC · original · reviewed
Copilot review overview
4 open issues
height - first_yandwidth - first_xare unsigned subtractions. If a future case uses a texture… · New!advisory->unmodelled++idiom is hard to read and easy to misinterpret when revisiting this… · NewWhat changed in this PR
Updates the
d3d12_texture_tilestest to treat a specific AMD WindowsCopyTilesbyte-offset divergence as a non-fatal NOTE (when it matches a CPU model), and documents the behavior.Changes:
CopyTilesoffsets; adds WARP confirmation; skips native/WARP comparisons under Wine; unbuffers stdoutCopyTilesrounding behaviorReview effort: Lite
@adrianmjim on GitHub · 2026-11-24 16:46 UTC · original
Addressed the four review comments in
e4f040332::102):for_each_checkednow skips a tile that starts past the texture edge. No current case reaches it, but a case smaller than the tile grid can no longer underflow.:201): the upload buffer is now zeroed over[0, tile_copy_offset)beforefill_tiles. Those bytes were already zero in practice, since it is a committed resource withoutD3D12_HEAP_FLAG_CREATE_NOT_ZEROED. The model reads them when it rounds the offset down, though, so it should not depend on that.!advisory->unmodelled++: now an explicitifwith a separate increment.Re-run on the RX 7900 XT (driver 32.0.32029.2010): builds without warnings,
d3d12_texture_tilespasses 3/3, one of them withLEONIDA_VK_VALIDATION=1(no validation messages). AI-assisted.@MalexAson on GitHub · 2026-11-24 19:24 UTC · original
Tested
e4f0403323applied onmain6293c1c4f, on Intel Iris Xe (Raptor Lake-P, 8086:a7a0), Intel 32.0.101.7092, Windows 11 24H2 (26100.6584):d3d12_texture_tilesstill fails. This driver breaks the expectations too, but in a different pattern from the AMD one.The native device the test picks here is the Iris Xe (tiled resources tier 3). The result is the same with the layer on the Iris Xe and on the RTX 4060 Laptop GPU (NVIDIA 616.92). The three offset-4 cases match natively, the layer passes every case and WARP is found (tier 3). Then:
On unchanged
mainthe same run stops at line 239 withalias tile 0 at (0,0): got 0x1cc0200, expected 0xcc020000.What this driver does, measured with a temporary local edit of
modelled_readback(not something to merge): it roundsBufferStartOffsetInBytesdown to a multiple of 4 only in the tiles-to-buffer direction, and honours it in the buffer-to-tiles direction. With the model rounding only the three readback copies, every diverging read is explained, 94208 of 245760 at offset 1 and 84480 of 222720 at offset 3, and the test passes with its NOTE on both layer GPUs. Rounding only the upload direction leaves the same 155648 reads unexplained as rounding both.So a second accepted model, rounded in the readback direction only, would cover this driver. I can rerun here if you push one.
Built with MSVC 19.50 + Ninja, RelWithDebInfo. AI-assisted: this run was made with a coding agent.
@adrianmjim on GitHub · 2026-11-24 20:44 UTC · original
@MalexAson thanks, that was exactly what was missing. Pushed
83aea690a: a second accepted model, rounded only in the tiles-to-buffer copies.modelled_readback()now takes the upload and the readback offsets separately. A native run at a byte-unaligned offset is a NOTE when every checked read matches one of the two models: both directions (AMD) or tiles-to-buffer only (Intel). The NOTE says which one matched.Checked on the RX 7900 XT, without Intel hardware:
LEONIDA_VK_VALIDATION=1).Could you rerun
d3d12_texture_tileson the Iris Xe at83aea690a? It should print... rounded down to 0 only in the tiles-to-buffer copiesat offsets 1 and 3.@MalexAson on GitHub · 2026-11-24 20:57 UTC · original
Tested
83aea690aapplied onmain6293c1c4f, on Intel Iris Xe (Raptor Lake-P, 8086:a7a0), Intel 32.0.101.7092, Windows 11 24H2 (26100.6584): pass, with the NOTE you predicted at both offsets.ctest -R "^d3d12_texture_tiles$": 3 of 3 runs pass with the layer on the Iris Xe, and 3 of 3 with the layer on the RTX 4060 Laptop GPU (NVIDIA 621.40; it was 616.92 for my first report). The native device is the Iris Xe in both. With the layer on the RTX 4060 the COPY-to-DIRECT case runs as well and matches natively (262144 pixels).The counts are the ones from my first measurement, and both diverging cases report the same model, so the one-model-per-device rule holds here.
AI-assisted: this run was made with a coding agent.
@efeekrb on GitHub · 2026-11-25 16:35 UTC · original
Tested on a two-GPU Windows laptop: the layer on an NVIDIA GeForce RTX 4060 Laptop GPU (NVIDIA 610.78), Windows 11 build 26300. The test's native D3D12 side is the Intel UHD Graphics iGPU (Windows driver 31.0.101.4255, tiled resources tier 3), the first hardware adapter.
mainat24a29f8, RelWithDebInfo,LEONIDA_VK_DEVICE=4060. This PR's diff applied cleanly, and onlyd3d12_texture_tiles_testwas rebuilt.main:d3d12_texture_tilesfails 3 of 3 reruns, in the 256 x 240, linear offset 1 case:alias tile 0 at (0,0): got 0x1cc0200, expected 0xcc020000.CopyTileswould with the offset rounded down to 0 only in the tiles-to-buffer copies, and WARP meets the expectations at both.So the Iris Xe pattern also holds on an Intel UHD Graphics. A side note: the test picks its native adapter itself and ignores
LEONIDA_HOST_ADAPTER(finding: #1608), so on a two-GPU PC the native side is the iGPU even when the layer runs on the NVIDIA GPU. No game files; counts and pass/fail lines only. AI-assisted (Claude Code).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.