Skip to content

feat(profiling): add optional Tracy profiling and Day 1 baseline - #849

Merged
otto-link merged 7 commits into
ottolink-dev:devfrom
barrulus:perf/tracy-node-baseline
Oct 20, 2026
Merged

otto-link merged 7 commits into
ottolink-dev:devfrom
barrulus:perf/tracy-node-baseline

Conversation

@barrulus

@barrulus barrulus commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

Hesiod currently has no committed node-profiling workflow, and the first measurements for #783 live in a local build directory and an issue comment. This adds optional Tracy instrumentation, repeatable profiling tools, and a permanent Day 1 baseline.

  • HESIOD_ENABLE_TRACY=OFF by default: normal builds require no Tracy package, link no client, and compile out zone/metadata expressions. Enabled builds add graph/node/export CPU zones, on-demand capture and Linux process-RSS plots.
  • Viewer and thumbnail CPU zones expose display-array conversion, water preparation, texture/image conversion and renderer handoff. A separate profile_viewer desktop workload exercises selection, parameter changes and camera movement; renderer handoff remains separate from background work and frame timing.
  • HighMap shared conversion and dispatch zones now separate gather/callback/scatter and tile storage access, with finer HydraulicBlur and ExportAsset stages. Hesiod enables the dependency hooks through its existing profiling switch; a numerical dispatch workload covers all four modes.
  • QTerrainRenderer CPU zones cover background mesh work, uploads and render passes. Bounded per-context OpenGL timestamp pools expose GPU paint spans as separate Tracy numeric plots, with no GPU busy-wait. The GUI workload covers 2D/3D rendering and multiple viewer lifetimes.
  • Deterministic pilot and bounded overnight runners preserve failures, verify completed target zones, isolate inputs/exports, snapshot binaries/tools/fixtures, support manual launch/resume, and report coverage explicitly.
  • The profiling guide describes build/capture use, interpretation, limitations and how to add finer stage zones. CI checks the Python harness and archived checksums.

Day 1 baseline

Day 1 baseline is the reference summary, with the original CSV. The archive preserves the original CSV byte-for-byte, JSON summaries, all 2,459 per-attempt result records, 275 fixtures and their frozen runner, dependency/binary hashes, the original profiling patch, earlier pilot, and failure logs/debugger evidence.

The original sweep measured 273 of 276 active nodes successfully (2,457 successful measurements). It identifies scaling and memory candidates including ExportAsset, HydraulicBlur, RecastCliffDirectional and texture quilting, and records the FlowStream/HydraulicVpipes failures plus the missing BlenderBridge fixture. The raw .tracy captures remain local; their hashes are archived, but the approximately 55 MB of binary captures are not added to Git.

These are historical measurements from the recorded dirty October 8 source/binary, not measurements of this rebased branch. Results describe one synthetic configuration per node; RAM is whole-process peak RSS, not per-node allocations or VRAM. The normal/instrumented pilot builds use different optimisation configurations and must not be treated as a controlled overhead comparison.

Rebase and scope

Rebased onto upstream dev at 3fe850c4, preserving upstream's existing headless-export fix. The current catalogue has 259 active types: 251 generated fixtures and eight explicit needs_fixture entries. Missing documentation now produces a coverage gap instead of aborting preparation. These counts describe fixture generation, not runtime success.

The HighMap stage instrumentation is a separate dependency change in HighMap #537, pinned here at 6751a406cc846f92eb9dd157feb6e007d8224f1f. That dependency PR needs review alongside this draft. Renderer instrumentation is likewise reviewed in QTerrainRenderer #43, pinned at 867a874f708a2f7ea8cff10bcf2bf513686c17a3.

This does not fix the two historical algorithm failures, add GPU kernel/VRAM instrumentation, rerun the full baseline against current upstream, or close #783.

Validation

  • 15 profiling harness tests passed, including timeout/RSS cleanup, resume, fixture typing, missing-documentation coverage and failure exclusion.

  • Full normal application/test build and graph-editor CTest passed; normal executable has no tracy:: symbols.

  • Standalone disabled/enabled hook tests passed; disabled metadata is not evaluated and an enabled disconnected client shuts down cleanly.

  • Baseline checksums, all 284 frozen fixture/runner hashes, and byte equality of the original CSV verified. All timing and memory summary values independently reconciled with the original per-attempt records.

  • Full Tracy-enabled application/test build and graph-editor CTest passed. Eight focused 64² capture cases passed: GaussianPulse, Abs, HeightmapToNormalMap, DistanceTransform, CoherentNoise (NVIDIA OpenCL), ExportHeightmap, Receive and TextureTransform. This is a smoke check, not a new overnight baseline.

  • Viewer follow-up: Tracy-enabled application/workload build and graph-editor CTest passed; all five changed/new translation units compiled with hooks disabled and no Tracy symbols. A real XCB/OpenGL capture on Mesa Intel(R) Graphics (ARL) verified heightmap/water/colour/thumbnail zones, three queued parameter updates and no data rebuilds during camera motion. This diagnostic capture is separate from Day 1 and does not exercise every instrumented layer type.

  • HighMap follow-up: full instrumented build and both graph-editor/dispatch CTests passed; seven modified implementation files compile with hooks disabled and no Tracy symbols. Five bounded 64² node captures plus regular/optimized unmasked export variants passed, with expected stage events verified. A separate capture verified all four dispatch modes and worker events. No new baseline or overhead claims.

  • Renderer follow-up: full instrumented build and both CTests passed. Standalone default-off renderer library has no Tracy/GPU-profiler symbols. The real Intel/Mesa XCB capture contains 113 CPU paint spans and 110 GPU samples across three context lifetimes, with no OpenGL errors or skipped samples. Camera motion produced 21 paints without mesh/data rebuilds. A disconnected run passed with zero GPU samples/pending queries. GPU samples are collection-time numeric plots, not native GPU timeline zones or presentation timings. NVIDIA, forced context loss, reconnect and pool saturation were not exercised.

Related to #783.

@barrulus
barrulus marked this pull request as ready for review October 19, 2026 15:07
@otto-link
otto-link merged commit e649ee8 into ottolink-dev:dev Oct 20, 2026
6 checks passed
@otto-link

Copy link
Copy Markdown
Member

thanks, very nice feature

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.

2 participants