Skip to content

feat: play mode starts simd when it is not running - #58

Open
M4X1K02 wants to merge 12 commits into
Spacefreak18:masterfrom
M4X1K02:feat/play-starts-simd
Open

M4X1K02 wants to merge 12 commits into
Spacefreak18:masterfrom
M4X1K02:feat/play-starts-simd

Conversation

@M4X1K02

@M4X1K02 M4X1K02 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Problem

Telemetry is two processes: simd publishes SimData into shared memory, monocoque consumes it in play mode. The product treated that split as a human launch order (simd, then game, then monocoque). If simd was not already running, play mode looped against empty memory. The manager TUI also wrote status with print(), which corrupts curses.

This PR includes #56 (fail-closed init). Merge #56 first; this one is the rest of the stack.

How it is solved

Ownership of the telemetry stack moves into play-mode startup.

ensure_simd() is called from the game loop (and GUI play entry). It is a no-op if simd is already running. Otherwise it locates a binary ($SIMD, then PATH, then install prefixes including /usr/local/bin and the XDG source-install layout) and starts it via the user unit or the binary. The result is a status, not a guess:

  • SIMD_OK — running or started
  • SIMD_NOT_INSTALLED — tell the user to install simd; do not enter a hollow game loop
  • SIMD_START_FAILED — binary existed but did not come up

The manager’s Start action is then “run play”. It does not have a second daemon step. Stop/restart notes go through the TUI, not stdout.

Docs stop mandating a start order. ctest covers discovery and play-mode start without a packaged daemon.

Test plan

  • Rebased onto current Spacefreak18/master through fix/fail-closed-init
  • cmake + ctest in an isolated ubuntu:24.04 container (4/4, including missing simd and start-simd)
  • Live play against a real sim still wants a human with the game and devices

AI disclaimer. This change was drafted with Cursor. Review process lifetime, binary discovery, and the manager TUI as you would any other contribution. Do not merge on the assistant’s summary alone. The author owns the result.

M4X1K02 and others added 12 commits September 13, 2026 15:39
Hardcoding proc2 broke distros that only ship libprocps, and skipped include dirs for getpid.c. Pass LIBPROC2 or LIBPROCPS through PROC_LIBS instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
Do not treat a failed Moza open as a valid fd, stop spinning if PulseAudio never becomes ready, and keep haptic slip from collapsing to abs() of a float.

Co-authored-by: Cursor <cursoragent@cursor.com>
simulatorapi already exports the procps library publicly, so repeating it on monocoque, the CLI, and the GUI was redundant.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the remaining magic velocity limits and payload loop bound so the fail-closed device paths stay readable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Monocoque locates and launches the required daemon itself. The only human step left is installing simd if the binary is missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
…which corrupts curses.

Co-authored-by: Cursor <cursoragent@cursor.com>
Start and Restart only launch monocoque; simd comes up with it. Missing simd is reported as an install problem instead of a disabled menu item.

Co-authored-by: Cursor <cursoragent@cursor.com>
Tell users to run start-monocoque; enable simd.service at install time when possible. Steam instructions keep the bridge EXE only.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep __pycache__ and .pyc files out of the tree when running monocoque-manager locally.

Co-authored-by: Cursor <cursoragent@cursor.com>
CLI and GUI both go through require_simd(), and LD_LIBRARY_PATH / log path literals are named constants.

Co-authored-by: Cursor <cursoragent@cursor.com>
Menu keys live in one place, and stale PID cleanup no longer nests process checks four layers deep.

Co-authored-by: Cursor <cursoragent@cursor.com>
ctest covers missing vs started simd. Give PR builds cmake/pkg-config and a 30s test timeout so a hung spawn cannot stall the job.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant