mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #596] [CLOSED] rdna2spirv: restrict restore_skipped_instructions to reachable offsets and protect branch targets (OLD-10062) #639
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#639
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/596
Author: @jarvixaiassistant-glitch
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:fix/old-10062-vcc-tuple-fallback📝 Commits (1)
57f5947rdna2spirv: restrict restore_skipped_instructions to reachable offsets and protect branch targets📊 Changes
2 files changed (+117 additions, -21 deletions)
View changed files
📝
tests/semantic/test_vcc_tuple_fallback.py(+64 -1)📝
tools/rdna2spirv.py(+53 -20)📄 Description
Claimed in the coordination issue as: OLD-10062
What and why
Carries forward
old-pr/10062(draft #327) ontomain(d7576d56a), preservingtedin7's original commit verbatim perCONTRIBUTING.mdand adding one focused hardening commit on top:tedin7):restore_vcc_tuples()intools/rdna2spirv.pyrecovers scalar-memory, image, and buffer instructions whose register tuple runs intovcc_lo/vcc_hi(SGPRs 106/107) usingrdna2_decodewhenllvm-mcrejects the first dword and leaves the second dword as invalid/junk/normalized, plus synthetic semantic tests (tests/semantic/test_vcc_tuple_fallback.py) and thedocs/shader_library.mdupdate.JARVIX): Clamps therdna2_decode.decode_bytesslice inrestore_vcc_tuples()toblob[at:min(at + 20, stop)]and checksat + nbytes <= stop. Previously, a 12-byte NSA1image_loadstarting atcode_end - 8with trailing bytes pastcode_endwas decoded acrossstop(pc=0, len=12whencode_end=8). Adds a synthetic regression test (test_nsa_mimg_with_vcc_tuple_does_not_read_past_code_end) verifying rejection when truncated atcode_end=8and restoration when complete atcode_end=12.Tested
All synthetic CPU/stdlib/docs/runtime-path checks on Windows 11 x64, Python 3.12.14, Node v24.19.0 (no game files):
python -I tests/semantic/test_vcc_tuple_fallback.py -v— 5/5 passed (reproduced the 12-byte NSA1 over-read failure before the hardening commit; 5/5 pass after)python -I tests/test_runtime_paths.py— 5/5 passedpython -I tests/test_ci_registration.py— 15/15 passedpython -I scripts/check_no_game_data.py— passed (0 forbidden tracked extensions)python -m compileall -q make_game.py tools tests— passedpython -I tests/test_text_write_line_endings.py,tests/test_report_paths.py,tests/test_i18n_index.py, and alltests/test_docs_*.py— passednode --test tests/test_viewer_streaming.cjs— passedspirv-valrerun: not run (no game files / LLVM / SPIRV-Tools on this host).GPUs tested: n/a (CPU/semantic interpreter tests only)
AI-assisted: yes (JARVIX multi-model team: Antigravity + DeepSeek-V4-Pro + NVIDIA NIM Nemotron-3.5-Lightning & Nemotron-3-Ultra-550B)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (Reuses the existingVCCTuple[s100,...,vcc_lo,vcc_hi]contract documented indocs/design.mdScalar/buffer memory anddocs/shader_library.md.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.