game-harness 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes are recorded here. Releases follow
4
4
  [Semantic Versioning](https://semver.org/) and are generated from Conventional
5
5
  Commits by release-please.
6
6
 
7
+ ## [1.3.0](https://github.com/jbcom/game-harness/compare/game-harness-v1.2.0...game-harness-v1.3.0) (2026-10-10)
8
+
9
+
10
+ ### Features
11
+
12
+ * **chromium:** add the macos-hardware-metal gpu mode ([008f277](https://github.com/jbcom/game-harness/commit/008f2770886e73a2d323b65bb3f6373ea21be426))
13
+
7
14
  ## [1.2.0](https://github.com/jbcom/game-harness/compare/game-harness-v1.1.2...game-harness-v1.2.0) (2026-10-10)
8
15
 
9
16
 
package/README.md CHANGED
@@ -180,6 +180,11 @@ make WebGL start. The default `auto` profile lets Chromium select the native
180
180
  renderer (including Metal on macOS). `software` is an explicit SwiftShader
181
181
  fallback. `linux-hardware-vulkan` applies the reviewed Mesa/ANGLE flags and
182
182
  `EGL_PLATFORM=surfaceless` for a runner that exposes `/dev/dri/renderD128`.
183
+ `macos-hardware-metal` asks ANGLE for its Metal backend (`--use-angle=metal
184
+ --ignore-gpu-blocklist`); it is the profile for an Apple Silicon Mac with no
185
+ window session, where `headless: true` still reaches the real GPU (no display
186
+ server or Xvfb is involved), so a render host does not fall back to
187
+ SwiftShader.
183
188
 
184
189
  Vitest's interactive UI is disabled by default even though the Chromium window
185
190
  remains visible. This gives Playwright a fixed viewport and a deterministic
@@ -252,11 +257,12 @@ const browser = await chromium.launch({ args, env, headless: false });
252
257
  `createChromiumLaunchProfile()` is the peer-free primitive behind both
253
258
  `definePlaywrightConfig()` and `defineBrowserTestConfig()` — use it directly
254
259
  when driving Chromium yourself (a custom launch script, `production-runtime`'s
255
- own internals, or a non-Playwright automation layer). It resolves one of three
260
+ own internals, or a non-Playwright automation layer). It resolves one of four
256
261
  renderer policies (`auto` leaves selection to Chromium; `software` opts into
257
262
  SwiftShader explicitly; `linux-hardware-vulkan` applies the reviewed
258
263
  Mesa/ANGLE flags plus `EGL_PLATFORM=surfaceless` for a runner exposing
259
- `/dev/dri/renderD128`) and always de-duplicates and appends `--mute-audio`
264
+ `/dev/dri/renderD128`; `macos-hardware-metal` asks ANGLE for its Metal backend
265
+ with `--use-angle=metal --ignore-gpu-blocklist`) and always de-duplicates and appends `--mute-audio`
260
266
  last, so a caller-supplied arg list can never accidentally drop the silence
261
267
  guard. Every profile also carries `CHROMIUM_ANTI_THROTTLING_ARGS`
262
268
  (`--disable-background-timer-throttling`, `--disable-renderer-backgrounding`,
@@ -11,6 +11,7 @@ const GPU_ARGS = {
11
11
  '--use-angle=vulkan',
12
12
  '--ignore-gpu-blocklist',
13
13
  ],
14
+ 'macos-hardware-metal': ['--use-angle=metal', '--ignore-gpu-blocklist'],
14
15
  };
15
16
  /**
16
17
  * Keeps timers and rendering on schedule in pages Chromium considers
@@ -7,6 +7,7 @@ const GPU_ARGS = {
7
7
  '--use-angle=vulkan',
8
8
  '--ignore-gpu-blocklist',
9
9
  ],
10
+ 'macos-hardware-metal': ['--use-angle=metal', '--ignore-gpu-blocklist'],
10
11
  };
11
12
  /**
12
13
  * Keeps timers and rendering on schedule in pages Chromium considers
@@ -1,12 +1,16 @@
1
1
  /** Browser renderer policy for agent-controlled Chromium sessions. */
2
- export type ChromiumGpuMode = 'auto' | 'software' | 'linux-hardware-vulkan';
2
+ export type ChromiumGpuMode = 'auto' | 'software' | 'linux-hardware-vulkan' | 'macos-hardware-metal';
3
3
  export type ChromiumEnvironment = Record<string, string | undefined>;
4
4
  export interface ChromiumLaunchProfileOptions {
5
5
  /**
6
- * `auto` leaves renderer selection to Chromium (Metal on macOS, the native
7
- * desktop stack elsewhere). `software` opts into SwiftShader explicitly.
6
+ * `auto` leaves renderer selection to Chromium (Metal on macOS in a headed
7
+ * window, the native desktop stack elsewhere). `software` opts into
8
+ * SwiftShader explicitly.
8
9
  * `linux-hardware-vulkan` is a proven Mesa/ANGLE profile for a
9
10
  * Linux runner with `/dev/dri/renderD128` passed through.
11
+ * `macos-hardware-metal` asks ANGLE for its Metal backend, which gives a
12
+ * headless Chromium on an Apple Silicon Mac (no window session needed) the
13
+ * real GPU instead of SwiftShader.
10
14
  */
11
15
  gpuMode?: ChromiumGpuMode;
12
16
  /** Additional Chromium arguments, de-duplicated ahead of `--mute-audio`. */
@@ -1,12 +1,16 @@
1
1
  /** Browser renderer policy for agent-controlled Chromium sessions. */
2
- export type ChromiumGpuMode = 'auto' | 'software' | 'linux-hardware-vulkan';
2
+ export type ChromiumGpuMode = 'auto' | 'software' | 'linux-hardware-vulkan' | 'macos-hardware-metal';
3
3
  export type ChromiumEnvironment = Record<string, string | undefined>;
4
4
  export interface ChromiumLaunchProfileOptions {
5
5
  /**
6
- * `auto` leaves renderer selection to Chromium (Metal on macOS, the native
7
- * desktop stack elsewhere). `software` opts into SwiftShader explicitly.
6
+ * `auto` leaves renderer selection to Chromium (Metal on macOS in a headed
7
+ * window, the native desktop stack elsewhere). `software` opts into
8
+ * SwiftShader explicitly.
8
9
  * `linux-hardware-vulkan` is a proven Mesa/ANGLE profile for a
9
10
  * Linux runner with `/dev/dri/renderD128` passed through.
11
+ * `macos-hardware-metal` asks ANGLE for its Metal backend, which gives a
12
+ * headless Chromium on an Apple Silicon Mac (no window session needed) the
13
+ * real GPU instead of SwiftShader.
10
14
  */
11
15
  gpuMode?: ChromiumGpuMode;
12
16
  /** Additional Chromium arguments, de-duplicated ahead of `--mute-audio`. */
@@ -17,10 +17,13 @@ const browser = await chromium.launch({ args, env, headless: false });
17
17
  `definePlaywrightConfig()` and `defineBrowserTestConfig()` — use it directly
18
18
  when driving Chromium yourself (a custom launch script, `production-runtime`'s
19
19
  own internals, or a non-Playwright automation layer). It resolves one of
20
- three renderer policies (`auto` leaves selection to Chromium; `software`
20
+ four renderer policies (`auto` leaves selection to Chromium; `software`
21
21
  opts into SwiftShader explicitly; `linux-hardware-vulkan` applies the
22
22
  reviewed Mesa/ANGLE flags plus `EGL_PLATFORM=surfaceless` for a runner
23
- exposing `/dev/dri/renderD128`) and always de-duplicates and appends
23
+ exposing `/dev/dri/renderD128`; `macos-hardware-metal` asks ANGLE for its
24
+ Metal backend with `--use-angle=metal --ignore-gpu-blocklist`, which a
25
+ headless Chromium on an Apple Silicon Mac with no window session honours by
26
+ using the real GPU) and always de-duplicates and appends
24
27
  `--mute-audio` last, so a caller-supplied arg list can never accidentally
25
28
  drop the silence guard.
26
29
 
@@ -43,7 +43,11 @@ to make WebGL start. The default `auto` profile lets Chromium select the
43
43
  native renderer (including Metal on macOS). `software` is an explicit
44
44
  SwiftShader fallback. `linux-hardware-vulkan` applies the reviewed
45
45
  Mesa/ANGLE flags and `EGL_PLATFORM=surfaceless` for a runner that exposes
46
- `/dev/dri/renderD128`.
46
+ `/dev/dri/renderD128`. `macos-hardware-metal` asks ANGLE for its Metal backend
47
+ (`--use-angle=metal --ignore-gpu-blocklist`); it is the profile for an Apple
48
+ Silicon Mac with no window session, where `headless: true` still reaches the
49
+ real GPU (no display server or Xvfb is involved), so a render host does not
50
+ fall back to SwiftShader.
47
51
 
48
52
  A Gitea runner job using the hardware profile must install
49
53
  `mesa-vulkan-drivers` and `xvfb`, require the render device with
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "game-harness",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Release-grade browser QA primitives for TypeScript games: silent Playwright/Vitest sessions, deterministic screenshots, runtime proof, and Lighthouse gates.",
5
5
  "type": "module",
6
6
  "license": "MIT",