← Back to Pull requests

Mac Native: fixes from the owner's first play session on Metal (book, sound library, hidden runs) #282

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 22, 2026 19:51 UTC
Author

Part of #246 (done test, check 5: the owner's play session on the Metal build). The first session found faults; this fixes them and closes two ways a hidden run could reach the screen.

What the session found

1. The attribute book of the Fallout 3 opening was upside down and could not be passed with a game pad.
2. Very loud static when a menu opened during the first spoken line.
3. A hidden run made for these fixes put a macOS box on the screen ("reopen windows?"), and another was ended by macOS for asking for headphone motion.

The book

  • Cause: the screen's own script turned the book with rows of the opposite sign to the game's. It was upside down and seen from the back, on both builds (not a fault of the Metal renderer; the two builds drew the same wrong picture).

  • The book now faces the camera, right way up, and opens closed on its cover (the rules started the first page's clip while it sat on the cover, which hid the cover's button).

  • The pad's triggers turn the pages, as the book's own button faces say. Only the shoulder buttons did.

  • A new event lets a round press a key or pad button on the character screens, through the same handlers as a real press. With it a hidden round on both builds turned pages, spent all points and closed the screen.

  • Pictures before and after on both builds match each other; the face screen, the lock screen and the New Vegas attribute machine were checked on both builds too and match.
  • The static

  • The build the owner played linked Apple's OpenAL framework instead of OpenAL Soft: a local configure picked the SDK's framework without a word. The packaged app never does (the package check refuses it).

  • On OpenAL Soft the fault does not show: the same moment was recorded to a file in hidden rounds, with a menu opened during the line, plain and with HRTF. No noise burst in any recording. Reading the pause path found nothing that touches sound when a menu opens.

  • Not proven that Apple's library was the cause (it cannot write to a file); the owner's next session on OpenAL Soft will tell.

  • Configure now stops when CMake finds Apple's OpenAL.framework, and says what to pass. CI is not affected: it finds the dependency set's library.
  • Hidden runs never reach the screen or the speakers

  • Sound of a round goes to a file, never to a device (OpenAL Soft's wave output; kept only when the round asks). A round with sound is refused on an engine that links Apple's framework. A new step opens the pause menu.

  • Head tracking never starts in a headless run, and never when macOS would end the game for asking: macOS charges a motion request to the app that started the game and reads the usage text from that app. The engine checks first and logs a warning instead. (The lookup of that app uses a system function without public documentation, found by name; without it the engine checks its own bundle.)

  • The engine tells AppKit to ignore saved window state first thing in main, before anything makes the application object. SDL registers the same default, but only after the application has finished launching. Proven: the default is registered before any application object exists. Not proven by experiment: that this stops the box (nobody should provoke it); it rests on AppKit's documented behaviour.
  • Tests

  • Metal build: openfallout-tests 929 pass; components-tests 7,237 pass, 1 fails locally (OsgNotifyThreadsTest, an old local OpenSceneGraph build without the repository's patch 0006; it failed the same way before this branch).

  • OpenGL build (book commits): 917 and 7,238 pass.

  • Python: scripts/openfallout 415 OK (with lupa), CI 398 OK, check_core_edges.py 0 violations.

  • New tests: the book's rows and keys (lupa), the book's opening state (gtest), the head-tracking start rule (gtest), the saved-window-state default (gtest), the OpenAL configure guard (configures a small project both ways), the runner's sound output and pause-menu step.
  • 🤖 Generated with Claude Code

    <!-- CURSOR_SUMMARY -->
    ---

    [!NOTE]

    Medium Risk

    Touches macOS startup (AppKit defaults), privacy-sensitive motion access, and CMake/sound linkage paths that affect every developer build and CI rounds with audio.

    > Overview

    Addresses issues from the first Metal play session: the Fallout 3 SPECIAL book is re-oriented (matrix rows), opens closed on the cover in C++ (specialscreen), and accepts trigger and shoulder page turns; char-gen Lua exposes FalloutChargenPress and refactored pad/key handlers so rounds can drive those screens without real input.

    > Configure now fails if CMake picks Apple's OpenAL.framework, with a new CI configure test and build-baseline notes for linking OpenAL Soft. Headless rounds route enabled sound through OpenAL Soft's wave backend to sound.wav or /dev/null, reject engines linked to system OpenAL, and add r.pauseMenu plus optional keep_sound.

    > On macOS startup, ignoreSavedWindowState() runs in main before SDL/AppKit creates the app object, with gtests for the native bridge. Head tracking is gated via applyHeadTrackingSetting: it stays off in headless runs and when the responsible app's Info.plist lacks NSMotionUsageDescription (checked without starting Core Motion).

    > <sup>Reviewed by Cursor Bugbot for commit 77f90f8a7f48bedb92b599677f3ed14569b7a0f7. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

    <!-- /CURSOR_SUMMARY -->

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Head tracking now starts only when enabled and the responsible app has a motion-usage description; headless runs skip motion access.
    Controller triggers can turn pages in the SPECIAL book. Round scripts can open or close the pause menu and send character-generation input.
    Headless runs can save audio output to sound.wav.
    macOS now ignores saved window state when launching the game.
    Bug Fixes
    Corrected the SPECIAL book’s initial page and orientation.
    macOS configuration now reports an error if Apple’s OpenAL framework is selected.
    Documentation
    Updated build, head-tracking, and round-script references.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: cursor[bot] Review duration: 20m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #282"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.7% · Safe to merge
    27.7%