Managed view hierarchy: object names are an opt-in of CaptureSceneGraph; nodes labelled by their most telling component; names_omitted marker #305
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #305"
general
weight: 0.35
krassx
What
Object names become an opt-in of the managed view hierarchy, so that the capture is as cheap and as steady as it can be. The Unity-only launch option
CaptureSceneGraph(com.bugsee.option.unity.capture-scene-graph) keeps its key; its enumSceneGraphCapturenow encodes two independent choices, positions and object names:| Value | Object names | Positions (
bounds+sceneblock) | Was ||---|---|---|---|
|
None| no | no |None||
Structure| no | no | new ||
StructureWithNames| yes | no |NamesOnly||
Scene(default when omitted) | no | yes | new ||
SceneWithNames| yes | yes |All(the old default) |Three behavior changes, all in the CHANGELOG under Unreleased:
1. Default: an app that does not set the option used to send every GameObject name and scene name; it now reads and sends none.
SceneWithNamesrestores the old default.2.
class_nameat every level: a node is labelled by the component that says best what the object is, not by its first component (a mesh wasMeshFilter, nowMeshRenderer; a button wasImage, nowButton; an object with your script reads the script's name).3. New root key: a reply made without names carries
"names_omitted": trueon its root node.Related PRs (none has to merge first; the key is optional and an unknown key is ignored):
names_omitted: bugsee/specs#90Why names are off by default
Performance and stability first:
Object.nameis the one per-object read of the walk that allocates (a string per object, on the main thread, garbage for the collector). Without it a capture costs about 2 µs (20 %) less per node, reads 17 to 19 % more nodes in its 250 ms window and leaves nothing to collect (numbers below). Embedders who accept the overhead opt in through the launch option. Privacy is a side benefit: a name is free text a game can fill at run time, and by default none is collected. The docs, the CHANGELOG, DESIGN.md and the XML docs say it in this order.Scene names stay withheld at the default level (decided): a
Scenenode carries its name only at theWithNameslevels.How it works
Runtime/Internal/ManagedViewHierarchy.cs):Object.nameandScene.nameare read only when the level sends names. A source-text test pins these as the only two name reads, and forbidsScene.path,ToStringof a Unity object, interpolation and concatenation with one.ManagedViewLabelinRuntime/WrapperPolicy/ManagedViewTypeCache.cs): each component type has a rank, worked out once per type and kept in the type cache beside the type's name: a script from outside theUnityEngine,Unity,TMProandCinemachinenamespaces (the app's and third-party assets') > a uGUI control (derived fromSelectable) > any other component > aMeshFilteror a missing script.class_nameis the component of the highest rank, the first in component order among equals; no component givesRectTransform/GameObjectas before. In the walk this replacesif (first == null) first = name;byif (rank > bestRank) { bestRank = rank; best = name; }: no engine call, no allocation, noGetTypeadded (a test pins the loop's text and its singleGetType/GetComponents). Types are recognised by full name, so the pure code needs no reference to the engine or to uGUI and is unit-tested with stand-in types.ManagedViewTreeJson.NamesOmittedKey):"names_omitted":trueright after the root'sclass_name/bounds, written by the writer when it writes no names, so also in the tree-only fallback, in a tree cut by its deadline, with or without positions and beside thesceneblock. Never written with names.EmitNamesbesideEmitBounds; the engine writes names (and positions) only when both the snapshot and the capture's level say so.class_name(a type name) and its bounds._and-ignored; anything else isNoneand logged.SendsNames(level)/SendsPositions(level).The marker: name and shape
names_omitted, boolean,trueonly, root only. A flag written only when true is how this tree already states something exceptional about a capture (truncated,best_effort), so absence keeps meaning "nothing to say" and every older document stays valid; "omitted" is the spec's word for data a wrapper is set not to send (bounds,scene). The capture level itself is not written: it is this wrapper's vocabulary, and a consumer needs the one fact. It sits on the root, not inscene, because a reply without positions has noscene. Without it a missingoptions.nameis ambiguous (names off, a node under a secure rectangle, an older SDK).Viewer check for the
class_namechangebugsee/bugsee-web-viewermainusesclass_nameas the row title and breadcrumb (nodeDisplayName), as the "Class" row of the properties sheet, for theTOPITEMsentinel of native roots, and in the list of class fields for symbolication. No icon, filter or type label is keyed on a particular class name, and nothing mentionsMeshFilter,MeshRendererorUnityPlayeroutside test fixtures. Nothing breaks; rows simply read better.Migration (beta)
NamesOnlyandAllare removed: code that names them stops compiling and has to choose (StructureWithNames/SceneWithNamesare what they sent)."NamesOnly"and"All"are still read, as exactly what they sent before. Neither can send more than the same string did. (Whether they should log a deprecation note is on hold.)All(with names) and is nowScene(without).StructureandStructureWithNames: less than before, never more.class_namehas to be adjusted.CHANGELOG (item 6, and #301)
Open PR #301 already adds the missing heading: its whole diff is
## [7.0.0-beta.2] - 2026-11-27and a blank line directly under## [Unreleased], which is right, because everything under Unreleased onmainis in the tagv7.0.0-beta.2(checked: main's Unreleased body equals the tag's beta.2 section).I did not add a second heading somewhere else. This branch contains the same two lines at the same place, and puts under Unreleased only what is not in the tag: this PR's entries and the one entry #304 added ("The managed view hierarchy walk does less for every object it reads", moved up verbatim, since it sat in what becomes the released section). From the beta.2 heading down the file is byte-identical to
mainwith #301 applied (asserted by the script that built it, and checked again by a reviewer againstorigin/mainand the tag).What to do: merge #301 first. After that, when this PR is retargeted and rebased, the heading lines are already there; check
grep -c '^## \[7.0.0-beta.2\]' CHANGELOG.mdgives 1 (both sides insert at the same spot, so git may report a conflict or, depending on alignment, duplicate the heading). If #304 merges before this, its bullet lands under the beta.2 heading onmainand has to move up; this branch already has it in the right place.Verification
dotnet test Tests~/WrapperPolicy: 2698 passed.sh Tools~/scripts/compile-check.sh: 11/11.capture-scene-graphstays Unity-only;OptionPlatformGatepasses the value through unchanged.BUGSEE_NO_SYMBOL_UPLOAD=1, device lock held, test app uninstalled afterwards. Release builds for everything timed.-
vhscene(self-checking, release), with the new label rule and the marker, at every level: default 56 PASS / 0 FAIL,scenewithnames55/0,structure21/0,structurewithnames20/0,none2/0, oldall55/0 (read as SceneWithNames), oldnamesonly20/0 (read as StructureWithNames),bogus2/0 (refused, no tree). It checks, among the rest: a cube isMeshRendererwith componentsMeshFilter,MeshRenderer, the object with the scenario's script is labelled by it, a camera isCamera, an object without components isRectTransform; the root carriesnames_omittedexactly when the level sends no names, once; no fixture name is anywhere in a reply without names.-
vhsecurescale(release): PASS at the default level and atscenewithnames.-
vhon a development build (functional run only, no timing claim), the scenario that could not be run before:xctrace list devices), so no iOS device run; the iOS bridge is not touched and CI's iOS bridge tests pass. The last commit (theCinemachinenamespace in the once-per-type rank, tests and wording) was made after the device runs; it does not touch the per-node path.Measured (HONOR WOD-LX1, release, 21 warm captures per cell, medians)
Harness:
vhscale/vhscaleunslicedas in #304's evidence, synthetic scenes of 1000 and 5000 objects, 3 launches per cell, launches alternated, 8 captures per N per launch with the first dropped. Tree cost per node = (main ms - scene main ms) / nodes.Names off against names on (same APK, level given at launch):
| Mode | N |
Scene(default, no names) |SceneWithNames| Difference ||---|---|---|---|---|
| Unsliced, tree µs/node | 1000 | 8.01 (7.69..9.71) | 10.34 (9.17..12.11) | -2.33 µs, -22.5 % |
| Unsliced, tree µs/node | 5000 | 7.62 (7.29..8.42) | 9.51 (8.73..11.65) | -1.89 µs, -19.9 % |
| Sliced, nodes in 250 ms | 1000 | 1186 (992..1439) | 1013 (825..1252) | +17.1 % |
| Sliced, nodes in 250 ms | 5000 | 1323 (1106..1500) | 1114 (785..1402) | +18.8 % |
The new label rule against the old one (two APKs, default level, launches alternated; "old" is this branch one commit before the rule):
| Mode | N | New rule | Old rule (first component) | Difference |
|---|---|---|---|---|
| Unsliced, tree µs/node | 1000 | 8.17 (7.83..8.95) | 8.31 (7.83..9.01) | -0.15 µs, -1.8 % |
| Unsliced, tree µs/node | 5000 | 7.93 (7.54..8.59) | 7.96 (7.56..8.74) | -0.03 µs, -0.4 % |
| Sliced round 1, tree µs/node | 1000 | 11.59 (10.73..13.08) | 11.24 (10.56..14.55) | +0.35 µs, +3.1 % |
| Sliced round 1, tree µs/node | 5000 | 9.92 (9.48..14.24) | 9.48 (8.75..10.96) | +0.44 µs, +4.6 % |
| Sliced round 2, tree µs/node | 1000 | 11.23 (10.51..11.89) | 11.15 (10.44..13.51) | +0.08 µs, +0.7 % |
| Sliced round 2, tree µs/node | 5000 | 9.87 (9.51..14.20) | 10.15 (9.37..12.99) | -0.28 µs, -2.7 % |
| Sliced, nodes in 250 ms (rounds 1, 2) | 1000 | 1111, 1169 | 1147, 1136 | -3.1 %, +2.9 % |
| Sliced, nodes in 250 ms (rounds 1, 2) | 5000 | 1239, 1238 | 1260, 1261 | -1.7 %, -1.8 % |
Reading: in the unsliced walk, the cleanest per-node number, the new rule is not slower. In the sliced walk the first round was 3 to 5 % slower and the second, run with the launch order reversed, was within 1 % at N=1000 and 2.7 % faster at N=5000; every difference is smaller than the p10..p90 spread of its own cell, and two measurements of identical walker code in different sessions (the default-level row of the first table against the "old rule" row here) differ by as much (8.01 against 8.31, 7.62 against 7.96). So: no cost that this measurement can tell from its noise, which is what one integer comparison per component should give. The rule is kept. (A stricter bound would need many more launches; say so if you want them.)
Review
Fresh Opus reviewers, no shared context, the diff and the task text only. First part of the PR: three rounds, the third clean. This second part: three rounds on the SDK diff (the first found four should-fix items: a marker test that never cut its tree, Cinemachine 2 ranked as an app script, two stale sentences; the third was clean) and four rounds on the spec and viewer diffs (the fourth clean).
Open questions
1. Old strings
"All"/"NamesOnly": a deprecation note and a removal date (on hold, per the coordinator).2. The label rule's namespace list (
UnityEngine,Unity,TMPro,Cinemachinecount as Unity's): a project that puts its own code underUnity.gets it ranked as a package's, and a third-party asset's script ranks like the app's. Both are documented; say if another root should be on the list.3. An iOS device run when the iPhone XS is back.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf