Repository navigation
physics, ariadne: one scene wind for the water, clouds and trees, and its push on bodies (O14) - #1317
Merged
Merged
Conversation
…in both seas (O13) - cvc::algo::wind_field: the scene's gusts as one deterministic function of (x, y, t): two scales of integer-hashed value noise carried downwind and ABYSSAL's pulse over time. cvc/gl/WindGLSL.h is the same in GLSL, no texture. Everything the wind moves (O14: the clouds, the trees, the air physics) can sample it at the same point and time. - cvc::ocean: fetch.h (the fetch map in one upwind sweep, coarse, capped by each body's extent; each cascade scaled by sqrt(F / F_full), F_full where its band is fully grown), sea_lag.h (the sea's wind follows with a time constant and steps by keyframes, at most one per crossfade), current.h (a divergence-free curl-noise current and a two-phase flow map). sea_surface takes a sea_forcing: the h0 crossfade, the fetch scales, the ripples' gust weight, the current. - Ariadne: scene_wind.h reads a node's wind in one place (O14 points it at wind.*). SceneWaterSeaClock steps the keyframes both seas use. New water keys: gustiness, lee, sea_lag, sea_fade, current (water_controls.ari, ARIADNE.md). - cvcGL: OceanWind (one RG32F texture of the two keyframes' fetch maps; the gusts and the current hashed per vertex). The water node and lsystem_coast draw the lee, the gusts (the ripples' weight, cat's paws in the shading), the current carrying the two short cascades, and mix the two keyframes' h0 on the CPU only while a crossfade runs. - Tests: ocean_wind_test (fetch behind an island and on a lake, the lag and its debounce, a continuous crossfade, golden hashes of the fetch map, the gusts and the current, a divergence-free current, the physics sea's lee and current), a floating crate in the lee against one in the open (ariadne_scene_world_test), the water node's new keys (cvcgl_ariadne_realize). No golden hash moved: a sea_surface without a forcing has the same digest and values as before.
… its push on bodies (O14) A document's scene: wind: seeds wind.speed, wind.dir and wind.gustiness. While wind.speed is set, the water (both seas), cloud_sky's drift and orographic heading, and the forest's lean and sway all follow those keys, sampling the same gust field at the same (x, y, t). Each node's own wind keys are the fallback. SceneWind::azimuth is dir + 90 (O13 had it mirrored). cvc::physics: field::wind takes a flow_velocity (a velocity in space and time, with a digest). wind_flow is the scene's wind over a power-law height profile, linear below 0.1 m. A flow with a wind may have no volume (then it is air everywhere). The field step reads the wind once per body and its profile at nine heights across the body, and clips cells to the wind's base. The wind's digest is in save() and state_hash(); a world without one hashes as before. A vehicle's aero drag reads the wind at its centre of mass. The push: SceneWorld adds the wind as a flow field. WorldVehicles' dynamic, dynamic4w and kinematic fleets get the wind's share of the drag through the drive's external force. The room rules carry the wind to arisrv: dynamic avatars stand in a flow field, and kinematic avatars drift once the wind's drag beats the walker's grip, the drift folded into the intent. wind_controls.ari; docs: roadmap As built (O14), ARIADNE.md Wind, PHYSICS_API.md flow hook.
…ater and clouds, and a Wind panel in Settings The water's and the clouds' own winds stay as fallbacks. The Water and Sky panels' wind sliders say they are unused while the scene has a wind.
…th the wind on and off
This was referenced Nov 16, 2026
…intent The test runs 120 frames while a writer thread replaces vehicle a's intent, then expects a to be moving. A thread can start late: on a busy machine all 120 frames (a few tens of milliseconds) passed before the writer ran, no intent reached a, and only the last 6 frames moved it. That reads 0.10766078436440293 m/s, which is what recipe / windows-2022 / Release read on #1318, and what a writer held back until the frames end reads here, bit for bit. The frames now start once the writer has landed an intent (10 s at most). A failure says a's speed after the threaded frames, how many intents landed during them, and whether a existed. It passes with the writer started 300 ms late.
…s mid-run After its first intent the writer may still be descheduled for all 120 frames (a few tens of milliseconds on a busy machine), which would fail the check that an intent landed while the world stepped. The world now steps on, a frame at a time, until one does (10 s at most).
This branch carried #1311's original commit (b6ab0c4), whose files are identical in the squash. The add/add conflicts (wind_field.h/.cpp, scene_wind.h/.cpp) and water_controls.ari take this branch's side, which is #1311 plus #1317's changes. docs/ARIADNE.md is a three-way merge on b6ab0c4 as its base, so master's later edits and #1317's both stand. Against master, the result is exactly #1317's own diff against b6ab0c4: the same 44 files and the same changed lines.
transfix
enabled auto-merge (squash)
November 16, 2026 19:19
…ne-wind # Conflicts: # docs/PHYSICS_API.md
master fails to build arisrvx's python_engine.cpp: #1302 (bridged users) added room(), bridge_presence(), bridge_absent(), bridge_post() and listen_chat() calling server_link() with no argument, written against the process-wide server link that the P0a cleanup replaced with the module's own state, server_link(PyObject *self). Each of the five now names its module argument self and passes it, as the other server ops (lent(), publish(), ...) already do. Found in #1324's pycvc-linux / cp312 job (run 43956686020), which builds the PR merged with master.
…ne-wind # Conflicts: # src/cvcGL/test/cvcgl_ariadne_realize.cpp
The realize suite runs every node type's checks in one process. In a Linux Debug job (Xvfb, llvmpipe) it took 250.6 s, 50 s under the 300 s a test without a TIMEOUT gets; on a slower runner (#1309's Debug job, where PhConvoy and Ewave also ran about 1.3x longer) it timed out on all three attempts. As cvcgl_ewave, cvcgl_wake and cvcgl_volren_node have, it gets a budget of its own with headroom, so only a real hang fails it.
…ter's arisrvx build
…ize's Debug timeout
…ne-wind # Conflicts: # src/cvc/ariadne/scene_world.cpp # src/cvc/ariadne/world_vehicles.cpp # src/cvc/tests/ariadne_scene_world_test.cpp
…ne-wind # Conflicts: # docs/ARIADNE.md # examples/ariadne/documents/terrain_lab.ari # src/cvc/ariadne/components/INDEX.ari # src/cvc/ariadne/components/sky_controls.ari # src/cvcGL/ariadne/lsystem_nodes.cpp # src/cvcGL/test/cvcgl_ariadne_realize.cpp
…feat/scene-wind #1322 moved each cell's reads into read_cell() (and ahead of the loop, on the field workers, for a free surface's cells). The scene wind's per-cell work moves with it: body_wind holds a body's wind (its reference at the centre of mass and its height profile), made once per body and field as before, and read_cell takes it to clip the cell at the wind's base and to read its velocity. A wind is a flow's and a free surface a fluid's, so the workers' reads never need it. The arithmetic is the branch's, in the same order. world.cpp keeps #1322's timing and the branch's field_time() for the vehicles' pre_step; the tests are both sides'.
…ne-wind # Conflicts: # docs/ARIADNE.md # examples/ariadne/documents/terrain_lab.ari # src/cvcGL/test/cvcgl_ariadne_realize.cpp
…e-wind world_vehicles.cpp: the runtime keeps both the scene's wind (set_wind) and the boats' still water. The wind's push on the plants that feel no field now leaves the boat fleet out as it leaves out the jolt vehicles: a boat's hull is a dynamic body in the scene's physics world, so the wind's flow field already drags on its part in the air, and the push would charge it twice.
transfix
added a commit
that referenced
this pull request
Nov 17, 2026
transfix
added a commit
that referenced
this pull request
Nov 17, 2026
Both sides kept: bind_boats beside bind_wind (scene_world.h, scene_realize.cpp), the Boats and Wind sections in ARIADNE.md, terrain_lab's boat and wind panels. The Launch panel moves under World to [16, 590]: the right column now holds Sky, Water, Weather and Wind. A boat node's hull is a dynamic body, so the wind's flow field drags on it directly (it is not a world vehicle, so the vehicles' wind push does not reach it).
transfix
added a commit
that referenced
this pull request
Nov 17, 2026
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.
O14 of
docs/roadmap/OCEAN-AND-WEATHER-ROADMAP.md: one scene wind (E5) that the water, the clouds, the trees and the physics all read, and a push from it on the bodies in the world: vehicles, avatars and anything dynamic. Exit: one key turns everything.Stacked on #1311 (O13, branch
feat/ocean-wind): this PR's base isfeat/ocean-wind, and it should be retargeted to master once #1311 merges.What changed, and where
scene: wind: { speed, dir, gustiness, base }seedswind.speed(m/s, 10 m up),wind.dir(degrees, the way it blows from +x toward +y) andwind.gustiness, drawn or headless (inc/cvc/ariadne/scene_wind.h:seed_scene_wind,scene_wind_set). Whilewind.speedis set, every reader follows these keys, with the same gusts at the same (x, y, t) (cvc::algo::wind_gust).wind_controls.ariis the panel.scene_wind()now returns the scene's wind when there is one. The node's ownwater.wind_speed/wind_dir/gustinessare a fallback, left alone and unused while the scene has a wind (they're not mirrored). No shader change.cloud_sky: the deck drifts along the wind's heading at the wind's speed at the deck's base (a height profile), times the gusts' spatial mean, in place ofsky.wind_azand the fixed 3 m/s; its orographic slopes take the same heading. It publishessky.drift_az/sky.drift_speed. This fixes O13'sSceneWind::azimuth(), which mirrored the heading (90 − dir; it's dir + 90).forest_trees: each tree leans downwind as well as swaying, scaled by the gust at the tree (repose_forest_in_wind), and the forest publishesforest.lean_dir.inc/cvc/physics/flow_velocity.h:field::windis aflow_velocity(a velocity in space and time, with a digest) in place of a flow's velocity volumes.wind_flowis the scene's wind times the power-law height profile (h/10)^(1/7) over a base level (the ground's or the water's). A flow with a wind may have no volume: it's then air everywhere.state_hash: the wind's digest goes into the save's surface section, so a world without winds or free surfaces saves and hashes exactly as before, andrestore()refuses another wind.air_at); its chassis still skips flow fields.SceneWorld::bind_wind, headless and drawn): one volume-less flow field, added, replaced or removed as the keys change.WorldVehicles:joltfleets through their aero drag.dynamic,dynamic4wandkinematicfleets get the wind's share of the drag (the drag in moving air less the drag in still air, which the dynamic models already charge) through the drive's external force each navigator tick.entity_info::wind_fx/wind_fyreport it.physicssection (wind.*, written only when there is a wind) and replicates. Dynamic avatars stand in a flow field inavatar_world, and their walker pushes back. Kinematic avatars hold while the wind's drag is within the walker's grip (840 N) and drift past it; the drift is folded into the intent, so the server, a client's prediction and a replay agree bit for bit.CVC_WITH_MUJOCOis off on this machine and its deps aren't installed, so I couldn't buildmujoco_robot.cpp. The seam is the samewind_flowintoxfrc_appliedper body.docs/ARIADNE.md§5.4 "Wind" and the component table,docs/PHYSICS_API.md"The wind: a flow field'sflow_velocity".wind: { speed: 9, dir: 30, gustiness: 0.25 }. Before this, its water blew toward 30° and its clouds drifted toward +x (wind_az: 90), so they disagreed.sky.drift_az120).wind_speed/wind_dirand the sky'swind_azstay as fallbacks, commented as such.wind_controls.sky.driftscales it if the owner wants them slower.forest_trees(which does follow the wind) isn't in terrain_lab. A wind lean for the world's foliage would be a vertex-shader job (uniforms only) and isn't in this PR.How it was checked (Windows 11, MSVC Release)
New tests, with what they measured:
physics_field_test:TheSceneWindCarriesABallAlongTheDragCurve: a 1 kg ball 0.5 m in radius, 10 m up in a 10 m/s wind (no gravity), reaches 8.285 m/s in 2 s; the drag curve says 8.279. The profile reads 0.72 of U10 at 1 m and 1.26 at 50 m.AFloatingCrateDriftsDownwind: a 1 × 1 × 0.5 m crate at density 500 floats upright in a 10 m/s wind and drifts 0.154 m/s on the water's drag alone, against 0.156 m/s where the wind's drag on its top half balances the water's on the bottom half. On the scene water's damping it drifts 0.0013 m/s. Its immersed volume is the water's half only.TheSceneWindIsInTheStateHash: the hash moves with the wind; a world without one hashes as before;restore()refuses another wind; a wind on a fluid, and a flow with neither volume nor wind, are refused.TheSceneWindIsTheSameOnEveryPlatform: pins the digest (c7ec24178041550e) and 200 velocities (3ec1c28ca0601404).physics_vehicle_test,ACrosswindPushesTheCarAside: a Humvee at 25 m/s in a 15 m/s crosswind is pushed 406 N aside (0.15 m/s², under 0.05 g), matching ½ ρ C_d A |u| u for the 10.4 m/s of air at its centre of mass.ariadne_scene_world_test:AriadneWorldVehicles.TheSceneWindPushesEveryPlant: four plants under nav@1 in a 30 m/s wind for 8 s, against the same run in still air. Push downwind and offset from the still-air run:jolt1273 N, 2.20 m;dynamic1189 N, 4.34 m;dynamic4w1881 N, 0.16 m;kinematic1576 N, 1.15 m. The push is exactly 0 without a wind.AriadneSceneWorld.TheSceneWindCarriesWhatFallsAndTurnsWithItsKey: a beach ball dropped from 40 m in a 12 m/s wind is at (51.4, 0) after 4 s. Withwind.dirset to 90 it's at (0, 51.7). Clearingwind.speedtakes the field out of the world.AriadneSceneWorld.TheWaterFollowsTheScenesWind: the water takes the scene's wind and turns withwind.dirwhile its own keys stay; clearingwind.speedgives it its own wind back.holon_test:HolonTest.KinematicAvatarsHoldInABreezeAndDriftInAGale: standing 1 s, an avatar doesn't move in 9 m/s and slides 23.1 m in 90 m/s. The client's prediction is bit for bit the server's.HolonPhysicsTest.TheWindPushesADynamicAvatar: standing 2 s, 0.005 m in 9 m/s (the walker holds), 13.6 m in 75 m/s.world_rules_test,TheScenesWindIsTheRooms: a document'swind:becomes the room rules' wind and round-trips through the room's rules section; a negative speed is refused. (A room without a wind writes nowind.*keys, so its section is unchanged; the existing room-rules tests pass.)cvcgl_ariadne_realize, "O14: one key turns everything": with a generated world, awaternode (own wind 3 m/s toward −90°), acloud_skyandforest_trees, the scene's wind (9 m/s toward 30°) drives all three. The water's wind is 30°,sky.drift_azis 120 andforest.lean_diris 30, whilewater.wind_dirstays −90. Settingwind.dirto 120 turns them to 120 / 210 / 120 on the next tick. Clearingwind.speedputs each back on its own wind.AriadneComponents.ShippedComponentsLoadClean:wind_controls.ariloads, binds, and is in INDEX.ari.Regression: 1413 tests matching Physics, Ocean, Algo, Ariadne, Holon, Avatar, WorldRules, Room, cvcgl_ariadne, cvcgl_ocean, Lsys, Forest, Wind and Conference all pass; the skips are the usual ones. No existing golden hash moved: a world without a wind saves and hashes as before.
terrain_lab frames: one key, before and after
Offscreen
arigl snapshotat 1280×720, same camera (held by anon_tickorbit). "After" is the same document with--set wind.dir=120and nothing else. I looked at each one:preset: island,edge: shore, looking along the wind): at 30° the water in front of the island is in its lee, glassy, with the sun's glint unbroken. At 120° the lee has moved off to the side, and the same water is rough, the glint broken into ripples.I haven't recorded an MP4:
arigl snapshot --mp4(#1310) isn't on master yet. The live turn (one key changing everything on the next tick) is covered bycvcgl_ariadne_realize.Frame rate and WebGL2
No new sampler, texture or shader change: the water reads the scene wind through its existing uniforms. The cloud drift and the trees' lean are CPU work per frame (one gust frame, and one lean per tree in place of the old sway). The physics reads the wind once per body per step, and once per pushed vehicle per navigator tick.
terrain_lab with the wind on vs off, same binaries:
onis the document as shipped,offis--set wind.speed=(cleared, so the water and clouds use their own winds and there's no wind field). Each figure is ms per frame, (720-frame run − 120-frame run) / 600,arigl snapshot1280×720, three rounds in ABBA order on a machine shared with other agents' builds:On − off is −2.4, −7.4 and −6.5 ms: the wind costs nothing this machine can see. The "faster" side is noise: the deck's clouds sit in different places once they drift at a different speed.
Not done, not checked
steeringWind()(weather_node.cpp, weather: storm cells, storm decks and dark bases; live cloud base/top and darkness (O18) #1312, still open) doesn't read the scene wind yet, and weather: rain, with streaks, shafts, wet ground, rings and fog (O19) #1315's rain slant readssteeringWind(). Once weather: storm cells, storm decks and dark bases; live cloud base/top and darkness (O18) #1312 lands, it should takescene_wind_set()where it reads its own steering wind.feat/water-drift, stacked on this one).TheSceneWindIsTheSameOnEveryPlatform) were measured on Windows MSVC only; Linux, macOS and wasm are for CI to confirm.