cpu: reject four import bindings the call translator should refuse #655

Manually merged
github merged 1 commit from gh-pr/655/head into gh-pr/655/base 2026-11-26 22:09:13 +00:00
Owner

@⁠Leyukaka on GitHub · 2026-11-22 18:02 UTC · original
Leyukaka:icall-controls → main · +53 −0 · 1 files · 1 commits · merged 2026-11-22 18:31 UTC

Change

This closes four coverage gaps in resolve_import (tools/cpu_call_aot.py). Each was a one-line mutation that let a binding through that the translator should refuse, and every cpu_ test still passed on main with it applied. Only tests/cpu/import_check.py changes (53 added lines); the translator does not.

The named-import case now also calls resolve_import directly with the parsed import entry of the built fixture, and expects these rejections:

Input Expected error Mutation it covers
symbol MIX_ARGS for import mix_args unbound import symbol compared case-insensitively
module name with a trailing dot unbound import trailing dots stripped before the DLL comparison
a second ordinary import at the same IAT slot no unique ordinary import len(matches) != 1 relaxed to not matches
a copy of the provider whose export section lost IMAGE_SCN_MEM_EXECUTE non-executable export execute bit not checked

The unmodified binding is checked first and must resolve to mix_args, so each rejection is reached with otherwise valid inputs. The modified provider is written to the test's temporary directory.

Verification

On d9c6bf6 (branch on 2bb9ee0), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14:

ctest --preset dev --no-tests=error -j 4

All 292 tests pass.

Each mutation was applied to tools/cpu_call_aot.py one at a time, and all cpu_ tests were run. On main, all of them passed for each mutation. On this branch, each fails cpu_aot_import_call.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (No capability changed.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

**@⁠Leyukaka** on GitHub · 2026-11-22 18:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/655) `Leyukaka:icall-controls` → `main` · +53 −0 · 1 files · 1 commits · merged 2026-11-22 18:31 UTC ## Change This closes four coverage gaps in `resolve_import` (`tools/cpu_call_aot.py`). Each was a one-line mutation that let a binding through that the translator should refuse, and every `cpu_` test still passed on `main` with it applied. Only `tests/cpu/import_check.py` changes (53 added lines); the translator does not. The named-import case now also calls `resolve_import` directly with the parsed import entry of the built fixture, and expects these rejections: | Input | Expected error | Mutation it covers | |---|---|---| | symbol `MIX_ARGS` for import `mix_args` | `unbound import` | symbol compared case-insensitively | | module name with a trailing dot | `unbound import` | trailing dots stripped before the DLL comparison | | a second ordinary import at the same IAT slot | `no unique ordinary import` | `len(matches) != 1` relaxed to `not matches` | | a copy of the provider whose export section lost `IMAGE_SCN_MEM_EXECUTE` | `non-executable export` | execute bit not checked | The unmodified binding is checked first and must resolve to `mix_args`, so each rejection is reached with otherwise valid inputs. The modified provider is written to the test's temporary directory. ## Verification On `d9c6bf6` (branch on `2bb9ee0`), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14: ```text ctest --preset dev --no-tests=error -j 4 ``` All 292 tests pass. Each mutation was applied to `tools/cpu_call_aot.py` one at a time, and all `cpu_` tests were run. On `main`, all of them passed for each mutation. On this branch, each fails `cpu_aot_import_call`. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [ ] I updated README/docs when a capability or build requirement changed. (No capability changed.) - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
The import check gains direct resolve_import rejections for a symbol
that differs only in case, a module name with a trailing dot, two
ordinary imports at the same IAT slot, and a provider whose export
section lost its execute bit. Each covers a cpu_call_aot mutation that
passed every cpu_ test before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:09:12 +00:00
github manually merged commit d9c6bf6e49 into gh-pr/655/base 2026-11-26 22:09:13 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.