Maelstrom: final API is select; SDL drain attribution is not established
Historical source last updated, 2026-10-24. Runtime and implementation claims below describe that dated source; see current app notes and source for subsequent changes.
The captured final EIP 0x075040f8 is WSOCK32 select, proven through the authentic SDL_net import table and the exact historical loader allocation, rather than inferred from the address. The previous capture's zero 0x4019ab counter cannot establish that HandleEvents never returned: this address is an interior instruction of the block beginning at 0x4019a8. The historical counter checks block-entry EIP. A source-anchored executable counterexample reaches Sync0x40e000 while the 0x4019ab count remains zero. This corrects the causal interpretation of the prior capture, without changing its observations or bytes.
This task proves an instrumentation limitation and the final API identity. It does not prove a permanent hang, an SDL event/mutex defect, a Winsock implementation defect, or gameplay acceptance. No production repair, compilation, module instantiation, guest, browser, box operation, build or deployment occurred.
Exact binding and byte evidence
The unchanged raw log reports SDL import processing ending at2069 thunks, then SDL_net ending at2091; all DllMain calls follow import patching. Authentic SDL_net has22 system imports, in descriptor/ILT order:21 WSOCK32 ordinal imports followed by KERNEL32 DisableThreadLibraryCalls. SDL and CRT dependencies resolve against already loaded modules. Historical process_dll_imports reserves exactly one slot per system import; thunk_reserve atomically increments the shared cursor. SDL_net's WSOCK32 ordinal18 is system import10 at preferred IAT0x10002050. Therefore slot2069+10=2079, address0x07500000+8*2079=0x075040f8. The historical ordinal resolver maps18 to select. Later thunk allocations cannot move this earlier slot. The final register line names that exact address, independently of candidate stack words.
Original SDL_net call0x1000135d (e8ee090000) targets jump0x10001d50 (ff2550200010), through that same IAT. Its return0x10001362 relocates with SDL_net base0x7a2000 to0x7a3362. At both39000/41900 the captured slot0x074ffb18 contains0x7a3362; the final ESP is0x074ffb18. Candidate arguments are nfds0x53000001, readfds0x074ffb50, writefds0, exceptfds0, timeval0x074ffb48. The sampled timeval is{1,0}:1000ms. These samples precede the final register print; they are not a simultaneous final unwind. Nevertheless the exact final thunk binding is established without them.
The older SDL return0x688a92 matches call0x10022a8c through IAT0x1002a07c = KERNEL32 ReleaseMutex. The historical ReleaseMutex handler calls host_set_event with a private high bit, returns success/failure, and consumes8 stack bytes; it has no WAT parking loop. SDL unlock then returns0 or-1. This does not prove host mutex correctness or ownership, but it rejects treating that old return word as evidence that the final EIP is ReleaseMutex. The older HandleEvents/PeepEvents return chain can survive below the current stack pointer after those functions return. Neither stale-looking network words nor stale-looking SDL words are a formal unwind.
Original disassembly is retained in original-boundary.asm (historical artifact: maelstrom-sdl-event-drain-cause-20261024/original-boundary.asm), covering538 input instruction bytes. No original executable bytes were changed. The helper rechecks the original entire DLL/EXE hashes before parsing them.
Why the earlier phase counter was insufficient
RunFrame calls HandleEvents at0x4019a3. Its return PC is0x4019a8, where the original instructions are 83c404 e850c60000: ADD ESP,4 followed by CALL Sync at0x4019ab, returning0x4019b0. Nothing branches to the interior call address on this path. Historical run-loop counters compare the armed address with EIP before executing the decoded block. Debug arming disables block chaining via dbg_chain_guard; it does not insert a split at every armed instruction. The counterexample takes the authentic block's control effects, counts entry0x4019a8, and reaches Sync0x40e000 with count0x4019ab still0. This is a bounded block model, not full emulator execution. It demonstrates that the previous inference is invalid, rather than demonstrating all captured execution paths.
The previous after-input address was also labeled Sync entry, but actual Sync entry is0x40e000. A zero counter at0x4019ab cannot certify Sync was not reached. The capture contains a candidate0x4019b0 return at0x074ffe9c, compatible with the real Sync call, and SDL_net data compatible with a socket wait. We do not promote those words to a formal active Sync frame. The final select identity and invalid zero-counter inference are the substantiated advances. The stars/no-HUD screenshot remains nonacceptance.
Historical return semantics and precise remaining boundary
Exact sourceb41a7c5f4b752d1f0bdab1141a11d4fed4dc6f9a handle_select first advances ESP by24, pumps sockets, and checks readiness without modifying fd_sets. With no readiness and positive timeval it initializes a deadline once, then uses signed tick-deadline comparison. vsock_block(24) restores ESP, sets handler_set_eip, EIP=current_thunk_eip, yield_reason8 and steps0. Reentry preserves the original call frame. On timeout/readiness it clears vsock_sel_waiting, filters fd_sets and returns total. The unchanged canonical harness clears yield8, yields to the host event loop and pumps VLAN. The sampled nonnull one-second timeval rules out a null-timeval infinite wait for that sampled frame, but no deadline, readiness state, API entry/exit sequence or final timeval was captured. Repeated select invocations can look identical to a single parked invocation in snapshots. We cannot infer duration from unchanged stack bytes or a final thunk alone.
The remaining boundary is whether this select invocation returns, and whether PollEvent returns occur during the same window. A future coordinator-authorized capture can settle it with one bounded window on the same exact module/harness (no such run performed here):
- Arm three genuine entry/return boundaries before execution:
--count=0x40287d,0x7a3362,0x40e000. They are respectively the loop PollEvent return block, SDL_net select return block, and actual Sync entry. Byte-check their relocated identities before launch. Retain the existing once-after-wave observation. - At the first select thunk after the after-wave marker, obtain one trace with
--trace-at=0x075040f8 --trace-at-limit=1, recording EIP/ESP, six call-frame words, pointed timeval and fd_set. In this historical harness use the already validated trace-at dump/pointer parser; use the same-task canonical argv validation before any run. Do not assume an interior instruction breakpoint is reachable. The thunk is reachable as a parked reentry EIP, as the existing final state demonstrates. - Emit the three counts immediately before that window and after ten200ms batches (2s, twice the sampled timeout), with guest tick and yield reason at both endpoints. If necessary allow a bounded continuation to observe a real return; a two-second miss alone is not proof of permanent nontermination. Output ceiling8KiB, no screenshot needed. Stop the observation at the bound and hand lifecycle back to the coordinator.
Increasing PollEvent returns establish completed drain iterations, consistent with replenishment; establish the event type/producer only if those iterations actually continue. Increasing select returns establish repeated completed socket polls, rejecting a single stuck select even if the final EIP repeats. Select entries/reentries with no select return and progressing ticks isolate the single-API boundary; inspect its retained deadline/readiness before proposing a repair. No PollEvent-return increase alongside select returns redirects investigation away from replenished SDL events. Positive actual Sync-entry count directly rejects the earlier input-drain attribution. These observations distinguish the competing paths without interpreting old return slots as active frames.
Reproduction, controls and limits
timeout 60s python3 tools/maelstrom-sdl-boundary.py \
--game scratch/runs/<run-id>/Maelstrom-3.0.6 \
--source-repo /home/user/wine-assembly-shadow-man-span-static-canonical-oct23 \
--harness scratch/runs/<run-id>/canonical-run.js \
--wasm /home/user/wine-assembly-shadow-man-span-static-canonical-oct23/build/wine-assembly.wasm \
--out scratch/runs/<run-id>/maelstrom-sdl-boundary-result.json
The result (historical artifact: maelstrom-sdl-event-drain-cause-20261024/result.json) passes all six controls: changed call byte, incorrect SDL_net relocation, shifted allocation cursor, wrong ordinal binding, false mutex-thunk claim, and false zero-counter/no-Sync inference. The helper reads the WASM only to hash it; it imports no executable source from the donor. It reads exact historical Git blobs, checks full-file length/SHA256 and byte-exact line slices against historical-slices.json (historical artifact: maelstrom-sdl-event-drain-cause-20261024/historical-slices.json). Recorded excerpts are at most8KiB each,15497 bytes total. Original code input is538 bytes; all inspection/disassembly in this task conservatively charged below16KiB, under64KiB. It does not model the entire socket transport or host mutex machinery and claims no defect from the counterexample. No source or oracle was altered to make an actual runtime failure pass.