cpu: cover seven string direction and single-transfer lowerings #716
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/722"
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 R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T22:52:02Z.
Change
This closes seven coverage gaps in the direction-flag tracking and single-element string transfers of
tools/cpu_switch_aot.py. Each was a one-line mutation that passed everycpu_test onmain. The string fixture (tests/cpu/switch_strings.{asm,def,py}) and its counts indocs/experiments.mdchange; the translator does not.once_movsb_cleared: STD, then CLD, then one MOVSB (must step forward)PAGE_NOACCESSpage (must fault)bad_df_mixed_call: STD on one path before a callbad_df_host_call: STD before a bound host callbad_df_back_edge: STD on a loop back edge reaching RETbad_once_stosb_rcx: RCX read after a call and one STOSB67 a4(addr32 MOVSB) lowered directly (must be rejected)The
bad_*functions are only translated, never executed.bad_df_host_calluses the raw bytes ofcall [rip+0], and the check gives it a syntheticHostImport. The documented counts become 43 exports, 24,915 comparisons and 96 access violations, from this run.Verification
On
dfc7623(branch on787ace7), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14:All 304 tests pass.
tests/docs_links_check.pypasses.Each mutation was applied to
tools/cpu_switch_aot.pyone at a time, the project was rebuilt, and allcpu_tests were run. Onmain, all of them passed for each mutation. A control that made STD leave DF clear was caught bycpu_aot_switch_strings, so the run does detect a broken translator. On this branch, each of the seven mutations failscpu_aot_switch_strings.Checklist
AI-assisted.