-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodex_review.diff
More file actions
243 lines (240 loc) · 11 KB
/
Copy pathcodex_review.diff
File metadata and controls
243 lines (240 loc) · 11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
diff --git a/docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md b/docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md
index 47a7010d1..8134b4348 100644
--- a/docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md
+++ b/docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md
@@ -243,7 +243,8 @@ Current OWNER clarification:
- [ ] Delta - Shared JS consolidation
- [ ] Delta - API client consolidation
-- [ ] Delta - Runtime performance audit
+- [x] Delta - Runtime performance audit
+ - Completion reference: PR_26175_DELTA_001_Runtime_Performance_Optimization.
- [ ] Delta - Engine test coverage improvements
- [ ] Delta - Event system audit
- [ ] Delta - Controls runtime framework audit
diff --git a/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-branch-validation.md b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-branch-validation.md
new file mode 100644
index 000000000..2abd50a24
--- /dev/null
+++ b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-branch-validation.md
@@ -0,0 +1,15 @@
+# PR_26175_DELTA_001 Branch Validation
+
+| Gate | Status | Evidence |
+| --- | --- | --- |
+| Current branch before work | PASS | `main` |
+| Worktree before work | PASS | Clean |
+| Local/origin sync before work | PASS | `0 0` after `git pull --ff-only` |
+| Team ownership | PASS | Team Delta owns Runtime, Performance, and Runtime test coverage. |
+| Work branch | PASS | `PR_26175_DELTA_001_Runtime_Performance_Optimization` |
+| Previous Delta PR closed | PASS | No active Delta PR was present before PR_001. |
+| Scope boundary | PASS | Runtime tick-loop optimization, focused test, backlog/report artifacts only. |
+
+## Instruction Reads
+
+PASS - All files under `docs_build/dev/ProjectInstructions/` were read before implementation.
diff --git a/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-manual-validation-notes.md b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-manual-validation-notes.md
new file mode 100644
index 000000000..a3188b3b0
--- /dev/null
+++ b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-manual-validation-notes.md
@@ -0,0 +1,9 @@
+# PR_26175_DELTA_001 Manual Validation Notes
+
+- Confirmed Team Delta ownership covers Runtime, Performance, and Runtime test coverage.
+- Confirmed the optimization is limited to fixed-step runtime tick advancement.
+- Confirmed `advanceRuntimeTick(...)` now reuses the existing `deltaSeconds` value when present.
+- Confirmed legacy tick objects without `deltaSeconds` still advance successfully.
+- Confirmed no browser-owned data, API contract, UI, or tool state changes were introduced.
+- Confirmed backlog completion reference was added for `Delta - Runtime performance audit`.
+- Confirmed source branch disposition should remain `retained`.
diff --git a/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-requirement-checklist.md b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-requirement-checklist.md
new file mode 100644
index 000000000..3a7ed3b8f
--- /dev/null
+++ b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-requirement-checklist.md
@@ -0,0 +1,19 @@
+# PR_26175_DELTA_001 Requirement Checklist
+
+| Requirement | Status | Notes |
+| --- | --- | --- |
+| Team Delta ownership only | PASS | Runtime, Performance, and Runtime test coverage are Delta-owned. |
+| One PR purpose | PASS | Fixed-step tick-loop performance optimization only. |
+| Preserve backward compatibility | PASS | Added legacy tick fallback when `deltaSeconds` is absent. |
+| Update backlog | PASS | `Delta - Runtime performance audit` marked complete. |
+| Update tool state if applicable | PASS | Not applicable; no tool tile/status changed. |
+| Produce governance reports | PASS | Summary, branch validation, checklist, validation lane, manual notes, Codex diff, changed-file list, and ZIP. |
+| Runtime validation | PASS | Targeted node checks and runtime tick test passed. |
+| No unrelated files | PASS | Changes are limited to runtime tick loop, its focused test, backlog, and reports. |
+| No branch deletion | PASS | Source branch retained. |
+
+## Compatibility Notes
+
+- `advanceRuntimeTick(...)` preserves the same public tick shape.
+- Callers with old tick objects still get a computed `deltaSeconds` value.
+- Invalid fixed-delta errors remain unchanged.
diff --git a/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-validation.md b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-validation.md
new file mode 100644
index 000000000..bca34ff0c
--- /dev/null
+++ b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-validation.md
@@ -0,0 +1,25 @@
+# PR_26175_DELTA_001 Validation Lane
+
+## Commands
+
+```powershell
+node --check src/engine/runtime/runtimeTickLoop.js
+node --check tests/engine/RuntimeTickLoop.test.mjs
+node tests/engine/RuntimeTickLoop.test.mjs
+```
+
+## Results
+
+| Command | Status |
+| --- | --- |
+| `node --check src/engine/runtime/runtimeTickLoop.js` | PASS |
+| `node --check tests/engine/RuntimeTickLoop.test.mjs` | PASS |
+| `node tests/engine/RuntimeTickLoop.test.mjs` | PASS |
+
+## Browser Validation
+
+SKIP - No browser UI files changed.
+
+## Playwright Validation
+
+SKIP - Runtime tick-loop internals are covered by the focused Node runtime test.
diff --git a/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization.md b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization.md
new file mode 100644
index 000000000..245a36e45
--- /dev/null
+++ b/docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization.md
@@ -0,0 +1,42 @@
+# PR_26175_DELTA_001_Runtime_Performance_Optimization
+
+## Summary
+
+Team Delta completed a focused runtime performance optimization for the fixed-step runtime tick loop.
+
+The runtime now reuses the precomputed `deltaSeconds` value already stored on a tick when advancing frames. This avoids recalculating the fixed delta seconds on every frame while preserving compatibility for legacy tick objects that do not yet carry `deltaSeconds`.
+
+## Scope
+
+- Team: Delta
+- Backlog item: `Delta - Runtime performance audit`
+- Runtime file changed: `src/engine/runtime/runtimeTickLoop.js`
+- Test file changed: `tests/engine/RuntimeTickLoop.test.mjs`
+- Backlog updated: `docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md`
+
+## Runtime Impact
+
+PASS - Fixed-step runtime advancement behavior remains backward compatible.
+
+- Existing tick objects from `createRuntimeTickLoop(...)` retain `deltaSeconds`.
+- `advanceRuntimeTick(...)` reuses that value.
+- Legacy tick objects without `deltaSeconds` still compute a valid fallback.
+- Invalid fixed-delta handling is unchanged.
+
+## Backlog Update
+
+PASS - `Delta - Runtime performance audit` is marked complete with this PR as the completion reference.
+
+## Tool State Update
+
+SKIP - No Build Path tool status or tool tile state changed. This PR affects runtime internals only.
+
+## Validation Summary
+
+PASS - Targeted runtime validation completed.
+
+See `PR_26175_DELTA_001_Runtime_Performance_Optimization-validation.md` for command details.
+
+## Branch Disposition
+
+Source branch should be retained after merge unless OWNER later approves branch deletion.
diff --git a/docs_build/dev/reports/codex_changed_files.txt b/docs_build/dev/reports/codex_changed_files.txt
index 4cb4ab3d9..729da1632 100644
--- a/docs_build/dev/reports/codex_changed_files.txt
+++ b/docs_build/dev/reports/codex_changed_files.txt
@@ -1,27 +1,10 @@
-assets/theme-v2/js/gamefoundry-partials.js
-assets/theme-v2/js/legal-document-page.js
-assets/theme-v2/partials/footer.html
-docs_build/dev/reports/PR_26175_OWNER_054-legal-corrected-package.md
-docs_build/dev/reports/codex_changed_files.txt
-docs_build/dev/reports/codex_review.diff
-docs_build/dev/reports/coverage_changed_js_guardrail.txt
-docs_build/dev/reports/playwright_v8_coverage_report.txt
-legal/community-guidelines.html
-legal/community-guidelines.md
-legal/cookie-policy.html
-legal/cookie-policy.md
-legal/cookies-policy.html
-legal/copyright-policy.html
-legal/copyright-policy.md
-legal/disclaimer.html
-legal/dmca-policy.html
-legal/dmca-policy.md
-legal/index.html
-legal/index.md
-legal/legal-nav.js
-legal/privacy-policy.html
-legal/privacy-policy.md
-legal/terms.html
-legal/terms-of-service.html
-legal/terms-of-service.md
-tests/playwright/tools/RemainingLegalPages.spec.mjs
\ No newline at end of file
+docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md / updated
+src/engine/runtime/runtimeTickLoop.js / updated
+tests/engine/RuntimeTickLoop.test.mjs / updated
+docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization.md / added
+docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-branch-validation.md / added
+docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-requirement-checklist.md / added
+docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-validation.md / added
+docs_build/dev/reports/PR_26175_DELTA_001_Runtime_Performance_Optimization-manual-validation-notes.md / added
+docs_build/dev/reports/codex_changed_files.txt / updated
+docs_build/dev/reports/codex_review.diff / updated
diff --git a/src/engine/runtime/runtimeTickLoop.js b/src/engine/runtime/runtimeTickLoop.js
index 39197ca04..06246b31c 100644
--- a/src/engine/runtime/runtimeTickLoop.js
+++ b/src/engine/runtime/runtimeTickLoop.js
@@ -48,12 +48,16 @@ export function advanceRuntimeTick(tick) {
});
}
+ const deltaSeconds = Number.isFinite(tick.deltaSeconds) && tick.deltaSeconds > 0
+ ? tick.deltaSeconds
+ : tick.fixedDeltaMs / 1000;
+
return createTickResult({
tick: Object.freeze({
frame: tick.frame + 1,
elapsedMs: tick.elapsedMs + tick.fixedDeltaMs,
fixedDeltaMs: tick.fixedDeltaMs,
- deltaSeconds: tick.fixedDeltaMs / 1000,
+ deltaSeconds,
}),
errors: [],
});
diff --git a/tests/engine/RuntimeTickLoop.test.mjs b/tests/engine/RuntimeTickLoop.test.mjs
index d33d5e7e8..a968c7f3f 100644
--- a/tests/engine/RuntimeTickLoop.test.mjs
+++ b/tests/engine/RuntimeTickLoop.test.mjs
@@ -19,6 +19,19 @@ export function run() {
const nextResult = advanceRuntimeTick(startResult.tick);
assert.equal(nextResult.valid, true);
assert.deepEqual(nextResult.tick, { frame: 1, elapsedMs: 100, fixedDeltaMs: 100, deltaSeconds: 0.1 });
+ assert.equal(
+ nextResult.tick.deltaSeconds,
+ startResult.tick.deltaSeconds,
+ 'Runtime tick advance should reuse the precomputed deltaSeconds value.'
+ );
+
+ const legacyTickResult = advanceRuntimeTick({ frame: 2, elapsedMs: 200, fixedDeltaMs: 100 });
+ assert.equal(legacyTickResult.valid, true);
+ assert.deepEqual(
+ legacyTickResult.tick,
+ { frame: 3, elapsedMs: 300, fixedDeltaMs: 100, deltaSeconds: 0.1 },
+ 'Runtime tick advance should preserve compatibility for ticks without deltaSeconds.'
+ );
const invalidResult = createRuntimeTickLoop({ fixedDeltaMs: 0 });
assert.equal(invalidResult.valid, false);