@plasius/gpu-world-generator 0.0.8 → 0.0.11
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/README.md +24 -0
- package/dist/index.cjs +603 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -1
- package/dist/index.d.ts +75 -1
- package/dist/index.js +594 -1
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0004-worker-dag-manifests-for-chunk-and-voxel-generation.md +37 -0
- package/docs/adrs/index.md +1 -0
- package/docs/design/worker-manifest-integration.md +42 -0
- package/docs/tdrs/index.md +3 -0
- package/docs/tdrs/tdr-0001-world-generator-worker-manifest-contract.md +39 -0
- package/package.json +6 -3
- package/src/index.ts +1 -0
- package/src/worker.ts +710 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# ADR-0004: Worker DAG Manifests for Chunk and Voxel Generation
|
|
2
|
+
|
|
3
|
+
- **Status**: Accepted
|
|
4
|
+
- **Date**: 2026-03-14
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
World generation already has an inherent DAG: fractal prepass and field
|
|
9
|
+
synthesis can start independently, terrain synthesis joins them, and voxel,
|
|
10
|
+
mesh, bake, and serialization stages branch afterwards. Leaving this implicit
|
|
11
|
+
forces consumer packages to flatten the pipeline into opaque queue work.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
Publish worker-first manifest helpers from `@plasius/gpu-world-generator`.
|
|
16
|
+
|
|
17
|
+
- `streaming` profile:
|
|
18
|
+
runtime chunk generation and mesh-ready output
|
|
19
|
+
- `bake` profile:
|
|
20
|
+
background/offline generation plus asset serialization
|
|
21
|
+
|
|
22
|
+
Each manifest exports:
|
|
23
|
+
|
|
24
|
+
- `queueClass: voxel`
|
|
25
|
+
- `schedulerMode: dag`
|
|
26
|
+
- explicit job priorities and dependencies
|
|
27
|
+
- adaptive budget ladders for degradable stages
|
|
28
|
+
- debug allocation metadata for observability
|
|
29
|
+
|
|
30
|
+
## Consequences
|
|
31
|
+
|
|
32
|
+
- Positive: chunk and voxel generation can be coordinated by shared worker and
|
|
33
|
+
performance packages without package-specific glue.
|
|
34
|
+
- Positive: authoritative terrain stages remain explicit and protected from
|
|
35
|
+
visual-only degradation.
|
|
36
|
+
- Negative: world-generation stage names become part of the public contract and
|
|
37
|
+
require migration discipline.
|
package/docs/adrs/index.md
CHANGED
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
- [ADR-0001: GPU World Generator Package Scope](./adr-0001-package-scope.md)
|
|
4
4
|
- [ADR-0002: Tiled World Generation, LOD, and Stitching](./adr-0002-world-tiling-lod-stitching.md)
|
|
5
|
+
- [ADR-0004: Worker DAG Manifests for Chunk and Voxel Generation](./adr-0004-worker-dag-manifests-for-chunk-and-voxel-generation.md)
|
|
5
6
|
- [ADR-0003: Terrain Generation Style Mixing (Shader-Based)](./adr-0003-terrain-generation-style-mixing.md)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Worker Manifest Integration
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
`@plasius/gpu-world-generator` now publishes chunk/voxel generation as a
|
|
6
|
+
multi-root DAG so shared scheduling and performance packages can reason about
|
|
7
|
+
world generation explicitly.
|
|
8
|
+
|
|
9
|
+
## Streaming Profile
|
|
10
|
+
|
|
11
|
+
- roots:
|
|
12
|
+
`fractalPrepass`, `fieldSynthesis`
|
|
13
|
+
- join:
|
|
14
|
+
`terrainSynthesis`
|
|
15
|
+
- branches after terrain:
|
|
16
|
+
`voxelMaterialize`, `tileBake`
|
|
17
|
+
- final runtime visual stage:
|
|
18
|
+
`meshBuild`
|
|
19
|
+
|
|
20
|
+
This profile models the latency-sensitive path used while streaming terrain
|
|
21
|
+
around the active camera or player.
|
|
22
|
+
|
|
23
|
+
## Bake Profile
|
|
24
|
+
|
|
25
|
+
The bake profile reuses the same early stages and extends the tail with:
|
|
26
|
+
|
|
27
|
+
- `assetSerialize`
|
|
28
|
+
|
|
29
|
+
This represents offline or background generation where asset persistence is part
|
|
30
|
+
of the pipeline.
|
|
31
|
+
|
|
32
|
+
## Authority Boundaries
|
|
33
|
+
|
|
34
|
+
- `fractalPrepass`, `fieldSynthesis`, `terrainSynthesis`
|
|
35
|
+
authoritative, fixed budgets
|
|
36
|
+
- `voxelMaterialize`, `tileBake`
|
|
37
|
+
non-authoritative, degradable
|
|
38
|
+
- `meshBuild`
|
|
39
|
+
visual, degradable
|
|
40
|
+
|
|
41
|
+
This keeps core terrain correctness stable while allowing runtime pressure
|
|
42
|
+
control to trim mesh and auxiliary output cost first.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# TDR-0001: World-Generator Worker Manifest Contract
|
|
2
|
+
|
|
3
|
+
- **Status**: Accepted
|
|
4
|
+
- **Date**: 2026-03-14
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
The world-generator package needs to expose its chunk and voxel pipeline in a
|
|
9
|
+
form that `@plasius/gpu-worker` and `@plasius/gpu-performance` can consume
|
|
10
|
+
directly, without adding a hard dependency on either package.
|
|
11
|
+
|
|
12
|
+
## Decision
|
|
13
|
+
|
|
14
|
+
Publish two manifest profiles:
|
|
15
|
+
|
|
16
|
+
- `streaming`
|
|
17
|
+
- `fractalPrepass`
|
|
18
|
+
- `fieldSynthesis`
|
|
19
|
+
- `terrainSynthesis`
|
|
20
|
+
- `voxelMaterialize`
|
|
21
|
+
- `meshBuild`
|
|
22
|
+
- `tileBake`
|
|
23
|
+
- `bake`
|
|
24
|
+
- all streaming jobs plus `assetSerialize`
|
|
25
|
+
|
|
26
|
+
Contract rules:
|
|
27
|
+
|
|
28
|
+
- authoritative terrain jobs use fixed levels
|
|
29
|
+
- degradable voxel/mesh/bake jobs expose low/medium/high ladders
|
|
30
|
+
- job ids are namespaced as `world-generator.<profile>.<job>`
|
|
31
|
+
- queue class is always `voxel`
|
|
32
|
+
- scheduler mode is always `dag`
|
|
33
|
+
|
|
34
|
+
## Consequences
|
|
35
|
+
|
|
36
|
+
- Positive: consumers can import manifests directly and feed them into shared
|
|
37
|
+
worker-budget adapters.
|
|
38
|
+
- Positive: the package stays in control of its actual generation topology.
|
|
39
|
+
- Negative: adding or renaming stages becomes a public API change.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasius/gpu-world-generator",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "GPU-assisted world generation with hex-grid terrain synthesis.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"prepublishOnly": "npm run build && npm run pack:check"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@plasius/gpu-worker": "^0.1.
|
|
41
|
+
"@plasius/gpu-worker": "^0.1.10"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@eslint/js": "^9.39.1",
|
|
45
|
+
"@types/node": "^22.10.0",
|
|
45
46
|
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
46
47
|
"@typescript-eslint/parser": "^8.46.2",
|
|
47
|
-
"@types/node": "^22.10.0",
|
|
48
48
|
"c8": "^10.1.3",
|
|
49
49
|
"eslint": "^9.39.1",
|
|
50
50
|
"globals": "^17.3.0",
|
|
@@ -65,5 +65,8 @@
|
|
|
65
65
|
"homepage": "https://github.com/Plasius-LTD/gpu-world-generator#readme",
|
|
66
66
|
"overrides": {
|
|
67
67
|
"minimatch": "^10.2.1"
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=24"
|
|
68
71
|
}
|
|
69
72
|
}
|
package/src/index.ts
CHANGED