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

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2045
Author: @alexandersato0830
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: codex/shader-index-surrogate-pairs


📝 Commits (1)

  • 19a2151 Decode supplementary characters in shader index JSON

📊 Changes

2 files changed (+36 additions, -7 deletions)

View changed files

📝 runtime/src/shader_library.h (+25 -7)
📝 runtime/test/shader_library_test.cpp (+11 -0)

📄 Description

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.

🔄 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/2045 **Author:** [@alexandersato0830](https://github.com/alexandersato0830) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/shader-index-surrogate-pairs` --- ### 📝 Commits (1) - [`19a2151`](https://github.com/ubiquitarianism/leonida/commit/19a215108e2908d78ca23a3750df59b59dfe82d1) Decode supplementary characters in shader index JSON ### 📊 Changes **2 files changed** (+36 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/shader_library.h` (+25 -7) 📝 `runtime/test/shader_library_test.cpp` (+11 -0) </details> ### 📄 Description Claimed in the coordination issue as: [SHADER-INDEX-SURROGATE-PAIRS](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7171580986) ### 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. --- <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#2051
No description provided.