Repository navigation
water: the wake drawn at every adaptive-quality tier - #1550
Merged
Merged
Conversation
Adaptive quality's last two tiers (3 low, 4 least) turned the bodies' waves off. The gallery's browser build runs terrain_lab at about 14 fps against its 30 fps target, so it sits at tier 4 and a floating crate or the launch never left a ring there. Native builds stay at tiers 0-1 and always drew them. Tiers 3 and 4 now keep the wake on its smallest window, 128 cells of 0.5 m (64 m round the camera's target), as tiers 1 and 2 have it, and step it in 1/30 s substeps in place of 1/60 (WaterQuality::wake_substep, passed to ewave_params::substep; the window restarts when the tier changes it, as it does for its size). A frame then runs half the substeps. The window's shortest waves (0.7 m) keep omega dt under 0.35, where ewave.h puts a substep's phi within 1 % of the exact, and open water keeps its exact dispersion; the rings a crate makes look the same. The other savings at those tiers are unchanged. Measured with the water node's own section times (water.profile 2, which waits for the GPU at each section's end), terrain_lab at 1280x720 with the camera 14 m behind crate_b on the lake, frames 60-240, two runs each (Windows, MSVC Release, Intel Arc iGPU): - tier 2 (128 cells, 1/60 s): sources 1.89-1.93 ms, step 2.40-2.48 ms, upload 0.86-0.87 ms, in all 5.3 ms a frame; - tier 4 (128 cells, 1/30 s): sources 1.95-2.00 ms, step 1.56-1.64 ms, upload 0.83-0.84 ms, in all 4.4-4.6 ms. The step falls by a third (each step has fixed passes besides its substeps), the wake by about 0.8 ms of a frame of about 47 ms. cvcgl_ewave's timing agrees: a walled 256^2 window steps a 1/30 s frame in 0.57-0.88 ms of GPU at 1/60 s (71 passes), 0.29-0.44 ms at 1/30 s (36). The browser was not measured; its frames of about 70 ms run about four substeps at 1/60 s against two at 1/30 s. The sources, the CPU's immersion of each body, are the largest part left, and no tier changes them. Test: WaterQuality.TheWakeIsDrawnAtEveryTier (fails on the old table); EachTierDrawsNoMoreThanTheOneAbove no longer expects tier 4 without a wake, and checks each tier's substep is no shorter than the one above. cvcgl_wake and cvcgl_ariadne_realize pass. Docs: scene_quality.h's tier table, ARIADNE.md's adaptive quality, OCEAN-AND-WEATHER-ROADMAP.md 10.10's table and the measurement.
transfix
added a commit
that referenced
this pull request
Nov 27, 2026
…cally, same bits) (#1562) PhysicsFieldWake.PackedBodiesStayBoundedAndSleep took 581-747 s of its 1200 s ctest budget on package-linux / libcvc-debug and timed out three times on a slow runner (#1550's). It took 269 s there on #1344; #1532 made every wake test 2.5-2.8x slower in Debug (the ring 3.0 to 8.2 s, the golden 2.4 to 5.8 s, this one 269 to 702 s). The test itself is as #1344 wrote it. Profiled locally (Debug, MSVC /Od): the calm run with a wake is 62% of the test, and 87% of that is the wake's wave step: deepen, the motion below the top that #1532 added (2 forward and ~3 inverse 64 x 64 FFTs a state a wave step), 51%; the ewave step 21%; sum, which now adds the depths, 9%. In an unoptimized build std::vector's operator[] is a call per element, and these passes made ~400k of them a state a wave step. And once every crate sleeps (~90 s into the calm run) the wake made depths for ~30 s more, while its waves died away, with nothing reading them. - fluid_wake::ready_depths: the depths are made at the first read after a wave step (in field_set::apply before the field workers' reads, when an awake body is in the wake's field, and in field_set::water_at), not at every wave step. The same inputs in the same order: the same bits. motion() reads only the layers that were made. - The wake's per-cell passes (deepen, derive, sum, the wave step's dh/dt) and fft_plan::run_2d's gather and scatter index through raw pointers: the same operations in the same order. On their own, 28% off a 20 s calm run with a wake in Debug (37.5 s to 27.1 s, three interleaved runs, the same peaks to 17 digits). - The test is two: the calm half keeps its name (and #1557's 3600 s), the swell's half is PackedBodiesStayBoundedInASwell, so each has its own ctest budget and ctest runs them side by side. What the comments claimed is now asserted too: every crate sleeps on calm water (9 of 9) and none in the swell (0 and 0). "Without one they sleep within 40" is 3 (2.55 s). Measured locally, Debug, the old and new builds run side by side on one loaded box: 283.6 s before; after, the calm half 72.5 s and the swell's 87.8 s (160.3 s). Every value the test prints is the same to the digit. No pinned hash moves: the wake golden 0xc72e26b4ef0f764a, the shore golden 0x89789ba92fbd1853, the swell and ocean scenes.
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.
Floating bodies leave their rings at every adaptive-quality tier. Until now the last two tiers turned the wake off, and the gallery's browser build sits on the last of them.
Why
wake = false, so a crate or the launch on the lake never left a ring in the browser.What changes
src/cvc/ariadne/scene_quality.cpp).WaterQuality::wake_substepis passed toewave_params::substepbystart_wake(src/cvcGL/ariadne/water_node.cpp);ewave.hputs a substep's φ within 1 % of the exact, and open water keeps its exact dispersion.Measured
terrain_lab at 1280×720 with the camera 14 m behind crate_b on the lake. The figures are the water node's own section times (
water.profile2, which waits for the GPU at each section's end), averaged over frames 60–240, two runs each (Windows, MSVC Release, Intel Arc iGPU):cvcgl_ewave's own timing agrees: a walled 256² window steps a 1/30 s frame in 0.57–0.88 ms of GPU at 1/60 s (71 passes) and 0.29–0.44 ms at 1/30 s (36 passes).Not measured:
The largest part left is the sources: the CPU's immersion of each body in the sea at the frame's time. No tier changes them.
Tests
WaterQuality.TheWakeIsDrawnAtEveryTier, which checks the wake, its window size and its substep at each tier. It fails on the old table.EachTierDrawsNoMoreThanTheOneAboveno longer expects tier 4 without a wake, and checks each tier's substep is no shorter than the tier above's.ariadne_scene_quality_test: 12 pass;cvcgl_wakeandcvcgl_ariadne_realize: pass;cvcgl_ewave: ran for its timings.Docs
scene_quality.h's tier table.OCEAN-AND-WEATHER-ROADMAP.md§10.10: the table, the reason, and the measurement.