Fix the lifecycle, audio, and renderer issues from the full-app review - #31
Merged
Conversation
Gameplay / lifecycle - Seed the RNG from the clock's integer fields: converting uptime * 1e6 to uint32_t is undefined past ~72 minutes and saturated to a constant seed. - One music rule (syncMusic): plays from round start through the end screen when sound is on, never on the phone while the round runs on the glasses, and is re-applied when the audio engine arrives after a process-death restore, on settings reload, and on every state change. - Stop the winning volley at the boss kill so nothing scores after the high-score table is written; a tie with an existing row is no longer celebrated as a new record and can no longer duplicate the row. - Reset invulnerability and the boss on the return to the title (the title ship blinked forever; the mothership stayed drawn under Settings), via a shared resetBattlefield() used by startLevel() too. - Atomic saves (temp file + fsync + rename) and scores drawn as long. Audio - Impl is shared so Oboe's error thread can never outlive it; the reopen after a disconnect is synchronised with shutdown and opens outside the lock. Shared mode at the device's native rate, requestStart checked. - pause()/resume() on focus loss/gain (phone role only). - Wrapping music phases (the bass line froze after ~8 minutes), soft clip, lower explosion gains. Renderer - A failed surface recreate no longer leaves the next frame running against a null surface; a half-built swapchain is torn down; every acquire / submit / present error rebuilds device-level state instead of leaving a reset fence that hangs the next relaunch. - IDENTITY pre-transform (content was drawn sideways on landscape-native panels), surface-capability and swapchain-image results checked. - Recovery timer with backoff in the main loop; the activity finishes only when the GPU is genuinely unsupported or the rebuild keeps failing. - Draw-command vector reused across frames; FPS counters per engine (the phone and glasses instances share the process). Glasses bridge - Delete every JNI local reference (the game thread never returns to Java) and cache a failed bridge lookup instead of retrying it every second. Tests / build / CI - Boss bomb test asserts the bomb is aimed; win test asserts the table matches the final score; new tests for the title reset and the tie case. - Gating jobs get timeouts; the one NDK install step without pipefail gets it. Oboe pinned to a hashed tarball, -Wall -Wextra on both native targets, runNativeTests finds the newest binary, backup rules wired, missing proguard file reference dropped, repo .clang-tidy. - replay-preview-multirun.sh keeps EMU_PGID while the emulator is alive (with a KILL fallback) and no longer relaunches the app after run 1, so it measures what the CI job measures. Verified: 105 native tests pass on the MP36 AVD; on MP36 the title, play at 60 fps, shade pause, and Home + relaunch all work with no Vulkan or Oboe warnings in logcat, and the stream opens at the native 48 kHz.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same treatment as VulkanAsteroids #17: a whole-app review (game logic, renderer and glasses bridge, audio, tests, build, CI), everything actionable fixed, then a second review pass on the diff itself.
This port had already absorbed most of the Asteroids findings (focus pause, per-image semaphores, dt-scaled decay, death-frame gating, a real smoke assertion), so the list is shorter and skews toward failure paths.
Correctness
syncMusic()rule now covers all of it.resetBattlefield()withstartLevel().preTransformis IDENTITY.long, draw-command vector reused, per-engine FPS counters.Tests, build, CI
pipefailgets it; Oboe pinned to a hashed tarball;-Wall -Wextraon both native targets (clean);runNativeTestsfinds the newest binary; backup rules wired; missing proguard file reference dropped; repo.clang-tidy.Behaviour changes worth knowing
Not changed
Verified