[PR #964] test: texture tiles NOTE only for the measured CopyTiles offset rounding on AMD and Intel (D3D-TILES-AMD-BYTE-OFFSET) #1001

Open
opened 2026-11-26 20:19:45 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/964
Author: @adrianmjim
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/texture-tiles-row-major-offset


📝 Commits (4)

  • 0e76c73 test: texture tiles NOTE only for AMD's rounded CopyTiles offset (D3D-TILES-AMD-BYTE-OFFSET)
  • e4f0403 test: texture tiles review follow-ups (D3D-TILES-AMD-BYTE-OFFSET)
  • 83aea69 test: texture tiles also accepts Intel's readback-only CopyTiles rounding (D3D-TILES-AMD-BYTE-OFFSET)
  • 07a204a Merge remote-tracking branch 'cont/main' into fix/texture-tiles-row-major-offset

📊 Changes

3 files changed (+245 additions, -47 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+10 -1)
📝 docs/testing.md (+1 -0)
📝 runtime/test/d3d12_texture_tiles_test.cpp (+234 -46)

📄 Description

Claimed in the coordination issue as: D3D-TILES-AMD-BYTE-OFFSET

What and why

d3d12_texture_tiles fails 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 five ctest failures #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 1 replay 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 CopyTiles rounded BufferStartOffsetInBytes down to a multiple of 4, in both directions:

  • Offsets 1, 2, 3, 5, 6 and 7 diverge; offsets 4 and 8 match.
  • Every divergent texel fits that model. That includes the reported 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:

  • CopyTiles documents no alignment for that offset.
  • WARP meets the test's expectations at every offset tried (1-8).
  • The layer meets them too. It stages unaligned offsets through transfer scratch, and the validation layer reports nothing.

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):

  • At a byte-unaligned offset, the native run reads every texel and produces a NOTE (on stdout) only if every checked read equals one of two CPU models of CopyTiles from modelled_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 is d3d12_bundle_test.
  • WARP runs at those offsets to confirm the expectations. Without WARP, the test says that nothing confirms them.
  • The layer is held to the expectations at every offset, as before.
  • New cases 256x240 and 240x240 at offset 4: native stays strict on clipped tiles on every GPU.
  • Under Wine/Proton neither the hardware adapter nor WARP is compared (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.

  • Before: fails 6/6 at offset 1, 3 runs with LEONIDA_VK_VALIDATION=1 and 3 without. After: passed 6/6 in a row, with no validation messages, and a passing run prints no got ... expected lines. The one exception is the handoff case described below.
  • Model fit: in local runs with extra cases (not committed), native matches the model at every texel for offsets 1-3 and 5-7 on 256x256, 240x240, 130x129 and 129x250.
  • Negative control: a deliberately wrong model (rounding to a multiple of 2) fails.
  • Intel model: on the CPU, the tiles-to-buffer-only model breaks the expectations at 94208 of 245760 reads (offset 1) and 84480 of 222720 (offset 3), and differs from the both-directions model at 155648 reads: the counts measured on the Iris Xe. On the 7900 XT it leaves 155648 and 138240 reads unexplained, so the two models don't overlap; an upload-only model fails too. A probe that pretended an earlier case matched the Intel model made the AMD run fail on the mismatch. Confirmed on the Iris Xe by @MalexAson at 83aea690a: pass, with the tiles-to-buffer-only NOTE at offsets 1 and 3 (https://github.com/ubiquitarianism/leonida/pull/964#issuecomment-7144284362).
  • Full ctest: only the 4 failures main already has on this GPU (vk_queue_query_sync, d3d12_execute_indirect_validation #504, d3d12_clear #516/#787, d3d12_pipeline_library_host).
  • Not tested by me: NVIDIA, Intel (run by @MalexAson, above), other AMD drivers, Wine.

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 ctest and once in 3 single-test runs.

  • On main this 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.
  • It also fails with the unchanged test code when only that case is run, and in a native-only probe with no Vulkan layer in the process (7 of 30 under load, 0 of 15 for the same work on one queue).
  • I did not loosen it. Details are in the coordination issue as a finding.

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

  • Based on current main and merges cleanly (written on 23c459644, merges cleanly onto a28927849).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/964 **Author:** [@adrianmjim](https://github.com/adrianmjim) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/texture-tiles-row-major-offset` --- ### 📝 Commits (4) - [`0e76c73`](https://github.com/ubiquitarianism/leonida/commit/0e76c7356912e6c129cec9f1f172d4f08e0c577e) test: texture tiles NOTE only for AMD's rounded CopyTiles offset (D3D-TILES-AMD-BYTE-OFFSET) - [`e4f0403`](https://github.com/ubiquitarianism/leonida/commit/e4f0403323309d3b757f2c27e229a07520dd58e9) test: texture tiles review follow-ups (D3D-TILES-AMD-BYTE-OFFSET) - [`83aea69`](https://github.com/ubiquitarianism/leonida/commit/83aea690ae03c00c898ee34271332652cf9606bb) test: texture tiles also accepts Intel's readback-only CopyTiles rounding (D3D-TILES-AMD-BYTE-OFFSET) - [`07a204a`](https://github.com/ubiquitarianism/leonida/commit/07a204a9b7b744bf666a43e73a94e213ab9a0fba) Merge remote-tracking branch 'cont/main' into fix/texture-tiles-row-major-offset ### 📊 Changes **3 files changed** (+245 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+10 -1) 📝 `docs/testing.md` (+1 -0) 📝 `runtime/test/d3d12_texture_tiles_test.cpp` (+234 -46) </details> ### 📄 Description Claimed in the coordination issue as: D3D-TILES-AMD-BYTE-OFFSET ### What and why `d3d12_texture_tiles` fails 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 five `ctest` failures #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 1` replay 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 `CopyTiles` rounded `BufferStartOffsetInBytes` down to a multiple of 4, in both directions: - Offsets 1, 2, 3, 5, 6 and 7 diverge; offsets 4 and 8 match. - Every divergent texel fits that model. That includes the reported `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: - `CopyTiles` documents no alignment for that offset. - WARP meets the test's expectations at every offset tried (1-8). - The layer meets them too. It stages unaligned offsets through transfer scratch, and the validation layer reports nothing. 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):** - At a byte-unaligned offset, the native run reads every texel and produces a NOTE (on stdout) only if **every checked read** equals one of two CPU models of `CopyTiles` from `modelled_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 is `d3d12_bundle_test`. - WARP runs at those offsets to confirm the expectations. Without WARP, the test says that nothing confirms them. - The layer is held to the expectations at every offset, as before. - New cases `256x240` and `240x240` at offset 4: native stays strict on clipped tiles on every GPU. - Under Wine/Proton neither the hardware adapter nor WARP is compared (`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`. - **Before:** fails 6/6 at offset 1, 3 runs with `LEONIDA_VK_VALIDATION=1` and 3 without. **After:** passed 6/6 in a row, with no validation messages, and a passing run prints no `got ... expected` lines. The one exception is the handoff case described below. - **Model fit:** in local runs with extra cases (not committed), native matches the model at every texel for offsets 1-3 and 5-7 on 256x256, 240x240, 130x129 and 129x250. - **Negative control:** a deliberately wrong model (rounding to a multiple of 2) fails. - **Intel model:** on the CPU, the tiles-to-buffer-only model breaks the expectations at 94208 of 245760 reads (offset 1) and 84480 of 222720 (offset 3), and differs from the both-directions model at 155648 reads: the counts measured on the Iris Xe. On the 7900 XT it leaves 155648 and 138240 reads unexplained, so the two models don't overlap; an upload-only model fails too. A probe that pretended an earlier case matched the Intel model made the AMD run fail on the mismatch. **Confirmed on the Iris Xe** by @MalexAson at `83aea690a`: pass, with the tiles-to-buffer-only NOTE at offsets 1 and 3 (https://github.com/ubiquitarianism/leonida/pull/964#issuecomment-7144284362). - **Full `ctest`:** only the 4 failures `main` already has on this GPU (`vk_queue_query_sync`, `d3d12_execute_indirect_validation` #504, `d3d12_clear` #516/#787, `d3d12_pipeline_library_host`). - **Not tested by me:** NVIDIA, Intel (run by @MalexAson, above), other AMD drivers, Wine. **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 `ctest` and once in 3 single-test runs. - On `main` this 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. - It also fails with the unchanged test code when only that case is run, and in a native-only probe with no Vulkan layer in the process (7 of 30 under load, 0 of 15 for the same work on one queue). - I did not loosen it. Details are in the coordination issue as a finding. 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 - [x] Based on current `main` and merges cleanly (written on `23c459644`, merges cleanly onto `a28927849`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#1001
No description provided.