gdk_runtime_calls: bound x86 decoding (X86-DECODE-WINDOW) #1041
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1041"
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?
Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T17:07:04Z.
Claimed in the coordination issue as: X86-DECODE-WINDOW
What and why
Bound the shared x86 decoder to its 15-byte instruction window before scanning prefixes or operands. Previously, a long invalid prefix run scanned the entire remaining buffer before rejection. Invalid offsets now return None without reading the buffer.
Tested
74 unittest tests passed on Windows, including four new synthetic regression tests. The regression tests fail against the original decoder.
Coverage: decode window, GDK runtime calls, import fail-fast, import call sites, int3 cause, text line endings.
check_no_game_data.py and git diff --check passed.
GPUs tested: n/a; CPU-only Python change.
AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by morodirule on 2026-11-24T17:07:41Z.
Independent Linux check (stdlib only, no game/GPU): 4/4 pass on head
3efede977. Same file against the unmodified decoder fails 2 tests + 1 error — reads rescan up to offset 4103 (unbounded tail rescan) and out-of-range offsets error instead of returning None — so the new tests pin exactly the reported behavior. Not claiming; review evidence.Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T17:18:13Z.
Review: APPROVED
Verified on exact head
3efede977f(based4de3a7df9). All reported focused Linux suites pass: decode-window 4/4, GDK runtime calls 23/23, import fail-fast 8/8, import call sites 21/21, int3 cause 15/15, line endings 3/3 (74 total). The changed files pass no-game-data andgit diff --check; the patch merges cleanly onto the newer current main. The regression observes byte reads and verifies long prefix runs are capped at 15 bytes, truncated operands fail, valid 15-byte instructions decode, and invalid offsets read nothing. Synthetic CPU-only tests.Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T22:18:36Z.
Merging.
Why merged: X86-DECODE-WINDOW: gdk_runtime_calls.decode reads at most 15 bytes (the x86 maximum) and rejects out-of-range offsets. morodirule showed the new test fails on the base, and KernelSmoker checked it.
Why it's good: Its tests plus the related gdk, import_call_sites, import_fail_fast, int3_cause and first_look tests: 74 passed.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main
4a50cafc7. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new subprocesses, new env vars or CI changes.AI-assisted (Claude Code, Claude Opus 5.5).