Decode supplementary Unicode in shader index JSON (SHADER-INDEX-SURROGATE-PAIRS) #2045

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

@⁠alexandersato0830 on GitHub · 2026-11-25 18:56 UTC · original
alexandersato0830:codex/shader-index-surrogate-pairs → main · +36 −7 · 2 files · 1 commits · open

Claimed in the coordination issue as: SHADER-INDEX-SURROGATE-PAIRS

What and why

JSON writers can encode one character outside the Basic Multilingual Plane as two \u escapes. The shader index reader currently encodes those surrogate code units separately, producing invalid UTF-8. Join the pair into one Unicode code point before emitting UTF-8, and refuse an unpaired surrogate. This changes JSON decoding. PR #2043 handles the separate filesystem conversion. RFC 8259, String encoding

Tested

  • The new synthetic JSON regression fails on 9f9a7c5f3 and passes with the fix. It checks a supplementary object key, the highest Unicode code point as a value, and isolated, mismatched or truncated surrogate pairs.
  • Built shader_library_test and ran the CMake shader_library test in RelWithDebInfo on Windows 11 with MSVC 19.51. All cases passed.
  • git diff --check and the source-only check passed.

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

AI-assisted: yes (Codex)

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
**@⁠alexandersato0830** on GitHub · 2026-11-25 18:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2045) `alexandersato0830:codex/shader-index-surrogate-pairs` → `main` · +36 −7 · 2 files · 1 commits · open Claimed in the coordination issue as: [SHADER-INDEX-SURROGATE-PAIRS](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why JSON writers can encode one character outside the Basic Multilingual Plane as two `\u` escapes. The shader index reader currently encodes those surrogate code units separately, producing invalid UTF-8. Join the pair into one Unicode code point before emitting UTF-8, and refuse an unpaired surrogate. This changes JSON decoding. PR #2043 handles the separate filesystem conversion. [RFC 8259, String encoding](https://www.rfc-editor.org/rfc/rfc8259#section-7) ### Tested - The new synthetic JSON regression fails on `9f9a7c5f3` and passes with the fix. It checks a supplementary object key, the highest Unicode code point as a value, and isolated, mismatched or truncated surrogate pairs. - Built `shader_library_test` and ran the CMake `shader_library` test in RelWithDebInfo on Windows 11 with MSVC 19.51. All cases passed. - `git diff --check` and the source-only check passed. GPUs tested: n/a (CPU-only parser test) AI-assisted: yes (Codex) ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys or decryption.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:15:56 +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/2045/head:github-bot/gh-2045'
git switch 'github-bot/gh-2045'

Merge

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