Skip to content

World GB2: a generated world is a dataset (data-generate) - #1396

Merged
transfix merged 1 commit into
masterfrom
feat/gb2-generated-dataset
Nov 20, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/gb2-generated-dataset

Conversation

@transfix

Copy link
Copy Markdown
Owner

GB2 of ARIADNE_WORLDS section 18.8 (the design is #1380, the bundle format #1385): a generated world reaches the physics the way a loaded city does, through a dataset.

What changes

  • The data store makes datasets as well as fetching them. A request with generate: and params: runs a registered generator for its files, and they decode as a fetched dataset's do (city_bundle unless as: says otherwise). The built-in generated_world makes the world (generate_world) and writes it as a version 2 city bundle, so the dataset's world is the bundle read back. generated beside it is the world as made (raster, roads, props).
    • documents: data: { world: { generate: generated_world, params: { seed: 7, half_m: 600 } } }
    • programs: (data-generate NAME GENERATOR [PARAMS])
    • hosts: register_data_generator; DataStore::put publishes a dataset its owner already made
  • A generated_world node is its dataset. Each world it makes, headless or drawn, is published as data.<id> (or the node's data: prop) and replaced in place on Regenerate, with its rev going up. Its body: is that dataset's world, as a data node's is. SceneWorld::generated_world(id) now answers when a renderer runs the node too (it was null).
  • SceneWorld takes a dataset that is already ready when the world is built, so its bodies are there from the start, not from the first sync. The take stays in sync() as well (a holon calling follow gets late datasets).
  • cvcGL writes a rebuild's bundle in its world task, off the frame thread. The frame thread only decodes it at the swap.
  • city_bundle publishes version 2's manifest: version, hash, water_level, region.*, generator (version, seed, params).
  • SceneWorld's public surface is unchanged.

Costs measured (MSVC Release, this box)

A terrain lab world (1.2 km, 500 trees, 90 rocks, 110 buildings):

Time
Generate 4.1 s
Write the bundle (30 MB, 25 MB of it props.glb) 1.6 s
Read it back 0.2 s

At 5 km: 14.5 s, 1.9 s and 0.5 s. The write runs in the world task. The read (0.2 to 0.5 s) is on the frame thread at the swap, which is new; it is not measured in a browser.

Tests

ariadne_world_dataset_test (new, 4 tests):

  • data-generate makes the bundle the world made directly writes: same hash, the terrain's heights as stored, the same collide items; the same params share one dataset.
  • An unknown generator fails the load and says so.
  • A generated_world node's dataset is ready at build, its bodies are the dataset's world, and Regenerate replaces it in place with its rev one higher.
  • A document's generate: entry gives a data node the same world (same hash) as the JSON request.

cvcgl_ariadne_physics: the drawn world's generated_world("world") is now the dataset's, with the same params and bundle hash as the headless world, and the state hashes still match.

Locally: 1,599 matching ariadne, world, data, bundle and cvcGL ariadne tests pass (the full build, MSVC Release).

Not in this PR

  • Region and water level on the data node (the crop, the walls at the region's edge, a water body or field from the level): the second GB2 PR.
  • The props LOD rungs, streets.json and ground.png in the bundle go with the renderer (GB3).

A generated world reaches the physics the way a loaded city does
(ARIADNE_WORLDS section 18.8, GB2):

- The data store makes datasets as well as fetching them: a request with
  generate: and params: runs a registered generator for its files, which
  decode as a fetched one's do (city_bundle). The built-in generated_world
  makes the world and writes it as a version 2 city bundle, so its world
  is the bundle read back. Documents name one in data: (generate:,
  params:), programs with (data-generate NAME GENERATOR [PARAMS]), hosts
  with register_data_generator. DataStore::put publishes a dataset its
  owner already made.
- A generated_world node publishes each world it makes, headless or drawn,
  as its dataset data.<id>, replaced in place on Regenerate (its rev up),
  and its body is that dataset's world, as a data node's is.
  SceneWorld::generated_world(id) now also answers when a renderer runs
  the node.
- SceneWorld takes a dataset that is already ready when the world is
  built, so its bodies are there from the start.
- cvcGL writes a rebuild's bundle in its world task, off the frame thread.
- city_bundle publishes a version 2 bundle's hash, water level, region
  and generator.
@transfix
transfix enabled auto-merge (squash) November 20, 2026 06:30
@transfix
transfix merged commit df6a9d7 into master Nov 20, 2026
29 checks passed
@transfix
transfix deleted the feat/gb2-generated-dataset branch November 20, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant