Skip to main content

Module native

Module native 

Source
Expand description

In-process stub host for running a guest natively (non-wasm targets).

It implements the same ABI as the runners’ headless mode: no display or audio, virtual time, in-memory storage, and FNV-1a hashes over presented frames, audio and gfx uploads. It checks arguments like the runners do (frame rate, audio format, frame geometry, storage keys and limits, gfx handles and buffer ranges) and panics where a runner would trap. A harness sets assets/params/input, calls the guest’s gasm_init/gasm_frame, then reads stats. Hashes match gasm-run --headless for deterministic guests.

The state is process-wide: run one guest per process (or per test binary with --test-threads=1).

Modules§

abi
Same signatures as the wasm imports (see sys.rs).

Structs§

Stats

Functions§

begin_frame
Call before each gasm_frame: time_ms is the start of that frame.
end_frame
Call after each gasm_frame so time advances.
set_asset
Harness API.
set_hashing
set_pad
set_param
set_text
Text returned by text_input until the next end_frame.
stats