No-op per-test ambient gate off the sim path (time is already real). The
#[kithara::test] macro emits ambient_scope(..) into sync and wasm test
bodies (async-native bodies carry with_ambient per-poll instead), so the
guard must exist (as a ZST) in the off-feature + wasm configs. Under
flash this is the engine’s AmbientScope / ambient_scope. !Send for
auto-trait parity with the engine guard (see FlashScope).
No-op real-time scope off the sim path (time is already real). !Send
(PhantomData<*mut ()>) for auto-trait PARITY with the engine guard: a
consumer compiling against the inert form must not become Send-legal code
that fails to compile under flash.
Inert mirror of the engine-backed yield future. Never produced by the inert
yield_now (off the sim path the real arm is always taken); present so
the surface matches the flash control surface 1:1.
Off the sim path a real I/O operation needs no pacing (time is already
real), so the scope is a ZST no-op. Under flash it is the engine’s
RealIoScope: while held, the virtual clock may not outrun real
time, so virtual watchdogs/timeouts cannot fire spuriously ahead of bytes
still on the wire.
Snapshot the per-test ambient gate for spawn propagation. Off the sim path
the gate does not exist and no test is flash-eligible, so the snapshot is
always false (the engine’s default outside a flash test).
Off the sim path: a prod #[kithara::flash(bool)] async region is an identity
passthrough (no per-poll re-assert needed when time is already real). Under
flash this is the engine’s dynamic.
Off the sim path: a prod #[kithara::flash(bool)] sync region’s RAII guard is
a ZST no-op (time is already real), so an annotated fn compiles away to its
bare body. Under flash this is the engine’s enter_dynamic.
Off the sim path: spawning needs no quiescence bracket, so participate is
an identity passthrough (the real clock already advances on its own). Under
flash this is the engine’s participate, which wraps the future so it
counts in the engine’s active_async while running. The loc spawn-site
identity (used by the engine’s hang dump) is unused off the sim path.
Restore a snapshotted ambient on a spawned child. Off the sim path this is
the ZST no-op guard (see ambient_scope); under flash it re-establishes
the engine’s per-test gate for the child’s lifetime.
Off the sim path the lexical test rewriter’s virtual_* targets alias
the REAL primitives, so a rewritten test body behaves identically to its
unrewritten form (the rewrite is a no-op when flash is off). The
#[kithara::test] macro emits these into EVERY test body, so they must
resolve in the off-feature + wasm configs.
Off the sim path: ambient does not exist, so re-asserting it per poll is an
identity passthrough. Under flash this is the engine’s with_ambient,
which re-establishes the snapshotted ambient around every poll so a future
(e.g. the async test body) keeps its flash-eligibility across .await
thread-hops instead of relying on a one-shot guard set on the first poll.
Cooperative async yield. Off the sim path this always takes the real arm —
the same semantics the engine build uses outside a flash-eligible test:
hand control back to the scheduler once, then resolve.
Off the sim path a prod async #[kithara::flash(bool)] region needs no
per-poll mode re-assert: the wrapper is the future itself. Under flash
this is the engine’s per-poll dynamic-flash wrapper.
Off the sim path a spawned task needs no quiescence accounting, so the
participant wrapper is the future itself. Under flash this is the
engine’s gate wrapper counted in active_async.
Off the sim path ambient does not exist, so there is nothing to re-assert
per poll: the wrapper is the future itself. Under flash this is the
engine’s per-poll ambient re-assert wrapper.