gdk_runtime_calls: bound x86 decoding (X86-DECODE-WINDOW) #1041
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1041
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1041/head"
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?
@Taffyyy-ops on GitHub · 2026-11-24 17:07 UTC · original
Taffyyy-ops:fix/x86-decode-window→main· +58 −1 · 2 files · 1 commits · merged 2026-11-24 22:18 UTCClaimed 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.
@morodirule on GitHub · 2026-11-24 17:07 UTC · original
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.@KernelSmoker on GitHub · 2026-11-24 17:18 UTC · original · approved these changes
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.@QemmHD on GitHub · 2026-11-24 22:18 UTC · original
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).