cpu: terminate the native EXE after its entry returns #388
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/394"
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 RonLogic on 2026-11-22T00:13:46Z.
Refs #281.
The CRT-free comparison EXE now enters a small startup wrapper. After the shared entry returns, the fixture's I/O provider compares the image base with the main process module. A native process calls
ExitProcesswith the entry's DWORD. The exact same image returns that DWORD to its host when run throughpe_map_run. AOT explicitly targets the unwind-boundednative_entryexport. The return-based body, mapper, and existing PE header guards remain in use.The new regression starts a worker and waits for its readiness event. It checks the exit status and both pipe EOFs on the native and AOT paths for both selectors and empty stdin. On the mapped path, a separate marker confirms that the host resumes after running the same image. A temporary copy with its startup RVA changed to the original body exercises the failing case and records process, entry thread, live threads, and pipe state before it is cleaned up.
Linux validation: Python checks and documentation checks passed. LLVM MASM and GNU PE linking verified the wrapper and body layout. The wrapped image's exported body produced byte-for-byte identical generated C++ to the direct-entry control, and the PE header guards passed.
Windows CI on
c32318apassed on Windows Server 2025 with MSVC 19.52.37029. All 42 CPU tests passed, includingcpu_aot_exe_entry,cpu_native_exe_chain, andcpu_native_exe_termination. The full non-hardware suite had 117 passes and two WARP capability skips. Both Linux CI jobs passed.This change is independent of #247, #253 and #256. It overlaps with their EXE test registration or translation entry selection. A bounded repeat on the original reproducing machine would supply follow-up evidence about the intermittent case.
Imported from R0Y00/Xbox2Windows. Originally posted by abilliontokens on 2026-11-22T00:41:48Z.
Bounded verification of #394 at
c32318a4c7a3cebcdd6409eca4af6e9d0c02e52bon this reproducing machine, as requested above. The wrapper eliminates the hang signature here — both statistically and with a deliberately live worker.Environment
c32318a4, built with thedevpreset in an isolated worktree. Wrapped binaries:cpu_exe_original.exe8964c971b0239ba78fb55947763c3a2b2febd2ea1184abab5c59107db6ffa6a3cpu_exe_io.dll2596edcbbc96711d03ddda28a43b5e65b7f9daf752ae2b259778b50b440fb6a6cpu_import_provider.dlldc9318dc5f87d687ab43229ee1a724cb827caf9be17a171806f02c4450b2547bLaunch series (pinned probe, quiet host)
Probe: https://gist.github.com/abilliontokens/15e0ef77afd0512acb21fc540417e62a/74a3882975692c728d0748fd4846a5c35fa69c55 —
python probe281_threads.py <launches> <build-dir>, alternating selector bytes, 5 s timeout, diagnostics before kill.main(9bdbb20, exe4304efc1…)c32318a40x60d, 750 ×0x57; the probe aborts on any unexpected exit), both pipes EOFc32318a4,CPU_EXE_TEST_LIVE_WORKER=1The baseline control reproduced on the same machine, same session, before the wrapped series ran.
Test results at
c32318a4cpu_native_exe_termination(5.5 s) — event-confirmed live worker before entry return, native process handle signals + both EOFs + exact bytes/exit for both selectors and empty stdin, the unwrapped negative control stalls as expected, and the mapped path returns to its host (mapped host returned).bvh_wave64_hardware(NVIDIA lanes 32..32),bvh_wave64_warp(WARP 4..4),wave_shuffle_warp(width-4 self-inverse). The #249 same-image chain (cpu_native_exe_chain) and the AOT comparison pass on the wrapped image.Limits
This confirms the candidate on this reproducing environment (Windows 26200.9711, this driver/loader state); it is not a run on the original reporter's machine. No launch stalled in the wrapped series, so there are no new stall diagnostics to compare. Worker-creator identification remains the separate track noted above.
AI-assisted; runs executed locally on the configuration above.