2f2147b093
Two bodies of work in one commit (the rename moved files the fixes also touched). Naming/structure cleanup (pre-launch): - Host modules m3.rs->punktfunk1.rs, m0.rs->spike.rs; CLI m3-host->punktfunk1-host, m0->spike; bare `punktfunk-host` now prints help. Types M3Options/M3Source-> Punktfunk1Options/Punktfunk1Source. - Clients consolidated out of crates/ into clients/: punktfunk-client-rs-> clients/probe (crate punktfunk-probe), client-linux->clients/linux, client-windows->clients/windows, punktfunk-android->clients/android/native (crate punktfunk-client-android; kept [lib] name=punktfunk_android so the JNI contract is unchanged). crates/ now holds only core + host. - Milestone codes M0-M4 purged from code/CLI/CLAUDE.md/README/docs/docs-site, kept only in docs/implementation-plan.md. docs/m2-plan.md-> docs/gamestream-host-plan.md. CI/gradle/flatpak paths updated. Client loss-recovery (video froze and never recovered after a brief drop): - Export punktfunk_connection_frames_dropped through the C ABI (the core already tracked it for the client keyframe-recovery loop; it was never reachable from the ABI clients). Regenerated punktfunk_core.h. - Apple (StreamPump + Stage2Pipeline) and Android (decode.rs) now poll frames_dropped and request a keyframe when it climbs -- the same loss-driven recovery Linux/Windows already had. Under infinite GOP the decoder silently conceals reference-missing frames, so the decode-error trigger rarely fires. Apple rumble robustness (worked then went spotty -- DualSense + Xbox): - Add CHHapticEngine stopped/reset handlers (rebuild on app background / audio interruption / server reset) and drop the permanent `broken` latch on a transient drive failure; latch only when the controller truly has no haptics. - Surface swallowed SDL set_rumble errors on Linux/Windows + diagnostic logging. Verified: cargo build/clippy/fmt --workspace, C-ABI harness, header drift. Not runnable on this box (verify in CI): Gitea workflows, gradle/Android, flatpak, Swift/decky. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
48 lines
2.1 KiB
Bash
Executable File
48 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Loopback integration: real punktfunk/1 hosts (synthetic source — pure protocol, runs fine on
|
|
# macOS) on 127.0.0.1, then the Swift integration tests against them through the xcframework.
|
|
# Two hosts: an open one (stream round trip) and one armed with --require-pairing (the PIN
|
|
# ceremony + pairing gate — its random PIN is parsed out of its log).
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/../.."
|
|
|
|
PORT="${PUNKTFUNK_LOOPBACK_PORT:-19778}"
|
|
PAIR_PORT="${PUNKTFUNK_PAIRING_PORT:-19779}"
|
|
|
|
cargo build --release -p punktfunk-host
|
|
|
|
# Each host gets a throwaway config home: the pairing host persists a trust store
|
|
# (punktfunk1-paired.json, resolved from $HOME) and both mint an identity cert on first
|
|
# run — none of that belongs in the user's real ~/.config/punktfunk, and separate homes
|
|
# also keep the two first runs from racing on the same cert.pem.
|
|
CFG="$(mktemp -d "${TMPDIR:-/tmp}/punktfunk-loopback.XXXXXX")"
|
|
PAIR_LOG="$CFG/pairing-host.log"
|
|
mkdir -p "$CFG/open" "$CFG/paired"
|
|
trap 'kill "${HOST_PID:-}" "${PAIR_PID:-}" 2>/dev/null || true' EXIT
|
|
# The open host also scripts a feedback burst (rumble + DualSense hidout) right after the
|
|
# handshake, so the Swift test can assert the host→client feedback planes end to end.
|
|
HOME="$CFG/open" XDG_CONFIG_HOME="$CFG/open/.config" PUNKTFUNK_TEST_FEEDBACK=1 \
|
|
target/release/punktfunk-host punktfunk1-host --port "$PORT" --source synthetic --frames 300 &
|
|
HOST_PID=$!
|
|
HOME="$CFG/paired" XDG_CONFIG_HOME="$CFG/paired/.config" \
|
|
target/release/punktfunk-host punktfunk1-host --port "$PAIR_PORT" --source synthetic --frames 300 \
|
|
--require-pairing >"$PAIR_LOG" 2>&1 &
|
|
PAIR_PID=$!
|
|
sleep 1
|
|
|
|
PIN=""
|
|
for _ in $(seq 50); do
|
|
PIN="$(grep -oE 'pair: [0-9]+' "$PAIR_LOG" | head -1 | cut -d' ' -f2 || true)"
|
|
[ -n "$PIN" ] && break
|
|
sleep 0.2
|
|
done
|
|
if [ -z "$PIN" ]; then
|
|
echo "no arming PIN in the pairing host's log ($PAIR_LOG)" >&2
|
|
exit 1
|
|
fi
|
|
|
|
cd clients/apple
|
|
PUNKTFUNK_LOOPBACK_PORT="$PORT" PUNKTFUNK_PAIRING_PORT="$PAIR_PORT" PUNKTFUNK_PAIRING_PIN="$PIN" \
|
|
PUNKTFUNK_TEST_FEEDBACK=1 \
|
|
swift test --filter LoopbackIntegrationTests
|