Repository navigation
World GB2 part 2: a data node's region and water level - #1399
Merged
Merged
Conversation
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.
A dataset's node shapes the world the physics and the navigator get from it, which itself stays whole (ARIADNE_WORLDS section 18.8, GB2): - region: [min_x, min_y, max_x, max_y] cuts the dataset's world once (crop_world_geometry: the terrain to the samples that cover it with its cell materials, each mesh to the faces whose centroid is inside with their face materials), so its bodies, the walls at its edge and the navigator's grid follow one cut. On data nodes and generated_world nodes. - water_level: on a data node, else its dataset's level (a version 2 bundle's, a made world's), is its one water knob: a still-water fluid field (1000 kg/m^3, from 1 m under the lowest ground to the level, inertial, so a wading vehicle drives through it) in its world, and the grid's water at the same level. A version 1 bundle has no level, so no water.
# Conflicts: # src/cvc/ariadne/scene_world.cpp # src/cvc/tests/ariadne_world_dataset_test.cpp
transfix
enabled auto-merge (squash)
November 20, 2026 19:37
# Conflicts: # docs/ARIADNE.md
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
The closed schema lands after the PRs that add loader keys, so it carries their keys now: - notifications: always, as well as a flag (#1450); - a tray_icon's icon: and auth: (#1450); - a color picker's fmt: rgb | hex (#1452); - a load:'s name:, a key or an expression that names the application (#1485); - scene: clock: max_lag:, more than 0 and at most 10 s, in the scene and in a scene of its own (#1475). Master's own new keys need none: #1472's look: wheel:, wheelbase: and track: sit in world:, which the world rules check, and #1399's region: is a custom node's own key. AcceptsWhatTheLoaderTakes takes each new form; FindsEachMistakeWhereItIs finds fmt: cmyk and notifications: sometimes.
transfix
added a commit
that referenced
this pull request
Nov 24, 2026
) * Ariadne: a closed .ari schema every load checks, and ari validate The .ari document's structure gets a formal definition, roadmap section 15, now docs/ARIADNE.md section 14: - src/cvc/ariadne/schema/ari.v1.schema.json: one JSON Schema for every top-level block, all 35 built-in widget types, the scene, include: and load: sites, with descriptions. Every map is closed: an unknown key is an error, except x- keys, a custom widget's or node's own keys, and a block an app registered or the document declares in customs:. A widget's type is its first type key in the loader's order. It keeps to json-schema-validator's draft-7 subset. - CMake embeds it (CvcEmbedText.cmake) for ari_schema_json() and installs it under share/libcvc/ariadne/schema/. - With the validator built in, every load checks the document, its import:ed libraries, its load: fragments and each include: expansion (placed in the unit's own file), as warnings and LoadResult::schema_issues with line and column. The compiled validators live in a cvc::app slot. - validate_string / validate_file check without loading, the document's own units instantiated with their declared args. - ari validate [--structural-only] [--strict] [--json] and ari schema. - ci.yml: package-linux's configure assertion also requires the validator. All 176 shipped documents are valid; reopen_refit.ari gains its missing meta.min_libcvc. Five loader tests that feed bad values count the loader's own warnings and check the schema flags the same pointer. New ariadne_schema_test and ctests for ari validate and ari schema. * Ariadne schema: scene: clock: hz, the world's rate OW8 (#1441) gave the scene's clock an hz key: a whole number of ticks a second from 10 to 240, as sim_rate_valid takes it. The schema takes it the same way in both clock entries, and ClockBlockTakesAWorldsRate checks that the schema accepts hz: 60 and flags each rate the loader warns about. * Ariadne schema: the hosts' blocks in their short forms wasm: takes a guest's path alone and relay: a relay's URL alone, as their readers do; a bare server: or world: sets nothing, as theirs do. The schema took a map only, so WasmWasiTest's `wasm: all.wat`, under min_libcvc 3.7.13, failed its load on Linux. * Ariadne schema: the keys the open PRs add to the loader The closed schema lands after the PRs that add loader keys, so it carries their keys now: - notifications: always, as well as a flag (#1450); - a tray_icon's icon: and auth: (#1450); - a color picker's fmt: rgb | hex (#1452); - a load:'s name:, a key or an expression that names the application (#1485); - scene: clock: max_lag:, more than 0 and at most 10 s, in the scene and in a scene of its own (#1475). Master's own new keys need none: #1472's look: wheel:, wheelbase: and track: sit in world:, which the world rules check, and #1399's region: is a custom node's own key. AcceptsWhatTheLoaderTakes takes each new form; FindsEachMistakeWhereItIs finds fmt: cmyk and notifications: sometimes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GB2 part 2 of ARIADNE_WORLDS section 18.8: the region and the water level on the data node. This answers prettyhatemachine's GRL-SNAM asks (the crop, and deep water that is ground at mu 0.10).
#1396 has merged and master is merged in, so this diff is part 2 alone.
What changes
region: [min_x, min_y, max_x, max_y]on a data node (and on agenerated_worldnode) cuts its dataset's world once, withcrop_world_geometry(new,world_geometry.h):edge_wallsare kept as they are.The bodies, the walls at the world's edge (now the region's) and the navigator's grid all follow the one cut. The dataset itself stays whole, and the drawing is not cut. A bad region warns and the whole world is used.
water_level:on a data node, else its dataset's level, is the node's one water knob. The dataset's level is a version 2 bundle'swater_level, or a made world'swater_level_m; a version 1 bundle such as Austin has none, so it gets no water. The level gives the node's world:volume_item"water", 1000 kg/m^3) over the terrain's extent, from 1 m under the lowest ground up to the level, with drag 1, damping 1e4 andinertialon;set_water) at the same level.The field follows the advice of the wading session (physics: land vehicles wade in water (opt-in vehicle_desc::wading) #1348): it reaches under the deepest bed, and with
inertialon the damping acts only on heave, so a wading vehicle still drives through it.WorldVehicles::ensure_watersees the world's water and adds no still field of its own. A scenewaternode over the node runs the water instead.Tests
ariadne_world_dataset_test, 4 new tests (8 in all):WorldRegion.ACropKeepsWhatIsInside: terrain origin, size, heights and cell materials; a mesh keeps one face with its material and three vertices; a mesh with no face inside goes; a region off the terrain, or backwards, throws.ARegionCutsTheBodiesTheWallsAndTheGrid: the cut terrain covers the region by under one cell, the bodies are the cut world's plus its four walls, the grid lies inside the cut, and the dataset stays whole.ABadRegionWarnsAndKeepsTheWholeWorldADataNodesWaterLevelIsItsWater: the field is fluid and inertial; a point under the level is wet at 1000 kg/m^3 and one above is dry; the grid has water at the level; a level under all ground makes no field.Locally: 2,041 matching ariadne, world, data, nav and cvcGL ariadne tests pass (full build, MSVC Release).
Open, not in this PR
water_deepbed cells keep mu 0.10 (mu_wet0.10). A car on a lakebed grips only if the raster gives those cells a bed class (mud, gravel, sand), which is a nav raster decision.dyn_chassis::add). A fluid field would push them with full sealed-box buoyancy. I haven't checked whether their plant overwrites the pose each step.