Skip to content

WIP: restore retained renderer performance endpoint - #70

Closed
tritao wants to merge 5 commits into
stack/render-geometry-resource-reusefrom
integration/retained-performance-wip
Closed

WIP: restore retained renderer performance endpoint#70
tritao wants to merge 5 commits into
stack/render-geometry-resource-reusefrom
integration/retained-performance-wip

Conversation

@tritao

@tritao tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

This is the single coarse integration branch above #69 used to recover the saved wip/retained-renderer-performance endpoint without replaying its obsolete lower-layer architecture. It is intentionally draft and not yet a review-ready performance PR.

Restored so far:

  • indexed triangle geometry-source reuse
  • indexed line geometry-source reuse
  • compact reused picking-range generation
  • resource-owned picking ranges shared by repeated commands

Next coarse groups:

  • visual instancing and batching
  • instanced picking and selection
  • incremental mutation/dependency tracking
  • asynchronous picking readback
  • remaining CPU construction optimizations and workloads

The repaired stack remains the architectural source of truth; behavior is adapted from wip/retained-renderer-performance rather than replayed verbatim.

Local validation: full build and 37/37 tests pass.

@tritao tritao changed the title integration/retained performance wip WIP: restore retained renderer performance endpoint Aug 21, 2026
@tritao

tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Restored the visual-instancing group on the repaired backend/resource interfaces:

  • visual instancing foundation with adjacent plan-operation batching
  • indexed and unindexed triangle instances
  • per-instance unlit diffuse RGBA
  • sorted transparent instances
  • shared textured instances
  • opaque vertex-colored instances
  • sorted lit-transparent instances

The old combined submission/picking foundation was not replayed wholesale because it also carried obsolete manager, asynchronous-picking, geometry-identity, and statistics APIs. Those remain isolated for later groups.

50k feature-rich workload, core profile, 5 samples:

Metric Before With visual instancing
Steady-state CPU render 87.71 ms 10.62 ms
Backend command execution 81.99 ms 5.02 ms
Forced-rebuild CPU render 238.66 ms 153.52 ms
Draw-list construction 147.03 ms 137.83 ms

Full local suite: 37/37 passed.

@tritao

tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Interaction batching has now been restored on top of the visual-instancing work:

  • instanced whole-object picking
  • instanced primitive/subelement picking
  • instanced depth-stack picking
  • instanced whole-object selection overlays
  • instanced primitive/subelement selection overlays
  • bounded primitive-selection amplification (large meshes fall back to exact range draws)

The ports use the repaired retained-geometry interfaces and do not restore the discarded submission-cache/statistics API. I intentionally left out the old interleaved-selection regrouping because it could reorder alpha-blended overlays; adjacent compatible targets still batch without changing overlay order.

Local validation after a complete rebuild: 37/37 tests passed, including GL/EGL, picking, benchmark smoke, and lifecycle stress.

Current 500-object dense-pick measurements on the local hardware (5 samples, ms):

renderer visual CPU median cold pick refresh pick pick query median
LegacyGL compatibility 1.921 1.838 0.789 0.830
DrawList compatibility 1.447 10.315 7.264 0.578
DrawList core 1.521 10.493 11.541 0.633

The query itself is competitive; retained pick-buffer construction/refresh remains the next clear interaction bottleneck. The PR branch is now at 31b34b2a4.

@tritao

tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Added resource-aware isolated geometry regeneration in 5576002be. The update replays into frame-arena scratch state, validates topology/layout/ranges, requires unique resource ownership, atomically redirects the stable resource handle, and advances a separate DrawList content revision so retained GPU buffers refresh without changing frame identity. Failed, shared, structural, and root-level-incomplete replay cases fall back to a full rebuild. Pixel output matches a forced full rebuild; the complete local suite passes 37/37.

@tritao

tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Added dependency-indexing layer in 6a4536e48 (rendering: index retained command dependencies). Incremental transform/material/geometry lookup now starts from commands indexed under the changed state node’s parent branch instead of scanning every retained command path. Candidate commands still receive the existing full occurrence-path and sibling-order checks, preserving shared-node semantics and root-level fallback. Temporary geometry replay commands are deliberately excluded from the persistent index.\n\nLocal validation: complete 33-test core configuration passed serially, including GL/EGL tests, benchmark smoke tests, workload viewer/parity, and lifecycle stress.

@tritao

tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Continued the incremental-update sequence with three clean layers:\n\n- e524ab7ee fixes the first SoBase::getAuditors() snapshot (required by conservative occurrence checks).\n- 0452b86c8 retains a bounded/de-duplicated notification queue and batches homogeneous translation or diffuse-color edits. Indexed candidates are sorted/uniqued without an O(total commands) bitmap scan; mixed or ambiguous edits rebuild.\n- 6f195f776 patches stable one-child switch visibility (ALL/NONE/0) while preserving visibility authored below the switch. Structural multi-child switching still rebuilds.\n\nThe complete 33-test configuration passed serially after the implementation; focused switch coverage also passed after adding authored-invisible command restoration.

@tritao

tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Added 160dc202c (rendering: regenerate shared geometry resources in place). Homogeneous coordinate edits now seed lookup through the dependency index, require a single stable geometry handle, expand to the complete owner set of that handle, replay one representative path, validate layout and element ranges transactionally, and update every owner revision. This also handles duplicate-parent occurrences that SoPath notifications cannot distinguish by index. Pixel output matches a forced rebuild; all 33 configured tests pass.

@tritao

tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Added mutation/scaling coverage in 5b2cc6647 (benchmarks: measure retained mutation scaling). The shared workload API now drives deterministic 1/10/100 translation and diffuse-material edit batches plus a single geometry edit in both compatibility and core DrawList contexts. Each sample asserts the exact incremental command count and zero rebuilds. JSON schema 7 adds incremental_update, mutation median/p95, and incremental_command_updates; --mutation-only N provides focused large-scene runs, while smoke/default modes include their standard-sized curves.\n\nLocal checks: GL benchmark smoke passed; a 500-command, 10-sample focused run completed with no unavailable cases or rebuilds.

@tritao

tritao commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Added multi-resource geometry regeneration and assembly mutation curves:\n\n- b5e2de6dd groups affected commands by stable geometry handle, replays one representative per handle, validates every layout/range before changing live resources, then advances all handle owners as one transaction. Any replay or validation failure rewinds the complete batch.\n- 5e8d60435 mutates one definition in expanded, shared-source, and shared-recipe assembly scenes, asserts exact face+edge update counts and zero rebuilds, and checks final pixels against a forced rebuild outside the timed interval.\n\nA 500-occurrence/10-sample hardware run passed. One shared definition updated 50 commands; core medians were about 4.1 ms for per-occurrence shared sources and 1.8 ms for shared-recipe resources. All 33 configured tests pass.

@tritao
tritao force-pushed the integration/retained-performance-wip branch from c38716e to 0adece8 Compare August 22, 2026 01:29
@tritao
tritao force-pushed the stack/render-geometry-resource-reuse branch from c8ce046 to 410096e Compare August 22, 2026 01:29
@tritao

tritao commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by the cleaned performance stack in #71, #72, #73, #74, and #75. The reconstructed stack preserves the exact implementation tree while separating submission batching, incremental updates, CPU reuse, interaction performance, and workload coverage into reviewable layers.

@tritao tritao closed this Aug 22, 2026
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