Skip to content

Storm wind gaps: sea keyframes off the frame, fronts where each tree, wave and body is, headless steering (F4/F6) - #1551

Merged
transfix merged 3 commits into
masterfrom
feat/storm-wind-gaps
Nov 26, 2026
Merged

transfix merged 3 commits into
masterfrom
feat/storm-wind-gaps

Conversation

@transfix

Copy link
Copy Markdown
Owner

Closes the storm wind's open gaps (ocean roadmap §9 F4/F6, the "Not done" list after O20 part 2, #1345). One of the parallel "fill every water-physics gap" pieces.

What changed

1. The sea's keyframes off the frame. While a scene has storms, the water's sea steps once a clock period and a keyframe's field goes in after the next period's start. Until now the keyframe's build (three cascades' h0 for the new wind, plus fetch maps when the wind turned: 100-250 ms) ran on the frame's thread. Now the keyframe is still decided on the clock (the lag is cheap), but its build is a sliced job on the app's scheduler (cvc/core/sliced_task.h, the way cloud_sky builds its decks): on the background pool natively, a few h0 rows a frame in single-threaded wasm (cvc::ocean::h0_builder, bit for bit build_h0).

  • The runtime adopts the job once it is done. If the clock reaches the keyframe's tick first, it finishes the job there and then: in WaterRuntime::tick(), or in the scene's world's sync through the new SceneColliders::settle, before the step that needs the field.
  • So the keyframe, its field and the tick it goes in at are the same as before, to the bit. A keyframe that comes with any other change is built at once, as before. Scenes without storms are unchanged.
  • The node's sea_threading prop picks the mode: automatic (the default), cooperative, threaded, or frame (the old in-frame build).
  • Found on the way: a clocked keyframe's drawn sea showed the new h0 for up to 0.5 s before its crossfade began, then snapped back to the old one. sync_sea now draws the old keyframe until t0, as the physics field does.

2. The front where each tree, wave and body is. The front's shape now lives in one header-only function, cvc::algo::add_gust_front. weather::gust_front sums it over the cells and gives the same bits as before. scene_fronts returns the storm air's strongest four cells at a given clock time.

  • Water: the sea's spectrum is still one for the whole water, grown from the centre's lagged wind. Under a front, the ripples and the roughness (the cascade that already follows the gusts) scale by |U + front here| / |U + front at the centre|, clamped to [0, 4]. The drawn water evaluates this per vertex from ten vec4 uniforms (cvc/gl/StormFrontGLSL.h). The physics sea reads the same cells through sea_forcing::fronts, from the air the scene's world puts in SceneColliders::air at every sync and air rebuild. The fronts are not in the sea's digest; the world's state hash already includes the air's.
  • Trees: the generated world's trees lean and sway per vertex in U + front at that vertex. The pines take each tree's own wind through repose_forest_in_wind's new local parameter.
  • Light bodies (F6) already read the front at each body; the new test checks that.

3. Headless runs steer as drawn ones do. WeatherFriction, which runs in every scene's world with a weather node, now logs steer and rate events.

  • At each sync it reads the steering as the drawn node does. A change goes in as an event at the start of the next clock period, at the first step past it (switch_steering, beside switch_gust), so every frame rate logs the same event.
  • The drawn node reads these events, and logs them itself only when there is no physics world. A replica following a relay's weather (OW5q) logs none.

4. Front gustiness. Decided, not built: decision D14 in the roadmap's §15. A front raises the mean wind, and the gusts multiply it, so they already swing harder in a front. A scene-wide gustiness that moves with the front would rebuild the water's field every frame, even with the keyframes off the frame.

Measured (Windows, MSVC Release)

  • Off the frame (AriadneSceneWeather.TheSeasKeyframesAreBuiltOffTheFrameAndGoInAtTheSameTick): the storm lake at 60 frames a second of wall time, with the scheduler pumped each frame, built off the frame and with sea_threading: frame.
    • Both runs agree on the state hash at all 540 frames and on the crate's position.
    • Quietest run: off the frame, 193 ms of building and 0.0 ms of it on the frame's thread; follow() median 5.8 ms, slowest 18.9 ms. In the frame: 149 ms, all on the frame's thread; median 5.0 ms, slowest 98.2 ms, with two frames over 50 ms (the keyframes).
    • On runs while other agents' builds held the machine at 100 % CPU, frames spread to hundreds of ms both ways; the hashes still agreed.
  • Fronts where each thing is (AFrontAtOneEndOfTheWorldReachesTheWavesAndBodiesThereFirst): a storm walking east over a 2 km world, time-lapsed ×15.
    • The physics sea's ripples rise at the west end at 4.13 s, with the east end's ratio still 1.00, and at the east end at 16.47 s.
    • A light ball passes 9 m/s at the west end at 4.87 s and at the east end at 17.73 s.
  • Drawn (cvcgl_ariadne_realize): a storm 500 m west of a generated world. Evaluated from the shaders' uniforms, the trees' wind is 18.56 m/s at x -140 and 9.00 at x 140. The ripples' ratio is 2.062 at x -140, the same as the physics sea's, and 1.000 at x 140. No shader errors.
  • Steering (cvcgl_ariadne_physics, test_steering_headless_and_drawn): the wind turned 2.2 s in. The drawn and headless runs both log one event, steer t=2.5 speed=9.7536815583389895 az=180, and their state hashes match. Before, the headless run logged nothing.
  • No pinned hash moved: physics_field_test's golden hashes, the replay trace, WorldWeather's golden hash, and all 149 ariadne_scene_world_test tests (two of them new). The storm tests compare runs with each other, not pinned values, and all still agree.

Local runs: ocean_spectrum/sea/wind/shore/ewave, world_weather, world_cloud, physics_field, physics_replay (with the trace), ariadne_scene_world_test (full), holon_test, holon_sync_test, cvcgl_ariadne_physics, cvcgl_ariadne_realize, cvcgl_ocean_fft/band, cvcgl_wake, cvcgl_ewave. clang-cl /Zs is clean on every touched source.

Not run: Linux, macOS, wasm and the browser (CI covers the native ones). No arigl frame-time measurement: arigl reports no per-frame time, and the machine was loaded.

Files outside the weather/water code

  • inc/cvc/ariadne/scene_generated_world.h: two members added to SceneColliders (settle, air). The terrain generator session was told on the bus.
  • src/cvcGL/ariadne/world_nodes.cpp: only the foliage wind (shader, tick_foliage_wind, a scene tick) and data_world_set_air.
  • scene_quality.cpp and tick_wake are untouched. pycvc set_wind is left to the bindings session.

… is, headless steering

The ocean roadmap's F4/F6 "Not done" list after the storm wind (#1345).

- Sea keyframes off the frame: while a scene has storms, a keyframe's h0
  and fetch maps (100-250 ms) are a sliced job on the app's scheduler
  (SceneWaterSeaClock::begin, cvc::ocean::h0_builder), adopted once done
  or finished at the tick its field goes in after (WaterRuntime::tick,
  SceneColliders::settle from the world's sync). The same keyframe,
  field and tick, to the bit; `sea_threading: frame` keeps the old way.
  The drawn sea now shows the old keyframe until a clocked keyframe's
  crossfade starts (it popped to the new h0 up to 0.5 s early).
- Fronts where each thing is: one front shape (cvc::algo::add_gust_front)
  for the weather, the sea and the shaders. The water's ripples and
  roughness scale by the wind there over the centre's (drawn per vertex
  through StormFrontGLSL's uniforms; the physics sea through
  sea_forcing::fronts and SceneColliders::air); the generated world's
  trees lean per vertex and the pines per tree.
- Headless steering: WeatherFriction logs steer and rate events on the
  clock, drawn or headless (switch_steering); the drawn node reads them.
- Front gustiness: decided, not built (roadmap section 15, D14).

No pinned hash moved. New tests: OceanH0.ABuilderStepByStepIsBuildH0,
OceanSea.AGustFrontRaisesTheRipplesWhereItBlows,
AriadneSceneWeather.TheSeasKeyframesAreBuiltOffTheFrameAndGoInAtTheSameTick,
AriadneSceneWeather.AFrontAtOneEndOfTheWorldReachesTheWavesAndBodiesThereFirst,
cvcgl_ariadne_physics test_steering_headless_and_drawn, and the realize
test's "the storms' fronts where each tree and wave is".
The roadmap's F4 "Not done" list conflicted with #1548's pycvc line: kept
this branch's struck-through items and took master's pycvc wording.
@transfix
transfix enabled auto-merge (squash) November 26, 2026 19:45
transfix added a commit that referenced this pull request Nov 26, 2026
…edAndSleep (#1557)

The packed-crates wake test took 747 s of physics_field_test's 1200 s
ctest budget on #1548's package-linux libcvc-debug run, and timed out at
1200 s on #1551's first run of that lane, on a runner about 2.9x slower
(the sibling wake test took 784 s there against 271 s on #1548). With
the lane's --repeat until-pass:3 that one timeout cost the job an hour.

A small file, appended to the directory's TEST_INCLUDE_FILES after the
discovered tests' own include, sets that one test's TIMEOUT to 3600 (the
cap ci.yml gives the heavy Debug lanes). The other physics_field tests
keep 1200. ctest skips the line if the test is filtered out or renamed.

Checked with ctest 3.31: --show-only=json-v1 over the real discovered
physics_field_test file lists the test at 3600 and its 51 neighbours at
1200; a name with no test behind it raises no error.
@transfix
transfix merged commit 327a791 into master Nov 26, 2026
30 checks passed
@transfix
transfix deleted the feat/storm-wind-gaps branch November 26, 2026 22:07
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