@reicek/neataptic-ts 0.1.21 → 0.1.22
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/.github/agents/boundary-mapper.agent.md +29 -0
- package/.github/agents/docs-scout.agent.md +29 -0
- package/.github/agents/plan-scout.agent.md +29 -0
- package/.github/agents/solid-split.agent.md +138 -0
- package/.github/copilot-instructions.md +103 -0
- package/package.json +6 -3
- package/plans/ES2023 migration +13 -8
- package/plans/Evolution_Training_Interoperability_Contracts.md +1 -1
- package/plans/Interactive_Examples_and_Learning_Path.md +10 -2
- package/plans/Memory_Optimization.md +3 -3
- package/plans/README.md +63 -0
- package/plans/Roadmap.md +15 -3
- package/plans/asciiMaze_SOLID_split.done.md +130 -0
- package/plans/flappy_bird_SOLID_split.done.md +67 -0
- package/scripts/assets/theme.css +221 -34
- package/scripts/copy-examples.mjs +9 -5
- package/scripts/export-onnx.mjs +3 -3
- package/scripts/generate-bench-tables.mjs +10 -10
- package/scripts/generate-bench-tables.ts +10 -10
- package/scripts/generate-docs.ts +1415 -449
- package/scripts/render-docs-html.ts +15 -8
- package/src/README.md +101 -223
- package/src/architecture/README.md +57 -185
- package/src/architecture/layer/README.md +38 -38
- package/src/architecture/network/README.md +33 -31
- package/src/architecture/network/activate/README.md +77 -77
- package/src/architecture/network/connect/README.md +15 -13
- package/src/architecture/network/deterministic/README.md +7 -7
- package/src/architecture/network/evolve/README.md +44 -44
- package/src/architecture/network/gating/README.md +20 -20
- package/src/architecture/network/genetic/README.md +51 -51
- package/src/architecture/network/mutate/README.md +97 -97
- package/src/architecture/network/onnx/README.md +264 -264
- package/src/architecture/network/prune/README.md +39 -39
- package/src/architecture/network/remove/README.md +26 -26
- package/src/architecture/network/serialize/README.md +56 -56
- package/src/architecture/network/slab/README.md +61 -61
- package/src/architecture/network/standalone/README.md +24 -24
- package/src/architecture/network/stats/README.md +9 -9
- package/src/architecture/network/topology/README.md +46 -46
- package/src/architecture/network/training/README.md +21 -21
- package/src/methods/README.md +9 -87
- package/src/multithreading/README.md +8 -77
- package/src/multithreading/workers/README.md +2 -2
- package/src/multithreading/workers/browser/README.md +0 -6
- package/src/multithreading/workers/node/README.md +0 -3
- package/src/neat/README.md +562 -568
- package/src/utils/README.md +18 -18
- package/test/examples/asciiMaze/README.md +59 -59
- package/test/examples/asciiMaze/asciiMaze.e2e.test.ts +14 -9
- package/test/examples/asciiMaze/browser-entry/README.md +196 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.abort.services.ts +95 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.constants.ts +23 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.curriculum.services.ts +115 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.globals.services.ts +106 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.host.services.ts +157 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.services.ts +14 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.ts +129 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.types.ts +120 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.utils.ts +98 -0
- package/test/examples/asciiMaze/browser-entry.ts +10 -576
- package/test/examples/asciiMaze/dashboardManager/README.md +276 -0
- package/test/examples/asciiMaze/dashboardManager/archive/README.md +16 -0
- package/test/examples/asciiMaze/dashboardManager/archive/dashboardManager.archive.services.ts +267 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.constants.ts +35 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.services.ts +103 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.ts +181 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.types.ts +267 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.utils.ts +254 -0
- package/test/examples/asciiMaze/dashboardManager/live/README.md +14 -0
- package/test/examples/asciiMaze/dashboardManager/live/dashboardManager.live.services.ts +264 -0
- package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +47 -0
- package/test/examples/asciiMaze/dashboardManager/telemetry/dashboardManager.telemetry.services.ts +513 -0
- package/test/examples/asciiMaze/dashboardManager.ts +13 -2335
- package/test/examples/asciiMaze/evolutionEngine/README.md +1058 -0
- package/test/examples/asciiMaze/evolutionEngine/curriculumPhase.ts +90 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.constants.ts +36 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.ts +58 -513
- package/test/examples/asciiMaze/evolutionEngine/engineState.types.ts +212 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.utils.ts +301 -0
- package/test/examples/asciiMaze/evolutionEngine/evolutionEngine.types.ts +445 -0
- package/test/examples/asciiMaze/evolutionEngine/evolutionLoop.ts +81 -50
- package/test/examples/asciiMaze/evolutionEngine/optionsAndSetup.ts +2 -4
- package/test/examples/asciiMaze/evolutionEngine/populationDynamics.ts +17 -33
- package/test/examples/asciiMaze/evolutionEngine/populationPruning.ts +1 -1
- package/test/examples/asciiMaze/evolutionEngine/rngAndTiming.ts +1 -2
- package/test/examples/asciiMaze/evolutionEngine/sampling.ts +1 -1
- package/test/examples/asciiMaze/evolutionEngine/scratchPools.ts +2 -5
- package/test/examples/asciiMaze/evolutionEngine/setupHelpers.ts +30 -37
- package/test/examples/asciiMaze/evolutionEngine/telemetryMetrics.ts +16 -58
- package/test/examples/asciiMaze/evolutionEngine/trainingWarmStart.ts +2 -2
- package/test/examples/asciiMaze/evolutionEngine.ts +55 -55
- package/test/examples/asciiMaze/fitness.ts +2 -2
- package/test/examples/asciiMaze/fitness.types.ts +65 -0
- package/test/examples/asciiMaze/interfaces.ts +64 -1352
- package/test/examples/asciiMaze/mazeMovement/README.md +356 -0
- package/test/examples/asciiMaze/mazeMovement/finalization/README.md +49 -0
- package/test/examples/asciiMaze/mazeMovement/finalization/mazeMovement.finalization.ts +138 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.constants.ts +101 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.services.ts +230 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.ts +299 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.types.ts +185 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.utils.ts +153 -0
- package/test/examples/asciiMaze/mazeMovement/policy/README.md +91 -0
- package/test/examples/asciiMaze/mazeMovement/policy/mazeMovement.policy.ts +467 -0
- package/test/examples/asciiMaze/mazeMovement/runtime/README.md +95 -0
- package/test/examples/asciiMaze/mazeMovement/runtime/mazeMovement.runtime.ts +354 -0
- package/test/examples/asciiMaze/mazeMovement/shaping/README.md +124 -0
- package/test/examples/asciiMaze/mazeMovement/shaping/mazeMovement.shaping.ts +459 -0
- package/test/examples/asciiMaze/mazeMovement.ts +12 -2978
- package/test/examples/flappy_bird/Trace-20260309T191949.json +24124 -0
- package/test/examples/flappy_bird/browser-entry/README.md +1129 -0
- package/test/examples/flappy_bird/browser-entry/browser-entry.host.utils.ts +4 -324
- package/test/examples/flappy_bird/browser-entry/browser-entry.network-view.utils.ts +6 -399
- package/test/examples/flappy_bird/browser-entry/browser-entry.playback.utils.ts +1 -717
- package/test/examples/flappy_bird/browser-entry/browser-entry.spawn.utils.ts +11 -31
- package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.utils.ts +15 -893
- package/test/examples/flappy_bird/browser-entry/host/README.md +307 -0
- package/test/examples/flappy_bird/browser-entry/host/host.resize.service.ts +1 -295
- package/test/examples/flappy_bird/browser-entry/host/host.ts +562 -6
- package/test/examples/flappy_bird/browser-entry/host/resize/README.md +274 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.constants.ts +31 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.services.ts +360 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.ts +117 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.types.ts +63 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.utils.ts +250 -0
- package/test/examples/flappy_bird/browser-entry/network-view/README.md +399 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.topology.utils.ts +255 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.ts +802 -7
- package/test/examples/flappy_bird/browser-entry/playback/README.md +684 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/README.md +277 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +770 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.cache.services.ts +178 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.constants.ts +107 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.utils.ts +518 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.ts +117 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.ts +233 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.services.ts +211 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.ts +48 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.types.ts +212 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.utils.ts +81 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.cache.services.ts +96 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.constants.ts +62 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.services.ts +244 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.ts +53 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.types.ts +68 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.utils.ts +100 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +310 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.ts +92 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.services.ts +272 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.types.ts +39 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.utils.ts +493 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.constants.ts +1 -1
- package/test/examples/flappy_bird/browser-entry/playback/playback.frame-render.service.ts +4 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.ts +44 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.service.ts +39 -122
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.services.ts +272 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.types.ts +62 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.utils.ts +11 -4
- package/test/examples/flappy_bird/browser-entry/playback/playback.ts +409 -8
- package/test/examples/flappy_bird/browser-entry/playback/playback.types.ts +4 -12
- package/test/examples/flappy_bird/browser-entry/runtime/README.md +235 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-launch.service.ts +45 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.lifecycle.service.ts +81 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.startup.service.ts +74 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.ts +31 -121
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.types.ts +36 -0
- package/test/examples/flappy_bird/browser-entry/visualization/README.md +557 -0
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.constants.ts +110 -0
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.draw.service.ts +957 -19
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.legend.utils.ts +138 -3
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.topology.utils.ts +3 -27
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.ts +1 -23
- package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +156 -0
- package/test/examples/flappy_bird/constants/README.md +1179 -0
- package/test/examples/flappy_bird/constants/constants.network-view.ts +24 -0
- package/test/examples/flappy_bird/constants/constants.palette.ts +7 -0
- package/test/examples/flappy_bird/constants/constants.starfield.ts +78 -3
- package/test/examples/flappy_bird/environment/README.md +143 -0
- package/test/examples/flappy_bird/environment/environment.observation.utils.ts +1 -19
- package/test/examples/flappy_bird/environment/environment.step.service.ts +3 -66
- package/test/examples/flappy_bird/evaluation/README.md +130 -0
- package/test/examples/flappy_bird/evaluation/evaluation.fitness.utils.ts +1 -1
- package/test/examples/flappy_bird/evaluation/evaluation.rollout.service.ts +5 -375
- package/test/examples/flappy_bird/evaluation/rollout/README.md +291 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.constants.ts +30 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.service.ts +58 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.services.ts +310 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.types.ts +56 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.utils.ts +368 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/README.md +618 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.playback.service.ts +7 -7
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.frame.service.ts +364 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.types.ts +14 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.utils.ts +4 -201
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +184 -345
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.warm-start.service.ts +291 -0
- package/test/examples/flappy_bird/flappy.simulation.shared.utils.ts +5 -0
- package/test/examples/flappy_bird/simulation-shared/README.md +417 -0
- package/test/examples/flappy_bird/simulation-shared/observation/README.md +183 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.features.utils.ts +301 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.ts +9 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.vector.utils.ts +59 -0
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.observation.utils.ts +5 -403
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.spawn.utils.ts +20 -6
- package/test/examples/flappy_bird/{evaluation/evaluation.statistics.utils.ts → simulation-shared/simulation-shared.statistics.utils.ts} +23 -8
- package/test/examples/flappy_bird/trainer/README.md +563 -0
- package/test/examples/flappy_bird/trainer/evaluation/README.md +199 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.constants.ts +9 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.services.ts +73 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.ts +165 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.types.ts +25 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.utils.ts +161 -0
- package/test/examples/flappy_bird/trainer/trainer.evaluation.service.ts +13 -0
- package/test/examples/flappy_bird/trainer/trainer.report.service.services.ts +181 -0
- package/test/examples/flappy_bird/trainer/trainer.report.service.ts +126 -0
- package/test/examples/flappy_bird/trainer/trainer.selection.utils.ts +89 -0
- package/test/examples/flappy_bird/trainer/trainer.ts +11 -553
- package/test/examples/flappy_bird/browser-entry/browser-entry.utils.ts +0 -12
- package/test/examples/flappy_bird/environment/environment.ts +0 -7
- package/test/examples/flappy_bird/evaluation/evaluation.ts +0 -7
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.ts +0 -15
- package/test/examples/flappy_bird/trainer/trainer.statistics.utils.ts +0 -78
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
# browser-entry/playback
|
|
2
|
+
|
|
3
|
+
## browser-entry/playback/playback.types.ts
|
|
4
|
+
|
|
5
|
+
### PlaybackEdgeBounds
|
|
6
|
+
|
|
7
|
+
Axis-aligned visible world bounds used for edge-aware trail fading.
|
|
8
|
+
|
|
9
|
+
### PlaybackStarfieldLayerSpec
|
|
10
|
+
|
|
11
|
+
Declarative recipe for building one cached starfield parallax layer.
|
|
12
|
+
|
|
13
|
+
### StarTile
|
|
14
|
+
|
|
15
|
+
Shared type contract for starfield tile rendering layers.
|
|
16
|
+
|
|
17
|
+
A tile is pre-rendered and repeated horizontally to draw efficient
|
|
18
|
+
parallax backgrounds during playback.
|
|
19
|
+
|
|
20
|
+
## browser-entry/playback/playback.starfield.types.ts
|
|
21
|
+
|
|
22
|
+
### playback.starfield.types
|
|
23
|
+
|
|
24
|
+
Shared type contract for starfield tile rendering layers.
|
|
25
|
+
|
|
26
|
+
A tile is pre-rendered and repeated horizontally to draw efficient
|
|
27
|
+
parallax backgrounds during playback.
|
|
28
|
+
|
|
29
|
+
### CreateStarTileCanvasOptions
|
|
30
|
+
|
|
31
|
+
Input contract for pre-rendering one deterministic starfield tile.
|
|
32
|
+
|
|
33
|
+
The generated tile is cached and repeated horizontally during playback,
|
|
34
|
+
so every field here affects both the visual look and the parallax cost.
|
|
35
|
+
|
|
36
|
+
### PlaybackStarfieldLayerSpec
|
|
37
|
+
|
|
38
|
+
Declarative recipe for building one cached starfield parallax layer.
|
|
39
|
+
|
|
40
|
+
### StarfieldCanvasDimensions
|
|
41
|
+
|
|
42
|
+
Normalized canvas dimensions used by browser and offscreen tile creation.
|
|
43
|
+
|
|
44
|
+
### StarPlacement
|
|
45
|
+
|
|
46
|
+
Deterministic placement and appearance for one rendered star sprite.
|
|
47
|
+
|
|
48
|
+
### StarTile
|
|
49
|
+
|
|
50
|
+
Shared type contract for starfield tile rendering layers.
|
|
51
|
+
|
|
52
|
+
A tile is pre-rendered and repeated horizontally to draw efficient
|
|
53
|
+
parallax backgrounds during playback.
|
|
54
|
+
|
|
55
|
+
## browser-entry/playback/playback.ts
|
|
56
|
+
|
|
57
|
+
### animatePopulationEpisode
|
|
58
|
+
|
|
59
|
+
`(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D, evolutionWorker: Worker, onFrameStats: (stats: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").PlaybackFrameStats) => void) => Promise<import("test/examples/flappy_bird/browser-entry/playback/playback").PlaybackEpisodeSummary>`
|
|
60
|
+
|
|
61
|
+
Public playback entry point used by browser runtime orchestration.
|
|
62
|
+
|
|
63
|
+
Parameters:
|
|
64
|
+
|
|
65
|
+
- `canvas` - - Target playback canvas.
|
|
66
|
+
- `context` - - Canvas 2D context.
|
|
67
|
+
- `evolutionWorker` - - Worker owning playback simulation state.
|
|
68
|
+
- `onFrameStats` - - Callback receiving per-frame playback telemetry.
|
|
69
|
+
|
|
70
|
+
Returns: Aggregate playback summary for the current episode.
|
|
71
|
+
|
|
72
|
+
### animatePopulationEpisodeInternal
|
|
73
|
+
|
|
74
|
+
`(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D, evolutionWorker: Worker, onFrameStats: (stats: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").PlaybackFrameStats) => void) => Promise<import("test/examples/flappy_bird/browser-entry/playback/playback").PlaybackEpisodeSummary>`
|
|
75
|
+
|
|
76
|
+
Internal playback orchestration entry retained for compatibility re-exports.
|
|
77
|
+
|
|
78
|
+
Parameters:
|
|
79
|
+
|
|
80
|
+
- `canvas` - - Target playback canvas.
|
|
81
|
+
- `context` - - Canvas 2D context.
|
|
82
|
+
- `evolutionWorker` - - Worker owning playback simulation state.
|
|
83
|
+
- `onFrameStats` - - Callback receiving per-frame playback telemetry.
|
|
84
|
+
|
|
85
|
+
Returns: Aggregate playback summary for the current episode.
|
|
86
|
+
|
|
87
|
+
### applyPlaybackStepSnapshot
|
|
88
|
+
|
|
89
|
+
`(sessionContext: PlaybackSessionContext, snapshot: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").EvolutionPlaybackStepSnapshot) => void`
|
|
90
|
+
|
|
91
|
+
Applies the latest worker snapshot to render state and trail caches.
|
|
92
|
+
|
|
93
|
+
Parameters:
|
|
94
|
+
|
|
95
|
+
- `sessionContext` - - Shared mutable playback session state.
|
|
96
|
+
- `snapshot` - - Worker snapshot for the current playback batch.
|
|
97
|
+
|
|
98
|
+
Returns: Nothing.
|
|
99
|
+
|
|
100
|
+
### createInitialPlaybackLoopState
|
|
101
|
+
|
|
102
|
+
`() => PlaybackLoopState`
|
|
103
|
+
|
|
104
|
+
Creates the mutable loop state used while processing playback steps.
|
|
105
|
+
|
|
106
|
+
Returns: Initialized loop state and aggregate summary values.
|
|
107
|
+
|
|
108
|
+
### createInitialRenderState
|
|
109
|
+
|
|
110
|
+
`(viewportDimensions: { visibleWorldWidthPx: number; visibleWorldHeightPx: number; }) => import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").PopulationRenderState`
|
|
111
|
+
|
|
112
|
+
Creates the initial render state used before the first worker snapshot.
|
|
113
|
+
|
|
114
|
+
Parameters:
|
|
115
|
+
|
|
116
|
+
- `viewportDimensions` - - Current visible world dimensions.
|
|
117
|
+
|
|
118
|
+
Returns: Initialized population render state.
|
|
119
|
+
|
|
120
|
+
### createInitialTrailState
|
|
121
|
+
|
|
122
|
+
`() => import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").TrailState`
|
|
123
|
+
|
|
124
|
+
Creates the initial trail state used before any snapshots have been applied.
|
|
125
|
+
|
|
126
|
+
Returns: Empty trail state for all birds.
|
|
127
|
+
|
|
128
|
+
### emitPlaybackFrameStats
|
|
129
|
+
|
|
130
|
+
`(iterationContext: PlaybackIterationContext, playbackStepPayload: { snapshot: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").EvolutionPlaybackStepSnapshot; instrumentation?: { activationCallsPerFrame: number; simulationStepsPerRaf: number; } | undefined; done: boolean; averagePipesPassed?: number | undefined; p90FramesSurvived?: number | undefined; winnerPipesPassed?: number | undefined; winnerFramesSurvived?: number | undefined; }) => void`
|
|
131
|
+
|
|
132
|
+
Resolves leader telemetry and emits the public frame-stats callback.
|
|
133
|
+
|
|
134
|
+
Parameters:
|
|
135
|
+
|
|
136
|
+
- `iterationContext` - - Shared loop dependencies and mutable playback state.
|
|
137
|
+
- `playbackStepPayload` - - Worker playback result for the current iteration.
|
|
138
|
+
|
|
139
|
+
Returns: Nothing.
|
|
140
|
+
|
|
141
|
+
### initializePlaybackSessionContext
|
|
142
|
+
|
|
143
|
+
`(canvas: HTMLCanvasElement, evolutionWorker: Worker) => PlaybackSessionContext`
|
|
144
|
+
|
|
145
|
+
Initializes worker playback and local state mirrors for one episode.
|
|
146
|
+
|
|
147
|
+
Parameters:
|
|
148
|
+
|
|
149
|
+
- `canvas` - - Target playback canvas.
|
|
150
|
+
- `evolutionWorker` - - Worker owning playback simulation state.
|
|
151
|
+
|
|
152
|
+
Returns: Session context shared across the playback loop.
|
|
153
|
+
|
|
154
|
+
### PlaybackEpisodeSummary
|
|
155
|
+
|
|
156
|
+
### requestPlaybackStepPayload
|
|
157
|
+
|
|
158
|
+
`(iterationContext: PlaybackIterationContext) => Promise<{ snapshot: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").EvolutionPlaybackStepSnapshot; instrumentation?: { activationCallsPerFrame: number; simulationStepsPerRaf: number; } | undefined; done: boolean; averagePipesPassed?: number | undefined; p90FramesSurvived?: number | undefined; winnerPipesPassed?: number | undefined; winnerFramesSurvived?: number | undefined; }>`
|
|
159
|
+
|
|
160
|
+
Requests one playback step batch from the evolution worker.
|
|
161
|
+
|
|
162
|
+
Parameters:
|
|
163
|
+
|
|
164
|
+
- `iterationContext` - - Shared loop dependencies and mutable playback state.
|
|
165
|
+
|
|
166
|
+
Returns: Worker playback step payload for the current iteration.
|
|
167
|
+
|
|
168
|
+
### resolvePlaybackEpisodeSummary
|
|
169
|
+
|
|
170
|
+
`(summary: PlaybackMutableSummary) => import("test/examples/flappy_bird/browser-entry/playback/playback").PlaybackEpisodeSummary`
|
|
171
|
+
|
|
172
|
+
Folds the mutable loop summary into the public playback summary shape.
|
|
173
|
+
|
|
174
|
+
Parameters:
|
|
175
|
+
|
|
176
|
+
- `summary` - - Mutable loop summary accumulated during playback.
|
|
177
|
+
|
|
178
|
+
Returns: Public playback episode summary.
|
|
179
|
+
|
|
180
|
+
### resolvePlaybackViewportDimensions
|
|
181
|
+
|
|
182
|
+
`(canvas: HTMLCanvasElement) => { visibleWorldWidthPx: number; visibleWorldHeightPx: number; }`
|
|
183
|
+
|
|
184
|
+
Resolves the current visible playback viewport dimensions from the canvas.
|
|
185
|
+
|
|
186
|
+
Parameters:
|
|
187
|
+
|
|
188
|
+
- `canvas` - - Target playback canvas.
|
|
189
|
+
|
|
190
|
+
Returns: Visible world width and height in pixels.
|
|
191
|
+
|
|
192
|
+
### runPlaybackIteration
|
|
193
|
+
|
|
194
|
+
`(iterationContext: PlaybackIterationContext) => Promise<void>`
|
|
195
|
+
|
|
196
|
+
Executes one playback iteration from viewport sync through render pacing.
|
|
197
|
+
|
|
198
|
+
Parameters:
|
|
199
|
+
|
|
200
|
+
- `iterationContext` - - Shared loop dependencies and mutable playback state.
|
|
201
|
+
|
|
202
|
+
Returns: Nothing.
|
|
203
|
+
|
|
204
|
+
### runPlaybackLoop
|
|
205
|
+
|
|
206
|
+
`(iterationContext: PlaybackIterationContext) => Promise<void>`
|
|
207
|
+
|
|
208
|
+
Runs playback iterations until the worker reports that the episode is done.
|
|
209
|
+
|
|
210
|
+
Parameters:
|
|
211
|
+
|
|
212
|
+
- `iterationContext` - - Shared loop dependencies and mutable playback state.
|
|
213
|
+
|
|
214
|
+
Returns: Nothing.
|
|
215
|
+
|
|
216
|
+
### syncPlaybackViewportDimensions
|
|
217
|
+
|
|
218
|
+
`(canvas: HTMLCanvasElement, renderState: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").PopulationRenderState) => void`
|
|
219
|
+
|
|
220
|
+
Synchronizes the render state viewport fields with the current canvas size.
|
|
221
|
+
|
|
222
|
+
Parameters:
|
|
223
|
+
|
|
224
|
+
- `canvas` - - Target playback canvas.
|
|
225
|
+
- `renderState` - - Mutable render state updated in place.
|
|
226
|
+
|
|
227
|
+
Returns: Nothing.
|
|
228
|
+
|
|
229
|
+
### updatePlaybackLoopCompletion
|
|
230
|
+
|
|
231
|
+
`(loopState: PlaybackLoopState, playbackStepPayload: { snapshot: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").EvolutionPlaybackStepSnapshot; instrumentation?: { activationCallsPerFrame: number; simulationStepsPerRaf: number; } | undefined; done: boolean; averagePipesPassed?: number | undefined; p90FramesSurvived?: number | undefined; winnerPipesPassed?: number | undefined; winnerFramesSurvived?: number | undefined; }) => void`
|
|
232
|
+
|
|
233
|
+
Updates the loop summary when the worker reports playback completion.
|
|
234
|
+
|
|
235
|
+
Parameters:
|
|
236
|
+
|
|
237
|
+
- `loopState` - - Mutable playback loop state.
|
|
238
|
+
- `playbackStepPayload` - - Worker playback result for the current iteration.
|
|
239
|
+
|
|
240
|
+
Returns: Nothing.
|
|
241
|
+
|
|
242
|
+
## browser-entry/playback/playback.errors.ts
|
|
243
|
+
|
|
244
|
+
### playback.errors
|
|
245
|
+
|
|
246
|
+
Error message emitted when playback requires RAF but it is unavailable.
|
|
247
|
+
|
|
248
|
+
### PLAYBACK_ANIMATION_FRAME_UNAVAILABLE_ERROR_MESSAGE
|
|
249
|
+
|
|
250
|
+
### PlaybackAnimationFrameUnavailableError
|
|
251
|
+
|
|
252
|
+
Error thrown when a playback frame wait is requested without RAF support.
|
|
253
|
+
|
|
254
|
+
## browser-entry/playback/playback.constants.ts
|
|
255
|
+
|
|
256
|
+
### cachedStarfieldTilesByHeight
|
|
257
|
+
|
|
258
|
+
## browser-entry/playback/playback.loop.service.ts
|
|
259
|
+
|
|
260
|
+
### nextAnimationFrame
|
|
261
|
+
|
|
262
|
+
`() => Promise<void>`
|
|
263
|
+
|
|
264
|
+
Yields until the next browser animation frame.
|
|
265
|
+
|
|
266
|
+
Returns: Promise resolved on next animation frame.
|
|
267
|
+
|
|
268
|
+
## browser-entry/playback/playback.render.service.ts
|
|
269
|
+
|
|
270
|
+
### drawPipeNeonOutline
|
|
271
|
+
|
|
272
|
+
`(context: CanvasRenderingContext2D, rectangleLeftPx: number, rectangleTopPx: number, rectangleWidthPx: number, rectangleHeightPx: number) => void`
|
|
273
|
+
|
|
274
|
+
Draws a simplified neon outline around a pipe rectangle.
|
|
275
|
+
|
|
276
|
+
Parameters:
|
|
277
|
+
|
|
278
|
+
- `context` - - Canvas 2D context.
|
|
279
|
+
- `rectangleLeftPx` - - Rectangle left position.
|
|
280
|
+
- `rectangleTopPx` - - Rectangle top position.
|
|
281
|
+
- `rectangleWidthPx` - - Rectangle width.
|
|
282
|
+
- `rectangleHeightPx` - - Rectangle height.
|
|
283
|
+
|
|
284
|
+
Returns: Nothing.
|
|
285
|
+
|
|
286
|
+
## browser-entry/playback/playback.starfield.service.ts
|
|
287
|
+
|
|
288
|
+
### createStarTile
|
|
289
|
+
|
|
290
|
+
`(layerSpec: import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").PlaybackStarfieldLayerSpec, tileHeightPx: number) => import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").StarTile`
|
|
291
|
+
|
|
292
|
+
Creates one cached tile layer from a declarative layer specification.
|
|
293
|
+
|
|
294
|
+
Parameters:
|
|
295
|
+
|
|
296
|
+
- `layerSpec` - - Density and motion contract for a starfield layer.
|
|
297
|
+
- `tileHeightPx` - - Height of the visible sky band in pixels.
|
|
298
|
+
|
|
299
|
+
Returns: Cached tile metadata for parallax drawing.
|
|
300
|
+
|
|
301
|
+
### resolveStarfieldTiles
|
|
302
|
+
|
|
303
|
+
`(visibleWorldHeightPx: number) => readonly import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").StarTile[]`
|
|
304
|
+
|
|
305
|
+
Resolves (and lazily creates) cached starfield tile layers for the viewport.
|
|
306
|
+
|
|
307
|
+
Parameters:
|
|
308
|
+
|
|
309
|
+
- `visibleWorldHeightPx` - - Viewport height in world pixels.
|
|
310
|
+
|
|
311
|
+
Returns: Ordered far/mid/near starfield tiles.
|
|
312
|
+
|
|
313
|
+
## browser-entry/playback/playback.starfield.services.ts
|
|
314
|
+
|
|
315
|
+
### createCanvasSizeFallback
|
|
316
|
+
|
|
317
|
+
`(canvasDimensions: import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").StarfieldCanvasDimensions) => HTMLCanvasElement`
|
|
318
|
+
|
|
319
|
+
Creates a size-only fallback so non-browser tests can skip rendering safely.
|
|
320
|
+
|
|
321
|
+
Parameters:
|
|
322
|
+
|
|
323
|
+
- `canvasDimensions` - - Already-normalized pixel dimensions.
|
|
324
|
+
|
|
325
|
+
Returns: Minimal canvas-shaped object cast to the compatible return type.
|
|
326
|
+
|
|
327
|
+
### createCompatibleCanvas
|
|
328
|
+
|
|
329
|
+
`(widthPx: number, heightPx: number) => HTMLCanvasElement | OffscreenCanvas`
|
|
330
|
+
|
|
331
|
+
Creates a browser-compatible canvas with clamped integer dimensions.
|
|
332
|
+
|
|
333
|
+
Parameters:
|
|
334
|
+
|
|
335
|
+
- `widthPx` - - Requested tile width in pixels.
|
|
336
|
+
- `heightPx` - - Requested tile height in pixels.
|
|
337
|
+
|
|
338
|
+
Returns: Offscreen canvas when supported, otherwise a DOM canvas fallback.
|
|
339
|
+
|
|
340
|
+
### createDocumentCanvasIfSupported
|
|
341
|
+
|
|
342
|
+
`(canvasDimensions: import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").StarfieldCanvasDimensions) => HTMLCanvasElement | null`
|
|
343
|
+
|
|
344
|
+
Creates a DOM canvas when document APIs are available.
|
|
345
|
+
|
|
346
|
+
Parameters:
|
|
347
|
+
|
|
348
|
+
- `canvasDimensions` - - Already-normalized pixel dimensions.
|
|
349
|
+
|
|
350
|
+
Returns: DOM canvas instance or `null` when unavailable.
|
|
351
|
+
|
|
352
|
+
### createOffscreenCanvasIfSupported
|
|
353
|
+
|
|
354
|
+
`(canvasDimensions: import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").StarfieldCanvasDimensions) => OffscreenCanvas | null`
|
|
355
|
+
|
|
356
|
+
Creates an offscreen canvas when the current runtime supports it.
|
|
357
|
+
|
|
358
|
+
Parameters:
|
|
359
|
+
|
|
360
|
+
- `canvasDimensions` - - Already-normalized pixel dimensions.
|
|
361
|
+
|
|
362
|
+
Returns: Offscreen canvas instance or `null` when unavailable.
|
|
363
|
+
|
|
364
|
+
### createStarTileCanvas
|
|
365
|
+
|
|
366
|
+
`(options: import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").CreateStarTileCanvasOptions) => CanvasImageSource`
|
|
367
|
+
|
|
368
|
+
Pre-renders a deterministic tile that can be reused across animation frames.
|
|
369
|
+
|
|
370
|
+
Parameters:
|
|
371
|
+
|
|
372
|
+
- `options` - - Declarative drawing recipe for one parallax layer.
|
|
373
|
+
|
|
374
|
+
Returns: Canvas image source containing the rendered star strip.
|
|
375
|
+
|
|
376
|
+
### initializeStarTileContext
|
|
377
|
+
|
|
378
|
+
`(options: { tileContext: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D; canvas: HTMLCanvasElement | OffscreenCanvas; blurPx: number; }) => void`
|
|
379
|
+
|
|
380
|
+
Clears the canvas and applies the glow settings shared by all rendered stars.
|
|
381
|
+
|
|
382
|
+
Parameters:
|
|
383
|
+
|
|
384
|
+
- `options` - - Context initialization dependencies.
|
|
385
|
+
|
|
386
|
+
Returns: Nothing. The provided context is mutated in place.
|
|
387
|
+
|
|
388
|
+
### normalizeCanvasDimensions
|
|
389
|
+
|
|
390
|
+
`(widthPx: number, heightPx: number) => import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").StarfieldCanvasDimensions`
|
|
391
|
+
|
|
392
|
+
Normalizes requested canvas dimensions into positive integer pixel sizes.
|
|
393
|
+
|
|
394
|
+
Parameters:
|
|
395
|
+
|
|
396
|
+
- `widthPx` - - Requested width in pixels.
|
|
397
|
+
- `heightPx` - - Requested height in pixels.
|
|
398
|
+
|
|
399
|
+
Returns: Clamped integer dimensions safe for canvas allocation.
|
|
400
|
+
|
|
401
|
+
### renderSeededStars
|
|
402
|
+
|
|
403
|
+
`(options: { tileContext: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D; seededRandom: () => number; canvasOptions: import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").CreateStarTileCanvasOptions; }) => void`
|
|
404
|
+
|
|
405
|
+
Draws all stars for one tile using a seeded random source.
|
|
406
|
+
|
|
407
|
+
Parameters:
|
|
408
|
+
|
|
409
|
+
- `options` - - Drawing context, seed source, and tile recipe.
|
|
410
|
+
|
|
411
|
+
Returns: Nothing. The provided context is mutated in place.
|
|
412
|
+
|
|
413
|
+
### resetStarTileContext
|
|
414
|
+
|
|
415
|
+
`(tileContext: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) => void`
|
|
416
|
+
|
|
417
|
+
Restores neutral drawing state so later canvas consumers start from defaults.
|
|
418
|
+
|
|
419
|
+
Parameters:
|
|
420
|
+
|
|
421
|
+
- `tileContext` - - 2D context used to render the star tile.
|
|
422
|
+
|
|
423
|
+
Returns: Nothing. The provided context is mutated in place.
|
|
424
|
+
|
|
425
|
+
### resolveStarPlacement
|
|
426
|
+
|
|
427
|
+
`(options: { seededRandom: () => number; tileWidthPx: number; tileHeightPx: number; minSizePx: number; maxSizePx: number; minAlpha: number; maxAlpha: number; }) => import("test/examples/flappy_bird/browser-entry/playback/playback.starfield.types").StarPlacement`
|
|
428
|
+
|
|
429
|
+
Resolves one deterministic star placement and appearance from the seeded RNG.
|
|
430
|
+
|
|
431
|
+
Parameters:
|
|
432
|
+
|
|
433
|
+
- `options` - - Random source and star placement bounds.
|
|
434
|
+
|
|
435
|
+
Returns: Pixel location, square size, and alpha for one rendered star.
|
|
436
|
+
|
|
437
|
+
### resolveStarTileContext
|
|
438
|
+
|
|
439
|
+
`(canvas: HTMLCanvasElement | OffscreenCanvas) => CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null`
|
|
440
|
+
|
|
441
|
+
Resolves the rendering context used for star tile pre-rendering.
|
|
442
|
+
|
|
443
|
+
Parameters:
|
|
444
|
+
|
|
445
|
+
- `canvas` - - Compatible canvas returned by the runtime-specific factory.
|
|
446
|
+
|
|
447
|
+
Returns: A 2D drawing context when rendering is supported.
|
|
448
|
+
|
|
449
|
+
## browser-entry/playback/playback.frame-render.service.ts
|
|
450
|
+
|
|
451
|
+
### renderPopulationFrame
|
|
452
|
+
|
|
453
|
+
`(context: CanvasRenderingContext2D, renderState: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").PopulationRenderState, trailState: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").TrailState) => void`
|
|
454
|
+
|
|
455
|
+
Draws one simulation frame for the current population state.
|
|
456
|
+
|
|
457
|
+
Parameters:
|
|
458
|
+
|
|
459
|
+
- `context` - - Canvas 2D drawing context.
|
|
460
|
+
- `renderState` - - Mutable simulation state snapshot.
|
|
461
|
+
- `trailState` - - Leader trail render cache.
|
|
462
|
+
|
|
463
|
+
Returns: Nothing.
|
|
464
|
+
|
|
465
|
+
### updateTrailState
|
|
466
|
+
|
|
467
|
+
`(trailState: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").TrailState, renderState: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").PopulationRenderState) => void`
|
|
468
|
+
|
|
469
|
+
Updates the trail cache from the latest frame snapshot.
|
|
470
|
+
|
|
471
|
+
Parameters:
|
|
472
|
+
|
|
473
|
+
- `trailState` - - Mutable trail state.
|
|
474
|
+
- `renderState` - - Current render state.
|
|
475
|
+
|
|
476
|
+
Returns: Nothing.
|
|
477
|
+
|
|
478
|
+
## browser-entry/playback/playback.trail.utils.ts
|
|
479
|
+
|
|
480
|
+
### clamp01
|
|
481
|
+
|
|
482
|
+
`(value: number) => number`
|
|
483
|
+
|
|
484
|
+
Clamps a number to the inclusive [0, 1] range.
|
|
485
|
+
|
|
486
|
+
Parameters:
|
|
487
|
+
|
|
488
|
+
- `value` - - Candidate value.
|
|
489
|
+
|
|
490
|
+
Returns: Clamped value.
|
|
491
|
+
|
|
492
|
+
### pushTrailPoint
|
|
493
|
+
|
|
494
|
+
`(trailPoints: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").TrailPoint[], frameIndex: number, yPosition: number) => void`
|
|
495
|
+
|
|
496
|
+
Appends one trail point while enforcing max retained history length.
|
|
497
|
+
|
|
498
|
+
Parameters:
|
|
499
|
+
|
|
500
|
+
- `trailPoints` - - Mutable trail collection.
|
|
501
|
+
- `frameIndex` - - Source frame index.
|
|
502
|
+
- `yPosition` - - Bird y position.
|
|
503
|
+
|
|
504
|
+
Returns: Nothing.
|
|
505
|
+
|
|
506
|
+
### resolveEdgeOpacityFactor
|
|
507
|
+
|
|
508
|
+
`(pointXPx: number, pointYPx: number, edgeBounds: import("test/examples/flappy_bird/browser-entry/playback/playback.types").PlaybackEdgeBounds) => number`
|
|
509
|
+
|
|
510
|
+
Converts distance-to-edge into a normalized opacity factor.
|
|
511
|
+
|
|
512
|
+
Returns 0 exactly on or beyond an edge and rises to 1 once distance exceeds
|
|
513
|
+
the configured fade band.
|
|
514
|
+
|
|
515
|
+
Parameters:
|
|
516
|
+
|
|
517
|
+
- `pointXPx` - - Point x position.
|
|
518
|
+
- `pointYPx` - - Point y position.
|
|
519
|
+
- `edgeBounds` - - Visible world bounds used for edge distance checks.
|
|
520
|
+
|
|
521
|
+
Returns: Opacity multiplier in [0, 1].
|
|
522
|
+
|
|
523
|
+
### resolveTrailLifetimeOpacityFactor
|
|
524
|
+
|
|
525
|
+
`(frameOffset: number, maxTrailFrameOffset: number) => number`
|
|
526
|
+
|
|
527
|
+
Converts trail age into a normalized opacity factor.
|
|
528
|
+
|
|
529
|
+
Oldest retained history approaches 0 opacity; newest approaches 1.
|
|
530
|
+
|
|
531
|
+
Parameters:
|
|
532
|
+
|
|
533
|
+
- `frameOffset` - - Frames between this point and newest trail point.
|
|
534
|
+
- `maxTrailFrameOffset` - - Oldest age offset currently retained by trail.
|
|
535
|
+
|
|
536
|
+
Returns: Opacity multiplier in [0, 1].
|
|
537
|
+
|
|
538
|
+
## browser-entry/playback/playback.render.utils.ts
|
|
539
|
+
|
|
540
|
+
### PlaybackBirdRenderStyle
|
|
541
|
+
|
|
542
|
+
Pure render-style result for one bird body draw pass.
|
|
543
|
+
|
|
544
|
+
### resolveBirdRenderStyle
|
|
545
|
+
|
|
546
|
+
`(birdIndex: number, championBirdIndex: number) => import("test/examples/flappy_bird/browser-entry/playback/playback.render.utils").PlaybackBirdRenderStyle`
|
|
547
|
+
|
|
548
|
+
Resolves opacity, body color, and champion marker for one bird.
|
|
549
|
+
|
|
550
|
+
Parameters:
|
|
551
|
+
|
|
552
|
+
- `birdIndex` - - Index of the bird currently being rendered.
|
|
553
|
+
- `championBirdIndex` - - Resolved champion index for the frame.
|
|
554
|
+
|
|
555
|
+
Returns: Pure style payload used by the render service.
|
|
556
|
+
|
|
557
|
+
### resolveChampionBirdIndex
|
|
558
|
+
|
|
559
|
+
`(renderState: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").PopulationRenderState) => number`
|
|
560
|
+
|
|
561
|
+
Resolves the champion bird index for the current render frame.
|
|
562
|
+
|
|
563
|
+
Champion selection first prefers the primary winner resolver and then
|
|
564
|
+
falls back to the first alive bird when no winner index is available.
|
|
565
|
+
|
|
566
|
+
Parameters:
|
|
567
|
+
|
|
568
|
+
- `renderState` - - Current frame render snapshot.
|
|
569
|
+
|
|
570
|
+
Returns: Champion index or `-1` when no bird is alive.
|
|
571
|
+
|
|
572
|
+
## browser-entry/playback/playback.snapshot.utils.ts
|
|
573
|
+
|
|
574
|
+
### applyPlaybackSnapshot
|
|
575
|
+
|
|
576
|
+
`(renderState: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").PopulationRenderState, snapshot: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").EvolutionPlaybackStepSnapshot) => void`
|
|
577
|
+
|
|
578
|
+
Applies worker snapshot data to the mutable playback render state.
|
|
579
|
+
|
|
580
|
+
Parameters:
|
|
581
|
+
|
|
582
|
+
- `renderState` - - Mutable render state mirror used by the browser.
|
|
583
|
+
- `snapshot` - - Worker playback snapshot for the current render tick.
|
|
584
|
+
|
|
585
|
+
Returns: Nothing.
|
|
586
|
+
|
|
587
|
+
### resolveLeaderFramesSurvived
|
|
588
|
+
|
|
589
|
+
`(renderState: import("test/examples/flappy_bird/browser-entry/browser-entry.simulation.types").PopulationRenderState) => number`
|
|
590
|
+
|
|
591
|
+
Resolves the maximum survived-frame count in the current render state.
|
|
592
|
+
|
|
593
|
+
Parameters:
|
|
594
|
+
|
|
595
|
+
- `renderState` - - Current render state.
|
|
596
|
+
|
|
597
|
+
Returns: Maximum frames survived by any bird.
|
|
598
|
+
|
|
599
|
+
## browser-entry/playback/playback.starfield.utils.ts
|
|
600
|
+
|
|
601
|
+
### createSeededRandom
|
|
602
|
+
|
|
603
|
+
`(seed: number) => () => number`
|
|
604
|
+
|
|
605
|
+
Creates a deterministic pseudo-random generator for starfield tile layouts.
|
|
606
|
+
|
|
607
|
+
Parameters:
|
|
608
|
+
|
|
609
|
+
- `seed` - - Unsigned integer seed.
|
|
610
|
+
|
|
611
|
+
Returns: Function that yields values in the range [0, 1).
|
|
612
|
+
|
|
613
|
+
### positiveModulo
|
|
614
|
+
|
|
615
|
+
`(value: number, modulo: number) => number`
|
|
616
|
+
|
|
617
|
+
Resolves positive modulo suitable for horizontal tiling offsets.
|
|
618
|
+
|
|
619
|
+
Parameters:
|
|
620
|
+
|
|
621
|
+
- `value` - - Input value to wrap.
|
|
622
|
+
- `modulo` - - Modulus base.
|
|
623
|
+
|
|
624
|
+
Returns: Wrapped value in [0, modulo).
|
|
625
|
+
|
|
626
|
+
## browser-entry/playback/playback.worker-channel.utils.ts
|
|
627
|
+
|
|
628
|
+
### PlaybackStepPayload
|
|
629
|
+
|
|
630
|
+
Shared alias for worker playback-step payload.
|
|
631
|
+
|
|
632
|
+
### PlaybackStepRequest
|
|
633
|
+
|
|
634
|
+
Request payload for one playback-step worker call.
|
|
635
|
+
|
|
636
|
+
### resolvePlaybackCompletionSummary
|
|
637
|
+
|
|
638
|
+
`(playbackStepPayload: { snapshot: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").EvolutionPlaybackStepSnapshot; instrumentation?: { activationCallsPerFrame: number; simulationStepsPerRaf: number; } | undefined; done: boolean; averagePipesPassed?: number | undefined; p90FramesSurvived?: number | undefined; winnerPipesPassed?: number | undefined; winnerFramesSurvived?: number | undefined; }, latestLeaderPipesPassed: number, latestLeaderFramesSurvived: number) => { averagePipesPassed: number; p90FramesSurvived: number; winnerPipesPassed: number; winnerFramesSurvived: number; }`
|
|
639
|
+
|
|
640
|
+
Resolves final playback summary values when worker reports completion.
|
|
641
|
+
|
|
642
|
+
Parameters:
|
|
643
|
+
|
|
644
|
+
- `playbackStepPayload` - - Playback payload returned by worker.
|
|
645
|
+
- `latestLeaderPipesPassed` - - Last observed leader pipes passed fallback.
|
|
646
|
+
- `latestLeaderFramesSurvived` - - Last observed leader frames fallback.
|
|
647
|
+
|
|
648
|
+
Returns: Final aggregate playback summary.
|
|
649
|
+
|
|
650
|
+
### resolvePlaybackFrameStats
|
|
651
|
+
|
|
652
|
+
`(playbackStepPayload: { snapshot: import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").EvolutionPlaybackStepSnapshot; instrumentation?: { activationCallsPerFrame: number; simulationStepsPerRaf: number; } | undefined; done: boolean; averagePipesPassed?: number | undefined; p90FramesSurvived?: number | undefined; winnerPipesPassed?: number | undefined; winnerFramesSurvived?: number | undefined; }, frameIndex: number, activeBirdCount: number, leaderPipesPassed: number, leaderFramesSurvived: number) => import("test/examples/flappy_bird/browser-entry/browser-entry.worker.types").PlaybackFrameStats`
|
|
653
|
+
|
|
654
|
+
Resolves HUD playback frame stats from worker payload and leader metrics.
|
|
655
|
+
|
|
656
|
+
Parameters:
|
|
657
|
+
|
|
658
|
+
- `playbackStepPayload` - - Playback payload returned by worker.
|
|
659
|
+
- `frameIndex` - - Current render frame index.
|
|
660
|
+
- `activeBirdCount` - - Number of alive birds in current frame.
|
|
661
|
+
- `leaderPipesPassed` - - Current frame leader pipes passed.
|
|
662
|
+
- `leaderFramesSurvived` - - Current frame leader survived frames.
|
|
663
|
+
|
|
664
|
+
Returns: Normalized per-frame HUD telemetry payload.
|
|
665
|
+
|
|
666
|
+
### resolvePlaybackStepRequest
|
|
667
|
+
|
|
668
|
+
`(input: import("test/examples/flappy_bird/browser-entry/playback/playback.worker-channel.utils").ResolvePlaybackStepRequestInput) => import("test/examples/flappy_bird/browser-entry/playback/playback.worker-channel.utils").ResolvePlaybackStepRequestResult`
|
|
669
|
+
|
|
670
|
+
Resolves step count and request payload for the next worker playback batch.
|
|
671
|
+
|
|
672
|
+
Parameters:
|
|
673
|
+
|
|
674
|
+
- `input` - - Current frame budget and viewport dimensions.
|
|
675
|
+
|
|
676
|
+
Returns: Request payload plus carried-over fractional frame budget.
|
|
677
|
+
|
|
678
|
+
### ResolvePlaybackStepRequestInput
|
|
679
|
+
|
|
680
|
+
Input used to resolve next playback-step request and budget remainder.
|
|
681
|
+
|
|
682
|
+
### ResolvePlaybackStepRequestResult
|
|
683
|
+
|
|
684
|
+
Output for resolved playback-step request and frame-budget remainder.
|