libtest runs each test on a thread with the default 2 MiB stack. In a debug
build, Device::new() materialises ~301 KiB of struct literals on the stack,
and postcard::from_bytes::<Device> rebuilds the whole value on the stack, so
any Device-constructing unit test (netplay savestate round trips etc.) peaks
at several times that and aborts the ENTIRE test binary with a stack
overflow, taking every other test down with it.
Fix, both layers:
- src/test_util.rs: with_big_stack() runs a test body on an explicitly sized
8 MiB thread (the budget the project already standardises on in
.cargo/config.toml). Regression test: a device serialise/restore/clone
round trip measured to overflow the 2 MiB libtest thread (SIGABRT) and
pass at 8 MiB, plus a size_of::<Device>() < 700 KiB tripwire.
- scripts/gate.sh: export RUST_MIN_STACK=8388608 around step 3 so the
documented gate also covers Device-constructing tests that are not yet
wrapped (the netplay cluster's !15/!18 tests land after this fix).
Verified: cargo test --lib bare (no env) -> 1 passed; full gate -> GATE_OK
with step 3 reporting 1 passed (was 0 on main).