Repository navigation
feat(d3d11_service): per-stage weave timing under DXR_WEAVE_GPU_TIMING (2D-under-the-lens P0) - #1824
Merged
Merged
Conversation
…G (2D-under-the-lens P0) Extends the DXR_WEAVE_GPU_TIMING=1 diagnostic on the present-owner path (comp_d3d11_service_weave_submit) so every stage is attributed: - GPU (6 non-blocking timestamps per submit, 8-slot ring): #1058 output clear, v6 crop copy (+lift) / batch SBS scratch clear+blit, the DP weave (set_overlay_2d + process_atlas), the post-weave overlay fallback blit, and the wish-publish epilogue, plus the total; - CPU wall time: render_mutex wait, immediate_ctx_mutex wait, input and overlay keyed-mutex acquires, and the whole synchronous submit; - counts: accepted / refused submits, by path (v6 zero-copy / v6 crop / batch / legacy) and by 2D-overlay route (DP / fallback / none, and declared-unchanged). One WARN line per client every 5 s ("weave timing [...]"), replacing the old "weave GPU time" line. Off by default. Adds the knob to the env-var census in docs/roadmap/control-panel-performance-settings.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
P0 of the "near-zero-cost 2D under the lens" plan: instrumentation only. It extends the existing
DXR_WEAVE_GPU_TIMING=1diagnostic on the D3D11 service present-owner path (comp_d3d11_service_weave_submit, the path that weaves the browser's whole-page 2D overlay) so every stage has its own cost. Later phases are judged against these numbers.The knob stays off by default. The env var is read once (cached static). It writes one WARN line per client every 5 s, never per frame. With the knob off, the added cost is a handful of
os_monotonic_get_ns()reads per submit and nothing else: no queries are created and nothing is logged.Companion plug-in PR (same knob, DP-internal split): DisplayXR/displayxr-leia-plugin#302.
What is measured
GPU. Six timestamps per submit, on the service immediate context, inside one disjoint query. Read back non-blocking from an 8-slot ring, frames late. A slot still in flight when the ring wraps is dropped, never waited on.
clear1058input_copyCopySubresourceRegion(+ lift writes)sbs_clear_blitweaveset_overlay_2d+process_atlas, i.e. the DP's weave including SR's in-weave 2D compose and the DP's alpha gatefallback_blitepiloguetotalThere is no woven-output copy inside the service. The caller copies the output back in its own process, so
epilogueis the only service-side GPU work after the weave. v6 zero-copy and legacy single-rect frames have no ingest stage.CPU wall time, per accepted submit:
submitweave_submit, from entry to return, including the fence signal +Flushrender_mutexrender_mutex_fair_lockwaitctx_muteximmediate_ctx_mutexwaitin_acquireIDXGIKeyedMutex::AcquireSync(0, 4)ov_acquireAcquireSync(0, 4), averaged over submits that carried an overlayCounts over the window:
refused: submits that returned false afterrender_mutexwas taken;v6zc/v6crop/batch/legacy;dp(composited inside the weave),fallback(runtime post-weave blit),none;unchanged: submits whose overlay the caller declared unchanged (v14).How to read the log line
The old
weave GPU time [...]line is replaced by:n=afterGPUis the number of query sets read back in the window. It can be lower thansubmitswhen sets were dropped in flight or discarded asdisjoint. Each GPU stage's(n=)is its own denominator.weaveis the number the later phases attack. Read it next to the plug-in'sLeia D3D11 DP timingline, which splits it into SR weave vs alpha gate.submitminus (render_mutex+ctx_mutex+in_acquire+ov_acquire) is the CPU time the service spends issuing work. A largerender_mutexpoints at contention with the render thread, not at the weave.overlay(dp=…)vsfallback=says which route the page's 2D layer actually took. Whenfallback>0,fallback_blitis the cost the DP route avoids.The existing unconditional
#625 weave timing/#625 weave splitlines are left as they are.Docs
Adds the missing
DXR_WEAVE_GPU_TIMINGrow to the census indocs/roadmap/control-panel-performance-settings.md(Diagnostics / observers). The knob was not listed there before.Testing
scripts\build_windows.bat build: green (=== ALL DONE ===; incremental rebuild after formatting also green, no new warnings).DXR_WEAVE_GPU_TIMING=1in the service's environment: stop the service and relaunch it from a.batthat sets the env, throughexplorer.exeso it stays at medium integrity. A client-side env var does not reach it.🤖 Generated with Claude Code