Repository navigation
Conversation
|
Tested
AI-assisted (Claude Code). |
TEST validation — ApproveValidated on CPU (no GPU, no game files). Single well-scoped check with comprehensive test coverage. What changed: Verification (author): Native probe: 128/128 malformed docs accepted before fix, 0/128 after. Independent verification (465d6a0eac): Full Pairwise: Recommendation: Approve / merge. Well-tested, CPU-only, clear scope, verified by two contributors. No concerns. |
loyrox
left a comment
There was a problem hiding this comment.
Tested 1360169 on NVIDIA GeForce RTX 3060 (driver 621.14 / 32.0.16.2114, Vulkan 1.4.357), Windows 11 10.0.26200, MSVC 19.51.36260 (VS 2026), CMake 4.2, RelWithDebInfo, -DLEONIDA_VULKAN_HEADERS_FETCH=ON: pass.
- Clean build, no errors.
shader_libraryandmodspass, with the new control-character checks running.- Full
ctest: 235/237, identical tomaindde82f2 on the same machine. The two failures are the same onmainand unrelated to this PR:d3d12_vulkan_deviceline 6574tiles == 1andd3d12_depth_resolve(refused resolves report "destination changed"), both already listed in #8426.
|
Tested 1360169 on Windows 11 Pro 10.0.26300, MSVC 14.51 (VS Build Tools 2026), Windows SDK 10.0.26100, NVIDIA GeForce RTX 4060 / 621.24, Khronos Vulkan headers via Merged onto main dde82f2 (clean), full runtime build, AI-assisted (Claude Code). No game files. |
Claimed as RT-739: #7913 (comment) (carried to #8047).
What and why
The shared JSON reader accepted literal newlines, NULs and every other byte below 0x20 inside strings. A malformed shader index or mod manifest therefore passed parsing, including when the invalid byte appeared in an object key. Reject those raw bytes as required by the string grammar in RFC 8259 section 7. Escaped controls remain valid, as do ordinary JSON whitespace outside strings and UTF-8 text. The comparison uses unsigned char so UTF-8 bytes are not mistaken for controls on platforms with signed char.
The implementation is one check in JsonReader::string. Tests cover all 32 controls at the root, in an array, in object keys and in object values; all 32 corresponding Unicode escapes; short escapes; UTF-8 and whitespace controls; and the mod-manifest caller.
Tested
Revision: 1360169, based on main dde82f2. Windows 11, MSVC 19.44.35230, Python 3.12.5, CMake 4.4.5/Ninja. CPU only; GPU and driver not used. All inputs synthetic.
cmake -S runtime -B runtime/build-json-controls -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfocmake --build runtime/build-json-controls --target shader_library_test mods_test --parallel 4ctest --test-dir runtime/build-json-controls -C RelWithDebInfo -R "^(shader_library|mods)$" --output-on-failure: 2/2 pass. Direct mods_test: 51 checks, 0 failures.python -m compileall -q make_game.py tools testsandpython -I make_game.py --help: pass.python -I scripts/run_semantic_tests.py tests/semantic: 447 files / 5,956 tests in 290 s; 2 files fail,test_image_atomics_guardandtest_image_store_d16. These are the previously recorded main failures covered by tests/semantic: three image test files red on main (stale after #4473 and #6805; LLVM_MC on Windows) #7284 (47 atomic-guard subcases and the stale cube-image expectation). This change touches no translator or semantic-test files. No game corpus or GPU run was performed.python -I scripts/check_no_game_data.py runtime/src/shader_library.h runtime/test/shader_library_test.cpp runtime/test/mods_test.cppandgit diff --check: pass.No PR dependencies. Pairwise
git merge-tree --write-treechecks are clean with #7737 (8ffb32c), #7738 (93a80f7) and #7962 (8e93ec5), whose scopes are surrogate pairs, numeric underflow and number syntax. The tree combining this change with #7737 also passes shader_library_test and mods_test (52 checks). None of those other implementations is included here.AI-assisted: yes (Codex).
Checklist