public readonly struct UiDiagnosticsWhat a debug overlay may read about a document, without being able to disturb it.
Remarks
An aggregator rather than an instrument. Every number here but the dirty regions was already published by the pass that computes it, one property at a time across the UiDocument partials — see this assembly's README § Diagnostics, where the shape and the three constraints behind it are argued. What was missing was one place to read them from, which is the whole of what doc 13's UI-debug overlay was blocked on.
⚠ It reads; it never samples. The reactive graph is single-threaded by contract, so a diagnostics surface that could touch a signal to answer a question would be able to perturb the document it is describing. Every member here is a field read or a walk of results that already exist, and none of them marks anything dirty.
⚠ And nothing on the read path allocates. A UI-debug overlay is on for minutes at a time in the frame it is diagnosing, so a surface that allocated per read would be measuring itself — which is the trap #597 is about one level up, where three boxed IReadOnlyList<T> enumerators cost a settled frame 504 bytes. This is a struct over the document, the regions come back as a span, and there is no list or string anywhere in it.
Fields and properties (15)
public const bool RecordsRegionsWhether this build records dirty regions at all.
public int LayoutNodesHow many nodes the layout tree holds.
public int StylesResolvedHow many elements the last pass cascaded.
public int StylesAppliedHow many had their layout style rebuilt from the result.
public int ContainerScopesEnteredHow many container scopes the last pass entered.
public int StyleCompactionsHow many times the style store has been compacted.
public int SettlingPassesHow many passes the last frame needed before nothing moved.
public bool SettledWhether the document has come to rest.
public bool LastPassWasColdWhether the last restyle had to resolve every element rather than a few.
public ReadOnlySpan<UiDirtyRegion> DirtyRegionsWhat invalidated the document before the pass Update most recently ran.
public int RegionsRecordedHow many invalidations were recorded, including any the ring had no room for.
public int DrawListsBuiltHow many times a surface's draw list has been rebuilt from the tree.
public int DrawListsChangedHow many of those rebuilds produced drawing that differs from the frame before.
public int BrokenBindingsHow many times a binding in this document has thrown and been suspended.
public string? LastBrokenBindingWhere the last such binding was written, and what it threw. Null until one does.
Methods (3)
public UiDiagnostics(UiDocument document)What a debug overlay may read about a document, without being able to disturb it.
public bool TryDescribe(float x, float y, out UiElement? element, out UiBoxModel box)The element at a point, and its four boxes.
public UiBoxModel BoxOf(UiElement element)An element's four boxes.
Used by (6)
- BrokenBindingTestsVixen.Ui.Tests
- DiagnosticsPanelVixen.Ui.Controls
- DiagnosticsPanelTestsVixen.Ui.Controls.Tests
- DiagnosticsTestsVixen.Ui.Tests
- IdleFrameWorkTestsVixen.Ui.Tests
- UiDocumentVixen.Ui