[PR #62] TEST-2033: print the sizes when the compacted-size check fails #114

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

📋 Pull Request Information

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

Base: main ← Head: old-pr/9785


📝 Commits (1)

  • de2370e test(xdxr): print the sizes when the compacted-size check fails

📊 Changes

1 file changed (+12 additions, -1 deletions)

View changed files

📝 runtime/test/vk_xdxr_build_test.cpp (+12 -1)

📄 Description

Carried over from old PR 9785 by Voltingg in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9785, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Voltingg: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: TEST-2033 (the claim could not be posted: interactions on
this repository are limited to collaborators)

What and why

TEST-2033: vk_xdxr_build_test.cpp:571 fails on a real Apple M4 with MoltenVK 1.4.2 (#9396, built
with Zig's clang), while CI's paravirtual Metal device passes. The item asked to tell a compiler
issue from a MoltenVK/Metal one.

It is not the compiler. On an Apple M1 Pro, macOS 27.3, MoltenVK 1.4.2 (Homebrew):

Compiler vk_xdxr_build_test full ctest
Apple clang 21.0.0 pass, 3/3 runs 64/64 (2 skipped)
zig c++ 0.17.1 (clang 22.1.8, the reporter's) pass, 3/3 runs 64/64 (2 skipped)

The xdxr_build_cases outputs of the two builds are byte-identical, and xdxr_build_check passes.
Khronos synchronization validation 1.4.363 reports no hazard in the whole test.

Since EXPECT returns at the first failure, everything before line 571 passed on the M4. The second
half of the condition is implied by the earlier dump check (same layout parameters), so on the M4
the GPU's postbuild value differed from the size the host read from the header after the build.
The check only printed the condition, so this change prints the values when it fails:

compacted size: postbuild 0x..., clone postbuild 0x..., header at build N, header now N, layout N
  • postbuild 0xabababab...: the GPU's write to the 16-byte info buffer never reached the host
    (MoltenVK/Metal, for example a small buffer used only through its device address on Apple9)
  • header now differs from header at build: something wrote over blas_random after its build
  • a plausible postbuild that differs from an unchanged header: the GPU read a stale header or
    the wrong address

Built keeps a pointer to the structure's mapped bytes to read the header again. Nothing changes
when the check passes.

It applies cleanly on #8776, which edits other lines of the same file.

Tested

  • Apple M1 Pro, macOS 27.3, MoltenVK 1.4.2, Vulkan loader 1.4.363: builds with Apple clang 21 and
    Zig 0.17.1 without warnings, and vk_xdxr_build_test passes with both.
  • With the condition forced true, it prints
    compacted size: postbuild 0x0000000000021a80, clone postbuild 0x0000000000021a80, header at build 137856, header now 137856, layout 169984.
  • Not tested on an M4: a rerun of vk_xdxr_build_test there with this change shows which of the
    three cases it is.
  • python -I scripts/check_no_game_data.py runtime/test/vk_xdxr_build_test.cpp: exit 0.

AI-assisted: yes (Claude Code)

Checklist

  • 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. (Not applicable: 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/62 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9785` --- ### 📝 Commits (1) - [`de2370e`](https://github.com/ubiquitarianism/leonida/commit/de2370ebe709d303d7d56ab758fb51d5ab0899ae) test(xdxr): print the sizes when the compacted-size check fails ### 📊 Changes **1 file changed** (+12 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/vk_xdxr_build_test.cpp` (+12 -1) </details> ### 📄 Description > Carried over from **old PR 9785** by `Voltingg` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9785`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Voltingg`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: TEST-2033 (the claim could not be posted: interactions on this repository are limited to collaborators) ### What and why TEST-2033: `vk_xdxr_build_test.cpp:571` fails on a real Apple M4 with MoltenVK 1.4.2 (`#9396`, built with Zig's clang), while CI's paravirtual Metal device passes. The item asked to tell a compiler issue from a MoltenVK/Metal one. It is not the compiler. On an Apple M1 Pro, macOS 27.3, MoltenVK 1.4.2 (Homebrew): | Compiler | `vk_xdxr_build_test` | full `ctest` | |---|---|---| | Apple clang 21.0.0 | pass, 3/3 runs | 64/64 (2 skipped) | | `zig c++` 0.17.1 (clang 22.1.8, the reporter's) | pass, 3/3 runs | 64/64 (2 skipped) | The `xdxr_build_cases` outputs of the two builds are byte-identical, and `xdxr_build_check` passes. Khronos synchronization validation 1.4.363 reports no hazard in the whole test. Since `EXPECT` returns at the first failure, everything before line 571 passed on the M4. The second half of the condition is implied by the earlier `dump` check (same layout parameters), so on the M4 the GPU's postbuild value differed from the size the host read from the header after the build. The check only printed the condition, so this change prints the values when it fails: compacted size: postbuild 0x..., clone postbuild 0x..., header at build N, header now N, layout N - `postbuild 0xabababab...`: the GPU's write to the 16-byte `info` buffer never reached the host (MoltenVK/Metal, for example a small buffer used only through its device address on Apple9) - `header now` differs from `header at build`: something wrote over `blas_random` after its build - a plausible `postbuild` that differs from an unchanged header: the GPU read a stale header or the wrong address `Built` keeps a pointer to the structure's mapped bytes to read the header again. Nothing changes when the check passes. It applies cleanly on `#8776`, which edits other lines of the same file. ### Tested - Apple M1 Pro, macOS 27.3, MoltenVK 1.4.2, Vulkan loader 1.4.363: builds with Apple clang 21 and Zig 0.17.1 without warnings, and `vk_xdxr_build_test` passes with both. - With the condition forced true, it prints `compacted size: postbuild 0x0000000000021a80, clone postbuild 0x0000000000021a80, header at build 137856, header now 137856, layout 169984`. - Not tested on an M4: a rerun of `vk_xdxr_build_test` there with this change shows which of the three cases it is. - `python -I scripts/check_no_game_data.py runtime/test/vk_xdxr_build_test.cpp`: exit 0. AI-assisted: yes (Claude Code) ### Checklist - [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. (Not applicable: 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#114
No description provided.