From 9c19d22349bcfb833f737f82390555e4de4b651e Mon Sep 17 00:00:00 2001 From: Ethan Stokes Date: Sat, 24 Oct 2026 19:36:54 -0500 Subject: [PATCH 1/3] Fix macOS physics playback and queued input ownership --- .github/workflows/checks.yml | 36 ++++++ .github/workflows/multi-platform.yml | 11 +- .gitignore | 6 + CMakeLists.txt | 10 +- CMakePresets.json | 37 ++++++ README.md | 82 ++++++++++++ docs/macos-parity.md | 39 ++++++ mod.json | 2 +- scripts/autotest-macos.py | 187 +++++++++++++++++++++++++++ scripts/dev-env.sh | 12 ++ src/main.cpp | 176 ++++++++++++++++++++----- 11 files changed, 566 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/checks.yml create mode 100644 CMakePresets.json create mode 100644 docs/macos-parity.md create mode 100644 scripts/autotest-macos.py create mode 100644 scripts/dev-env.sh diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..68f205c --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,36 @@ +name: Build checks +on: + push: + pull_request: + workflow_dispatch: +permissions: + contents: read +jobs: + build: + name: ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + include: + - name: Windows + os: windows-latest + target: Win64 + - name: macOS universal + os: macos-latest + target: MacOS + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Build embedded engine + id: engine + uses: ./.github/actions/build-engine + - name: Build mod + uses: geode-sdk/build-geode-mod@a0f7676e6fcd1a584f6d0c1c800239008412defc + with: + sdk: given + bindings-ref: 1605f500d053f8de122bf5c7dc6d17c24866e02e + target: ${{ matrix.target }} + combine: true + configure-args: >- + -DBLOCKWORK_FFI_LIB="${{ steps.engine.outputs.ffi-lib }}" + -DBLOCKWORK_FFI_INCLUDE_DIR="${{ steps.engine.outputs.ffi-include }}" diff --git a/.github/workflows/multi-platform.yml b/.github/workflows/multi-platform.yml index 54bb850..d9faa0a 100644 --- a/.github/workflows/multi-platform.yml +++ b/.github/workflows/multi-platform.yml @@ -72,11 +72,20 @@ jobs: with: ref: ${{ github.ref_name }} + - name: Build embedded engine + id: engine + uses: ./.github/actions/build-engine + - name: Build the mod - uses: geode-sdk/build-geode-mod@main + uses: geode-sdk/build-geode-mod@a0f7676e6fcd1a584f6d0c1c800239008412defc with: combine: true + sdk: given + bindings-ref: 1605f500d053f8de122bf5c7dc6d17c24866e02e target: ${{ matrix.config.target }} + configure-args: >- + -DBLOCKWORK_FFI_LIB="${{ steps.engine.outputs.ffi-lib }}" + -DBLOCKWORK_FFI_INCLUDE_DIR="${{ steps.engine.outputs.ffi-include }}" release: name: Combine and release diff --git a/.gitignore b/.gitignore index e0675fa..6c7585d 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,9 @@ winsdk_vfs_overlay.yaml # Python bytecode caches __pycache__/ *.py[cod] +# Local Geode SDK and CMake user configuration +.tools/ +CMakeUserPresets.json + +# Embedded engine checkout used by CI +/.blockwork-engine/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ec7d4a..a662b0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) if ("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS) set(CMAKE_OSX_ARCHITECTURES "arm64") -else() +elseif (NOT DEFINED CMAKE_OSX_ARCHITECTURES) set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") endif() set(CMAKE_CXX_VISIBILITY_PRESET hidden) @@ -57,9 +57,17 @@ endif() if (APPLE AND NOT IOS) find_library(CORE_FOUNDATION_LIB CoreFoundation REQUIRED) find_library(APPLICATION_SERVICES_LIB ApplicationServices REQUIRED) + find_library(SECURITY_LIB Security REQUIRED) + find_library(IOKIT_LIB IOKit REQUIRED) + find_library(APPKIT_LIB AppKit REQUIRED) + find_library(CORE_GRAPHICS_LIB CoreGraphics REQUIRED) target_link_libraries(${PROJECT_NAME} ${BLOCKWORK_FFI_LIB} ${CORE_FOUNDATION_LIB} ${APPLICATION_SERVICES_LIB} + ${SECURITY_LIB} + ${IOKIT_LIB} + ${APPKIT_LIB} + ${CORE_GRAPHICS_LIB} ) endif() diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..568e1df --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,37 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "mac-dev", + "displayName": "Geode macOS development (Apple Silicon)", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/mac-dev", + "environment": { + "PATH": "$penv{HOME}/.local/bin:$penv{PATH}", + "GEODE_SDK": "${sourceDir}/.tools/geode-sdk", + "CPM_SOURCE_CACHE": "${sourceDir}/.tools/cpm-cache", + "GEODE_BINDINGS_REPO_PATH": "${sourceDir}/.tools/bindings" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_OSX_ARCHITECTURES": "arm64", + "CMAKE_EXPORT_COMPILE_COMMANDS": true, + "SKIP_BUILDING_CODEGEN": false, + "BLOCKWORK_FFI_LIB": "${sourceDir}/../Blockwork/target/aarch64-apple-darwin/release/libblockwork_ffi.a", + "BLOCKWORK_FFI_INCLUDE_DIR": "${sourceDir}/../Blockwork/blockwork-ffi/include" + } + } + ], + "buildPresets": [ + { + "name": "mac-dev", + "configurePreset": "mac-dev", + "jobs": 4 + } + ] +} diff --git a/README.md b/README.md index 699a93c..20f4f67 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,58 @@ This is where she makes a mod. We recommend heading over to [the getting started section on our docs](https://docs.geode-sdk.org/getting-started/) for useful info on what to do next. ## Build instructions +### Local macOS development + +The local environment uses Geode SDK **v5.11.2**, bindings commit +`1605f500` (matching that release), and Geometry Dash **2.2081**. +The SDK, bindings, and dependency cache live in the ignored `.tools/` directory. +The Geode CLI is installed in `~/.local/bin`. + +```sh +source scripts/dev-env.sh +MACOSX_DEPLOYMENT_TARGET=13.0 cargo build -p blockwork-ffi --release --target aarch64-apple-darwin --manifest-path ../Blockwork/Cargo.toml +cmake --preset mac-dev +cmake --build --preset mac-dev +``` + +The `mac-dev` preset links the Rust engine from the sibling `../Blockwork` +checkout, including its macOS backend fixes. Rebuild that library when the engine changes. +The older `.tools/blockwork-engine` checkout is retained but is no longer the preset’s source. The preset builds +for Apple Silicon with debug symbols and generates +`build/mac-dev/compile_commands.json` for editor code completion. Open this +directory as a CMake project in CLion and select the `mac-dev` preset. +The build packages the mod and installs it into the CLI's active GD profile. +Restart Geometry Dash to load a rebuilt mod. + +```sh +geode profile list +geode run +``` + +The official `geode.devtools` mod is also installed in the local game; restart +the game to load it. Its tools can be opened with **F10** (or **Fn+F10**, depending +on your keyboard settings). + +To recreate the SDK checkout on another Mac: + +```sh +mkdir -p .tools +git clone --branch v5.11.2 --depth 1 https://github.com/geode-sdk/geode .tools/geode-sdk +git clone https://github.com/geode-sdk/bindings .tools/bindings +git -C .tools/bindings checkout 1605f500 +git clone https://github.com/Blockworked/Blockwork ../Blockwork +git -C ../Blockwork checkout e285eac69af1759811b39aeedd861653bd06a30b +source scripts/dev-env.sh +geode sdk install-binaries +geode profile add "$HOME/Library/Application Support/Steam/steamapps/common/Geometry Dash/Geometry Dash.app" --name gd-2.2081 mac +``` + +Keep this SDK pinned while using the downgraded game. The existing `build.sh` +is an older Windows cross-compilation script with machine-specific paths; +use the presets above for local macOS work. + +### Other platforms + For more info, see [our docs](https://docs.geode-sdk.org/getting-started/create-mod#build) ```sh # Assuming you have the Geode CLI set up already @@ -21,3 +73,33 @@ geode build * [Geode CLI](https://github.com/geode-sdk/cli) * [Bindings](https://github.com/geode-sdk/bindings/) * [Dev Tools](https://github.com/geode-sdk/DevTools) + +### Native macOS integration tests + +Build and install the mod first, close Geometry Dash and the Blockwork daemon, +then run: + +```sh +python3 scripts/autotest-macos.py --level 'Bloodbath Infinity 2' --runs 1 --speed 1 --output /tmp/blockwork-gd-normal +python3 scripts/autotest-macos.py --level 'Bloodbath Infinity 2' --runs 10 --speed 10 --output /tmp/blockwork-gd-10x +``` + +Each attempt freshly imports `~/Downloads/ChesszDC-Bloodbath-Infinity-zBot.gdr` +inside the game, links that new macro to the requested local level, and verifies +its identity in the terminal result. The runner launches through Steam: direct +Geode CLI launches exited before the menu on this installation. It temporarily +enables QOL safe mode, disables noclip and unrelated mods, sets the requested QOL +speed, and restores configuration files after stopping its game process. Existing +game saves are backed up. The output directory must be new; it contains replay +hashes, fresh macro copies, configuration backups, logs and result manifests. +A failed attempt stops the batch. Passing a finite batch is evidence for that +batch, not a guarantee about all future hardware and mod configurations. + +On macOS, the game inlines `processCommands` into its update loop. Playback and +step recording therefore use `processQueuedButtons`, the called physics-step +boundary. Other platforms retain the existing `processCommands` hook. + +CI builds the pinned Blockwork FFI library before building the mod. macOS uses a +universal arm64/x86_64 archive; Windows uses the MSVC static library. Both the +non-publishing checks and the release workflow pass the generated library and +header paths to CMake. The release workflow remains manually dispatched. diff --git a/docs/macos-parity.md b/docs/macos-parity.md new file mode 100644 index 0000000..d9900ac --- /dev/null +++ b/docs/macos-parity.md @@ -0,0 +1,39 @@ +# macOS integration verification + +In progress. The live acceptance fixture is the local **Bloodbath Infinity 2** level and fresh imports of `~/Downloads/ChesszDC-Bloodbath-Infinity-zBot.gdr`. The existing user replay is not used as the acceptance macro. + +## Platform fix + +The macOS game inlines `GJBaseGameLayer::processCommands` into `update`. Its standalone function is hookable but is not called by normal play. Before the fix, a fresh import succeeded, playback remained at step zero, and the player died at 1.36%. + +macOS now advances host-clock playback and recording at the called `processQueuedButtons` boundary, before the game consumes input. Zero-delta cleanup calls do not advance the clock. Windows retains its original `processCommands` boundary. The Mac build links the current sibling Blockwork engine and the AppKit/CoreGraphics frameworks required by its native backend. + +The native test runner launches through Steam, imports the GDR anew for every attempt, links the exact new macro to the requested local level, and records a result carrying a unique run identifier, macro identifier, selected identifier, level, step, completion/death state and elapsed time. The runner rejects results for another run or an existing macro. It keeps each imported macro and the logs in the evidence directory. QOL safe mode is on and noclip is off; unrelated mods are disabled. Configuration and game saves are backed up and restored after the owned game process stops. + +Queued playback also needed an ownership fix: the input-blocking hook was rejecting the mod’s own clicks when the game consumed them after the enqueue callback returned. Playback now retains the exact queued-command identities, filters foreign entries, and marks its own consumption scope. A stray queued press injected before the first recorded jump was rejected while the full 10x replay completed. Its 724 input events and all positions through the input phase match direct playback. Repeated tests with the user’s queue + click-between-steps options are in progress. + +## Observed results + +Environment: macOS 27.0.1, Apple Silicon, Geometry Dash 2.2081, Geode 5.11.2, bindings `1605f500`, QOL Mod 2.8.6. GDR SHA-256: `5700a2eb9213f2cc8e4303ec1966c169145804770048f9f12f733fe4d3b94efe`. + +| Gate | Evidence | +|---|---| +| Normal-speed completion | Fresh import completed the local level at 100%, step 27,081, 114.18 seconds from PlayLayer initialization. `/tmp/blockwork-gd-macos-physics-hook-1/manifest.json` | +| QOL 10x completion | Another fresh import completed at 100%, approximately 11.68 seconds. `/tmp/blockwork-gd-macos-10x-trace-1/manifest.json` | +| Input accuracy | All 724 emitted input events had identical names, directions and step numbers at normal speed and 10x. Position traces matched through step 26,840; the final input was step 26,741. Differences began during the finish sequence. `/tmp/blockwork-gd-macos-normal-vs-10x-trace.json` | +| Repeated 10x acceptance | 20/20 completed successfully using 20 distinct fresh imports, with no host-clock timeout warnings. Level time ranged from 11.67–11.74 seconds. `/tmp/blockwork-gd-macos-10x-batch-20/manifest.json`. | + +`getCurrentPercent()` may still be slightly below 100 at the game's `levelComplete` callback because it derives progress from position. The authoritative success event is the game completing the level with the player alive; the raw percentage is retained in the result, not rounded to manufacture success. + +## Reproduce + +Follow the macOS build steps in the README, close GD and the Blockwork daemon, then run: + +```sh +python3 scripts/autotest-macos.py --runs 1 --speed 1 --trace --output /tmp/blockwork-gd-normal-new +python3 scripts/autotest-macos.py --runs 20 --speed 10 --output /tmp/blockwork-gd-10x-new +``` + +The output directory must not already exist. `--queue`, `--cbs`, `--offset` and `--trace` explicitly select developer options. The successful reference runs use offset -1, queue off and click-between-steps off. Finite successful runs establish those observations; they do not prove success under every future machine load or unrelated mod configuration. + +Computer-use access to Geometry Dash was rejected by that tool’s approval review. No computer-use controls were used for the game; execution and evidence came from the mod’s own test harness and the official Steam launcher. Visual/keybind interaction coverage is therefore not claimed. diff --git a/mod.json b/mod.json index 101e356..c7c3f01 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "5.7.1", + "geode": "5.11.2", "gd": { "win": "2.2081", "mac": "*" diff --git a/scripts/autotest-macos.py b/scripts/autotest-macos.py new file mode 100644 index 0000000..ab6fefe --- /dev/null +++ b/scripts/autotest-macos.py @@ -0,0 +1,187 @@ +#!/usr/bin/env python3 +"""Run native macOS GD attempts with a fresh GDR import for every attempt. + +Preserves game saves and restores mod/Blockwork settings after stopping the +owned game process. Results and exact configuration backups remain in --output. +""" +import argparse +import hashlib +import json +import os +import platform +from pathlib import Path +import shutil +import signal +import subprocess +import sys +import time +import uuid + +MOD = 'com.blockworked.blockwork' + + +def load(path): + return json.loads(path.read_text()) if path.exists() else {} + + +def save(path, data): + path.parent.mkdir(parents=True, exist_ok=True) + temporary = path.with_suffix(path.suffix + '.autotest-tmp') + temporary.write_text(json.dumps(data, indent=2)) + temporary.replace(path) + + +def game_pids(executable): + rows = subprocess.check_output(['ps', '-axo', 'pid=,comm='], text=True).splitlines() + return [int(parts[0]) for row in rows if len(parts := row.strip().split(None, 1)) == 2 and parts[1] == str(executable)] + + +def stop_owned_game(executable): + pids = game_pids(executable) + for pid in pids: + os.kill(pid, signal.SIGTERM) + deadline = time.monotonic() + 5 + while game_pids(executable) and time.monotonic() < deadline: + time.sleep(.1) + for pid in game_pids(executable): + if pid in pids: + os.kill(pid, signal.SIGKILL) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--game', type=Path, default=Path.home() / 'Library/Application Support/Steam/steamapps/common/Geometry Dash/Geometry Dash.app') + parser.add_argument('--level', default='Bloodbath Infinity 2') + parser.add_argument('--gdr', type=Path, default=Path.home() / 'Downloads/ChesszDC-Bloodbath-Infinity-zBot.gdr') + parser.add_argument('--speed', type=float, default=1) + parser.add_argument('--runs', type=int, default=1) + parser.add_argument('--timeout', type=float, default=300) + parser.add_argument('--offset', type=int, default=-1) + parser.add_argument('--queue', action='store_true') + parser.add_argument('--cbs', action='store_true') + parser.add_argument('--trace', action='store_true') + parser.add_argument('--stray-queue', action='store_true', help='inject and verify rejection of a foreign queued press') + parser.add_argument('--output', type=Path, required=True) + args = parser.parse_args() + if sys.platform != 'darwin': + parser.error('This runner requires native macOS.') + if not args.gdr.is_file() or not 0 < args.speed <= 10 or args.runs < 1: + parser.error('Provide an existing GDR, speed in (0,10], and at least one run.') + if args.stray_queue and not args.queue: + parser.error('--stray-queue requires --queue.') + executable = args.game / 'Contents/MacOS/Geometry Dash' + if game_pids(executable): + parser.error('Geometry Dash is already running; close it before starting this isolated test.') + for row in subprocess.check_output(['ps', '-axo', 'comm='], text=True).splitlines(): + if row.strip().endswith('/blockwork-daemon'): + parser.error('Close the Blockwork daemon so the game owns its configuration during this test.') + geode = shutil.which('geode') or str(Path.home() / '.local/bin/geode') + profiles = subprocess.check_output([geode, 'profile', 'list'], text=True) + if not any(line.startswith('* ') and str(args.game) in line for line in profiles.splitlines()): + parser.error('--game must match the active Geode profile.') + args.output.mkdir(parents=True, exist_ok=False) + base = Path.home() / 'Library/Application Support/GeometryDash/geode/mods' + bw = Path.home() / 'Library/Application Support/Blockwork' + files = [base / 'geode.loader/saved.json', base / 'thesillydoggo.qolmod/saved.json', + base / MOD / 'settings.json', base / MOD / 'saved.json', bw / 'settings.json', + base / MOD / 'autotest.json', base / MOD / 'autotest-result.json'] + backups = {path: path.read_bytes() if path.exists() else None for path in files} + for name in ['CCGameManager.dat', 'CCLocalLevels.dat']: + path = base.parents[1] / name + backups[path] = path.read_bytes() + backup_dir = args.output / 'settings-before' + backup_dir.mkdir() + for index, (path, data) in enumerate(backups.items()): + if data is not None: + (backup_dir / f'{index}-{path.parent.name}-{path.name}').write_bytes(data) + for name in ['CCGameManager.dat', 'CCLocalLevels.dat']: + shutil.copy2(base.parents[1] / name, backup_dir / name) + manifest = {'gdr': str(args.gdr.resolve()), 'gdr_sha256': hashlib.sha256(args.gdr.read_bytes()).hexdigest(), + 'level': args.level, 'qol_speed': args.speed, 'frame_offset': args.offset, + 'queue': args.queue, 'cbs': args.cbs, 'stray_queue_probe': args.stray_queue, 'runs': [], + 'macos': platform.mac_ver()[0], 'architecture': platform.machine(), + 'mod_package_sha256': hashlib.sha256((args.game / 'Contents/geode/mods' / (MOD + '.geode')).read_bytes()).hexdigest()} + save(args.output / 'manifest.json', manifest) + steam = Path.home() / 'Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/steam_osx' + launched = False + signal.signal(signal.SIGTERM, lambda *_: sys.exit(130)) + try: + loader = load(files[0]) + for package in (args.game / 'Contents/geode/mods').glob('*.geode'): + loader['should-load-' + package.stem] = package.stem in {'geode.loader', 'thesillydoggo.qolmod', MOD} + save(files[0], loader) + qol = load(files[1]) + qol.update({'safe-mode_enabled': True, 'noclip_enabled': False, + 'speedhack/enabled_enabled': args.speed != 1, + 'speedhack-top_value': f'{args.speed:g}', 'speedhack/music_enabled': True}) + save(files[1], qol) + settings = load(files[2]) + settings.update({'enabled': True, 'action': 'run_macro', 'stop-on-end': True, + 'frame-locked': True, 'frame-offset': args.offset, 'speed-multiplier': 1, + 'queue-inputs': args.queue, 'substep-clicks': args.cbs, + 'trace-steps': args.trace, 'blockwork-dir': ''}) + save(files[2], settings) + seen_macros = set(path.stem for path in (bw / 'macros').glob('*.json')) + for index in range(args.runs): + run_id = uuid.uuid4().hex + request = {'run_id': run_id, 'local_name': args.level, 'import_gdr': str(args.gdr.resolve()), 'stray_queue_probe': args.stray_queue} + save(files[5], request) + files[6].unlink(missing_ok=True) + before_logs = set((args.game / 'Contents/geode/logs').glob('*.log')) + launched = True + launcher_log = (args.output / f'run-{index + 1}-launcher.log').open('w') + launcher = subprocess.Popen([str(steam), '-applaunch', '322170'], stdout=launcher_log, stderr=subprocess.STDOUT) + start = time.monotonic() + result = None + game_seen = False + while time.monotonic() - start < args.timeout: + if files[6].exists(): + try: + candidate = load(files[6]) + if candidate.get('run_id') == run_id: + result = candidate + break + except json.JSONDecodeError: + pass + running = bool(game_pids(executable)) + game_seen = game_seen or running + if not running and (game_seen or time.monotonic() - start > 45): + result = {'run_id': run_id, 'outcome': 'game-exited' if game_seen else 'launch-timeout', 'launcher_exit': launcher.poll()} + break + time.sleep(.2) + launcher_log.close() + if result is None: + result = {'run_id': run_id, 'outcome': 'timeout'} + result['wall_seconds'] = time.monotonic() - start + macro_id = result.get('macro_id', '') + result['verified_fresh_macro'] = bool(result.get('fresh_import') and macro_id not in seen_macros + and (bw / 'macros' / f'{macro_id}.json').exists()) + if result['verified_fresh_macro']: + shutil.copy2(bw / 'macros' / f'{macro_id}.json', args.output / f'run-{index + 1}-macro.json') + seen_macros.add(macro_id) + result['passed'] = (result.get('outcome') == 'complete' and result['verified_fresh_macro'] + and result.get('selected_macro_id') == macro_id + and result.get('level') == args.level and result.get('player_dead') is False + and (not args.stray_queue or (result.get('stray_queue_injected') and result.get('rejected_foreign_queue_inputs', 0) >= 1))) + manifest['runs'].append(result) + save(args.output / 'manifest.json', manifest) + print(json.dumps(result), flush=True) + stop_owned_game(executable) + launched = False + for log in set((args.game / 'Contents/geode/logs').glob('*.log')) - before_logs: + shutil.copy2(log, args.output / f'run-{index + 1}-{log.name}') + if not result['passed']: + break + return 0 if len(manifest['runs']) == args.runs and all(r['passed'] for r in manifest['runs']) else 1 + finally: + if launched: + stop_owned_game(executable) + for path, data in backups.items(): + if data is None: + path.unlink(missing_ok=True) + else: + path.write_bytes(data) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/scripts/dev-env.sh b/scripts/dev-env.sh new file mode 100644 index 0000000..f46ebb3 --- /dev/null +++ b/scripts/dev-env.sh @@ -0,0 +1,12 @@ +# Source this file from zsh or bash before using the Geode CLI. +if [ -n "${ZSH_VERSION:-}" ]; then + _geode_env_file="${(%):-%N}" +else + _geode_env_file="${BASH_SOURCE[0]}" +fi +_geode_repo="$(cd "$(dirname "$_geode_env_file")/.." && pwd)" +export PATH="$HOME/.local/bin:$PATH" +export GEODE_SDK="$_geode_repo/.tools/geode-sdk" +export GEODE_BINDINGS_REPO_PATH="$_geode_repo/.tools/bindings" +export CPM_SOURCE_CACHE="$_geode_repo/.tools/cpm-cache" +unset _geode_env_file _geode_repo diff --git a/src/main.cpp b/src/main.cpp index 03339f8..1f06513 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -252,6 +253,26 @@ bool frameLockedEnabled() { // Set while our own playback drives handleButton, so it isn't recorded back. bool inPlaybackInput = false; +std::vector playbackQueuedButtons; +int rejectedPlaybackQueueInputs = 0; +bool autotestStrayQueueProbe = false; +bool strayQueueInjected = false; +struct PlaybackInputScope { + bool previous = inPlaybackInput; + explicit PlaybackInputScope(bool enabled = true) { if (enabled) inPlaybackInput = true; } + ~PlaybackInputScope() { inPlaybackInput = previous; } +}; + +void queuePlaybackInput(GJBaseGameLayer* layer, bool secondary, bool down) { + auto size = layer->m_queuedButtons.size(); + layer->queueButton(1, down, secondary, layer->m_timestamp); + if (layer->m_queuedButtons.size() > size) playbackQueuedButtons.push_back(layer->m_queuedButtons.back()); +} + +bool sameQueuedInput(PlayerButtonCommand const& a, PlayerButtonCommand const& b) { + return a.m_button == b.m_button && a.m_isPush == b.m_isPush && a.m_isPlayer2 == b.m_isPlayer2 + && a.m_step == b.m_step && a.m_timestamp == b.m_timestamp; +} // Held state per player as last seen by the recorder: the game also releases // buttons that were never held (level start), which isn't an input. bool recordHeld[2] = {false, false}; @@ -261,7 +282,7 @@ void onSyncInput(const char* name, bool isButton, bool down) { if (!frameLockedLayer) { return; } - struct Guard { Guard() { inPlaybackInput = true; } ~Guard() { inPlaybackInput = false; } } guard; + PlaybackInputScope guard; std::string_view n = name; if (Mod::get()->getSettingValue("trace-steps")) { log::info("[trace-input] {} {} {} at step {}", name, isButton, down, frameLockedStep); @@ -289,10 +310,10 @@ void onSyncInput(const char* name, bool isButton, bool down) { } bool queued = Mod::get()->getSettingValue("queue-inputs"); if (isButton ? n == "Left" : (n == "Space" || n == "UpArrow")) { - if (queued) frameLockedLayer->queueButton(1, down, false, frameLockedLayer->m_timestamp); + if (queued) queuePlaybackInput(frameLockedLayer, false, down); else frameLockedLayer->handleButton(down, 1, true); } else if (isButton && n == "Right") { - if (queued) frameLockedLayer->queueButton(1, down, true, frameLockedLayer->m_timestamp); + if (queued) queuePlaybackInput(frameLockedLayer, true, down); else frameLockedLayer->handleButton(down, 1, false); } } @@ -385,6 +406,7 @@ void endStepRecording(bool keep) { } void stopFrameLocked() { + playbackQueuedButtons.clear(); if (frameLockedActive) { frameLockedActive = false; frameLockedLayer = nullptr; @@ -409,6 +431,8 @@ bool startFrameLocked(GJBaseGameLayer* layer) { } frameLockedActive = true; frameLockedStep = 0; + rejectedPlaybackQueueInputs = 0; + strayQueueInjected = false; frameLockedLayer = layer; if (Mod::get()->getSettingValue("substep-clicks")) { layer->m_clickBetweenSteps = true; @@ -423,6 +447,35 @@ bool startFrameLocked(GJBaseGameLayer* layer) { // script can drive a full macro run with no clicking. Consumed on use. // Progress is reported to the Geode log under "[autotest]". bool autotestLevelOpen = false; +std::string autotestRunId; +std::string autotestMacroId; +bool autotestFreshImport = false; +bool autotestResultWritten = false; +auto autotestStart = std::chrono::steady_clock::now(); + +void writeAutotestResult(std::string const& outcome, PlayLayer* layer = nullptr) { + if (autotestRunId.empty() || autotestResultWritten) return; + autotestResultWritten = true; + matjson::Value result; + result["run_id"] = autotestRunId; + result["outcome"] = outcome; + result["fresh_import"] = autotestFreshImport; + result["macro_id"] = autotestMacroId; + result["selected_macro_id"] = levelmacros::selectedMacroId(); + result["step"] = frameLockedStep; + result["stray_queue_injected"] = strayQueueInjected; + result["rejected_foreign_queue_inputs"] = rejectedPlaybackQueueInputs; + result["elapsed_seconds"] = std::chrono::duration(std::chrono::steady_clock::now() - autotestStart).count(); + if (layer) { + result["level"] = std::string(layer->m_level->m_levelName); + result["percent"] = layer->getCurrentPercent(); + result["player_dead"] = layer->m_player1->m_isDead; + } + std::ofstream out(Mod::get()->getSaveDir() / "autotest-result.json"); + out << result.dump(); + log::info("[autotest] result {}", result.dump()); +} + class AutoTestOpener : public LevelDownloadDelegate { public: @@ -469,6 +522,8 @@ void maybeStartAutotest() { return; } auto json = parsed.unwrap(); + autotestRunId = json["run_id"].asString().unwrapOr(""); + autotestStrayQueueProbe = json["stray_queue_probe"].asBool().unwrapOr(false); if (auto ldm = json["ldm"].asBool()) { // Low detail mode is game variable 0042. GameManager::get()->setGameVariable("0042", ldm.unwrap()); @@ -476,7 +531,10 @@ void maybeStartAutotest() { } if (auto fps = json["fps"].asDouble()) { // Frames shorter than a physics step let a real input land on any step. +#ifdef GEODE_IS_WINDOWS + // CCApplication exposes this VSync switch only on Windows. CCApplication::sharedApplication()->toggleVerticalSync(false); +#endif CCApplication::sharedApplication()->setAnimationInterval(1.0 / fps.unwrap()); log::info("[autotest] fps -> {}", fps.unwrap()); } @@ -484,7 +542,12 @@ void maybeStartAutotest() { log::info("[autotest] new_macro('{}') -> {}", newMacro.unwrap(), blockwork_create_macro(newMacro.unwrap().c_str())); } if (auto importPath = json["import_gdr"].asString()) { - log::info("[autotest] import_gdr('{}') -> {}", importPath.unwrap(), blockwork_import_gdr(importPath.unwrap().c_str())); + auto before = levelmacros::selectedMacroId(); + int result = blockwork_import_gdr(importPath.unwrap().c_str()); + autotestMacroId = levelmacros::selectedMacroId(); + autotestFreshImport = result == 0 && !autotestMacroId.empty() && autotestMacroId != before; + log::info("[autotest] import_gdr('{}') -> {} (fresh={}, macro={})", importPath.unwrap(), result, autotestFreshImport, autotestMacroId); + if (!autotestFreshImport) { writeAutotestResult("import-failed"); return; } } if (json["import_pending"].asBool().unwrapOr(false)) { log::info("[autotest] import_pending -> {}", blockwork_import_pending_gdrs()); @@ -495,11 +558,14 @@ void maybeStartAutotest() { for (auto* level : CCArrayExt(locals)) { if (std::string(level->m_levelName) == localName.unwrap()) { log::info("[autotest] using local level '{}'", localName.unwrap()); + if (autotestFreshImport) levelmacros::link(levelmacros::keyFor(level), autotestMacroId); AutoTestOpener::get().open(level); return; } } log::error("[autotest] no local level named '{}'", localName.unwrap()); + for (auto* level : CCArrayExt(locals)) log::info("[autotest] available local level '{}'", std::string(level->m_levelName)); + writeAutotestResult("level-not-found"); return; } int levelId = json["level_id"].asInt().unwrapOr(0); @@ -653,6 +719,7 @@ class $modify(PlayLayer) { if (!PlayLayer::init(level, useReplay, dontCreateObjects)) { return false; } + if (autotestLevelOpen) autotestStart = std::chrono::steady_clock::now(); // First entry into the level. Retries reuse this same PlayLayer and // go through resetLevel() instead, never back through init(). if (stepRecordingWanted()) { @@ -674,6 +741,7 @@ class $modify(PlayLayer) { return; } if (autotestLevelOpen) { + writeAutotestResult("died", this); log::info("[autotest] died at {}% on step {} (object id {} anticheat={} at {},{}; player at {},{})", getCurrentPercent(), stepRecordingActive ? recordStep : frameLockedStep, object ? object->m_objectID : -1, object == m_anticheatSpike, object ? object->getPositionX() : 0.f, object ? object->getPositionY() : 0.f, player->getPositionX(), player->getPositionY()); } stopFrameLocked(); @@ -755,6 +823,7 @@ class $modify(PlayLayer) { void levelComplete() { PlayLayer::levelComplete(); + if (autotestLevelOpen) writeAutotestResult("complete", this); if (frameLockedActive || stepRecordingActive) { log::info("[autotest] LEVEL COMPLETE on step {}", stepRecordingActive ? recordStep : frameLockedStep); } @@ -794,45 +863,94 @@ class $modify(PlayLayer) { } }; -class $modify(GJBaseGameLayer) { - void processCommands(float dt, bool isHalfTick, bool isLastTick) { - if (frameLockedActive && static_cast(PlayLayer::get()) == this) { - double timeMs = static_cast(frameLockedStep - Mod::get()->getSettingValue("frame-offset")) * 1000.0 / kStepsPerSecond; - if (frameLockedStep < 60000 && Mod::get()->getSettingValue("trace-steps")) { - log::info("[trace] {} {} {}", frameLockedStep, m_player1->getPositionX(), m_player1->getPositionY()); - } - blockwork_sync_step(timeMs, &onSyncInput); - frameLockedStep++; +// macOS inlines processCommands into update, but calls processQueuedButtons +// once per physics tick. Keep the common clock at that actual call boundary. +void beforePhysicsInput(GJBaseGameLayer* layer) { + if (frameLockedActive && static_cast(PlayLayer::get()) == layer) { + double timeMs = static_cast(frameLockedStep - Mod::get()->getSettingValue("frame-offset")) * 1000.0 / kStepsPerSecond; + if (frameLockedStep < 60000 && Mod::get()->getSettingValue("trace-steps")) { + log::info("[trace] {} {} {}", frameLockedStep, layer->m_player1->getPositionX(), layer->m_player1->getPositionY()); } - bool isPlay = static_cast(PlayLayer::get()) == this; - if (stepRecordingActive && isPlay && recordStep < 9000 && Mod::get()->getSettingValue("trace-steps")) { - log::info("[trace] {} {} {}", recordStep, m_player1->getPositionX(), m_player1->getPositionY()); + blockwork_sync_step(timeMs, &onSyncInput); + frameLockedStep++; + } + bool isPlay = static_cast(PlayLayer::get()) == layer; + if (stepRecordingActive && isPlay && recordStep < 9000 && Mod::get()->getSettingValue("trace-steps")) { + log::info("[trace] {} {} {}", recordStep, layer->m_player1->getPositionX(), layer->m_player1->getPositionY()); + } + if (autotestLevelOpen && isPlay && stepRecordingActive) { + // Lets the test input generator follow the game's own step clock. + if (!stepFile) { +#ifdef GEODE_IS_MACOS + auto path = std::filesystem::temp_directory_path() / "bw_step.txt"; + stepFile = fopen(path.string().c_str(), "wb"); +#else + stepFile = fopen("Z:\\tmp\\bw_step.txt", "wb"); +#endif } - if (autotestLevelOpen && isPlay && stepRecordingActive) { - // Lets the test input generator follow the game's own step clock. - if (!stepFile) { - stepFile = fopen("Z:\\tmp\\bw_step.txt", "wb"); - } - if (stepFile) { - fseek(stepFile, 0, SEEK_SET); - fprintf(stepFile, "%lld %d \n", recordStep, 1); - fflush(stepFile); - } + if (stepFile) { + fseek(stepFile, 0, SEEK_SET); + fprintf(stepFile, "%lld %d \n", recordStep, 1); + fflush(stepFile); } + } +} +void afterPhysicsInput(GJBaseGameLayer* layer) { + if (stepRecordingActive && static_cast(PlayLayer::get()) == layer) recordStep++; +} + +class $modify(GJBaseGameLayer) { + void processCommands(float dt, bool isHalfTick, bool isLastTick) { +#ifndef GEODE_IS_MACOS + beforePhysicsInput(this); +#endif GJBaseGameLayer::processCommands(dt, isHalfTick, isLastTick); - if (stepRecordingActive && isPlay) { - recordStep++; - } +#ifndef GEODE_IS_MACOS + afterPhysicsInput(this); +#endif } void processQueuedButtons(float dt, bool clearInputQueue) { +#ifdef GEODE_IS_MACOS + const bool physicsTick = dt > 0 && !inExtraUpdate; + if (physicsTick) beforePhysicsInput(this); +#endif if (stepRecordingActive && !inPlaybackInput && !m_queuedButtons.empty() && static_cast(PlayLayer::get()) == this) { for (auto const& c : m_queuedButtons) { log::info("[trace-queue] rec={} cur={} dt={:.9f} btn={} push={} p2={} step={} ts={:.9f} m_ts={:.9f} lvlTime={:.9f}", recordStep, m_currentStep, dt, (int)c.m_button, c.m_isPush, c.m_isPlayer2, c.m_step, c.m_timestamp, m_timestamp, m_gameState.m_levelTime); } } + const bool queuedPlayback = frameLockedActive && frameLockedLayer == this + && Mod::get()->getSettingValue("queue-inputs"); + if (queuedPlayback) { + if (autotestLevelOpen && autotestStrayQueueProbe && !strayQueueInjected && frameLockedStep == 301) { + queueButton(1, true, false, m_timestamp); + strayQueueInjected = true; + log::info("[autotest] injected foreign queued press before the first recorded jump"); + } + // A queued macro click is applied after onSyncInput returns. Keep + // its ownership until consumption, and remove foreign queue entries + // so allowing our own handleButton calls cannot admit real clicks. + auto remaining = playbackQueuedButtons; + auto& queue = m_queuedButtons; + queue.erase(std::remove_if(queue.begin(), queue.end(), [&](auto const& command) { + auto found = std::find_if(remaining.begin(), remaining.end(), [&](auto const& own) { + return sameQueuedInput(command, own); + }); + if (found == remaining.end()) { rejectedPlaybackQueueInputs++; return true; } + remaining.erase(found); + return false; + }), queue.end()); + } + PlaybackInputScope playback(queuedPlayback); GJBaseGameLayer::processQueuedButtons(dt, clearInputQueue); + if (queuedPlayback && frameLockedActive) { + playbackQueuedButtons.assign(m_queuedButtons.begin(), m_queuedButtons.end()); + } +#ifdef GEODE_IS_MACOS + if (physicsTick) afterPhysicsInput(this); +#endif } void handleButton(bool down, int button, bool isPlayer1) { From 99d1b2d433df81c37ceb9f91aacf1eeac85337c7 Mon Sep 17 00:00:00 2001 From: Ethan Stokes Date: Sat, 24 Oct 2026 19:37:10 -0500 Subject: [PATCH 2/3] Include the embedded engine build action in CI --- .github/actions/embedded-engine/action.yml | 49 ++++++++++++++++++++++ .github/workflows/checks.yml | 2 +- .github/workflows/multi-platform.yml | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/actions/embedded-engine/action.yml diff --git a/.github/actions/embedded-engine/action.yml b/.github/actions/embedded-engine/action.yml new file mode 100644 index 0000000..fb3a1ca --- /dev/null +++ b/.github/actions/embedded-engine/action.yml @@ -0,0 +1,49 @@ +name: Build embedded Blockwork engine +description: Build the pinned Rust FFI library and expose its library/header paths. +outputs: + ffi-lib: + description: Static library for the host platform (universal on macOS). + value: ${{ steps.build.outputs.ffi-lib }} + ffi-include: + description: Generated C header directory. + value: ${{ steps.build.outputs.ffi-include }} +runs: + using: composite + steps: + - uses: actions/checkout@v4 + with: + repository: Blockworked/Blockwork + ref: e285eac69af1759811b39aeedd861653bd06a30b + path: .blockwork-engine + persist-credentials: false + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ runner.os == 'macOS' && 'aarch64-apple-darwin,x86_64-apple-darwin' || 'x86_64-pc-windows-msvc' }} + - uses: Swatinem/rust-cache@v2 + with: + workspaces: .blockwork-engine -> target + key: geode-ffi-${{ runner.os }} + - name: Build static FFI library + id: build + shell: bash + run: | + engine_root="$GITHUB_WORKSPACE/.blockwork-engine" + if [ "$RUNNER_OS" = macOS ]; then + export MACOSX_DEPLOYMENT_TARGET=11.0 + for target in aarch64-apple-darwin x86_64-apple-darwin; do + cargo build --manifest-path "$engine_root/Cargo.toml" -p blockwork-ffi --release --locked --target "$target" + done + mkdir -p "$engine_root/target/universal-macos" + ffi_lib="$engine_root/target/universal-macos/libblockwork_ffi.a" + lipo -create -output "$ffi_lib" \ + "$engine_root/target/aarch64-apple-darwin/release/libblockwork_ffi.a" \ + "$engine_root/target/x86_64-apple-darwin/release/libblockwork_ffi.a" + lipo -verify_arch arm64 x86_64 "$ffi_lib" + ffi_include="$engine_root/blockwork-ffi/include" + else + cargo build --manifest-path "$engine_root/Cargo.toml" -p blockwork-ffi --release --locked --target x86_64-pc-windows-msvc + ffi_lib="$(cygpath -m "$engine_root/target/x86_64-pc-windows-msvc/release/blockwork_ffi.lib")" + ffi_include="$(cygpath -m "$engine_root/blockwork-ffi/include")" + fi + echo "ffi-lib=$ffi_lib" >> "$GITHUB_OUTPUT" + echo "ffi-include=$ffi_include" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 68f205c..dfe4f30 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - name: Build embedded engine id: engine - uses: ./.github/actions/build-engine + uses: ./.github/actions/embedded-engine - name: Build mod uses: geode-sdk/build-geode-mod@a0f7676e6fcd1a584f6d0c1c800239008412defc with: diff --git a/.github/workflows/multi-platform.yml b/.github/workflows/multi-platform.yml index d9faa0a..107530a 100644 --- a/.github/workflows/multi-platform.yml +++ b/.github/workflows/multi-platform.yml @@ -74,7 +74,7 @@ jobs: - name: Build embedded engine id: engine - uses: ./.github/actions/build-engine + uses: ./.github/actions/embedded-engine - name: Build the mod uses: geode-sdk/build-geode-mod@a0f7676e6fcd1a584f6d0c1c800239008412defc From 33c0f7195425ac53f6f0f5b09df53ab2f2a8624e Mon Sep 17 00:00:00 2001 From: Ethan Stokes Date: Sun, 25 Oct 2026 15:25:11 -0500 Subject: [PATCH 3/3] Finalize verified macOS replay evidence and engine references --- .github/actions/embedded-engine/action.yml | 6 ++++-- README.md | 2 +- docs/macos-parity.md | 8 ++++++-- src/main.cpp | 2 ++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/actions/embedded-engine/action.yml b/.github/actions/embedded-engine/action.yml index fb3a1ca..810953b 100644 --- a/.github/actions/embedded-engine/action.yml +++ b/.github/actions/embedded-engine/action.yml @@ -13,7 +13,7 @@ runs: - uses: actions/checkout@v4 with: repository: Blockworked/Blockwork - ref: e285eac69af1759811b39aeedd861653bd06a30b + ref: 65207fed4487cfb3568a3fc019025a17f66d3bbf path: .blockwork-engine persist-credentials: false - uses: dtolnay/rust-toolchain@stable @@ -38,7 +38,9 @@ runs: lipo -create -output "$ffi_lib" \ "$engine_root/target/aarch64-apple-darwin/release/libblockwork_ffi.a" \ "$engine_root/target/x86_64-apple-darwin/release/libblockwork_ffi.a" - lipo -verify_arch arm64 x86_64 "$ffi_lib" + for arch in arm64 x86_64; do + lipo "$ffi_lib" -verify_arch "$arch" + done ffi_include="$engine_root/blockwork-ffi/include" else cargo build --manifest-path "$engine_root/Cargo.toml" -p blockwork-ffi --release --locked --target x86_64-pc-windows-msvc diff --git a/README.md b/README.md index 20f4f67..292c162 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ git clone --branch v5.11.2 --depth 1 https://github.com/geode-sdk/geode .tools/g git clone https://github.com/geode-sdk/bindings .tools/bindings git -C .tools/bindings checkout 1605f500 git clone https://github.com/Blockworked/Blockwork ../Blockwork -git -C ../Blockwork checkout e285eac69af1759811b39aeedd861653bd06a30b +git -C ../Blockwork checkout 65207fed4487cfb3568a3fc019025a17f66d3bbf source scripts/dev-env.sh geode sdk install-binaries geode profile add "$HOME/Library/Application Support/Steam/steamapps/common/Geometry Dash/Geometry Dash.app" --name gd-2.2081 mac diff --git a/docs/macos-parity.md b/docs/macos-parity.md index d9900ac..7d580cf 100644 --- a/docs/macos-parity.md +++ b/docs/macos-parity.md @@ -1,6 +1,6 @@ # macOS integration verification -In progress. The live acceptance fixture is the local **Bloodbath Infinity 2** level and fresh imports of `~/Downloads/ChesszDC-Bloodbath-Infinity-zBot.gdr`. The existing user replay is not used as the acceptance macro. +The live acceptance fixture is the local **Bloodbath Infinity 2** level and fresh imports of `~/Downloads/ChesszDC-Bloodbath-Infinity-zBot.gdr`. The existing user replay is not used as the acceptance macro. ## Platform fix @@ -10,7 +10,7 @@ macOS now advances host-clock playback and recording at the called `processQueue The native test runner launches through Steam, imports the GDR anew for every attempt, links the exact new macro to the requested local level, and records a result carrying a unique run identifier, macro identifier, selected identifier, level, step, completion/death state and elapsed time. The runner rejects results for another run or an existing macro. It keeps each imported macro and the logs in the evidence directory. QOL safe mode is on and noclip is off; unrelated mods are disabled. Configuration and game saves are backed up and restored after the owned game process stops. -Queued playback also needed an ownership fix: the input-blocking hook was rejecting the mod’s own clicks when the game consumed them after the enqueue callback returned. Playback now retains the exact queued-command identities, filters foreign entries, and marks its own consumption scope. A stray queued press injected before the first recorded jump was rejected while the full 10x replay completed. Its 724 input events and all positions through the input phase match direct playback. Repeated tests with the user’s queue + click-between-steps options are in progress. +Queued playback also needed an ownership fix: the input-blocking hook was rejecting the mod’s own clicks when the game consumed them after the enqueue callback returned. Playback now retains the exact queued-command identities, filters foreign entries, and marks its own consumption scope. A stray queued press injected before the first recorded jump was rejected while the full 10x replay completed. Its 724 input events and all positions through the input phase match direct playback. The user’s queue + click-between-steps options completed 20/20 fresh-import 10x attempts; each injected foreign press was rejected, with no host-clock timeout warnings. The final queued implementation also completed a fresh normal-speed run at 100% (114.22 seconds). Evidence: `/tmp/blockwork-gd-macos-10x-queued-batch-20/manifest.json` and `/tmp/blockwork-gd-macos-normal-queued-final/manifest.json`. ## Observed results @@ -37,3 +37,7 @@ python3 scripts/autotest-macos.py --runs 20 --speed 10 --output /tmp/blockwork-g The output directory must not already exist. `--queue`, `--cbs`, `--offset` and `--trace` explicitly select developer options. The successful reference runs use offset -1, queue off and click-between-steps off. Finite successful runs establish those observations; they do not prove success under every future machine load or unrelated mod configuration. Computer-use access to Geometry Dash was rejected by that tool’s approval review. No computer-use controls were used for the game; execution and evidence came from the mod’s own test harness and the official Steam launcher. Visual/keybind interaction coverage is therefore not claimed. + +The private-repository CI jobs were rejected before startup by GitHub billing/spending limits. This is an external execution block, not a compiler result. The local universal mod compiles and links both architectures with a macOS 11.0 floor and no mixed-target warnings. Its final 3/3 fresh-import 10x acceptance batch passed on Apple Silicon; Windows compilation and Intel game runtime are not claimed. + +A separate universal smoke batch was interrupted on focus loss during its second attempt. That batch is recorded separately and is not counted among completed batches. The harness now reports paused/unfocused interruptions explicitly. Final evidence is also preserved in `build/macos-verification/summary.json`. diff --git a/src/main.cpp b/src/main.cpp index 1f06513..949f834 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -468,6 +468,7 @@ void writeAutotestResult(std::string const& outcome, PlayLayer* layer = nullptr) result["elapsed_seconds"] = std::chrono::duration(std::chrono::steady_clock::now() - autotestStart).count(); if (layer) { result["level"] = std::string(layer->m_level->m_levelName); + result["level_key"] = levelmacros::keyFor(layer->m_level); result["percent"] = layer->getCurrentPercent(); result["player_dead"] = layer->m_player1->m_isDead; } @@ -843,6 +844,7 @@ class $modify(PlayLayer) { void pauseGame(bool unfocused) { PlayLayer::pauseGame(unfocused); + if (autotestLevelOpen) writeAutotestResult(unfocused ? "interrupted-unfocused" : "interrupted-paused", this); // TEMPORARY: confirm this hook actually fires on Escape at all // before trusting anything past this line. log::info("blockwork: pauseGame hook fired (unfocused={})", unfocused);