Skip to content

Commit e6dd66d

Browse files
committed
Add smart lane scheduling and reusable Playwright runtime sessions to reduce redundant startup and deterministic rerun waste - PR_26146_029-lane-session-reuse-and-smart-scheduling
1 parent 4f641d0 commit e6dd66d

17 files changed

Lines changed: 633 additions & 26141 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ NEXT_COMMAND.txt
1717
node_modules/
1818
tests/results/
1919
tmp/
20+
scripts/untracked/
2021

2122
# Codex files
2223
docs/dev/codex_commands.md
@@ -33,3 +34,5 @@ docs/dev/reports/playwright_v8_coverage_report.txt
3334

3435
*.mp4
3536
*.mkv
37+
38+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Dependency Gating Report
2+
3+
Generated: 2026-05-26T19:04:26.917Z
4+
Status: PASS
5+
6+
## Gate Order
7+
8+
1. Zero-browser preflight must pass.
9+
2. Lane compilation must pass.
10+
3. Deterministic lane dependency validation must pass.
11+
4. Only dependency-eligible targeted lanes may be scheduled.
12+
13+
## Lane Dependency Graph
14+
15+
| Lane | Selected | Status | Dependencies | Affected Surface | Reason |
16+
| --- | --- | --- | --- | --- | --- |
17+
| workspace-contract | No | SKIP | none | Workspace Manager V2 contract and lifecycle behavior | Lane was not selected, so dependency-gated runtime scheduling skipped it. |
18+
| tool-runtime | Yes | PASS | none | First-class tool runtime behavior | Lane has no lane dependencies and is eligible after preflight and compilation pass. |
19+
| integration | Yes | PASS | none | Workspace, tool, game index, and manifest handoff behavior | Lane has no lane dependencies and is eligible after preflight and compilation pass. |
20+
| engine-src | No | SKIP | none | src/ engine and shared runtime capability behavior | Lane was not selected, so dependency-gated runtime scheduling skipped it. |
21+
| samples | No | SKIP | none | Affected samples lane, on request only | Lane was not selected, so dependency-gated runtime scheduling skipped it. |
22+
23+
## Dependency Failures Caught Pre-Runtime
24+
25+
No deterministic dependency failures were found before runtime.
26+
27+
## Enforcement Notes
28+
29+
- Invalid dependency graphs block runtime before Playwright startup.
30+
- Dependency failures do not trigger fallback reruns or unrelated lane execution.
31+
- Workspace V2 is scheduled only when the workspace-contract lane is explicitly selected.
32+
- Samples remain on-request only and are not implicit dependency gates.
Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,26 @@
11
# Lane Compilation Report
22

3-
Generated: 2026-05-26
4-
PR: PR_26146_028-zero-browser-preflight-and-lane-compilation
3+
Generated: 2026-05-26T19:04:26.917Z
4+
Status: PASS
55

6-
## Summary
6+
## Lane Graph
77

8-
Status: PASS
9-
Lane compilation failures: none
10-
Runtime discovery failures prevented: none needed
8+
| Lane | Status | Affected Surface | Targets | Commands | Reason |
9+
| --- | --- | --- | --- | --- | --- |
10+
| workspace-contract | SKIP | Workspace Manager V2 contract and lifecycle behavior | none | npm.cmd run test:workspace-v2 | Lane was not selected. |
11+
| tool-runtime | PASS | First-class tool runtime behavior | tests/playwright/tools/AssetManagerV2.spec.mjs; tests/playwright/tools/PreviewGeneratorV2Baseline.spec.mjs; tests/playwright/tools/CollisionInspectorV2.spec.mjs | C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/AssetManagerV2.spec.mjs --grep "launch guard|temporary UAT context|rejects non-Workspace" --project=playwright --workers=1 --reporter=list; C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/PreviewGeneratorV2Baseline.spec.mjs tests/playwright/tools/CollisionInspectorV2.spec.mjs --project=playwright --workers=1 --reporter=list | Lane graph, command shape, targets, fixtures, and ownership compile before runtime. |
12+
| integration | PASS | Workspace, tool, game index, and manifest handoff behavior | tests/playwright/integration/GameIndexPreviewManifestResolution.spec.mjs | C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/integration/GameIndexPreviewManifestResolution.spec.mjs --grep Pong --project=playwright --workers=1 --reporter=list | Lane graph, command shape, targets, fixtures, and ownership compile before runtime. |
13+
| engine-src | SKIP | src/ engine and shared runtime capability behavior | scripts/run-node-test-files.mjs; tests/core/EngineCoreBoundaryBaseline.test.mjs; tests/core/FrameClock.test.mjs; tests/core/FixedTicker.test.mjs; tests/assets/AssetLoaderSystem.test.mjs; tests/audio/AudioService.test.mjs; tests/input/InputMap.test.mjs; tests/input/KeyboardState.test.mjs; tests/input/MouseState.test.mjs; tests/input/GamepadInputAdapter.test.mjs; tests/input/GamepadHapticsService.test.mjs; tests/render/Renderer.test.mjs | C:\nvm4w\nodejs\node.exe scripts/run-node-test-files.mjs tests/core/EngineCoreBoundaryBaseline.test.mjs tests/core/FrameClock.test.mjs tests/core/FixedTicker.test.mjs tests/assets/AssetLoaderSystem.test.mjs tests/audio/AudioService.test.mjs tests/input/InputMap.test.mjs tests/input/KeyboardState.test.mjs tests/input/MouseState.test.mjs tests/input/GamepadInputAdapter.test.mjs tests/input/GamepadHapticsService.test.mjs tests/render/Renderer.test.mjs | Lane was not selected. |
14+
| samples | SKIP | Affected samples lane, on request only | scripts/run-node-test-files.mjs; tests/samples/SamplesProgramCombinedPass.test.mjs; tests/samples/FullscreenRuleEnforcement.test.mjs | C:\nvm4w\nodejs\node.exe scripts/run-node-test-files.mjs tests/samples/SamplesProgramCombinedPass.test.mjs tests/samples/FullscreenRuleEnforcement.test.mjs | Lane was not selected. |
1115

12-
## Compiled Lane Graph
16+
## Compilation Failures
1317

14-
| Lane | Status | Runtime Execution | Targets | Reason |
15-
| --- | --- | --- | --- | --- |
16-
| workspace-contract | PASS | Skipped | `npm run test:workspace-v2` | Lane definition compiles and fixture path resolves; not selected for affected runtime validation. |
17-
| tool-runtime | PASS | Executed | `tests/playwright/tools/AssetManagerV2.spec.mjs`; `tests/playwright/tools/PreviewGeneratorV2Baseline.spec.mjs`; `tests/playwright/tools/CollisionInspectorV2.spec.mjs` | Selected affected lane. Targets are inside `tests/playwright/tools`; grep pipe is Node-argv safe. |
18-
| integration | PASS | Executed | `tests/playwright/integration/GameIndexPreviewManifestResolution.spec.mjs` | Selected affected lane. Target is inside `tests/playwright/integration`. |
19-
| engine-src | PASS | Skipped | node engine/src test files | Lane definition compiles; not affected by this PR. |
20-
| samples | PASS | Skipped | node samples test files | Lane definition compiles; samples lane remains on-request and sample scope was not active. |
18+
No lane compilation failures.
2119

22-
## Compilation Rules
20+
## Deterministic Setup Rules
2321

2422
- Unknown lanes fail before runtime.
25-
- Missing targets, fixtures, or helper imports fail before runtime.
23+
- Missing targets or fixtures fail before runtime.
2624
- Playwright targets must stay inside the owning lane directory.
27-
- Shell-sensitive grep values must use the Node CLI argv path.
25+
- Shell-sensitive grep values must be passed through the Node CLI argv path.
2826
- Deterministic lane-definition failures do not trigger fallback reruns or full lane escalation.
29-
30-
## Runtime Savings Observations
31-
32-
- Lane graph resolution happens before browser startup.
33-
- Invalid targeted lane setup cannot fall through into runtime discovery.
34-
- Tool-runtime combines Preview Generator V2 and Collision Inspector V2 into one Playwright CLI invocation.
35-
- Workspace V2 was not scheduled for this PR.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Lane Runtime Optimization Report
2+
3+
Generated: 2026-05-26T19:04:26.917Z
4+
Status: PASS
5+
6+
## Runtime Cost Summary
7+
8+
Reused runtime sessions: 2
9+
Prevented redundant browser launches: 1
10+
Prevented redundant lane execution: 3
11+
Baseline Playwright/browser launches: 4
12+
Scheduled Playwright/browser launches: 3
13+
14+
## Scheduled Lane Order
15+
16+
1. tool-runtime
17+
2. integration
18+
19+
## Scheduling Blockers
20+
21+
No zero-browser, compilation, or dependency blockers were found.
22+
23+
## Lane Plans
24+
25+
| Lane | Baseline Browser Launches | Scheduled Browser Launches | Commands | Reason |
26+
| --- | --- | --- | --- | --- |
27+
| tool-runtime | 3 | 2 | C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/AssetManagerV2.spec.mjs --grep "launch guard|temporary UAT context|rejects non-Workspace" --project=playwright --workers=1 --reporter=list; C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/PreviewGeneratorV2Baseline.spec.mjs tests/playwright/tools/CollisionInspectorV2.spec.mjs --project=playwright --workers=1 --reporter=list | Tool runtime lane validates focused tool behavior without treating unrelated stale product assertions as blockers. |
28+
| integration | 1 | 1 | C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/integration/GameIndexPreviewManifestResolution.spec.mjs --grep Pong --project=playwright --workers=1 --reporter=list | Integration lane validates explicit cross-surface handoffs only; broad all-game thumbnail coverage is outside the default targeted lane. |
29+
30+
## Runtime Savings Observations
31+
32+
- Zero-browser preflight, lane compilation, and dependency validation run once per targeted runner invocation.
33+
- Compatible Playwright specs with matching options are kept in shared CLI invocations to avoid redundant browser startup.
34+
- Unselected lanes are not scheduled after isolated targeted lane failures.
35+
- Workspace V2 and samples lanes are not escalated unless explicitly selected.

docs/dev/reports/playwright_structure_audit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Playwright Structure Audit
22

3-
Generated: 2026-05-26T18:25:51.107Z
3+
Generated: 2026-05-26T19:04:26.887Z
44
Status: PASS
55

66
## Lane Directories

docs/dev/reports/static_validation_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Static Validation Report
22

3-
Generated: 2026-05-26T18:25:51.151Z
3+
Generated: 2026-05-26T19:04:26.914Z
44
Status: PASS
55
Static only: No
66
Dry run: No
77

88
## Requested Lanes
99

10-
- integration
1110
- tool-runtime
11+
- integration
1212

1313
## Prevented Launches
1414

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,72 @@
11
# Testing Lane Execution Report
22

3-
Generated: 2026-05-26
4-
PR: PR_26146_028-zero-browser-preflight-and-lane-compilation
3+
Generated: 2026-05-26T19:05:55.095Z
4+
Dry run: No
55

66
## Summary
77

8-
PASS: 3
8+
PASS: 2
99
WARN: 0
1010
FAIL: 0
1111
SKIP: 3
1212

1313
## Full Samples Smoke
1414

1515
Status: SKIP
16-
Reason: This PR changes zero-browser preflight, lane compilation, and targeted lane routing only. No sample JSON, shared sample loader, or sample framework files were changed.
16+
Reason: Skipped because changed files do not modify sample JSON or shared sample loader/framework behavior.
1717

18-
## Executed and Skipped Lanes
18+
## Preflight
1919

20-
| Lane / Check | Status | Executed/Skipped Reason | Affected Surface | Evidence |
21-
| --- | --- | --- | --- | --- |
22-
| zero-browser-preflight | PASS | Executed first to prove deterministic setup checks run before Playwright runtime initialization. | Placement, ownership, registrations, imports, fixtures, helpers, grep, quoting, lane references, lane configuration | `npm run test:playwright:zero-browser` passed and wrote zero-browser plus lane compilation reports. |
23-
| tool-runtime | PASS | Executed because lane compilation and zero-browser routing changed. | Asset Manager V2, Preview Generator V2, Collision Inspector V2 runtime tests | `PLAYWRIGHT_BROWSERS_PATH=0 node ./scripts/run-targeted-test-lanes.mjs --lanes integration,tool-runtime`; Asset Manager focused subset 5 passed, Preview Generator and Collision Inspector combined run 11 passed. |
24-
| integration | PASS | Executed because the integration lane remains part of the affected compiled lane graph. | Game index preview manifest handoff | Same combined runner command; focused Pong handoff subset 3 passed. |
25-
| workspace-contract | SKIP | Skipped because zero-browser preflight does not require Workspace V2 launch and Workspace V2 runtime wiring was not changed. | Workspace Manager V2 contract/lifecycle behavior | Not run. |
26-
| engine-src | SKIP | Skipped because no `src/`, engine Playwright, or node engine lane targets changed. | src/ engine/shared runtime behavior | Not run. |
27-
| samples | SKIP | Skipped because samples are on-request or affected-sample only and this PR did not impact samples. | On-request samples lane | Not run. |
20+
Status: PASS
21+
Reason: Runner preflight and Playwright structure audit passed before expensive lane execution.
22+
Command: C:\nvm4w\nodejs\node.exe scripts/audit-playwright-test-locations.mjs
23+
Details: Lane tool-runtime grep pattern is passed as a literal Node argv value: launch guard|temporary UAT context|rejects non-Workspace
24+
25+
## Dependency Gate
26+
27+
Status: PASS
28+
Reason: No deterministic dependency failures before runtime.
29+
30+
## Runtime Scheduling
2831

29-
## Prevented Launches and Fast-Fail Reasons
32+
Status: PASS
33+
Scheduled lane order: tool-runtime, integration
34+
Reused runtime sessions: 2
35+
Prevented redundant browser launches: 1
36+
Prevented redundant lane execution: 3
3037

31-
- Prevented browser launches: 0 in this validation run because no deterministic pre-runtime failures were found.
32-
- Fast-fail reasons: none.
33-
- If preflight finds placement, helper ownership, import, fixture, lane reference, lane configuration, grep, or quoting failures, the runner exits before Playwright/browser startup.
38+
## Validation Sequence
39+
40+
- PASS zero-browser preflight first: `npm run test:playwright:zero-browser`
41+
- PASS lane compilation validation second: `node ./scripts/run-targeted-test-lanes.mjs --zero-browser-only --lanes tool-runtime,integration`
42+
- PASS affected targeted runtime lanes after dependency validation: `PLAYWRIGHT_BROWSERS_PATH=0 node ./scripts/run-targeted-test-lanes.mjs --lanes tool-runtime,integration`
43+
- SKIP Workspace V2 lane: no Workspace V2 contract behavior was changed, and workspace-contract lane was not in scope.
44+
- SKIP full samples smoke: changed files do not modify sample JSON or shared sample loader/framework behavior.
45+
46+
## Lanes
47+
48+
| Lane | Status | Executed/Skipped Reason | Affected Surface | Fixtures / Inputs |
49+
| --- | --- | --- | --- | --- |
50+
| workspace-contract | SKIP | Lane was not selected for this targeted run. | Workspace Manager V2 contract and lifecycle behavior | tests/fixtures/workspace-v2/uat.manifest.json; mocked File System Access repo handles; explicit game manifest/toolState payloads |
51+
| tool-runtime | PASS | Tool runtime lane validates focused tool behavior without treating unrelated stale product assertions as blockers. | First-class tool runtime behavior | tool-specific mocked repo/file picker inputs; explicit manifest/toolState launch contexts |
52+
| integration | PASS | Integration lane validates explicit cross-surface handoffs only; broad all-game thumbnail coverage is outside the default targeted lane. | Workspace, tool, game index, and manifest handoff behavior | repo game manifests; manifest preview asset roles; repo-served browser pages |
53+
| engine-src | SKIP | Lane was not selected for this targeted run. | src/ engine and shared runtime capability behavior | explicit node unit fixtures; fresh in-memory localStorage/sessionStorage mocks per file |
54+
| samples | SKIP | Lane was not selected for this targeted run. | Affected samples lane, on request only | sample metadata and validation artifacts; sample structure fixtures |
3455

35-
## Corrected Ownership Drift
56+
## Commands
3657

37-
- No new misplaced tests or helpers were found in this PR.
38-
- Existing corrections remain enforced: Asteroids game specs under `tests/playwright/games`, integration handoff under `tests/playwright/integration`, documented game fixtures only in tool tests.
58+
### workspace-contract
59+
- SKIP
3960

40-
## Runtime Savings Observations
61+
### tool-runtime
62+
- PASS C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/AssetManagerV2.spec.mjs --grep "launch guard|temporary UAT context|rejects non-Workspace" --project=playwright --workers=1 --reporter=list
63+
- PASS C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/PreviewGeneratorV2Baseline.spec.mjs tests/playwright/tools/CollisionInspectorV2.spec.mjs --project=playwright --workers=1 --reporter=list
4164

42-
- Zero-browser preflight ran before browser startup.
43-
- Affected lanes ran in one Node lane-runner process.
44-
- Preview Generator V2 and Collision Inspector V2 ran through one Playwright CLI invocation.
45-
- Workspace V2, engine/src, samples, and full samples smoke were not started.
65+
### integration
66+
- PASS C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/integration/GameIndexPreviewManifestResolution.spec.mjs --grep Pong --project=playwright --workers=1 --reporter=list
4667

47-
## Static Validation
68+
### engine-src
69+
- SKIP
4870

49-
- PASS `node --check scripts/run-targeted-test-lanes.mjs`
50-
- PASS `node --check scripts/audit-playwright-test-locations.mjs`
71+
### samples
72+
- SKIP

0 commit comments

Comments
 (0)