Normalize SPIR-V file byte order (SPIRV-WORDS-ENDIAN) #2051

Open
github-bot wants to merge 1 commit from github-bot/gh-2051 into main AGit
Owner

@⁠alexandersato0830 on GitHub · 2026-11-25 19:02 UTC · original
alexandersato0830:codex/spirv-word-endianness → main · +23 −3 · 2 files · 1 commits · open

Claimed in the coordination issue as: SPIRV-WORDS-ENDIAN

What and why

The shared shader reader rejected SPIR-V files in the opposite byte order, although the Python reflector accepts either order. Use the SPIR-V magic to detect the file’s byte order and return native-endian words to Vulkan. The existing byte-count and short-read checks still apply. SPIR-V binary format · Vulkan SPIR-V environment

Tested

  • On Windows 11, MSVC 19.51, CMake RelWithDebInfo: the word-by-word reversed synthetic fixture failed on main 9f9a7c5 and the shader_library CTest target passed with the fix. The test checks the entire output, including a word beyond the header.
  • Verified the source-only check and git diff --check.

GPUs tested: n/a (CPU-only reader test).

AI-assisted: yes.

  • Based on current main.
  • One topic.
  • Uses source and synthetic test words only.
**@⁠alexandersato0830** on GitHub · 2026-11-25 19:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2051) `alexandersato0830:codex/spirv-word-endianness` → `main` · +23 −3 · 2 files · 1 commits · open Claimed in the coordination issue as: [SPIRV-WORDS-ENDIAN](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why The shared shader reader rejected SPIR-V files in the opposite byte order, although the Python reflector accepts either order. Use the SPIR-V magic to detect the file’s byte order and return native-endian words to Vulkan. The existing byte-count and short-read checks still apply. [SPIR-V binary format](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#MagicNumber) · [Vulkan SPIR-V environment](https://docs.vulkan.org/spec/latest/appendices/spirvenv.html) ### Tested - On Windows 11, MSVC 19.51, CMake RelWithDebInfo: the word-by-word reversed synthetic fixture failed on main `9f9a7c5` and the `shader_library` CTest target passed with the fix. The test checks the entire output, including a word beyond the header. - Verified the source-only check and `git diff --check`. GPUs tested: n/a (CPU-only reader test). AI-assisted: yes. - [x] Based on current `main`. - [x] One topic. - [x] Uses source and synthetic test words only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:16:08 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2051/head:github-bot/gh-2051'
git switch 'github-bot/gh-2051'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2051'
git switch 'github-bot/gh-2051'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2051'
git switch 'github-bot/gh-2051'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2051'
git switch 'main'
git merge --squash 'github-bot/gh-2051'
git switch 'main'
git merge --ff-only 'github-bot/gh-2051'
git switch 'main'
git merge 'github-bot/gh-2051'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.