gdk_runtime_calls: bound x86 decoding (X86-DECODE-WINDOW) #1041

Merged
leonida/mandy
Taffyyy-ops merged 1 commit from fix/x86-decode-window into main 2026-11-24 22:18:39 +00:00

Pull request successfully merged and closed

Taffyyy-ops commented 2026-11-24 17:07:04 +00:00

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.

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.
morodirule commented 2026-11-24 17:07:41 +00:00

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.

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 approved these changes 2026-11-24 17:18:13 +00:00
KernelSmoker left a comment

Verified on exact head 3efede977f82be464e518e099441a6aced010227 (base d4de3a7df9438bb0781d8d7c8f7f169a2616279f). 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 and git 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.

Verified on exact head 3efede977f82be464e518e099441a6aced010227 (base d4de3a7df9438bb0781d8d7c8f7f169a2616279f). 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 and `git 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 commented 2026-11-24 22:18:36 +00:00

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).

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).
Sign in to join this conversation.
No description provided.