Skip to content

ci(audience): Linux PlayMode under xvfb (SDK-317 / SDK-318)#765

Draft
ImmutableJeffrey wants to merge 1 commit intochore/sdk-317-audience-linux-platform-supportfrom
chore/audience-linux-perf-test-polling
Draft

ci(audience): Linux PlayMode under xvfb (SDK-317 / SDK-318)#765
ImmutableJeffrey wants to merge 1 commit intochore/sdk-317-audience-linux-platform-supportfrom
chore/audience-linux-perf-test-polling

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Collaborator

@ImmutableJeffrey ImmutableJeffrey commented May 9, 2026

Summary

Adds Linux PlayMode CI for the Audience SDK sample app, with the perf trims that bring Unity 6 cell wall time down from initial-failure to ~22-25 min, plus diagnostics and one SDK fix surfaced by the investigation.

CI workflow

  • Adds playmode-linux job running under xvfb inside the unityci/editor:ubuntu-...-linux-il2cpp-3 container. The image ships both Mono and IL2CPP playback engines plus xvfb, so one tag covers both backends.
  • Replaces game-ci/unity-test-runner@v4 with manual docker run because the action hardcodes -batchmode -nographics, so PlayMode tests came back inconclusive and silently passed.
  • Watchdog SIGTERMs Unity 30s after seeing Test run completed so cells exit on suite finish; handles Unity 6's known post-test shutdown hang. 40 min hard cap as fallback.
  • Replaces cartesian + partial-include matrix with explicit per-cell entries; partial includes failed to merge the runner column and spawned zero tests.
  • Captures standalone player log alongside the editor log; surfaces the CI provenance line to the job summary.
  • Defense-in-depth step that fails the cell when zero tests executed (NUnit "inconclusive" doesn't fail the job by default).

Perf trims (Unity 6 Linux)

  • GraphicsApisLinuxOverride build hook forces StandaloneLinux64 to OpenGLCore-only at build time, skipping Vulkan shader variants the runtime never uses.
  • LinuxLogPaneSuppression setup-fixture hides the in-app log ScrollView on Unity 6 Linux, skipping llvmpipe rasterising thousands of UI Toolkit triangles per frame.
  • Adds -force-glcore to skip Unity 6's Vulkan init negotiation.

Diagnostics

  • LogCiProvenance runtime hook stamps [CI] buildGuid=... runId=... cellId=... into Player.log on player startup. Gated to CI runs only.
  • Mirrors OnError and Log.Writer output to Debug.Log so SDK warnings and failure callbacks reach Player.log, not just the in-app pane.
  • PlayerProfilerLogger runtime hook writes a Unity profiler binary log when AUDIENCE_PLAYER_PROFILE_PATH is set.
  • Adds audience_ci_test_marker PlayMode test that emits a CDP marker row so this run's events can be filtered out of analytics.

SDK fix

  • DiskStore.ReadBatch now treats DirectoryNotFoundException as empty queue, matching the existing guards in DeleteAll and ApplyAnonymousDowngrade. Prevents external test cleanup or persistentDataPath wipes from surfacing as OnError.

Sample-app cleanup

  • Trims 30 unused packages and engine modules from examples/audience/Packages/manifest.json.

Linear: SDK-317, SDK-318, SDK-340, SDK-341

ImmutableJeffrey added a commit that referenced this pull request May 9, 2026
Commit e7718f6 added a comment block above the xvfb-run line that
contained 'xvfb's own screen size'. The apostrophe terminated the outer
bash -c '...' single-quoted heredoc, the rest of the inner script
became outer-shell tokens, and every Linux PlayMode cell on PR #765
exited 1 right after license activation (cell time 90 seconds).

Rewords the comment without the apostrophe. No semantic change to the
docker invocation or the Unity command line.
ImmutableJeffrey added a commit that referenced this pull request May 9, 2026
…SampleApp

Drops 30 of 39 manifest.json entries that the SampleApp does not use.
Verified by grepping the SampleApp source, the SampleApp scene, and
the Audience SDK runtime for any reference to each removed module or
package.

Removed packages:
- com.unity.textmeshpro: no TMP_Text or TMPro references
- com.unity.timeline: no PlayableDirector or TimelineAsset references
- com.unity.ugui: SampleApp uses UI Toolkit, no Canvas references
- com.unity.visualscripting: no ScriptMachine or graph references

Removed engine modules:
- ai, animation, assetbundle, cloth, director, imageconversion,
  particlesystem, physics, physics2d, screencapture, terrain,
  terrainphysics, tilemap, ui, umbra, unityanalytics, vehicles, video,
  vr, wind, xr: no runtime references in SampleApp or audience SDK
- unitywebrequestassetbundle, unitywebrequestaudio,
  unitywebrequesttexture, unitywebrequestwww: SDK uses
  System.Net.Http.HttpClient, not UnityWebRequest variants

Kept (verified used or required):
- com.immutable.audience: the SDK
- com.unity.test-framework: test runner
- com.unity.modules.androidjni: Android plugin compatibility
- com.unity.modules.audio: AudioListener present in SampleApp scene
- com.unity.modules.imgui: test runner overlay
- com.unity.modules.jsonserialize: defensive
- com.unity.modules.uielements: UI Toolkit, primary UI surface
- com.unity.modules.unitywebrequest: defensive (test framework)

Expected impact:
- Smaller IL2CPP and Mono player binaries.
- Faster IL2CPP compile and Bee/Tundra build phases on every cell.
- Faster project init (less to load, fewer InitializeOnLoad hooks).
- Per-frame UI Toolkit cost on llvmpipe is unchanged; that is targeted
  separately by PR #765's log-pane suppression.

Risk: a build link error on a platform that needs a removed module
shows immediately in CI; revert is one-line.
@ImmutableJeffrey ImmutableJeffrey force-pushed the chore/audience-linux-perf-test-polling branch from 153b0f8 to cf5e5d9 Compare May 10, 2026 04:11
@ImmutableJeffrey ImmutableJeffrey changed the title perf(audience): decouple test polling from frame pacing on Linux PlayMode ci(audience): Linux PlayMode under xvfb (SDK-317 / SDK-318) May 10, 2026
@ImmutableJeffrey ImmutableJeffrey changed the base branch from chore/sdk-318-linux-playmode-xvfb to chore/sdk-317-audience-linux-platform-support May 10, 2026 04:11
- Adds playmode-linux job using docker + xvfb. game-ci/unity-test-runner@v4 hardcodes -nographics, so PlayMode tests came back inconclusive and silently passed.
- Watchdog SIGTERMs Unity 30s after "Test run completed" so cells exit on suite finish; handles Unity 6's known shutdown hang.
- Replaces cartesian + partial-include matrix with explicit per-cell entries; partial includes failed to merge the runner column and spawned zero tests.
- Forces StandaloneLinux64 to OpenGLCore-only at build to skip Vulkan shader variants and runtime negotiation.
- Suppresses in-app log pane on Unity 6 Linux to skip llvmpipe rasterising UI Toolkit triangles per frame.
- Stamps CI provenance into Player.log on player startup; gated to CI runs only.
- Mirrors SDK output and OnError fires to Debug.Log so failures land in Player.log.
- Captures Unity profiler binary log when AUDIENCE_PLAYER_PROFILE_PATH is set.
- DiskStore.ReadBatch treats missing queue dir as empty (matches existing guards).
- Trims 30 unused packages from the sample-app manifest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ImmutableJeffrey ImmutableJeffrey force-pushed the chore/audience-linux-perf-test-polling branch from cf5e5d9 to 9da4f4c Compare May 10, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant